/* Темы через CSS-переменные. Тёмная — по умолчанию.
   Цвет текста — не ниже 4,5:1 (WCAG AA) на bg, bg-2, bg-3 и на своей подложке *-bg; текст на заливке акцентом — --on-accent. */
:root, [data-theme="dark"] {
  --bg: #0e1116; --bg-2: #151a21; --bg-3: #1c232c; --line: #2a323d;
  --text: #d8dee7; --muted: #8a96a6; --accent: #4c9aff; --on-accent: #0e1116;
  --green: #2fbf71; --yellow: #e0b341; --red: #f17575; --gray: #808a98;
  --green-bg: rgba(47,191,113,.14); --yellow-bg: rgba(224,179,65,.14); --red-bg: rgba(241,117,117,.14);
  --shadow: 0 6px 24px rgba(0,0,0,.45);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f7fa; --bg-2: #ffffff; --bg-3: #eef1f5; --line: #d9dee5;
  --text: #1b2330; --muted: #5d6878; --accent: #1d69d4; --on-accent: #fff;
  --green: #12723e; --yellow: #805e00; --red: #b92a2a; --gray: #636e7e;
  --green-bg: rgba(18,114,62,.10); --yellow-bg: rgba(128,94,0,.10); --red-bg: rgba(185,42,42,.10);
  --shadow: 0 6px 24px rgba(0,0,0,.12);
  color-scheme: light;
}
/* Движение — короткое и служебное: --ease — одна кривая на всё (как у полосы шагов «Инструкции»),
   --t-fast — отклик на наведение, --t — смена состояния, --t-move — подсветка едет к новому месту */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --t-fast: .12s; --t: .2s; --t-move: .26s; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
/* фокус с клавиатуры — кольцо акцентом, а не рамка браузера */
:is(button, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.num, td.num { font-variant-numeric: tabular-nums; text-align: right; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .02em; }
.tabs { display: flex; gap: 2px; position: relative; --glide-bg: var(--bg-3); --glide-r: 6px; }
.tabs a { padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; transition: color var(--t) var(--ease); }
.tabs a:not(.active):hover { color: var(--text); }
.tabs a.active { background: var(--bg-3); color: var(--text); }
.spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
/* кнопки отвечают на наведение рамкой акцента, на нажатие — сдвигом на 1 px */
.icon-btn, .btn { transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast), transform var(--t-fast); }
.icon-btn:hover, .btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn:active, .btn:active:not(:disabled) { transform: translateY(1px); }
/* значки — SVG-маска цвета текста: одинаковы в любом шрифте и в обеих темах */
.ico { display: inline-block; width: 1.2em; height: 1.2em; flex: none; vertical-align: middle; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ico-menu { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2.5 4h11M2.5 8h11M2.5 12h11'/%3E%3C/svg%3E"); }
.ico-theme { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5.7' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M8 2.3a5.7 5.7 0 0 1 0 11.4z'/%3E%3C/svg%3E"); }
.ico-close { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E"); }
/* значки разделов — у вкладок; рисуются только на телефоне (нижняя панель и лист «Ещё») */
.ico-terminal { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='12' height='10' rx='1.5'/%3E%3Cpath d='M2 7h12M6.5 7v6'/%3E%3C/svg%3E"); }
.ico-stats { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M3.5 13V8M8 13V3.5M12.5 13V10M2 13.5h12'/%3E%3C/svg%3E"); }
.ico-journal { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2.5h8.5v11H4A1.5 1.5 0 0 1 2.5 12V4A1.5 1.5 0 0 1 4 2.5zM6.5 6h3.5M6.5 9h3.5'/%3E%3C/svg%3E"); }
.ico-calendar { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 7h12M5 1.5v3M11 1.5v3'/%3E%3C/svg%3E"); }
.ico-game { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12.5l3.5-4 3 2.5 5.5-7'/%3E%3Cpath d='M10.5 4h3.5v3.5'/%3E%3C/svg%3E"); }
.ico-sources { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='2' y='2.5' width='12' height='4' rx='1.2'/%3E%3Crect x='2' y='9.5' width='12' height='4' rx='1.2'/%3E%3Cpath d='M4.5 4.5h.01M4.5 11.5h.01'/%3E%3C/svg%3E"); }
.ico-guide { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 3.5h4A1.5 1.5 0 0 1 8 5v8.5a1 1 0 0 0-1-1H2.5zM13.5 3.5h-4A1.5 1.5 0 0 0 8 5v8.5a1 1 0 0 1 1-1h4.5z'/%3E%3C/svg%3E"); }
.ico-updates { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.6 8a5.4 5.4 0 1 0 1.6-3.8'/%3E%3Cpath d='M2.5 2v2.8h2.8M8 5v3.2l2.2 1.4'/%3E%3C/svg%3E"); }
.ico-rub { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 13.5V2.5h3.25a2.75 2.75 0 0 1 0 5.5H5.5M3.5 10.5h5.5M3.5 8h2'/%3E%3C/svg%3E"); }
.ico-users { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='5.5' r='2.5'/%3E%3Cpath d='M1.5 13.5c.4-2.4 2.2-4 4.5-4s4.1 1.6 4.5 4M10.5 3.2a2.5 2.5 0 0 1 0 4.6M12.3 9.9c1.1.6 1.9 1.8 2.2 3.6'/%3E%3C/svg%3E"); }
.ico-tariffs { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8.4V3.5a1 1 0 0 1 1-1h4.9l5.3 5.3a1 1 0 0 1 0 1.4l-4.5 4.5a1 1 0 0 1-1.4 0z'/%3E%3Cpath d='M5.6 5.6h.01'/%3E%3C/svg%3E"); }
.ico-more { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3E%3Ccircle cx='3' cy='8' r='1.5'/%3E%3Ccircle cx='8' cy='8' r='1.5'/%3E%3Ccircle cx='13' cy='8' r='1.5'/%3E%3C/svg%3E"); }
.tabs-more, .tabs-sheet, .tabs-backdrop { display: none; }   /* только на телефоне */
/* точка статуса цвета текста (связь, биржи) — размер от шрифта, как был у знака ● */
.dot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; background: currentColor; vertical-align: middle; }
.user { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.user a { color: var(--accent); text-decoration: none; }
.user[hidden] { display: none; }
.conn { color: var(--gray); transition: color var(--t) var(--ease); }
.conn.on { color: var(--green); }
.conn.off { color: var(--red); }
/* пульс точки связи — пришла и применена новая порция вилок (shell.js flush) */
.conn .dot { position: relative; }
.conn .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0; }
.conn.beat .dot::after { animation: cf-beat .9s var(--ease); }
@keyframes cf-beat { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(2.8); } }

.banner { background: var(--red-bg); color: var(--red); border-bottom: 1px solid var(--red); padding: 6px 12px; font-weight: 600; animation: cf-fade var(--t) var(--ease); }

.kpi { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding: 8px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.kpi-item { display: flex; flex-direction: column; gap: 1px; }
.kpi-item.budget { flex-direction: row; align-items: center; gap: 8px; margin-left: auto; }
.kpi-label { color: var(--muted); font-size: 11px; }
.kpi-item b { padding: 0 4px; margin: 0 -4px; border-radius: 4px; }   /* поле под вспышку «тика», текст не сдвигается */
.light.green { color: var(--green); } .light.yellow { color: var(--yellow); } .light.red { color: var(--red); } .light.gray { color: var(--gray); }
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; position: relative; }
.seg button { background: none; border: 0; border-radius: 5px; padding: 4px 12px; transition: color var(--t-move) var(--ease), background-color var(--t-fast); }
.seg button:not(.active):hover { background: var(--bg-3); }
.seg button.active { background: var(--accent); color: var(--on-accent); }
/* Скользящая подсветка (motion.js glide): заливка выбранного — ::before во весь контейнер, вырезанная clip-path
   по месту кнопки .active; едет переход clip-path — без пересчёта раскладки. Без скрипта остаётся заливка самой кнопки. */
.glide { isolation: isolate; }
.glide::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: var(--glide-bg, var(--accent));
  clip-path: inset(var(--gy, 0px) calc(100% - var(--gx, 0px) - var(--gw, 0px)) calc(100% - var(--gy, 0px) - var(--gh, 0px)) var(--gx, 0px) round var(--glide-r, 5px));
  transition: clip-path var(--t-move) var(--ease); }
.glide.glide-none::before { visibility: hidden; }
.glide.glide-now::before { transition: none; }
.glide:not(.glide-none) > .active { background: transparent; }
/* «Тик»: число изменилось — короткая вспышка подложкой акцента, как у новой вилки (затухание цвета, без движения) */
.tick { animation: cf-tick 1.2s ease-out; }
@keyframes cf-tick { 0%, 15% { background-color: color-mix(in srgb, var(--accent) 26%, transparent); } 100% { background-color: transparent; } }
@keyframes cf-fade { from { opacity: 0; } }
input[type=number], input[type=text], select { background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; width: 110px; }
input.invalid { border-color: var(--red); background: var(--red-bg); }
.field-err { color: var(--red); font-size: 11px; }
/* «?» у термина: всплывает определение, щелчок — слово в «Инструкции» */
.help { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1;
  text-decoration: none; vertical-align: 1px; cursor: help; flex: none; position: relative; transition: color var(--t-fast), border-color var(--t-fast); }
.help::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }   /* попадание пальцем — 26 px, глиф прежний */
.help:hover { color: var(--accent); border-color: var(--accent); }
.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.layout { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 280px; flex: none; overflow: auto; background: var(--bg-2); border-right: 1px solid var(--line); padding: 10px 12px;
  display: flex; flex-direction: column; }   /* колонкой — «✓ сохранено» внизу и при коротком содержимом (12.11) */
#settings { flex: 1 0 auto; }
body.sidebar-collapsed .sidebar { display: none; }
main { flex: 1; overflow: auto; position: relative; padding: 10px 12px; }
.view[hidden] { display: none; }
/* смена раздела: новый проявляется из полупрозрачного (без сдвига: transform сломал бы шторку position: fixed внутри) */
.view.view-in { animation: cf-view-in .18s var(--ease); }
@keyframes cf-view-in { from { opacity: .35; } }
@media (min-width: 901px) {   /* открытая панель настроек въезжает слева; на узком экране у неё свой выезд */
  .sidebar.side-in { animation: cf-side-in var(--t-move) var(--ease); }
}
@keyframes cf-side-in { from { opacity: .4; transform: translateX(-10px); } }

/* крестик закрывает панель и на компьютере (замечание владельца 01.11: «☰» в шапке не находили, страницы оставались
   узкими); прилипает к верху панели при прокрутке */
.sidebar-close { display: block; position: sticky; top: 0; z-index: 1; margin: 0 0 4px auto; padding: 4px 10px; font-size: 15px; background: var(--bg-2); }
.sidebar h3 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sidebar h3:first-child { margin-top: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
.row label { color: var(--text); }
.row .field { display: flex; flex-direction: column; align-items: flex-end; }
.hint { color: var(--muted); font-size: 11px; }
/* низ панели — «✓ сохранено, ЧЧ:ММ» (12.11), прилипает к низу при прокрутке; Telegram не подключён — предупреждение */
.settings-saved { position: sticky; bottom: 0; margin: 8px -12px -10px; padding: 6px 12px; background: var(--bg-2); border-top: 1px solid var(--line); color: var(--green); font-size: 11px; }
.settings-saved:empty { display: none; }
.settings-saved.bad { color: var(--red); }
.tg-warn { margin: 4px 0; padding: 6px 8px; border-radius: 6px; background: var(--yellow-bg); color: var(--yellow); font-size: 12px; }
.tg-ex summary { cursor: pointer; margin: 6px 0 2px; color: var(--text); }
.tg-ex-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; padding: 2px 0 6px; }
.tg-ex-list label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-ex-list .any-bank { grid-column: 1 / -1; }   /* «Любой банк» — своей строкой над банками */
.btn { background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
.tg-link { margin: 4px 0 8px; }
.tg-link a.btn { display: inline-block; color: var(--text); text-decoration: none; }

.first-run { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.first-run[hidden] { display: none; }
.first-run .ill { width: min(352px, 100%); height: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* Схемы (web/schemes.js): тонкие линии темы, акцент — то, что движется и вспыхивает; зелёный — только пометка.
   Контур чертится при первом появлении (.is-in ставит watch), текст проявляется следом; .late — вторая очередь.
   «Уменьшить движение» схемы не останавливает — решение владельца 09.10 (как на td-logic.ru). */
.ill { display: block; overflow: visible; font-family: inherit; }
.ill .ln { fill: none; stroke: color-mix(in srgb, var(--muted) 45%, transparent); stroke-width: 1.5; }
.ill .lm { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.ill .lb { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.ill .lt { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; }
.ill .dash { stroke-dasharray: 4 5; }
.ill .fn { fill: var(--ill-bg, var(--bg)); }
.ill .fb { fill: var(--accent); }
.ill .glow { fill: var(--accent); opacity: .3; filter: blur(4px); }
.ill .tick-bg { fill: color-mix(in srgb, var(--accent) 26%, transparent); }
.ill .pill-g { fill: var(--green-bg); }
.ill text { fill: var(--muted); font-size: 12px; }
.ill .tt { fill: var(--text); }
.ill .tb { fill: var(--accent); }
.ill .tg { fill: var(--green); font-size: 11px; font-weight: 600; }
.ill .tn { font-variant-numeric: tabular-nums; }
.ill .big { font-size: 20px; font-weight: 700; }
.ill .mid { font-size: 16px; font-weight: 700; }
.ill.draw :is(.ln, .lm, .lb, .lt):not(.dash) { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.ill.draw :is(text, .dash, .pill-g) { opacity: 0; }
.ill.draw.is-in :is(.ln, .lm, .lb, .lt):not(.dash) { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease); }
.ill.draw.is-in :is(text, .dash, .pill-g) { opacity: 1; transition: opacity .6s var(--ease) .5s; }
.ill.draw.is-in .late:not(text, .dash) { transition-delay: .8s; }
.ill.draw.is-in :is(text, .dash).late { transition-delay: 1.3s; }
/* пустое состояние раздела: схема над надписью; пока сканер запускается, у пустого терминала — только надпись */
.ill-wrap .ill { width: min(300px, 100%); height: auto; margin: 0 auto 10px; }
.ill-wrap p { margin: 0 auto; max-width: 46ch; }
.first-run:not([hidden]) ~ #view-terminal .term-empty .ill { display: none; }
.stub { border: 1px dashed var(--line); border-radius: 8px; padding: 16px; color: var(--muted); margin-bottom: 10px; }
/* кнопка, которая выглядит ссылкой: «Указать страну» в терминале, «выбрать» в панели */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 3px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.grid th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--bg); }
table.grid td.err { white-space: normal; color: var(--muted); max-width: 420px; }
.badge { display: inline-block; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.degraded { background: var(--yellow-bg); color: var(--yellow); }
.badge.down, .badge.broken { background: var(--red-bg); color: var(--red); }
.badge.disabled, .badge.pending { background: var(--bg-3); color: var(--muted); }

@media (max-width: 900px) {
  /* панель поверх таблицы выезжает сдвигом (transform) — раскладка страницы не пересчитывается */
  .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: 86vw; max-width: 340px; box-shadow: var(--shadow); transition: transform .15s, visibility .15s; }
  body.sidebar-collapsed .sidebar { display: flex; transform: translateX(-100%); visibility: hidden; box-shadow: none; }
  .kpi-item.budget { margin-left: 0; }
  .topbar { gap: 8px; padding: 6px 8px; }
  #user-name { display: none; }
  /* вкладки — нижняя панель: четыре раздела и «Ещё», остальные — листом над панелью (#tabs-sheet, раскладывает shell.js layoutTabs) */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--bg-2); border-top: 1px solid var(--line); --glide-r: 8px; }
  .tabs a, .tabs-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 46px; padding: 4px 2px;
    border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 11px; line-height: 1.2; white-space: nowrap;
    transition: color var(--t) var(--ease); }
  .tabs a.active, .tabs-more.active { background: var(--bg-3); color: var(--text); }
  .tabs a::before, .tabs-more::before, .tabs-sheet a::before { content: ""; width: 22px; height: 22px; flex: none; background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
  main { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tabs-backdrop { position: fixed; inset: 0; z-index: 14; background: rgba(0, 0, 0, .35); }
  .tabs-sheet { position: fixed; left: 0; right: 0; bottom: calc(54px + env(safe-area-inset-bottom)); z-index: 16; flex-direction: column; padding: 6px 0;
    background: var(--bg-2); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: var(--shadow); }
  body.tabs-open .tabs-backdrop { display: block; animation: cf-fade var(--t) var(--ease); }
  body.tabs-open .tabs-sheet { display: flex; animation: cf-sheet-up var(--t-move) var(--ease); }
  .tabs-sheet a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--text); font-size: 14px; text-decoration: none; }
  .tabs-sheet a.active { color: var(--accent); }
}
@keyframes cf-sheet-up { from { opacity: .4; transform: translateY(24px); } }
/* «Меньше анимации» в системе: ничего не едет и не проявляется — панель, лист, подсветка переключателя и раздел
   встают сразу (шторка, карточка и новая вилка — terminal.css, столбики — stats.css, «Инструкция» — guide.css).
   Остаются смены цвета без движения — «тик» числа и наведение; спиннер крутится — он единственный признак загрузки. */
@media (prefers-reduced-motion: reduce) {
  .sidebar, .glide::before { transition: none; }
  .view.view-in, .sidebar.side-in, .banner, body.tabs-open .tabs-backdrop, body.tabs-open .tabs-sheet, .conn.beat .dot::after { animation: none; }
  .icon-btn:active, .btn:active:not(:disabled) { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
/* смена темы — плавное перетекание цветов (shell.js, View Transitions; браузер без них меняет сразу) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; animation-timing-function: var(--ease); }

/* Подписка закончилась — shell.js subscriptionEnded: вход есть, открыты «Игра», «Инструкция» и «Тарифы» с «Продлить»;
   KPI, бюджет, настройки и связь со сканером скрыты (данных нет), закрытые вкладки — атрибутом hidden */
body.sub-ended #kpi, body.sub-ended #banner, body.sub-ended #first-run, body.sub-ended #sidebar,
body.sub-ended #sidebar-toggle, body.sub-ended #conn { display: none !important; }
.tabs a[hidden], .tabs-sheet a[hidden], .tabs-more[hidden] { display: none !important; }
@media (max-width: 900px) { body.sub-ended .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Доступ закрыт (аккаунт отключён или удалён) — shell.js accessClosed */
body.access-closed > :not(.closed-note) { display: none !important; }
.closed-note { max-width: 32rem; margin: 18vh auto 0; padding: 0 16px; }
.closed-note h1 { font-size: 1.4rem; margin: 0 0 .5rem; }
.closed-note p { color: var(--muted); margin: 0 0 1.25rem; }
.closed-note a.btn { display: inline-block; color: var(--text); text-decoration: none; padding: 6px 14px; }
