/* Дизайн · Цвета, шрифты, раскладка. Светлая и тёмная тема. */
:root {
  --bg: #f4f5f2;
  --side: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f1f3ef;
  --border: #e2e5df;
  --text: #17201b;
  --muted: #6b756f;
  --accent: #0e7a5a;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --neg: #c0412c;
  --neg-soft: #fbe8e3;
  --warn: #a86d12;
  --warn-soft: #faf0da;
  --shadow: 0 1px 2px rgba(20, 30, 25, .04), 0 4px 16px rgba(20, 30, 25, .04);
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311; --side: #121815; --surface: #161d19; --surface-2: #1c2420; --border: #28312c;
    --text: #e6ece8; --muted: #8f9c95; --accent: #3cc58f; --accent-ink: #06130d; --accent-soft: #163428;
    --neg: #f07c66; --neg-soft: #3a1d17; --warn: #e3ad4f; --warn-soft: #362a12;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1311; --side: #121815; --surface: #161d19; --surface-2: #1c2420; --border: #28312c;
  --text: #e6ece8; --muted: #8f9c95; --accent: #3cc58f; --accent-ink: #06130d; --accent-soft: #163428;
  --neg: #f07c66; --neg-soft: #3a1d17; --warn: #e3ad4f; --warn-soft: #362a12;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 650; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--accent); }
.neg { color: var(--neg); }
.hidden { display: none !important; }

/* ── Раскладка ─────────────────────────── */
.layout { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); border-right: 1px solid var(--border); padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; font-weight: 650; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { stroke: var(--accent-ink); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px 4px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted);
  font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; gap: 6px; }
.side-user { flex: 1; font-size: 13px; color: var(--muted); padding-left: 8px; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.scrim { display: none; }
.main { min-width: 0; padding: 28px 36px 60px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Карточки и сетки ─────────────────── */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat.accent .stat-label, .stat.accent .stat-sub { color: inherit; opacity: .8; }

/* ── Кнопки, поля ─────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 550; font-size: 14px; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--neg); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 7px; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input {
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { width: auto; padding-right: 30px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.field-row:last-child { border-bottom: 0; }
.field-row .input { text-align: right; }
.suffix { position: relative; }
.suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.suffix .input { padding-right: 30px; }
.amounts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.amounts .input { text-align: center; padding: 8px 4px; }
.check { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.switch { display: flex; align-items: center; justify-content: flex-end; }

/* ── Метки ───────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.bad { background: var(--neg-soft); color: var(--neg); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--accent); } .dot.bad { background: var(--neg); } .dot.run { background: var(--warn); }

/* ── Таблицы ─────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 550; font-size: 12px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
th.r, td.r { text-align: right; }
.sym { font-weight: 650; letter-spacing: .01em; }
.cell-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.fail { color: var(--neg); font-size: 13px; max-width: 320px; }

/* ── Табы-переключатели ──────────────── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 550; font-size: 14px; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Покупки ─────────────────────────── */
.pick { display: grid; grid-template-columns: 34px 1fr 160px 90px 34px; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--surface-2); }
.rank { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 650; font-size: 13px; color: var(--muted); }
.pick-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-amount { text-align: right; font-weight: 650; font-size: 16px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.score { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.bought .sym, .bought .pick-amount { text-decoration: line-through; opacity: .55; }

/* ── Списки и строки ─────────────────── */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 550; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.mark { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; margin-top: 1px; }
.mark.ok { background: var(--accent-soft); color: var(--accent); }
.mark.bad { background: var(--neg-soft); color: var(--neg); }
.mark.warn { background: var(--warn-soft); color: var(--warn); }
.hbar { display: grid; grid-template-columns: 92px 1fr 64px; gap: 12px; align-items: center; font-size: 14px; padding: 6px 0; }
.hbar .bar { height: 10px; }
pre.report { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; line-height: 1.6; margin: 0; background: var(--surface-2); border-radius: 10px; padding: 16px; overflow-x: auto; }

/* ── График ──────────────────────────── */
.chart { width: 100%; height: 240px; display: block; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .line.down { stroke: var(--neg); }
.chart .area { fill: var(--accent); opacity: .09; }
.chart .area.down { fill: var(--neg); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }

/* ── Поиск ───────────────────────────── */
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 36px; }

/* ── Вход ────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login .brand { justify-content: center; font-size: 20px; margin-bottom: 8px; }
.login .card { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login .btn { justify-content: center; padding: 11px; }
.error { background: var(--neg-soft); color: var(--neg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note { font-size: 13px; color: var(--muted); text-align: center; }

/* ── Уведомления ─────────────────────── */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .2s; z-index: 50; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Телефон и планшет ───────────────── */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .layout.menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; display: none; }
  .layout.menu-open .scrim { display: block; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--border); }
  .topbar-title { font-weight: 600; }
  .main { padding: 18px 16px 48px; }
  h1 { font-size: 22px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 30px 1fr 74px 30px; padding: 12px 14px; gap: 10px; }
  .pick .score { display: none; }
  .hide-sm { display: none; }
  td, th { padding: 10px 10px; }
  .field-row { grid-template-columns: 1fr 120px; }
  .amounts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) { .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } .stat-value { font-size: 22px; } .card { padding: 14px 16px; } }
.section-title { font-size: 20px; margin-top: 12px; }
.layout > div { min-width: 0; }
.stack > .btn, .stack > a.btn { align-self: flex-start; }
.pick > div { min-width: 0; }

/* ── Диалог ──────────────────────────── */
.dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(0,0,0,.4); }
.dialog p { margin: 0; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Счёт ────────────────────────────── */
.account-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 14px; }
.account-strip:hover { border-color: var(--accent); }
.warn-card { border-color: var(--warn); background: var(--warn-soft); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg.val::before { background: var(--accent); }
.lg.inv::before { background: var(--muted); }
.chart .line-inv { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .line-dot { fill: var(--accent); }
.chart .line-inv-dot { fill: var(--muted); }
.pick.best .rank { background: var(--accent-soft); color: var(--accent); }
p.muted .icon { vertical-align: -4px; }
.plan-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -8px 0 16px; font-size: 14px; }

/* ── Интерактивный график ────────────── */
.pchart-head { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; min-height: 30px; font-size: 14px; }
.pchart-price { font-size: 22px; letter-spacing: -.01em; }
.tabs.small { margin: 10px 0 6px; }
.tabs.small .tab { padding: 4px 11px; font-size: 13px; }
.pchart .chart { height: 260px; touch-action: pan-y; cursor: crosshair; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart .cross-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .hidden { display: none; }

/* ── Сворачиваемое боковое меню (компьютер) ── */
@media (min-width: 901px) {
  .layout { transition: grid-template-columns .15s; }
  .layout.side-collapsed { grid-template-columns: 68px 1fr; }
  .layout.side-collapsed > div:last-child { grid-column: 2; }
  .side-collapsed .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 68px; z-index: 40; overflow-x: hidden;
    transition: width .15s ease, box-shadow .15s; padding: 18px 10px;
  }
  .side-collapsed .sidebar:hover { width: 252px; box-shadow: 0 0 40px rgba(0,0,0,.15); transition-delay: .12s; }
  .side-collapsed .sidebar:not(:hover) .nav-item span,
  .side-collapsed .sidebar:not(:hover) .brand-text,
  .side-collapsed .sidebar:not(:hover) .side-user { display: none; }
  .side-collapsed .sidebar:not(:hover) .nav-label { height: 1px; padding: 0; margin: 8px 6px; background: var(--border); color: transparent; overflow: hidden; }
  .side-collapsed .sidebar:not(:hover) .nav-item { justify-content: center; padding: 9px 0; }
  .side-collapsed .sidebar:not(:hover) .brand { justify-content: center; padding: 4px 0 6px; }
  .side-collapsed .sidebar:not(:hover) .side-foot { flex-direction: column; }
  .nav-item, .brand { white-space: nowrap; }
}

/* ── Дивизионы: 6 столбиков рядом ── */
.board-note { margin: -6px 0 12px; font-size: 13px; }
.div-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: start; }
.bcol { padding: 0; overflow: hidden; }
.bcol.active { border-color: var(--accent); }
.bhead { display: block; width: 100%; text-align: left; border: 0; background: var(--surface-2); padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.bhead:hover { background: var(--accent-soft); }
.btitle { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bmeta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.bmeta span { overflow: hidden; text-overflow: ellipsis; }
.blist { display: flex; flex-direction: column; }
.bpick { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 18px; gap: 6px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.bpick:last-child { border-bottom: 0; }
.bpick:hover { background: var(--surface-2); }
.bpick .check { width: 16px; height: 16px; }
.brank { font-size: 11px; color: var(--muted); text-align: center; }
.bmain { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.bsym { display: flex; gap: 4px; align-items: center; }
.bsub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bamt { font-weight: 600; font-size: 12px; }
.bpick .star { color: var(--warn); font-size: 12px; }
.bpick .up { color: var(--accent); font-size: 12px; font-weight: 700; }
.bpick.best { background: var(--accent-soft); }
.bpick.bought .sym, .bpick.bought .bamt { text-decoration: line-through; opacity: .55; }
.bpick.out { opacity: .7; }
.empty.small { padding: 18px 10px; font-size: 13px; }
.div-board + p, .div-board + .tabs { margin-top: 16px; }
@media (max-width: 1200px) { .div-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .div-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 330px) { .div-board { grid-template-columns: 1fr; } }
.steps { margin: 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.card.pair { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--surface-2); box-shadow: none; }

/* ── skriner: верхняя панель, вход, согласие, cookie, подвал ── */
.content { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar { display: flex !important; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--bg);
  padding: 10px 36px; border-bottom: 1px solid var(--border); }
.topbar .menu-btn, .topbar .top-brand { display: none; }
.topbar-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.input.lang, select.lang { width: auto; padding: 6px 28px 6px 10px; font-size: 13px; }
.userbox { display: flex; align-items: center; gap: 8px; }
.user-mail { font-size: 13px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 16px 36px 24px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.footer-links { display: flex; gap: 16px; }
.footer a, .legal a, .checkline a { text-decoration: underline; }
.dialog.auth, .dialog.gate { width: min(440px, calc(100vw - 32px)); }
.dialog.gate { width: min(560px, calc(100vw - 32px)); }
.dialog.gate p { line-height: 1.55; }
.dialog-x { position: absolute; right: 10px; top: 10px; }
.dialog { position: relative; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 14px; text-decoration: underline; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.checkline .check { margin-top: 2px; flex: none; }
.gate-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.small { font-size: 12px; }
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.18);
  padding: 12px 16px; font-size: 14px; max-width: 760px; margin: 0 auto; }
.cookie-bar span { flex: 1; min-width: 220px; }
.cookie-bar a { text-decoration: underline; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 650; font-size: 14px; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.notice { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); padding: 12px 16px; font-size: 14px; color: var(--muted); }
.notice.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.legal section + section { margin-top: 18px; }
.legal h2 { font-size: 16px; margin-bottom: 6px; }
.legal p { margin: 0; line-height: 1.6; }
.bigcode { font-family: var(--mono); font-size: 32px; letter-spacing: .2em; font-weight: 700; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; }
.invite .input[type=email] { flex: 1; min-width: 220px; }
a.brand { color: inherit; }
@media (max-width: 900px) {
  .topbar { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .top-brand { display: inline; font-weight: 700; }
  .topbar-title { display: none; }
  .user-mail { display: none; }
  .footer { padding: 14px 16px 90px; }
}

/* ═════════════ Дизайн v2 · skriner: современный «технологичный» вид ═════════════ */
:root {
  --bg: #f5f7fb; --side: rgba(255,255,255,.72); --surface: #ffffff; --surface-2: #f1f4f9; --border: #e3e8f1;
  --text: #0b1220; --muted: #5d677a; --accent: #059669; --accent-2: #4f46e5; --accent-ink: #ffffff; --accent-soft: #e3f7ef;
  --neg: #dc2645; --neg-soft: #fde8ec; --warn: #b26b00; --warn-soft: #fdf1dc;
  --glow: rgba(5,150,105,.14); --grid: rgba(15,23,42,.045);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 28px rgba(15,23,42,.06);
  --radius: 16px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a13; --side: rgba(10,15,28,.78); --surface: #0d1424; --surface-2: #131c30; --border: #1d2840;
    --text: #e7edf7; --muted: #8d99b0; --accent: #34d399; --accent-2: #818cf8; --accent-ink: #04120c; --accent-soft: rgba(52,211,153,.12);
    --neg: #fb7185; --neg-soft: rgba(251,113,133,.12); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.12);
    --glow: rgba(52,211,153,.10); --grid: rgba(148,163,184,.055);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060a13; --side: rgba(10,15,28,.78); --surface: #0d1424; --surface-2: #131c30; --border: #1d2840;
  --text: #e7edf7; --muted: #8d99b0; --accent: #34d399; --accent-2: #818cf8; --accent-ink: #04120c; --accent-soft: rgba(52,211,153,.12);
  --neg: #fb7185; --neg-soft: rgba(251,113,133,.12); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.12);
  --glow: rgba(52,211,153,.10); --grid: rgba(148,163,184,.055);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
}

/* Фон: тонкая сетка и мягкое свечение сверху */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 18% -8%, var(--glow), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-attachment: fixed;
  letter-spacing: -.005em;
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.num, .stat-value, .pick-amount, .bamt, .bigcode { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.page-head p { max-width: 760px; }

/* Логотип: градиентный знак и надпись */
.brand-mark { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.brand-mark svg { stroke: #fff; }
.brand-text, .top-brand { font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--accent) 70%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Боковое меню и верхняя панель — полупрозрачные, с размытием */
.sidebar { background: var(--side); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-right: 1px solid var(--border); }
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent) !important; backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); }
.nav-item { position: relative; border-radius: 12px; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent-2)); }
.nav-label { letter-spacing: .12em; font-size: 10.5px; }

/* Карточки: тонкая рамка, лёгкое стекло, свечение рамки при наведении */
.card { border-radius: var(--radius); border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s, transform .2s; }
a.card:hover, .bcol:hover, .account-strip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.card-head h2, h2 { letter-spacing: -.01em; }
.stat-label { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 700; }
.stat.accent { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 75%, var(--accent)));
  border-color: transparent; box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 28%, transparent); color: #fff; }
.stat.accent .stat-label, .stat.accent .stat-sub { color: #fff; opacity: .85; }
.notice { backdrop-filter: blur(6px); }

/* Кнопки и поля */
.btn { border-radius: 12px; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 55%, var(--accent)));
  border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn:focus-visible, .input:focus, .tab:focus-visible, .check:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.input, select.input { border-radius: 12px; background: var(--surface); }
.tab { border-radius: 999px; font-weight: 600; }
.tab.active { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 55%, var(--accent))); color: #fff; border-color: transparent; }
.badge { border: 1px solid transparent; letter-spacing: .01em; }
.badge.ok { border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.badge.bad { border-color: color-mix(in srgb, var(--neg) 25%, transparent); }
.badge.warn { border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.chip { border: 1px solid var(--border); background: var(--surface); font-family: var(--mono); font-size: 13px; }
.chip:hover { border-color: var(--accent); }

/* Таблицы: заголовки как в терминале, подсветка строки */
th { text-transform: uppercase; letter-spacing: .07em; font-size: 10.5px; font-weight: 650; background: transparent; }
thead tr { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tbody tr.click:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sym { font-family: var(--mono); font-weight: 700; letter-spacing: -.01em; }

/* Дивизионы: акцентная полоса сверху колонки */
.bcol { position: relative; }
.bcol::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .55; }
.bcol.active::before { opacity: 1; height: 3px; }
.bcol.active { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.bhead { background: transparent; }
.bhead:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.bpick.best { background: linear-gradient(90deg, var(--accent-soft), transparent); }
.bpick:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.rank, .brank { font-family: var(--mono); }

/* График: свечение линии */
.chart .line { stroke-width: 2.2; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent)); }
.chart .area { opacity: .12; }
.pchart-price { font-family: var(--mono); font-size: 26px; }

/* Окна, плашки, подвал */
.dialog { border-radius: 20px; border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(3,7,18,.55); backdrop-filter: blur(4px); }
.cookie-bar { border-radius: 16px; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.footer { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.toast { border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.skeleton { border-radius: var(--radius); }
.score .bar > i, .bar > i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
@media (max-width: 480px) {
  .stat-value { font-size: 19px; overflow-wrap: anywhere; }
  .stat-label { font-size: 10px; }
  h1 { font-size: 24px; }
}
.stat, .card { min-width: 0; }
