/* Центр — «Пульт управления» (макет А, утверждён владельцем 03.10.2026).

   Тёмная приборная панель по умолчанию и светлая тема: в браузере — по системной теме или по кнопке в шапке,
   в Mini App — по теме Telegram (атрибут data-theme ставит app.js). Шрифт Golos Text лежит рядом со страницей
   (golos-*.woff2): внешние шрифты и CDN в webview Telegram не грузятся, а политика страницы разрешает только
   свои файлы. Инлайновых стилей нет нигде — всё, что зависит от данных (ширина полосы, место плитки, высота
   столбика), app.js ставит свойством через CSSOM. */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(golos-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(golos-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(golos-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- темы ---------- */

:root {
  color-scheme: dark;
  --bg: #07101F; --bg-glow: #0E1F3D;
  --surface: #0D1930; --surface-2: #122240; --surface-3: #1A2E52;
  --line: #1B2B49; --line-2: #2A4169;
  --ink: #E8EEFA; --ink-2: #B0BDD4; --ink-3: #8494B2;
  --accent: #5AA9FF; --accent-strong: #8FC5FF; --on-accent: #03101F;
  --ok: #1FA98C; --warn: #D9A032; --bad: #EB5563; --none: #8E98AD;
  --mix-cell: 34%; --mix-tile: 18%;
  --scrim: rgb(2 6 14 / .62);
  --shadow: 0 1px 0 rgb(255 255 255 / .035) inset, 0 14px 34px -18px rgb(0 0 0 / .75);
  --shadow-pop: 0 18px 48px -12px rgb(0 0 0 / .7);
  --header-bg: rgb(7 16 31 / .82);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #EDF1F7; --bg-glow: #DCE7F8;
    --surface: #FFFFFF; --surface-2: #F3F6FB; --surface-3: #E4EAF4;
    --line: #DDE4EF; --line-2: #C3CEDF;
    --ink: #0B1526; --ink-2: #3F4D66; --ink-3: #5C6A83;
    --accent: #2563EB; --accent-strong: #1D4FC4; --on-accent: #FFFFFF;
    --ok: #0F9D86; --warn: #D08C00; --bad: #D9304A; --none: #8B8B95;
    --mix-cell: 24%; --mix-tile: 13%;
    --scrim: rgb(10 20 40 / .38);
    --shadow: 0 1px 2px rgb(16 32 64 / .05), 0 10px 28px -18px rgb(16 32 64 / .28);
    --shadow-pop: 0 18px 48px -12px rgb(16 32 64 / .35);
    --header-bg: rgb(237 241 247 / .85);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #EDF1F7; --bg-glow: #DCE7F8;
  --surface: #FFFFFF; --surface-2: #F3F6FB; --surface-3: #E4EAF4;
  --line: #DDE4EF; --line-2: #C3CEDF;
  --ink: #0B1526; --ink-2: #3F4D66; --ink-3: #5C6A83;
  --accent: #2563EB; --accent-strong: #1D4FC4; --on-accent: #FFFFFF;
  --ok: #0F9D86; --warn: #D08C00; --bad: #D9304A; --none: #8B8B95;
  --mix-cell: 24%; --mix-tile: 13%;
  --scrim: rgb(10 20 40 / .38);
  --shadow: 0 1px 2px rgb(16 32 64 / .05), 0 10px 28px -18px rgb(16 32 64 / .28);
  --shadow-pop: 0 18px 48px -12px rgb(16 32 64 / .35);
  --header-bg: rgb(237 241 247 / .85);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07101F; --bg-glow: #0E1F3D;
  --surface: #0D1930; --surface-2: #122240; --surface-3: #1A2E52;
  --line: #1B2B49; --line-2: #2A4169;
  --ink: #E8EEFA; --ink-2: #B0BDD4; --ink-3: #8494B2;
  --accent: #5AA9FF; --accent-strong: #8FC5FF; --on-accent: #03101F;
  --ok: #1FA98C; --warn: #D9A032; --bad: #EB5563; --none: #8E98AD;
  --mix-cell: 34%; --mix-tile: 18%;
  --scrim: rgb(2 6 14 / .62);
  --shadow: 0 1px 0 rgb(255 255 255 / .035) inset, 0 14px 34px -18px rgb(0 0 0 / .75);
  --shadow-pop: 0 18px 48px -12px rgb(0 0 0 / .7);
  --header-bg: rgb(7 16 31 / .82);
}
:root {
  --ok-cell: color-mix(in oklab, var(--ok) var(--mix-cell), var(--surface));
  --warn-cell: color-mix(in oklab, var(--warn) var(--mix-cell), var(--surface));
  --bad-cell: color-mix(in oklab, var(--bad) var(--mix-cell), var(--surface));
  --none-cell: var(--surface-2);
  --ok-tile: color-mix(in oklab, var(--ok) var(--mix-tile), var(--surface));
  --warn-tile: color-mix(in oklab, var(--warn) var(--mix-tile), var(--surface));
  --bad-tile: color-mix(in oklab, var(--bad) var(--mix-tile), var(--surface));
  --accent-wash: color-mix(in oklab, var(--accent) 14%, transparent);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r: 14px;
  --r-sm: 10px;
  --gut: 24px;
  --head-h: 64px;
  --tap: 44px;
  /* Безопасные поля экрана: вырез и полоска жестов (env) и, в Telegram во весь экран, — его поля и кнопки
     поверх страницы (`--tg-safe-*` ставит app.js из `safeAreaInset` + `contentSafeAreaInset`). Берётся большее. */
  --safe-t: max(env(safe-area-inset-top, 0px), var(--tg-safe-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px));
  --safe-l: max(env(safe-area-inset-left, 0px), var(--tg-safe-left, 0px));
  --safe-r: max(env(safe-area-inset-right, 0px), var(--tg-safe-right, 0px));
  --top-h: calc(var(--head-h) + var(--safe-t));
}

/* ---------- основа ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(150px + var(--safe-t)); }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 520px at 15% -10%, var(--bg-glow), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 14px/1.45 "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
select, input { font: inherit; color: inherit; }
a { color: var(--accent); }
::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
svg { display: block; }
.vh, .sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.hint, .meta { color: var(--ink-3); }
.meta { font-size: 12.5px; line-height: 1.45; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 20px;
  padding: var(--safe-t) calc(var(--gut) + var(--safe-r)) 0 calc(var(--gut) + var(--safe-l));
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3);
  display: grid; place-items: center; flex: none; border: 1px solid var(--line-2);
}
.brand-mark svg { width: 22px; height: 22px; }
.bm-dot { fill: var(--accent); }
.bm-in { fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; }
.bm-out { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-t b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-t span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .spacer { flex: 1; }
.seg {
  position: relative; display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 3px; isolation: isolate; flex: none;
}
.seg button {
  position: relative; z-index: 1; height: 36px; padding: 0 14px; border-radius: 9px; color: var(--ink-2);
  font-weight: 500; white-space: nowrap; transition: color .2s;
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--ink); }
.seg button:hover { color: var(--ink); }
.seg .ind {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 9px;
  background: var(--surface-3);
  box-shadow: 0 1px 0 rgb(255 255 255 / .05) inset, 0 2px 8px -2px rgb(0 0 0 / .35);
  transition: transform .38s var(--ease), width .38s var(--ease);
}
.seg.sm button { height: 32px; padding: 0 11px; font-size: 13px; }
.icon-btn {
  height: 40px; min-width: 40px; padding: 0 10px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; border-radius: 10px; color: var(--ink-2); border: 1px solid transparent;
  transition: background .2s, color .2s; flex: none;
}
.icon-btn:hover, .icon-btn[aria-current="page"] { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; flex: none; }
.only-m { display: none; }

/* ---------- прогон месяца ---------- */

.scrub {
  position: sticky; top: var(--top-h); z-index: 30; padding: 12px var(--gut) 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.scrub-in {
  display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 16px 10px 10px; box-shadow: var(--shadow);
}
.play {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; flex: none; transition: transform .2s var(--ease), filter .2s;
}
.play:hover { filter: brightness(1.08); }
.play:active { transform: scale(.94); }
.play[disabled] { opacity: .4; cursor: default; }
.play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.sc-day { flex: none; min-width: 150px; line-height: 1.2; }
.sc-day b { font-size: 15px; font-weight: 600; display: block; white-space: nowrap; }
.sc-day span { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.sc-track { position: relative; flex: 1; height: 44px; min-width: 0; }
.sc-bars { position: absolute; inset: 0 0 12px 0; display: flex; align-items: flex-end; gap: 2px; }
.sc-bars i {
  position: relative; flex: 1; border-radius: 3px 3px 1px 1px; min-height: 3px; height: 30%; background: var(--line-2);
  transition: opacity .25s, height .35s var(--ease), background-color .35s;
}
.sc-bars i.ok { background: var(--ok); }
.sc-bars i.warn { background: var(--warn); }
.sc-bars i.bad { background: var(--bad); }
.sc-bars i.nodata { background: var(--line-2); }
.sc-bars i.after { opacity: .28; }
/* Выбранный день: обводка внутри своего столбика и черта под ним — ровно по ячейке дня, соседей не закрывает. */
.sc-bars i.sel { opacity: 1; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--surface); min-height: 10px; }
.sc-bars i.sel::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; border-radius: 2px; background: var(--ink);
}
.sc-track:has(.sc-range:focus-visible) .sc-bars i.sel { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px var(--surface); }
.sc-track:has(.sc-range:focus-visible) .sc-bars i.sel::after { background: var(--accent); }
.sc-bars i.future { background: transparent; border: 1px dashed var(--line-2); height: 30%; }
.sc-axis { position: absolute; left: 0; right: 0; bottom: -2px; height: 12px; font-size: 10px; color: var(--ink-3); }
.sc-axis span { position: absolute; transform: translateX(-50%); }
.sc-range {
  position: absolute; top: 0; height: 34px; left: 0; width: 100%;
  -webkit-appearance: none; appearance: none; background: transparent; margin: 0; cursor: pointer; touch-action: pan-y;
}
.sc-range::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.sc-range::-moz-range-track { height: 34px; background: transparent; }
/* Ручка ползунка невидима — она только ловит палец; выбранный день рисует сам столбик (`.sc-bars i.sel`). */
.sc-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 34px; background: transparent; border: 0; box-shadow: none;
}
.sc-range::-moz-range-thumb { width: 22px; height: 34px; background: transparent; border: 0; box-shadow: none; opacity: 0; }
.sc-range:focus-visible { outline: none; }
.sc-range[disabled] { display: none; }
.sc-meta {
  flex: none; text-align: right; font-size: 12px; color: var(--ink-3); line-height: 1.3;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.sc-upd { color: var(--ink-3); font-size: 12px; text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; padding: 2px 0; }
.sc-upd:hover { color: var(--ink); }
.chip-btn {
  height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: 12px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s, opacity .2s;
}
.chip-btn:hover { background: var(--surface-2); color: var(--ink); }
.chip-btn[disabled] { opacity: .4; cursor: default; }

/* ---------- раскладка ---------- */

main.view { display: block; padding: 6px calc(var(--gut) + var(--safe-r)) calc(48px + var(--safe-b)) calc(var(--gut) + var(--safe-l)); max-width: 1600px; margin: 0 auto; view-transition-name: view; }
.no-scrub main.view { padding-top: 20px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px;
  box-shadow: var(--shadow); min-width: 0; position: relative;
}
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 32px; flex-wrap: wrap; }
.card-h h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.card-h .sub, .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.grow { flex: 1; }
.ib {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink-3);
  font-size: 11px; font-weight: 700; font-style: italic; font-family: Georgia, serif;
  display: inline-grid; place-items: center; flex: none; position: relative; transition: color .2s, border-color .2s;
}
.ib::before { content: ""; position: absolute; inset: -11px; }
.ib:hover, .ib[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.key.ok { background: var(--ok); } .key.warn { background: var(--warn); } .key.bad { background: var(--bad); }
.key.none { background: var(--none); }
.key.round { border-radius: 50%; }
.key.line { width: 16px; height: 2px; border-radius: 2px; background: var(--accent); }
.key.dash { width: 16px; height: 0; border-top: 2px dashed var(--ink-3); border-radius: 0; }
.key.dot { width: 16px; height: 0; border-top: 2px dotted var(--accent); border-radius: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--none); flex: none; }
.pill.ok { background: var(--ok-cell); } .pill.ok::before { background: var(--ok); }
.pill.warn { background: var(--warn-cell); } .pill.warn::before { background: var(--warn); }
.pill.bad { background: var(--bad-cell); } .pill.bad::before { background: var(--bad); }
.pill.plain::before { display: none; }
.empty-card { padding: 28px 20px; text-align: center; color: var(--ink-3); }

/* ---------- кольцо ---------- */

.gauge { position: relative; width: 100%; max-width: 280px; margin: 0 auto; }
.gauge svg { width: 100%; height: auto; overflow: visible; }
.g-track { fill: none; stroke: var(--surface-3); stroke-linecap: round; }
.g-val { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease), stroke .5s; }
.g-val[data-s="ok"] { stroke: var(--ok); } .g-val[data-s="warn"] { stroke: var(--warn); } .g-val[data-s="bad"] { stroke: var(--bad); }
.g-zone { fill: none; stroke-width: 3; opacity: .55; }
.g-zone.bad { stroke: var(--bad); } .g-zone.warn { stroke: var(--warn); } .g-zone.ok { stroke: var(--ok); }
.g-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.g-lab { fill: var(--ink-3); font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.g-center { position: absolute; left: 50%; top: 63%; transform: translate(-50%, -50%); text-align: center; line-height: 1; white-space: nowrap; }
.g-num { font-size: 52px; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.g-cap { margin-top: 8px; }
.ring .r-track { fill: none; stroke: var(--surface-3); }
.ring .r-val { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease), stroke .4s; }
.ring .r-val[data-s="ok"] { stroke: var(--ok); } .ring .r-val[data-s="warn"] { stroke: var(--warn); }
.ring .r-val[data-s="bad"] { stroke: var(--bad); }
.ring svg { transform: rotate(-90deg); }

/* ---------- главный показатель ---------- */

.hero-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.hero-facts { display: flex; flex-direction: column; gap: 14px; }
.hero-facts dt { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.hero-facts dd { font-size: 14px; color: var(--ink-2); }
.hero-facts dd b { font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; margin-right: 4px; font-variant-numeric: tabular-nums; }
.hl-switch { margin-left: 4px; }
.sector-pick {
  height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2);
  padding: 0 10px; font-size: 13px; color: var(--ink-2); max-width: 180px;
}
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile-k .t-lab { font-size: 13px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tile-k .t-big { font-size: 36px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin-top: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-k .t-big small { font-size: 15px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.tile-k .t-note { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.tile-k .t-note b { color: var(--ink); font-weight: 600; }
.delta { font-weight: 600; }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); margin-top: 16px; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: var(--accent); transition: width .9s var(--ease), background-color .4s; }
.meter > i.ok { background: var(--ok); } .meter > i.warn { background: var(--warn); } .meter > i.bad { background: var(--bad); }
.meter > b { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); border-radius: 2px; transition: left .9s var(--ease); }
.meter-lab { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.segbar { display: flex; gap: 2px; height: 12px; margin-top: 16px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.segbar i { height: 100%; flex: 0 0 0; min-width: 0; transition: flex-grow .8s var(--ease); }
.segbar i.ok { background: var(--ok); } .segbar i.warn { background: var(--warn); } .segbar i.bad { background: var(--bad); } .segbar i.none { background: var(--none); }
.seg-leg { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.seg-leg span { display: flex; align-items: center; gap: 6px; }
.seg-leg b { color: var(--ink); font-weight: 600; font-size: 14px; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.dots i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); transition: background-color .35s; }
.dots i.ok { background: var(--ok); }
.dots i.part { background: color-mix(in oklab, var(--ok) 35%, var(--surface-3)); }
.spark { margin-top: 10px; height: 34px; }
.sp-bar { fill: var(--line-2); } .sp-bar.hit { fill: var(--accent); }
.sp-need { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }

/* ---------- карта точек ---------- */

.tmap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(78px, auto)); gap: 8px; position: relative; }
.tmap.flow { grid-template-rows: none; grid-auto-rows: minmax(78px, auto); }
.reg { font-size: 11px; color: var(--ink-3); align-self: center; justify-self: center; text-align: center; letter-spacing: .02em; pointer-events: none; line-height: 1.3; }
.tmap.flow .reg { grid-column: 1 / -1; justify-self: start; align-self: end; min-height: 0; padding: 6px 2px 0; text-transform: uppercase; font-weight: 600; letter-spacing: .05em; }
.tile {
  position: relative; text-align: left; border-radius: 12px; padding: 10px 11px 10px; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 78px;
  transition: background-color .45s, border-color .45s, transform .25s var(--ease), box-shadow .25s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.tile:active { transform: scale(.98); }
.tile.ok { background: var(--ok-tile); border-color: color-mix(in oklab, var(--ok) 45%, var(--line)); }
.tile.warn { background: var(--warn-tile); border-color: color-mix(in oklab, var(--warn) 45%, var(--line)); }
.tile.bad { background: var(--bad-tile); border-color: color-mix(in oklab, var(--bad) 50%, var(--line)); }
.t-name { font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }
.t-pct { font-size: 24px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.t-st { font-size: 11px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.t-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--none); }
.tile.ok .t-st::before { background: var(--ok); } .tile.warn .t-st::before { background: var(--warn); } .tile.bad .t-st::before { background: var(--bad); }
.t-bar { position: absolute; left: 11px; right: 11px; bottom: 7px; height: 3px; border-radius: 2px; background: color-mix(in oklab, var(--ink) 10%, transparent); overflow: hidden; }
.t-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: var(--ink-2); transition: width .6s var(--ease); }
.t-bar b { position: absolute; top: 0; bottom: 0; left: 76.9%; width: 2px; background: var(--ink); }
.pulse { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); opacity: 0; transition: opacity .3s; }
.tile.attn .pulse { opacity: 1; }
.tile.attn .pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--bad); animation: pulse 1.8s var(--ease) infinite; }
.tile.attn.warn .pulse { background: var(--warn); }
.tile.attn.warn .pulse::after { border-color: var(--warn); }
@keyframes pulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.map-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.map-foot b { color: var(--ink); }
.attn-line { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- рейтинг ---------- */

.board { display: flex; flex-direction: column; }
.brow {
  display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 50px; align-items: center; gap: 12px;
  padding: 4px 8px; margin: 0 -8px; border-radius: 10px; text-align: left; min-height: 44px; transition: background .2s;
}
.brow.cut { border-top: 1px dashed var(--line-2); border-radius: 0 0 10px 10px; }
.brow:hover { background: var(--surface-2); }
.brow .bn { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .bn small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; line-height: 1.2; }
.bbar { position: relative; height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); }
.bbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 0 4px 4px 0; transition: width .7s var(--ease), background-color .4s; background: var(--none); }
.bbar i.ok { background: var(--ok); } .bbar i.warn { background: var(--warn); } .bbar i.bad { background: var(--bad); }
.bbar b { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); border-radius: 2px; }
.brow .bv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.board-note { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ---------- графики ---------- */

.chart { position: relative; width: 100%; min-height: 120px; }
.chart svg { width: 100%; overflow: visible; }
.c-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.c-ax { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.c-area { fill: var(--accent); opacity: .12; }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.c-pace { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 5; }
.c-fc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1.5 5; stroke-linecap: round; opacity: .9; }
.c-plan { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.c-lab { fill: var(--ink-2); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.c-lab.strong { fill: var(--ink); font-weight: 600; font-size: 12.5px; }
.c-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.c-cross { stroke: var(--ink-3); stroke-width: 1; }
.c-hit { fill: transparent; cursor: crosshair; }
.c-bar { fill: var(--accent); transition: opacity .2s; }
.c-bar.miss { fill: color-mix(in oklab, var(--accent) 45%, var(--surface-3)); }
.c-bar:hover { opacity: .75; }
.c-bar.today { fill: url(#hatch); }
.c-avg { stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 5 4; }
.hatch-l { stroke: var(--ink-3); stroke-width: 1.5; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; min-height: calc(100% - 46px); }
.donut { position: relative; width: 180px; height: 180px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; transition: stroke-dasharray .8s var(--ease), stroke-dashoffset .8s var(--ease); }
.donut .d-ok { stroke: var(--ok); } .donut .d-warn { stroke: var(--warn); } .donut .d-bad { stroke: var(--bad); } .donut .d-none { stroke: var(--none); }
.donut .d-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.donut .d-c b { font-size: 34px; font-weight: 650; letter-spacing: -.03em; }
.donut .d-c span { font-size: 12px; color: var(--ink-3); }
.dl { display: flex; flex-direction: column; gap: 10px; min-width: 170px; }
.dl div { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.dl div.sum { border-top: 1px solid var(--line); padding-top: 10px; }
.dl b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- все показатели × точки ---------- */

.hm-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.hm-wrap { overflow: auto; max-height: 620px; border-radius: 10px; overscroll-behavior-x: contain; position: relative; }
.hm { border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; min-width: 100%; }
.hm thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 0; height: 40px; vertical-align: bottom; }
.hm thead th button { width: 100%; min-height: 44px; padding: 4px 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; line-height: 1.15; border-radius: 6px; color: inherit; white-space: nowrap; }
.hm thead th.corner button { align-items: flex-start; padding-left: 8px; }
.hm thead th button:hover { color: var(--ink); background: var(--surface-2); }
.hm thead th button[aria-sort] { color: var(--ink); }
.hm thead th .arr { font-size: 9px; height: 10px; opacity: 0; }
.hm thead th button[aria-sort] .arr { opacity: 1; }
.hm thead th.corner { left: 0; z-index: 3; text-align: left; }
.hm tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 500; font-size: 13px; padding: 0 10px 0 6px; white-space: nowrap; min-width: 168px; max-width: 200px; }
.hm tbody th button { display: flex; flex-direction: column; align-items: flex-start; min-height: 38px; justify-content: center; text-align: left; width: 100%; line-height: 1.2; overflow: hidden; }
.hm tbody th small { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.hm td { min-width: 50px; height: 38px; padding: 0; text-align: center; border-radius: 6px; font-size: 12.5px; font-weight: 500; background: var(--none-cell); color: var(--ink-3); transition: background-color .35s, box-shadow .15s; }
.hm td button { width: 100%; height: 100%; min-height: 38px; color: inherit; font-weight: inherit; border-radius: 6px; }
.hm td.ok { background: var(--ok-cell); color: var(--ink); } .hm td.warn { background: var(--warn-cell); color: var(--ink); } .hm td.bad { background: var(--bad-cell); color: var(--ink); }
.hm td:hover { box-shadow: 0 0 0 2px var(--ink) inset; }
.hm td.off { opacity: .5; }

/* ---------- фильтры ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s, border-color .2s;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.select, select, input[type="search"], input[type="text"], input[type="password"] {
  min-height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 12px;
  font-size: 13.5px; max-width: 100%; color: var(--ink);
}
select, .select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.filters .grow { min-width: 0; }
.score-note { font-size: 12px; color: var(--ink-3); display: inline-flex; gap: 8px; align-items: center; }

/* ---------- секторы ---------- */

.sec { cursor: pointer; text-align: left; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; display: block; width: 100%; }
.sec:hover { transform: translateY(-2px); }
.sec[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.sec-body { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.sec .g-num { font-size: 30px; }
.sec-n { font-size: 13px; color: var(--ink-2); }
.sec-n b { display: block; font-size: 22px; color: var(--ink); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sec-n + .sec-n { margin-top: 8px; }
.sec .seg-leg { font-size: 11.5px; }

/* ---------- сотрудники ---------- */

.ppl { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pcard {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 14px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); transition: transform .25s var(--ease), border-color .25s;
}
.pcard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ava { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: var(--surface-3); color: var(--ink); flex: none; }
.pc-n { min-width: 0; }
.pc-n b { display: block; font-size: 14.5px; font-weight: 600; }
.pc-n span { font-size: 12px; color: var(--ink-3); }
.score { position: relative; width: 52px; height: 52px; flex: none; }
.score svg { width: 100%; height: 100%; }
.score b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 650; }
.score.big { width: 110px; height: 110px; }
.score.big b { font-size: 30px; }
.comps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.comp { min-width: 0; }
.comp .cl { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.comp b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; margin: 1px 0 6px; white-space: nowrap; }
.comp i { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); position: relative; overflow: hidden; }
.comp i em { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: var(--accent); transition: width .7s var(--ease); }
.pc-extra { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }

/* ---------- боковая панель / нижний лист ---------- */

.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 55; }
.scrim.on { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(640px, 100vw); background: var(--surface);
  padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  border-left: 1px solid var(--line); z-index: 60; display: flex; flex-direction: column; transform: translateX(104%);
  visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s; box-shadow: -30px 0 70px -30px rgb(0 0 0 / .6);
}
.panel.open { transform: translateX(0); visibility: visible; transition: transform .45s var(--ease), visibility 0s 0s; }
.panel.drag { transition: none; }
.grab { display: none; }
.p-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); flex: none; }
.p-title { flex: 1; min-width: 0; }
.p-title h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.p-title p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.p-nav { display: flex; gap: 4px; flex: none; }
.p-nav .icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); }
.p-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 40px; }
.page-body { max-width: 860px; margin: 0 auto; }
.page-body .p-sec:first-child { margin-top: 0; }
.p-sec { margin-top: 26px; }
.p-sec:first-child { margin-top: 0; }
.p-sec > h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-sec > h3 .sub { font-weight: 400; }
.p-sum { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
.p-sum.person { grid-template-columns: 120px 1fr; }
.p-sum .g-num { font-size: 36px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.kv dt { font-size: 11.5px; color: var(--ink-3); }
.kv dd { font-size: 19px; font-weight: 600; letter-spacing: -.015em; margin-top: 1px; font-variant-numeric: tabular-nums; }
.kv dd small { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.grp { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 16px 0 4px; }
.grp:first-of-type { margin-top: 4px; }
.mrow {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.3fr) 128px 60px 24px; gap: 12px; align-items: center;
  padding: 7px 8px; margin: 0 -8px; border-radius: 10px; text-align: left; width: calc(100% + 16px); min-height: 46px;
  transition: background .2s; cursor: pointer;
}
.mrow:hover { background: var(--surface-2); }
.mrow[aria-pressed="true"] { background: var(--accent-wash); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent) inset; }
.mrow .mn { font-size: 13px; font-weight: 500; line-height: 1.25; }
.mrow .mn small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.mrow .mv { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }
.mrow .mv .m2 { display: block; }
.mrow .mv b { color: var(--ink); font-weight: 600; font-size: 13px; }
.mrow .pill { justify-self: end; }
.bullet { position: relative; height: 14px; }
.bullet .bt { position: absolute; inset: 3px 0; border-radius: 0 3px 3px 0; background: var(--surface-3); }
.bullet .bf { position: absolute; left: 0; top: 3px; bottom: 3px; width: 0; border-radius: 0 3px 3px 0; background: color-mix(in oklab, var(--accent) 35%, var(--surface-3)); transition: width .7s var(--ease); }
.bullet .ba { position: absolute; left: 0; top: 3px; bottom: 3px; width: 0; border-radius: 0 3px 3px 0; background: var(--accent); transition: width .7s var(--ease); }
.bullet .bp { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); border-radius: 1px; transition: left .7s var(--ease); }
.bullet .bpace { position: absolute; top: -3px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink-2); transform: translateX(-5px); transition: left .7s var(--ease); }
.leg-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.leg-row span { display: inline-flex; align-items: center; gap: 6px; }
.lk-a { width: 14px; height: 6px; border-radius: 2px; background: var(--accent); }
.lk-f { width: 14px; height: 6px; border-radius: 2px; background: color-mix(in oklab, var(--accent) 35%, var(--surface-3)); }
.lk-p { width: 2px; height: 12px; background: var(--ink); }
.lk-t { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink-2); }
.srow { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 112px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .sn { font-size: 13px; font-weight: 500; line-height: 1.25; min-width: 0; }
.srow .sn small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.srow .sv { text-align: right; font-size: 12px; color: var(--ink-2); line-height: 1.3; font-variant-numeric: tabular-nums; }
.srow .sv b { color: var(--ink); font-size: 13px; }
.sbar { position: relative; height: 12px; border-radius: 0 3px 3px 0; background: var(--surface-2); }
.sbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 0 3px 3px 0; background: var(--accent); transition: width .7s var(--ease); }
.sbar i.ok { background: var(--ok); } .sbar i.warn { background: var(--warn); } .sbar i.bad { background: var(--bad); }
.sbar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.vrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) 48px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.vrow:last-child { border-bottom: 0; }
.vrow .sv { text-align: right; }
.shifts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shift { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.shift h4 { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-bottom: 8px; }
.shift ul { list-style: none; }
.shift li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; border-top: 1px solid var(--line); min-height: 34px; }
.shift li:first-child { border-top: 0; }
.shift li > span { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.yday { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; flex-wrap: wrap; }
.rings3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.rings3 .ring { width: 84px; height: 84px; margin: 0 auto; position: relative; }
.rings3 .ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 650; }
.rings3 p { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.3; }
.rings3 p small { display: block; color: var(--ink-3); }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note-line { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.45; }

/* ---------- подсказка, тост ---------- */

.tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.45; box-shadow: var(--shadow-pop); opacity: 0;
  transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 260px; font-variant-numeric: tabular-nums; left: 0; top: 0;
}
.tip.on { opacity: 1; transform: none; }
.tip b { font-size: 13.5px; }
.tip .tk { display: inline-block; width: 12px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 6px; }
.tip .tk.p { background: var(--ink-3); }
.tip .mut { color: var(--ink-3); }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 96; transform: translate(-50%, 20px); opacity: 0; background: var(--ink);
  color: var(--surface); padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; pointer-events: none;
  transition: opacity .25s, transform .35s var(--ease); white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- «Откуда цифра» ---------- */

/* Окно открывается только нажатием: на телефоне — нижний лист, с 700 px — поповер у кнопки. Прокручивается
   только тело — крестик в шапке остаётся на виду при любой длине текста. */
.why-shade { position: fixed; inset: 0; z-index: 94; background: var(--scrim); }
.why-shade.bare { background: none; }
.why-sheet {
  position: fixed; z-index: 95; right: 0; bottom: 0; left: 0; display: grid; grid-template-rows: auto minmax(0, 1fr);
  max-height: min(76vh, 560px); padding-bottom: var(--safe-b); border: 1px solid var(--line-2);
  border-radius: 16px 16px 0 0; background: var(--surface); box-shadow: var(--shadow-pop); animation: why-in .18s var(--ease);
}
@keyframes why-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.why-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.why-head h2 { flex: 1 1 auto; min-width: 0; padding-top: 4px; font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.why-x { flex: none; width: var(--tap); height: var(--tap); margin: -10px -10px -6px 0; border-radius: 10px; color: var(--ink-3); font-size: 15px; line-height: 1; }
.why-x:hover { background: var(--surface-2); color: var(--ink); }
.why-body { display: grid; gap: 8px; align-content: start; overflow: auto; padding: 12px 16px 16px; font-size: 12.5px; line-height: 1.5; }
.why-sub { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.why-src { font-weight: 600; font-size: 13px; }
.why-where { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.why-formula { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.why-rule { color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.why-from { display: grid; gap: 4px; justify-items: start; padding-top: 8px; border-top: 1px solid var(--line); }
.why-time, .why-state { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.why-state.bad { color: var(--bad); }
.why-state.warn { color: var(--warn); }
.why-open { margin-top: 4px; }
.why-link { color: var(--ink-3); font-size: 12px; text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; }
.why-link:hover { color: var(--ink); }

/* ---------- страницы: вклад, доступы, настройки, профиль ---------- */

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.page-head .grow { min-width: 0; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px 0 8px; margin-left: -8px;
  border-radius: 10px; color: var(--accent); font-weight: 500;
}
.back:hover { background: var(--surface-2); }
.stack { display: grid; gap: 12px; }
.gap-under { margin-bottom: 16px; }
.gap-over { margin-top: 16px; }
.row-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  min-height: var(--tap); padding: 0 18px; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--ink-3); }
.field input, .field select { width: 100%; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; white-space: nowrap; font-weight: 500; }
.unit { color: var(--ink-3); font-weight: 400; }
.mark { font-size: 13px; }
.dot { display: inline-block; vertical-align: middle; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--l, var(--none)); }
.l-green { --l: var(--ok); } .l-yellow { --l: var(--warn); } .l-red { --l: var(--bad); } .l-none { --l: var(--none); }
.plink { display: inline-block; min-height: var(--tap); padding: 12px 4px; margin: -12px -4px; color: var(--accent); text-align: left; font-weight: inherit; }
.why { position: relative; padding: 6px; margin: -6px; border-radius: 6px; font: inherit; text-align: inherit; transition: background .12s; }
.why:hover, .why[aria-expanded="true"] { background: var(--surface-2); }
.why.u { text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; padding: 15px 6px; margin: -15px -6px; }
.notice { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.banner {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid color-mix(in oklab, var(--bad) 60%, var(--line)); border-radius: 12px; background: var(--bad-tile); font-size: 13.5px;
}
.skeleton { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.skeleton div { grid-column: span 4; height: 160px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); animation: shimmer 1.4s ease-in-out infinite; }
.skeleton div:first-child { grid-column: span 5; height: 300px; } .skeleton div:nth-child(2) { grid-column: span 7; height: 300px; }
.skeleton div:nth-child(n+3) { grid-column: span 12; height: 220px; }
@keyframes shimmer { 50% { opacity: .55; } }
.empty { padding: 28px 12px; text-align: center; color: var(--ink-3); }

/* «Вклад»: карточки на телефоне, таблица с 700 px */
.ctable { display: block; }
.ctable > .crow + .crow { margin-top: 6px; }
.chead { display: none; }
.crow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.crow > .c { display: grid; gap: 1px; min-width: 0; font-size: 14px; }
.crow > .c > .why { display: grid; gap: 1px; width: 100%; min-width: 0; }
.crow .num { white-space: normal; }
.lbl { font-size: 11px; line-height: 1.3; color: var(--ink-3); }
.crow > .c-name { grid-area: 1 / 1 / auto / span 2; display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; font-weight: 600; align-self: center; }
.crow > .c-name .dot { margin-top: 6px; }
.crow > .c-shifts { grid-area: 1 / 3; text-align: right; }
.crow > .c-pct { grid-area: 1 / 4; text-align: right; align-self: center; font-size: 17px; font-weight: 600; }
.crow > .c-pct > .why { padding-block: 10px; margin-block: -10px; }
.crow > .c-plan { grid-area: 2 / 1; } .crow > .c-exp { grid-area: 2 / 2; } .crow > .c-fact { grid-area: 2 / 3; } .crow > .c-share { grid-area: 2 / 4; }
.crow .plink { padding-block: 10px; margin-block: -10px; }
.totals { list-style: none; display: grid; gap: 10px 12px; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.totals li { display: grid; gap: 1px; }
.totals .lbl { font-size: 11.5px; }
.totals .num { font-size: 16px; font-weight: 600; white-space: normal; }
.totals .num > .why { display: inline-block; min-width: var(--tap); padding: 12px 6px; margin: -12px -6px; }

/* «Доступы» */
.users { list-style: none; display: grid; gap: 8px; }
.user { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
/* Отозванный доступ — серый текст; кнопка «Удалить» у него остаётся яркой, иначе выглядела бы выключенной. */
.user.off > .who, .user.off > .meta { opacity: .55; }
.user .who { font-weight: 600; }
.candidates { list-style: none; display: grid; gap: 4px; }
.candidates button { display: block; width: 100%; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; }
.candidates button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.access-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
/* «Был в Центре», «Удалить» у отозванного и «Журнал доступов» (04.10.2026) */
.user .seen { display: block; }
.chip.user-del { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 45%, var(--line-2)); }
.chip.user-del:hover { color: var(--bad); background: var(--bad-cell); }
.log-h { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.log-open { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap); margin: -6px 0; text-align: left; font-weight: inherit; }
.log-open .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.log-open .chev { width: 18px; height: 18px; flex: none; color: var(--ink-3); transition: transform .2s var(--ease); }
.log-open[aria-expanded="true"] .chev { transform: rotate(90deg); }
.log-body { margin-top: 12px; }
.log-list { list-style: none; }
.log-list li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.log-list li:first-child { padding-top: 0; border-top: 0; }
.log-at { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* «Настройки» */
.set-list { list-style: none; display: grid; gap: 6px; }
.set-store { display: grid; gap: 8px; padding: 2px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.set-store.on { padding-bottom: 14px; border-color: var(--line-2); }
.set-open { display: grid; gap: 1px; width: 100%; min-height: var(--tap); padding: 9px 0; text-align: left; }
.set-name { font-size: 14px; font-weight: 600; }
.set-name .hint { font-weight: 400; font-size: 12px; }
.set-sum { font-size: 12.5px; line-height: 1.35; color: var(--ink-3); }
.set-apply { width: 100%; padding: 8px 14px; line-height: 1.3; }
.bfq-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.bfq-table th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 0 10px 8px 0; white-space: nowrap; }
.bfq-table td { padding: 4px 10px 4px 0; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.bfq-table td.r, .bfq-table th.r { text-align: right; }
.bfq-table tr.closed td { opacity: .45; }
.bfq-table input { width: 140px; min-height: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.bfq-table input.dirty { border-color: var(--accent); }
.bfq-table input.bad { border-color: var(--bad); }
.bfq-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.bfq-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.bfq-total { font-size: 13px; color: var(--ink-2); }
.bfq-total b { font-size: 16px; color: var(--ink); }
.dir-open { text-align: left; color: var(--ink); font: inherit; min-height: 40px; text-decoration: underline dotted var(--line-2); text-underline-offset: 4px; }
.dir-open:hover, .dir-open[aria-expanded="true"] { color: var(--accent); }
.bfq-table tr.dir-row td { padding: 12px 0 16px; border-top: 0; }
.dir-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); }
.dir-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input, .bfq-table .check input { appearance: auto; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; border: 0; background: none; accent-color: var(--accent); }
.bfq-table .dir-form input[type="text"], .bfq-table .dir-form select { width: 100%; text-align: left; }
.dir-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.goal-list { list-style: none; display: grid; }
.goal-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.goal-row:first-child { border-top: 0; }
.goal-name { flex: 1; min-width: 0; font-size: 13.5px; }
.goal-in { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; }
.goal-in input { width: 72px; min-height: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.goal-in input.dirty { border-color: var(--accent); }
.goal-in input.bad { border-color: var(--bad); }
/* «BFQ — условия» (04.10.2026): разделы по группам мотивации — липкий заголовок с полосой цвета раздела, чтобы
   при прокрутке было видно, в каком разделе находишься; в разделе — карточки блоков словами, «i», правка по «Изменить».
   Цвета разделов — свои, не светофорные: зелёный/жёлтый/красный на этом экране значили бы «хорошо/плохо». */
:root { --sec-1: #5AA9FF; --sec-2: #B394FF; --sec-3: #3CC8D8; --sec-4: #F28AB8; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --sec-1: #2563EB; --sec-2: #7C3AED; --sec-3: #0E8FA3; --sec-4: #D9468A; }
}
:root[data-theme="light"] { --sec-1: #2563EB; --sec-2: #7C3AED; --sec-3: #0E8FA3; --sec-4: #D9468A; }
:root[data-theme="dark"] { --sec-1: #5AA9FF; --sec-2: #B394FF; --sec-3: #3CC8D8; --sec-4: #F28AB8; }
.br-t1 { --sec: var(--sec-1); } .br-t2 { --sec: var(--sec-2); } .br-t3 { --sec: var(--sec-3); } .br-t4 { --sec: var(--sec-4); }
.br-intro { display: grid; gap: 10px; }
.br-intro .card-h { margin-bottom: 0; }
.br-wbar { display: flex; gap: 2px; height: 10px; margin-top: 6px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.br-wbar i { flex: 0 1 0; min-width: 0; background: var(--sec); transition: flex-grow .3s var(--ease); }
.br-wlist { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); }
.br-wlist li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.br-wlist b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.br-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--sec); flex: none; }
.br-how-t {
  justify-self: start; min-height: var(--tap); color: var(--accent); font-size: 13px; font-weight: 500;
  text-decoration: underline dotted; text-underline-offset: 4px;
}
.br-how-t:hover { color: var(--accent-strong); }
.br-how { display: grid; gap: 6px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--ink-2); max-width: 78ch; }
.br-sec { margin-top: 28px; }
.br-sec-h {
  position: sticky; top: var(--top-h); z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  padding: 12px 2px 10px; background: var(--bg); border-bottom: 2px solid var(--sec);
}
.br-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--sec); flex: none; }
.br-sec-h h3 { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.br-sec-w { font-size: 13px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.br-rule { display: grid; gap: 6px; justify-items: start; margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink); max-width: 80ch; }
.br-eg { list-style: none; display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.br-eg li { padding-left: 14px; position: relative; }
.br-eg li::before, .br-says li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--sec, var(--ink-3));
}
.br-cards { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); align-items: start; }
.br-card { display: grid; gap: 10px; align-content: start; padding: 16px 18px 14px; }
.br-card.open { grid-column: 1 / -1; }
.br-card.off { opacity: .62; }
.br-card-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.br-card-h h4 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.br-role {
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: color-mix(in oklab, var(--sec) 18%, var(--surface)); color: var(--ink);
}
.br-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.br-tab th { padding: 0 14px 6px 0; text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.br-tab td { padding: 7px 14px 7px 0; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.br-tab td:first-child { width: 1%; white-space: nowrap; color: var(--ink-2); }
.why-body .br-tab { font-size: 12.5px; }
.br-says { list-style: none; display: grid; gap: 7px; font-size: 13.5px; line-height: 1.5; }
.br-says li { position: relative; padding-left: 14px; }
.br-stale { font-size: 12.5px; color: var(--warn); }
.br-card-f { display: flex; flex-wrap: wrap; gap: 8px; }
.br-edit { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.br-gedit { justify-self: stretch; }
.br-f { display: grid; gap: 4px; align-content: start; font-size: 12px; color: var(--ink-3); min-width: 0; }
.br-f > span { color: var(--ink-2); font-weight: 500; }
.br-f small { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.br-f input[type="text"] { min-height: 40px; width: 130px; max-width: 100%; }
.br-f input[readonly] { color: var(--ink-3); background: var(--surface-2); }
.br-f select { min-height: 40px; width: 280px; max-width: 100%; }
.br-f .check { min-height: 32px; color: var(--ink); }
.br-f input.num, .br-tiers input.num, .br-row input { text-align: right; font-variant-numeric: tabular-nums; }
.br-scale { display: grid; gap: 6px; }
.br-row { display: grid; grid-template-columns: repeat(3, minmax(0, 104px)) 40px; gap: 6px 8px; align-items: center; }
.br-row input { width: 100%; min-height: 40px; }
.br-row-h { font-size: 11.5px; color: var(--ink-3); }
.br-row-h span { text-align: right; padding-right: 12px; }
.br-row-tag { grid-column: 1 / -1; margin-top: -2px; font-size: 11.5px; color: var(--ink-3); }
.br-row-tag.warn, .br-gap { color: var(--warn); }
.br-gap { font-size: 12px; line-height: 1.4; }
.br-x { min-width: 40px; min-height: 40px; padding: 0; }
.br-adv { display: grid; gap: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.br-legend { list-style: none; display: grid; gap: 4px; font-size: 12px; line-height: 1.45; color: var(--ink-3); max-width: 90ch; }
.br-legend b { color: var(--ink-2); font-weight: 600; }
.br-mlist { display: flex; flex-wrap: wrap; gap: 0 16px; }
.br-tiers td { padding-right: 6px; }
.br-tiers input { width: 84px; min-height: 36px; }
.br-tiers td:first-child input { width: 110px; text-align: left; }
.br-tiers select { min-height: 36px; max-width: 220px; }
.br-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.br-del { color: var(--bad); }
.br-sum { font-size: 13px; font-weight: 600; }
.br-sum.ok { color: var(--ok); } .br-sum.bad { color: var(--bad); }
/* Полоса «Сохранить» появляется при правке и держится у нижнего края, пока прокручиваешь длинный экран. */
.br-bar {
  position: sticky; bottom: calc(16px + var(--safe-b)); z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 24px; padding: 10px 12px 10px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow-pop);
}
/* Окно «i» и подсказка при наведении: шаги расчёта и пример. */
.br-steps { display: grid; gap: 5px; padding-left: 18px; color: var(--ink-2); }
.why-body .br-says { font-size: 12.5px; gap: 5px; color: var(--ink-2); }
.tip:has(.tip-rule) { max-width: 380px; }
.tip-rule { display: grid; gap: 6px; }
.tip-rule .br-steps { gap: 3px; }
.tip-rule .br-tip-h { color: var(--ink-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tip-rule .why-formula { padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }
.tip-rule .why-rule { color: var(--ink-3); }
@media (max-width: 760px) {
  /* Над нижней панелью вкладок (64 px), а не под ней. */
  .br-bar { bottom: calc(72px + var(--safe-b)); padding: 10px 12px; }
  .solo .br-bar { bottom: calc(8px + var(--safe-b)); }
  .br-bar .br-sum { flex: 1 1 100%; }
  .br-bar .grow { display: none; }
  .br-bar .btn { flex: 1 1 0; }
  .br-sec-h h3 { font-size: 15px; }
}
.bfq-blocks td { font-size: 13px; white-space: nowrap; }
.bfq-blocks td:first-child { white-space: normal; }
.refresh-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 12px; }

/* Вход */
.gate-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate {
  width: min(400px, 100%); display: grid; gap: 14px; padding: 28px 24px; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.gate .brand { justify-content: center; margin-bottom: 4px; }
.gate .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.gate .brand-mark svg { width: 28px; height: 28px; }
.gate h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.gate p { color: var(--ink-3); font-size: 13.5px; }
.gate .btn, .gate .chip { width: 100%; min-height: var(--tap); }
.login-form { display: grid; gap: 12px; width: 100%; text-align: left; }
.login-form .btn { width: 100%; }
.wide { width: 100%; }
#tglogin { min-height: 48px; display: grid; place-items: center; }

/* ---------- нижняя панель (телефон) ---------- */

.bottombar { display: none; }

/* ---------- переходы ---------- */

::view-transition-old(view) { animation: vt-out .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(view) { animation: vt-in .42s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateX(calc(var(--vt-dir, 1) * -24px)); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(calc(var(--vt-dir, 1) * 32px)); } }

/* ---------- ширина ---------- */

@media (max-width: 1180px) {
  .s5, .s7, .s4, .s8 { grid-column: span 12; }
  .s3 { grid-column: span 6; }
  .top .lbl { display: none; }
  .access-grid { grid-template-columns: 1fr; }
}
@media (min-width: 700px) {
  .why-sheet { right: auto; bottom: auto; width: min(380px, calc(100vw - 16px)); max-height: min(64vh, 460px); padding-bottom: 0; border-radius: 14px; }
  .chead {
    display: grid; position: sticky; top: calc(var(--top-h) + 4px); z-index: 2;
    grid-template-columns: minmax(140px, 1.6fr) repeat(6, minmax(58px, 1fr)); gap: 8px; padding: 8px 12px 6px;
    background: var(--bg); box-shadow: 0 1px 0 var(--line); font-size: 11px; color: var(--ink-3);
  }
  .chead > span + span { text-align: right; }
  .crow { grid-template-columns: minmax(140px, 1.6fr) repeat(6, minmax(58px, 1fr)); gap: 8px; padding: 12px 12px; align-items: center; }
  .crow > .c { text-align: right; }
  .crow > .c > .why { padding: 12px 6px; margin: -12px -6px; }
  .crow .lbl { display: none; }
  .crow > .c-name { grid-area: auto; grid-column: 1; text-align: left; }
  .crow > .c-shifts { grid-area: auto; grid-column: 2; } .crow > .c-plan { grid-area: auto; grid-column: 3; }
  .crow > .c-exp { grid-area: auto; grid-column: 4; } .crow > .c-fact { grid-area: auto; grid-column: 5; }
  .crow > .c-pct { grid-area: auto; grid-column: 6; font-size: 15px; } .crow > .c-share { grid-area: auto; grid-column: 7; }
}
@media (max-width: 760px) {
  :root { --gut: 16px; --head-h: 56px; }
  .top { gap: 8px; padding-right: calc(10px + var(--safe-r)); }
  .top .tabs-top, .hide-m { display: none; }
  .only-m { display: inline; }
  .brand-t span { max-width: 130px; }
  .icon-btn { min-width: 44px; height: 44px; padding: 0 8px; }
  .scrub { position: fixed; top: auto; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); padding: 0; background: none; z-index: 45; }
  .solo .scrub { bottom: 0; }
  .scrub-in { border-radius: 16px 16px 0 0; border-bottom: 0; padding: 8px 12px 8px 8px; gap: 10px; box-shadow: 0 -10px 30px -12px rgb(0 0 0 / .45); }
  .solo .scrub-in { padding-bottom: calc(8px + var(--safe-b)); }
  .sc-day { min-width: 0; }
  .sc-day b { font-size: 13.5px; }
  .sc-day span, .sc-meta { display: none; }
  .sc-track { height: 40px; }
  .sc-axis { display: none; }
  .sc-bars { inset: 0 0 4px 0; }
  .sc-range { height: 40px; }
  .sc-range::-webkit-slider-runnable-track { height: 40px; }
  .sc-range::-webkit-slider-thumb { height: 40px; }
  main.view { padding: 12px var(--gut) calc(150px + var(--safe-b)); }
  .no-scrub main.view { padding-bottom: calc(90px + var(--safe-b)); }
  .solo main.view { padding-bottom: calc(90px + var(--safe-b)); }
  .solo.no-scrub main.view { padding-bottom: calc(24px + var(--safe-b)); }
  .grid { gap: 12px; }
  .s3, .s5, .s7, .s4, .s8, .s6 { grid-column: span 12; }
  .card { padding: 16px; }
  .hero-body { grid-template-columns: 1fr; gap: 8px; }
  .hero-facts { flex-direction: row; justify-content: space-between; gap: 10px; }
  .hero-facts > div { flex: 1; min-width: 0; }
  .hero-facts dd b { font-size: 19px; display: block; }
  .hero-facts dd { font-size: 12px; }
  .gauge { max-width: 250px; }
  .tiles { gap: 12px; }
  .tile-k .t-big { font-size: 28px; }
  .tile-k .t-big small { font-size: 13px; }
  .tile-k .t-big.wrap small { display: block; margin: 4px 0 0; white-space: normal; line-height: 1.25; }
  .reg { display: none; }
  .tmap, .tmap.flow { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: auto; gap: 8px; }
  .tmap.flow .reg { display: block; }
  .tmap .tile { min-height: 72px; padding: 9px 12px 13px; grid-column: auto !important; grid-row: auto !important; }
  .t-name { font-size: 13px; padding-right: 10px; } .t-pct { font-size: 22px; } .t-st { font-size: 10.5px; }
  .pulse { top: 9px; right: 9px; width: 8px; height: 8px; }
  .seg-leg { flex-wrap: wrap; gap: 4px 10px; justify-content: flex-start; }
  .brow:nth-child(n+6) { display: none; }
  .board.all .brow { display: grid; }
  .board-note { display: none; }
  .brow { grid-template-columns: minmax(0, 108px) minmax(0, 1fr) 48px; gap: 10px; }
  .hm tbody th { min-width: 128px; max-width: 140px; font-size: 12px; }
  .hm td { min-width: 46px; height: 44px; }
  .hm tbody th button { min-height: 44px; }
  .hm-wrap { max-height: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .sec-body { grid-template-columns: 120px 1fr; }
  .ppl { grid-template-columns: 1fr; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(64px + var(--safe-b)); padding: 0 var(--safe-r) var(--safe-b) var(--safe-l); background: var(--surface); border-top: 1px solid var(--line); }
  .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); min-height: 56px; position: relative; transition: color .2s; }
  .bottombar button svg { width: 22px; height: 22px; }
  .bottombar button[aria-selected="true"] { color: var(--ink); }
  .bottombar button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .panel { top: auto; bottom: 0; left: 0; width: 100%; height: calc(100dvh - 10px - var(--safe-t)); padding-top: 0; border-left: 0; border-radius: 20px 20px 0 0; transform: translateY(104%); box-shadow: 0 -20px 60px -20px rgb(0 0 0 / .6); }
  .panel.open { transform: translateY(var(--drag, 0px)); }
  .grab { display: block; width: 100%; height: 22px; flex: none; position: relative; touch-action: none; }
  .grab::after { content: ""; position: absolute; left: 50%; top: 9px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-2); }
  .p-head { padding: 2px 16px 12px; touch-action: none; }
  .p-title h2 { font-size: 18px; }
  .p-body { padding: 16px 16px 40px; }
  .p-sum { grid-template-columns: 1fr; gap: 6px; }
  .p-sum .gauge { max-width: 220px; }
  .p-sum.person { grid-template-columns: 96px 1fr; }
  .p-sum.person .score.big { width: 96px; height: 96px; }
  .mrow { grid-template-columns: minmax(0, 1fr) auto 24px; grid-template-areas: "n p i" "b b b" "v v v"; gap: 6px 10px; padding: 10px 8px; }
  .mrow .mn { grid-area: n; } .mrow .pill { grid-area: p; } .mrow .ib { grid-area: i; } .mrow .bullet { grid-area: b; } .mrow .mv { grid-area: v; text-align: left; }
  .mrow .mv .m2 { display: inline; color: var(--ink-3); } .mrow .mv .m2::before { content: " · "; }
  .srow { grid-template-columns: minmax(0, 1fr) 96px; grid-template-areas: "n v" "b b"; gap: 6px 10px; }
  .srow .sn { grid-area: n; } .srow .sv { grid-area: v; } .srow .sbar { grid-area: b; }
  .shifts { grid-template-columns: 1fr; }
  .toast { bottom: calc(150px + var(--safe-b)); }
  .donut { width: 160px; height: 160px; }
  .page-head h1 { font-size: 19px; }
  .bfq-table input { width: 112px; }
  .bfq-table .hide-m { display: none; }
  .gate { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .tile.attn .pulse::after { animation: none; transform: scale(1.25); opacity: .6; }
  ::view-transition-old(view), ::view-transition-new(view) { animation: none; }
}
@media (forced-colors: active) {
  .tile, .hm td, .pill { border: 1px solid CanvasText; }
}

/* Кнопки «Доступы» и «Профиль» на странице «Настройки» — только на телефоне: в шапке им там нет места. */
.only-m-flex { display: none; }
@media (max-width: 760px) { .only-m-flex { display: flex; } }
.gate .chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--accent); }

/* ---------- начало месяца: «рано судить» (меньше EARLY_DAYS закрытых дней) ----------
   Проценты видны, светофора нет: серый вместо зелёного/жёлтого/красного, счёт статусов — бледно, с подсказкой. */

.key.early { background: var(--ink-3); }
.pill.early::before { background: var(--ink-3); }
.g-val[data-s="early"] { stroke: var(--ink-3); }
.meter > i.early, .bbar i.early { background: var(--ink-3); }
.tile.early { background: var(--surface-2); border-style: dashed; border-color: var(--line-2); }
.tile.early .t-st::before { background: var(--ink-3); }
.hm td.early { background: color-mix(in oklab, var(--ink) 7%, var(--surface)); color: var(--ink); }
.tile-k .t-early:empty { display: none; }
.tile-k .t-early { margin-top: 10px; line-height: 1.15; }
.tile-k .t-early b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.02em; color: var(--ink-2); }
.tile-k .t-early small { font-size: 13px; color: var(--ink-3); }
.tile-k.early .t-big { display: none; }
.tile-k.early .segbar, .tile-k.early .seg-leg, .sec.early .segbar, .sec.early .seg-leg, .early .donut { filter: grayscale(1); opacity: .45; }
.t-hint { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
.t-hint:empty { display: none; }
@media (max-width: 560px) { .tile-k .t-early b { font-size: 21px; } }

/* ---------- карточки показателей на главной ---------- */

/* Двенадцать приборов в два ряда: цифра — чернилами, статус — точкой и словом (не только цветом). */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 14px 14px 12px;
  overflow: hidden; min-height: 176px; transition: border-color .2s, transform .2s var(--ease);
}
.kpi:hover { border-color: var(--line-2); }
.kpi:active { transform: scale(.985); }
.kpi .k-top { display: flex; align-items: baseline; justify-content: space-between; gap: 2px 8px; flex-wrap: wrap; }
.kpi .k-lab { font-size: 13px; font-weight: 600; color: var(--ink); }
.kpi .k-st { font-size: 11px; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.kpi .k-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--none); flex: none; }
.kpi.ok .k-st::before { background: var(--ok); } .kpi.warn .k-st::before { background: var(--warn); } .kpi.bad .k-st::before { background: var(--bad); }
.kpi.fact .k-st::before { background: transparent; box-shadow: 0 0 0 1px var(--line-2) inset; }
.kpi .k-pct { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .k-pct small { font-size: 15px; font-weight: 500; color: var(--ink-3); margin-left: 2px; letter-spacing: 0; }
.kpi .k-pct.dim { font-size: 22px; color: var(--ink-2); padding: 4px 0 2px; }
.kpi .k-ff, .kpi .k-need { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi .k-ff b, .kpi .k-need b, .kpi .k-lost b { color: var(--ink); font-weight: 600; }
.kpi .k-spark { display: block; height: 28px; margin-top: auto; padding-top: 8px; }
.kpi .k-spark svg { height: 22px; display: block; }
.kpi .k-meter { display: block; margin-top: 12px; height: 6px; }
.kpi .k-meter > b { top: -4px; bottom: -4px; }
.kpi .k-lost { font-size: 11.5px; color: var(--bad); margin-top: 4px; min-height: 15px; line-height: 1.3; }
.kpi .k-lost.up { color: var(--ok); }
.hm td.fact { background: var(--surface-2); color: var(--ink-2); font-weight: 450; }
.hm thead th.on button { color: var(--ink); background: var(--accent-wash); }
.hm td.on { box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 55%, transparent) inset; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 168px; padding: 12px 12px 10px; }
  .kpi .k-pct { font-size: 26px; }
  .kpi .k-top { flex-direction: column; align-items: flex-start; }
  .kpi .k-pct.dim { font-size: 19px; }
}

/* «Доступы» → «Отделы» (04.10.2026) */
.access-depts .dept + .dept { border-top: 1px solid var(--line); padding-top: 10px; }
.dept-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dept-h .sub { color: var(--ink-3); font-size: 12px; }
.dept-h .chip { margin-left: auto; }

/* «Мой сектор»: плитки «Вчера», «Нужно продавать GI», «Где теряем BFQ» (вопросы Алика 04.10.2026) */
.tile-k .t-miss { color: var(--ink-3); line-height: 1.45; }
.tile-k .t-miss:empty { display: none; }
.tile-k .bad-t { color: var(--bad); }
.tile-k .ok-t { color: var(--ok); }
.loss-list { list-style: none; display: grid; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.loss-list li { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: 8px; align-items: center; }
.loss-list .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loss-list .bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.loss-list .bar i { display: block; height: 100%; background: var(--bad); border-radius: 3px; }
.loss-list .num { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* «Точка» → ВМР: анкеты Т2 за месяц (кто заваливает и его средний результат) */
.marks { list-style: none; display: grid; gap: 6px; margin-top: 10px; font-size: 13px; }
.marks li:not(.meta) { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: baseline;
  padding: 6px 0; border-top: 1px solid var(--line); }
.marks .mk-who { overflow: hidden; text-overflow: ellipsis; }
.marks .mk-who small { color: var(--ink-3); font-size: 11.5px; }
.marks .mk-date { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.marks .mk-score { font-weight: 650; font-variant-numeric: tabular-nums; }
.marks .mk-score.ok { color: var(--ok); } .marks .mk-score.warn { color: var(--warn); } .marks .mk-score.bad { color: var(--bad); }
.marks .mk-miss { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; }
