/* AKSO ERP — панель продавца для всех площадок. Палитра AKSO. */
:root {
    --bg: #100b1c;
    --surface: #181027;
    --surface-2: #211735;
    --surface-3: #2a1e42;
    --line: #2b1f42;
    --line-2: #3b2a5a;
    --text: #efe9f7;
    --muted: #a596bd;
    --dim: #7a6b93;
    --violet: #b84fd6;
    --violet-deep: #7c3aed;
    --ok: #4ade80;
    --warn: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --p-playerok: #3b82f6;
    --p-funpay: #f97316;
    --p-ggsel: #22c55e;
    --p-site: #b84fd6;
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 10px;
    --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
    --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --side-w: 236px;
    --tab-h: 0px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; }
h1 { font: 700 24px/1.25 var(--display); letter-spacing: -.01em; }
h2 { font: 700 19px/1.3 var(--display); }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 9px; }
.brand span { font: 700 16px var(--display); white-space: nowrap; }
.brand b { color: var(--violet); }

/* ---------- кнопки, поля ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--r-md); font-weight: 700; cursor: pointer; text-decoration: none;
    white-space: nowrap; transition: filter .15s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--violet), var(--violet-deep)); color: #fff; }
.btn-primary:hover:not([disabled]) { filter: brightness(1.1); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-danger { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .32); color: #fecaca; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: var(--r-sm); font-size: 14px; }
.btn-xs { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--violet); cursor: pointer; font-weight: 700; text-decoration: none; }
.input, .textarea {
    width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: var(--bg); color: var(--text); outline: none;
}
select.input { padding-right: 30px; }
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--violet); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.field small { color: var(--dim); font-size: 12px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.err { color: var(--danger); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- макет панели ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px;
    border-right: 1px solid var(--line); background: var(--surface);
}
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
    text-decoration: none; color: var(--muted); font-weight: 700;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.on { color: var(--text); background: var(--surface-3); }
.nav a.on svg { color: var(--violet); }
.badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
    background: var(--violet); color: #fff; font-size: 11px; font-weight: 800;
}
.badge.warn { background: var(--danger); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.wallet {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-md);
    background: var(--bg); border: 1px solid var(--line); cursor: pointer; text-align: left;
}
.wallet span { grid-column: 1; font-size: 12px; color: var(--muted); font-weight: 700; }
.wallet b { grid-column: 1; font: 700 16px var(--display); }
.wallet i {
    grid-column: 2; grid-row: 1 / span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--violet), var(--violet-deep)); color: #fff; font-style: normal; font-size: 19px;
}
.wallet.sm { grid-template-columns: auto auto; padding: 4px 4px 4px 12px; border-radius: 999px; }
.wallet.sm b { font-size: 14px; }
.sub-pill { padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); color: var(--muted); }
.sub-pill.ok { color: var(--ok); border-color: rgba(74, 222, 128, .3); }
.sub-pill.bad { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-size: 14px; }
.me .ava { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.me .ava img { width: 100%; height: 100%; object-fit: cover; }
.me b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me button { padding: 0; background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; text-decoration: underline; }

.mtop { display: none; }
.tabbar { display: none; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 40px; max-width: 1240px; width: 100%; }
.view { display: flex; flex-direction: column; gap: 18px; }
.v-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.banner {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; border-radius: var(--r-md);
    background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .3);
}
.banner p { flex: 1; min-width: 220px; }
.banner.info { background: rgba(184, 79, 214, .1); border-color: rgba(184, 79, 214, .35); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-h h2 { font-size: 16px; }
.empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.empty h3 { color: var(--text); font: 700 17px var(--display); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.skeleton { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.seg-inline { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seg-inline button { height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; }
.seg-inline button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }

/* платформа */
.plat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.plat::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--violet)); }
.plat.playerok { --pc: var(--p-playerok); }
.plat.funpay { --pc: var(--p-funpay); }
.plat.ggsel { --pc: var(--p-ggsel); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.chip.ok { background: rgba(74, 222, 128, .12); color: var(--ok); }
.chip.warn { background: rgba(251, 191, 36, .12); color: var(--warn); }
.chip.bad { background: rgba(248, 113, 113, .12); color: var(--danger); }
.chip.info { background: rgba(96, 165, 250, .12); color: var(--info); }
.chip.vio { background: rgba(184, 79, 214, .16); color: #e3b5f2; }

/* ---------- обзор ---------- */
.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.ledger { grid-column: span 12; }
.ledger-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.ledger-sum { font: 700 clamp(30px, 4vw, 42px)/1.05 var(--display); letter-spacing: -.02em; }
.ledger-sum small { display: block; margin-top: 6px; font: 600 14px var(--body); color: var(--muted); letter-spacing: 0; }
.ledger-cur { display: flex; gap: 6px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.kpi { background: var(--surface); padding: 12px 14px; }
.kpi b { display: block; font: 700 20px var(--display); }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi a { text-decoration: none; }
.bars { position: relative; height: 180px; display: flex; align-items: flex-end; gap: 3px; margin-top: 18px; padding-bottom: 22px; }
.bar { position: relative; flex: 1; min-width: 2px; height: 100%; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--violet), rgba(124, 58, 237, .55)); min-height: 2px; }
.bar.zero i { background: var(--surface-3); }
.bar:hover i { filter: brightness(1.25); }
.bar em { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--dim); white-space: nowrap; }
.bar .tip {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2; display: none; padding: 6px 9px;
    border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-2); font-size: 12px; white-space: nowrap; pointer-events: none;
}
.bar:hover .tip, .bar:focus .tip { display: block; }
.ov-half { grid-column: span 6; }
.ov-third { grid-column: span 4; }
.split { display: flex; flex-direction: column; gap: 12px; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.split-row .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.split-row .track i { display: block; height: 100%; border-radius: 6px; background: var(--pc, var(--violet)); }
.top-items { width: 100%; border-collapse: collapse; font-size: 14px; }
.top-items td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.top-items td:last-child { text-align: right; white-space: nowrap; color: var(--muted); }
.top-items tr:last-child td { border-bottom: 0; }
.acc-mini { display: flex; flex-direction: column; gap: 8px; }
.acc-mini a { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 0; }

/* ---------- аккаунты ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acc { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.acc::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ac, var(--violet)); }
.acc-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.acc-h h3 { font-size: 17px; overflow-wrap: anywhere; }
.acc-bal { font: 700 20px var(--display); }
.acc-err { font-size: 13px; color: #fecaca; background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .25); border-radius: var(--r-sm); padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow: auto; }
.acc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pick-plat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick-plat button {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: var(--r-md); cursor: pointer; text-align: left;
    background: var(--surface-2); border: 1px solid var(--line);
}
.pick-plat button[aria-pressed="true"] { border-color: var(--violet); background: rgba(184, 79, 214, .12); }
.pick-plat b { font-size: 15px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.steps code, .hint code { background: var(--surface-3); color: var(--text); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* ---------- чаты ---------- */
.view-chats { height: calc(100dvh - 120px); min-height: 480px; }
.chats { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.c-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.c-tools { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.c-items { flex: 1; overflow-y: auto; }
.c-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 3px solid transparent; width: 100%; text-align: left; border-top: 0; border-right: 0; }
.c-item:hover { background: var(--surface-2); }
.c-item.on { background: var(--surface-3); border-left-color: var(--violet); }
.c-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-item time { font-size: 12px; color: var(--dim); }
.c-item p { grid-column: 1; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-item .badge { grid-column: 2; margin: 0; justify-self: end; }
.c-item .plat { grid-column: 1 / -1; font-size: 11px; }
.c-room { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.c-empty { flex: 1; display: grid; place-items: center; color: var(--muted); }
.c-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.c-head .back { display: none; }
.c-orders { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.c-order { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-size: 13px; max-width: 320px; }
.c-order span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; font-size: 12px; color: var(--dim); margin: 10px 0 4px; }
.msg { max-width: min(560px, 82%); padding: 9px 12px; border-radius: 14px; background: var(--surface-2); overflow-wrap: anywhere; }
.msg .t { white-space: pre-wrap; }
.msg.own { align-self: flex-end; background: rgba(124, 58, 237, .32); }
.msg.admin { border: 1px solid rgba(96, 165, 250, .4); }
.msg small { display: block; margin-top: 3px; font-size: 11px; color: var(--dim); }
.msg .who { display: block; font-size: 12px; font-weight: 800; color: #e3b5f2; margin-bottom: 2px; }
.msg img { max-width: 260px; border-radius: 10px; margin: 4px 0; cursor: zoom-in; }
.msg.err small { color: var(--danger); }
.plaque { align-self: center; max-width: 92%; padding: 8px 14px; border-radius: 12px; font-size: 13px; text-align: center; background: var(--surface-2); color: var(--muted); }
.plaque.problem { background: rgba(251, 191, 36, .1); color: #fde68a; border: 1px solid rgba(251, 191, 36, .3); }
.plaque.ok { background: rgba(74, 222, 128, .08); color: #bbf7d0; }
.plaque.note { background: rgba(184, 79, 214, .1); color: #ecd0f5; border: 1px dashed rgba(184, 79, 214, .45); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; height: 44px; resize: none; padding: 11px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg); outline: none; }
.composer textarea:focus { border-color: var(--violet); }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: var(--r-md); display: grid; place-items: center; cursor: pointer; background: var(--surface-2); border: 1px solid var(--line); }
.icon-btn.send { background: linear-gradient(135deg, var(--violet), var(--violet-deep)); border: 0; color: #fff; }

/* ---------- заказы ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .input { width: auto; min-width: 150px; }
.filters #orderSearch { min-width: 240px; }
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .item { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tbl .r { text-align: right; white-space: nowrap; }
.more { display: flex; justify-content: center; padding: 14px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- плагины ---------- */
.plug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.plug { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.plug-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--surface-3); }
.plug-price { font: 700 22px var(--display); }
.plug-price small { font: 600 13px var(--body); color: var(--muted); }
.plug p { color: var(--muted); font-size: 14px; }
.plug .row:last-child { margin-top: auto; }
.vb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.vb-tabs button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; color: var(--muted); font-weight: 700; }
.vb-tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }
.vb-list { display: flex; flex-direction: column; gap: 8px; }
.vb-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.vb-item .sub { grid-column: 1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.vb-item .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vb-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg); border: 1px dashed var(--line-2); font-size: 14px; }
.vb-code { font: 700 15px var(--display); letter-spacing: 2px; padding: 3px 10px; border-radius: 8px; background: rgba(184, 79, 214, .18); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; }

/* ---------- подписка ---------- */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan {
    position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2);
    border: 1px solid var(--line);
}
.plan.best { border-color: var(--violet); background: linear-gradient(160deg, rgba(184, 79, 214, .16), var(--surface-2) 60%); }
.plan-price { font: 700 28px var(--display); }
.plan-price small { font: 600 14px var(--body); color: var(--muted); }
.plan .gift { position: absolute; top: -11px; right: 14px; padding: 3px 10px; border-radius: 999px; background: var(--violet); color: #fff; font-size: 12px; font-weight: 800; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.sub-state { display: flex; flex-direction: column; gap: 6px; }
.sub-state b { font: 700 22px var(--display); }
.history { display: flex; flex-direction: column; }
.history div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history div:last-child { border-bottom: 0; }
.history small { color: var(--dim); font-size: 12px; }
.history .plus { color: var(--ok); }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.presets button { height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 700; }
.presets button[aria-pressed="true"] { border-color: var(--violet); background: rgba(184, 79, 214, .16); }

/* ---------- окно ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 3, 12, .72); backdrop-filter: blur(4px); }
.sheet-panel {
    position: relative; width: min(620px, 100%); max-height: 90dvh; overflow-y: auto; background: var(--surface);
    border: 1px solid var(--line-2); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.sheet-panel.narrow { width: min(440px, 100%); }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; z-index: 1; }
.pad { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.pad h2 { padding-right: 40px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); }
.seg button { height: 38px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.oauth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px; border-radius: var(--r-md); background: #1f3326; border: 1px solid #166534; font-weight: 600; box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.toast.bad { background: #3a1620; border-color: #7f1d1d; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 90dvh; border-radius: 12px; }
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.legal a { color: inherit; text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* ---------- лендинг ---------- */
.landing { max-width: 1160px; margin: 0 auto; padding: 0 20px 30px; }
.l-top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.l-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; padding: 56px 0 64px; }
.l-copy h1 { font: 700 clamp(32px, 5vw, 54px)/1.08 var(--display); letter-spacing: -.025em; max-width: 14ch; }
.l-copy p { margin-top: 20px; font-size: 18px; color: var(--muted); max-width: 52ch; }
.l-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.l-board { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(124, 58, 237, .18); }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-weight: 700; font-size: 14px; }
.lb-row i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.lb-row em { margin-left: auto; font-style: normal; font-size: 12px; }
.lb-row em.ok { color: var(--ok); }
.lb-msg { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; max-width: 88%; }
.lb-msg.own { align-self: flex-end; background: rgba(124, 58, 237, .32); }
.lb-msg b { display: block; font-size: 12px; color: #e3b5f2; }
.l-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.l-feats article { padding: 22px; border-top: 2px solid var(--violet); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.l-feats h3 { font: 700 17px var(--display); margin-bottom: 8px; }
.l-feats p { color: var(--muted); font-size: 15px; }
.l-prices { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: center; }
.l-prices h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }
.l-prices p { color: var(--muted); margin-top: 10px; }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
    .ov-half, .ov-third { grid-column: span 12; }
    .bill-grid { grid-template-columns: 1fr; }
    .chats { grid-template-columns: 290px minmax(0, 1fr); }
}
@media (max-width: 860px) {
    :root { --tab-h: 64px; }
    .app { grid-template-columns: 1fr; }
    .side { display: none; }
    .mtop {
        position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px;
        background: rgba(16, 11, 28, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
    }
    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
        height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(16, 11, 28, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    }
    .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; }
    .tabbar a.on { color: var(--text); }
    .tabbar a.on svg { color: var(--violet); }
    .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
    .main { padding: 18px 16px calc(var(--tab-h) + 30px); }
    h1 { font-size: 21px; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bars { height: 140px; gap: 2px; }
    .view-chats { height: calc(100dvh - 58px - var(--tab-h) - 36px); min-height: 0; }
    .chats { grid-template-columns: 1fr; border-radius: var(--r-md); }
    .chats.open .c-list { display: none; }
    .chats:not(.open) .c-room { display: none; }
    .c-head .back { display: grid; }
    .c-list { border-right: 0; }
    .tbl thead { display: none; }
    .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
    .tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .tbl td { padding: 0; border: 0; }
    .tbl .item { grid-column: 1; max-width: none; white-space: normal; }
    .tbl .r { grid-column: 2; grid-row: 1; }
    .tbl .c-sec { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
    .filters { width: 100%; }
    .filters .input, .filters #orderSearch { flex: 1 1 140px; min-width: 0; }
    .plan-cards { grid-template-columns: 1fr; }
    .pick-plat { grid-template-columns: 1fr; }
    .sheet { padding: 0; place-items: end stretch; }
    .sheet-panel, .sheet-panel.narrow { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .input, .textarea, .composer textarea { font-size: 16px; }
    .toast { bottom: calc(var(--tab-h) + 14px); }
    .l-hero { grid-template-columns: 1fr; padding: 28px 0 40px; gap: 32px; }
    .l-feats, .l-prices { grid-template-columns: 1fr; }
    .legal { margin-bottom: 0; }
    .kv { grid-template-columns: 110px minmax(0, 1fr); }
    .panel { padding: 16px; }
    .vb-item { grid-template-columns: minmax(0, 1fr); }
    .vb-item .acts { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}
@media (max-width: 420px) {
    .presets { grid-template-columns: repeat(2, 1fr); }
    .acc-grid, .plug-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
