/* KingBet — общие стили приложения и связанных страниц. */
/* Размеры шрифта в rem, а не в пикселях: иначе системная настройка размера
   текста (в том числе в Telegram) не действует на приложение. */
/* Onest (SIL OFL): вариативный 100–900; рабочие веса 450/550/650. */
@font-face {
  font-family: 'Onest';
  src: url('../fonts/Onest.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}
html { font-size: 100%; }
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ============ Dark theme (default): тёплый уголь + золото ============ */
:root {
  --bg: #070605;
  --bg2: #0b0a08;
  --card-solid: #14120e;
  --card2: #1e1b15;
  --line: rgba(255,255,255,0.07);
  --line-gold: rgba(233,191,102,0.35);
  --text: #f2f0eb;
  --muted: #9a9488;
  --accent: #e9bf66;
  --accent2: #f3d78e;
  --gold: #e9bf66;
  --gold-deep: #c08b2e;
  --gold-soft: rgba(233,191,102,0.12);
  --on-gold: #201806;
  --green: #49ce94;
  --red: #ff6079;
  --red-soft: #ff8fa0;
  --radius: 20px;

  /* surfaces & effects */
  --sheen: rgba(255,248,230,.03);
  --glass: rgba(26,23,17,.68);
  --tabbar-bg: rgba(12,11,9,.92);
  --panel-warm: #1f1a10;
  --sessbar-grad: linear-gradient(120deg, rgba(233,191,102,.15), rgba(20,18,14,.94) 52%);
  --tot-bg: rgba(255,255,255,0.045);
  --tot-bg-on: rgba(255,255,255,0.07);
  --shadow: 0 10px 34px rgba(0,0,0,.55);
  --card-hover-shadow: 0 12px 30px rgba(0,0,0,.5);
  --bar-shadow: 0 8px 24px rgba(0,0,0,.45);
  --scroll-thumb: #3a352c;
  --dot-off: #38332a;
  --fav-off: #403a2e;
  --icon-off: #5c5546;
  --wtext: #ccc5b6;
  --brand-bet: #f2f0eb;
  --brand-king: #e9bf66;
  --brand-king-a: #f3d78e;
  --brand-king-b: #c08b2e;
  --chip-black: #1e1e22;
  --chip-black-line: #3a3a42;
  --tip-bg: #0c0a07;
  --tip-text: #f0e9d8;
  --toast-bg: rgba(20,18,14,.96);
  --glow: .55;

  /* strategy line colors */
  --s-ab: #ff4968;
  --s-eo: #ffd44e;
  --s-rb: #e9eaf0;
  --s-lh: #489fff;

  /* canvas chart palette */
  --ch-grid: rgba(255,255,255,0.06);
  --ch-vgrid: rgba(255,255,255,0.05);
  --ch-label: rgba(255,255,255,0.45);
  --ch-axis: rgba(255,255,255,0.55);
  --ch-axis-text: rgba(255,255,255,0.8);
  --ch-zone1: rgba(233,191,102,0.05);
  --ch-zone2: rgba(233,191,102,0.035);
  --ch-zone-line: rgba(233,191,102,0.16);
  --ch-cross: rgba(255,255,255,0.55);
  --ch-tip-bg: #0c0a07;
  --ch-tip-border: rgba(233,191,102,0.35);
  --ch-tip-sub: rgba(255,255,255,0.6);
  --ch-spark-zero: rgba(255,255,255,0.18);
}

/* ============ Light theme: тёплая слоновая кость ============ */
:root[data-theme="light"] {
  --bg: #f7f3ea;
  --bg2: #fffdf8;
  --card-solid: #ffffff;
  --card2: #f0e9da;
  --line: rgba(46,36,16,0.10);
  --line-gold: rgba(128,91,22,0.32);
  --text: #1a170f;
  --muted: #6e6858;
  --accent: #d9a62e;
  --accent2: #a57706;
  --gold: #805b16;
  --gold-deep: #6f4d12;
  --gold-soft: rgba(128,91,22,0.10);
  --on-gold: #201806;
  --green: #127447;
  --red: #b51e3a;
  --red-soft: #b51e3a;

  --sheen: rgba(255,255,255,0);
  --glass: rgba(255,253,248,.72);
  --tabbar-bg: rgba(255,253,248,.94);
  --panel-warm: #fdf5e0;
  --sessbar-grad: linear-gradient(120deg, rgba(233,191,102,.18), rgba(255,252,245,.96) 52%);
  --tot-bg: rgba(46,36,16,0.04);
  --tot-bg-on: rgba(46,36,16,0.06);
  --shadow: 0 10px 30px rgba(90,70,20,.13);
  --card-hover-shadow: 0 12px 26px rgba(90,70,20,.15);
  --bar-shadow: 0 8px 20px rgba(90,70,20,.12);
  --scroll-thumb: #d6cfc0;
  --dot-off: #d9d2c2;
  --fav-off: #c6bda9;
  --icon-off: #a79d8a;
  --wtext: #4a4438;
  --brand-bet: #1a170f;
  --brand-king: #936818;
  --brand-king-a: #c08b2e;
  --brand-king-b: #805b16;
  --chip-black: #24242a;
  --chip-black-line: #3f3f48;
  --tip-bg: #1e190e;
  --tip-text: #f6efdc;
  --toast-bg: rgba(255,253,247,.97);
  --glow: 0;

  --s-ab: #e91340;
  --s-eo: #a57706;
  --s-rb: #292a32;
  --s-lh: #006bef;

  --ch-grid: rgba(0,0,0,0.07);
  --ch-vgrid: rgba(0,0,0,0.05);
  --ch-label: rgba(0,0,0,0.45);
  --ch-axis: rgba(0,0,0,0.5);
  --ch-axis-text: rgba(0,0,0,0.75);
  --ch-zone1: rgba(128,91,22,0.05);
  --ch-zone2: rgba(128,91,22,0.035);
  --ch-zone-line: rgba(128,91,22,0.45);
  --ch-cross: rgba(0,0,0,0.5);
  --ch-tip-bg: #ffffff;
  --ch-tip-border: rgba(128,91,22,0.4);
  --ch-tip-sub: rgba(0,0,0,0.55);
  --ch-spark-zero: rgba(0,0,0,0.2);
}

/* ============ Фокус и движение ============ */
/* Видимый фокус обязателен: без него клавиатурой пользоваться нельзя вслепую
   (WCAG 2.4.7). :focus-visible не мешает тем, кто работает мышью. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 10px;
}
/* убираем двойную рамку у полей, у них своя подсветка */
.input:focus-visible, .select:focus-visible { outline-offset: 0; }

/* Единый язык движения: три длительности и два ускорения. Раньше значения
   были россыпью (0,12–1,0 с, четыре разных easing) — интерфейс выглядел
   собранным из разных продуктов. */
:root {
  --dur-fast: 120ms;   /* микро-отклик: нажатие, наведение */
  --dur-base: 200ms;   /* появление, смена состояния */
  --dur-slow: 320ms;   /* переход экрана */
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --ease-in: cubic-bezier(.4, 0, .7, .2);
}

/* Отступы под чужой интерфейс. Telegram рисует свою панель (закрыть, «⌄»,
   «…») ПОВЕРХ мини-аппа, а на телефонах вебвью заходит под статусбар и
   индикатор home. Точные значения приходят из app.js в --tg-*; env() —
   страховка для клиентов, которые их не сообщают. */
:root {
  --tg-top: 0px;
  --tg-bottom: 0px;
  --tg-left: 0px;
  --tg-right: 0px;
  /* запас под кнопки Telegram в полноэкранном режиме: их ставит app.js */
  --tg-ctl: 0px;
  --safe-top: max(var(--tg-top), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-bottom), env(safe-area-inset-bottom, 0px));
  --safe-left: max(var(--tg-left), env(safe-area-inset-left, 0px));
  --safe-right: max(var(--tg-right), env(safe-area-inset-right, 0px));
  --veil: rgba(10, 9, 8, .55);
}

html, body { height: 100%; }
body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(233,191,102,.12) 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 15%, rgba(233,191,102,.06) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Onest', Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 450;
  font-size: 0.875rem;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-slow) ease, color var(--dur-slow) ease;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
b { color: var(--text); }

/* ---------- icons (SVG sprite, наследуют currentColor) ---------- */
.ico { vertical-align: -0.16em; flex-shrink: 0; }
/* кнопки только с иконкой */
#detailBack, #detailFav, #favFilter { display: flex; align-items: center; justify-content: center; }
button .ico, .advice-bet .ico, h3 .ico { pointer-events: none; }
.empty .big .ico { color: var(--gold); opacity: .55; }
.advice-reason .ico { color: var(--gold); }
.confirm-warn .ico { color: var(--gold); }
.toast .ico { color: var(--gold); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- tooltips (JS-движок: прижим к краям экрана + long-press) ---------- */
.rr-tip {
  position: fixed; z-index: 600;
  background: var(--tip-bg);
  border: 1px solid var(--line-gold);
  color: var(--tip-text); padding: 12px 14px; border-radius: 12px;
  font-size: 0.8125rem; font-weight: 400; line-height: 1.55; text-align: start;
  max-width: min(310px, calc(100vw - 24px)); box-sizing:border-box;
  overflow-wrap:anywhere;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  animation: tipIn var(--dur-fast) var(--ease-out);
}
.rr-tip .tip-title { font-size:.875rem; font-weight:650; margin-bottom:8px; }
.rr-tip .tip-section + .tip-section { margin-top:9px; }
.rr-tip .tip-heading { font-weight:550; margin-bottom:5px; }
.rr-tip .tip-rule { padding:3px 0; font-variant-numeric:tabular-nums; }
.rr-tip .tip-line + .tip-line { margin-top:3px; }
@keyframes tipIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* Длинное нажатие на элемент с подсказкой не должно вызывать системную лупу
   и выделение текста — на телефонах подсказку рисуем сами. */
[data-tip] { -webkit-touch-callout: none; }

/* ---------- Welcome ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--panel-warm) 0%, transparent 60%),
    radial-gradient(800px 400px at 50% 110%, rgba(233,191,102,.08) 0%, transparent 60%),
    var(--bg);
  display: flex;
  overflow-y: auto;
}
/* Центрирование через margin:auto, а не align-items:center: при переполнении
   (первый слайд с легендой выше экрана) flex-центрирование обрезало верх —
   логотип и начало карточки оказывались недостижимы для скролла. */
.welcome-inner {
  margin: auto;
  max-width: 420px; width: 100%; text-align: center;
  padding: calc(24px + var(--safe-top)) calc(22px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(22px + var(--safe-left));
}
.welcome-logo {
  position: relative; display: flex; justify-content: center; margin-bottom: 2px;
  /* однократное появление: бесконечное покачивание отвлекало от текста */
  animation: floatyIn var(--dur-slow) var(--ease-out);
  filter: drop-shadow(0 10px 26px rgba(233,191,102,.5));
}
/* золотое сияние за короной */
.welcome-logo::before {
  content: ''; position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: 220px; height: 160px; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(233,191,102,.32), rgba(233,191,102,.08) 55%, transparent 72%);
  animation: haloIn var(--dur-slow) var(--ease-out);
}
@keyframes haloIn { from { opacity: 0; transform: translate(-50%,-50%) scale(.9); } to { opacity: .85; transform: translate(-50%,-50%) scale(1); } }
@keyframes floatyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.welcome h1 { margin-bottom: 10px; }
.brand-rule {
  width: 168px; height: 2px; margin: 2px auto 20px;
  background: linear-gradient(90deg, transparent, var(--gold) 22%, #fff3c4 50%, var(--gold) 78%, transparent);
  border-radius: 2px; opacity: .85;
}
.wslide {
  display: none; text-align: left;
  background: linear-gradient(165deg, var(--sheen), transparent 45%), var(--card-solid);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-height: 300px;
  box-shadow: var(--shadow);
}
/* листание: слайд заезжает со стороны, в которую листают (--dir: 1|-1) */
.wslide.active { display: block; animation: wSlideIn var(--dur-slow) var(--ease-out); }
@keyframes wSlideIn {
  from { opacity: 0; transform: translateX(calc(22px * var(--dir, 1))); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .wslide.active { animation: none; } }
.wslide h2 { font-size: 1.125rem; margin-bottom: 12px; color: var(--gold); letter-spacing: .3px; }
.wslide p { margin-bottom: 10px; line-height: 1.55; color: var(--wtext); }
.strat-legend { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; }
.strat-legend span { display: flex; align-items: center; gap: 9px; font-size: 0.8125rem; }
.strat-legend i { width: 20px; height: 4px; border-radius: 2px; display: inline-block; }
/* стрелки по бокам слайдов — только на широком экране: на телефоне они
   съедали ширину карточки, текст переносился сильнее и слайд не влезал
   в один экран с логотипом; листание — свайпами */
.welcome-nav {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 8px; align-items: center;
}
.w-arrow {
  display: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex: 0 0 auto;
  transition: opacity var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
@media (min-width: 900px) {
  .welcome-nav { grid-template-columns: auto minmax(0, 1fr) auto; }
  .w-arrow { display: flex; }
}
.w-arrow:hover:not(:disabled) { border-color: var(--line-gold); color: var(--text); }
.w-arrow:active:not(:disabled) { transform: scale(.92); }
.w-arrow:disabled { opacity: .3; cursor: default; }
.w-arrow svg { display: block; }
[dir="rtl"] .w-arrow svg { transform: scaleX(-1); }
.welcome-dots { margin: 18px 0; display: flex; gap: 7px; justify-content: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-off); transition: var(--dur-base); }
.dot.active { background: linear-gradient(90deg, var(--accent), var(--gold)); width: 24px; border-radius: 5px; }
/* кнопки завершения: стеком с зазором — раньше слипались */
.welcome-actions { display: grid; gap: 10px; }
.welcome-actions .btn { width: 100%; }
/* панель «Начать» видна только на последнем слайде; display:grid перебивал
   бы UA-стиль [hidden] — как раньше случилось с кнопкой «Пропустить» */
.welcome-actions[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons / inputs ---------- */
/* Одна золотая кнопка на экран, остальные тихие. Бегущих блик-градиентов нет
   намеренно: от них интерфейс выглядит дешёвым. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  border-radius: 12px; padding: 11px 16px; font-size: 0.875rem; font-weight: 550;
  min-height: 44px;                 /* цель нажатия по правилам платформ */
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.btn:hover { border-color: var(--line-gold); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, #e7ba46, #ca9720);
  border-color: transparent; color: var(--on-gold); font-weight: 550;
}
.btn-primary:hover { background: linear-gradient(180deg, #f0c75c, #d5a12a); }
.btn-lg { width: 100%; padding: 13px; font-size: 0.9375rem; }
.btn-ghost, .btn-quiet { background: transparent; }
.btn-quiet:hover { background: var(--card2); }
.btn-danger { background: transparent; border-color: rgba(255,77,94,.32); color: var(--red); }
.btn-danger:hover { background: rgba(255,77,94,.09); border-color: rgba(255,77,94,.6); }
/* Активный Confirm — заливка, чтобы его нельзя было спутать с отключенной:
   обе стоят рядом и раньше выглядели одинаково прозрачными. */
.btn-success { background: var(--green); border-color: var(--green); color: #0b2b1b; font-weight: 550; }
.btn-success:disabled { background: transparent; color: var(--green); opacity: .45; }
.btn-icon { padding: 10px; }

.select, .input {
  background: var(--card-solid); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-size: 0.875rem; font-family: inherit;
  min-height: 44px;                 /* палец, а не курсор */
  min-width: 0; transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,191,102,.14); }

/* Метки и числа. Деньги никогда не переносятся, знак валюты — тише суммы,
   цифры табличные: в столбцах они не пляшут. */
.lbl-cap {
  font-size: 0.625rem; font-weight: 550; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--muted);
}
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.money i { font-style: normal; font-size: .78em; font-weight: 550; opacity: .5; margin-left: .3em; }
.money .king-unit { display:inline-block; vertical-align:baseline; opacity:1; position:relative; }
.king-crown { display:inline-block; width:1em; height:1em; vertical-align:-.08em; }
.king-unit-name { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--gold)); flex: 0 0 auto; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; font-size: 0.7188rem; font-weight: 550;
  background: var(--tot-bg); color: var(--muted);
}
.pill.hot { background: rgba(255,77,94,.11); color: var(--red-soft); }
.pill.warm { background: var(--gold-soft); color: var(--gold); }
.pill.live { background: rgba(47,213,117,.1); color: var(--green); }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(13px + var(--safe-top)) calc(16px + var(--safe-right) + var(--tg-ctl, 0px)) 11px calc(16px + var(--safe-left));
  border-bottom: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(12px);
}
.app-title { display: flex; align-items: center; gap: 10px; }
.app-logo { display: block; }
/* корона и надпись без пульсации и бегущего блика: спокойное золото читается дороже */
.brand-crown { filter: drop-shadow(0 1px 5px rgba(233,191,102,.35)); }
.brand-king {
  background-image: linear-gradient(180deg, #f6dd93 0%, #e4bb52 45%, #c8951f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="light"] .brand-king {
  background-image: linear-gradient(180deg, #d9a62e 0%, #b98713 55%, #8f6708 100%);
}
.brand-bet { color: var(--brand-bet); margin-left: 4px; }
/* крупный логотип на приветствии: размер в vw, чтобы не вылезал на узком экране */
.brand-lg { font-size: clamp(34px, 12.5vw, 52px); letter-spacing: .5px; font-weight: 650; line-height: 1.05; }
.brand-lg .brand-bet { margin-left: 7px; }
.welcome-logo svg { width: clamp(220px, 62vw, 320px); height: auto; }
.live-dot { display: flex; align-items: center; gap: 6px; font-size: 0.6562rem; color: var(--muted); font-weight: 550; letter-spacing: 1px; }
/* только первый span — точка; подпись и время не должны в неё превращаться */
.live-dot > span:first-child {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  transition: background-color var(--dur-base), box-shadow var(--dur-base);
}
/* импульс только на настоящий спин, а не бесконечное мерцание */
.live-dot > span:first-child.beat { animation: beat 600ms var(--ease-out); }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(47,213,117,.55); }
  100% { box-shadow: 0 0 0 9px rgba(47,213,117,0); }
}
/* связь потеряна: цвет, подпись и приглушённые числа — не только цвет */
.live-dot.stale > span:first-child { background: var(--gold); }
.live-dot.down > span:first-child { background: var(--muted); }
.live-dot .when { font-size: 0.5938rem; color: var(--muted); letter-spacing: 0; }
.stale-data { opacity: .55; transition: opacity var(--dur-base); }
/* правая группа шапки: переключатель «окно ↔ полный экран» и LIVE.
   Кнопка слева от LIVE: крестик Telegram перекрывает правый край шапки */
.header-right { display: flex; align-items: center; gap: 10px; }
.fs-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 auto; padding: 0;
  /* Меню Telegram перекрывает угол и в обычном окне: кнопку держим левее. */
  margin-right: 40px;
  background: none; border: none; border-radius: 8px;
  color: var(--muted); cursor: pointer;
  transition: color var(--dur-base), background-color var(--dur-base);
}
.fs-toggle:hover { color: var(--text); background: var(--gold-soft); }
.fs-toggle .ico { display: block; }

#views { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.view {
  padding: 14px calc(14px + var(--safe-right)) 28px calc(14px + var(--safe-left));
  animation: viewIn var(--dur-base) var(--ease-out);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view > h2 { font-size: clamp(1.625rem, 2.2vw, 2rem); font-weight: 550; letter-spacing: -.03em; margin-bottom: 6px; }
.view > .view-hint { font-size: 0.7812rem; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }

.tabbar {
  display: flex; border-top: 1px solid var(--line);
  background: var(--tabbar-bg); backdrop-filter: blur(12px);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}
.tab {
  flex: 1; background: none; border: none; color: var(--muted); font-size: 0.6562rem;
  padding: 9px 2px 10px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 3px; font-family: inherit; transition: color var(--dur-base); position: relative;
}
.tab::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%) scaleX(0);
  width: 30px; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent);
  transition: transform var(--dur-base) ease;
}
.tab.active::before { transform: translateX(-50%) scaleX(1); }
.tab-ico { display: flex; opacity: .55; transition: opacity var(--dur-base), transform var(--dur-fast) var(--ease-out); }
.tab-ico svg { display: block; }
.tab.active { color: var(--gold); }
.tab.active .tab-ico { opacity: 1; }

/* ---------- Сессия одной строкой (вкладка «Все столы») ---------- */
.sessbar {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  background: var(--card-solid); border: 1px solid var(--line-gold);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; cursor: pointer;
  transition: border-color var(--dur-base), background-color var(--dur-base);
}
.sessbar:hover { background: var(--card2); }
.sb-main { min-width: 0; }
.sessbar-link { display:flex; align-items:center; gap:10px; color:var(--gold); font-size:.8125rem; font-weight:600; }
.sessbar-link > span:first-child { max-width:110px; }
.sessbar-link .sessbar-go { flex-shrink:0; }
@media (max-width:480px) {
  .sessbar-link { flex-direction:column-reverse; gap:6px; text-align:center; max-width:90px; }
}
.session-mini-tables { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:8px 20px; min-width:0; }
.sessbar > .session-mini-tables { grid-column:1 / -1; border-top:1px solid var(--line); padding-top:12px; }
#sessTablesSummary { margin-top:16px; }
.session-mini-table { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; padding:8px 0; min-width:0; }
.smt-name { font-size:.8125rem; font-weight:600; overflow-wrap:anywhere; }
.smt-bet,.smt-progress { font-size:.75rem; color:var(--muted); }
.smt-bet { grid-row:2; grid-column:1 / -1; }
.smt-progress { grid-row:3; grid-column:1 / -1; }
.smt-result { grid-column:2; grid-row:1; font-size:.8125rem; white-space:nowrap; }
.sb-bal { font-size: 1.5rem; font-weight: 550; letter-spacing: -.03em; margin-top: 2px; }
.sb-sub { font-size: 0.7188rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-pills { display: flex; gap: 6px; }
.sessbar-go { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px;
  background: linear-gradient(160deg, #F3D78E 0%, #E9BF66 30%, #D8A744 65%, #C08B2E 100%);
  color: var(--on-gold); border: 1px solid rgba(243, 215, 142, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 4px 14px rgba(233, 191, 102, .25); }

/* Изменение баланса: цифры пересчитываются плавно, а поле вокруг них коротко
   пульсирует цветом направления — заметно с одного взгляда, но ничего не
   прыгает. Свечение рисуем внутренней тенью, чтобы не сдвигать вёрстку. */
.sh-balance, .sb-bal, .hc-sum { transition: color var(--dur-slow) ease; }
.flash-up { color: var(--green); }
.flash-down { color: var(--red); }

.pulse-field { border-radius: 14px; }
@keyframes pulseUp {
  0%   { background-color: rgba(47,213,117,0);    box-shadow: inset 0 0 0 1px rgba(47,213,117,0); }
  14%  { background-color: rgba(47,213,117,.20);  box-shadow: inset 0 0 0 1px rgba(47,213,117,.55); }
  55%  { background-color: rgba(47,213,117,.10);  box-shadow: inset 0 0 0 1px rgba(47,213,117,.25); }
  100% { background-color: rgba(47,213,117,0);    box-shadow: inset 0 0 0 1px rgba(47,213,117,0); }
}
@keyframes pulseDown {
  0%   { background-color: rgba(255,77,94,0);     box-shadow: inset 0 0 0 1px rgba(255,77,94,0); }
  14%  { background-color: rgba(255,77,94,.20);   box-shadow: inset 0 0 0 1px rgba(255,77,94,.55); }
  55%  { background-color: rgba(255,77,94,.10);   box-shadow: inset 0 0 0 1px rgba(255,77,94,.25); }
  100% { background-color: rgba(255,77,94,0);     box-shadow: inset 0 0 0 1px rgba(255,77,94,0); }
}
/* длительность равна пересчёту числа (420 мс + запас): раньше пульсация
   доигрывала уже после того, как цифры замерли */
.pulse-up { animation: pulseUp 520ms var(--ease-out); }
.pulse-down { animation: pulseDown 520ms var(--ease-out); }

/* ---------- Панель фильтров ---------- */
/* ---------- Панель фильтров и поиск ---------- */
/* Поиск отдельной строкой: на телефоне три органа управления в ряд уже тесно,
   а поле ввода должно быть широким. */
.toolbar { display: grid; gap: 8px; margin-bottom: 14px; }
.toolbar-row { display: flex; gap: 8px; }
.toolbar-row .select { flex: 1; min-width: 0; }

.search {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 12px; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
  transition: border-color var(--dur-base) var(--ease-out);
}
.search:focus-within { border-color: var(--line-gold); }
.search input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: none; outline: none; padding: 0;
  color: var(--text); font: inherit; font-size: 0.9375rem;
}
.search input::placeholder { color: var(--muted); }
/* родной крестик Safari/Chrome рядом с нашей кнопкой — это два крестика */
.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.s-clear {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-right: -6px; flex: 0 0 auto;
  background: none; border: none; border-radius: 50%;
  color: var(--muted); cursor: pointer; padding: 0;
}
.s-clear:hover { color: var(--text); background: var(--gold-soft); }

/* название стола в шапке окна: миниатюра, имя, метки — одной строкой */
.overlay-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.overlay-title .dt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-copy { flex: 0 0 36px; width: 36px; padding: 0; color: var(--muted); }

/* Панель фильтров: свёрнута по умолчанию, чтобы лента начиналась сразу. */
.filter-panel {
  display: grid; gap: 10px; padding: 12px;
  border-radius: 12px; background: var(--card2); border: 1px solid var(--line);
}
.fp-group { display: grid; gap: 7px; }
.fp-label {
  font-size: 0.6875rem; font-weight: 550; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
#filterToggle { display: flex; align-items: center; gap: 7px; padding: 10px 13px; flex: 0 0 auto; }
#filterToggle.on { color: var(--gold); border-color: var(--line-gold); }
.ft-label { font-size: 0.8125rem; font-weight: 550; }
.ft-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: var(--gold-ink, #14100a);
  font-size: 0.6875rem; font-weight: 550;
}
/* внутри раскрытой панели чипы переносятся: место выделено намеренно */
.filter-panel .chips { flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; }

/* Только что выпавшее число в открытой карточке: короткая вспышка, чтобы было
   видно, что спин пришёл, а не просто перерисовалась строка. */
@keyframes numFresh {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.numchip.fresh { animation: numFresh var(--dur-slow, .45s) var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .numchip.fresh { animation: none; } }

/* ---------- Микро-анимации: нажатия и появления ---------- */
/* Только transform/opacity — композитор, без reflow. Всё завёрнуто в
   no-preference: с «уменьшить движение» интерфейс статичен, как и раньше. */
@media (prefers-reduced-motion: no-preference) {
  /* нажатие: поверхность проседает под пальцем (transition у .tcard/.btn/
     .chip/.tab-ico дополнен transform в их базовых правилах) */
  .tcard:active { transform: scale(.985); }
  .btn:active { transform: translateY(1px); }
  .chip:active, .seg button:active { transform: scale(.96); }
  .dd-btn { transition: transform var(--dur-fast) var(--ease-out); }
  .dd-btn:active { transform: scale(.98); }
  .tab:active .tab-ico { transform: scale(.88); }

  /* вкладка активировалась — иконка пружинит */
  .tab.active .tab-ico { animation: tabPop .3s var(--ease-out); }
  @keyframes tabPop {
    0% { transform: scale(.7); }
    62% { transform: scale(1.12); }
    100% { transform: scale(1); }
  }

  /* карточка оффера собирается на глазах: блоки поднимаются каскадом */
  .confirm-card > * {
    animation: riseIn var(--dur-slow) var(--ease-out) both;
  }
  .confirm-card > :nth-child(2) { animation-delay: 40ms; }
  .confirm-card > :nth-child(3) { animation-delay: 80ms; }
  .confirm-card > :nth-child(4) { animation-delay: 120ms; }
  .confirm-card > :nth-child(n+5) { animation-delay: 150ms; }

  /* числа ставки выскакивают по одному — ставка «набирается» на глазах */
  .confirm-card .howto-nums .numchip {
    animation: numFresh .3s var(--ease-out) both;
    animation-delay: calc(150ms + var(--i, 0) * 18ms);
  }
}
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Спящий стол: метка приглушённая, а не тревожная — это обычное состояние
   ночью, а не поломка. */
.pill.sleep { background: var(--tot-bg); color: var(--muted); border: 1px solid var(--line); }

/* Чипы провайдеров: множественный выбор, «Все» сбрасывает. Цвет отметки — тот
   же, что у миниатюры этого провайдера, чтобы связь читалась без подписей. */
/* На телефоне пять чипов занимали две строки и отжимали первую карточку вниз.
   Держим их одной прокручиваемой строкой с затуханием у правого края, чтобы было
   видно: список продолжается. На широком экране места хватает — переносим. */
.chips {
  display: flex; gap: 7px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; white-space: nowrap; }
.chip {
  min-height: 34px; padding: 7px 12px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
  font-size: 0.8125rem; font-weight: 550; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out), transform .15s var(--ease-out);
}
.chip:hover { color: var(--text); }
.chip.on {
  color: var(--chip-ink, var(--gold)); border-color: var(--chip-ink, var(--line-gold));
  background: var(--chip-bg, var(--gold-soft));
}
.chip[data-provider="evolution"] { --chip-ink: #e0b96a; --chip-bg: rgba(224, 185, 106, .13); }
.chip[data-provider="pragmatic"] { --chip-ink: #7fb2e0; --chip-bg: rgba(127, 178, 224, .13); }
.chip[data-provider="playtech"]  { --chip-ink: #d78ab8; --chip-bg: rgba(215, 138, 184, .13); }
.chip[data-provider="ezugi"]     { --chip-ink: #7cc79a; --chip-bg: rgba(124, 199, 154, .13); }
:root[data-theme="light"] .chip[data-provider="evolution"] { --chip-ink: #8a6512; --chip-bg: rgba(138, 101, 18, .1); }
:root[data-theme="light"] .chip[data-provider="pragmatic"] { --chip-ink: #1c4f7c; --chip-bg: rgba(28, 79, 124, .1); }
:root[data-theme="light"] .chip[data-provider="playtech"]  { --chip-ink: #7d2757; --chip-bg: rgba(125, 39, 87, .1); }
:root[data-theme="light"] .chip[data-provider="ezugi"]     { --chip-ink: #1f6b3d; --chip-bg: rgba(31, 107, 61, .1); }

/* ---------- Миниатюра стола ---------- */
/* Картинок столов пока нет. Вместо пустого места — подложка с колесом,
   окрашенная по провайдеру: карточки различаются на глаз, а когда появятся
   фотографии, они встанут ровно в эту рамку. */
.tc-thumb {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(150deg, var(--thumb-a, var(--card2)), var(--thumb-b, var(--card)));
  border: 1px solid var(--line); color: var(--thumb-ink, var(--muted));
}
.tc-thumb.sm { width: 34px; height: 34px; border-radius: 9px; }
/* Монограмма и тонкое кольцо: намёк на колесо, чтобы плитка не выглядела
   просто цветным квадратом. */
.tc-thumb .mono {
  font-size: 1.0625rem; font-weight: 650; letter-spacing: .01em;
  color: var(--thumb-ink, var(--muted));
}
.tc-thumb.sm .mono { font-size: 0.75rem; }
.tc-thumb::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  border: 1px solid currentColor; opacity: .22; pointer-events: none;
}
.tc-thumb.sm::after { inset: 3px; }
.tc-thumb { position: relative; }
.tc-thumb:has(img)::after { display: none; }
.tc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-thumb[data-provider="evolution"] { --thumb-a: #3a2a12; --thumb-b: #171208; --thumb-ink: #e0b96a; }
.tc-thumb[data-provider="pragmatic"] { --thumb-a: #16283c; --thumb-b: #0b141d; --thumb-ink: #7fb2e0; }
.tc-thumb[data-provider="playtech"]  { --thumb-a: #33172a; --thumb-b: #190c15; --thumb-ink: #d78ab8; }
.tc-thumb[data-provider="ezugi"]     { --thumb-a: #16311f; --thumb-b: #0b170f; --thumb-ink: #7cc79a; }
:root[data-theme="light"] .tc-thumb[data-provider="evolution"] { --thumb-a: #f3e4c4; --thumb-b: #e6d2a7; --thumb-ink: #8a6512; }
:root[data-theme="light"] .tc-thumb[data-provider="pragmatic"] { --thumb-a: #d9e6f4; --thumb-b: #c3d6ea; --thumb-ink: #1c4f7c; }
:root[data-theme="light"] .tc-thumb[data-provider="playtech"]  { --thumb-a: #f2dbe9; --thumb-b: #e5c4d8; --thumb-ink: #7d2757; }
:root[data-theme="light"] .tc-thumb[data-provider="ezugi"]     { --thumb-a: #d8ecdf; --thumb-b: #bfdccb; --thumb-ink: #1f6b3d; }

/* хвост ленты: сколько показано и как показать ещё. В сетке карточек
   хвост обязан занимать всю строку — иначе на десктопе подпись и кнопка
   садятся в одну свободную ячейку и «съезжают» в сторону. */
.feed-tail, .empty {
  grid-column: 1 / -1;
}
.feed-tail {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 6px 0 2px; font-size: 0.8125rem;
}
.feed-tail .btn { min-width: 220px; }

/* ---------- Карточка стола ---------- */
#favFilter { color: var(--icon-off); padding: 10px 13px; flex: 0 0 auto; }
#favFilter.on { color: var(--gold); border-color: var(--line-gold); }

.cards { display: flex; flex-direction: column; gap: 12px; }
.tcard {
  display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr);
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px; cursor: pointer;
  transition: border-color var(--dur-base), background-color var(--dur-base), transform var(--dur-fast) var(--ease-out);
}
.tcard:hover { border-color: var(--line-gold); }
.tc-head { display: flex; align-items: flex-start; gap: 10px; }
.tc-name { flex: 1; min-width: 0; }
.tc-name h3 {
  font-size: 1rem; font-weight: 550; letter-spacing: .1px;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.tc-name h3 > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Метка состояния — не название: она не сжимается и не режется многоточием,
   иначе получалось «нет обновле…». Сокращается пусть название. */
.tc-name h3 > .pill { flex: 0 0 auto; overflow: visible; }
.tc-meta {
  display: block; margin-top: 4px; font-size: 0.7188rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* область нажатия 44×44 при той же иконке: 22px мало для пальца и ниже
   минимума WCAG 2.5.8 */
.tc-fav {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -11px -11px -11px 0;
  background: none; border: none; color: var(--fav-off);
  cursor: pointer; padding: 0; transition: color var(--dur-base) var(--ease-out);
}
.tc-fav.on { color: var(--gold); }
/* hover здесь выглядит как включённое состояние, а тач-экраны держат :hover
   после тапа до следующего касания: снятая звезда казалась золотой. Поэтому
   подсветка наведения — только там, где hover действительно есть. */
@media (hover: hover) {
  .tc-fav:hover { color: var(--gold); }
}

/* главная строка: что интересного на столе прямо сейчас */
.tc-lead { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; min-width: 0; }
.tc-lead b { font-weight: 650; font-size: 1.0625rem; letter-spacing: -.015em; white-space: nowrap; }
.tc-lead .word { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-lead .val {
  margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums;
  font-size: 0.9375rem; font-weight: 550; letter-spacing: -.2px;
}

/* Закрытые числа. Размытие — только оформление: под ним стоит заглушка, а не
   спрятанное значение, потому что бесплатному клиенту сервер перевес не
   присылает вовсе. Курсор-подсказка объясняет, чем это открывается. */
.blurred {
  filter: blur(4px); opacity: .72; cursor: help;
  user-select: none; -webkit-user-select: none;
}
.tc-lead .val.blurred, .tc-lead .val .blurred { letter-spacing: .06em; }
.mrow .edge .blurred { letter-spacing: .06em; }

.tc-spark { height: 52px; }
.tc-spark canvas { width: 100%; height: 52px; display: block; }
/* Закрытый мини-график: размытие плюс подпись, чтобы это не читалось как сбой
   отрисовки. Числа перевеса сервер бесплатному клиенту и так не присылает. */
.tc-spark.locked { position: relative; }
.tc-spark.locked canvas { filter: blur(7px); opacity: .5; }
.spark-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 550; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase; pointer-events: none;
}

/* четыре счёта в ровной сетке — раньше это были разноцветные плашки */
.tc-scores {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.tc-scores > div { min-width: 0; }
.tc-scores .k { display: flex; align-items: center; gap: 5px; font-size: 0.6562rem; color: var(--muted); }
.tc-scores .k span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-scores b { display: block; margin-top: 3px; font-size: 0.8438rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.tc-scores > div.on .k { color: var(--gold); }

.tc-nums { display: flex; gap: 5px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; direction: ltr; scrollbar-width: thin; }
.numchip {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.7188rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.numchip.red { background: #b8283a; color: #fff; }
.numchip.black { background: var(--chip-black); color: #e6e3dc; }
.numchip.green { background: #1c8f52; color: #fff; }
.tc-nums.big { gap: 7px; }
.tc-nums.big .numchip { width: 36px; height: 36px; font-size: 0.8438rem; font-weight: 550; }

/* ---------- Разделы с подписью ---------- */
.sec { display: grid; gap: 9px; grid-template-columns: minmax(0, 1fr); }
.sec > h4 { padding-left: 1px; }

/* ---------- Рейтинги: строка ---------- */
.rr-body { min-width: 0; }
.rr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.875rem; }
.rr-top b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-strat { display: flex; align-items: center; gap: 6px; font-size: 0.7188rem; color: var(--muted); white-space: nowrap; }
.rating-bar { height: 3px; background: var(--card2); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.rating-bar i { display: block; height: 100%; background: var(--accent); }
.rating-pos { font-size: 0.8125rem; font-weight: 550; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rating-pos.top { color: var(--gold); }
.rr-score { font-size: 1.125rem; font-weight: 550; font-variant-numeric: tabular-nums; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; animation: overlayIn var(--dur-base) var(--ease-out);
}
@keyframes overlayIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.overlay-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) calc(12px + var(--safe-right) + var(--tg-ctl, 0px)) 10px calc(12px + var(--safe-left));
  border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px);
}
.overlay-title { flex: 1; min-width: 0; font-weight: 550; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.overlay-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay-body {
  flex: 1; overflow-y: auto; display: grid; gap: 14px; align-content: start; grid-template-columns: minmax(0, 1fr);
  padding: 14px calc(14px + var(--safe-right)) calc(28px + var(--safe-bottom)) calc(14px + var(--safe-left));
}
#detailFav { color: var(--icon-off); }
#detailFav.on { color: var(--gold); }

/* ---------- График ---------- */
.chart-box {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.chart-controls .spacer { flex: 1; }
.seg { display: flex; background: var(--card2); border-radius: 10px; padding: 3px; }
.seg button {
  background: none; border: none; color: var(--muted); font-size: 0.75rem; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: 550; transition: var(--dur-fast);
}
.seg button.on { background: var(--tot-bg-on); color: var(--text); }
.zoom-btns { display: flex; gap: 4px; }
.zoom-btns .btn { padding: 10px; min-width: 44px; color: var(--muted); background: transparent; border-color: transparent; }
.zoom-btns .btn:hover { color: var(--gold); background: var(--card2); }

/* переключатели линий: точка цвета вместо разноцветной обводки */
.strat-toggles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.strat-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--tot-bg); border: none; border-radius: 9px; padding: 8px 4px;
  font-size: 0.7188rem; font-weight: 550; font-family: inherit; color: var(--muted);
  cursor: pointer; min-width: 0; transition: background-color var(--dur-fast), color var(--dur-fast);
}
.strat-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strat-toggle .strat-toggle-copy { display:flex; flex-direction:column; gap:4px; min-width:0; }
.chart-direction { display:block; font-size:.625rem; line-height:1.4; font-weight:400; color:var(--muted); white-space:normal; }
.strat-toggle .chart-direction { overflow:visible; white-space:normal; }
.chart-direction > span { white-space:nowrap; }
.strat-toggle.on { background: var(--tot-bg-on); color: var(--text); }
.strat-toggle:not(.on) .sdot { opacity: .4; }

/* ---------- Что на столе: строки стратегий ---------- */
.metrics { display: grid; grid-template-columns: minmax(0, 1fr); }
.mrow {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mrow:first-child { border-top: 1px solid var(--line); }
.mrow .who { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 650; }
.mrow .edge { font-size: 0.875rem; font-weight: 550; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mrow .sub { font-size: 0.7188rem; color: var(--muted); }
.mrow .lvl { font-size: 0.7188rem; color: var(--muted); text-align: right; white-space: nowrap; }
/* строка, из-за которой стол вообще интересен — выделяем целиком */
.mrow.lead {
  background: var(--gold-soft); border-radius: 10px;
  padding-left: 10px; padding-right: 10px; margin: 0 -10px;
}
.mrow.lead .who { color: var(--gold); font-weight: 550; }
.mrow.lead .edge { font-size: 1rem; }
.mrow.lead .lvl { color: var(--gold); font-weight: 550; }
.mrow.lead { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
.mrow.lead .who { grid-column:1; grid-row:1; }
.mrow.lead .sub { grid-column:1; grid-row:2; }
.mrow.lead .edge { grid-column:3; grid-row:1; }
.mrow.lead .lvl { grid-column:3; grid-row:2; }
.metric-analysis { grid-column:2; grid-row:1 / 3; align-self:center; display:flex; align-items:center; justify-content:center; gap:7px; color:var(--gold); font-size:.75rem; font-weight:550; }
@media (max-width:700px) {
  .mrow.lead { grid-template-columns:minmax(0,1fr) auto; }
  .mrow.lead .edge,.mrow.lead .lvl { grid-column:2; }
  .metric-analysis { grid-column:1 / -1; grid-row:3; margin-top:7px; }
}

/* ---------- Факты о столе ---------- */
.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border-radius: 14px; overflow: hidden;
}
.facts > div { background: var(--card-solid); padding: 12px 14px; min-width: 0; }
.facts .k { font-size: 0.6875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts .v { margin-top: 4px; font-size: 0.9375rem; font-weight: 550; font-variant-numeric: tabular-nums; }

/* ---------- Формы ---------- */
.form-card {
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.form-card h2 { font-size: 1.125rem; font-weight: 550; margin-bottom: 16px; }
.form-row { margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 7px; font-weight: 550; }
.form-row .input, .form-row .select { width: 100%; }

/* ---------- Шапка сессии ---------- */
.sess-head {
  background: linear-gradient(180deg, rgba(233,191,102,.055), transparent 55%), var(--card-solid);
  border: 1px solid var(--line-gold); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr);
}
.sh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* отрицательные отступы гасят собственные: место под свечение есть,
   а вёрстка не смещается */
.sh-money { padding: 7px 11px; margin: -7px -11px; min-width: 0; }
.sh-balance { font-size: 2.0625rem; font-weight: 550; letter-spacing: -.6px; margin-top: 4px; }
.sh-delta { margin-top: 6px; font-size: 0.7812rem; color: var(--muted); }
.sh-delta b { font-weight: 550; }
.sh-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border-radius: 12px; overflow: hidden;
}
.sh-stats > div { background: var(--bg2); padding: 10px 12px; min-width: 0; }
.sh-stats b { display: block; font-size: 0.9375rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.sh-stats span { font-size: 0.6562rem; color: var(--muted); }

/* ---------- Карточка стола в сессии ---------- */
.advice-card {
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px; display: grid; gap: 13px; grid-template-columns: minmax(0, 1fr);
  transition: border-color var(--dur-base);
}
.ac-head { display: flex; align-items: center; gap: 10px; }
.ac-head h3 { flex: 1; min-width: 0; font-size: 1rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-strat { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* Главное на карточке — какую ставку продублировать. Поэтому: цветная полоса
   стратегии слева, крупная сумма и сторона тем же цветом. Это должно читаться
   с одного взгляда, без вглядывания. Полоса — отдельная «пилюля» внутри блока:
   бордер по радиусу угла заворачивался и выглядел заломом. */
.ac-bet {
  position: relative;
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  background: var(--tot-bg); border-radius: 12px; padding: 13px 15px 13px 18px;
}
.ac-bet::before {
  content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px;
  border-radius: 2px; background: var(--c, var(--accent));
}
.ac-bet .lbl-cap { flex: 0 0 100%; margin-bottom: 5px; }
.ac-bet .sum { font-size: 1.625rem; font-weight: 550; letter-spacing: -.5px; }
.ac-bet .side { font-size: 0.9375rem; font-weight: 650; color: var(--muted); }
.ac-bet .side b { color: var(--c, var(--text)); font-weight: 550; }
.ac-bet .side b.arm-n { font-weight: 800; letter-spacing: -.2px; }
:root[data-theme="light"] .ac-bet .side b { filter: brightness(.82); }

.ac-arm { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.arm-bar { height: 4px; background: var(--card2); border-radius: 2px; overflow: hidden; }
.arm-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.ac-arm .cap { font-size: 0.7188rem; color: var(--muted); }
.advice-reason { font-size: 0.75rem; color: var(--muted); line-height: 1.55; }
.ac-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border-radius: 12px; overflow: hidden;
}
.ac-stats > div { background: var(--bg2); padding: 9px 12px; }
.ac-stats b { display: block; font-size: 0.875rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.ac-stats span { font-size: 0.6562rem; color: var(--muted); }
.advice-chart canvas { width: 100%; display: block; }
/* По графику можно листать страницу вертикально, а горизонтальные жесты и
   касания достаются самому графику — иначе на телефоне не прочитать значение. */
.chart-box canvas, .advice-chart canvas { touch-action: pan-y; }
/* Режим оффера: пока человек решает по предложению, остальная деталь скрыта —
   кнопки подтверждения не теряются среди графика и таблиц. */
#detailBody.offer-on > :not(.detail-actions) { display: none; }

/* ---------- «Куда ставить»: графическое пояснение ---------- */
/* Не все знают, что «A» — это половина колеса. Показываем схему и сами числа,
   иначе совет «ставьте на A» непонятен без домашней работы. */
.howto {
  display: grid; gap: 9px; grid-template-columns: minmax(0, 1fr);
  background: var(--tot-bg); border-radius: 12px; padding: 13px 14px;
}
.howto.compact { background: none; padding: 0; }
/* Фишки совета — ровной сеткой во всю ширину: перенос «кто влез» оставлял
   рваный хвост в строке. Плитки со скруглением читаются как поле ставки. */
.howto.compact .howto-nums {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 6px;
}
.howto.compact .numchip.sm { width: auto; height: 26px; border-radius: 8px; }
.howto-row { display: flex; align-items: center; gap: 13px; min-width: 0; }
.howto-body { display: grid; gap: 9px; min-width: 0; }
.howto-note { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1.5; }
.howto-note b { color: var(--text); }
.bet-board { display:grid; grid-template-columns:minmax(20px,.85fr) repeat(12,minmax(0,1fr)) minmax(20px,.85fr); gap:3px; width:100%; padding:7px; border:1px solid var(--line); border-radius:12px; background:#123c30; }
.bet-cell { display:flex; align-items:center; justify-content:center; min-width:0; min-height:32px; border:1px solid #ffffff30; border-radius:4px; color:#ffffff80; font-size:clamp(10px,2.5vw,14px); font-weight:600; position:relative; }
.bet-cell.red { background:#702733; }
.bet-cell.black { background:#202727; }
.bet-cell.zero { grid-row:1 / 4; background:#185d43; }
.bet-column { font-size:9px; }
.bet-outside { font-size:clamp(9px,2.3vw,13px); }
.bet-outside.red { color:#ff6678; }
.bet-outside.black { color:#d9d9d9; }
.bet-cell.selected { color:#fff; border-color:#f1ca70; box-shadow:inset 0 0 0 1px #f1ca70; }
.bet-cell.selected.red { background:#bf3048; }
.bet-cell.selected.black { background:#101515; }
.bet-cell.selected::after { content:''; position:absolute; inset:2px; border:1px solid #f1ca7040; border-radius:2px; pointer-events:none; }
.howto-body:has(.bet-board) { width:100%; }
.wheel { flex: 0 0 auto; }
.howto-nums { display: flex; flex-wrap: wrap; gap: 5px; }
.numchip.sm { width: 25px; height: 25px; font-size: 0.6562rem; font-weight: 550; }

/* поле игрового стола: так эта ставка выглядит в казино */
.bet-field {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  min-width: 84px; padding: 14px 16px; border-radius: 10px;
  background: var(--card2); border: 1px solid var(--line);
  font-size: 0.9375rem; font-weight: 550; letter-spacing: 1.4px;
}
.bet-field.bf-red { background: #b8283a; border-color: #b8283a; color: #fff; }
.bet-field.bf-black { background: var(--chip-black); border-color: var(--chip-black-line); color: #e6e3dc; }

/* пояснение стратегий на приветственном экране */
.strat-legend.legend-rich { display: grid; gap: 12px; }
.legend-row { display: flex; align-items: center; gap: 12px; text-align: left; }
.legend-row b { display: block; font-size: 0.8438rem; margin-bottom: 2px; }

/* ---------- Новое из аудита: ошибки полей, счётчик, сравнение ---------- */
/* Ошибка у поля, а не всплывающим сообщением: видно, что именно не так. */
.field-error {
  font-size: 0.75rem; color: var(--red); margin-top: 6px; min-height: 0;
  line-height: 1.4;
}
.field-error:empty { display: none; }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,77,94,.14); }

/* Счётчик ждущих решения столов: видно из любой вкладки. */
.tab { position: relative; }
.tab-badge {
  position: absolute; top: 5px; left: 50%; margin-left: 6px;
  width: 18px; min-width: 18px; height: 18px; padding: 0;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--accent); color: var(--on-gold);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align:center;
  font-variant-numeric:tabular-nums;
}
@media(min-width:900px) { .tab-badge { position:static; margin-left:0; margin-inline-start:4px; flex:0 0 18px; align-self:center; } }

/* Что бесплатно и что за доступ — рядом, чтобы замок не читался как «всё платно». */
.lock-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lock-compare ul { margin: 6px 0 0; padding-left: 16px; }
.lock-compare li { font-size: 0.75rem; color: var(--muted); line-height: 1.6; }

/* Баланс виртуальный: путать его с деньгами в казино нельзя. */
.virt {
  margin-left: 6px; padding: 2px 6px; border-radius: 6px;
  background: var(--tot-bg); color: var(--muted);
  font-size: 0.5625rem; letter-spacing: .6px; font-weight: 550;
}

/* ---------- Платная часть и партнёрские ссылки ---------- */
/* Закрытое не подделываем: график и разбор просто не приходят с сервера,
   а на месте блока стоит понятная карточка с ценой. */
.lock-card {
  display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr);
  background: linear-gradient(180deg, rgba(233,191,102,.07), transparent 60%), var(--card-solid);
  border: 1px solid var(--line-gold); border-radius: var(--radius); padding: 16px;
}
.lock-title { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 550; color: var(--gold); }
.lock-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lock-actions .btn { flex: 1; min-width: 140px; white-space: normal; }

/* размытая заглушка под закрытым блоком: видно форму, но не значения */
/* Закрытый график: форма видна, значения — нет. Слишком сильное размытие
   читалось как поломка отрисовки, поэтому линия остаётся узнаваемой. */
.locked-peek {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--card2); min-height: 190px;
}
.locked-peek > canvas { filter: blur(5px); opacity: .9; pointer-events: none; user-select: none; }
.locked-peek::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 95% at 50% 45%, transparent 35%, var(--peek-veil));
}
:root { --peek-veil: rgba(0, 0, 0, .5); }
:root[data-theme="light"] { --peek-veil: rgba(255, 255, 255, .62); }
.peek-over {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.peek-cap {
  font-size: 0.8125rem; font-weight: 550; letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 2px 10px var(--peek-veil);
}
:root[data-theme="light"] .peek-cap { color: var(--gold-deep); }
.btn-sm { padding: 10px 18px; font-size: 0.875rem; }

.btn-link { background: var(--card2); border-color: var(--line-gold); color: var(--gold); font-weight: 550; }
.btn-link:hover { background: var(--gold-soft); }

/* профиль: доступ и приглашения */
.access-row {
  display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr);
  padding: 12px 13px; border-radius: 12px;
  background: var(--tot-bg); font-size: 0.8125rem;
}
.access-row.on { background: var(--gold-soft); }
.access-row b { font-size: 0.9375rem; }
.ref-link {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border-radius: 11px; padding: 10px 12px;
  font-size: 0.75rem; word-break: break-all;
}
.ref-link code { flex: 1; min-width: 0; }

/* ---------- Живое предложение ставки ---------- */
/* Пока окно открыто, стол крутится дальше. Поэтому у предложения виден срок,
   а если совет изменился — об этом говорится прямо, а не подставляется молча. */
.offer-state { display: grid; gap: 9px; grid-template-columns: minmax(0, 1fr); }
.offer-state.stale {
  background: var(--gold-soft); border-radius: 11px; padding: 11px 13px;
  font-size: 0.75rem; line-height: 1.5; color: var(--gold);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start;
}
.offer-state.stale b { color: var(--text); }
:root[data-theme="light"] .offer-state.stale { color: var(--gold-deep); }
.offer-state .btn { grid-column: 1 / -1; justify-self: start; }

/* ---------- Стол отыграл плечо ---------- */
/* Остановленный стол не должен выглядеть как играющий: другое поле, другой
   акцент и две равноправные кнопки вместо одной тихой. */
.ac-done {
  display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr);
  background: var(--gold-soft); border-radius: 12px; padding: 13px 15px;
  border-left: 3px solid var(--accent);
}
.ac-done-sum { font-size: 1.5rem; font-weight: 550; letter-spacing: -.4px; }
.sh-stats > div.wait b, .wait-txt { color: var(--gold); }

/* ---------- Подтверждение ставки ---------- */
.confirm-card {
  background: linear-gradient(180deg, rgba(233,191,102,.06), transparent 55%), var(--card-solid);
  border: 1px solid var(--line-gold); border-radius: var(--radius);
  padding: 16px; display: grid; gap: 13px; grid-template-columns: minmax(0, 1fr);
  /* на широком экране карточка уже окна — держим её по центру, а не у левого края */
  margin-inline: auto;
}
.confirm-card h3 { font-size: 1rem; font-weight: 550; }
/* Стоп-защита сессии: красный для убытка, зелёный для зафиксированной прибыли */
.guard-banner {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px;
  border-radius: var(--radius); padding: 14px 15px; font-size: 0.82rem; line-height: 1.55;
}
.guard-banner > svg { flex: none; margin-top: 2px; }
.guard-banner > div { flex: 1 1 220px; }
.guard-banner.loss { background: rgba(255,77,94,.09); border: 1px solid rgba(255,77,94,.35); }
.guard-banner.win { background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.3); }
.guard-banner .confirm-actions { width: 100%; margin: 0; }
.confirm-warn {
  background: var(--gold-soft); border-radius: 11px; padding: 11px 13px;
  font-size: 0.75rem; color: var(--gold); line-height: 1.55;
}
:root[data-theme="light"] .confirm-warn { color: var(--gold-deep); }
/* ---------- «Подробнее»: объяснения под спойлером ---------- */
/* На экране решения — ставка и сторона — объяснений быть не должно: они
   читаются один раз, а пугают каждый. Спойлер свёрнут по умолчанию. */
.confirm-more summary {
  display: flex; align-items: center; gap: 8px; min-height: 26px;
  cursor: pointer; list-style: none;
  font-size: 0.8125rem; font-weight: 550; color: var(--muted);
}
.confirm-more summary::-webkit-details-marker { display: none; }
.confirm-more summary .chev {
  width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--dur-fast) ease;
}
.confirm-more[open] summary .chev { transform: rotate(45deg); }
.confirm-more summary:hover, .confirm-more[open] summary { color: var(--text); }
.confirm-more .more-body {
  display: grid; gap: 10px; margin-top: 10px; padding-top: 11px;
  border-top: 1px solid var(--line);
}
/* тихая строка срока действия под предложением */
.offer-timer .ico { vertical-align: -2px; margin-right: 1px; }
/* ---------- Банкролл: главное поле формы ---------- */
/* Расчёт начинается с него: сколько играете — такой и совет по ставке.
   Золотая рамка и метка делают поле заметным до того, как до него доскроллят. */
.input-lead { border-color: var(--accent); background: var(--gold-soft); }
.input-lead:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,191,102,.22); }
.input-lead.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,77,94,.14); }
.form-row label.lbl-lead { color: var(--text); }
.lbl-lead::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: 1px;
}
/* Мелкое золото на светлом даёт 3,4–3,9:1 — ниже порога AA. Для текста берём
   тёмное золото (4,8–5,5:1), светлое оставляем заливкам и границам. */
:root[data-theme="light"] .tab.active,
:root[data-theme="light"] .lock-title,
:root[data-theme="light"] .mrow.lead .who,
:root[data-theme="light"] .mrow.lead .lvl,
:root[data-theme="light"] .wait-txt,
:root[data-theme="light"] .sh-stats > div.wait b,
:root[data-theme="light"] .btn-link,
:root[data-theme="light"] .sessbar-go,
:root[data-theme="light"] .offer-state.stale { color: var(--gold-deep); }
:root[data-theme="light"] .pill.warm { color: var(--gold-deep); }
:root[data-theme="light"] .sessbar-go { color: var(--on-gold); }
.confirm-actions { display: flex; gap: 8px; }
/* кнопкам здесь разрешён перенос: длинная надпись не должна вылезать за карточку */
.confirm-actions .btn { flex: 1; min-width: 0; white-space: normal; }
.detail-actions > .btn { width: 100%; }

.flash-win { animation: flashWin 260ms var(--ease-out); }
.flash-lose { animation: flashLose 260ms var(--ease-out); }
@keyframes flashWin { 0% { border-color: var(--green); } 100% { border-color: var(--line); } }
@keyframes flashLose { 0% { border-color: var(--red); } 100% { border-color: var(--line); } }

/* ---------- История ---------- */
.hist-card {
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px; display: grid; gap: 11px; grid-template-columns: minmax(0, 1fr);
}
.hc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hc-top b { font-size: 0.875rem; font-weight: 550; }
.hc-sum { font-size: 1.1875rem; font-weight: 550; white-space: nowrap; }
.hc-line { font-size: 0.75rem; color: var(--muted); line-height: 1.5; }
.hc-tables { display: grid; gap: 1px; background: var(--line); border-radius: 11px; overflow: hidden; grid-template-columns: minmax(0, 1fr); }
.hc-tables > div {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline;
  background: var(--bg2); padding: 9px 12px; font-size: 0.7812rem;
}
.hc-tables .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-tables .ct { color: var(--muted); font-size: 0.7188rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hc-tables .pl { font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Рейтинги ---------- */
.rating-list { display: flex; flex-direction: column; gap: 8px; }
.rating-row {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; transition: border-color var(--dur-base), background-color var(--dur-base);
}
.rating-row:hover { border-color: var(--line-gold); }
.rating-pos { font-size: 0.9375rem; font-weight: 550; color: var(--muted); width: 26px; }
.rating-pos.top { color: var(--gold); }
.rating-bar { flex: 1; height: 5px; background: var(--card2); border-radius: 3px; overflow: hidden; }
.rating-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 3px; }

/* ---------- Profile ---------- */
.currency-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cur-btn {
  background: var(--card2); border: 1.5px solid var(--line); border-radius: 13px; padding: 13px 6px;
  color: var(--text); cursor: pointer; font-family: inherit; text-align: center;
  transition: transform var(--dur-fast), border-color var(--dur-base), background-color var(--dur-base);
}
.cur-btn:hover { transform: translateY(-2px); }
.cur-btn.on { border-color: var(--gold); background: var(--gold-soft); }
.cur-sym { font-size: 1.4375rem; font-weight: 550; display: block; }
.cur-name { font-size: 0.6562rem; color: var(--muted); }

/* выбор языка: флаг и название в два ряда, как в списке валют */
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lang-btn {
  background: var(--card2); border: 1.5px solid var(--line); border-radius: 13px; padding: 10px 6px;
  color: var(--text); cursor: pointer; font-family: inherit; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform var(--dur-fast), border-color var(--dur-base), background-color var(--dur-base);
}
.lang-btn:hover { transform: translateY(-2px); }
.lang-btn.on { border-color: var(--gold); background: var(--gold-soft); }
.lang-flag { font-size: 1.125rem; line-height: 1; }
.lang-name { font-size: 0.6875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lang-btn.on .lang-name { color: var(--text); }

/* Языки с письмом справа налево: разворачиваем строки и отступы, но числа,
   графики и подписи на них остаются как есть. */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .tc-lead .val { margin-left: 0; margin-right: auto; }
[dir="rtl"] .sb-sub, [dir="rtl"] .tc-meta { direction: rtl; }
[dir="rtl"] .numchip, [dir="rtl"] .money, [dir="rtl"] .sh-balance { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] canvas { direction: ltr; }
/* Название приложения — имя собственное: оно читается слева направо на любом
   языке, иначе «KING BET» превращается в «BET KING». */
[dir="rtl"] .app-title, [dir="rtl"] .welcome-logo, [dir="rtl"] .brand-lg { direction: ltr; }
[dir="rtl"] .brand-bet { margin-left: 4px; margin-right: 0; }

/* theme switcher */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-btn {
  background: var(--card2); border: 1.5px solid var(--line); border-radius: 13px;
  padding: 12px 6px 10px; color: var(--text); cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: transform var(--dur-fast), border-color var(--dur-base), background-color var(--dur-base);
}
.theme-btn:hover { transform: translateY(-2px); }
.theme-btn.on { border-color: var(--gold); background: var(--gold-soft); }
.theme-btn .swatch {
  width: 100%; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 3px; overflow: hidden;
}
.theme-btn .swatch i { width: 7px; height: 14px; border-radius: 2px; display: block; }
.swatch-dark { background: #0a0a0a; }
.swatch-light { background: #f7f5f0; }
/* ровная диагональ, а не наползающий белый угол */
.swatch-auto { background: linear-gradient(115deg, #0a0a0a 0 50%, #f7f5f0 50% 100%); }
.theme-btn .lbl2 { font-size: 0.6875rem; color: var(--muted); font-weight: 650; }
.theme-btn.on .lbl2 { color: var(--text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: calc(12px + var(--safe-top)); left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); z-index: 500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--toast-bg); backdrop-filter: blur(8px); color: var(--text);
  border: 1px solid var(--line-gold); border-radius: 13px;
  padding: 12px 15px; font-size: 0.8125rem; line-height: 1.45; animation: toastIn var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow);
}
/* сдвиг небольшой намеренно: с большим замахом сообщение на миг залезает
   под панель Telegram, которая висит поверх приложения */
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Скелетон: каркас появляется сразу, данные втекают в готовые места —
   иначе экран прыгает после ответа сервера. */
.skel { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
/* каркас не должен выглядеть нажимаемым: обещать нажатие там, где ещё нечего
   открывать, — прямой обман */
.tcard.skel { cursor: default; pointer-events: none; }
.skel-line, .skel-box {
  background: linear-gradient(90deg, var(--tot-bg) 25%, var(--card2) 50%, var(--tot-bg) 75%);
  background-size: 220% 100%;
  border-radius: 10px;
  animation: shimmer 1200ms ease-in-out infinite;
}
.skel-line { height: 14px; }
.skel-line.w60 { width: 60%; }
.skel-line.w40 { width: 40%; }
.skel-box { height: 190px; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

.empty { text-align: center; color: var(--muted); padding: 44px 20px; line-height: 1.65; animation: fadeIn var(--dur-base) var(--ease-out); }

/* Кому системная настройка велит меньше движения — тому почти без движения. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
.empty .big { display: flex; justify-content: center; margin-bottom: 12px; }

/* Планшет в портрете: просто центрируем колонку, раскладка остаётся телефонной.
   Верхняя граница дробная не случайно: при масштабе экрана 150% ширина окна
   бывает 899.33px — с «max-width: 899px» такое окно не попадало ни в этот
   диапазон, ни в следующий, и раскладка оставалась без правил. */
@media (min-width: 700px) and (max-width: 899.98px) {
  .view, .overlay-body, .overlay-head { max-width: 640px; margin: 0 auto; width: 100%; }
}

/* Телефон лёжа: экран низкий, и шапка с вкладками съедают почти всё.
   Делаем их компактнее — содержимому остаётся вдвое больше места. */
@media (orientation: landscape) and (max-height: 460px) and (max-width: 899.98px) {
  .app-header { padding-top: calc(6px + var(--safe-top)); padding-bottom: 6px; }
  .app-title { font-size: 1rem; }
  .brand-crown { width: 30px; height: 18px; }
  .tab { padding: 5px 2px 6px; font-size: 0.5938rem; gap: 1px; }
  .view { padding-top: 8px; }
}

/* ============================================================
   Широкий экран: компьютер и планшет в альбомной ориентации.
   Навигация уезжает в левую колонку — нижняя панель во всю ширину
   монитора выглядит потерянной, а карточки раскладываются в сетку
   вместо того, чтобы растягиваться на полтора метра.
   ============================================================ */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .app-header {
    grid-column: 1 / -1; grid-row: 1;
    padding-left: calc(24px + var(--safe-left));
    padding-right: calc(24px + var(--safe-right));
  }
  .app-title { font-size: 1.3125rem; }

  .tabbar {
    grid-column: 1; grid-row: 2;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    border-top: none; border-right: 1px solid var(--line);
    padding: 16px 12px calc(16px + var(--safe-bottom)) calc(12px + var(--safe-left));
    overflow-y: auto;
  }
  .tab {
    flex: 0 0 auto; flex-direction: row; gap: 12px; justify-content: flex-start;
    padding: 11px 14px; border-radius: 12px; font-size: 0.8438rem; font-weight: 550;
  }
  .tab:hover { color: var(--text); background: var(--card2); }
  .tab.active { background: var(--gold-soft); }
  /* активную вкладку помечаем полоской слева, а не сверху */
  .tab::before {
    top: 50%; left: 0; width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    transform: translateY(-50%) scaleY(0);
  }
  .tab.active::before { transform: translateY(-50%) scaleY(1); }
  .tab-ico { opacity: .62; }

  #views { grid-column: 2; grid-row: 2; }
  .view {
    max-width: 1240px; margin: 0 auto; width: 100%;
    padding: 22px calc(28px + var(--safe-right)) 52px 28px;
  }

  /* карточки в сетку; отступы между ними задаёт gap, а не margin */
  .cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px; align-items: start;
  }
  .rating-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); gap: 9px;
  }
  .tcard, .advice-card, .hist-card, .rating-row { margin-bottom: 0; }
  /* карточкам сессии нужен график: даём им больше ширины, чем обычным */
  #view-session .cards { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
  .rating-row:hover { transform: none; border-color: var(--line-gold); }

  .info-grid { grid-template-columns: repeat(4, 1fr); }
  /* формы и переключатели не растягиваем: длинная строка ввода неудобна */
  .form-card, .toolbar, .confirm-card { max-width: 760px; }
  /* места хватает — поиск и фильтры в одну строку, чипы без прокрутки */
  .toolbar { grid-template-columns: minmax(220px, 1fr) auto; align-items: center; }
  #filterPanel { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar-row .select { flex: 0 0 auto; min-width: 170px; }
  /* три числа на полтора метра ширины выглядят потерянными */
  .sh-stats { max-width: 620px; }

  /* деталь стола — окно поверх списка, а не отдельный экран */
  .overlay {
    background: var(--veil); backdrop-filter: blur(7px);
    align-items: center; justify-content: flex-start;
    padding: 5vh calc(24px + var(--safe-right)) 5vh 24px;
    animation: modalIn var(--dur-base) var(--ease-out);
  }
  .overlay-head, .overlay-body { width: min(940px, 100%); max-width: none; margin: 0; }
  .overlay-head {
    border: 1px solid var(--line); border-bottom: none; border-radius: 18px 18px 0 0;
    padding: 14px 18px;
  }
  .overlay-body {
    flex: 0 1 auto; max-height: 82vh;
    background: var(--bg2);
    border: 1px solid var(--line); border-top: none; border-radius: 0 0 18px 18px;
    padding: 16px 18px 24px; box-shadow: var(--shadow);
  }

  .toasts { left: auto; width: min(430px, 40vw); }
  .welcome-inner { max-width: 560px; }
}

@keyframes modalIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* Совсем широкий монитор: третья колонка карточек и более свободные поля */
@media (min-width: 1500px) {
  .view { max-width: 1600px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
  .rating-list { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

/* строка входа в профиле */
.auth-row {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-radius: 12px;
  background: var(--tot-bg); border: 1px solid var(--line);
  font-size: 0.8125rem; font-weight: 550; line-height: 1.35;
}
.auth-row .ico { flex: 0 0 auto; }
.auth-row.auth-ok { color: var(--text); border-color: var(--line-gold); background: var(--gold-soft); }
.auth-row.auth-ok .ico { color: var(--green); }
.auth-row.auth-off { color: var(--muted); }
.auth-row.auth-off .ico { color: var(--accent); }

/* ================= оплата криптовалютой =================
   Список тарифов внутри приложения: выбор срока одним касанием, цена всегда
   на виду. Выделение выбранного — рамкой, а не заливкой: заливка спорила бы
   с золотой кнопкой оплаты. */
.pay-card { display: grid; gap: 12px; background: var(--card-solid); border: 1px solid var(--line-gold); border-radius: var(--radius); padding: 16px; }
.pay-h { font-size: 0.9375rem; font-weight: 550; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.pay-note { color: var(--muted); font-size: 0.8125rem; line-height: 1.45; }
/* QR адреса кошелька: белая подложка обязательна — сканеру нужен контраст */
.pay-qr { width: fit-content; margin: 0 auto; padding: 8px; background: #fff; border-radius: 10px; }
.pay-qr svg { display: block; width: 140px; height: 140px; }
.pay-plans { display: grid; gap: 8px; }
.pay-plan {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 13px; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.pay-plan:hover { border-color: var(--line-gold); }
.pay-plan.on { border-color: var(--accent); background: var(--gold-soft); }
.pay-term { flex: 1; min-width: 0; font-weight: 550; font-size: 0.9375rem; }
.pay-per { display: block; font-weight: 450; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.pay-price { font-weight: 550; font-size: 0.9375rem; white-space: nowrap; }
.pay-save { font-size: 0.6875rem; font-weight: 550; padding: 2px 7px; border-radius: 999px; background: rgba(47,213,117,.14); color: var(--green); white-space: nowrap; }
.pay-state { text-align: center; padding: 10px 0 4px; display: grid; gap: 6px; justify-items: center; }
.pay-big { font-size: 1.0625rem; font-weight: 550; }
.pay-big.ok { color: var(--green); }
.pay-err { color: var(--red-soft); font-size: 0.8125rem; }
.pay-assets { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-asset { font-size: 0.6875rem; font-weight: 550; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--tot-bg); color: var(--wtext); }
.pay-card .btn-lg { width: 100%; }
/* перевод на наш адрес: сумма, адрес и комментарий — то, что копируют */
.pay-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line);
}
.pay-row-lbl { grid-column: 1; font-size: 0.75rem; color: var(--muted); }
.pay-row-val {
  grid-column: 1; grid-row: 2; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem; font-weight: 550; word-break: break-all; user-select: all; line-height: 1.35;
}
.pay-copy { grid-column: 2; grid-row: 1 / span 2; padding: 8px 10px; }
.pay-warn {
  display: flex; gap: 7px; align-items: flex-start; font-size: 0.8125rem; line-height: 1.45;
  color: var(--gold); background: var(--gold-soft); border-radius: 11px; padding: 9px 11px;
}
.pay-claim { display: grid; gap: 8px; }
.pay-input {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-family: ui-monospace, monospace; font-size: 0.8125rem;
}
.pay-input:focus { outline: none; border-color: var(--accent); }
.pay-dots { color: var(--muted); font-size: 0.875rem; }
.pay-dots::after { content: '.'; animation: payDots 1.2s steps(1, end) infinite; }
@keyframes payDots { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } }
@media (prefers-reduced-motion: reduce) { .pay-dots::after { content: '...'; animation: none; } }

/* ---------- настройки как в iOS: подпись + карточка с рядами ---------- */
/* Профиль и подобные экраны собираются из групп: маленький капслок над
   стеклянной карточкой, внутри — ряды. Так экран читается сверху вниз,
   а не как свалка полей. */
.set-group { display: grid; gap: 8px; }
.set-group + .set-group { margin-top: 16px; }
#view-profile .lbl-cap { padding-left: 4px; }
.set-card {
  display: grid; gap: 8px; padding: 10px;
  background: var(--glass-bg); border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glow-soft);
}
.set-card > .btn-lg, .set-card > .btn { width: 100%; }
.set-card p.about { font-size: 0.75rem; line-height: 1.55; }

/* Широкий экран: профиль — узкая колонка настроек по центру, а не кнопки и
   поля, растянутые на полтора метра. Мобайл не трогаем (ширина и так меньше). */
@media (min-width: 900px) {
  #view-profile { max-width: 620px; margin: 0 auto; }
}

/* тема: сегмент из двух равных частей (режим «Системная» убран, третья
   колонка оставляла пустоту справа) */
.theme-seg { display: grid; grid-template-columns: repeat(2, 1fr); }
.theme-seg button { white-space: nowrap; }

/* валюта: компактные кнопки в ровном ряду */
.currency-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 7px; }
.cur-btn { padding: 9px 4px 7px; border-radius: 14px; }
.cur-sym { font-size: 1.0625rem; display: block; }
.cur-name { font-size: 0.5938rem; color: var(--muted); }
.cur-btn.on .cur-name { color: var(--text); }

/* язык: компактные пилюли «флаг + название» */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 7px; }
.lang-btn {
  flex-direction: row; justify-content: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 12px; min-width: 0;
}
.lang-flag { font-size: 0.9375rem; line-height: 1; }
.lang-name { font-size: 0.8125rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- дропдаун сортировки: вместо нативного <select> ---------- */
.dd { position: relative; min-width: 0; }
.dd-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  min-height: 44px; padding: 10px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--glass-line);
  color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 550;
  cursor: pointer; text-align: left;
}
.dd-btn > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: 0 0 auto; opacity: .6; transition: transform var(--dur-fast) var(--ease-out); }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 90;
  display: none; padding: 5px;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-line); border-radius: 16px;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.dd.open .dd-menu { display: grid; gap: 2px; }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border-radius: 11px;
  background: none; border: none; color: var(--text);
  font: inherit; font-size: 0.875rem; font-weight: 550; cursor: pointer; text-align: left;
}
.dd-opt:hover { background: rgba(255, 255, 255, .07); }
.dd-opt.on { color: var(--gold); font-weight: 550; }
:root[data-theme="light"] .dd-opt.on { color: var(--gold-deep); }
.toolbar-row .dd { flex: 1; min-width: 0; }
@media (min-width: 900px) { .toolbar-row .dd { flex: 0 0 auto; min-width: 210px; } }

/* Плавающая кнопка поддержки: круглый буй в углу на всех экранах.
   Появляется, только когда бот поддержки поднят (ссылку присылает /api/meta).
   z ниже таббара (45) и оверлеев (60+) нарочно: диалоги её перекрывают. */
.support-fab {
  position: fixed;
  right: calc(14px + var(--safe-right));
  bottom: calc(86px + var(--safe-bottom));    /* над таббаром: 8px + 66px + 12px */
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  background: linear-gradient(180deg, rgba(233, 191, 102, .16), rgba(26, 23, 17, .55) 45%), var(--card2);
  border: 1px solid var(--line-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 26px rgba(0, 0, 0, .45);
  cursor: pointer;
  z-index: 44;
  transition: transform var(--dur-fast) ease;
}
.support-fab:hover { border-color: var(--gold); }
.support-fab:active { transform: scale(.92); }
:root[data-theme="light"] .support-fab {
  background: linear-gradient(180deg, rgba(233, 191, 102, .18), rgba(255, 253, 248, .85) 45%), var(--card2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 10px 24px rgba(90, 70, 20, .18);
}
@media (min-width: 900px) {
  .support-fab { right: 18px; bottom: 18px; }
}

.filter-actions { width: 100%; flex: 0 0 auto; padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.filter-actions .btn { width: 100%; }

@media (min-width: 700px) and (max-width: 899.98px) {
  .filter-actions { max-width: 640px; margin: 0 auto; }
}
@media (min-width: 900px) {
  #filterOverlay .overlay-body { border-bottom: none; border-radius: 0; box-shadow: none; }
  .filter-actions { width: min(940px, 100%); border: 1px solid var(--line); border-radius: 0 0 18px 18px; background: var(--bg2); box-shadow: var(--shadow); }
}

.chart-controls .seg { flex-wrap: wrap; max-width: 100%; }

.detail-session-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.detail-session-nav .btn { min-width: 0; white-space: normal; }

.manual-card #cFill { width: 100%; }
.manual-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.manual-fields .form-row { min-width: 0; margin: 0; }
.manual-fields label { display: block; min-height: 0; }
.manual-fields .input { width: 100%; min-width: 0; }
.manual-fields .manual-wide { grid-column: 1 / -1; }
.manual-fields .manual-wide label { min-height: 0; }
.manual-card .field-error:empty, .manual-card #manualNotice:empty { display: none; }

.manual-fields select.input {
  --manual-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%239d927c' stroke-width='1.5'/%3E%3C/svg%3E");
  -webkit-appearance: none; appearance: none; color-scheme: dark;
  background-color: var(--card2); color: var(--text); -webkit-text-fill-color: var(--text);
  padding-inline-end: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%239d927c' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
:root[data-theme="light"] .manual-fields select.input { color-scheme: light; background-color: var(--card2); background-image: var(--manual-select-arrow); background-repeat: no-repeat; background-position: right 12px center; }
[dir="rtl"] .manual-fields select.input, :root[data-theme="light"][dir="rtl"] .manual-fields select.input { background-position: left 12px center; }
@media (max-width: 699px) { .manual-fields .input { font-size: 16px; } }

.session-topup { margin-top: 12px; }
.funds-card { width: 100%; max-width: 560px; margin: 0 auto; }
.funds-card .input { width: 100%; font-size: 16px; }

.funds-card input[type="number"] { appearance: textfield; }
.funds-card input::-webkit-inner-spin-button, .funds-card input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* WebKit не наследует шрифт body у кнопок фильтров автоматически. */
#filterOverlay .chip { font-family: inherit; }


.numchip.latest-result { position:relative; outline:2px solid var(--gold); outline-offset:3px; box-shadow:0 0 0 5px var(--gold-soft); z-index:1; }
.tc-nums { padding-block:9px 12px; }

.tc-nums { padding-inline:6px; }

/* Расчёт серии остаётся самостоятельной информационной вставкой. */
.bet-rounds { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; padding:4px; }
.bet-rounds + label { margin-top:8px; }
#cStrategyChoice > span:first-child { white-space:normal; overflow:visible; }
.manual-card #chipBudget { padding:16px; border:1px solid var(--line); border-radius:var(--radius-field); background:var(--card2); line-height:1.5; overflow-wrap:anywhere; }
.manual-card #chipBudget:empty { display:none; }
.budget-series { color:var(--text); font-weight:600; }
.budget-reserve,.budget-note { margin-top:8px; }
.budget-track { height:4px; overflow:hidden; border-radius:999px; background:var(--line); margin-top:12px; }
.budget-track i { display:block; height:100%; border-radius:inherit; background:var(--gold); transition:width var(--dur-base) var(--ease-out); }

.detail-bet-entry { margin-bottom: 16px; }

.bet-entry-number { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }

.session-archive { width: 100%; margin-top: 16px; }
.archive-entry-info { display: grid; gap: 8px; margin: 12px 0; }

.history-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.history-toolbar .history-back { margin-bottom: 0; }

.tip-caption { color:var(--muted); font-size:11px; letter-spacing:.08em; text-transform:uppercase; margin-bottom:8px; }
.field-help { color:var(--muted);font-size:13px;line-height:1.5;margin:4px 0 12px; }
.recommendation-button { width:100%;margin:16px 0;min-height:48px; }
.balance-breakdown { display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin-top:16px; }
.balance-breakdown div { display:grid;gap:4px; }
.balance-breakdown span { font-size:12px;color:var(--muted); }

.removal-confirm { z-index: 1100; }

.recommendation-summary { margin: -4px 0 16px; color:var(--text); font-weight:600;line-height:1.6; }

.sh-money { flex:1;min-width:0; }
.balance-breakdown { grid-template-columns:repeat(5,minmax(0,1fr));max-width:900px; }
@media(max-width:600px) { .balance-breakdown {grid-template-columns:repeat(2,minmax(0,1fr));} }

.balance-breakdown span { min-height:2.8em;line-height:1.4; }
.recommendation-button .king-crown { filter:brightness(0);opacity:.85; }

.metrics-explanation { margin:8px 0 12px; }

.history-finances { margin-top:20px; }
.history-finances > b { display:none; }
.history-ledger { margin-top:24px;padding-top:20px;border-top:1px solid var(--line); }
.history-ledger h3 {font-size:15px;margin:0 0 12px;}
.ledger-row {display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:16px;padding:12px 0;align-items:center;border-bottom:1px solid var(--line);font-size:14px;}
.ledger-row time {color:var(--muted);font-size:12px;}
.balance-equation {font-size:14px;line-height:1.8;overflow-wrap:anywhere;margin-top:20px;}
@media(max-width:600px){.ledger-row{grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;}.ledger-row time{grid-row:2;}.ledger-row b{grid-column:2;grid-row:1 / 3;}}

.history-finances {margin-top:0;}
.history-finances .balance-breakdown {grid-template-columns:repeat(4,minmax(0,1fr));margin-top:0;}
.history-finances .balance-breakdown span {min-height:0;}
.history-detail-summary {gap:12px;}
.history-detail-summary h2,.history-ledger p {margin:0;}
.history-ledger {margin-top:4px;padding-top:16px;}
.history-ledger .balance-equation {margin-top:16px;}
.manual-parameters-title {margin:4px 0 0;font-size:15px;}
.recommendation-calculation {padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-field);margin-top:8px;}
.recommendation-calculation summary {cursor:pointer;color:var(--gold);font-weight:600;}
.recommendation-calculation p {margin:10px 0;}
.calculation-result {font-size:15px;line-height:1.8;font-weight:600;color:var(--text);overflow-wrap:anywhere;}
@media(max-width:600px){.history-detail-summary .history-money{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-block:8px;}.history-detail-summary .history-money>div{font-size:1rem;gap:5px;}.history-detail-summary .history-money .lbl-cap{font-size:9px;}.history-finances .balance-breakdown{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}.history-detail-summary{padding:14px;}}

.history-ledger {scroll-margin-top:calc(var(--header-h,64px) + var(--safe-top,0px) + 16px);}

.channel-gate{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;overflow:auto;padding:24px;background:radial-gradient(ellipse at top,rgba(233,191,102,.12),transparent 65%),var(--bg);}
.channel-card{width:min(100%,480px);padding:28px;border:1px solid var(--line-gold);border-radius:24px;background:var(--card-solid);box-shadow:var(--shadow);}
.channel-brand{margin-bottom:24px;}.channel-brand svg{width:140px;height:auto;}
.channel-card h2{margin:0 0 16px;font-size:24px;line-height:1.25;}.channel-card p{color:var(--muted);line-height:1.6;}
.channel-actions{display:grid;gap:12px;margin-top:24px;}.channel-actions .btn{width:100%;white-space:normal;min-height:48px;}
.channel-card .channel-status{font-size:13px;min-height:20px;margin:16px 0 0;}.channel-card>.btn{margin-top:12px;width:100%;}
@media(max-width:420px){.channel-gate{padding:16px;}.channel-card{padding:22px;}}

.channel-gate .channel-card .channel-check{border:1px solid var(--line-gold);background:var(--card2);color:var(--text);}
:root[data-theme="light"] .channel-gate .channel-card .channel-check{border:1px solid var(--line-gold);background:var(--card2);color:var(--text);}
