/* Капельница. Светлый тёплый инструмент: крупные цифры, большие кнопки,
   всё важное — в нижней половине экрана, чтобы доставал большой палец.

   Цвет приложения выбирается в настройках (data-accent на <html>):
   голубой, салатовый, бирюзовый. Все три проверены на контраст:
   белый текст на цветной кнопке — не ниже 4,5:1. */

:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --ink: #1a1d21;
  --ink-2: #5b636c;
  --ink-3: #6e767f;
  --line: #ebe7e0;
  --line-2: #dad5cc;
  --accent: #0a7ea4;
  --accent-soft: #e6f3f8;
  --accent-ink: #065a75;
  --fluid: #7fc9e4;
  --fluid-dark: #43a9cd;
  --ok: #1a8a5a;
  --on-accent: #ffffff;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --err: #c0392b;
  --err-soft: #fdeeec;
  --radius: 22px;
  --radius-s: 15px;
  --shadow: 0 1px 2px rgba(60,45,30,.04), 0 8px 28px rgba(60,45,30,.07);
  --tap: 58px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
}
:root[data-accent="salad"] {
  --accent: #3b8229; --accent-soft: #ebf5e4; --accent-ink: #2a5f1d;
  --fluid: #a9db8e; --fluid-dark: #6fb54d;
}
:root[data-accent="teal"] {
  --accent: #0a7f76; --accent-soft: #e2f3f0; --accent-ink: #075c55;
  --fluid: #84d6cc; --fluid-dark: #3fb2a4;
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

:root[data-theme="dark"], :root.theme-dark {
  --bg: #14171b;
  --card: #1d2126;
  --ink: #f1f2f3;
  --ink-2: #a3adb7;
  --ink-3: #7f8a95;
  --line: #2a3037;
  --line-2: #3a424b;
  --accent: #4ec2e8;
  --accent-soft: #123340;
  --accent-ink: #9adcf3;
  --fluid: #4ba9c9;
  --fluid-dark: #2d7c99;
  --ok: #46c08a;
  --on-accent: #06222c;
  --warn: #e3a33d;
  --warn-soft: #33270f;
  --err: #f0776a;
  --err-soft: #3a1d1a;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 28px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root.theme-dark[data-accent="salad"] {
  --accent: #8ccf63; --accent-soft: #1f3518; --accent-ink: #bfe6a6;
  --fluid: #6aa94b; --fluid-dark: #4a8a2f; --on-accent: #0b1a10;
}
:root.theme-dark[data-accent="teal"] {
  --accent: #45cbbb; --accent-soft: #10342f; --accent-ink: #9fe6dc;
  --fluid: #3aa497; --fluid-dark: #237b70; --on-accent: #06221f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; min-height: 100dvh; }

.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.screen {
  flex: 1;
  /* сверху — место под часы и значок сети айфона, иначе шапка уезжает под них */
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
  max-width: 560px; width: 100%; margin: 0 auto;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 25px; }
h2 { font-size: 19px; }
p { margin: 0; }

/* ───────── шапка ───────── */
.head { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; }
.head h1 { flex: 1; text-transform: uppercase; letter-spacing: .06em; font-size: 17px; color: var(--ink-2); font-weight: 700; }
.head .head-act { display: flex; gap: 6px; }

/* ───────── карточки ───────── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.card-title { font-size: 13.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; margin-bottom: 12px; }

/* ───────── поля ввода ───────── */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field-label .unit { color: var(--ink-3); font-size: 13.5px; }

.input-row { display: flex; align-items: stretch; gap: 8px; }
input[type="number"], input[type="text"], input[type="time"], select {
  width: 100%; min-height: var(--tap);
  font: 600 29px/1.1 var(--font); letter-spacing: -.02em;
  color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line-2); border-radius: var(--radius-s);
  padding: 8px 14px; appearance: none;
}
input[type="time"] { font-size: 25px; }
input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--card); }
input.is-bad { border-color: var(--err); background: var(--err-soft); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.field-err { color: var(--err); font-size: 14.5px; margin-top: 6px; display: flex; gap: 6px; align-items: center; }

/* быстрый выбор */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 44px; padding: 0 15px; border-radius: 22px;
  border: 1.5px solid var(--line-2); background: var(--card);
  color: var(--ink-2); font: 600 16px/1 var(--font);
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip small { font-weight: 500; opacity: .75; font-size: 12.5px; }
/* Короткие быстрые кнопки — ровно в один ряд, одинаковой ширины.
   Подпись «макро/микро» уходит под число, иначе четыре не влезают в 375 точек. */
.chips--fit { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.chips--fit .chip { padding: 0 4px; justify-content: center; }
.chips--fit .chip:has(small) { flex-direction: column; gap: 1px; min-height: 54px; }
.chip--ghost { border-style: dashed; }

/* переключатель */
.seg { display: flex; background: var(--bg); border-radius: var(--radius-s); padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button {
  flex: 1; min-width: 0; min-height: 48px; border: 0; border-radius: 11px; background: transparent;
  color: var(--ink-2); font: 600 16.5px/1.15 var(--font); cursor: pointer; padding: 4px 6px;
}
.seg button.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ───────── кнопки ───────── */
.btn {
  min-height: var(--tap); padding: 0 20px; border-radius: var(--radius-s);
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink);
  font: 650 18px/1.15 var(--font); display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; width: 100%;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--danger { color: var(--err); border-color: var(--line-2); }
.btn--ghost { background: transparent; }
.btn--icon { width: auto; min-width: 48px; min-height: 48px; padding: 0 10px; border: 0; background: transparent; color: var(--ink-2); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; min-width: 0; padding: 0 10px; gap: 6px; font-size: 16.5px; white-space: nowrap; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ───────── результат ───────── */
.result { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; scroll-margin-top: calc(var(--safe-t) + 12px); }
.result-main { padding: 20px 16px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.result-main .lbl { font-size: 13.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.result-main .big { font-size: 56px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.result-main .sub { color: var(--ink-2); font-size: 16px; margin-top: 6px; }
.result-main .sub b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.result-main .sub--margin { font-size: 14.5px; margin-top: 2px; color: var(--accent-ink); }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; }
.rcell { padding: 14px 15px; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rcell:nth-child(2n) { border-right: 0; }
.rcell .k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.rcell .v { font-size: 28px; font-weight: 680; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rcell .u { font-size: 14.5px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.rcell--wide { grid-column: 1 / -1; border-right: 0; }

.hint { background: var(--accent-soft); color: var(--accent-ink); padding: 13px 16px; font-size: 16px; line-height: 1.45; }
.hint b { font-weight: 700; }
.note-round { background: var(--warn-soft); color: var(--warn); padding: 13px 16px; font-size: 14.5px; line-height: 1.45; display: flex; gap: 8px; }
.note-round .icon { flex: none; margin-top: 1px; }

.disclaimer { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; padding: 13px 16px; border-top: 1px solid var(--line); }

.errors { background: var(--err-soft); color: var(--err); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-size: 16px; }
.errors ul { margin: 0; padding-left: 18px; }

/* ───────── капельница ───────── */
.dripbox { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 16px; margin-bottom: 14px; }
.dripstage { position: relative; padding-bottom: 28px; }   /* внизу — полоска под подсказку, чтобы не лежала на картинке */
.dripwrap { display: flex; justify-content: center; align-items: center; height: 270px; }
.drip { height: 270px; width: auto; }

.drip-bag { fill: var(--bg); stroke: var(--line-2); stroke-width: 2.2; }
.drip-bag-fluid { fill: var(--fluid); opacity: .55; }
.drip-bag-label { fill: var(--line-2); }
.drip-tube { fill: var(--line-2); }
.drip-tube-fluid { fill: var(--fluid); opacity: .7; }
.drip-chamber { fill: var(--bg); stroke: var(--line-2); stroke-width: 2.2; }
.drip-chamber-fluid { fill: var(--fluid); opacity: .75; }
.drip-spike { fill: var(--line-2); }
.drip-glare { fill: #fff; opacity: .5; }
:root[data-theme="dark"] .drip-glare, :root.theme-dark .drip-glare { opacity: .07; }
.drip-clamp { fill: var(--line-2); }
.drip-clamp-wheel { fill: var(--ink-3); opacity: .5; }
.drip-drop { fill: var(--fluid-dark); }
.drip-splash { fill: none; stroke: var(--fluid-dark); stroke-width: 1.6; }

.drip-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.drip-meta b { color: var(--ink); font-weight: 680; }

.transport { display: flex; gap: 10px; margin-top: 12px; }

/* поле для тапов поверх картинки: почти невидимое, пока им не пользуются */
.tapover {
  position: absolute; inset: 0; width: 100%; border: 0; margin: 0; padding: 0 0 4px;
  background: transparent; border-radius: var(--radius-s); cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center; font: inherit;
  transition: background .25s;
}
.tapover-hint { font-size: 13px; color: var(--ink-3); opacity: .7; letter-spacing: .02em; }
.tapover.is-live { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.tapover.is-live .tapover-hint { opacity: 0; }
.tapover.is-hit { background: color-mix(in srgb, var(--accent) 14%, transparent); transition: none; }

/* панель метронома */
.tm { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-ink); }
.tm-row { display: flex; align-items: center; gap: 8px; }
.tm-num { flex: 1; font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.tm-num.is-dim { color: var(--ink-3); }
.tm-num .u { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.tm-sub { font-size: 15px; margin-top: 4px; line-height: 1.4; }
.tm-wait { font-size: 16px; color: var(--ink-2); text-align: center; padding: 8px 0; }
.tm-x { color: var(--accent-ink); }
.tm-use { margin-top: 12px; }
.tm .hint { margin: 12px -16px 0; }
.tm .note-round { margin: 12px -16px 0; }
.tm--big { background: var(--card); color: var(--ink-2); padding: 16px; }
.tm--big .tm-num { font-size: 48px; text-align: left; }
.tm--big .hint, .tm--big .note-round { margin: 12px 0 0; border-radius: var(--radius-s); }

.lead { color: var(--ink-2); font-size: 16.5px; line-height: 1.45; margin: -4px 2px 14px; }
.transport .btn { flex: 1; }

/* ───────── таймер ───────── */
.timer-big { text-align: center; padding: 22px 16px 10px; }
.timer-big .clock { font: 700 60px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timer-big .lbl { font-size: 13.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.timer-big.is-paused .clock { color: var(--warn); }
.timer-big.is-done .clock { color: var(--ok); }
.timer-margin { color: var(--accent-ink); font-size: 15px; margin-top: 8px; line-height: 1.35; }

.bar { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 12px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s linear; }
.bar-row { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-2); }
.bar-row b { color: var(--ink); font-weight: 680; }

.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius-s); overflow: hidden; }
.pairs > div { background: var(--card); padding: 12px 14px; min-width: 0; }
.pairs .k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.pairs .v { font-size: 21px; font-weight: 680; margin-top: 2px; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 13px; font: 650 13.5px/1 var(--font); }
.badge--run { background: var(--accent-soft); color: var(--accent-ink); }
.badge--pause { background: var(--warn-soft); color: var(--warn); }
.badge--done { background: #e6f6ee; color: var(--ok); }
:root[data-theme="dark"] .badge--done, :root.theme-dark .badge--done { background: #102e21; }

/* ───────── подсчёт капель ───────── */
.tapzone {
  width: 100%; min-height: 220px; border-radius: var(--radius); border: 2px dashed var(--line-2);
  background: var(--card); color: var(--ink); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; cursor: pointer; margin: 0 0 14px; font: inherit;
  transition: background .25s, border-color .25s;
}
.tapzone.is-live { border-style: solid; border-color: var(--accent); }
.tapzone.is-hit { background: var(--accent-soft); transition: none; }
.tapzone .t { font-size: 16px; color: var(--ink-2); }
/* капля-значок: на каждый тап коротко «падает» */
.tapzone-drop {
  width: 46px; height: 46px; background: var(--fluid-dark);
  border-radius: 50% 0 50% 50%; transform: rotate(-45deg);
}
.tapzone.is-hit .tapzone-drop { animation: drop .26s ease-out; }
@keyframes drop { from { transform: translateY(-14px) rotate(-45deg) scale(.85); } to { transform: rotate(-45deg); } }

/* ───────── списки ───────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border-radius: var(--radius-s); box-shadow: var(--shadow); padding: 14px 15px; display: flex; gap: 10px; align-items: flex-start; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 680; font-size: 18px; }
.item-sub { color: var(--ink-2); font-size: 14.5px; margin-top: 3px; line-height: 1.4; }
.item-when { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
.item-acts { display: flex; flex-direction: column; gap: 4px; }

.empty { text-align: center; color: var(--ink-2); padding: 44px 18px; font-size: 16.5px; line-height: 1.5; }
.empty-title { font-size: 21px; font-weight: 700; color: var(--ink); }

/* ───────── настройки ───────── */
.rows { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); min-height: var(--tap); }
.row:last-child { border-bottom: 0; }
.row--link { color: inherit; text-decoration: none; }
.row--link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row-go { color: var(--ink-3); font-size: 24px; line-height: 1; }
/* Узкий экран: переключатель из трёх-пяти кнопок не влезает рядом с подписью,
   поэтому такие строки складываем в столбик. */
.row--stack { display: block; }
.row--stack .row-main { margin-bottom: 10px; }
.row--stack .seg { width: 100%; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 18px; }
.row-sub { color: var(--ink-3); font-size: 14px; margin-top: 3px; line-height: 1.4; }
.swatch { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 58px; font-size: 15px !important; }
.swatch i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #0a7ea4; }
.swatch i[data-accent="salad"] { background: #3b8229; }
.swatch i[data-accent="teal"] { background: #0a7f76; }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: var(--line-2); border-radius: 16px; transition: background .18s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ───────── обратная связь ───────── */
.feedback-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--accent-soft); color: var(--ink); border: 0; border-radius: var(--radius);
  padding: 16px; margin-bottom: 18px; font: inherit;
}
.feedback-card .row-sub { color: var(--accent-ink); }
.feedback-card-go { flex: none; background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: 16px; padding: 10px 16px; border-radius: 22px; }
textarea.feedback-text {
  width: 100%; min-height: 168px; resize: vertical; display: block;
  font: 400 18px/1.45 var(--font); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line-2); border-radius: var(--radius-s); padding: 12px 14px;
}
textarea.feedback-text:focus { outline: none; border-color: var(--accent); background: var(--card); }
.unit.is-bad { color: var(--err); }
.feedback-status { margin-top: 12px; color: var(--err); font-size: 15.5px; line-height: 1.45; }
.feedback-ok { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }

/* ───────── нижняя навигация ───────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tab {
  border: 0; background: transparent; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: var(--tabbar-h); font: 600 12.5px/1 var(--font); cursor: pointer; position: relative;
}
.tab.is-on { color: var(--accent); }
.tab .dot { position: absolute; top: 10px; margin-left: 20px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }


/* ───────── плитки на доске «Идёт сейчас» ───────── */
.tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 15px 16px 14px; border-left: 5px solid var(--accent); cursor: pointer;
}
.tile--paused { border-left-color: var(--warn); }
.tile--soon { border-left-color: var(--warn); background: var(--warn-soft); }
.tile--done { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--card)); }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile-name { flex: 1; font-weight: 700; font-size: 19px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-note { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.tile-clock { font: 700 38px/1.05 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.tile--done .tile-clock { color: var(--ok); font-family: inherit; font-size: 31px; }
.tile--paused .tile-clock { color: var(--warn); }
.tile-sub { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.tile .bar { margin: 10px 0 0; height: 8px; }
.tile-acts { display: flex; gap: 8px; margin-top: 10px; }
.tile-acts .btn { flex: 1; min-height: 48px; font-size: 16.5px; padding: 0 12px; }
.tile-acts .btn--icon { flex: none; min-width: 48px; }

/* счётчик на вкладке */
.tab .count {
  position: absolute; top: 8px; margin-left: 24px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent);
  font: 700 11px/18px var(--font); font-style: normal; text-align: center;
}
.tab .count--alarm { background: var(--err); color: #fff; }

.item-where { font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; margin-bottom: 2px; }

/* ───────── всплывашки ───────── */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: #24262a; color: #fff; padding: 13px 18px; border-radius: 24px; font-size: 16px;
  max-width: 90%; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 26px rgba(0,0,0,.28);
}
.toast.is-in { opacity: 1; transform: none; }
.toast--err { background: var(--err); }
.toast--ok { background: var(--ok); }

/* ───────── аварийный экран ───────── */
#boot-fallback { display: none; padding: 40px 24px; text-align: center; color: var(--ink-2); }
#boot-fallback.is-on { display: block; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}
