/* Пульт заявок — стили. Вид «как Claude» по проекту «Творим» (docs/dashboard_SPEC.md §10): тёплая бумажная палитра,
   тонкие линии, один акцент (терракота), Literata — заголовки, Inter Tight — интерфейс. Шрифты локальные (ПК клиента
   работает без интернета, CDN запрещены). Цвета живут только в блоках тем ниже — компоненты берут переменные. */

@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/InterTight-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/InterTight-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; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/Literata-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/Literata-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, [data-theme="light"] {
  color-scheme: light;
  --bg: #FAF9F5; --side: #F5F4ED; --hover: #F0EEE6; --card: #FFFFFF;
  --t1: #141413; --t2: #3D3D3A; --t3: #73726C;
  --line: rgba(31,30,29,.15); --line-2: rgba(31,30,29,.30);
  --accent: #C6613F; --accent-fill: #B4532F; --accent-ink: #FFFFFF;
  --btn: #141413; --btn-ink: #FFFFFF;
  --shadow: 0 4px 20px rgba(0,0,0,.04);
  /* статусы: тёплые приглушённые; текст чипа — тёмный вариант основы (контраст ≥ 4,5:1) */
  --st-draft: #6E6553; --st-queue: #8A5C14; --st-posted: #3F6649; --st-review: #A9502F; --st-error: #9A3A30; --st-cancel: #73726C;
  --ok: #4F7A5A; --warn: #B07A2A; --bad: #B04A3F;
}
/* ── тёмная тема: явная или «как в системе» ── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262624; --side: #1F1E1D; --hover: #3A3A37; --card: #30302E;
  --t1: #FAF9F5; --t2: #C2C0B6; --t3: #9C9A92;
  --line: rgba(250,249,245,.12); --line-2: rgba(250,249,245,.26);
  --accent: #D97757; --accent-fill: #D97757; --accent-ink: #1F1E1D;
  --btn: #FAF9F5; --btn-ink: #141413;
  --shadow: 0 4px 24px rgba(0,0,0,.30);
  --st-draft: #CFC6B3; --st-queue: #E2B266; --st-posted: #9CC4A5; --st-review: #F0A386; --st-error: #EE9A8F; --st-cancel: #9C9A92;
  --ok: #8DB897; --warn: #D9A85A; --bad: #E58A7E;
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    color-scheme: dark;
    --bg: #262624; --side: #1F1E1D; --hover: #3A3A37; --card: #30302E;
    --t1: #FAF9F5; --t2: #C2C0B6; --t3: #9C9A92;
    --line: rgba(250,249,245,.12); --line-2: rgba(250,249,245,.26);
    --accent: #D97757; --accent-fill: #D97757; --accent-ink: #1F1E1D;
    --btn: #FAF9F5; --btn-ink: #141413;
    --shadow: 0 4px 24px rgba(0,0,0,.30);
    --st-draft: #CFC6B3; --st-queue: #E2B266; --st-posted: #9CC4A5; --st-review: #F0A386; --st-error: #EE9A8F; --st-cancel: #9C9A92;
    --ok: #8DB897; --warn: #D9A85A; --bad: #E58A7E;
  }
}
:root {
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Literata", Georgia, serif;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body { font: 400 14px/1.45 var(--sans); color: var(--t1); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.muted { color: var(--t3); }
.serif { font-family: var(--serif); }

/* ── каркас ── */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
  /* фон боковой колонки — на всю высоту страницы (сама колонка прилипает к экрану) */
  background: linear-gradient(90deg, var(--side) 0 247px, var(--line) 247px 248px, transparent 248px); }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; font-weight: 600; font-size: 15px; letter-spacing: -.005em; }
.brand .mark { width: 28px; height: 28px; flex: none; display: block; }
.navgrp { margin-top: 18px; }
.navgrp h6 { font-weight: 500; font-size: 12px; color: var(--t3); padding: 0 10px; margin-bottom: 4px; }
.nav { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--t2); }
.nav .ic { color: var(--t3); }
.nav:hover { background: var(--hover); }
.nav.on { background: var(--hover); color: var(--t1); font-weight: 500; }
.nav.on .ic { color: var(--t1); }
.nav .cnt { font-style: normal; margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-fill); color: var(--accent-ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.side .sp { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.me .ava { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); color: var(--t2); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.me .who { line-height: 1.2; }
.me .who small { display: block; color: var(--t3); font-size: 12px; }
.me .ib { margin-left: auto; }

.main { min-width: 0; padding: 0 40px 48px; }
.top { display: flex; align-items: center; gap: 16px; height: 76px; }
.top h1 { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.01em; }
.top .date { color: var(--t3); font-size: 14px; margin-top: 6px; }
.top .sp { flex: 1; }

/* ── полоса статусов системы ── */
.health { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.hpill { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px; border-radius: 7px; color: var(--t2); font-size: 13px; white-space: nowrap; }
.hpill:hover { background: var(--hover); }
.hpill b { font-weight: 500; color: var(--t1); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

/* ── числа дня ── */
.kpis { display: grid; grid-template-columns: 1.35fr repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); margin-top: 8px; }
.kpi { padding: 18px 20px 16px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .lbl { color: var(--t3); font-size: 12.5px; font-weight: 500; }
.kpi .val { font: 500 30px/1.15 var(--sans); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--t3); font-size: 12.5px; margin-top: 2px; }
.kpi.hero .val { font-family: var(--serif); font-weight: 400; font-size: 40px; color: var(--accent); }
.kpi .bar { height: 4px; border-radius: 2px; background: var(--hover); margin-top: 10px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.kpi.attn .val { color: var(--st-review); }

/* ── секции ── */
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; margin-top: 32px; }
.sec h2 { font-family: var(--serif); font-weight: 400; font-size: 20px; letter-spacing: -.005em; display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.sec h2 a { margin-left: auto; font-family: var(--sans); font-size: 13px; color: var(--t3); }
.sec h2 a:hover { color: var(--t1); }
.sec + .sec { margin-top: 32px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }

/* список «требует внимания» */
.attn-list .row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); }
.attn-list .row:first-child { border-top: 0; }
.attn-list .row:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.attn-list .t { font-weight: 500; }
.attn-list .d { color: var(--t3); font-size: 13px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-list .go { color: var(--t3); font-size: 13px; white-space: nowrap; }
.sev { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--st-review); }
.sev .ic { width: 13px; height: 13px; stroke-width: 2; }
.sev.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--st-error); }
.sev.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--st-queue); }

/* лента бота */
.feed .ev { display: grid; grid-template-columns: 46px 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); }
.feed .ev:first-child { border-top: 0; }
.feed .tm { color: var(--t3); font-size: 13px; font-variant-numeric: tabular-nums; }
.feed .kind { color: var(--t3); }
.feed .kind .ic { width: 16px; height: 16px; }
.feed .what { min-width: 0; }
.feed .what b { font-weight: 500; }
.feed .what span { color: var(--t3); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* график по часам */
.chart { padding: 18px 18px 12px; }
.chart svg { display: block; width: 100%; height: 152px; }
.hours { display: grid; grid-template-columns: repeat(11, 1fr); text-align: center; color: var(--t3); font-size: 11.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; color: var(--t3); font-size: 12.5px; margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── чипы статусов ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.chip.draft { color: var(--st-draft); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.queue { color: var(--st-queue); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip.posted { color: var(--st-posted); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.chip.review { color: var(--st-review); background: var(--accent-soft); }
.chip.review::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.error { color: var(--st-error); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.chip.cancel { color: var(--st-cancel); box-shadow: inset 0 0 0 1px var(--line); text-decoration: line-through; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); font-weight: 500; white-space: nowrap; }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
.btn.accent { background: var(--accent-fill); color: var(--accent-ink); }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--st-error); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent); }
.ib { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--t3); }
.ib:hover { background: var(--hover); color: var(--t1); }
kbd { font: 500 11px/1 var(--sans); padding: 3px 5px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--t3); }

/* ── таблица заявок ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--t3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sel td { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.tbl .store b { font-weight: 500; display: block; }
.tbl .store span { color: var(--t3); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); color: var(--t2); font-size: 13px; }
.fbtn.on { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; min-width: 280px; border-radius: var(--r-sm); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--t3); }

/* ── правая панель (карточка заявки, разбор) ── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 0; margin: 0 -40px; border-top: 1px solid var(--line); min-height: calc(100vh - 76px); }
.split > .list { padding: 18px 28px 40px 40px; min-width: 0; }
.split > .pane { border-left: 1px solid var(--line); background: var(--card); padding: 22px 24px 28px; }
.pane h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.01em; }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 7px 12px; margin-top: 16px; font-size: 13.5px; }
.kv dt { color: var(--t3); }
.lines { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
.lines .ln { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); align-items: baseline; }
.lines .ln:first-child { border-top: 0; }
.lines .ln small { display: block; color: var(--t3); font-size: 12.5px; }
.lines .ln .q { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.src { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; white-space: pre-line; color: var(--t2); }
.timeline { margin-top: 18px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.timeline li { list-style: none; position: relative; padding: 0 0 10px 10px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -18px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1.5px var(--t3); }
.timeline li.done::before { background: var(--t3); }
.timeline li span { color: var(--t3); margin-right: 8px; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.ttl { font-weight: 500; font-size: 12.5px; color: var(--t3); margin-top: 22px; }

/* ── рабочее место оператора ── */
.queue .qi { padding: 13px 14px; border-radius: var(--r-md); border: 1px solid transparent; }
.queue .qi + .qi { margin-top: 4px; }
.queue .qi.on { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.queue .qi b { font-weight: 500; }
.queue .qi .d { color: var(--t3); font-size: 13px; margin-top: 3px; }
.work { display: grid; grid-template-columns: 340px minmax(0, 960px); gap: 32px; align-items: start; }
.fixrow { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) 84px 28px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.fixrow:first-child { border-top: 0; }
.fixrow .raw { color: var(--t2); }
.fixrow .raw small { display: block; color: var(--t3); font-size: 12px; }
.field { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); min-width: 0; }
.field.auto { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--t2); }
.field.focus { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.field.need { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); color: var(--t3); }
.field span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg { margin: 6px 0 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.sugg div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 13.5px; }
.sugg div.on { background: var(--hover); }
.sugg div small { color: var(--t3); font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 9px; margin-top: 16px; color: var(--t2); }
.check i { width: 18px; height: 18px; border-radius: 5px; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; }
.check i .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.photo { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: #2B2A27; aspect-ratio: 3 / 4; display: grid; place-items: center; }

/* ── система ── */
.sysgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sys { padding: 18px 20px; }
.sys h4 { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 15px; }
.sys h4 .st { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--t3); display: flex; align-items: center; gap: 7px; }
.sys dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; margin-top: 14px; font-size: 13.5px; }
.sys dt { color: var(--t3); }
.sys dd { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 3px; background: var(--hover); margin-top: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--t3); border-radius: 3px; }

/* ═══ экраны «Заявки», «Проверка», «Система» ═══ */
.phone-only { display: none; }
.btn .ic { width: 16px; height: 16px; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn kbd { color: inherit; opacity: .75; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent); }
.sec-note { color: var(--t3); font-size: 13.5px; margin: -6px 0 16px; }
.cols.flush { margin-top: 0; align-items: start; }

/* фильтры и поиск */
.filters .search { flex: 1 1 320px; max-width: 440px; }
.filters .grow { flex: 1 1 0; }
.search .ic { width: 16px; height: 16px; }
.flabel { color: var(--t3); font-size: 13px; margin-left: 10px; }
.fbtn .ic { width: 15px; height: 15px; }
.seg { display: inline-flex; }
.seg .fbtn { border-radius: 0; margin-left: -1px; }
.seg .fbtn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.seg .fbtn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.sw { width: 24px; height: 14px; border-radius: 7px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-2); position: relative; flex: none; }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--t3); }

.main:has(> .split) { padding-bottom: 0; }   /* правая панель доходит до низа страницы */

/* таблица заявок */
.tblcard { overflow: hidden; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--hover) 45%, transparent); }
.tbl tbody tr.sel:hover td { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.tbl .t-time { color: var(--t3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .t-drv, .tbl .t-lines, .tbl .t-doc { color: var(--t2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .t-src { color: var(--t3); }
.tbl .t-src .ic { width: 17px; height: 17px; }
.tbl .none { color: var(--t3); }
.tbl .u { display: none; }
.more { text-align: center; padding: 18px 0 4px; color: var(--t3); font-size: 13px; }

/* карточка заявки */
.pane .ph { display: flex; align-items: center; gap: 10px; }
.pane .ph .ib { margin-left: auto; margin-right: -6px; }
.kv dd { margin: 0; }
.ttl + .lines, .ttl + .src, .ttl + .timeline { margin-top: 8px; }
.src b { font-weight: 500; color: var(--t1); }
.timeline small { color: var(--t3); font-size: 12.5px; margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; }

/* «Проверка» */
.work { margin-top: 22px; }
.queue .qttl { display: flex; justify-content: space-between; align-items: baseline; padding: 0 14px; margin-bottom: 8px; font-size: 12.5px; color: var(--t3); font-weight: 500; }
.queue .qttl b { font-weight: 500; color: var(--t1); font-size: 14px; }
.queue .qi { display: block; }
.queue .qi .qh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.queue .qi .d + .d { margin-top: 1px; }
.queue .qi .age { color: var(--t3); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.queue .qi .age.old { color: var(--st-review); }
.qbar { align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); margin-bottom: 16px; }
.qbar span { color: var(--t3); display: flex; align-items: center; gap: 4px; }
.solve h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }
.solve .sh { display: flex; align-items: flex-start; gap: 16px; }
.solve .sh .chip { margin-left: auto; flex: none; margin-top: 6px; }
.solve .sub { color: var(--t3); font-size: 13.5px; margin-top: 4px; }
.solve .ttl { display: flex; align-items: center; gap: 8px; margin-top: 26px; }
.ttl .r { margin-left: auto; font-weight: 400; }
.fixrow.head { padding-top: 10px; padding-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--t3); }
.fixrow .cell { min-width: 0; }
.fixrow .ib { width: 28px; height: 28px; }
.fixrow .cap { display: none; }
.fixrow.open { align-items: start; }
.fixrow.open > .raw { margin-top: 8px; }
.fixrow.open > .ib { margin-top: 4px; }
.field .tag { margin-left: auto; padding-left: 8px; flex: none; color: var(--t3); font-size: 12px; font-style: normal; }
.field.qty { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.field .ic { width: 15px; height: 15px; color: var(--t3); }
.field.need .ic { margin-left: auto; }
.field .caret { width: 1px; height: 17px; background: var(--accent); margin-left: 1px; flex: none; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: inherit; }
.field input::placeholder { color: var(--t3); }
.sugg div.foot { justify-content: flex-start; padding: 7px 12px; border-top: 1px solid var(--line); color: var(--t3); font-size: 12px; }
.addrow { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); color: var(--t3); font-size: 13.5px; }
.addrow .ic { width: 15px; height: 15px; }
.check span { color: var(--t3); font-size: 13px; }
.solve .actions { margin-top: 20px; }
.actions .rem { margin-left: auto; align-self: center; color: var(--t3); font-size: 13px; }
.keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 16px; color: var(--t3); font-size: 12.5px; }
.keys span { display: inline-flex; align-items: center; gap: 5px; }

/* фото-просмотр и QR. Тут единственные литералы цвета: «краски» фотографии и белая подложка QR
   (код читается только тёмным по светлому — в обеих темах), остальное — переменные тем */
.photo { position: relative; background: var(--ph-bg);
  --ph-bg: #2B2A27; --ph-table: #3B352D; --ph-paper: #F2EEE0; --ph-paper-2: #E4DDC8; --ph-rule: #A9BBD3; --ph-margin: #CF8B86;
  --ph-ink: #27355F; --ph-shade: #000000; --ph-ctl: rgba(20,20,19,.62); --ph-ctl-ink: #FAF9F5; }
.photo.wide { display: block; aspect-ratio: auto; height: 380px; }
.photo.wide > svg { display: block; width: 100%; height: 100%; }
.photo .tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.photo .tools button { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--ph-ctl); color: var(--ph-ctl-ink); }
.photo .tools .ic { width: 17px; height: 17px; }
.photo .stamp { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; font-size: 12px; background: var(--ph-ctl); color: var(--ph-ctl-ink); }
.qr { --qr-bg: #FFFFFF; --qr-ink: #141413; width: 236px; height: 236px; padding: 14px; background: var(--qr-bg); border: 1px solid var(--line); border-radius: var(--r-md); }
.qr svg { display: block; width: 100%; height: 100%; }
.loginbox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; padding: 26px 28px; align-items: start; }
.qrcol { width: 236px; }
.timer { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0 6px; font-size: 13.5px; color: var(--t2); }
.timer span:last-child { color: var(--t3); }
.loginbox h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.01em; }
.steps { list-style: none; margin-top: 12px; }
.steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; color: var(--t3); }
.steps .s { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.steps .s .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.steps li.done { color: var(--t2); }
.steps li.done .s { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--st-posted); box-shadow: none; }
.steps li.now { color: var(--t1); font-weight: 500; }
.steps li.now .s { box-shadow: inset 0 0 0 1.5px var(--accent); }
.steps li.now .s::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--t2); font-size: 13.5px; }
.note .ic { width: 17px; height: 17px; color: var(--t3); margin-top: 1px; }
.loginbox .actions { margin-top: 18px; }

/* «Система» */
.sys { display: flex; flex-direction: column; }
.sys .ft { margin-top: auto; padding-top: 18px; display: flex; align-items: center; gap: 12px; }
.sys .ft span { color: var(--t3); font-size: 13px; }
.sys p { margin-top: 10px; color: var(--t3); font-size: 13.5px; }
.sys p.lead { color: var(--t2); }
.sys .field { margin-top: 14px; }
.sys .mrow { margin-top: 14px; font-size: 13.5px; }
.sys .mrow .l { display: flex; justify-content: space-between; gap: 12px; }
.sys .mrow .l span { color: var(--t3); }
.sys .mrow .l b { font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
.sys dl + .mrow { margin-top: 16px; }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.spark { display: block; width: 100%; height: 34px; margin-top: 8px; }
.proc { margin-top: 6px; }
.proc .pr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.proc .pr:first-child { border-top: 0; }
.proc .pr b { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.proc .pr small { display: block; margin-top: 2px; color: var(--t3); font-size: 12.5px; line-height: 1.4; }
.evl { margin-top: 8px; }
.evl .e { display: grid; grid-template-columns: 82px 8px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.evl .e:first-child { border-top: 0; }
.evl .e .t { color: var(--t3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.evl .e .dot { align-self: center; }

/* ── нижняя панель телефона ── */
.tabbar { display: none; }

/* ── планшет ── */
@media (max-width: 1099px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); background: linear-gradient(90deg, var(--side) 0 63px, var(--line) 63px 64px, transparent 64px); }
  .side { padding: 14px 8px; }
  .side .brand span, .nav span, .navgrp h6, .me .who, .me .ib { display: none; }
  .nav { justify-content: center; padding: 0; }
  .nav .cnt { position: absolute; margin: -18px -22px 0 0; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .cols, .work { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .sysgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ── телефон ── */
@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { display: none; }
  .main { padding: 0 16px 96px; }
  .top { height: auto; padding: 18px 0 10px; flex-wrap: wrap; gap: 6px 12px; }
  .top h1 { font-size: 26px; }
  .top .sp { display: none; }
  .health { width: 100%; justify-content: space-between; overflow: hidden; }
  .hpill { padding: 0 6px; gap: 6px; font-size: 12px; }
  .hpill .hide-sm { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px 12px; }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(4) { border-left: 1px solid var(--line); }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi.hero { grid-column: 1 / -1; border-left: 0; }
  .kpi.hero + .kpi { border-left: 0; }
  .kpi.hero ~ .kpi:nth-child(even) { border-left: 0; }
  .kpi.hero ~ .kpi:nth-child(odd) { border-left: 1px solid var(--line); }
  .kpi .val { font-size: 24px; }
  .kpi.hero .val { font-size: 34px; }
  .cols { gap: 0; margin-top: 24px; }
  .sec + .sec, .cols > .sec + .sec { margin-top: 26px; }
  .feed .ev { grid-template-columns: 42px 18px minmax(0, 1fr); }
  .feed .ev .chip { grid-column: 3; justify-self: start; margin-top: 2px; }
  .sysgrid { grid-template-columns: minmax(0, 1fr); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--side); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--t3); position: relative; min-height: 44px; }
  .tabbar a.on { color: var(--t1); font-weight: 500; }
  .tabbar .cnt { font-style: normal; position: absolute; top: 7px; left: 50%; margin-left: 6px; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px; background: var(--accent-fill); color: var(--accent-ink); font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
}
/* ── телефон: «Заявки», «Проверка», «Система» (после основного блока — перекрывает его) ── */
@media (max-width: 767px) {
  .pc-only { display: none !important; }
  .phone-only { display: flex; }
  .btn { min-height: 44px; }
  .btn kbd { display: none; }
  .actions.fill .btn { flex: 1 1 auto; }
  .actions.fill .btn.accent { flex-basis: 100%; }
  .sec-note { margin-top: 0; }
  .cols.flush { gap: 16px; }

  /* фильтры */
  .filters { gap: 8px; margin-bottom: 12px; }
  .filters .search { flex: 1 1 100%; max-width: none; min-width: 0; height: 44px; }
  .filters .grow { display: none; }
  .fbtn { height: 40px; padding: 0 13px; }

  /* список + панель: панель (карточка заявки) на телефоне — отдельный экран, в списке её нет */
  .main:has(> .split) { padding-bottom: 96px; }
  .split { margin: 0 -16px; min-height: 0; }
  .split > .list { padding: 12px 16px 24px; }

  /* таблица заявок → карточки */
  .tbl, .tbl tbody { display: block; }
  .tbl thead, .tbl colgroup { display: none; }
  .tbl tr { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); grid-template-areas: "store store store st" "drv drv drv drv" "time src lines doc"; gap: 8px 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
  .tbl tbody tr:first-child { border-top: 0; }
  .tbl td, .tbl tr:last-child td { padding: 0; border: 0; }
  .tbl tr.sel td, .tbl tbody tr:hover td { background: none; }
  .tbl .t-store { grid-area: store; }
  .tbl .t-st { grid-area: st; justify-self: end; }
  .tbl .t-drv { grid-area: drv; font-size: 13px; }
  .tbl .t-drv::before { content: "водитель "; color: var(--t3); }
  .tbl .t-time { grid-area: time; font-size: 13px; }
  .tbl .t-src { grid-area: src; display: flex; }
  .tbl .t-lines { grid-area: lines; font-size: 13px; }
  .tbl .t-doc { grid-area: doc; justify-self: end; font-size: 13px; }
  .tbl .u { display: inline; }
  .tbl .t-drv.none, .tbl .t-lines.none, .tbl .t-doc.none { display: none; }

  /* «Проверка» */
  .work { gap: 0; margin-top: 0; }
  .solve h2 { font-size: 21px; }
  .solve .sh { flex-wrap: wrap; gap: 6px 12px; }
  .solve .sh .chip { margin-left: 0; order: -1; margin-top: 0; }
  .photo.wide { height: 300px; }
  .fixrow { grid-template-columns: minmax(0, 1fr) 72px 28px; gap: 8px 10px; padding: 12px 14px; align-items: start; }
  .fixrow.head { display: none; }
  .fixrow .raw { grid-column: 1 / -1; font-weight: 500; }
  .fixrow.open > .raw { margin-top: 0; }
  .fixrow.open > .ib { margin-top: 0; }
  .fixrow .cap { display: block; margin-top: 3px; padding-left: 2px; color: var(--t3); font-size: 12px; }
  .fixrow .ib { align-self: start; margin-top: 4px; }
  .photo .stamp { display: none; }
  .field { height: 40px; }
  .actions .rem { flex-basis: 100%; margin-left: 0; order: -1; }

  /* «Система» */
  .loginbox { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 22px; }
  .qrcol { margin: 0 auto; }
  .evl .e { grid-template-columns: 8px minmax(0, 1fr); gap: 1px 10px; }
  .evl .e .t { grid-column: 2; grid-row: 1; font-size: 12.5px; }
  .evl .e .dot { grid-column: 1; grid-row: 2; align-self: start; margin-top: 7px; }
  .evl .e > span:last-child { grid-column: 2; grid-row: 2; }
  .proc .pr { grid-template-columns: minmax(0, 1fr); }
  .proc .pr .btn { justify-self: start; }
}

/* карточка с длинными подписями («Распознавание фото») — на две колонки, подписи не сжимаются в столбик */
.sys.sys-wide dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.sys.sys-wide dd { overflow-wrap: anywhere; }
