/*
 * Fixik — оформление веб-панели (спека этапа 2 §6, §9.2).
 * Эталон — утверждённый макет docs/superpowers/specs/2026-10-02-fixik-web-panel-mockup.html: токены цветов
 * и стили компонентов перенесены из него. Добавлено то, чего в макете нет: свои копии шрифтов, служебные
 * страницы, плитка с нулём, ширина 900–1099 px, телефон без отдельной разметки, классы вместо style=.
 * CSP панели — style-src 'self' и font-src 'self': никаких внешних адресов и импорта, атрибутов style= нет.
 * Задачи 11–14 дописывают свои правила в конец файла.
 */

/* ---------- шрифты: Fontsource 5.3.0, лицензия OFL 1.1 (тексты — fonts/OFL-*.txt) ---------- */
/* Наборы latin и cyrillic с unicode-range самого Fontsource: браузер скачивает только нужный файл. */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/golos-text-latin-400-normal.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: "Golos Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/golos-text-cyrillic-400-normal.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: 500;
  font-display: swap;
  src: url(/static/fonts/golos-text-latin-500-normal.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: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/golos-text-cyrillic-500-normal.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: 600;
  font-display: swap;
  src: url(/static/fonts/golos-text-latin-600-normal.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: "Golos Text";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/golos-text-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-latin-400-normal.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: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-latin-500-normal.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: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/unbounded-latin-600-normal.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: "Unbounded";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/unbounded-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- токены: значения макета; тёмная тема — по настройке системы (спека §6.1) ---------- */
/* Все цвета — токены: цвет числом стоит только в блоках :root. Два отступления от макета: --critical светлой
   темы — #bf3030 вместо #d03b3b, тёмной — #f07070 вместо #ef6a6a. С макетными мелкий красный текст не дотягивал
   до 4.5:1 (WCAG AA): в светлой теме — чип «! прострочено 1 д» и включённое «Лише прострочені», в тёмной —
   срок «! 01.10» в выбранной строке списка. */

:root {
  --plane: #f3f4f1;
  --surface: #fafaf8;
  --raised: #ffffff;
  --ink: #15171b;
  --ink-2: #4a4d53;
  --muted: #6c6f75;
  --hair: #e6e6e0;
  --line: #d0cfc7;
  --accent: #3343c4;
  --accent-weak: rgba(51, 71, 196, .08);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --critical: #bf3030;
  --critical-weak: rgba(208, 59, 59, .10);
  --serious: #bf5a28;
  --serious-weak: rgba(236, 131, 90, .17);
  --warning: #966200;
  --warning-dot: #fab219;
  --warning-weak: rgba(250, 178, 25, .20);
  --good: #0a7d0a;
  --good-weak: rgba(12, 163, 12, .10);
  --shadow: 0 14px 36px rgba(20, 22, 28, .08);
  /* Поверх скриншота — метка .zoom и просмотр скриншотов (Task 14): одни цвета для обеих тем, фон снимка от темы
     не зависит. Поэтому тёмный блок эти токены не переопределяет. */
  --overlay: rgba(0, 0, 0, .55);
  --overlay-strong: rgba(0, 0, 0, .78);
  --overlay-ring: rgba(255, 255, 255, .3);
  --on-overlay: #fff;
  --viewer-bg: #0d0e10;
  --viewer-backdrop: rgba(10, 11, 13, .72);
  --font-ui: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mark: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 10px;
  /* Не цвет: верх карточки поверх списка при 900–1099 px. Пока карточка открыта, panel.js (Task 14) ставит сюда
     верх списка #task-list; тёмный блок токен не переопределяет. */
  --drawer-top: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plane: #0f1012;
    --surface: #15161a;
    --raised: #1b1d21;
    --ink: #f2f2ef;
    --ink-2: #c6c5bc;
    --muted: #9a9ca1;
    --hair: #292b2f;
    --line: #3a3c41;
    --accent: #8f98ff;
    --accent-weak: rgba(143, 152, 255, .14);
    --series-1: #3987e5;
    --series-2: #d95926;
    --critical: #f07070;
    --critical-weak: rgba(239, 106, 106, .15);
    --serious: #f0936c;
    --serious-weak: rgba(240, 147, 108, .15);
    --warning: #fab219;
    --warning-dot: #fab219;
    --warning-weak: rgba(250, 178, 25, .14);
    --good: #4cc94c;
    --good-weak: rgba(76, 201, 76, .13);
    --shadow: 0 14px 36px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

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

*,
*::before,
*::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--plane); color: var(--ink); font: 15px/1.5 var(--font-ui); }
a { color: var(--accent); }
button,
input,
select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Спрайт значков (_icons.html): символы видны через <use>, сам спрайт места не занимает. */
body > svg,
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { display: inline-block; flex: none; width: 14px; height: 14px; vertical-align: -2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted,
.zero { color: var(--muted); }
/* Индикатор htmx: свои стили htmx не вставляет (includeIndicatorStyles: false, иначе нужен inline-стиль). */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; transition: opacity .2s ease-in; }

/* ---------- шапка приложения (base.html) ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 54px;
  padding: 0 22px;
  border-bottom: 1px solid var(--hair);
  background: var(--surface);
}
.mark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font: 600 16px/1 var(--font-mark);
  letter-spacing: .01em;
  text-decoration: none;
}
.mark .i { width: 19px; height: 19px; color: var(--accent); }
.nav { display: flex; align-self: stretch; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  margin-bottom: -1px;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav a.on { border-bottom-color: var(--accent); color: var(--ink); }
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
  color: var(--ink-2);
  font-size: 14px;
}
.ava {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* «Вийти» — форма POST /logout, оформленная как ссылка (спека §5.5, §6.1). */
.logout-form { display: flex; margin: 0; }
.logout { padding: 0; border: 0; background: none; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.logout:hover { color: var(--ink); }

/* ---------- страница: заголовок, переключатели, пометки ---------- */

.main { display: grid; gap: 16px; min-width: 0; padding: 22px 22px 26px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.head :is(h1, h2, h3) { margin: 0; font: 600 23px/1.2 var(--font-ui); }
.seg {
  display: inline-flex;
  justify-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
/* Пункты — ссылки (?period=7), подписи с радиокнопкой внутри (форма фильтров) или span. */
.seg > * {
  position: relative;
  padding: 5px 12px;
  border-left: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}
.seg > :first-child { border-left: 0; }
.seg > a,
.seg > label { cursor: pointer; }
/* Кольцо фокуса ссылки периода — внутри пункта: внешнее обрезал бы overflow: hidden у .seg. */
.seg > a:focus-visible { outline-offset: -2px; }
.seg > .on { background: var(--ink); color: var(--surface); font-weight: 500; }
/* На выбранном пункте кольцо отделено от заливки --ink полосой цвета фона: вплотную к заливке — 2.3:1. */
.seg > .on:focus-visible { box-shadow: inset 0 0 0 4px var(--surface); }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* Правила с :has() — отдельно: браузер без :has() отбросил бы весь список селекторов. */
.seg > :has(> input:checked) { background: var(--ink); color: var(--surface); font-weight: 500; }
.seg > :has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg > :has(> input:checked:focus-visible) { box-shadow: inset 0 0 0 4px var(--surface); }
.range { color: var(--ink-2); font-size: 13px; }
.fresh { color: var(--muted); font-size: 13px; }
.example {
  margin-left: auto;
  padding: 3px 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 11px var(--font-num);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- «що горить»: плитки (спека §6.2) ---------- */

.attn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "ic lbl big" "ic sub big";
  align-items: center;
  column-gap: 14px;
  row-gap: 1px;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--raised);
  color: inherit;
  text-decoration: none;
}
a.tile:hover { border-color: var(--line); }
a.tile:hover .lbl { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tile .ic { display: grid; grid-area: ic; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.tile .ic .i { width: 19px; height: 19px; }
.tile .lbl { grid-area: lbl; font-size: 15px; font-weight: 600; }
.tile .sub {
  grid-area: sub;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile .big { grid-area: big; font: 500 34px/1 var(--font-num); }
.t-crit .ic { background: var(--critical-weak); color: var(--critical); }
.t-crit .big { color: var(--critical); }
.t-ser .ic { background: var(--serious-weak); color: var(--serious); }
.t-ser .big { color: var(--serious); }
.t-warn .ic { background: var(--warning-weak); color: var(--warning); }
.t-warn .big { color: var(--warning); }
/* Плитка с нулём (D29, спека §6.2): серая, с зелёной галочкой, не ссылка. */
.t-ok { background: var(--surface); }
.t-ok .ic { background: var(--good-weak); color: var(--good); }
.t-ok .big { color: var(--muted); }

/* ---------- панели и таблицы ---------- */

.grid2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.panel { min-width: 0; border: 1px solid var(--hair); border-radius: var(--r); background: var(--raised); }
.panel-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 14px 16px 8px; }
.panel-h :is(h2, h3, h4) { margin: 0; font: 600 15.5px/1.3 var(--font-ui); }
.panel-h span { color: var(--muted); font-size: 12.5px; }
.panel-f {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 12px;
  color: var(--muted);
  font-size: 12.5px;
}
.tblwrap { overflow-x: auto; }
/* Таблица внизу панели: .tblwrap (overflow-x: auto) обрезает фон итоговой строки по скруглённым углам рамки. */
.panel > .tblwrap:last-child { border-radius: 0 0 calc(var(--r) - 1px) calc(var(--r) - 1px); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 7px 12px;
  border-bottom: 1px solid var(--hair);
  color: var(--muted);
  font: 500 11.5px/1.2 var(--font-ui);
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface); font-weight: 600; }
.r { text-align: right; }
/* Группы столбцов «Зараз» и «За N днів». */
.grp th {
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.grp th span { display: block; padding-bottom: 5px; border-bottom: 1px solid var(--line); text-align: center; }
.dept-t tbody tr:hover td { background: var(--plane); cursor: pointer; }
.dept { font-weight: 500; white-space: nowrap; }
.lnk { border-bottom: 1px dotted var(--muted); color: inherit; text-decoration: none; }
.lnk:hover { border-bottom-style: solid; }
.go { width: 28px; padding-left: 0; color: var(--muted); }
.dur { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- чипы: цвет — только проблема, всегда со значком и словом (D29) ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}
.chip .i { width: 12px; height: 12px; }
a.chip:hover { box-shadow: inset 0 0 0 1px currentColor; }
.c-crit { background: var(--critical-weak); color: var(--critical); }
.c-ser { background: var(--serious-weak); color: var(--serious); }
.c-warn { background: var(--warning-weak); color: var(--warning); }
.c-good { background: var(--good-weak); color: var(--good); }
.c-urgent { padding: 1px 8px 1px 5px; border: 1px solid var(--line); color: var(--ink); }
/* Нейтральный чип: дополнительные фильтры («Довго в роботі ✕», «фільтр не розпізнано»), пометки. */
.c-muted { padding: 1px 8px 1px 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }

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

.load { display: grid; padding: 2px 8px 4px; }
.lrow {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(50px, 1fr) 26px 46px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
a.lrow:hover { background: var(--plane); }
.lname { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
/* Полоса — SVG: длину задаёт атрибут <rect width="57%">, а не style= (спека §9.2). */
.lbar { display: block; width: 100%; height: 8px; overflow: hidden; border-radius: 4px; background: var(--plane); }
.lbar rect { fill: var(--series-1); }
/* Строка «Без виконавця». */
.lname.warn,
.lrow.warn .lname { color: var(--warning); font-weight: 500; }
.lrow.warn .lbar rect { fill: var(--warning-dot); }
.lval { font: 500 14px var(--font-num); text-align: right; }
.lod { display: flex; justify-content: flex-start; }

/* ---------- график «Створено і закрито по днях» ---------- */

.chart { padding: 0 14px 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 0 4px 2px; color: var(--ink-2); font-size: 13px; }
.legend i {
  display: inline-block;
  width: 16px;
  height: 2px;
  margin-right: 7px;
  border-radius: 1px;
  vertical-align: middle;
}
.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; }
.plot text { fill: var(--muted); font: 12px var(--font-num); }
.plot .end { fill: var(--ink-2); font: 500 13px var(--font-ui); }
.plot .end .n { fill: var(--ink); font: 500 13px var(--font-num); }
/* Цвета частей графика — классами: в макете это были атрибуты со var(). */
.plot .grid { stroke: var(--hair); stroke-width: 1; }
.plot .axis { stroke: var(--line); stroke-width: 1; }
.plot .series { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plot .series.s1 { stroke: var(--series-1); }
.plot .series.s2 { stroke: var(--series-2); }
.plot .dot { stroke: var(--raised); stroke-width: 2; }
.plot .dot.s1 { fill: var(--series-1); }
.plot .dot.s2 { fill: var(--series-2); }
.plot .cursor { stroke: var(--line); stroke-width: 1; }
.plot .hit { fill: transparent; }
/* Подсказка при наведении: left ставит panel.js через element.style (спека §9.2). */
.tip {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  gap: 3px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}
.tip .d { color: var(--ink); font: 500 12px var(--font-num); }
.tip i { display: inline-block; width: 12px; height: 2px; margin-right: 7px; vertical-align: middle; }
.tip b { margin-left: 6px; color: var(--ink); font: 500 12.5px var(--font-num); }
/* Метки рядов в легенде и подсказке. */
.legend .s1,
.tip .s1 { background: var(--series-1); }
.legend .s2,
.tip .s2 { background: var(--series-2); }

/* ---------- «Задачі»: фильтры ---------- */

/* min-width: 0 — элемент сетки .main: иначе длинное значение фильтра раздвинуло бы страницу шире телефона. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
/* Пилюля фильтра: «Відділ: усі ⌄». Длинное значение сжимается многоточием, а не раздвигает ряд шире экрана. */
.sel {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}
.sel b { color: var(--ink); font-weight: 500; }
.sel .i { width: 12px; height: 12px; color: var(--muted); }
/* Подпись выбранного варианта (b.sel-val) ставит сервер, после выбора — panel.js (Task 13). */
.sel-val { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
/* Сам <select> невидим и растянут на всю пилюлю: список открывает клик в любом её месте — по «Відділ:»,
   по значению и по стрелке. Шрифт 16 px: при фокусе на поле мельче iOS увеличивает страницу. */
.sel > select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
/* «Лише прострочені» — пилюля со значком «!»: флажок скрыт, вид включённой пилюли дают правила Task 13
   с :has(> input:checked). Без :has() флажок остаётся видимым, иначе включённый фильтр не отличить. */
.sel > input[type="checkbox"] { margin: 0; accent-color: var(--critical); }
@supports selector(:has(*)) {
  .sel > input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }
}
/* Поля невидимы, поэтому кольцо фокуса — на пилюле. Правила с :has() — каждое отдельно (см. .seg). */
.sel:has(> input[type="checkbox"]) { cursor: pointer; }
.sel:has(> select:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sel:has(> input[type="checkbox"]:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Чипы дополнительных фильтров («Довго в роботі ✕») в ряду формы — той же высоты и тем же шрифтом, что .sel. */
.filters .chip { padding: 5px 10px 5px 9px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; }
.search {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* Подсказка, которой не хватает места на узком телефоне, кончается многоточием, а не обрезанной буквой. */
.search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  outline: none;
  text-overflow: ellipsis;
}
.search input::placeholder { color: var(--muted); opacity: 1; }

/* ---------- «Задачі»: список и карточка рядом ---------- */

/* Второй столбец — карточка; пока #drawer пуст, он скрыт и столбец нулевой. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; overflow: hidden; overflow: clip; }
.list { display: flex; flex-direction: column; min-width: 0; }
.list .tblwrap { flex: 1; }
/* Пока форма фильтров ждёт ответа (htmx ставит ей .htmx-request), список под ней полупрозрачный. */
.filters.htmx-request + .split .list { opacity: .55; transition: opacity .15s; }
/* Столбцы по спеке §6.3: №, Задача, Статус, Постановник, Виконавець, Термін, Створено. Узкие колонки — по
   содержимому (дата, чип, номер), всё остальное место — названию задачи: без явной ширины table-layout: fixed
   делил бы остаток поровну между «Задача», «Термін» и «Створено» — под «05.10» уходила бы треть таблицы. */
.tasks-t { table-layout: fixed; }
/* Заголовки-ссылки сортировки: кликабельна вся ячейка, у активной колонки — стрелка. */
.tasks-t th { padding: 0; }
.tasks-t th .thsort { display: block; padding: 7px 12px; color: inherit; text-decoration: none; }
.tasks-t th .thsort:hover { color: var(--ink); }
.tasks-t th[aria-sort] .thsort { color: var(--ink); }
.tasks-t th .arr { color: var(--accent); }
.tasks-t th:nth-child(1) { width: 64px; }
.tasks-t th:nth-child(3) { width: 108px; }
.tasks-t th:nth-child(4) { width: 140px; }
.tasks-t th:nth-child(5) { width: 144px; }
.tasks-t th:nth-child(6) { width: 120px; }
.tasks-t th:nth-child(7) { width: 92px; }
.tasks-t td { overflow: hidden; }
.trow td { vertical-align: top; cursor: pointer; }
.trow:hover td { background: var(--plane); }
.trow.sel-row td { background: var(--accent-weak); }
.trow.sel-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tid { color: var(--ink-2); font: 500 13px var(--font-num); white-space: nowrap; }
/* Значок «‼» срочной задачи — у первой строки заголовка, даже если заголовок переносится: 3.5 px — это
   (21 px строки − 14 px значка) / 2, как при выравнивании по центру одной строки. */
.ttl {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}
.ttl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ttl:hover span { text-decoration: underline; }
.ttl .i { margin-top: 3.5px; color: var(--ink); }
.tsub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Приглушённая строка выбранной задачи: на её фоне у --muted контраст 4.45:1 (ниже WCAG AA), у --ink-2 — около 8:1. */
.trow.sel-row .tsub { color: var(--ink-2); }
/* Статусы нейтральны и различаются значками; зелёный — только «Виконана» (D29). */
.st { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13.5px; white-space: nowrap; }
.st .i { color: var(--ink-2); }
.st.done .i { color: var(--good); }
.st.cancel,
.st.cancel .i { color: var(--muted); }
.due { display: inline-flex; align-items: center; gap: 4px; font: 500 13px var(--font-num); white-space: nowrap; }
.due.bad { color: var(--critical); }
.clip { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font: 12.5px var(--font-num); }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- карточка задачи (спека §6.4) ---------- */

.drawer {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 16px 20px 22px;
  background: var(--raised);
}
/* #drawer пуст, пока карточка не открыта. Второе правило — на случай пробелов внутри (:empty их не прощает). */
.drawer:empty { display: none; }
.drawer:not(:has(*)) { display: none; }
.dh { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dh .tid { color: var(--ink); font-size: 14px; }
.xbtn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.xbtn:hover { border-color: var(--line); color: var(--ink); }
/* «‹ Задачі» в полосе .dbar над карточкой на телефоне (спека §6.5). */
.back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}
.dtitle { margin: 0; font: 600 18.5px/1.35 var(--font-ui); overflow-wrap: anywhere; text-wrap: balance; }
.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.sec { display: grid; gap: 8px; }
.sec :is(h2, h3, h4, h5) {
  margin: 0;
  color: var(--muted);
  font: 500 11.5px/1 var(--font-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Миниатюра: картинка /media/{id} или плитка состояния («завантажується», «HEIC · завантажити», §7.6). */
.shot {
  position: relative;
  display: grid;
  place-content: center;
  gap: 4px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--plane);
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: center;
  text-decoration: none;
}
/* Скриншот с телефона — вертикальный, и главное у него вверху (номер заказа, плашка «Не оплачено»):
   миниатюра показывает верх картинки, а не середину. */
.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  cursor: zoom-in;
}
.shot .zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--overlay);
  color: var(--on-overlay);
  font-size: 9px;
}
/* «Текст звернення»: переносы строк description сохраняются, пробелы подряд — нет (спека §6.4). */
.msg {
  margin: 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.tl { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.tl li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; font-size: 13.5px; }
.tl time { padding-top: 1px; color: var(--muted); font: 12.5px var(--font-num); }
.tl em { color: var(--muted); font-style: normal; }

/* ---------- кнопки ---------- */

.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 8px;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { opacity: .88; }
/* Второстепенная кнопка: рамка — тенью, чтобы размер совпадал с .btn. */
.btn-ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.btn-ghost:hover { opacity: 1; box-shadow: inset 0 0 0 1px var(--ink-2); }

/* ---------- служебные страницы (service.html, спека §6.6) ---------- */

.svc { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 32px 16px; }
.svc-card {
  display: grid;
  justify-items: start;
  gap: 14px;
  width: 100%;
  max-width: 440px;
  padding: 28px 28px 26px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--raised);
  box-shadow: var(--shadow);
}
.svc-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink);
  font: 600 18px/1 var(--font-mark);
  letter-spacing: .01em;
  text-decoration: none;
}
.svc-logo .i { width: 22px; height: 22px; color: var(--accent); }
.svc-title { margin: 0; font: 600 21px/1.3 var(--font-ui); text-wrap: balance; }
.svc-text { margin: 0; color: var(--ink-2); }
.svc-hint { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- ширина экрана (спека §6.1, §6.5) ---------- */

/* От 1100 px: список и открытая карточка рядом по правилу золотого сечения — карточка занимает большую часть
   экрана (1,618 : 1 ≈ 62 %), список — меньшую. Карточка липкая и не уезжает при прокрутке длинного списка. */
@media (min-width: 1100px) {
  .drawer {
    position: sticky;
    top: 0;
    align-self: start;
    min-width: 0;
    max-height: 100vh;
    overflow-y: auto;
    border-left: 1px solid var(--hair);
  }
  .split:has(> .drawer > *) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.618fr); }
  /* Разделитель — граница списка на всю высоту, как в макете: липкая карточка обычно короче списка, и её
     граница обрывалась бы посреди страницы. Без :has() остаётся граница карточки. */
  .split:has(> .drawer > *) > .list { border-right: 1px solid var(--hair); }
  .split:has(> .drawer > *) > .drawer { border-left: 0; }
  /* В сжатом списке остаются только № и название: статус, постановник, исполнитель, срок и «Створено» —
     в самой карточке. */
  .split:has(> .drawer > *) .tasks-t :is(th, td):nth-child(n+3) { display: none; }
}

/* 1100–1249 px, пока карточка открыта: заголовок задачи в сжатом списке — до двух строк, колонка № уже.
   От 1250 px заголовок и с карточкой — одна строка с многоточием, как в макете: строки не прыгают, когда
   карточку открывают и закрывают. */
@media (min-width: 1100px) and (max-width: 1249.98px) {
  .split:has(> .drawer > *) .ttl span {
    display: -webkit-box;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .split:has(> .drawer > *) .tasks-t th:nth-child(1) { width: 64px; }
}

/* 1100–1279 px: «Навантаження» — в узком правом столбце; имени больше места, чем полосе, иначе имена средней
   длины обрезаются. */
@media (min-width: 1100px) and (max-width: 1279.98px) {
  .lrow { grid-template-columns: minmax(0, 1.8fr) minmax(40px, 1fr) 26px 46px; }
}

/* Меньше 1100 px: «Огляд» в одну колонку, список задач на всю ширину. */
@media (max-width: 1099.98px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .split { display: block; }
}

/* 900–1099 px: карточка выезжает справа поверх списка — от верха списка, а не окна: шапка с «Вийти» и фильтры
   с полем поиска остаются видны. Верх списка ставит в токен --drawer-top panel.js (Task 14). */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .drawer {
    position: fixed;
    top: var(--drawer-top, 0px);
    right: 0;
    bottom: 0;
    z-index: 20;
    width: 61.8vw;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
}

/* От 900 px: разметка «только для телефона» скрыта; подпись плитки переносится, а не теряет номер задачи за
   многоточием — при 900–1099 px плитки узкие, при 1100–1200 px подпись сжимает двузначное число плитки. */
@media (min-width: 900px) {
  .only-sm { display: none !important; }
  .tile .sub { white-space: normal; }
}

/* Меньше 900 px — телефон (спека §6.5): одна колонка, карточка на весь экран, таблицы — карточками. */
@media (max-width: 899.98px) {
  .hide-sm { display: none !important; }

  .bar { gap: 12px; height: 48px; padding: 0 14px; }
  .nav a { padding: 0 9px; font-size: 14.5px; }
  /* Шапка телефона (спека §6.5): логотип, вкладки и «Вийти»; буква и имя скрыты, как в макете телефона. */
  .ava,
  .who-name { display: none; }
  .main { gap: 12px; padding: 14px 12px 20px; }
  /* «Огляд»: над плитками — переключатель периода своей строкой, под ним даты одной строкой (в макете телефона —
     только переключатель). Заголовок «Огляд» повторял бы вкладку: он скрыт визуально и остаётся для чтения
     с экрана. */
  .head { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; }
  .head .seg { grid-column: 1 / -1; }
  .head h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .attn { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tile { padding: 11px 14px 11px 11px; }
  .tile .ic { width: 34px; height: 34px; }
  .tile .big { font-size: 28px; }
  /* Нагрузка: имени — всё свободное место, полоса — не шире 96 px, иначе имена средней длины обрезаются уже при
     360 px. */
  .lrow { grid-template-columns: minmax(0, 1fr) clamp(36px, 20%, 96px) 26px 46px; column-gap: 8px; }
  .search { flex-basis: 100%; }
  /* Шрифт поля мельче 16 px iOS при фокусе увеличивает вместе со страницей. */
  .search input { font-size: 16px; }
  .svc-card { padding: 22px 20px; }

  /* «Відділи» — как на телефоне в макете: приглушённый заголовок капслоком и отдельная карточка на каждый
     отдел, «Усі відділи» — последней. Сам блок — без рамки и фона; без :has() карточки стоят в обычном блоке. */
  .grid2 > .panel:has(.dept-t) { border: 0; background: none; }
  .grid2 > .panel:has(.dept-t) .panel-h { padding: 6px 2px 12px; }
  .grid2 > .panel:has(.dept-t) .panel-h :is(h2, h3, h4) {
    color: var(--muted);
    font: 600 13px/1 var(--font-ui);
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .grid2 > .panel:has(.dept-t) .panel-h span { display: none; }
  /* Карточка отдела — строка с переносом: сверху название и чип просроченных, ниже «Нові · У роботі · Закрито».
     Число, которому не хватило места, уходит на следующую строку, а не раздвигает карточку шире блока.
     Подписи — из атрибута data-label ячеек; «Час виконання» и стрелка скрыты. */
  .dept-t { display: block; }
  .dept-t tbody,
  .dept-t tfoot { display: grid; gap: 12px; }
  .dept-t tfoot { margin-top: 12px; }
  .dept-t thead { display: none; }
  .dept-t tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--hair);
    border-radius: var(--r);
    background: var(--raised);
  }
  /* Разрыв между строкой названия и строкой чисел. */
  .dept-t tr::after { content: ""; flex-basis: 100%; order: 1; }
  .dept-t tbody tr:hover { border-color: var(--line); }
  /* Итог «Усі відділи» — приглушённым фоном, как строка итога на компьютере. */
  .dept-t tfoot tr { background: var(--surface); }
  .dept-t td { display: block; padding: 0; border: 0; background: none; text-align: left; }
  .dept-t tbody tr:hover td { background: none; }
  /* Название — 15 px, как в макете телефона. */
  .dept-t td:nth-child(1) { flex: 1 1 0; min-width: 0; font-size: 15px; font-weight: 600; white-space: normal; }
  /* Чип просроченных — у первой строки названия, даже если длинное название переносится. */
  .dept-t td:nth-child(4) { flex: none; }
  .dept-t td:nth-child(2),
  .dept-t td:nth-child(3),
  .dept-t td:nth-child(5) { order: 2; margin-top: 6px; }
  .dept-t td:nth-child(n+6) { display: none; }
  /* «Нові 2»: число — 13 px/500, как в макете телефона. Подпись перед числом входит в его ссылку: псевдоэлемент
     закрывает всю ячейку с полями — в неё легко попасть пальцем, и «У роботі» открывает задачи «У роботі». */
  .dept-t td[data-label] { position: relative; font-size: 13px; font-weight: 500; }
  .dept-t td[data-label] a.lnk::after { content: ""; position: absolute; inset: -6px -8px; }
  .dept-t td[data-label]::before {
    content: attr(data-label);
    margin-right: 4px;
    color: var(--ink-2);
    font: 13px/1.5 var(--font-ui);
  }

  /* Строки списка задач — карточками: номер и статус, заголовок, исполнитель и срок. */
  .tasks-t,
  .tasks-t tbody { display: block; }
  .tasks-t thead,
  .tasks-t colgroup { display: none; }
  .tasks-t .trow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "tid st" "ttl ttl" "who due";
    align-items: start;
    gap: 4px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hair);
    cursor: pointer;
  }
  .tasks-t .trow:last-child { border-bottom: 0; }
  .tasks-t .trow:hover { background: var(--plane); }
  .tasks-t .trow.sel-row { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }
  .tasks-t .trow > td,
  .tasks-t .trow > td:first-child {
    display: block;
    overflow: visible;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .tasks-t .trow > td:nth-child(1) { grid-area: tid; }
  .tasks-t .trow > td:nth-child(2) { grid-area: ttl; }
  /* Статус — у правого края, как срок под ним; ширину колонки задаёт строка «прострочено N д». */
  .tasks-t .trow > td:nth-child(3) { grid-area: st; justify-self: end; }
  .tasks-t .trow > td:nth-child(4) { grid-area: who; color: var(--ink-2); font-size: 13.5px; }
  .tasks-t .trow > td:nth-child(5) { grid-area: due; text-align: right; }
  .tasks-t .ttl span,
  .tasks-t .tsub { white-space: normal; }
  /* Слово длиннее строки — адрес, номер заказа — переносится, а не обрезается многоточием посреди заголовка. */
  .tasks-t .ttl span { overflow-wrap: anywhere; }

  /* Карточка задачи — на весь экран, кнопка «Відкрити в Telegram» — на всю ширину. */
  .drawer {
    position: fixed;
    inset: 0;
    z-index: 20;
    gap: 14px;
    padding: 14px 14px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--plane);
  }
  /* Сверху — полоса «‹ Задачі … #10057», как шапка карточки в макете; при прокрутке длинной карточки она
     остаётся наверху. Отступы и top — минус отступы карточки: полоса во всю ширину и у самого края. */
  .dbar {
    position: sticky;
    top: -14px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 48px;
    margin: -14px -14px 0;
    padding: 0 14px;
    border-bottom: 1px solid var(--hair);
    background: var(--surface);
  }
  /* «‹ Задачі» — на всю высоту полосы и от самого края: в неё легко попасть пальцем. Кольцо фокуса — внутри
     ссылки: внешнее ушло бы за край экрана. */
  .dbar .back { align-self: stretch; margin-left: -14px; padding: 0 14px; }
  .dbar .back:focus-visible { outline-offset: -2px; }
  /* Номер задачи в полосе — приглушённый, как в макете телефона. */
  .dbar .tid { color: var(--ink-2); font-size: 13px; }
  /* Плитки состояний скриншотов («завантажується», «HEIC · завантажити») — светлее фона карточки. */
  .drawer .shot { background: var(--raised); }
  .drawer .btn { justify-self: stretch; padding: 12px 16px; }
}

/* Меньше 360 px: в «Навантаженні» полоса скрыта — имени нужно всё место; число и чип остаются. */
@media (max-width: 359.98px) {
  .lrow { grid-template-columns: minmax(0, 1fr) 26px 46px; }
  .lbar { display: none; }
}


/* ---------- вход и выход (login.html, Task 11) ---------- */

/* Тексты служебных страниц короткие: последнее слово не остаётся на строке одно («Спробуйте ще / раз.»). */
.svc-text { text-wrap: pretty; }


/* ---------- «Огляд» (Task 12, спека §6.2): нагрузка, отделы, пустые блоки, график ---------- */

/* Строка нагрузки — div: ссылка на имени растянута на всю строку (?assignee=U), чип просроченных — своя
   ссылка поверх неё (?assignee=U&overdue=1). Вложить ссылку в ссылку HTML не позволяет. */
.lrow { position: relative; }
.lrow:hover { background: var(--plane); }
.lname a { color: inherit; text-decoration: none; }
.lname a::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.lname a:focus-visible { outline: 0; }
.lname a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.lod .chip { position: relative; z-index: 1; }
/* Легенда нагрузки: красный чип только со значком «!» — ключ к чипам строк, той же высоты; слово — рядом (D29). */
.panel-f .chip { padding: 4px 6px; }
/* «і ще N виконавців» — не ссылка. */
.lmore { margin: 0; padding: 6px 8px; color: var(--muted); font-size: 13px; }
/* Стрелка «›» в конце строки отдела — ссылка на его открытые задачи; вся строка ведёт туда же (panel.js). */
.go a { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: inherit; }
.go a:hover { background: var(--hair); color: var(--ink); }
/* Пометка «бот не може писати» у названия отдела — нейтральный чип без значка. Длинное название с пометкой
   переносится на вторую строку, а не раздвигает таблицу шире блока. */
.dept-t .dept { white-space: normal; }
.dept .chip { padding-left: 8px; font-weight: 400; vertical-align: 1px; }
/* Ноль в «Прострочені» — td.num.zero, как остальные числа строки (макет); чипы таблицы, в том числе
   «✓ усе вчасно» телефона в этой ячейке, — шрифтом текста, а не цифр. */
.dept-t .chip { font-family: var(--font-ui); }
/* Пустые блоки: нет активных отделов, нет открытых задач. */
.panel-empty { margin: 0; padding: 4px 16px 16px; color: var(--muted); font-size: 14px; }
/* Курсор графика (линия и точки) не ловит указатель: его ловит прямоугольник .hit поверх. */
.plot .hover { pointer-events: none; }
/* Палец, проведённый по графику вбок, листает дни подсказки, а вверх-вниз — прокручивает страницу. Правило
   стоит на <svg>: у фигур внутри SVG (display: inline) браузер touch-action не учитывает. */
.plot svg { touch-action: pan-y; }
/* Линии и обводка точек графика — одной толщины при любом масштабе SVG: на телефоне он сжат втрое. */
.plot .grid line,
.plot .axis,
.plot .series,
.plot .dot,
.plot .cursor { vector-effect: non-scaling-stroke; }
/* Значения последнего дня под графиком — строка только для телефона (p.ends.only-sm). */
.ends { margin: 4px 4px 0; color: var(--ink-2); font: 500 13px var(--font-ui); text-align: right; }
.ends .num { color: var(--ink); }

@media (min-width: 900px) and (max-width: 1199.98px) {
  /* SVG графика сжат до 0,7–0,97: подписи в нём крупнее, на экране — 10–13,6 px; от 1200 px — снова 12 и 13.
     Больше 14 нельзя: двузначное «12 створено» упрётся в правый край viewBox. */
  .plot text,
  .plot .end,
  .plot .end .n { font-size: 14px; }
}

@media (min-width: 1100px) and (max-width: 1199.98px) {
  /* «Відділи» рядом с нагрузкой — узкая таблица: с отступами 12 px числовые столбцы оставляли названию так мало
     места, что переносились и короткие названия из двух слов («Підтримка клієнтів»). У стрелки «›» слева — 0. */
  .dept-t th,
  .dept-t td { padding-left: 9px; padding-right: 9px; }
  .dept-t .go { padding-left: 0; }
}

@media (max-width: 899.98px) {
  /* График на телефоне сжат втрое, подписи внутри SVG стали бы мельче 4 px. Они скрыты: даты окна — в
     подзаголовке, суммы — в легенде, значения последнего дня — строкой .ends под графиком, любого дня — в
     подсказке. Точки — крупнее. */
  .plot text { display: none; }
  .plot .dot { r: 14px; }
  /* Подсказка — над графиком: под пальцем её не видно, а поверх графика она закрыла бы точки. Две строки
     (дата; «Створено N  Закрито M») — она помещается над графиком в самом блоке. */
  .tip { top: auto; bottom: calc(100% + 6px); grid-template-columns: auto auto; column-gap: 14px; }
  .tip .d { grid-column: 1 / -1; }
}


/* ---------- «Задачі»: список (Task 13, спека §6.3) ---------- */

/* Заголовок страницы для чтения с экрана: на экране его роль играет вкладка «Задачі». */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Чипы дополнительных фильтров и их скрытые поля стоят в общем ряду формы; HTMX заменяет блок по id="chips". */
.chips { display: contents; }
/* «Лише прострочені»: HTMX перерисовывает только список, поэтому вид переключателя берётся из самого флажка.
   Красными становятся рамка, текст, число и оба значка — «!» (.a-i) и «✕» (.x-i). */
.sel:has(> input:checked) { border-color: var(--critical); background: var(--critical-weak); color: var(--critical); }
.sel:has(> input:checked) b,
.sel:has(> input:checked) .i { color: var(--critical); }
.sel .x-i { display: none; }
.sel:has(> input:checked) .x-i { display: inline-block; }
.cnt:empty { display: none; }
/* «Відкриті» недоступен, пока стоит чип «Закрито за N днів». */
.seg > :has(> input:disabled) { color: var(--muted); cursor: not-allowed; opacity: .55; }
/* «Задач не знайдено», «у закритих: K», «Скинути фільтри». */
.list-empty { display: grid; justify-items: start; gap: 10px; padding: 26px 18px 22px; }
.list-empty p { margin: 0; color: var(--ink-2); font-size: 14px; }
.list-empty .list-empty-title { color: var(--ink); font-size: 15px; font-weight: 600; }
/* «‹ сторінка 2 з 3 ›». */
.pages { display: inline-flex; align-items: center; gap: 8px; }
.pages a {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
}
.pages a:hover { border-color: var(--ink-2); color: var(--ink); }
/* «Esc — закрити картку» — только пока карточка открыта: в #drawer есть разметка. */
.esc-hint { display: none; }
.split:has(> .drawer > *) .esc-hint { display: inline; }

/* 900–1099 px карточка лежит поверх списка справа (Task 10: position: fixed, right: 0, ширина 61.8vw — большая
   часть по правилу золотого сечения; перекрытые колонки видны в самой карточке) и закрывает правые
   «ширина − 22 − 1» px низа списка: 22 px — правое поле страницы .main, 1 px — рамка панели. Пока она открыта,
   правое поле .pager — эта полоса плюс обычные 14 px: «N задач · …», «‹ сторінка X з Y ›» и подсказка
   переносятся в видимой части списка (flex-wrap Task 10). Подсказка — у правого края этой части, рядом
   с карточкой, и тогда, когда переносится на свою строку. */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .split:has(> .drawer > *) .pager { padding-right: calc(61.8vw - 22px - 1px + 14px); }
  .split:has(> .drawer > *) .esc-hint { margin-left: auto; }
}


/* ---------- карточка задачи (Task 14, спека §6.4, §7.6) ---------- */

/* Миниатюра-ссылка: файл («HEIC · завантажити») или сообщение с картинкой в Telegram. */
a.shot:hover { border-color: var(--line); color: var(--ink); }
.shot .i { justify-self: center; }
/* Подпись под «Відкрити в Telegram». */
.tg-hint { margin: -8px 0 0; color: var(--muted); font-size: 12.5px; }
/* Заголовок карточки поверх списка получает фокус из panel.js. Открыли карточку кликом или касанием строки —
   кольца нет, как у ссылки после клика; с клавиатуры кольцо общее (:focus-visible). Класс by-pointer ставит
   panel.js для браузеров, которые не знают focus({ focusVisible }), и снимает, когда фокус уходит с заголовка. */
.dtitle.by-pointer:focus-visible { outline: none; }

/* Просмотр скриншотов: <dialog id="viewer"> поверх страницы; картинку и номер ставит panel.js.
   Цвета — токены Task 10, общие для обеих тем: фон снимка не зависит от темы. */
.viewer {
  width: min(1100px, 100vw - 32px);
  height: min(860px, 100vh - 32px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--viewer-bg);
  color: var(--on-overlay);
}
.viewer::backdrop { background: var(--viewer-backdrop); }
.viewer img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vbtn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--overlay-ring);
  border-radius: 50%;
  background: var(--overlay);
  color: var(--on-overlay);
  cursor: pointer;
}
/* Кнопки тёмные с белым ободком: их видно и на светлом, и на тёмном скриншоте. */
.vbtn:hover { background: var(--overlay-strong); }
/* Кольцо фокуса — белое на тёмной кайме, одно для обеих тем: его видно и на тёмном фоне просмотра, и над светлым
   скриншотом. Общее кольцо --accent здесь — 2.5:1 в светлой теме и 2.6:1 над белым скриншотом в тёмной. */
.vbtn:focus-visible {
  outline: 2px solid var(--on-overlay);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--overlay-strong);
}
.vbtn .i { width: 18px; height: 18px; }
.vprev { top: 50%; left: 12px; transform: translateY(-50%); }
.vnext { top: 50%; right: 12px; transform: translateY(-50%); }
.vclose { top: 12px; right: 12px; }
.vcount {
  position: absolute;
  bottom: 12px;
  left: 50%;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--overlay);
  font-size: 12px;
  transform: translateX(-50%);
}
/* Одна картинка — без стрелок и номера. */
.viewer.single .vprev,
.viewer.single .vnext,
.viewer.single .vcount { display: none; }

@media (max-width: 899.98px) {
  /* Просмотр — на весь экран. Под карточкой на весь экран страница не прокручивается: класс card-open
     у <html> ставит panel.js, пока карточка открыта. */
  .viewer { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .card-open { overflow: hidden; }
}

/* ---------- «Задачі»: HTMX-запрос не удался (ревью) ---------- */

/* Сообщение в начале списка: проблема — красное, со значком и словами (D29). Видно, пока panel.js не снял hidden.
   Обычный блок <p>, а не flex-ряд (F37): значок строчный, как буква, и стоит в первой строке текста. Во flex-ряду
   с переносом фраза — один анонимный элемент: на телефоне она уходила на свою строку, и «!» оставался наверху один. */
.list-error {
  margin: 10px 14px 0;
  padding: 8px 12px;
  border: 1px solid var(--critical);
  border-radius: 8px;
  background: var(--critical-weak);
  color: var(--critical);
  font-size: 13.5px;
}
.list-error .i { margin-right: 6px; }
.list-error a { color: inherit; font-weight: 500; }
/* Список, который не обновился, приглушён до следующего удачного обновления — всё, кроме самого сообщения. */
#task-list.stale > :not(.list-error) { opacity: .55; }


/* Этап 3: общее (план 08)
   Панель и маршруты этапа 3. Ниже — блоки планов 09, 10, 11, 12 со своими стилями. */

/* Чип области руководителя в шапке (§7.9): названия отделов с обрезанием; у администратора чипа нет.
   nowrap у .chip уже есть; меньше 900 px чип скрыт общим .hide-sm. */
.who-scope { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* Шапка администратора — три вкладки (§7.9): на узком экране уже отступы, меньше 420 px — без слова «fixik»,
   имя ссылки даёт её aria-label. Модификатор — класс, а не :has(). */
@media (max-width: 899.98px) {
  .bar-admin { gap: 10px; }
  .bar-admin .nav a { padding: 0 7px; }
}
@media (max-width: 419.98px) {
  .bar-admin .mark-text { display: none; }
}

/* Общие поля форм этапа 3 (§5.15): «Призначити» в карточке задачи и «Надати доступ» на странице «Доступ». */
.fld { display: grid; gap: 4px; color: var(--ink-2); font-size: 12.5px; }
.fld-in {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font-size: 14px;
}
.fld-in:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
.fld-in[aria-invalid="true"] { border-color: var(--critical); }
.fld-hint { color: var(--muted); font-size: 12.5px; }
.btn:disabled, .btn-ghost:disabled, .chip-x:disabled { cursor: not-allowed; opacity: .55; }

/* ===== Этап 3 · план 09 — начало ===== */
/*   Действия с задачей и комментарии (§9.3). */

/* ---------- этап 3: действия и комментарии в карточке (спека этапа 3 §5.15, §6.1, §6.4) ---------- */

/* Блок действий под заголовком карточки: заметка, ряд кнопок статуса, подсказка, «Призначити», строки результата. */
.acts-box { display: grid; gap: 10px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.act { display: flex; margin: 0; }
/* «Скасувати», «Призначити» и «Змінити термін» — <summary> с классом .btn-ghost; системный треугольник скрыт. */
.acts summary,
.assign > summary,
.due > summary { list-style: none; }
.acts summary::-webkit-details-marker,
.assign > summary::-webkit-details-marker,
.due > summary::-webkit-details-marker { display: none; }
.acts details[open] > summary,
.assign[open] > summary,
.due[open] > summary { box-shadow: inset 0 0 0 1px var(--ink-2); }
.assign > summary .i,
.due > summary .i { transition: transform .15s; }
.assign[open] > summary .i,
.due[open] > summary .i { transform: rotate(180deg); }
/* Вопрос «Скасувати» раскрыт: на месте ряда — вопрос и две кнопки. Без :has() вопрос встаёт рядом с кнопками. */
.acts:has(> details.confirm[open]) > :not(details.confirm),
details.confirm[open] > summary { display: none; }
details.confirm[open] { flex: 1 1 100%; }
.confirm-box {
  display: grid;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.confirm-box > p { margin: 0; }
/* Поле комментария — во всю ширину блока, кнопки — рядом под ним (.act внутри — сетка, не flex-ряд). */
.confirm-box .act { display: grid; gap: 8px; }
.confirm-foot { display: flex; flex-wrap: wrap; gap: 8px; }
/* «Призначити» и «Змінити термін» — в одном ряду; раскрытый блок занимает ряд целиком, форма — под ним
   и сдвигает карточку вниз, ничего не перекрывая. */
.acts-more { display: flex; flex-wrap: wrap; gap: 8px; }
.acts-more > details[open] { flex: 1 1 100%; }
.assign-form,
.due-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--surface);
}
.assign-foot { display: flex; flex-wrap: wrap; gap: 8px; }
/* Отдел без бота и чат без права записи: нейтральные пояснения, как пометка «бот не може писати» на «Огляді»
   (красный, оранжевый и жёлтый заняты, D29). */
.act-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
}
.act-note .i { flex: none; margin-top: 2px; color: var(--muted); }
/* Строка результата записи. ok и info — без зелёного: «Скасовано.» с зелёной галочкой читалось бы как «отмена —
   это хорошо» (D29). err и ошибка без новой карточки — как .list-error: проблема — цвет, значок и слово. */
.act-result { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13.5px; }
.act-result .i { flex: none; margin-top: 2px; }
.act-result.ok { color: var(--ink); }
.act-result.ok .i { color: var(--ink-2); }
.act-result.info { color: var(--ink-2); }
.act-result.err,
.act-error {
  padding: 8px 12px;
  border: 1px solid var(--critical);
  border-radius: 8px;
  background: var(--critical-weak);
  color: var(--critical);
}
.act-error-text { overflow-wrap: anywhere; }
.act-error a { color: inherit; font-weight: 500; }
/* Фокус после ответа ставит panel.js: после щелчка кольца нет, с клавиатуры — общее :focus-visible. */
.act-result.by-pointer:focus-visible,
.acts-off.by-pointer:focus-visible { outline: none; }
/* Пока идёт запрос записи: блоки записи приглушены, а поля и кнопки выключены (hx-disabled-elt). */
#drawer.htmx-request { cursor: progress; }
#drawer.htmx-request :is(.acts-box, .cm-form) { opacity: .6; pointer-events: none; transition: opacity .15s; }

/* «Коментар у чат» (§6.1): поле — как .fld-in, растягивается по вертикали до 40 % высоты экрана. */
.cm-sec { display: grid; gap: 8px; }
.cm-form { display: grid; gap: 8px; }
.ta {
  width: 100%;
  min-height: 84px;
  max-height: 40vh;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font: 14px/1.5 var(--font-ui);
  resize: vertical;
}
.ta:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
.ta[aria-invalid="true"] { border-color: var(--critical); }
.cm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.cm-hint { flex: 1 1 200px; margin: 0; color: var(--muted); font-size: 12.5px; }
.cm-count { color: var(--muted); font: 12.5px var(--font-num); }
.cm-foot .btn { margin-left: auto; }

/* Комментарий в «Історії» (§6.4): подпись, текст с переносами строк и состояние доставки. */
.tl li.cm { align-items: start; }
.tl .tl-b { display: grid; gap: 4px; min-width: 0; }
.tl .msg { font-size: 13.5px; }
.cm-state { color: var(--muted); font-size: 12.5px; }
.cm-state .i { margin-right: 4px; }
a.cm-state { color: var(--ink-2); text-decoration: none; }
a.cm-state:hover { text-decoration: underline; }
.cm-failed { color: var(--critical); }

@media (max-width: 899.98px) {
  /* Карточка на весь экран: кнопки ряда и summary растягиваются и не ниже 44 px — под палец. */
  .acts > *,
  .acts-more > * { flex: 1 1 auto; }
  .acts > * > :is(.btn, .btn-ghost),
  .acts-more > * > summary { width: 100%; }
  .acts summary,
  .acts-more summary,
  .assign > summary,
  .due > summary { min-height: 44px; }
  /* Вопрос «Скасувати»/«Готово»: «Так, скасувати» и «Ні, залишити» — по половине строки под полем. */
  .confirm-foot > :is(.btn, .confirm-no) { flex: 1 1 0; }
  .assign-foot > :is(.btn, .assign-close) { flex: 1 1 0; }
  /* Шрифт поля 16 px: мельче iOS при фокусе увеличивает страницу. */
  .ta { font-size: 16px; }
  .cm-foot .btn { flex: 1 1 100%; margin-left: 0; }
}
/* ===== Этап 3 · план 09 — конец ===== */

/* ===== Этап 3 · план 10 — начало ===== */
/* ---------- «Доступ» (этап 3 §7.7, план 10): страница полных администраторов ---------- */
/* Цвета — только токены, обе темы; новых токенов нет. Приглушённый текст — --muted на --raised, как .tsub (AA). */

/* Подпись к заголовку «Доступ». На телефоне h1 скрыт визуально правилом .head h1 (Э2), подпись остаётся. */
.head-note { color: var(--muted); font-size: 13px; }
/* Регион #access: его целиком заменяют ответы POST. Форма, отправившая запрос, приглушена, пока ждёт ответа
   (класс htmx-request ставит htmx), как список при смене фильтров. */
.access { display: grid; gap: 14px; min-width: 0; }
.access > .list-error { margin: 0; }
.access form { margin: 0; }
.access form.htmx-request { opacity: .55; transition: opacity .15s; }
.access-side { display: grid; align-content: start; gap: 14px; min-width: 0; }

/* Строка результата — нейтральная, не зелёная: успешная операция — не состояние задач (D29). «Увага: …» —
   вторая строка в том же оформлении, «Повернути» — сразу за текстом. Ошибка — .form-error, как .list-error:
   рамка, фон, значок и слова. */
.access-result {
  display: grid;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}
.access-result > div { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; }
.access-result > div > .i { margin-top: 4px; color: var(--ink-2); }
.access-result > div > span { min-width: 0; overflow-wrap: anywhere; }
.form-error {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--critical);
  border-radius: 8px;
  background: var(--critical-weak);
  color: var(--critical);
  font-size: 13.5px;
}
.form-error .i { margin-right: 6px; }
/* «Повернути» — форма в строке результата, кнопка выглядит ссылкой. */
.inline-form { display: inline; margin: 0; }
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }

/* «Керівники відділів»: имя, ник и подписи — в первой ячейке, ID — цифрами JetBrains Mono. */
.access-t td { vertical-align: top; }
.mname { display: block; font-weight: 500; overflow-wrap: anywhere; }
.access-t .tsub { white-space: normal; }
.access-t td.num { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
/* Чип отдела — форма отзыва; длинное название переносится, а не раздвигает таблицу. «✕» — 24×24 (WCAG 2.5.8). */
.access-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.access-chips .chip { gap: 2px; padding: 2px 2px 2px 9px; white-space: normal; overflow-wrap: anywhere; }
.chip-x {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.chip-x:hover { background: var(--hair); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* «Надати доступ»: видимый стандартный select со стрелкой i-down поверх (картинку data: CSP запрещает). */
.grant { display: grid; gap: 14px; padding: 4px 16px 16px; }
.grant fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.fld-l { margin-bottom: 4px; padding: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.fld-or { margin-top: 6px; }
.field {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font-size: 14px;
}
.field::placeholder { color: var(--muted); opacity: 1; }
.field:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
.field[aria-invalid="true"] { border-color: var(--critical); }
.field-sel { position: relative; display: block; }
.field-sel .field { padding-right: 32px; -webkit-appearance: none; appearance: none; }
.field-sel .i {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}
.checks { display: grid; gap: 2px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.check:hover { background: var(--plane); }
.check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.check input[aria-invalid="true"] { outline: 2px solid var(--critical); outline-offset: 1px; }
.checks-sub { margin: 8px 0 2px; color: var(--muted); font-size: 12.5px; }
.access-note { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: 13px; }
/* «Повні адміністратори» — только чтение. */
.admins-list { display: grid; gap: 6px; margin: 0; padding: 4px 16px 10px; list-style: none; font-size: 14px; }
.admins-list .num { margin-left: 4px; font-size: 13px; }

/* 900–1099 px — одна колонка (правило .grid2 Э2): форма и администраторы не шире 560 px. */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .access-side { max-width: 560px; }
}

/* Телефон: руководители — карточками (имя и «Прибрати»; ник и ID; чипы), поля и кнопка — на всю ширину,
   шрифт полей 16 px (иначе iOS увеличивает страницу при фокусе), «✕» — 32×32. */
@media (max-width: 899.98px) {
  .head .head-note { grid-column: 1 / -1; }
  .field { font-size: 16px; }
  .grant .btn { justify-self: stretch; min-height: 44px; }
  .chip-x { width: 32px; height: 32px; }
  .access-t,
  .access-t tbody { display: block; }
  .access-t thead { display: none; }
  .access-t tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name act" "id id" "deps deps";
    gap: 6px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hair);
  }
  .access-t tr:last-child { border-bottom: 0; }
  .access-t td { display: block; padding: 0; border: 0; }
  .access-t td:nth-child(1) { grid-area: name; }
  .access-t td:nth-child(2) { grid-area: id; }
  .access-t td:nth-child(3) { grid-area: deps; }
  .access-t td:nth-child(4) { grid-area: act; }
}
/* ===== Этап 3 · план 10 — конец ===== */

/* ===== Этап 3 · план 11 — начало ===== */

/* ---------- «Задачі»: выгрузка в Excel (этап 3 §8.2) ---------- */

/* «Завантажити Excel» — последняя в низу списка, у правого края; вид — как у «‹ ›» страниц. */
.export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-decoration: none;
  white-space: nowrap;
}
.export:hover { border-color: var(--ink-2); color: var(--ink); }

/* 900–1099 px, карточка поверх списка: «Esc — закрити картку» уже прижата вправо (этап 2); кнопка встаёт сразу
   за ней, а не делит с ней свободное место. */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .split:has(> .drawer > *) .export { margin-left: 0; }
}

/* Телефон: своей строкой на всю ширину, 44 px — как «Відкрити в Telegram» в карточке. */
@media (max-width: 899.98px) {
  .export { flex-basis: 100%; justify-content: center; padding: 12px 16px; font-size: 14px; text-align: center; white-space: normal; }
}
/* ===== Этап 3 · план 11 — конец ===== */

/* ===== Этап 3 · план 12 — начало ===== */
/* ---------- «Огляд»: строка про щоденне зведення (этап 3 §9.7.2). Не проблема: без красного, оранжевого
   и жёлтого (D29); красное — только сообщение об ошибке «Не треба» ---------- */
.offer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--raised);
}
.offer-ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-weak);
  color: var(--accent);
}
.offer-ic .i { width: 18px; height: 18px; }
.offer-txt { min-width: 0; }
.offer-title { margin: 0; font: 600 14.5px/1.35 var(--font-ui); }
.offer-text { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; text-wrap: pretty; }
.offer-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.offer-act form { display: flex; margin: 0; }
.offer-act .btn,
.offer-act .btn-ghost { padding: 7px 12px; font-size: 13.5px; }
.offer-act button:disabled { cursor: progress; } /* приглушение — общее правило :disabled (§5.15) */
/* [hidden] { display: none !important; } из базы сильнее display: flex */
.offer-err {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  color: var(--critical);
  font-size: 13px;
  font-weight: 500;
}
.offer-note {
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: 13.5px;
}
@media (max-width: 899.98px) {
  /* Значок и текст сверху, кнопки — своей строкой во всю ширину, под палец (§9.7.3). */
  .offer { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 12px; }
  .offer-act { grid-column: 1 / -1; margin-top: 6px; }
  .offer-act > .btn { flex: 1 1 auto; }
  .offer-act .btn,
  .offer-act .btn-ghost { min-height: 44px; padding: 10px 14px; }
}
/* ===== Этап 3 · план 12 — конец ===== */
