/* Один файл стилей на витрину и админку. Только системные шрифты — Google Fonts из Китая не грузятся. */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #151826;
  --muted: #646b80;
  --line: #e3e6ee;
  --accent: #5b4cf0;
  --accent-2: #8a5cf6;
  --accent-soft: #ecebfe;
  --ok: #14945c;
  --ok-soft: #e3f6ec;
  --warn: #b26a00;
  --warn-soft: #fff3dc;
  --bad: #d23b3b;
  --bad-soft: #fde8e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 8px 24px rgba(20, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #171a23;
    --surface-2: #1f2330;
    --text: #e9ebf2;
    --muted: #9aa1b5;
    --line: #2a2f3d;
    --accent: #8b7dff;
    --accent-2: #b08cff;
    --accent-soft: #252244;
    --ok: #3cc98a;
    --ok-soft: #13301f;
    --warn: #f0a93a;
    --warn-soft: #33270f;
    --bad: #ff6b6b;
    --bad-soft: #3a1818;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* --- Шапка и подвал витрины --- */
.demo-bar { background: var(--warn-soft); color: var(--warn); font-size: 14px; text-align: center; padding: 6px 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-size: 16px; }
.top nav { display: flex; gap: 20px; margin-left: auto; font-size: 15px; }
.top nav a { color: var(--muted); }
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: grid; gap: 12px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot nav a { color: var(--muted); }

/* --- Главная --- */
.hero { padding: 48px 0 24px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 8px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.step b { display: block; margin-bottom: 2px; }
.step .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.group { margin-top: 36px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 10px; color: var(--text); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease; position: relative; }
a.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.card.off { opacity: .6; }
.card .row { display: flex; align-items: center; gap: 12px; }
.mono-tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 20px; flex: none; }
.t-claude { background: linear-gradient(135deg, #d97757, #b5533a); }
.t-chatgpt { background: linear-gradient(135deg, #19a37f, #0e7a5f); }
.t-telegram { background: linear-gradient(135deg, #37aee2, #1e88c7); }
.t-other { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.card .title { font-weight: 650; }
.card .sub { color: var(--muted); font-size: 14px; }
.card .price { font-size: 22px; font-weight: 750; margin-top: auto; }
.badge { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); }
.faq { display: grid; gap: 10px; margin-top: 16px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* --- Товар и формы --- */
.crumbs { font-size: 14px; color: var(--muted); margin: 24px 0 12px; }
.product { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.buy { position: sticky; top: 76px; }
.buy .price { font-size: 32px; font-weight: 800; margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--muted); }
.check input { margin-top: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650;
  border: 0; border-radius: 11px; padding: 12px 18px; cursor: pointer; background: var(--accent); color: #fff; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 9px; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 15px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.howto ol { padding-left: 20px; margin: 0; }
.howto li { margin-bottom: 6px; }

/* --- Заказ --- */
.order-box { max-width: 640px; margin: 32px auto 0; }
.timeline { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 0; }
.timeline li { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 18px; position: relative; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface);
  flex: none; display: grid; place-items: center; font-size: 14px; z-index: 1; }
.timeline li.done { color: var(--text); }
.timeline li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.timeline li.active { color: var(--text); font-weight: 600; }
.timeline li.active .dot { border-color: var(--accent); }
.timeline li.active .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }
.code-box { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px dashed var(--accent);
  border-radius: 12px; padding: 14px; font-family: var(--mono); font-size: 18px; word-break: break-all; }
.code-box span { flex: 1; }
.pay-mock { max-width: 460px; margin: 40px auto 0; }
.pay-mock .sum { font-size: 34px; font-weight: 800; margin: 6px 0 18px; }
.pay-methods { display: flex; gap: 8px; margin-bottom: 18px; }
.pay-methods span { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 1.5em; }

/* --- Админка --- */
.adm { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 4px 8px 16px; }
.side a.nav { display: block; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-size: 15px; }
.side a.nav:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.side a.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side form { margin-top: auto; padding: 8px; }
.main { padding: 24px 28px 60px; min-width: 0; }
.main h1 { font-size: 26px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 24px; font-weight: 750; margin-top: 4px; }
.kpi .note { font-size: 13px; color: var(--muted); margin-top: 2px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td.wrap-text { white-space: normal; min-width: 180px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.ok, .pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.processing, .pill.paid, .pill.awaiting_payment { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.failed, .pill.manual_review { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: minmax(100px, 38%) 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.row-edit summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.row-edit .form-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; white-space: normal; }
.row-edit .form-grid .span2 { grid-column: span 2; }
.row-edit .form-grid .span4 { grid-column: span 4; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.brand-grid a { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; }
.brand-grid a:hover { border-color: var(--accent); text-decoration: none; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type=text] { padding: 6px 8px; font-size: 13px; width: 140px; }
.login { max-width: 380px; margin: 12vh auto 0; }

@media (max-width: 860px) {
  .product, .cols { grid-template-columns: 1fr; }
  .buy { position: static; }
  .steps { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .adm { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .side .logo { width: 100%; padding-bottom: 6px; }
  .side form { margin: 0 0 0 auto; padding: 0; }
  .main { padding: 18px 16px 48px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .row-edit .form-grid { grid-template-columns: 1fr 1fr; }
  .row-edit .form-grid .span4 { grid-column: span 2; }
}
