/* EARNER — панель внутри Telegram. Пиксельный шрифт, терминальный стиль.
   Тема по часам Ташкента (core.js): днём 08:00–19:30 светлая — белый фон,
   тёмно-зелёный/красный текст, <html data-theme="light">; вечером и ночью
   тёмная — чёрный фон и неоновый текст. Акцент — зелёный (по умолчанию) или
   красный: <html data-accent="red">. Тема Telegram не используется.
   Палитры графиков проверены валидатором (CVD, контраст, полоса светлоты)
   отдельно для каждой пары «тема × акцент», тексты — WCAG ≥ 4.5:1. */

@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/pixelify-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/pixelify-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: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/pixelify-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; }
/* Дополнение к Pixelify (webapp/tools/build_font_extras.py): свои цифры (табличные,
   «5» не путается с «S», «3» — с «З»), символы ₽ ≈ → ← ▲ ▼ ✓ ✕ ↩ ₸ ₴ и починка
   его букв — нет «О» и «П», «К»/«Ќ» перепутаны, «Э» = «З», «С» почти замкнута,
   «Е» с хвостиками «Є», «Z» = «2». unicode-range печатает сам скрипт сборки. */
@font-face { font-family: "EarnerPixel Extras"; font-weight: 100 550; font-display: swap;
  src: url(fonts/earner-extras-400.woff2) format("woff2");
  unicode-range: U+0030-0039, U+0043, U+0045, U+005A, U+0401, U+040C, U+0415, U+041A, U+041E-041F, U+0421, U+042D,
    U+044D, U+2009, U+202F, U+20B4, U+20B8, U+20BD, U+2190, U+2192, U+21A9, U+2248, U+25B2, U+25BC, U+2713, U+2715; }
@font-face { font-family: "EarnerPixel Extras"; font-weight: 551 900; font-display: swap;
  src: url(fonts/earner-extras-700.woff2) format("woff2");
  unicode-range: U+0030-0039, U+0043, U+0045, U+005A, U+0401, U+040C, U+0415, U+041A, U+041E-041F, U+0421, U+042D,
    U+044D, U+2009, U+202F, U+20B4, U+20B8, U+20BD, U+2190, U+2192, U+21A9, U+2248, U+25B2, U+25BC, U+2713, U+2715; }

:root {
  color-scheme: dark;
  /* поверхности */
  --bg: #020403;
  --card: #07120b;
  --card2: #0c1d12;
  --line: #17351f;
  --line2: #2b5e3a;
  /* текст */
  --fg: #56f07a;            /* основной — неоновый зелёный, 12.9:1 на карточке */
  --fg-hi: #b6ffc6;         /* цифры и заголовки */
  --hint: #46a862;          /* второстепенный, 6.4:1 */
  --accent: #56f07a;
  --accent-text: #000000;
  --link: #8dffa6;
  --glow: rgba(86, 240, 122, .38);
  --shade: rgba(86, 240, 122, .07);
  --soft: rgba(86, 240, 122, .12);
  --overlay: rgba(0, 0, 0, .72);
  --pop: #000000;                                   /* подложка тостов и подсказок */
  --scan: rgba(0, 0, 0, .16);                       /* строки развёртки */
  --sheet-shadow: 0 -10px 30px rgba(0, 0, 0, .6);
  --dim: 42%;                                       /* приглушённые столбики графиков */
  /* статусы: зелёный — хорошо, красный — плохо, янтарь — внимание (всегда с иконкой) */
  --good: #56f07a; --good-text: #56f07a;
  --warn: #ffc44d; --warn-text: #ffc44d;
  --crit: #ff5c5c; --danger: #ff5c5c;
  /* графики (валидатор: ALL PASS на #07120b) */
  --s1: #2aa84f; --s2: #a26ef0; --s1-wash: rgba(42, 168, 79, .18);
  --grid: rgba(86, 240, 122, .10); --axis: rgba(86, 240, 122, .30);
  --heat-0: #0c1d12; --heat-1: #1d6e37; --heat-2: #238944; --heat-3: #2aa84f; --heat-4: #47bf68;
  --heat-5: #6fd389; --heat-6: #9be6ae;

  --pad: 14px;
  --tab-h: 60px;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --font: "EarnerPixel Extras", "Pixelify Sans", ui-monospace, Menlo, Consolas, monospace;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --notch: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%,
    5px 100%, 0 calc(100% - 5px), 0 5px);
}

:root[data-accent="red"] {
  --bg: #040101;
  --card: #150809;
  --card2: #210d0e;
  --line: #3a1719;
  --line2: #66282b;
  --fg: #ff5c5c;            /* 6.5:1 */
  --fg-hi: #ffb3b3;         /* 11.5:1 */
  --hint: #cf5d5d;          /* 5.0:1 */
  --accent: #ff5c5c;
  --link: #ff9a9a;
  --glow: rgba(255, 92, 92, .38);
  --shade: rgba(255, 92, 92, .08);
  --soft: rgba(255, 92, 92, .13);
  --crit: #ff8f8f; --danger: #ff8f8f;
  /* графики (валидатор: ALL PASS на #150809) */
  --s1: #e0484d; --s2: #3d8ef0; --s1-wash: rgba(224, 72, 77, .18);
  --grid: rgba(255, 92, 92, .10); --axis: rgba(255, 92, 92, .30);
  --heat-0: #210d0e; --heat-1: #83272a; --heat-2: #a02f33; --heat-3: #bf393d; --heat-4: #e0484d;
  --heat-5: #ec7377; --heat-6: #f49c9f;
}

/* ── День: светлая тема (08:00–19:30 по Ташкенту) ─────────────────────────── */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --card: #f5fbf6;
  --card2: #e9f5ec;
  --line: #cfe5d6;
  --line2: #5f9d78;         /* рамки полей и переключателей — 3.2:1 на белом */
  --fg: #0b6b2e;            /* 6.3:1 на карточке */
  --fg-hi: #06331a;         /* 13.4:1 */
  --hint: #437157;          /* 5.0:1 даже на нажатой карточке */
  --accent: #12873d;        /* кнопки: белый текст 4.6:1 */
  --accent-text: #ffffff;
  --link: #0a6630;
  --glow: transparent;      /* неон днём не светится */
  --shade: rgba(18, 135, 61, .07);
  --soft: rgba(18, 135, 61, .14);
  --overlay: rgba(8, 36, 18, .38);
  --pop: #ffffff;
  --scan: rgba(0, 0, 0, .03);
  --sheet-shadow: 0 -8px 24px rgba(0, 0, 0, .14);
  --dim: 58%;               /* на белом 42% слишком бледно */
  --good: #12873d; --good-text: #0e7a36;
  --warn: #c27c00; --warn-text: #8a5200;
  --crit: #c42b2b; --danger: #c42b2b;
  /* графики (валидатор: ALL PASS на #f5fbf6) */
  --s1: #1e9e4a; --s2: #7b4fd6; --s1-wash: rgba(30, 158, 74, .16);
  --grid: rgba(11, 107, 46, .14); --axis: rgba(11, 107, 46, .40);
  --heat-0: #eaf4ed; --heat-1: #68c287; --heat-2: #46ab6a; --heat-3: #2a9152; --heat-4: #1a7840;
  --heat-5: #0f5f31; --heat-6: #084524;
}

:root[data-theme="light"][data-accent="red"] {
  --bg: #ffffff;
  --card: #fdf6f6;
  --card2: #f9eaea;
  --line: #f1d4d4;
  --line2: #cf6b6b;         /* 3.5:1 на белом */
  --fg: #b3171c;            /* 6.4:1 */
  --fg-hi: #4d0b0e;         /* 14.4:1 */
  --hint: #9a4b4e;          /* 5.6:1 */
  --accent: #c62828;        /* белый текст 5.6:1 */
  --accent-text: #ffffff;
  --link: #a8151a;
  --glow: transparent;
  --shade: rgba(198, 40, 40, .06);
  --soft: rgba(198, 40, 40, .12);
  --overlay: rgba(40, 8, 8, .38);
  --crit: #8c1010; --danger: #8c1010;
  /* графики (валидатор: ALL PASS на #fdf6f6) */
  --s1: #d43f3f; --s2: #2f6fd6; --s1-wash: rgba(212, 63, 63, .14);
  --grid: rgba(179, 23, 28, .12); --axis: rgba(179, 23, 28, .40);
  --heat-0: #f9ecec; --heat-1: #f19a9a; --heat-2: #e46f6f; --heat-3: #d04a4a; --heat-4: #b33232;
  --heat-5: #8f2222; --heat-6: #6b1616;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--fg); font: 16px/1.36 var(--font); letter-spacing: .01em;
  overscroll-behavior-y: none; min-height: 100vh; min-height: var(--tg-viewport-height, 100vh);
}
/* Лёгкие «строки развёртки» ЭЛТ-монитора поверх всего */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, var(--scan) 2px 3px);
}
::selection { background: var(--accent); color: var(--accent-text); }
a { color: var(--link); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; }
.hidden { display: none !important; }
/* Иконки — пиксельные (Pixelarticons, сетка 24 из «пикселей» 2×2): размеры кратны 12 px,
   чтобы каждый пиксель ложился ровно в пиксели экрана */

/* ── Каркас ───────────────────────────────────────────────────────────────── */

#app { max-width: 680px; margin: 0 auto; }
.page {
  padding: calc(10px + var(--safe-top)) var(--pad) calc(var(--tab-h) + var(--safe-bottom) + 28px);
  animation: boot .18s steps(3) both;
}
@keyframes boot { from { opacity: 0; } }
.page.dim { opacity: .5; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; }
.topbar h1 {
  font-size: 26px; line-height: 1.1; margin: 0; font-weight: 700; flex: 1; min-width: 0;
  color: var(--fg-hi); text-transform: uppercase; letter-spacing: .03em; text-shadow: 0 0 10px var(--glow);
}
.topbar .tt::before { content: "> "; color: var(--hint); text-shadow: none; }
.topbar .tt::after { content: "_"; margin-left: 2px; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.topbar .sub {
  display: block; font-size: 13px; color: var(--hint); font-weight: 400; letter-spacing: .02em;
  text-transform: none; margin-top: 5px; text-shadow: none;
}
.topbar .flag { font-size: 30px; line-height: 1; }
.iconbtn {
  width: 40px; height: 40px; border: 1px solid var(--line2); background: var(--card); color: var(--fg);
  display: grid; place-items: center; cursor: pointer; flex: none; border-radius: 0;
}
.iconbtn:active { background: var(--accent); color: var(--accent-text); }
.iconbtn svg { width: 24px; height: 24px; }
.avatar {
  width: 40px; height: 40px; border: 2px solid var(--accent); background: var(--card); color: var(--fg-hi);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; overflow: hidden; flex: none;
  image-rendering: pixelated; cursor: pointer;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

/* ── Таббар ───────────────────────────────────────────────────────────────── */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg);
  border-top: 2px solid var(--line2); padding-bottom: var(--safe-bottom);
}
.tabbar .in { max-width: 680px; margin: 0 auto; display: flex; height: var(--tab-h); }
.tab {
  flex: 1; border: 0; background: none; color: var(--hint); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-size: 11px; cursor: pointer;
  position: relative; text-transform: uppercase; letter-spacing: .04em;
}
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--fg-hi); text-shadow: 0 0 8px var(--glow); }
.tab.on::before { content: ""; position: absolute; top: -2px; left: 22%; right: 22%; height: 3px; background: var(--accent); }
.tab .dot { position: absolute; top: 8px; left: calc(50% + 9px); width: 8px; height: 8px; background: var(--crit); }

/* ── Секции и строки ──────────────────────────────────────────────────────── */

.sec { margin: 0 0 22px; }
.sec-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--hint); margin: 0 2px 8px; text-transform: uppercase; letter-spacing: .08em;
}
.sec-h > span:first-child:not(:empty)::before { content: "// "; opacity: .7; }
.sec-h .more { color: var(--link); cursor: pointer; text-transform: none; letter-spacing: .02em; }
.sec-f { font-size: 13px; color: var(--hint); margin: 8px 2px 0; line-height: 1.45; }
.card { background: var(--card); border: 1px solid var(--line); overflow: hidden; clip-path: var(--notch); }
.card.pad { padding: 14px var(--pad); }

.row {
  display: flex; align-items: center; gap: 12px; padding: 11px var(--pad); min-height: 50px;
  position: relative; cursor: default; width: 100%; text-align: left; border: 0; background: none; color: inherit;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; right: var(--pad); left: var(--pad);
  border-top: 1px dashed var(--line2); opacity: .7;
}
.row.ic + .row::before, .row + .row.ic::before { left: 62px; }
button.row, a.row, .row[data-act] { cursor: pointer; }
button.row:active, a.row:active, .row[data-act]:active { background: var(--shade); }
.row .ico {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none; font-size: 18px;
  border: 1px solid var(--line2); background: var(--bg); color: var(--fg);
}
.row .ico svg { width: 24px; height: 24px; }
.row .ico.flag { background: none; border: 0; font-size: 24px; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; color: var(--fg-hi); }
.row .s { font-size: 13.5px; color: var(--hint); margin-top: 3px; line-height: 1.32; overflow-wrap: anywhere; }
.row .v { color: var(--fg); font-size: 15px; text-align: right; flex: none; max-width: 52%; overflow-wrap: anywhere; }
.row .v.strong { color: var(--fg-hi); font-weight: 700; }
.row .chev { color: var(--hint); flex: none; width: 8px; height: 14px; }
.row.danger .t { color: var(--danger); }
.row.accent .t { color: var(--link); }
.row.disabled { opacity: .4; pointer-events: none; }
.row .lk { color: var(--hint); flex: none; }
.row .lk svg { width: 18px; height: 18px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── Кнопки ───────────────────────────────────────────────────────────────── */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 50px; padding: 12px 16px; border: 2px solid var(--accent); border-radius: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; box-shadow: 4px 4px 0 var(--line2);
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line2); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.soft { background: transparent; color: var(--fg-hi); }
.btn.plain { background: var(--card); color: var(--fg); border-color: var(--line2); }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--crit); }
.btn.good { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }   /* подтверждение — цветом панели, не статусным */
.btn.compact { min-height: 38px; padding: 7px 12px; font-size: 13.5px; width: auto; box-shadow: 3px 3px 0 var(--line2); }
.btns { display: grid; gap: 12px; margin: 0 0 22px; }
.btns.two { grid-template-columns: 1fr 1fr; }
.btns.two .btn { font-size: 14px; padding-left: 8px; padding-right: 8px; gap: 6px; }
.btn svg { width: 24px; height: 24px; flex: none; margin: -3px 0; }
.btn.compact svg, .btns.two .btn svg { width: 18px; height: 18px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line2); background: var(--card); color: var(--fg); border-radius: 0; padding: 8px 12px;
  font-size: 14.5px; cursor: pointer; line-height: 1.2;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.chip:active { background: var(--shade); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
.chips.scroll::-webkit-scrollbar { display: none; }

.seg { display: flex; border: 1px solid var(--line2); padding: 2px; gap: 2px; background: var(--bg); }
.seg button {
  flex: 1; border: 0; background: none; padding: 8px 6px; font-size: 14px; cursor: pointer;
  color: var(--hint); white-space: nowrap; border-radius: 0;
}
.seg button.on { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.seg-wrap { margin: 0 0 16px; }

/* Переключатель — квадратный */
.sw { position: relative; width: 50px; height: 28px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw span { position: absolute; inset: 0; border: 2px solid var(--line2); background: var(--bg); }
.sw span::after {
  content: ""; position: absolute; width: 16px; height: 16px; left: 4px; top: 4px; background: var(--hint);
  transition: transform .12s steps(3);
}
.sw input:checked + span { border-color: var(--accent); background: var(--soft); }
.sw input:checked + span::after { transform: translateX(22px); background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.sw input:disabled + span { opacity: .45; }
.sw input:focus-visible + span { outline: 2px dashed var(--fg-hi); outline-offset: 2px; }

/* ── Метки статуса ────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 8px; white-space: nowrap;
  line-height: 1.3; border: 1px solid currentColor; color: var(--hint); background: transparent;
  text-transform: uppercase; letter-spacing: .04em;
}
.pill::before { content: ""; width: 6px; height: 6px; background: currentColor; flex: none; }
.pill.no-dot::before { display: none; }
.pill.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 10%, transparent); }
.pill.warn { color: var(--warn-text); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill.crit { color: var(--crit); background: color-mix(in srgb, var(--crit) 12%, transparent); }
.pill.info { color: var(--link); }
.pill.live::before { animation: blink 1.1s steps(1) infinite; }

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0 0 16px;
  background: var(--card); border: 1px solid var(--line2); border-left-width: 4px; font-size: 14.5px; line-height: 1.42;
  color: var(--fg-hi);
}
.banner .bi { font-size: 18px; line-height: 1.2; flex: none; color: var(--accent); }
.banner .bi svg { width: 24px; height: 24px; margin-top: -2px; }
.banner.warn .bi { color: var(--warn-text); }
.banner.crit .bi { color: var(--crit); }
.banner.good .bi { color: var(--good-text); }
.banner .bt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.banner b { font-weight: 700; }
.banner.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.banner.crit { border-color: var(--crit); background: color-mix(in srgb, var(--crit) 9%, var(--card)); }
.banner.good { border-color: var(--good); background: color-mix(in srgb, var(--good) 7%, var(--card)); }
.banner.info { border-color: var(--accent); }
.banner .acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.banner[data-act], .banner[data-nav] { cursor: pointer; }

/* ── Цифры ────────────────────────────────────────────────────────────────── */

.hero { padding: 16px var(--pad) 16px; position: relative; }
/* Уголки-прицел по краям главной цифры — как рамка HUD */
.hero::before {
  content: ""; position: absolute; inset: 7px; pointer-events: none; opacity: .6;
  --c: linear-gradient(var(--accent), var(--accent));
  background:
    var(--c) left top / 10px 2px, var(--c) left top / 2px 10px,
    var(--c) right top / 10px 2px, var(--c) right top / 2px 10px,
    var(--c) left bottom / 10px 2px, var(--c) left bottom / 2px 10px,
    var(--c) right bottom / 10px 2px, var(--c) right bottom / 2px 10px;
  background-repeat: no-repeat;
}
.hero .lbl { font-size: 13px; color: var(--hint); text-transform: uppercase; letter-spacing: .08em; }
.hero .val {
  font-size: 40px; font-weight: 700; line-height: 1.12; margin: 6px 0 6px; overflow-wrap: anywhere;
  color: var(--fg-hi); text-shadow: 0 0 14px var(--glow);
}
.hero .meta { font-size: 13.5px; color: var(--hint); display: flex; flex-wrap: wrap; gap: 4px 14px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 22px; }
.tile {
  background: var(--card); border: 1px solid var(--line); padding: 12px 13px; min-width: 0; position: relative;
  clip-path: var(--notch);
}
.tile[data-act], .tile[data-nav] { cursor: pointer; }
.tile[data-act]:active, .tile[data-nav]:active { background: var(--card2); }
.tile .lbl { font-size: 12.5px; color: var(--hint); line-height: 1.25; text-transform: uppercase; letter-spacing: .06em; }
.tile .val { font-size: 24px; font-weight: 700; line-height: 1.2; margin-top: 6px; overflow-wrap: anywhere; color: var(--fg-hi); }
.tile .val small { font-size: 14px; font-weight: 400; color: var(--hint); white-space: nowrap; }
.tile .delta { font-size: 12.5px; margin-top: 5px; color: var(--hint); }
.tile .delta.up { color: var(--good-text); }
.tile .delta.down { color: var(--crit); }
.tile .spark { margin-top: 8px; height: 26px; }
.tile.wide { grid-column: 1 / -1; }

.meter { height: 10px; border: 1px solid var(--line2); background: var(--bg); margin-top: 8px; padding: 1px; }
.meter i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--s1) 0 6px, transparent 6px 8px); }
.meter.good i { background: repeating-linear-gradient(90deg, var(--good) 0 6px, transparent 6px 8px); }
.meter.warn i { background: repeating-linear-gradient(90deg, var(--warn) 0 6px, transparent 6px 8px); }
.meter.crit i { background: repeating-linear-gradient(90deg, var(--crit) 0 6px, transparent 6px 8px); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--hint); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; color: var(--fg-hi); }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; }
.qa {
  background: var(--card); border: 1px solid var(--line); padding: 12px 4px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: var(--fg);
  min-width: 0; text-transform: uppercase; letter-spacing: .03em; clip-path: var(--notch);
}
.qa .qi { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line2); color: var(--fg-hi); background: var(--bg); }
.qa .qi svg { width: 24px; height: 24px; }
.qa:active { background: var(--accent); color: var(--accent-text); }
.qa:active .qi { border-color: var(--accent-text); color: var(--accent-text); background: transparent; }
.qa span:last-child { text-align: center; line-height: 1.2; }

/* ── Списки данных ────────────────────────────────────────────────────────── */

.lot { display: flex; align-items: center; gap: 10px; padding: 10px var(--pad); position: relative; }
.lot + .lot::before { content: ""; position: absolute; top: 0; left: var(--pad); right: var(--pad); border-top: 1px dashed var(--line); }
.lot .dot { width: 8px; height: 8px; flex: none; background: var(--hint); }
.lot .dot.clean { background: var(--good); box-shadow: 0 0 6px var(--glow); }
.lot .dot.sb { background: var(--crit); }
.lot .p { font-weight: 700; min-width: 58px; color: var(--fg-hi); }
.lot .ttl { flex: 1; min-width: 0; font-size: 13.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lot .cc { font-size: 13.5px; white-space: nowrap; }
.lot[data-act] { cursor: pointer; }
.lot[data-act]:active { background: var(--shade); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-weight: 400; color: var(--hint); padding: 8px 10px; border-bottom: 1px solid var(--line2);
  text-transform: uppercase; letter-spacing: .05em; font-size: 12px;
}
.tbl td { padding: 8px 10px; border-bottom: 1px dashed var(--line); vertical-align: top; overflow-wrap: anywhere; color: var(--fg-hi); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

.log {
  font-size: 13px; color: var(--hint); max-height: 170px; overflow: auto; margin-top: 10px; line-height: 1.5;
  border-top: 1px dashed var(--line2); padding-top: 8px;
}
.log div { overflow-wrap: anywhere; }
.log div::before { content: "$ "; opacity: .6; }

.empty { text-align: center; padding: 34px 20px; color: var(--hint); font-size: 14.5px; }
.empty .ei { font-size: 38px; margin-bottom: 12px; color: var(--hint); display: grid; place-items: center; }
.empty .ei svg { width: 48px; height: 48px; }

.skel { background: var(--card); border: 1px solid var(--line); animation: skel 1s steps(2) infinite; }
@keyframes skel { 50% { background: var(--card2); } }

.note { font-size: 13.5px; color: var(--hint); line-height: 1.45; margin: 0 2px 18px; }
.small { font-size: 13.5px; color: var(--hint); }
.mono { font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; letter-spacing: 0; }
.sp { height: 12px; }

/* ── Формы ────────────────────────────────────────────────────────────────── */

.field { display: block; margin: 0 0 14px; }
.field .fl { font-size: 13px; color: var(--hint); margin: 0 2px 6px; display: block; }
.inp {
  width: 100%; border: 1px solid var(--line2); border-radius: 0; background: var(--bg); padding: 12px 13px;
  font-size: 16px; outline: none; color: var(--fg-hi); caret-color: var(--accent);
}
.inp::placeholder { color: var(--hint); opacity: .75; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--glow); }
textarea.inp { min-height: 120px; resize: vertical; line-height: 1.4; font-family: var(--mono); font-size: 16px; letter-spacing: 0; }
.err { color: var(--crit); font-size: 14px; margin: -6px 2px 12px; overflow-wrap: anywhere; }
.err::before { content: "✕ "; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 2px dashed var(--line2); padding: 26px 16px; background: var(--card); cursor: pointer; color: var(--hint); font-size: 14px;
}
.drop:active { border-color: var(--accent); }
.drop .di { color: var(--fg-hi); }
.drop .di svg { width: 36px; height: 36px; }
.drop b { color: var(--fg-hi); font-weight: 700; font-size: 16px; }
.drop input { display: none; }

.prog { height: 14px; border: 1px solid var(--line2); background: var(--bg); padding: 2px; overflow: hidden; }
.prog i {
  display: block; height: 100%; transition: width .3s steps(4);
  background: repeating-linear-gradient(90deg, var(--accent) 0 7px, transparent 7px 9px);
}
.prog.indet i { width: 32% !important; animation: indet 1.4s steps(14) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(320%); } }

/* ── Шторки ───────────────────────────────────────────────────────────────── */

.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 40; animation: fadein .12s steps(2); }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 680px; margin: 0 auto;
  background: var(--card); border-top: 2px solid var(--accent); max-height: 88vh; display: flex; flex-direction: column;
  animation: up .2s steps(5); padding-bottom: var(--safe-bottom); box-shadow: var(--sheet-shadow);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 4px; background: var(--line2); margin: 8px auto 2px; flex: none; }
.sheet .sh { display: flex; align-items: center; gap: 10px; padding: 8px var(--pad) 8px; flex: none; }
.sheet .sh h3 {
  margin: 0; font-size: 18px; font-weight: 700; flex: 1; line-height: 1.25; color: var(--fg-hi);
  text-transform: uppercase; letter-spacing: .03em;
}
.sheet .sh h3::before { content: "> "; color: var(--hint); }
.sheet .sb { padding: 6px var(--pad) 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .sf { padding: 10px var(--pad) 14px; display: grid; gap: 12px; flex: none; }
.sheet .x {
  width: 34px; height: 34px; border: 1px solid var(--line2); background: var(--bg); color: var(--fg);
  display: grid; place-items: center; cursor: pointer; flex: none; border-radius: 0;
}
.sheet .x svg { width: 12px; height: 12px; }
.sheet .card { background: var(--bg); }
.sheet .sec { margin-bottom: 14px; }
.sheet p { margin: 0 0 12px; line-height: 1.45; color: var(--fg-hi); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px); z-index: 95;
  transform: translateX(-50%); background: var(--pop); color: var(--fg-hi); padding: 11px 16px; border: 2px solid var(--accent);
  font-size: 14.5px; max-width: min(92vw, 520px); box-shadow: 4px 4px 0 var(--line2);
  animation: toast .16s steps(3); line-height: 1.35; text-align: center;
}
.toast.err { border-color: var(--crit); color: var(--crit); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

.jobs-pill {
  position: fixed; bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px); right: 12px; z-index: 30; display: flex;
  align-items: center; max-width: min(70vw, 360px); gap: 8px; background: var(--accent); color: var(--accent-text);
  border: 0; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--line2);
  text-transform: uppercase; letter-spacing: .03em;
}
.jobs-pill .spin { width: 12px; height: 12px; flex: none; background: currentColor; animation: blink .7s steps(1) infinite; }
.jobs-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Графики ──────────────────────────────────────────────────────────────── */

.chart { position: relative; padding: 12px 10px 8px; }
.chart .ch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.chart .ch .ct { font-size: 15px; font-weight: 700; color: var(--fg-hi); text-transform: uppercase; letter-spacing: .04em; }
.chart .ch .cs { font-size: 13px; color: var(--hint); }
.chart .tv { border: 1px solid var(--line2); background: none; color: var(--link); font-size: 12.5px; cursor: pointer; padding: 3px 8px; flex: none; }
.chart svg { width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .axis text, .chart .lbl { fill: var(--hint); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; stroke-dasharray: 2 3; }
.chart .base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar { fill: var(--s1); shape-rendering: crispEdges; }
.chart .bar.dim { fill: color-mix(in srgb, var(--s1) var(--dim), transparent); }
.chart .bar.s2 { fill: var(--s2); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar.hot { fill: var(--fg-hi); }
.chart .ln { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
.chart .ln.s2 { stroke: var(--s2); }
.chart .area { fill: var(--s1-wash); }
.chart .mk { fill: var(--s1); stroke: var(--card); stroke-width: 2; shape-rendering: crispEdges; }
.chart .mk.s2 { fill: var(--s2); }
.chart .xh { stroke: var(--fg-hi); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .vl { fill: var(--fg-hi); font-size: 11.5px; font-weight: 700; font-family: var(--font); }
.sheet .chart .mk { stroke: var(--bg); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--hint); margin: 8px 4px 2px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; background: var(--s1); }
.legend i.s2 { background: var(--s2); }
.legend i.box { width: 10px; height: 10px; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--pop); color: var(--fg-hi);
  border: 1px solid var(--accent); padding: 7px 10px; font-size: 13px; line-height: 1.4; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--line2); transform: translate(-50%, -100%);
}
.tip b { font-size: 14.5px; font-weight: 700; }
.tip .k { display: inline-block; width: 10px; height: 3px; vertical-align: middle; margin-right: 5px; background: var(--s1); }
.tip .k.s2 { background: var(--s2); }

.hbars { padding: 2px var(--pad) 12px; }
.hb { display: grid; grid-template-columns: minmax(0, 40%) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; cursor: default; }
.hb[data-nav] { cursor: pointer; }
.hb .hn { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg-hi); }
.hb .ht { height: 14px; position: relative; }
.hb .ht i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); min-width: 2px; }
.hb .ht i.ghost { background: var(--s1-wash); outline: 1px dashed var(--s1); outline-offset: -1px; }
.hb .hv { font-size: 13.5px; text-align: right; white-space: nowrap; font-weight: 700; color: var(--fg-hi); }
.hb .hv small { font-weight: 400; color: var(--hint); }

.heat { display: grid; gap: 2px; padding: 4px var(--pad) 10px; font-size: 11px; color: var(--hint); }
.heat .hc { aspect-ratio: 1.15; background: var(--heat-0); position: relative; }
.heat .hl { display: flex; align-items: center; }
.heat .hh { text-align: center; }

/* ── Мелочи ───────────────────────────────────────────────────────────────── */

.split { display: flex; gap: 10px; align-items: center; }
.split > * { flex: 1; }
.right { text-align: right; }
.muted { color: var(--hint); }
.ok-t { color: var(--good-text); }
.bad-t { color: var(--crit); }
.warn-t { color: var(--warn-text); }
.wrap { overflow-wrap: anywhere; }
.big { font-size: 20px; font-weight: 700; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.card.pad p { margin: 0 0 8px; }
.card.pad p:last-child { margin: 0; }
.faq + .faq { border-top: 1px dashed var(--line2); }
.faq summary {
  padding: 12px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  gap: 10px; color: var(--fg-hi);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "[+]"; color: var(--hint); font-weight: 400; }
.faq[open] summary::after { content: "[−]"; }
.faq > div { font-size: 14px; color: var(--hint); padding: 0 0 12px; line-height: 1.45; }
.splash { min-height: 70vh; display: grid; place-items: center; color: var(--hint); text-align: center; padding: 30px; }
.splash .logo {
  font-size: 40px; font-weight: 700; letter-spacing: .12em; color: var(--fg-hi); margin-bottom: 12px;
  text-shadow: 0 0 18px var(--glow);
}
.splash .logo::after { content: "_"; animation: blink 1.06s steps(1) infinite; }
/* Загрузка: 12 пиксельных делений заполняются по одному */
.bootbar { width: 148px; height: 16px; margin: 0 auto 14px; border: 2px solid var(--line2); padding: 2px; }
.bootbar i {
  display: block; height: 100%; width: 72px; max-width: 100%;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 12px);
  animation: bootfill 1.56s steps(12, jump-start) infinite;
}
@keyframes bootfill { from { width: 0; } to { width: 144px; } }
.splash .lock { font-size: 44px; margin-bottom: 10px; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
@media (min-width: 560px) { .tiles.k4 { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  body::after { display: none; }
}
