/*
   ЗЕТРА ПОШУК.

   Бренд Zetra, осучаснений: логотип, фірмовий червоний і Roboto Condensed -
   із сайту zetra.com.ua; решта - сучасна мова інтерфейсів: липка напівпрозора
   шапка, м'які тіні й заокруглення, заголовки Roboto Condensed над текстом
   Roboto, і рух там, де він щось каже: шестерня логотипа крутиться, поки
   сервер працює, картки з'являються, лічильники підстрибують, коли
   змінюються.

   Робочий екран лишається щільним: оператор проводить на ньому години. Усі
   анімації вимикаються, якщо в системі ввімкнено «зменшити рух».

   Червоний трохи темніший за сайтовий (#c4463d проти #ce4f46): білий текст на
   кнопці читається з контрастом 4,9:1, а на око різниці не видно.
*/

/* Шрифт лежить у застосунку, а не тягнеться з Google: сторінка не залежить
   від чужого сервера, і перший показ не блимає системним шрифтом. */
@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-condensed-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-condensed-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-condensed-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-condensed-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: "Roboto"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url("fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #1f2328;
  --dim: #5f6670;
  --line: #e6e8ec;
  --line-strong: #d0d5dc;
  --accent: #c4463d;
  --accent-dark: #a9362e;
  --accent-ink: #ffffff;
  --accent-soft: #fbeceb;
  --slate: #3c495f;
  --graphite: #1c2126;
  --ok: #3b7a1e;
  --ok-soft: #ebf5e4;
  --warn: #93600f;
  --warn-soft: #fdf5e6;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --focus: rgba(196, 70, 61, .16);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lift: 0 10px 24px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-red: 0 8px 18px rgba(196, 70, 61, .30);
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --display: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* hidden має вимикати елемент і тоді, коли йому дали display флексом чи
   інлайн-блоком нижче. Без цього прихована позначка «прийнято» лишалась би
   видимою на всіх картках одразу. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; width: 100%; }

h1 { font: 700 30px/1.15 var(--display); margin: 4px 0 10px; letter-spacing: -.005em; color: var(--ink); }
/* Підзаголовки - дрібна «мітка розділу» великими літерами. */
h2 { font: 700 13px/1.3 var(--display); margin: 28px 0 10px; text-transform: uppercase;
     letter-spacing: .09em; color: var(--dim); }
h3 { font-size: 15px; margin: 0; font-weight: 700; }
a { color: var(--slate); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

/* Шапка: липка й напівпрозора - при прокрутці крізь неї ледь видно картки.
   Згори - фірмова червона риска, як смуга над шапкою zetra.com.ua. */
.top { position: sticky; top: 0; z-index: 20;
       background: rgba(255, 255, 255, .86);
       -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
       border-bottom: 1px solid var(--line); }
.top::before { content: ""; display: block; height: 3px;
               background: linear-gradient(90deg, var(--accent), #e0675d 60%, var(--accent-dark));
               transform-origin: left center; }
.top-in { display: flex; align-items: center; gap: 22px; max-width: 1500px;
          margin: 0 auto; padding: 10px 20px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
         color: #3a3a3b; flex: 0 0 auto; }
.brand-logo { display: block; height: 34px; width: auto; overflow: visible; }
.logo-gear { transform-box: fill-box; transform-origin: center; }
.brand-word { font: 700 22px/1 var(--display); letter-spacing: .08em; color: var(--accent);
              padding-top: 5px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0;
          color: var(--dim); font-size: 14px; padding-left: 20px; border-left: 1px solid var(--line); }
.crumbs a { color: var(--slate); text-decoration: none; padding: 4px 8px; border-radius: 999px;
            transition: background-color .2s, color .2s; }
.crumbs a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.crumbs span { padding: 0 2px; color: var(--line-strong); }
.usernav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.settings-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
                 border-radius: 999px; color: var(--slate); text-decoration: none; font-size: 14px;
                 transition: background-color .2s, color .2s; }
.settings-link:hover { background: #eef0f3; color: var(--ink); }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round; transition: transform .6s var(--ease); }
.settings-link:hover .ico { transform: rotate(90deg); }
.signout { margin: 0; }
.linkish { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0;
           padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; color: var(--slate);
           font: inherit; font-size: 14px; transition: background-color .2s; }
.linkish:hover { background: #eef0f3; color: var(--ink); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
          background: var(--accent-soft); color: var(--accent-dark); font: 700 13px/1 var(--display); }

/* Смужка «сервер працює». Невидима, поки немає задачі. */
.top-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden;
                opacity: 0; transition: opacity .3s; }
.top-progress i { position: absolute; top: 0; bottom: 0; width: 35%;
                  background: linear-gradient(90deg, transparent, var(--accent), transparent); }
html.working .top-progress { opacity: 1; }

/* Підвал - графітовий, як у сайту, але тонкий. */
.foot { background: var(--graphite); color: #9aa3ad; font-size: 13px; margin-top: 36px; }
.foot-in { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
           max-width: 1500px; margin: 0 auto; padding: 16px 20px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; color: #ffffff; }
.foot-brand .brand-logo { height: 20px; }
.foot-brand b { font: 700 14px/1 var(--display); letter-spacing: .08em; color: #ff8a80; padding-top: 3px; }
.foot-link { margin-left: auto; color: #ffffff; text-decoration: none; }
.foot-link:hover { color: #ff8a80; text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.work { max-width: 1500px; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lead { color: var(--dim); max-width: 70ch; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.clip { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin: 12px 0; box-shadow: var(--shadow);
}

.note {
  background: var(--card); border: 1px solid var(--warn); color: var(--warn);
  border-radius: var(--radius); padding: 8px 12px; margin: 12px 0;
}
.note.ok { border-color: var(--ok); color: var(--ok); }
.empty { color: var(--dim); padding: 10px 0; }
/* overflow-wrap: довге ім'я файлу або адреса в pre-wrap не переносяться й
   тягнуть за собою горизонтальний скрол усієї сторінки. */
.err { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card);
       border: 1px solid var(--line); padding: 12px; border-radius: var(--radius); }

/* кнопки й поля */

/* min-height 40px: рекомендована ціль для пальця - 44, і саме на кнопках, що
   витрачають гроші, промах коштує найдорожче. Кнопки стоять поруч у ряду, тож
   без цього «Пропустити» й «Оптимізувати» різняться на кілька пікселів. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px;
  padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink); text-decoration: none;
  font: inherit; font-size: 15px; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--slate); color: var(--slate); }
/* Основна дія - червона й великими літерами, як «КУПИТЬ» на сайті. */
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
               text-transform: uppercase; font-weight: 500; letter-spacing: .03em; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-ink); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.ghost { border-color: transparent; color: var(--dim); background: transparent; }
.btn[disabled], .btn[disabled]:hover { opacity: .45; cursor: not-allowed;
  border-color: var(--line-strong); color: var(--ink); }
.btn.primary[disabled], .btn.primary[disabled]:hover { background: var(--accent);
  border-color: var(--accent); color: var(--accent-ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }

kbd {
  font: 11px/1 ui-monospace, Menlo, Consolas, monospace;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: 2px 4px; color: var(--dim); background: var(--bg);
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 14px; color: var(--dim); }
.field.inline { flex-direction: row; align-items: center; gap: 6px; }
.field.grow { flex: 1 1 260px; min-width: 0; }
.field.grow select { width: 100%; }
/* 16px - не естетика, а поведінка: iOS автоматично зумить сторінку, щойно
   торкаєшся поля з меншим шрифтом, і повернути масштаб назад людина, яка з
   компʼютерами не дружить, не здогадається. Заодно вищий padding: у поле
   треба влучити пальцем. */
input, select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 7px 9px;
  max-width: 100%;
}
input:focus, select:focus { border-color: var(--slate); }
input[type="number"] { width: 8em; }
.form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.form .cols { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.form .cols .field { flex: 1 1 260px; }
.form .cols .field.wide { flex-basis: 100%; }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* таблиці */

.grid { width: 100%; border-collapse: collapse; background: var(--card);
        border: 1px solid var(--line); border-radius: var(--radius); }
.grid th, .grid td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 13px; color: var(--dim); font-weight: 500; text-transform: uppercase;
           letter-spacing: .02em; background: #fafafa; }
.grid tbody tr:last-child td { border-bottom: 0; }
/* У прев'ю файла заголовки - назви колонок клієнта: регістр лишаємо як є. */
.grid.preview th { text-transform: none; letter-spacing: 0; }
.grid td.zero { color: var(--dim); }
.grid td.has { font-weight: 600; }
.scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.scroll .grid { border: 0; }
/* Усередині .form (flex-колонка з align-items: flex-start) ширина елемента
   рахується по вмісту, тому контейнер розтягувався б під ширину таблиці
   замість того, щоб її прокручувати - і на вузькому екрані знову їхала б
   уся сторінка. Ширину задаємо явно, як і сусідньому .cols. */
.form > .scroll { width: 100%; }
.preview td { white-space: nowrap; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; }
.map select { min-width: 22em; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: var(--radius);
       background: #eef0f3; color: var(--slate); font-size: 12px; font-weight: 400; }

/* лічильники */

/* два числа вгорі робочого екрана - усе, що людині треба знати про прогрес */

.counters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.counter {
  display: flex; flex-direction: column; min-width: 104px; padding: 8px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  border-left: 3px solid var(--slate); color: var(--ink); box-shadow: var(--shadow);
}
.counter:first-child { border-left-color: var(--ok); }
.counter b { font-size: 24px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter span { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .02em; }

/* рядок стану задачі: одна смужка, один рядок тексту й кнопка «спинити» */

.status { display: flex; align-items: center; gap: 12px; }
.status .bar { flex: 0 0 140px; height: 6px; background: var(--bg);
               border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.status .bar i { display: block; height: 100%; background: var(--accent);
                 transition: width .3s linear; }
.status .txt { flex: 1 1 auto; }
.status.failed .txt { color: var(--bad); }

/* список проєктів */

.projects { list-style: none; margin: 0; padding: 0;
            display: flex; flex-direction: column; gap: 8px; }
.project { display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
           padding: 12px 14px; background: var(--card); box-shadow: var(--shadow);
           border: 1px solid var(--line); border-radius: var(--radius); }
.project .who > a { font-size: 17px; text-decoration: none; color: var(--ink); }
.project .who > a:hover { color: var(--accent-dark); }
.project .who { flex: 1 1 240px; min-width: 0; }

/* готові файли */

.files { list-style: none; margin: 0; padding: 0;
         display: flex; flex-direction: column; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* значки */

.badge { display: inline-block; padding: 1px 6px; border-radius: 4px;
         border: 1px solid var(--line); font-size: 11px; color: var(--dim); }
/* Підпис стану з'являється лише після рішення, тому він завжди про закриту
   позицію - і завжди спокійно-зелений, без червоного «відхилено». */
.badge.done { color: var(--ok); border-color: var(--ok); }

/* робочий екран */

.help { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 12px; color: var(--dim);
        background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.hint { margin: 6px 0 0; }

.pos {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 10px 0; outline: none; box-shadow: var(--shadow);
}
.pos:focus-visible, .pos.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
/* Приглушення розібраної позиції - навмисне: око має бігти далі. Але воно
   гасило й червоне повідомлення про збій, а його контраст і так на межі.
   Тому приглушуємо вміст, а рядок стану й поле доопрацювання - ні. */
.pos.resolved { opacity: .55; }
.pos.resolved .posmsg, .pos.resolved .refine, .pos.resolved .acts { opacity: 1; }
/* Кандидати й подробиці на розібраній позиції згортаємо - оператор іде далі.
   А от .acts лишаємо: саме там кнопка «повернути в роботу», і промах по
   сусідній позиції має виправлятись одразу, а не пошуком її в списку
   «прийнятих» після перезавантаження. */
.pos.resolved .cands, .pos.resolved .extras { display: none; }
/* На ПРИЙНЯТІЙ картці обрана картинка лишається - маленькою. Доти після
   «Прийняти» зникало все, і людина не могла перевірити, що натиснула саме
   ту, - лишалось тільки «Повернути» й дивитися заново. */
.pos.resolved[data-status="accepted"] .cands { display: flex; margin: 4px 0 6px; }
.pos.resolved[data-status="accepted"] .cand:not(.chosen) { display: none; }
.pos.resolved[data-status="accepted"] .cand.chosen { width: 84px; }
.pos.resolved[data-status="accepted"] .cand.chosen .shot { height: 72px; }
.pos.resolved[data-status="accepted"] .cand.chosen figcaption,
.pos.resolved[data-status="accepted"] .cand.chosen .accept,
.pos.resolved[data-status="accepted"] .cand.chosen .chosenmark { display: none; }
.pos.busy { opacity: .7; }

.pos-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pos-head .art { font-weight: 700; font-size: 17px; color: var(--ink); }
.pos-head .name { font-size: 16px; font-weight: 400; color: var(--ink); }
.pos-head .name { flex: 1 1 40ch; min-width: 0; overflow-wrap: anywhere; }

.pos-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--bg);
        border: 1px solid var(--line); color: var(--ink); text-decoration: none;
        overflow-wrap: anywhere; }
.chip b { color: var(--dim); font-weight: 600; margin-right: 4px; }

.extras { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 8px; }
.extras > div { display: flex; gap: 6px; font-size: 14px; max-width: 100%; }
.extras > div.long { flex-basis: 100%; }
.extras dt { color: var(--dim); margin: 0; }
.extras dd { margin: 0; overflow-wrap: anywhere; }

/* align-items: stretch плюс margin-top: auto на кнопці - підписи в кандидатів
   різної висоти, а кнопки «Прийняти» мають стояти в один ряд: око шукає їх
   на однаковому місці, а не бігає вгору-вниз. */
.cands { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; align-items: stretch; }
.cand { margin: 0; width: 190px; display: flex; flex-direction: column; gap: 4px; }
.cand .shot { position: relative; height: 160px; background: #ffffff;
              border: 1px solid var(--line); border-radius: var(--radius);
              display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cand img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cand .noshot { color: var(--dim); font-size: 12px; }
.cand .hotkey { position: absolute; top: 4px; left: 4px; min-width: 18px; text-align: center;
                background: var(--accent); color: var(--accent-ink); border-radius: 4px;
                font-size: 11px; padding: 1px 5px; }
.cand figcaption { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; }
.cand .dom { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* «Прийняти» - головна дія на кожній картинці: червоний контур, червона
   заливка під курсором. Повністю червоними кнопками весь екран не заливаємо -
   їх на ньому десятки. */
.cand .accept { justify-content: center; margin-top: auto; border-color: var(--accent);
                color: var(--accent-dark); font-weight: 500; }
.cand .accept:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Уже прийнятий кандидат: інакше на закритій позиції всі кнопки однакові
   й оператор не бачить, що саме обрав минулого разу. */
.cand.chosen .shot { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok) inset; }
.cand.chosen .accept, .cand.chosen .accept:hover { border-color: var(--ok); color: var(--ok);
                                                    background: var(--card); }
/* Рамка кольором - підказка, а не відповідь: у темній темі й на світлих
   картинках вона губиться. Підпис не губиться ніде. */
.cand .chosenmark { position: absolute; top: 4px; right: 4px;
                    background: var(--ok); color: var(--card);
                    border-radius: 4px; font-size: 11px; padding: 1px 6px; }

/* Якою спробою знайдено те, що зараз на екрані. Стоїть НАД картинками: це
   перше, що має прочитати око, перш ніж вибирати. */
.foundby { margin: 6px 0 2px; font-size: 13px; color: var(--dim); }
.cand .warn { color: var(--warn); font-size: 13px; flex-basis: 100%; }

.acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* «Повернути» має сенс лише там, де є що скасовувати, а на свіжому екрані
   таких карток немає взагалі: там стоять тільки позиції, які чекають рішення.
   Показ керується станом самої картки - JS міняє data-status одразу після
   рішення, тому кнопка з'являється й зникає без перезавантаження. */
.pos .undo { display: none; }
.pos[data-status="accepted"] .undo,
.pos[data-status="skipped"] .undo { display: inline-flex; }
/* Оптимізація має сенс лише на прийнятій картці, а «повернути оригінал» - лише
   там, де оптимізована копія вже є. Обидві кнопки ховає й показує CSS за
   станом картки, тому після рішення нічого не треба перемальовувати. */
.pos .optimize, .pos .unenh { display: none; }
.pos[data-status="accepted"] .optimize { display: inline-flex; }
.pos[data-enhanced="1"] .unenh { display: inline-flex; }

/* Доопрацювання. Ховаємо доти, доки картку не прийнято: до вибору картинки
   доопрацьовувати нема чого. Вибір «з оптимізованої» показуємо лише коли
   оптимізована копія існує - інакше це порожня обіцянка. */
.pos .refine { display: none; }
.pos[data-status="accepted"] .refine {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 6px 0 2px; }
/* 16px - не примха: на менших розмірах iOS сам зумить сторінку, щойно
   торкнешся поля, і повернути масштаб назад людина вже не здогадається. */
.pos .refnote { flex: 1 1 260px; min-width: 0; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 7px; font: inherit;
    font-size: 16px; background: var(--card); color: inherit; }
.pos .refcost { font-size: 12px; color: var(--dim); white-space: nowrap; }
.pos .refhint { font-size: 13px; color: var(--dim); }
/* Фото за посиланням. Поле таке ж, як у доопрацювання (16px - інакше iOS
   зумить сторінку). На розібраній картці ховаємо: додавати вже нема куди. */
.pos .linkadd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; }
.pos .linkurl { flex: 1 1 260px; min-width: 0; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 7px; font: inherit;
    font-size: 16px; background: var(--card); color: inherit; }
.pos.resolved .linkadd, .pos[data-status="accepted"] .linkadd,
.pos[data-status="skipped"] .linkadd { display: none; }
/* Підказка після першого пошуку й лічильник способів. Гаснуть, щойно позицію
   розібрано: розібраній картці радити «Шукати інше» вже нема чого. */
.pos .nudge { margin: 6px 0 2px; font-size: 14px; color: var(--dim); }
.pos .stepsleft { margin: 4px 0 2px; font-size: 13px; color: var(--dim); }
.pos.resolved .nudge, .pos[data-status="accepted"] .nudge, .pos[data-status="skipped"] .nudge,
.pos.resolved .stepsleft, .pos[data-status="accepted"] .stepsleft,
.pos[data-status="skipped"] .stepsleft { display: none; }
.pos .refbase { display: none; gap: 12px; font-size: 14px; color: var(--dim); }
.pos .refbase input { transform: scale(1.2); }
.pos[data-enhanced="1"] .refbase { display: inline-flex; }
.pos .refbase label { display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 2px; }
/* Прийняті картки в списку приглушені - це правильно для перегляду, але
   поле, у яке треба цілитись і читати набране, приглушувати не можна. */
.pos.resolved .refine { opacity: 1; }
/* Плитка прийнятих на екрані вивантаження. Дрібна навмисно: це не перегляд,
   а спосіб упізнати картинку й натиснути на ній «Оптимізувати». */
/* Екран входу. Єдина сторінка, де людина ще нічого не знає про застосунок,
   тому тут порожньо, широкі поля й нічого зайвого навколо. */
.gate { display: flex; align-items: center; justify-content: center;
        min-height: calc(100vh - 120px); padding: 20px; }
.signin { width: min(400px, 100%); padding: 26px 26px 22px; }
.signin h1 { margin: 0 0 6px; font-size: 21px; }
.signin .lead { margin: 0 0 16px; }
.signin .form { gap: 14px; }
.signin .field { width: 100%; }
.signin .field input { width: 100%; padding: 8px 10px; font-size: 15px; }
.signin .btn.primary { width: 100%; justify-content: center; padding: 9px; }
.signin .note { width: 100%; box-sizing: border-box; margin: 0 0 14px; }
.signin .small { margin: 14px 0 0; }
.note.bad { border-color: var(--bad); color: var(--bad); }
body:has(.gate) .top { display: none; }

.folded { margin: 4px 0 8px; }
.folded > summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.folded > summary:hover { color: var(--ink); }

.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 16px; }
.tile { margin: 0; width: 132px; display: flex; flex-direction: column; gap: 4px;
        border: 1px solid var(--line); border-radius: var(--radius); padding: 6px;
        background: var(--card); box-shadow: var(--shadow); }
.tile img { width: 100%; height: 96px; object-fit: contain; background: #ffffff; }
.tile figcaption { font-size: 11px; overflow-wrap: anywhere; }
.tile .btn { justify-content: center; font-size: 13px; padding: 6px 8px;
             min-height: 36px; }
.tile .tag { font-size: 11px; color: var(--ok); text-align: center; }
.tile.done { opacity: .7; }
.tile.busy { opacity: .5; }

.cand .enhmark { position: absolute; bottom: 4px; left: 4px; font-size: 11px;
                 padding: 1px 6px; border-radius: 9px; background: var(--ok);
                 color: var(--card); }
/* Попередження оптимізації. Стоїть над міткою «оптимізовано» і кольором
   каже те саме, що текстом: картинку віддали, але дивитись треба очима. */
.cand .enhwarn { position: absolute; bottom: 24px; left: 4px; right: 4px;
                 font-size: 11px; padding: 1px 6px; border-radius: 9px;
                 background: var(--bad); color: var(--card); }
/* Рядок про втрачений зв'язок. Смужка прогресу застигає мовчки, і без цього
   напису людина дивиться на неї, доки не натисне F5. */
.netnote { color: var(--bad); font-size: 13px; margin-left: 8px; }
.posmsg { color: var(--dim); font-size: 13px; }
/* Збій має читатись, а не вгадуватись: свій колір, жирність і невеличка
   підкладка, щоб текст не зливався з карткою. */
.posmsg.bad { color: var(--bad); font-weight: 600; font-size: 14px; }
.loader { color: var(--dim); }
/* Мітка кінця списку. Висота обов'язкова: елемент нульової висоти
   IntersectionObserver не показує, і дозавантаження ніколи не спрацьовує. */
#sentinel { height: 24px; }
.more { display: block; margin: 8px auto; }

@media (max-width: 700px) {
  .cand { width: 46%; }
  .cand .shot { height: 120px; }
  .job .kind, .job .state { min-width: 0; }
  /* Шапка на вузькому екрані розсипалась на чотири стиснуті стовпчики -
     кожен по кілька літер. Хай переносяться рядком. */
  .top-in { flex-wrap: wrap; row-gap: 6px; gap: 12px; padding: 8px 14px; min-height: 0; }
  .brand-logo { height: 28px; }
  .brand-word { font-size: 18px; padding-top: 4px; }
  .crumbs { order: 3; flex-basis: 100%; padding-left: 0; border-left: 0; margin-left: -8px; }
  .settings-link span, .who-name { display: none; }
  .foot-link { margin-left: 0; }
  h1 { font-size: 24px; }
  /* Форма пошуку: поле й кнопка в стовпчик, поле на всю ширину. Інакше
     «скільки позицій» стискається до двох цифр. */
  .row-form { flex-direction: column; align-items: stretch; }
  .row-form .field.inline { flex-direction: column; align-items: stretch; gap: 4px; }
  .row-form input[type="number"] { width: 100%; }
  .row-form .btn { width: 100%; }
  /* Дії на картці: кнопки на всю ширину, щоб платна не тулилась до
     безкоштовної на відстані пальця. */
  .acts { gap: 10px; }
  .acts .btn { flex: 1 1 46%; }
}

/* ---------- прибирання зайвого з екрана ---------- */

/* Кнопка «Показати» біля списків із data-autosubmit: зі скриптами вона нічого
   не додає, без них - єдиний спосіб застосувати фільтр. Тому ховає її саме
   ознака працюючого JS, а не hidden у розмітці. */
.js .nojs { display: none; }

/* Решта колонок клієнта - згорнуто: на картці видно два найзмістовніші поля,
   інші відкриваються за потреби. */
.more-fields > summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 13px;
  padding: 2px 0;
}
.more-fields { margin-top: 4px; }

/* Кнопка видалення стоїть у рядку поруч із посиланнями, тому форма навколо
   неї не має переносити рядок. */
.inline-form { display: inline; }
.btn.danger { border-color: var(--bad); color: var(--bad); }

/* шапка: посилання на налаштування праворуч, окремо від хлібних крихт */
/* Вибір постачальника: кожен рядок - велика ціль для пальця, з ціною поруч
   із назвою. Недоступний варіант приглушений, але видимий: людина має
   бачити, що він є, і що для нього треба ключ. */
/* Рядок прибирання переносимо: три сервіси в один рядок на телефоні не
   влазять, а горизонтальний скрол на сторінці налаштувань - остання річ,
   яку варто пропонувати людині, що прийшла вписати ключ. */
.row-form.wrap { flex-wrap: wrap; gap: 10px; align-items: center; }

.field.pick { border: 1px solid var(--line); border-radius: var(--radius);
              padding: 10px 12px; gap: 4px; }
.field.pick .pickhead { display: flex; align-items: center; gap: 8px;
                        font-size: 15px; }
.field.pick input[type="radio"] { transform: scale(1.3); }
.field.pick.dimmed { opacity: .6; }



ul.plain { margin: 8px 0; padding-left: 18px; }
ul.plain li { margin: 4px 0; }
.field.long input { width: min(38em, 100%); }
.field.long .small { max-width: 44em; }


/* =====================================================================
   Сучасний шар: поверхні, кнопки, поля.
   Правила показу й приховування (data-status, resolved, hidden) вище не
   чіпаємо - тут лише вигляд.
   ===================================================================== */

.wrap { padding: 22px 20px; }
.card, .pos, .project, .counter, .tile, .note, .help, .status {
  border-radius: var(--radius); }
.card { border-color: var(--line); box-shadow: var(--shadow); padding: 16px 18px; }
.lead { color: var(--dim); font-size: 15px; }

/* кнопки */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: 14.5px; letter-spacing: .005em;
       border-color: var(--line-strong); background: var(--card); color: var(--ink);
       transition: transform .15s var(--ease), box-shadow .2s var(--ease),
                   background-color .2s, border-color .2s, color .2s; }
.btn:hover { background: #f7f8fa; border-color: #b9c0c9; color: var(--ink);
             transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, #cf5046, var(--accent)); border-color: transparent;
               color: #ffffff; text-transform: none; font: 700 15.5px/1 var(--display);
               letter-spacing: .04em; padding-left: 18px; padding-right: 18px; }
.btn.primary:hover { background: linear-gradient(180deg, #c4463d, var(--accent-dark)); color: #ffffff;
                     box-shadow: var(--shadow-red); border-color: transparent; }
.btn.danger { border-color: var(--line-strong); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f0b4ae; color: var(--bad); }
.btn.ghost:hover { background: #eef0f3; box-shadow: none; }
.btn[disabled], .btn[disabled]:hover { transform: none; box-shadow: none; opacity: .5; }
.btn.ghost[disabled], .btn.ghost[disabled]:hover { border-color: transparent; color: var(--dim); background: transparent; }
.btn.primary[disabled], .btn.primary[disabled]:hover { background: linear-gradient(180deg, #cf5046, var(--accent)); }

/* поля */
input, select { border-radius: var(--radius-sm); border-color: var(--line-strong);
                transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.pos .refnote, .pos .linkurl { border-radius: var(--radius-sm); border-color: var(--line-strong);
                               transition: border-color .2s, box-shadow .2s; }
.pos .refnote:focus, .pos .linkurl:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }

/* примітки: м'яка заливка й смужка ліворуч */
.note { background: var(--warn-soft); border: 0; border-left: 4px solid var(--warn); color: #6b4608;
        box-shadow: none; padding: 10px 14px; }
.note.ok { background: var(--ok-soft); border-left-color: var(--ok); color: #2d5c17; }
.note.bad { background: var(--bad-soft); border-left-color: var(--bad); color: #8c1d17; }

/* дрібні мітки - «пігулки» */
.chip, .badge, .tag { border-radius: 999px; }
.badge.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-weight: 500; }

/* лічильники */
.counters { gap: 12px; }
.counter { min-width: 132px; padding: 12px 18px 10px; border: 1px solid var(--line); box-shadow: var(--shadow);
           position: relative; overflow: hidden; }
.counter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--slate); }
.counter:first-child::before { background: var(--ok); }
.counter:first-child { border-left: 1px solid var(--line); }
.counter b { display: inline-block; font: 700 32px/1.05 var(--display); transform-origin: left bottom; }
.counter span { font-size: 12px; font-weight: 500; letter-spacing: .06em; }

/* рядок стану */
.status { gap: 14px; }
.status .bar { flex-basis: 180px; height: 8px; border: 0; border-radius: 999px; background: #eceef2; }
.status .bar i { border-radius: 999px;
                 background-color: var(--accent);
                 background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%,
                                   transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%,
                                   transparent 75%, transparent);
                 background-size: 16px 16px; }

/* список проєктів */
.projects { gap: 10px; }
.project { padding: 14px 16px; border-color: var(--line); box-shadow: var(--shadow);
           transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.project:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: #dcdfe5; }
.project .who > a { font: 700 19px/1.2 var(--display); color: var(--ink); }
.meter { height: 6px; margin-top: 8px; max-width: 360px; border-radius: 999px; background: #eceef2; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px;
           background: linear-gradient(90deg, var(--ok), #69a83c); transform-origin: left center; }

/* робочий екран */
.pos { border-color: var(--line); box-shadow: var(--shadow); padding: 14px 16px; margin: 12px 0;
       transition: opacity .35s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.pos:focus-visible, .pos.on { border-color: rgba(196, 70, 61, .55);
                              box-shadow: 0 0 0 4px var(--focus), var(--shadow-lift); }
.pos-head .art { font: 700 20px/1.2 var(--display); letter-spacing: .01em; }
.pos-head .name { font-size: 15.5px; }
.cands { gap: 12px; }
.cand .shot { border-radius: 10px; border-color: var(--line); background: #ffffff;
              transition: box-shadow .25s var(--ease), border-color .2s, transform .25s var(--ease); }
.cand .shot img { transition: transform .45s var(--ease); }
.cand:hover .shot { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: #d9dde3; }
.cand:hover .shot img { transform: scale(1.06); }
.cand .accept { border-radius: 999px; border: 1.5px solid rgba(196, 70, 61, .55); color: var(--accent-dark);
                font: 700 15px/1 var(--display); letter-spacing: .03em; }
.cand .accept:hover { background: linear-gradient(180deg, #cf5046, var(--accent)); border-color: transparent;
                      color: #ffffff; box-shadow: var(--shadow-red); }
.cand.chosen .shot { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(59, 122, 30, .22); }
.cand.chosen .accept, .cand.chosen .accept:hover { background: var(--ok-soft); border-color: transparent;
                                                   color: var(--ok); box-shadow: none; }
.cand .chosenmark { border-radius: 999px; padding: 2px 8px; font-weight: 500; }
.cand .enhmark, .cand .enhwarn { border-radius: 999px; }
.foundby { text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.posmsg.bad { background: var(--bad-soft); padding: 3px 10px; border-radius: 999px; font-size: 13.5px; }

/* плитки експорту */
.tile { border-color: var(--line); box-shadow: var(--shadow); padding: 8px;
        transition: transform .2s var(--ease), box-shadow .25s var(--ease); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile img { border-radius: 8px; }

/* налаштування: варіант оптимізації - картка, що підсвічується */
.field.pick { border-radius: var(--radius); transition: border-color .2s, box-shadow .2s, background-color .2s; }
.field.pick:hover { border-color: #cfd4db; }
.field.pick:has(input:checked) { border-color: rgba(196, 70, 61, .55); background: #fffafa;
                                 box-shadow: 0 0 0 3px var(--focus); }
.grid { border-radius: var(--radius); overflow: hidden; }
.scroll { border-radius: var(--radius); }

/* вхід */
/* Фон - на всю сторінку, а не на колонку контенту: інакше м'які плями
   обрізаються прямокутником по краю колонки. */
body:has(.gate) {
  background:
    radial-gradient(900px 520px at 10% 0%, rgba(196, 70, 61, .12), transparent 62%),
    radial-gradient(800px 520px at 100% 100%, rgba(60, 73, 95, .12), transparent 62%),
    var(--bg);
  background-attachment: fixed; }
/* body - колонка, а main уже розтягується між шапкою й футером, тож фіксована
   висота тут лише виштовхувала футер за край екрана. */
.gate { min-height: 0; }
body:has(.gate) .foot { margin-top: 0; }
.signin { width: min(420px, 100%); padding: 30px 30px 24px; border-radius: 18px;
          box-shadow: 0 24px 48px rgba(16, 24, 40, .12), 0 4px 10px rgba(16, 24, 40, .05); }
.signin-brand { display: flex; align-items: center; gap: 10px; color: #3a3a3b; }
.signin-brand .brand-logo { height: 40px; }
.signin-brand .brand-word { font-size: 26px; }
.signin-tag { margin: 6px 0 22px; color: var(--dim); font-size: 14px; }
.signin h1 { font-size: 22px; margin-bottom: 4px; }

/* =====================================================================
   Рух. Короткий і лише там, де він щось каже.
   ===================================================================== */

@keyframes zp-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes zp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes zp-spin { to { transform: rotate(360deg); } }
@keyframes zp-gear-in { from { transform: rotate(-150deg); } to { transform: rotate(0deg); } }
@keyframes zp-word { from { opacity: 0; transform: translateX(-8px); letter-spacing: .3em; }
                     to { opacity: 1; transform: none; letter-spacing: .08em; } }
@keyframes zp-pop { 0% { opacity: 0; transform: scale(.5); } 60% { opacity: 1; transform: scale(1.15); }
                    100% { transform: scale(1); } }
@keyframes zp-bump { 0% { transform: scale(1); } 35% { transform: scale(1.25); color: var(--accent); }
                     100% { transform: scale(1); } }
@keyframes zp-stripes { from { background-position: 0 0; } to { background-position: 32px 0; } }
@keyframes zp-run { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@keyframes zp-flash { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes zp-ring { 0% { box-shadow: 0 0 0 0 rgba(59, 122, 30, .45); } 100% { box-shadow: 0 0 0 10px rgba(59, 122, 30, 0); } }

/* шапка при завантаженні: риска росте зліва, шестерня докручується, слово виїжджає */
.top::before { animation: zp-grow .8s var(--ease) both; }
.logo-gear { animation: zp-gear-in 1.1s var(--ease) .1s backwards; transition: transform .7s var(--ease); }
.brand:hover .logo-gear { transform: rotate(120deg); }
.top .brand-word, .signin-brand .brand-word { animation: zp-word .7s var(--ease) .15s backwards; }
/* поки сервер працює - шестерня крутиться, під шапкою біжить смужка */
html.working .top .logo-gear { animation: zp-spin 1.8s linear infinite; }
html.working .top-progress i { animation: zp-run 1.2s var(--ease) infinite; }

/* поява вмісту */
main > * { animation: zp-rise .45s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .04s; }
main > *:nth-child(3) { animation-delay: .08s; }
main > *:nth-child(4) { animation-delay: .12s; }
main > *:nth-child(n+5) { animation-delay: .16s; }
.projects > .project, #list > .pos, .tiles > .tile, .counters > .counter {
  animation: zp-rise .45s var(--ease) both; }
.projects > .project:nth-child(2), #list > .pos:nth-child(2), .tiles > .tile:nth-child(2), .counters > .counter:nth-child(2) { animation-delay: .06s; }
.projects > .project:nth-child(3), #list > .pos:nth-child(3), .tiles > .tile:nth-child(3) { animation-delay: .12s; }
.projects > .project:nth-child(4), #list > .pos:nth-child(4), .tiles > .tile:nth-child(4) { animation-delay: .18s; }
.projects > .project:nth-child(n+5), #list > .pos:nth-child(n+5), .tiles > .tile:nth-child(n+5) { animation-delay: .22s; }
.meter i { animation: zp-grow .9s var(--ease) .25s both; }
.signin { animation: zp-rise .55s var(--ease) both; }

/* відгук на дії */
.status:not([hidden]) { animation: zp-rise .35s var(--ease) both; }
html.working .status .bar i { animation: zp-stripes .9s linear infinite; }
.counter b.bump { animation: zp-bump .55s var(--ease); }
.cand .chosenmark:not([hidden]) { animation: zp-pop .4s var(--ease) both; }
.cand.chosen .shot { animation: zp-ring .7s ease-out; }
.posmsg.flash { animation: zp-flash .3s var(--ease) both; }
.note { animation: zp-rise .4s var(--ease) both; }
/* картка, по якій іде задача: біжить червона риска згори */
.pos.busy { position: relative; overflow: hidden; }
.pos.busy::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 40%;
                    background: linear-gradient(90deg, transparent, var(--accent), transparent);
                    animation: zp-run 1.1s var(--ease) infinite; }

/* Людям, яким рух заважає (системне «зменшити рух»), - статичний інтерфейс. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .top-progress { display: none; }
}
