/* BotPay · сине-голубая тема, тёмная и светлая */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080B11;
  --bg-2: #0C1119;
  --surface: #111824;
  --surface-2: #172031;
  --surface-3: #1F2B40;
  --line: rgba(150, 185, 235, .10);
  --line-2: rgba(150, 185, 235, .19);
  --text: #EDF2FA;
  --muted: #8B98B0;
  --faint: #5E6B83;
  --accent: #3CC8FF;
  --accent-2: #2F6BFF;
  --accent-rgb: 60, 200, 255;
  --link: #6FD6FF;
  --on-accent: #04111F;
  --grad: linear-gradient(115deg, #46D2FF 0%, #2F6BFF 100%);
  --hero-card: linear-gradient(150deg, #2056E8 0%, #1638B8 100%);
  --glow: radial-gradient(60% 55% at 85% 0%, rgba(47, 107, 255, .28), transparent 70%), radial-gradient(45% 45% at 0% 20%, rgba(60, 200, 255, .12), transparent 70%);
  --ok: #34D399;
  --ok-bg: rgba(52, 211, 153, .13);
  --bad: #F87171;
  --bad-bg: rgba(248, 113, 113, .13);
  --wait: #FBBF24;
  --wait-bg: rgba(251, 191, 36, .13);
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
  /* старые имена — для совместимости со страницами */
  --ink: var(--text);
  --ink-2: var(--surface-2);
  --paper: var(--bg);
  --amber: var(--accent);
  --amber-deep: var(--accent-2);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --display: "Inter Tight", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F6FB;
  --bg-2: #EAF0F8;
  --surface: #FFFFFF;
  --surface-2: #F1F5FB;
  --surface-3: #E3EAF5;
  --line: rgba(18, 38, 74, .09);
  --line-2: rgba(18, 38, 74, .17);
  --text: #0D1626;
  --muted: #5B6880;
  --faint: #8792A6;
  --accent: #0E9BE8;
  --accent-2: #2457F5;
  --accent-rgb: 14, 155, 232;
  --link: #1667D9;
  --on-accent: #fff;
  --grad: linear-gradient(115deg, #1AB2F5 0%, #2457F5 100%);
  --glow: radial-gradient(60% 55% at 85% 0%, rgba(36, 87, 245, .12), transparent 70%), radial-gradient(45% 45% at 0% 20%, rgba(26, 178, 245, .10), transparent 70%);
  --ok: #0F9D6B;
  --ok-bg: rgba(15, 157, 107, .11);
  --bad: #D93B3B;
  --bad-bg: rgba(217, 59, 59, .09);
  --wait: #B7791F;
  --wait-bg: rgba(214, 158, 46, .14);
  --shadow: 0 20px 50px -28px rgba(20, 40, 80, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; transition: background-color .25s, color .25s; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(var(--accent-rgb), .3); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 50; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
h2 { font-size: 1.15rem; margin-bottom: 16px; }
h3 { font-size: 1rem; margin-bottom: 8px; }
p { margin: 0 0 12px; max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--ok); }
.minus { color: var(--bad); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Знак BotPay: плашка с облачком чата ---------- */
.coin { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--grad); position: relative; box-shadow: 0 6px 18px -8px rgba(var(--accent-rgb), .9); }
.coin::after { content: ""; position: absolute; inset: 7px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H11l-4.6 3.8c-.6.5-1.4.1-1.4-.7V16A2.5 2.5 0 0 1 4 13.5z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H11l-4.6 3.8c-.6.5-1.4.1-1.4-.7V16A2.5 2.5 0 0 1 4 13.5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }

/* ---------- Переключатель темы ---------- */
.theme-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; flex: none; }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }

/* ---------- Каркас кабинета ---------- */
.frame { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: var(--glow), var(--bg); background-attachment: fixed; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.area-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.area-switch a { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 8px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .88rem; transition: background .15s, color .15s; }
.area-switch a:hover { color: var(--text); }
.area-switch a[aria-current="page"] { background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 16px -8px rgba(var(--accent-rgb), .8); }
.area-switch .ico { width: 17px; height: 17px; }
.side-label { font-size: .78rem; color: var(--faint); padding: 0 12px; margin: 4px 0 -8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { position: relative; color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 12px; display: flex; gap: 12px; align-items: center; font-weight: 500; transition: background .15s, color .15s; }
.side-nav a span:first-of-type { flex: 1; }
.side-nav a:hover { background: var(--surface); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.side-nav a[aria-current="page"] .ico { color: var(--accent); }
.count { background: var(--grad); color: var(--on-accent); border-radius: 999px; font-size: .74rem; font-weight: 700; padding: 0 8px; line-height: 20px; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); font-weight: 800; font-family: var(--display); flex: none; }
.who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.who b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.main { padding: 34px 44px 72px; max-width: 1220px; width: 100%; min-width: 0; }
.page-title { overflow-wrap: anywhere; word-break: break-word; font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 26px; font-weight: 800; letter-spacing: -.025em; }
.section { margin-top: 32px; }
.page-title + .section, .page-title + .flash + .section, .main > .section:first-child { margin-top: 0; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.row-between h2 { margin: 0; }

/* ---------- Баланс: главный акцент кабинета ---------- */
.purse { position: relative; overflow: hidden; background: var(--hero-card, var(--grad)); color: #fff; border-radius: var(--radius-l); padding: 30px 34px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; align-items: end; box-shadow: var(--shadow); }
:root[data-theme="light"] .purse { background: linear-gradient(150deg, #2563F5 0%, #1840C9 100%); }
.purse::after { content: ""; position: absolute; right: -60px; top: -90px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 65%); pointer-events: none; }
.purse .label { color: rgba(255, 255, 255, .72); font-size: .9rem; margin-bottom: 6px; }
.purse .big { font-family: var(--display); font-weight: 800; font-size: clamp(2.1rem, 4.6vw, 3.2rem); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.purse .mid { font-family: var(--display); font-weight: 700; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.purse .hint { color: rgba(255, 255, 255, .66); font-size: .8rem; margin-top: 6px; }
.purse .btn { margin-top: 18px; background: #fff; color: #1638B8; box-shadow: none; }
.purse .btn:hover { color: #1638B8; filter: none; background: #EAF1FF; }
.purse .btn-ghost, .purse .btn-ghost-dark { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.purse .btn-ghost:hover, .purse .btn-ghost-dark:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.purse a:not(.btn) { color: #fff; }
.purse .check { color: rgba(255, 255, 255, .8); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; }
.stats .v { font-family: var(--display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stats .k { color: var(--muted); font-size: .85rem; margin-top: 2px; }

/* ---------- Быстрые действия и график ---------- */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; transition: border-color .15s, transform .15s var(--ease), background .15s; }
.quick a:hover { color: var(--text); border-color: rgba(var(--accent-rgb), .5); background: var(--surface-2); transform: translateY(-2px); }
.quick .q-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(var(--accent-rgb), .12); color: var(--accent); flex: none; }
.quick small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 24px 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chart-head h2 { margin: 0; }
.chart-total { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 6px; height: 170px; padding-bottom: 24px; position: relative; }
.chart::before { content: ""; position: absolute; left: 0; right: 0; bottom: 24px; border-top: 1px solid var(--line); }
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar i { display: block; width: 100%; max-width: 30px; min-height: 3px; border-radius: 7px 7px 3px 3px; background: var(--grad); opacity: .85; transition: opacity .15s, transform .15s; transform-origin: bottom; }
.bar.zero i { background: var(--surface-3); opacity: 1; }
.bar:hover i, .bar:focus-visible i { opacity: 1; }
.bar small { position: absolute; bottom: -22px; font-size: .7rem; color: var(--faint); white-space: nowrap; }
.bar .tip { position: absolute; bottom: calc(var(--h) + 8px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: .76rem; font-weight: 600; padding: 5px 8px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.bar:hover .tip, .bar:focus-visible .tip { opacity: 1; }
.bar:nth-child(-n+3) .tip { left: 0; transform: none; }
.bar:nth-last-child(-n+3) .tip { left: auto; right: 0; transform: none; }
.chart-card { overflow: hidden; }

/* ---------- Панели, таблицы ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px 26px; }
.panel + .panel { margin-top: 16px; }
.grid-2 > .panel + .panel { margin-top: 0; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; background: var(--surface-2); }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.empty { padding: 34px 26px; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: 4px; }

.badge { display: inline-block; font-size: .78rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }
.badge-mute { background: var(--surface-3); color: var(--muted); }

/* ---------- Формы ---------- */
form.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 520px; }
form.stack.wide { max-width: none; }
.panel form.stack { max-width: none; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-width: 0; }
.field label, fieldset.field legend { font-weight: 600; font-size: .9rem; }
.field .help { color: var(--muted); font-size: .84rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=tel], input[type=date], select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; min-height: 48px; width: 100%; max-width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s, background .15s;
}
:root[data-theme="light"] input:not([type]), :root[data-theme="light"] input[type=text], :root[data-theme="light"] input[type=email], :root[data-theme="light"] input[type=password], :root[data-theme="light"] input[type=number], :root[data-theme="light"] input[type=url], :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: #fff; }
input::placeholder, textarea::placeholder { color: var(--faint); text-transform: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238B98B0' stroke-width='1.6'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 14px center !important; padding-right: 38px; }
input[type=file] { font: inherit; color: var(--muted); }
input[type=file]::file-selector-button { font: 600 .88rem var(--body); color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; margin-right: 12px; cursor: pointer; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18); }
input:disabled { opacity: .6; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent-2); flex: none; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline .field { flex: 1 1 160px; }
.inline > .btn { flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 .95rem var(--body); border: 0; border-radius: 12px; padding: 12px 22px; cursor: pointer; text-decoration: none; min-height: 48px; line-height: 1.2; text-align: center; background: var(--grad); color: var(--on-accent); box-shadow: 0 10px 24px -12px rgba(var(--accent-rgb), .9); transition: transform .15s var(--ease), box-shadow .15s, filter .15s; }
.btn:hover { color: var(--on-accent); filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(var(--accent-rgb), 1); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost, .btn-ghost-dark { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover, .btn-ghost-dark:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.btn-ink { background: var(--surface-3); color: var(--text); box-shadow: none; }
.btn-ink:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .45); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .65); }
.btn-s { padding: 7px 14px; font-size: .84rem; border-radius: 10px; min-height: 36px; }
.btn-s .ico { width: 16px; height: 16px; }
.btn-l { padding: 15px 28px; font-size: 1.02rem; border-radius: 14px; min-height: 54px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline-form { display: inline-flex; vertical-align: middle; }
td.acts { text-align: right; }
.table-wrap td form.inline input[type=text] { min-width: 160px; flex: 1; }
td.acts > form, td.acts > a { display: inline-flex; margin: 3px 0 3px 6px; vertical-align: middle; }

.flash { padding: 13px 16px 13px 44px; border-radius: 14px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); position: relative; animation: drop-in .35s var(--ease); }
.flash::before { content: ""; position: absolute; left: 16px; top: 17px; width: 13px; height: 13px; border-radius: 50%; }
.flash-ok { border-color: rgba(52, 211, 153, .35); }
.flash-ok::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.flash-err { border-color: rgba(248, 113, 113, .4); }
.flash-err::before { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.flash-info { border-color: rgba(var(--accent-rgb), .35); }
.flash-info::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.callout, p.callout, p.flash { max-width: none; }
.callout { background: var(--wait-bg); border: 1px solid rgba(251, 191, 36, .3); border-radius: var(--radius-m); padding: 15px 20px; margin-bottom: 14px; }
.callout p:last-child { margin-bottom: 0; }

.bot-list { display: grid; gap: 10px; }
.bot-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 22px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s var(--ease), background .15s; }
.bot-row:hover { color: inherit; border-color: rgba(var(--accent-rgb), .45); background: var(--surface-2); transform: translateY(-1px); }
div.bot-row:hover { transform: none; }
.bot-row-main { text-decoration: none; color: inherit; min-width: 0; display: grid; gap: 4px; }
.bot-row-main:hover { color: inherit; }
.bot-row-side { display: grid; justify-items: end; gap: 10px; }
.bot-row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .bot-row { grid-template-columns: minmax(0, 1fr); } .bot-row-side { justify-items: start; } .bot-row-acts { justify-content: flex-start; } }
.bot-row .t { font-weight: 600; }
.bot-row .s { color: var(--muted); font-size: .88rem; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2.eq { align-items: stretch; }
.grid-2 > *, .product-grid > * { margin-top: 0 !important; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: flex-end; padding: 12px 4px; font-size: .9rem; color: var(--muted); }
.step-code { font-family: var(--display); font-size: 1.5rem; letter-spacing: .08em; background: var(--bg-2); padding: 8px 14px; border-radius: var(--radius-s); display: inline-block; }

/* ---------- Оплата подключения ---------- */
.pay-box { grid-template-columns: 1.2fr 1fr; align-items: center; }
.pay-actions { display: grid; gap: 10px; justify-items: start; }
.pay-box-calm .big { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.autorenew { margin-top: 14px; }

/* ---------- Вкладки бота ---------- */
.tabs { display: flex; gap: 4px; margin: 4px 0 26px; overflow-x: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: max-content; max-width: 100%; }
.tabs a { padding: 9px 18px; text-decoration: none; color: var(--muted); border-radius: 10px; white-space: nowrap; font-weight: 600; font-size: .92rem; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--on-accent); background: var(--grad); }

/* ---------- Товары ---------- */
.thumb { width: 48px; height: 48px; border-radius: var(--radius-s); object-fit: cover; display: block; background: var(--surface-2); }
.thumb-empty { border: 1px dashed var(--line-2); }
.thumb-l { width: 96px; height: 96px; }
.photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { margin-bottom: 6px; padding: 0; }
fieldset[disabled] .check { opacity: .7; }
.product-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.preview { position: sticky; top: 24px; }
.tg-card { background: #0E1621; border-radius: 16px; padding: 10px; }
.tg-photo { aspect-ratio: 4 / 3; border-radius: 12px 12px 0 0; background: #24303F center / cover no-repeat; }
.tg-body { background: #182533; color: #E9EEF4; border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; font-size: .93rem; overflow-wrap: anywhere; }
.tg-photo:not([hidden]) + .tg-body { border-radius: 0 0 12px 12px; }
.tg-quote { border-left: 3px solid #6AB3F3; padding: 2px 8px; background: rgba(106, 179, 243, .1); border-radius: 4px; max-height: 9em; overflow: hidden; }
.items-list { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; padding: 4px 2px; }
.items-list .mono { overflow-wrap: anywhere; }
.kb-preview { background: #0E1621; border-radius: 14px; padding: 8px; display: grid; gap: 6px; max-width: 420px; margin-bottom: 10px; }
.kb-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.kb-row span { background: #2B3A4C; color: #fff; border-radius: 9px; padding: 9px 6px; text-align: center; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-btns { margin: 14px 0 0; max-width: 560px; }
.main-btns h3 { margin-bottom: 10px; }
.kb-row .kb-own { background: #1D3D6B; box-shadow: inset 0 0 0 1px rgba(60, 200, 255, .5); }
.menu-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--line); }
.menu-table tr:last-child { border-bottom: 0; }
.menu-table td { border: 0; }
.menu-table td:nth-child(3) { grid-column: 1 / -1; padding-top: 0; }
.menu-table .actions { gap: 6px; }
.var-table input { padding: 7px 10px; min-width: 0; }
.var-table td:first-child input { min-width: 120px; }
.num-input { max-width: 110px; }
.row-off td { opacity: .5; }
.var-add { padding: 16px; border-top: 1px solid var(--line); }
.var-table + .var-add { margin-top: 0; }
.var-acts { flex-wrap: nowrap; }
.cat-grid { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
@media (max-width: 1200px) { .cat-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .var-table thead { display: none; }
  .var-table, .var-table tbody { display: block; width: 100%; min-width: 0; }
  .var-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .var-table td { padding: 0; border: 0; text-align: left; }
  .var-table td[data-l]::before { content: attr(data-l); display: block; font-size: .74rem; color: var(--faint); margin-bottom: 4px; }
  .var-table td:first-child, .var-table td:last-child, .var-table td.small { grid-column: 1 / -1; }
  .var-table td:first-child input { min-width: 0; width: 100%; }
  .var-table .num-input { max-width: none; width: 100%; }
  .var-acts { flex-wrap: wrap; }
}
.items-list .badge { margin-left: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: grid; gap: 2px; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; height: 100%; background: var(--bg-2); transition: border-color .15s, background .15s; }
.seg small { color: var(--muted); font-size: .82rem; }
.seg input:checked + span { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); box-shadow: inset 0 0 0 1px var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .seg { grid-template-columns: 1fr; } }

/* ---------- Вход и регистрация ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-form { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-form .auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.auth-card h1 { font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-card form.stack { max-width: none; margin-top: 26px; }
.auth-card .btn { width: 100%; }
.auth-art { position: relative; overflow: hidden; margin: 14px; border-radius: 28px; background: var(--hero-card, var(--grad)); color: #fff; padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; justify-content: space-between; }
:root[data-theme="light"] .auth-art { background: linear-gradient(150deg, #2563F5 0%, #1840C9 100%); }
.auth-art::before { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 65%); }
.auth-art h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; max-width: 14ch; margin: 0; position: relative; }
.auth-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; position: relative; }
.auth-art li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .88); }
.auth-art li .ico { margin-top: 2px; background: rgba(255, 255, 255, .16); border-radius: 8px; padding: 4px; width: 26px; height: 26px; }
.auth-note { font-size: .8rem; color: rgba(255, 255, 255, .6); position: relative; }

/* Простая страница по центру (установка) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--glow), var(--bg); }
.auth .auth-card { padding: 0; margin: 0; }
.auth .brand { margin-bottom: 26px; }
.auth .panel { margin-top: 16px; }

/* ---------- Главная BotPay ---------- */
.lp { background: var(--glow), var(--bg); background-repeat: no-repeat; }
.lp-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.lp-top-in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.lp-nav { display: flex; gap: 4px; flex: 1; }
.lp-nav a { position: relative; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem; padding: 8px 12px; border-radius: 10px; transition: color .15s, background .15s; }
.lp-nav a:hover { color: var(--text); background: var(--surface); }
.lp-top .actions { gap: 8px; margin-left: auto; flex-wrap: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding: 76px 0 96px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 22px; }
.hero-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 800; line-height: .98; letter-spacing: -.045em; margin-bottom: 24px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .05em; }
.hero p.lead { font-size: 1.14rem; color: var(--muted); margin-bottom: 32px; max-width: 46ch; }
.hero-facts { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts b { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.hero-facts span { color: var(--muted); font-size: .86rem; }

/* Живая демонстрация кабинета */
.demo { position: relative; overflow: hidden; background: var(--hero-card); border-radius: 30px; padding: 26px; color: #fff; box-shadow: 0 40px 90px -40px rgba(30, 70, 220, .8); }
:root[data-theme="light"] .demo { background: linear-gradient(150deg, #2563F5 0%, #1840C9 100%); }
.demo::before { content: ""; position: absolute; right: -40px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 65%); pointer-events: none; }
.demo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; position: relative; }
.demo-head b { font-family: var(--display); font-size: 1.15rem; font-weight: 800; }
.demo-pill { font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); }
.demo-wallet { position: relative; background: #fff; color: #0D1626; border-radius: 22px; padding: 22px; }
.demo-wallet small { color: #5B6880; }
.demo-wallet .t { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 16px; }
.demo-sum { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 4.2vw, 3.1rem); letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 4px 0 16px; }
.demo-sum.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.04); color: #1667D9; } }
.demo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-btns span { background: #EAF1FF; color: #1D4ED8; font-size: .86rem; font-weight: 600; padding: 8px 14px; border-radius: 10px; }
.demo-feed { position: relative; display: grid; gap: 8px; margin-top: 14px; min-height: 152px; }
.demo-item { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .93); color: #0D1626; border-radius: 16px; padding: 12px 14px; margin-left: 24px; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .5); }
.demo-item.in { animation: slide-in .55s var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
.demo-item .ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #E3EDFF; color: #1D4ED8; flex: none; }
.demo-item div { flex: 1; min-width: 0; line-height: 1.25; }
.demo-item div small { color: #5B6880; font-size: .78rem; display: block; }
.demo-item div b { font-size: .92rem; }
.demo-item em { font-style: normal; font-weight: 800; color: #0F9D6B; white-space: nowrap; }
.demo-note { position: relative; font-size: .76rem; color: rgba(255, 255, 255, .62); margin: 14px 0 0; }

.lp-section { padding: 88px 0; border-top: 1px solid var(--line); }
.lp-section > .wrap > h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin-bottom: 14px; max-width: 18ch; }
.lp-sub { color: var(--muted); font-size: 1.08rem; max-width: 56ch; margin-bottom: 40px; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.bento > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 26px; display: flex; flex-direction: column; gap: 8px; transition: border-color .2s; }
.bento > div:hover { border-color: var(--line-2); }
.bento h3 { font-size: 1.15rem; font-weight: 700; margin: 6px 0 0; }
.bento p { color: var(--muted); margin: 0; }
.b-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.bento .w3 { grid-column: span 3; }
.bento .w2 { grid-column: span 2; }
.bento .w4 { grid-column: span 4; }
.b-mock { margin-top: auto; padding-top: 16px; display: grid; gap: 8px; }
.b-key { font-family: ui-monospace, Menlo, monospace; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.b-key span { color: var(--ok); font-family: var(--body); font-weight: 600; font-size: .82rem; }
.b-terms { display: flex; gap: 8px; flex-wrap: wrap; }
.b-terms span { padding: 9px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: .9rem; }
.b-terms span.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.b-terms s { color: var(--faint); margin-left: 6px; }

.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.lp-steps li { counter-increment: s; position: relative; padding: 26px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); }
.lp-steps li::before { content: counter(s); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: var(--on-accent); font-family: var(--display); font-weight: 800; margin-bottom: 18px; }
.lp-steps h3 { font-size: 1.1rem; }
.lp-steps p { color: var(--muted); margin: 0; }

.price { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
.price-main { background: var(--hero-card); color: #fff; border-radius: 28px; padding: 32px; position: relative; overflow: hidden; }
:root[data-theme="light"] .price-main { background: linear-gradient(150deg, #2563F5 0%, #1840C9 100%); }
.price-main::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 65%); }
.price-main .v { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 3.8rem); letter-spacing: -.045em; line-height: 1; margin: 14px 0 6px; }
.price-main p { color: rgba(255, 255, 255, .75); }
.price-main .btn { background: #fff; color: #1638B8; box-shadow: none; margin-top: 12px; position: relative; z-index: 1; }
.price-main .btn:hover { color: #1638B8; background: #EAF1FF; }
.price-list { display: grid; gap: 12px; }
.price-list > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.price-list b { font-family: var(--display); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.price-list span { color: var(--muted); }
.price-list strong { display: block; color: var(--text); font-weight: 600; }

.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.5rem; line-height: 1; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); padding-bottom: 20px; margin: 0; }

.cta-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 40px; border-radius: 30px; background: var(--hero-card); color: #fff; }
:root[data-theme="light"] .cta-band { background: linear-gradient(150deg, #2563F5 0%, #1840C9 100%); }
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
.cta-band p { color: rgba(255, 255, 255, .75); margin: 0; }
.cta-band .btn { background: #fff; color: #1638B8; box-shadow: none; }
.cta-band .btn:hover { color: #1638B8; background: #EAF1FF; }
.promo-shop { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 28px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.promo-shop p { margin: 0; color: var(--muted); }
.promo-shop strong { color: var(--text); }

.land-foot { padding: 34px 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.land-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.land-foot a { color: var(--muted); }
.land-foot a:hover { color: var(--text); }
.land-body { background: var(--bg); color: var(--text); padding: 64px 0; }
.land-body h2 { margin-top: 28px; }

/* Поле выбора файла по-русски (кнопка рисуется скриптом) */
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick .file-name { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.file-pick:focus-within .btn { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .35); }

/* Юридические страницы */
.legal { padding-top: 48px; padding-bottom: 72px; }
.legal > * { max-width: 820px; }
.legal h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
.legal h2 { font-size: 1.15rem; margin: 30px 0 10px; }
.legal p { color: var(--text); opacity: .92; line-height: 1.65; max-width: 820px; }
.legal-n { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.legal-req { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; }
.legal-links { margin-top: 36px; color: var(--muted); }

/* Промокоды */
.promo-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.promo-list { display: grid; gap: 12px; }
.promo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; display: grid; gap: 10px; }
.promo-card.is-off { opacity: .7; }
.promo-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.promo-code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 1.08rem; letter-spacing: .04em; padding: 4px 10px; border-radius: 8px; border: 1px dashed rgba(var(--accent-rgb), .55); color: var(--accent); margin-right: 6px; }
.promo-val { font-family: var(--display); font-size: 1.3rem; font-weight: 800; }
.promo-meta { margin: 0; }
.promo-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; }
.promo-link > span { font-size: .78rem; color: var(--faint); font-weight: 600; }
.promo-link code { background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.btn.is-done { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .4); }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .lp-nav { display: none; }
  .hero { grid-template-columns: 1fr; padding: 40px 0 64px; gap: 44px; }
  .bento .w2, .bento .w3, .bento .w4 { grid-column: span 6; }
  .price { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 900px) {
  .frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  .side { position: sticky; z-index: 20; height: auto; padding: 10px 12px 8px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(12px); overflow: visible; }
  .side-label { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { white-space: nowrap; padding: 8px 12px; gap: 8px; }
  .side-nav .ico { width: 18px; height: 18px; }
  .side-foot { position: absolute; top: 8px; right: 12px; padding: 0; border: 0; background: none; gap: 4px; }
  .side-foot .avatar, .side-foot .who { display: none; }
  .main { padding: 24px 16px 56px; }
  .purse { grid-template-columns: 1fr; gap: 18px; padding: 24px; }
  .grid-2, .product-grid, .promo-grid { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .lp-steps { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; padding: 28px; }
}
@media (max-width: 640px) {
  /* Таблицы превращаются в карточки: подписи столбцов берутся из шапки */
  .table-wrap table.stacked thead { display: none; }
  .table-wrap table.stacked, .table-wrap table.stacked tbody { display: block; }
  .table-wrap table.stacked tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap table.stacked tr:last-child { border-bottom: 0; }
  .table-wrap table.stacked td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; }
  .table-wrap table.stacked td[data-label]::before { content: attr(data-label); display: block; font-size: .74rem; color: var(--faint); margin-bottom: 1px; }
  .table-wrap table.stacked td:first-child { grid-column: 1 / -1; }
  .table-wrap table.stacked td.r { text-align: left; }
  .table-wrap table.stacked td.acts, .table-wrap table.stacked td:last-child:not([data-label]), .table-wrap table.stacked td[data-label=""] { grid-column: 1 / -1; text-align: left; }
  .table-wrap table.stacked td.acts > form, .table-wrap table.stacked td.acts > a { margin: 6px 6px 0 0; }
  .table-wrap table.stacked td[data-label=""]::before { display: none; }
  .table-wrap table.stacked .thumb { width: 40px; height: 40px; }
  /* Длинные почты, адреса и подписи переносятся внутри своей ячейки и не заезжают на соседние */
  .table-wrap table.stacked td { overflow-wrap: anywhere; white-space: normal; }
  .table-wrap table.stacked td.num { white-space: normal; }
  .table-wrap table.stacked td:has(> .mono), .table-wrap table.stacked td:has(> a[href^="/admin/user.php"]) { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stats > div { padding: 14px 16px; }
  .stats .v { font-size: 1.12rem; }
  .lp-top-in { gap: 10px; }
  .lp-top .btn-ghost.hide-s { display: none; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .demo { padding: 18px; border-radius: 24px; }
  .hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hero-facts b { font-size: 1.15rem; }
  .hero-facts span { font-size: .78rem; display: block; line-height: 1.3; }
  .hero-kicker { font-size: .8rem; }
  .demo-btns span { font-size: .8rem; padding: 7px 10px; }
  .b-key { flex-direction: column; gap: 4px; }
  .demo-item { margin-left: 0; }
  th, td { padding: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .panel { padding: 20px; }
  .lp-section { padding: 64px 0; }
  .chart { gap: 3px; }
  .bar small { display: none; }
  .bar:nth-child(7n+1) small { display: block; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }

/* Выбор касс бота */
.gw-pick { position: relative; display: block; cursor: pointer; }
.gw-pick input { position: absolute; top: 16px; left: 16px; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.gw-pick-in { display: grid; gap: 8px; padding: 14px 16px 14px 46px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.gw-pick:hover .gw-pick-in { border-color: rgba(var(--accent-rgb), .5); }
.gw-pick input:checked + .gw-pick-in { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); box-shadow: inset 0 0 0 1px var(--accent); }
.gw-pick.is-off { cursor: default; opacity: .55; }
.gw-pick.is-off .gw-pick-in { display: flex; justify-content: space-between; align-items: center; }
.gw-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.gw-m { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-3, rgba(127,127,127,.12)); border: 1px solid var(--line); white-space: nowrap; }

/* ---------- Статистика бота ---------- */
.st-head { margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.st-period { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.st-period a { padding: 7px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.st-period a:hover { color: var(--text); }
.st-period a[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.st-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .st-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-kpi .v { font-size: 1.6rem; }
.st-sub { color: var(--faint); font-size: .78rem; margin-top: 6px; }
.st-chart .bar { position: relative; }
.st-chart .bar b { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 46%; max-width: 14px; border-radius: 5px 5px 2px 2px; }
.st-chart .bar b.st-new { background: #9b8cff; opacity: .9; }
.st-chart .bar b.st-buy { background: #2ecc71; width: 26%; max-width: 8px; }
.st-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.st-l1 { background: var(--grad); } .st-l2 { background: #9b8cff; } .st-l3 { background: #2ecc71; }
.funnel { display: grid; gap: 14px; }
.funnel-lbl { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.funnel-lbl span { flex: 1; min-width: 0; }
.funnel-lbl b { font-variant-numeric: tabular-nums; }
.funnel-lbl small { width: 100%; color: var(--faint); font-size: .76rem; margin-top: -2px; }
.funnel-bar { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.st-table table { min-width: 0; }
.st-short { display: none; }
@media (max-width: 720px) {
  .st-period { width: 100%; overflow-x: auto; } .st-kpi .v { font-size: 1.35rem; }
  .st-full { display: none; } .st-short { display: inline; }
  .st-table th, .st-table td { padding: 10px 10px; font-size: .86rem; }
  .st-table td:first-child { word-break: break-word; }
}

/* QA: действия в таблицах, документы на телефоне */
.acts-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 220px; }
@media (max-width: 720px) { .acts-row { justify-content: flex-start; min-width: 0; } .legal { padding-top: 28px; } }

/* ---------- Защита от выхода контента за границы ---------- */
.main, .panel, .section, .grid-2 > *, .purse > *, .row-between > *, .stats > div { min-width: 0; }
.main, .panel, .flash, .empty, .callout { overflow-wrap: break-word; }
.table-wrap td a, .table-wrap td .mono, .table-wrap td code, .table-wrap td small { overflow-wrap: anywhere; }
.mono, code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
img, video, canvas, svg { max-width: 100%; }
.panel code, .panel .mono { word-break: break-word; }
@media (max-width: 640px) {
  .row-between { align-items: flex-start; }
  .row-between > a { white-space: nowrap; }
  .actions > .btn, .actions > form { max-width: 100%; }
  .btn { white-space: normal; text-align: center; }
  .tabs { width: 100%; }
}

/* Карточки ботов на обзоре */
.bot-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;margin-top:12px}
.bot-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-l);padding:16px;display:grid;gap:12px;min-width:0}
.bot-card strong{overflow-wrap:anywhere}
.bc-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0}
.bc-stats div{min-width:0}
.bc-stats dt{font-size:12px;opacity:.65}
.bc-stats dd{margin:2px 0 0;font-weight:600;overflow-wrap:anywhere}

/* Выбор срока оплаты */
.term-pills{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.term-pill{display:inline-flex;flex-direction:column;align-items:center;padding:8px 14px;border-radius:12px;border:1px solid var(--line-2);color:inherit;text-decoration:none;font-weight:600;line-height:1.2}
.term-pill small{font-size:11px;color:var(--ok);font-weight:600}
.term-pill.on{border-color:var(--accent);background:rgba(var(--accent-rgb),.14)}


/* Длинные имена и ссылки не растягивают страницу вширь (мотание при прокрутке на телефоне) */
html, body { max-width: 100%; overflow-x: clip; }
.main, .main > *, .section, .panel, .card { min-width: 0; }
h1, h2, h3, .page-title, .sub, .crumbs { overflow-wrap: anywhere; }

/* Админка → «Комиссии и вывод»: настройки по разделам в две колонки */
.set-grid { columns: 2; column-gap: 16px; }
.set-group { display: grid; gap: 14px; margin: 0 0 16px; break-inside: avoid; }
.set-group h2 { margin: 0; font-size: 1.02rem; }
.set-group .field { margin: 0; }
.set-save { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; }
.set-save .btn { box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
@media (max-width: 900px) { .set-grid { columns: 1; } .set-save .btn { width: 100%; } }

/* ---------- Блок «Оплата звёздами» ---------- */
.st-lead { color: var(--muted); font-size: .92rem; margin: 2px 0 14px; }
.st-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.st-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.st-k { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.st-v { font-size: 1.12rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-s { color: var(--muted); font-size: .8rem; }
.st-prog { background: linear-gradient(135deg, rgba(255, 196, 0, .10), rgba(255, 196, 0, .03)); border: 1px solid rgba(255, 196, 0, .22); border-radius: var(--radius-m); padding: 14px 16px; margin-bottom: 14px; }
.st-prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .9rem; color: var(--muted); }
.st-prog-top b { color: var(--text); font-size: 1.15rem; }
.st-of { color: var(--muted); font-weight: 500; font-size: .9rem; }
.st-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 10px 0 8px; }
.st-bar span { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: linear-gradient(90deg, #FFB800, #FFD84D); box-shadow: 0 0 12px rgba(255, 196, 0, .45); transition: width .4s; }
.st-prog-bot { color: var(--muted); font-size: .82rem; }
.st-bot { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 10px; flex-wrap: wrap; }
.st-bot-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(255, 196, 0, .14); flex: none; }
.st-bot-main { display: grid; gap: 1px; flex: 1; min-width: 140px; }
.st-bot-main a { font-weight: 700; font-size: 1.02rem; }
.st-toggle { margin: 0; }
.st-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: .92rem; }
.st-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-knob { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .2s; flex: none; }
.st-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.st-switch input:checked + .st-knob { background: var(--ok); border-color: transparent; }
.st-switch input:checked + .st-knob::after { transform: translateX(18px); }
.st-switch input:focus-visible + .st-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-note { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0 0 10px; }
.st-note b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  .st-tiles { grid-template-columns: 1fr; gap: 6px; }
  .st-tile { grid-template-columns: 1fr auto; align-items: center; padding: 10px 12px; }
  .st-tile .st-k { grid-column: 1; }
  .st-tile .st-v { grid-column: 2; grid-row: 1 / span 2; font-size: 1.02rem; }
  .st-tile .st-s { grid-column: 1; }
}

/* ---------- Общие элементы блоков страницы бота ---------- */
.bh { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bh-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: none; background: rgba(var(--accent-rgb), .12); }
.bh-ic.gold { background: rgba(255, 196, 0, .14); }
.bh-ic.green { background: rgba(52, 211, 153, .14); }
.bh-ic.violet { background: rgba(167, 139, 250, .16); }
.bh-ic.red { background: rgba(248, 113, 113, .14); }
.bh-t { flex: 1; min-width: 0; }
.bh-t h2 { margin: 0; font-size: 1.15rem; }
.bh-t .bh-s { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.bh > .badge { flex: none; }
.st-sec { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.st-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-row .field { flex: 1; min-width: 180px; margin: 0; }
.st-switch.sm { font-size: .88rem; font-weight: 500; }
.opt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.opt-card { position: relative; cursor: pointer; display: block; }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card .oc { display: grid; gap: 3px; height: 100%; padding: 11px 13px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface-2); transition: border-color .15s, background .15s; }
.opt-card .oc b { font-size: .95rem; }
.opt-card .oc span { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.opt-card input:checked + .oc { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt-card input:focus-visible + .oc { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-ex { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 10px 12px; font-size: .85rem; margin-top: 10px; display: grid; gap: 4px; }
.st-ex .st-ex-r { display: flex; justify-content: space-between; gap: 10px; }
.st-ex .st-ex-r b { white-space: nowrap; }
.st-bar.blue span { background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px rgba(var(--accent-rgb), .4); }
.st-bar.red span { background: linear-gradient(90deg, #f87171, #fb923c); box-shadow: none; }
.st-copy { display: flex; gap: 8px; align-items: stretch; }
.st-copy input { flex: 1; min-width: 0; font-family: var(--mono, monospace); font-size: .88rem; }
.st-danger { border: 1px solid rgba(248, 113, 113, .25); background: rgba(248, 113, 113, .05); border-radius: var(--radius-m); padding: 12px 14px; margin-top: 12px; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.st-side { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; display: grid; gap: 10px; }
@media (max-width: 760px) { .st-two { grid-template-columns: 1fr; } }
.st-prog-top { flex-wrap: wrap; }
@media (max-width: 640px) {
  .bh { flex-wrap: wrap; row-gap: 6px; }
  .bh-t { flex: 1 1 calc(100% - 56px); }
  .bh > .badge { margin-left: 54px; }
  .st-prog-top b { white-space: normal; }
}

/* ---------- Доработка страницы бота ---------- */
.spy { margin: -8px -12px 20px; padding: 8px 12px; background: color-mix(in srgb, var(--bg, #0a0e16) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
/* «Кто платит комиссию»: вертикальный список с отметкой */
.opt-cards { grid-template-columns: 1fr !important; gap: 6px; }
.opt-card .oc { grid-template-columns: 20px 1fr; column-gap: 12px; align-items: start; padding: 12px 14px; }
.opt-card .oc::before { content: ""; grid-row: 1 / span 2; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-2); box-sizing: border-box; transition: border .15s, background .15s; }
.opt-card .oc b, .opt-card .oc span { grid-column: 2; }
.opt-card input:checked + .oc::before { border: 5px solid var(--accent); background: var(--surface); }
.opt-card input:checked + .oc { box-shadow: none; }
.st-side .st-ex { background: var(--surface); }
.st-two > .st-side { position: static; }
.panel .st-sec:first-child { margin-top: 0; }
#pay-box + .kpis, .section + .kpis { margin-top: 14px; }
#admin .st-row { max-width: 640px; }
/* Поле загрузки файла в стиле сайта */
.main .panel input[type=file] { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; padding: 10px; border: 1px dashed var(--line-2); border-radius: var(--radius-s); background: var(--surface-2); color: var(--muted); font-size: .88rem; cursor: pointer; }
.main .panel input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 8px; background: rgba(var(--accent-rgb), .14); color: var(--accent); font-weight: 600; cursor: pointer; }
.main .panel input[type=file]:hover { border-color: var(--accent); }

/* ---------- Вкладки бота: одна строка + меню «Ещё» ---------- */
.tabs.tabs-x { overflow: visible; flex-wrap: nowrap; align-items: center; }
.tabs.tabs-x a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; }
.tab-ic { font-size: .95em; line-height: 1; filter: saturate(.9); }
.tabs-more { position: relative; }
.tabs-more summary { list-style: none; cursor: pointer; padding: 9px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; white-space: nowrap; user-select: none; }
.tabs-more summary::-webkit-details-marker { display: none; }
.tabs-more summary:hover, .tabs-more[open] summary { color: var(--text); background: var(--surface-2); }
.tabs-more summary.has-on { color: var(--text); }
.tabs-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.tabs-menu a { padding: 10px 12px !important; border-radius: 9px; color: var(--text) !important; }
.tabs-menu a:hover { background: var(--surface-2); }
.tabs-menu a[aria-current="page"] { background: rgba(var(--accent-rgb), .14) !important; color: var(--accent) !important; }
@media (max-width: 900px) {
  .tabs.tabs-x { overflow-x: auto; overflow-y: visible; }
  .tabs.tabs-x a { padding: 8px 11px; }
  .tabs-more { position: static; }
  .tabs-menu { right: 8px; left: auto; top: auto; margin-top: 8px; position: fixed; }
}
@media (max-width: 900px) {
  .tabs.tabs-x { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); scrollbar-width: none; }
  .tabs.tabs-x::-webkit-scrollbar { display: none; }
  .tabs.tabs-x a[aria-current="page"] { scroll-margin-left: 8px; }
}

/* ---------- Единый стиль кабинета: переключатели, радио, таблицы, пустые состояния ---------- */
/* Галочки в .check — переключателями */
.main .check input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin-top: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s, border-color .2s; flex: none; }
.main .check input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.main .check input[type=checkbox]:checked { background: var(--ok); border-color: transparent; }
.main .check input[type=checkbox]:checked::after { transform: translateX(16px); }
.main .check input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.main .check input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }
.main .check { align-items: center; padding: 3px 0; }
.main .check > span { line-height: 1.45; }
/* Радио — аккуратными кругами */
.main .check input[type=radio] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: 0; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; cursor: pointer; flex: none; transition: border .15s; }
.main .check input[type=radio]:checked { border: 5px solid var(--accent); }
.main .check input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Таблицы */
.main .table-wrap th { text-transform: uppercase; letter-spacing: .04em; font-size: .74rem; }
.main .table-wrap tbody tr { transition: background .12s; }
.main .table-wrap tbody tr:hover { background: rgba(var(--accent-rgb), .04); }
.main .table-wrap tbody tr:last-child td { border-bottom: 0; }
/* Пустые состояния */
.main .empty { text-align: center; padding: 40px 26px; }
.main .empty strong { font-size: 1.05rem; margin-bottom: 6px; }
.main .empty::before { content: "✨"; display: block; font-size: 30px; margin-bottom: 8px; opacity: .85; }
/* Шапка блока внутри панели: отступ под ней, если сразу таблица/форма */
.panel > .bh:first-child { margin-bottom: 16px; }
.panel h3 { font-size: 1rem; margin: 18px 0 10px; }
.panel > h3:first-child { margin-top: 0; }
/* Вкладки бота: всегда одна строка (правило cab.css про перенос не действует) */
@media (min-width: 901px) {
  body.cab .tabs.tabs-x { flex-wrap: nowrap; overflow: visible; width: 100%; }
  body.cab .tabs.tabs-x a { padding: 8px 12px; }
}
@media (max-width: 900px) {
  body.cab .tabs.tabs-x { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; width: 100%; max-width: 100%; position: static; }
  body.cab .tabs.tabs-x a { padding: 8px 11px; }
  .tabs-more summary { padding: 8px 11px; }
  .tabs-menu { position: fixed; left: 12px; right: 12px; top: auto; margin-top: 6px; min-width: 0; }
}
.tabs-menu a .tab-ic { width: 1.3em; text-align: center; }

/* Строка разделов страницы: плавающая панель прямо под шапкой сайта, без щели и обрезки */
body.cab .spy, .main .spy { position: sticky; top: var(--tb-h, 60px); z-index: 9; margin: -6px 0 20px; padding: 6px; display: flex; gap: 4px; overflow-x: auto;
  background: color-mix(in srgb, var(--surface) 97%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
body.cab .spy a, .main .spy a { border: 0; background: transparent; padding: 6px 12px; }
body.cab .spy a:hover { color: var(--text); background: var(--surface-2); }
body.cab .spy a.on { background: var(--accent); color: var(--on-accent); }
@media (max-width: 900px) { body.cab .spy, .main .spy { top: var(--tb-h, 56px); -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); } }
/* якоря блоков не прячутся под шапкой и панелью разделов */
.main .panel[id], .main #pay-box { scroll-margin-top: 130px; }
/* щит над строкой разделов: прокручиваемое содержимое не просвечивает между ней и шапкой */
body.cab .spy::before { content: ""; position: fixed; left: 0; right: 0; height: 0; }
body.cab .spy { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }

/* ---------- Компактные настройки ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bh > .st-switch { flex: none; margin-left: auto; }
.st-switch.only { gap: 0; }
.sc-desc { color: var(--muted); font-size: .87rem; line-height: 1.5; margin: -4px 0 14px; }
.nf-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; }
.nf { display: grid; gap: 5px; }
.nf > label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.nf-in { display: inline-flex; align-items: center; width: 132px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface-2); transition: border-color .15s; }
.nf-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.nf-in input { flex: 1; min-width: 0; width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 4px 9px 12px !important; font-weight: 600; font-size: .98rem; outline: none; }
.nf-in span { padding: 0 12px 0 2px; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.nf small { color: var(--muted); font-size: .75rem; max-width: 160px; line-height: 1.35; }
.nf.wide .nf-in { width: 180px; }
.sc-stat { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.sc-stat b { color: var(--text); }
.segx { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.segx label { cursor: pointer; }
.segx input { position: absolute; opacity: 0; pointer-events: none; }
.segx span { display: block; padding: 7px 13px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.segx input:checked + span { background: var(--accent); color: var(--on-accent); }
.segx input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-sub { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.sc-sub .bh { margin-bottom: 10px; }
.sc-sub .bh-ic { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
.sc-sub .bh-t h2 { font-size: 1rem; }
/* блоки в ряду — одной высоты */
.grid-2.eqh { align-items: stretch; }
.grid-2.eqh > .panel { height: 100%; display: flex; flex-direction: column; }
.grid-2.eqh > .panel > .sc-stat { margin-top: auto; align-self: flex-start; }
.grid-2.eqh > .panel > .nf-row + .sc-stat { margin-top: 14px; }
/* кабинет: поля чуть компактнее */
.main .panel .field input:not([type]), .main .panel .field input[type=text], .main .panel .field input[type=number], .main .panel .field input[type=url], .main .panel .field select { padding-top: 10px; padding-bottom: 10px; }
.main .panel .field + .field { margin-top: 2px; }
.save-dock { position: sticky; bottom: 12px; z-index: 6; display: flex; justify-content: flex-end; margin-top: 18px; }
.save-dock .btn { box-shadow: 0 10px 30px rgba(var(--accent-rgb), .35); }
.segx { display: flex; width: max-content; max-width: 100%; flex-wrap: wrap; }
.main .segx label span, .segx span { background: transparent; border: 0; }
.main .segx input:checked + span { background: var(--accent); color: var(--on-accent); }
.save-dock { position: static; }

/* ---------- Покупатели: строки в одну линию ---------- */
.cust-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.cust-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cust-bar input[type=search] { flex: 1; min-width: 180px; padding: 10px 12px; }
.cust-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.cust-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); transition: background .12s; }
.cust-row:last-child { border-bottom: 0; }
.cust-row:hover { background: rgba(var(--accent-rgb), .04); }
.cust-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--accent); background: rgba(var(--accent-rgb), .12); }
.cust-row.is-banned .cust-av { color: #f87171; background: rgba(248, 113, 113, .12); }
.cust-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-meta { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-act { margin: 0; }
.cust-act .btn { min-width: 132px; justify-content: center; }
.cust-ban:hover { color: #f87171; border-color: rgba(248, 113, 113, .5); }
@media (max-width: 1100px) { .cust-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cust-row { grid-template-columns: 38px minmax(0, 1fr) auto; } .cust-row .badge { display: none; } .cust-act .btn { min-width: 0; } }
/* скрытое поле внутри готовой кнопки «Выбрать файл» не трогаем */
.main .panel .file-pick input[type=file] { width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; margin: 0; }

/* ---------- Аудит: мелкие недочёты ---------- */
/* кнопка меню в шапке телефона: без серого фона браузера, как соседние кнопки */
button.icon-btn { appearance: none; -webkit-appearance: none; background: transparent; border: 1px solid var(--line); color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
button.icon-btn:hover { background: var(--surface-2); color: var(--text); }
/* строки поиска в админке: на телефоне поле поиска — на всю ширину */
@media (max-width: 640px) {
  body .sform { flex-wrap: wrap; max-width: none; }
  body .sform input[type=search], body .sform input[type=text] { flex: 1 1 100%; min-width: 0; }
  body .sform input[type=date] { flex: 1 1 40%; min-width: 0; }
}
/* плашка статистики — обычный текст, без разрыва по словам */
.sc-stat { display: inline-block; line-height: 1.5; }
/* шапка с переключателем на телефоне: переключатель остаётся в той же строке */
@media (max-width: 640px) {
  .bh:has(> .st-switch) { flex-wrap: nowrap; }
  .bh:has(> .st-switch) .bh-t { flex: 1 1 0; min-width: 0; }
}
/* Категории: строки */
.cat-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); }
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-name { display: flex; gap: 8px; align-items: center; margin: 0; min-width: 0; }
.cat-name input { flex: 1; min-width: 120px; padding: 8px 12px; }
.cat-cnt { text-decoration: none; font-weight: 700; color: var(--accent); white-space: nowrap; }
.cat-cnt span { color: var(--muted); font-weight: 500; font-size: .82rem; }
.cat-act { display: flex; gap: 6px; margin: 0; }
@media (max-width: 640px) { .cat-row { grid-template-columns: minmax(0, 1fr) auto; } .cat-act { grid-column: 1 / -1; } }
/* Мои боты: юзернейм в одну строку с многоточием */
.bcard-nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Поиск с датами в админке: шире, без переноса кнопки */
@media (min-width: 641px) { .main .sform:has(input[type=date]) { max-width: 720px; } .main .sform:has(input[type=date]) input[type=search] { min-width: 220px; } }
.table-wrap > .cat-list { border: 0; border-radius: 0; }
.cust-meta { white-space: normal; overflow: visible; line-height: 1.4; }
