/* Палитра задаётся двумя осями: data-mode (тёмная/светлая) и --accent
   (цвет темы — F1 или команды, выставляется из app.js). */
:root{
  --accent:#e10600;
  --on-accent:#fff;
  --fs:14;
  --safe-top:env(safe-area-inset-top,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
}
html[data-mode=dark]{
  --bg:#0a0a0b; --surface:#141417; --surface-2:#1c1c20; --line:#2a2a30;
  --text:#f2f2f4; --text-2:#d9d9de; --muted:#8b8b95;
  --danger-bg:#1c0c0d;
}
html[data-mode=light]{
  --bg:#f3f3f5; --surface:#ffffff; --surface-2:#ececf0; --line:#dcdce2;
  --text:#111114; --text-2:#2a2a30; --muted:#6b6b75;
  --danger-bg:#fff0ef;
}
/* Светлые командные цвета (Mercedes, Williams) на белом фоне не читаются как
   текст — для надписей в светлой теме цвет темы притемняется. */
html[data-mode=dark]{--accent-ink:var(--accent)}
html[data-mode=light]{--accent-ink:color-mix(in srgb,var(--accent) 62%,#000)}
:root{
  --accent-soft:color-mix(in srgb,var(--accent) 22%,var(--surface));
  --accent-tint:color-mix(in srgb,var(--accent) 10%,var(--surface));
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  background:var(--bg);color:var(--text);
  font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  display:flex;flex-direction:column;overflow:hidden;
  -webkit-tap-highlight-color:transparent;
  transition:background-color .2s;
}
button{font-family:inherit}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums}
[hidden]{display:none!important}

/* ── Шапка ─────────────────────────────── */
.top{
  padding:calc(10px + var(--safe-top)) 14px 8px;
  background:linear-gradient(180deg,var(--accent-tint) 0%,var(--surface) 75%);
  border-bottom:1px solid var(--line);
}
.top-row{display:flex;align-items:center;gap:10px}
/* Логотип — белая картинка, используется как маска: цвет берётся из темы.
   badge — белый (--on-accent) на круге цвета темы, plain — сам логотип цвета темы. */
.logo{width:44px;height:44px;flex:none;display:grid;place-items:center;border-radius:50%;
  background:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent);
  transition:transform .15s}
.logo:active{transform:scale(.92)}
.logo i{width:80%;height:80%;background:var(--on-accent);
  -webkit-mask:url(logo.png) center/contain no-repeat;mask:url(logo.png) center/contain no-repeat}
body.logo-plain .logo{background:none;box-shadow:none}
body.logo-plain .logo i{width:100%;height:100%;background:var(--accent-ink)}
.session{flex:1;min-width:0;text-align:center}
.session-name{font-weight:700;font-size:13px;text-transform:uppercase;letter-spacing:.4px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.session-sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.status{
  font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;
  padding:4px 8px;border-radius:999px;border:1px solid var(--line);
  background:var(--surface-2);color:var(--muted);white-space:nowrap;
}
.status.live{border-color:var(--accent);color:var(--text);background:var(--accent-soft)}
.status.live::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;
  background:var(--accent);margin-right:5px;vertical-align:1px;animation:pulse 1.2s infinite}
@keyframes pulse{50%{opacity:.25}}
.meters{display:flex;gap:8px;margin-top:8px}
.meter{flex:1;min-width:0;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;
  padding:5px 8px;display:flex;flex-direction:column;gap:1px}
.meter-k{font-size:9px;letter-spacing:.8px;color:var(--muted)}
.meter-v{font-size:14px;font-weight:700;white-space:nowrap}

/* ── Статус трассы ─────────────────────── */
.track{display:flex;align-items:center;gap:10px;padding:9px 14px;font-weight:900;letter-spacing:.8px;
  font-size:13px;text-transform:uppercase;color:#fff}
.track-flag{font-size:16px;line-height:1}
.track-text{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track-lap{font-size:11px;font-weight:700;opacity:.85;letter-spacing:0}
.track[data-s=red]{background:repeating-linear-gradient(135deg,#d10000 0 14px,#b30000 14px 28px);animation:alarm 1.4s infinite}
.track[data-s=sc],.track[data-s=sc_in]{background:repeating-linear-gradient(135deg,#ffb000 0 14px,#f29a00 14px 28px);color:#1a1200}
.track[data-s=vsc]{background:#ffb000;color:#1a1200}
.track[data-s=chequered]{color:#111;text-shadow:0 0 4px #fff,0 0 2px #fff;background:
  repeating-conic-gradient(#fff 0 25%,#dcdce2 0 50%) 0 0/16px 16px}
@keyframes alarm{50%{filter:brightness(1.25)}}
/* На красном флаге перекрашивается и вся шапка — видно даже на вкладке «Позиции». */
body.status-red .top{background:linear-gradient(180deg,#5a0000 0%,var(--surface) 90%);border-bottom-color:#d10000}
body.status-red .card[data-cat=red_flag]{box-shadow:0 0 0 1px #ff2d20 inset}

/* ── Вкладки ───────────────────────────── */
.tabs{display:flex;background:var(--surface);border-bottom:1px solid var(--line)}
.tab{
  flex:1;padding:10px 2px;background:none;border:0;border-bottom:2px solid transparent;
  color:var(--muted);font-size:12px;font-weight:600;cursor:pointer;position:relative;
}
.tab.is-active{color:var(--text);border-bottom-color:var(--accent)}
.badge{display:inline-block;min-width:16px;height:16px;line-height:16px;border-radius:8px;margin-left:4px;
  background:var(--accent);color:var(--on-accent);font-size:10px;padding:0 4px;vertical-align:1px}

/* ── Контент ───────────────────────────── */
main{flex:1;min-height:0;position:relative}
/* Позицию чтения держит app.js (pushCard). Встроенный якорь Chrome/Android делал
   то же самое — вдвоём они сдвигали текст на высоту новой карточки. */
.view{position:absolute;inset:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:10px 12px 14px;display:none;overflow-anchor:none}
.view.is-active{display:block}
.empty{color:var(--muted);font-size:12px;text-align:center;padding:28px 20px}
.hint{color:var(--muted);font-size:12px;margin:2px 0 10px}
.hint-dev{margin-top:14px;padding:10px;border:1px dashed var(--line);border-radius:8px}
.block{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:10px}
.block h3{margin:0 0 10px;font-size:12px;letter-spacing:.6px;text-transform:uppercase;color:var(--muted)}
.block-head{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.block-head h3{margin:0;flex:1}
.link{background:none;border:0;color:var(--accent-ink);font-size:12px;font-weight:600;cursor:pointer;padding:2px}
.btn-wide{width:100%;padding:11px;border-radius:10px;border:1px solid var(--line);background:var(--surface);
  color:var(--text);font-size:13px;font-weight:600;cursor:pointer}

/* ── Карточка события ──────────────────── */
.card{
  background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--accent);
  border-radius:10px;padding:10px 12px;margin-bottom:8px;position:relative;
}
.card.new{animation:in .3s cubic-bezier(.2,.8,.3,1)}
@keyframes in{from{opacity:0;transform:translateY(-10px) scale(.99)}}
.card-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.card-emoji{font-size:16px;line-height:1}
.card-title{font-size:calc((var(--fs) - 2) * 1px);font-weight:800;letter-spacing:.5px;text-transform:uppercase;flex:1}
.card-meta{font-size:10px;color:var(--muted);white-space:nowrap;margin-left:auto}
.card-text{font-size:calc(var(--fs) * 1px);color:var(--text-2);word-wrap:break-word}
.card.raw .card-text{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:calc((var(--fs) - 1) * 1px)}
.card-drivers{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.card.fav{box-shadow:0 0 0 1px var(--accent) inset;background:var(--accent-tint)}
.card.fav::after{content:"★";position:absolute;right:10px;bottom:8px;color:var(--accent-ink);font-size:12px}

.pill{display:inline-flex;align-items:center;gap:6px;background:var(--surface-2);
  border:1px solid var(--line);border-radius:999px;padding:3px 9px 3px 4px;font-size:11px}
.pill .num{min-width:20px;height:18px;border-radius:5px;display:grid;place-items:center;
  font-size:10px;font-weight:800;color:#0b0b0c;padding:0 3px}
.pill .team{color:var(--muted);font-size:10px}

.radio-box{margin-top:8px;background:var(--surface-2);border-radius:8px;padding:8px 10px}
.radio-top{display:flex;align-items:center;gap:8px}
.radio-top audio{flex:1;min-width:0;height:32px}
html[data-mode=dark] .radio-top audio{filter:invert(1) hue-rotate(180deg) saturate(.6)}
.lang{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:7px;
  font-size:11px;font-weight:800;padding:5px 8px;cursor:pointer;white-space:nowrap}
.lang b{color:var(--accent-ink)}
.transcript{margin-top:7px;font-size:calc((var(--fs) - 1) * 1px);color:var(--text-2);white-space:pre-line}
.transcript.none{color:var(--muted);font-style:italic}

.tyres{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:12px;flex-wrap:wrap}
.tyre{display:inline-flex;align-items:center;gap:5px;font-weight:700;font-size:11px}
.tyre i{width:12px;height:12px;border-radius:50%;border:2px solid;display:inline-block}
.tyre-note{color:var(--muted);font-size:11px}

.card[data-cat=red_flag],.card[data-cat=safety_car]{border-left-color:#ff2d20;background:var(--danger-bg)}
.card[data-cat=sector_flags]{border-left-color:#ffd000}
.card[data-cat=blue_flags]{border-left-color:#2e6cff}
.card[data-cat=penalties],.card[data-cat=track_limits]{border-left-color:#ff7a00}
.card[data-cat=team_radio]{border-left-color:#9a9aa6}
.card[data-cat=tyre_changes]{border-left-color:#00c46a}
.card[data-cat=session_status]{border-left-color:var(--text)}

body.compact .card{padding:7px 10px;margin-bottom:5px;border-radius:8px}
body.compact .card-head{margin-bottom:3px}
body.compact .card-drivers{margin-top:5px}
body.compact .pill{padding:1px 7px 1px 3px}

/* ── Позиции ───────────────────────────── */
.stand-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;
  font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--muted)}
.standings{display:flex;flex-direction:column;gap:4px}
.row{display:flex;align-items:center;gap:9px;background:var(--surface);
  border:1px solid var(--line);border-radius:8px;padding:7px 10px}
.row.fav{box-shadow:0 0 0 1px var(--accent) inset}
.row .p{width:22px;font-weight:800;font-size:13px;color:var(--muted);text-align:right}
.row .bar{width:4px;height:22px;border-radius:2px}
.row .acr{font-weight:800;font-size:13px;letter-spacing:.5px;width:42px}
.row .nm{flex:1;min-width:0;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .gap{font-size:12px;font-weight:700;text-align:right;min-width:74px}
.row .gap.lead{color:var(--accent-ink)}
.row.out{opacity:.5}
.row.out .p{font-size:10px;letter-spacing:.3px}
.row.out .gap{font-size:10px;color:var(--muted)}
/* Как в F1-приложении: штраф — белый «!» на красном, расследование — чёрный на жёлтом. */
.marks{display:inline-flex;align-items:center;gap:4px;flex:none}
.mark-pen,.mark-inv{width:16px;height:16px;border-radius:3px;display:grid;place-items:center;
  font-size:12px;font-weight:900;line-height:1}
.mark-pen{background:#e10600;color:#fff}
.mark-inv{background:#ffd000;color:#000}
.pen-lbl{font-size:10px;font-weight:800;color:#ff3b30}
.legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:10px;font-size:11px;color:var(--muted);align-items:center}
.legend span{display:inline-flex;align-items:center;gap:5px}

/* ── Фильтры ───────────────────────────── */
.chips{display:flex;flex-wrap:wrap;gap:7px}
.chip{padding:7px 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface-2);
  color:var(--muted);font-size:12px;cursor:pointer}
.chip.on{border-color:var(--accent);background:var(--accent-soft);color:var(--text)}
.drivers{display:flex;flex-direction:column;gap:4px}
.drv{display:flex;align-items:center;gap:9px;padding:6px 4px;border-radius:8px}
.drv .bar{width:4px;height:24px;border-radius:2px}
.drv .acr{font-weight:800;width:40px}
.drv .nm{flex:1;min-width:0;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drv.off .acr,.drv.off .nm{opacity:.4;text-decoration:line-through}
.star{background:none;border:0;font-size:18px;color:var(--line);cursor:pointer;padding:0 4px}
.star.on{color:var(--accent-ink)}
.switch{width:40px;height:24px;border-radius:12px;border:0;background:var(--surface-2);position:relative;cursor:pointer;
  box-shadow:0 0 0 1px var(--line) inset;flex:none}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;
  background:var(--muted);transition:transform .15s,background .15s}
.switch.on{background:var(--accent-soft);box-shadow:0 0 0 1px var(--accent) inset}
.switch.on::after{transform:translateX(16px);background:var(--accent)}

/* ── Вид ───────────────────────────────── */
.themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:7px;margin-bottom:12px}
.theme{display:flex;align-items:center;gap:7px;padding:8px;border-radius:9px;border:1px solid var(--line);
  background:var(--surface-2);color:var(--text);font-size:11px;font-weight:600;cursor:pointer;text-align:left;min-width:0}
.theme i{width:14px;height:14px;border-radius:50%;flex:none}
.theme span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.opt{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px solid var(--line)}
.opt:first-child{border-top:0}
.opt > span{font-size:13px}
.opt small{display:block;color:var(--muted);font-size:11px}
.seg{display:inline-flex;background:var(--surface-2);border-radius:8px;padding:2px;gap:2px;flex:none}
.seg button{border:0;background:none;color:var(--muted);font-size:11px;font-weight:700;padding:6px 9px;border-radius:6px;cursor:pointer}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:0 0 0 1px var(--accent) inset}

/* ── Панель управления ─────────────────── */
.deck{background:var(--surface);border-top:1px solid var(--line);padding:8px 12px calc(8px + var(--safe-bottom))}
.scrub{width:100%;height:22px;margin:0 0 4px;background:none;-webkit-appearance:none;appearance:none}
.scrub::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:var(--surface-2)}
.scrub::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;
  background:var(--accent);margin-top:-6px;border:2px solid var(--surface)}
.scrub::-moz-range-track{height:4px;border-radius:2px;background:var(--surface-2)}
.scrub::-moz-range-thumb{width:14px;height:14px;border:2px solid var(--surface);border-radius:50%;background:var(--accent)}
.deck-row{display:flex;align-items:center;gap:8px}
.btn{min-width:38px;height:38px;border-radius:9px;border:1px solid var(--line);
  background:var(--surface-2);color:var(--text);font-size:15px;cursor:pointer}
.btn:active{transform:scale(.96)}
.btn-play{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:700;min-width:56px}
.speeds{display:flex;gap:4px;margin-left:auto;overflow-x:auto;min-width:0}
.speed{padding:0 6px;height:38px;border-radius:9px;border:1px solid var(--line);background:var(--surface-2);
  color:var(--muted);font-size:12px;font-weight:700;cursor:pointer;flex:none}
.speed.on{border-color:var(--accent);color:var(--text);background:var(--accent-soft)}

/* ── Иконки событий ────────────────────── */
.ico{width:18px;height:18px;flex:none;display:inline-block;vertical-align:middle}
.card-emoji{display:inline-flex}
.card-emoji .ico{width:20px;height:20px}
.ico.mk{width:15px;height:15px}

/* ── Позиции: режимы ───────────────────── */
.stand-head{flex-direction:column;align-items:stretch;gap:8px;text-transform:none;letter-spacing:0}
.modes{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -12px;padding:0 12px}
.modes::-webkit-scrollbar{display:none}
.mode{flex:none;padding:7px 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);
  color:var(--muted);font-size:12px;font-weight:700;cursor:pointer}
.mode.on{border-color:var(--accent);background:var(--accent-soft);color:var(--text)}
#stSub{align-self:flex-start}
.hint-center{text-align:center;margin-top:10px}

.race-info{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin-bottom:8px;
  display:flex;flex-direction:column;gap:6px;font-size:12px}
.wx{display:flex;flex-wrap:wrap;gap:4px 12px;color:var(--muted)}
.wx b{color:var(--text)}
.wx .rain{color:#2e9bff;font-weight:700}
.fl{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.fl .k,.bsec .k,.h2h .k{color:var(--muted);font-size:11px}
.bsecs{display:flex;gap:6px;flex-wrap:wrap}
.bsec{display:inline-flex;align-items:center;gap:5px;font-size:12px}

/* Время как в тайминге F1: тёмная плашка, цветной текст — читается в обеих темах. */
.tm{display:inline-block;background:#1c1c20;color:#f2f2f4;border-radius:6px;padding:2px 6px;font-size:11px;font-weight:700;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums;white-space:nowrap}
.tm.yellow{color:#ffd000}.tm.green{color:#00e070}.tm.purple{color:#d27cff}
.tm.none{color:#6b6b75}.tm.out{color:#ff3b30}
.tm2{font-size:10px;color:var(--muted);white-space:nowrap}

/* строки таблицы */
.row{gap:6px;padding:6px 8px;cursor:pointer}
.row .p{width:24px}
.row .dp{width:26px;font-size:10px;font-weight:800;color:var(--muted);text-align:center;flex:none}
.row .dp.up{color:#00c46a}.row .dp.down{color:#ff3b30}
.row .acr{width:36px;flex:none}
.row .cells{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:6px}
.row .cells .nm{flex:1;min-width:0;text-align:left}
.row .gap{min-width:64px}
/* Пит-стопы: «PIT 2» в рамке — «П2» никто не понимал. Пусто, если заездов не было. */
.row .pits{flex:none;min-width:40px;text-align:right}
.pitb{display:inline-block;border:1px solid var(--line);border-radius:5px;padding:1px 4px;font-size:9px;font-weight:800;
  color:var(--muted);letter-spacing:.3px;white-space:nowrap}
.pitb b{color:var(--text);font-size:10px;margin-left:2px}
.row.sel{box-shadow:0 0 0 2px var(--accent) inset;background:var(--accent-tint)}
.row.m-sectors .tm.sec{min-width:52px;text-align:center}

.segs{display:flex;gap:5px;flex:1;justify-content:flex-end}
.sgs{display:flex;gap:1.5px}
.segs i,.lg-text i[class^=sg-]{display:inline-block;width:5px;height:12px;border-radius:1px;background:#3a3a42}
.sg-y{background:#ffd000!important}.sg-g{background:#00e070!important}.sg-p{background:#b44cff!important}.sg-x{background:#2e6cff!important}

.tb{display:inline-flex;align-items:center;gap:3px;flex:none}
.tb .tn{font-size:11px;font-weight:800;min-width:14px;text-align:right}
.tb i{width:18px;height:18px;border-radius:50%;border:2px solid;display:grid;place-items:center;font-style:normal;
  font-size:9px;font-weight:900;background:#111}
.tb.old{opacity:.6}
.tb.old i{width:15px;height:15px;font-size:8px}
.prev{display:flex;gap:5px;flex:1;min-width:0;overflow:hidden;justify-content:flex-start}

/* сравнение пилотов */
.h2h{background:var(--surface);border:1px solid var(--accent);border-radius:10px;padding:8px 10px;margin-bottom:8px}
.h2-top{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.h2-top .k{flex:1}
.h2-drv{display:inline-flex;align-items:center;gap:5px}
.h2-drv i{width:4px;height:18px;border-radius:2px}
.h2-drv small{color:var(--muted);font-size:10px;font-weight:700}
.h2-int{flex:1;text-align:center;font-weight:800;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
.h2-int small{display:block;font-family:inherit;font-size:9px;color:var(--muted);letter-spacing:.6px}
.h2-x{background:none;border:0;color:var(--muted);font-size:14px;cursor:pointer;padding:2px 4px}
.h2-row{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:4px 0;border-top:1px solid var(--line);
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
.h2-row > span:first-child{text-align:left}.h2-row > span:last-child{text-align:right}
.h2-row .k{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:10px;font-weight:700;letter-spacing:.5px;
  background:var(--surface-2);border-radius:999px;padding:2px 10px}
.h2-row .win{color:#00c46a;font-weight:800}
.h2-row .tb{justify-content:inherit}

/* ── Инфо ──────────────────────────────── */
.support{border-color:var(--accent);background:var(--accent-tint)}
.support-top{display:flex;gap:12px;align-items:center;margin-bottom:12px}
.support-top b{display:block;font-size:14px}
.support-top span{font-size:12px;color:var(--muted)}
.support-logo{width:48px;height:48px;border-radius:50%;background:var(--accent);display:grid;place-items:center;flex:none}
.support-logo i{width:80%;height:80%;background:var(--on-accent);
  -webkit-mask:url(logo.png) center/contain no-repeat;mask:url(logo.png) center/contain no-repeat}
.btn-support{display:block;text-align:center;text-decoration:none;padding:12px;border-radius:10px;
  background:var(--accent);color:var(--on-accent);font-weight:800;font-size:14px}
.links{display:flex;gap:8px;margin-top:8px}
.links a{flex:1;text-align:center;text-decoration:none;padding:9px;border-radius:9px;border:1px solid var(--line);
  background:var(--surface);color:var(--text);font-size:12px;font-weight:700}
.faq{border-top:1px solid var(--line);padding:9px 0}
.faq:first-of-type{border-top:0}
.faq summary{cursor:pointer;font-weight:700;font-size:13px;list-style:none;display:flex;justify-content:space-between}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--muted);font-weight:400}
.faq[open] summary::after{content:"−"}
.faq p{margin:6px 0 0;font-size:12px;color:var(--text-2)}
.lg{display:flex;gap:10px;align-items:flex-start;padding:7px 0;border-top:1px solid var(--line)}
.lg:first-of-type{border-top:0}
.lg .ico{width:24px;height:24px;margin-top:1px}
.lg b{display:block;font-size:12px}
.lg span{font-size:11px;color:var(--muted)}
.lg-text p{margin:0 0 8px;font-size:12px;color:var(--text-2)}
.lg-text .up{color:#00c46a}.lg-text .down{color:#ff3b30}
.lg-text .mark-pen,.lg-text .mark-inv{display:inline-grid;vertical-align:-3px}
.legend-times{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}
.legend-times > span{display:flex;align-items:center;gap:8px}

/* ── Замок для неподписанных ───────────── */
/* Всё, кроме логотипа, размыто и не нажимается: видно, что внутри что-то есть. */
body.locked .top{position:relative;z-index:60}
body.locked .top .session,body.locked .top .status,body.locked .meters,body.locked .track,
body.locked .tabs,body.locked main,body.locked .deck{filter:blur(6px);pointer-events:none;user-select:none}
body.locked .logo{animation:logoPulse 1.6s infinite}
@keyframes logoPulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 70%,transparent)}
  100%{box-shadow:0 0 0 14px transparent}}
.gate{position:fixed;inset:0;z-index:50;background:color-mix(in srgb,var(--bg) 55%,transparent);
  display:flex;align-items:flex-start;justify-content:center;padding:120px 18px 20px;overflow-y:auto}
/* Стрелка и подпись — поверх шапки, прямо справа от логотипа. */
.gate-arrow{position:fixed;z-index:70;left:64px;top:calc(18px + var(--safe-top));width:54px;height:30px;color:var(--accent-ink);
  animation:arrowNudge 1.4s ease-in-out infinite}
@keyframes arrowNudge{50%{transform:translateX(-5px)}}
.gate-hint{position:fixed;z-index:70;left:122px;top:calc(20px + var(--safe-top));font-size:12px;font-weight:800;color:var(--text);
  background:var(--surface);border:1px solid var(--accent);border-radius:999px;padding:4px 10px;white-space:nowrap}
.gate-card{width:100%;max-width:360px;background:var(--surface);border:1px solid var(--accent);border-radius:16px;
  padding:20px 18px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.45)}
.gate-lock{font-size:30px;line-height:1;margin-bottom:8px}
.gate-card h2{margin:0 0 8px;font-size:18px}
.gate-card p{margin:0 0 16px;font-size:13px;color:var(--text-2)}
.gate-check{width:100%;margin-top:8px;padding:11px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2);
  color:var(--text);font-size:13px;font-weight:700;cursor:pointer}
.gate-card small{display:block;margin-top:8px;color:var(--muted);font-size:12px;min-height:1em}

.gate-arrow,.gate-hint{display:none}
body.locked .gate-arrow,body.locked .gate-hint{display:block}

/* ── Трасса ────────────────────────────── */
.track-box{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:6px;margin-bottom:8px}
.track-svg{display:block;width:100%;height:auto;max-height:46vh}
.track-edge{fill:none;stroke:var(--surface-2);stroke-linejoin:round}
.track-line{fill:none;stroke:var(--line);stroke-linejoin:round}
html[data-mode=dark] .track-line{stroke:#3a3a44}
.car circle{fill:var(--c);stroke:var(--surface);stroke-width:.6px;vector-effect:non-scaling-stroke}
.car text{display:none;fill:var(--text);font-weight:900;text-anchor:middle;paint-order:stroke;stroke:var(--surface);
  stroke-width:3px;stroke-linejoin:round;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}
.car.lbl text{display:block}
.car.sel circle{stroke:var(--text);stroke-width:2px}
.tel-box{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:6px;margin-top:6px}
.tel-hint{grid-column:1/-1;text-align:center;padding:4px 6px;font-size:11px;color:var(--muted)}
.tel{background:var(--surface-2);border-radius:9px;padding:8px 10px}
.tel-head{display:flex;align-items:center;gap:6px;font-size:12px;margin-bottom:4px}
.tel-head i{width:4px;height:14px;border-radius:2px}
.tel-main{display:flex;align-items:baseline;gap:4px}
.tel-speed{font-size:26px;font-weight:900;font-variant-numeric:tabular-nums;line-height:1}
.tel-main small{color:var(--muted);font-size:10px}
.tel-gear{margin-left:auto;font-size:22px;font-weight:900;color:var(--accent-ink)}
.tel-gear small{margin-left:2px}
.tel-rpm{font-size:11px;color:var(--muted);margin:2px 0 6px}
.tel-bars{display:grid;grid-template-columns:auto 1fr;gap:4px 8px;align-items:center;font-size:10px}
.tbar{height:7px;border-radius:4px;background:var(--surface);overflow:hidden;display:block}
.tbar i{display:block;height:100%;border-radius:4px;transition:width .15s}
.tbar.thr i{background:#00c46a}.tbar.brk i{background:#ff3b30}

/* Пример во «Виде» прилипает сверху: видно результат, пока листаешь настройки. */
.preview-sticky{position:sticky;top:-10px;z-index:5;margin:-10px -12px 10px;padding:10px 12px 6px;
  background:var(--bg);border-bottom:1px solid var(--line);box-shadow:0 8px 16px -12px rgba(0,0,0,.6)}
.preview-label{font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.3px;margin-bottom:6px}
.preview-sticky .card{margin-bottom:6px}

/* ── Архив сессий ──────────────────────── */
.session{background:none;border:0;color:inherit;font:inherit;cursor:pointer;padding:0}
.chev{color:var(--accent-ink);font-size:10px}
.sheet{position:fixed;inset:0;z-index:80;background:rgba(0,0,0,.5);display:flex;align-items:flex-end}
.sheet-card{width:100%;max-height:80vh;overflow-y:auto;background:var(--surface);border-radius:16px 16px 0 0;
  padding:14px 14px calc(14px + var(--safe-bottom));border-top:1px solid var(--line);animation:sheetUp .22s ease-out}
@keyframes sheetUp{from{transform:translateY(40px)}}
.sheet-head{display:flex;align-items:center;justify-content:space-between}
.sheet-head h3{margin:0;font-size:15px}
.weekend{margin-bottom:12px}
.weekend-head{display:flex;align-items:baseline;gap:6px;font-size:13px;margin-bottom:6px}
.weekend-head .k{margin-left:auto;font-size:11px;color:var(--muted)}
.weekend-sessions{display:flex;flex-wrap:wrap;gap:6px}
.race{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:7px 11px;color:var(--text);
  cursor:pointer;font-size:12px;font-weight:700;text-align:left}
.race small{display:block;font-size:10px;font-weight:400;color:var(--muted)}
.race.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.race-tag{font-size:9px;font-weight:800;color:var(--on-accent);background:var(--accent);border-radius:999px;padding:1px 6px;margin-left:4px}
.archive-btn{margin-top:8px}
.nd{font-size:10px;color:var(--muted);font-weight:700}
