@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/onest-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; }
/* Один акцент, один радиус (10px для карточек, полей, кнопок; чипы капсулой), две темы по системе. */
:root {
  color-scheme: light dark;
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --text: #19212b;
  --muted: #5a6677;
  --line: #d9dfe7;
  --accent: #1b5ccf;
  --accent-text: #ffffff;
  --ok: #176b3a;
  --ok-bg: #e2f3e8;
  --warn: #8a5a00;
  --warn-bg: #fdf0d2;
  --bad: #a3271f;
  --bad-bg: #fbe5e2;
  --info: #1d4f91;
  --info-bg: #e2ecfa;
  --shadow: 0 1px 2px rgb(25 33 43 / .06), 0 6px 18px rgb(25 33 43 / .05);
  --radius: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151b;
    --surface: #1a2029;
    --surface-2: #151a22;
    --text: #e6eaf0;
    --muted: #9aa6b6;
    --line: #2b3441;
    --accent: #6b9cf2;
    --accent-text: #0b1118;
    --ok: #74d79b;
    --ok-bg: #15301f;
    --warn: #f0c262;
    --warn-bg: #352a0c;
    --bad: #f29a92;
    --bad-bg: #3a1a17;
    --info: #94bcf6;
    --info-bg: #16294a;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 18px rgb(0 0 0 / .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
h3 { font-size: 17px; line-height: 1.35; margin: 0; font-weight: 650; }
.lead { color: var(--muted); margin: 0 0 18px; max-width: 65ch; }
.muted { color: var(--muted); font-size: 14px; }

/* шапка: один ряд; на узких экранах навигация уходит во второй ряд и прокручивается */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 8px 14px; max-width: 1400px; padding-top: 8px; padding-bottom: 8px; min-height: 56px; }
.brand { flex: none; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
header.top nav { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; }
header.top nav::-webkit-scrollbar { display: none; }
nav a { flex: none; color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 9px; border-radius: var(--radius); transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
nav a.active { color: var(--text); background: var(--surface-2); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { nav a:hover { background: var(--surface-2); color: var(--text); } }
.who { flex: none; display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; white-space: nowrap; }
.who a { color: var(--muted); text-decoration: none; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; text-align: center; }
@media (max-width: 1280px) {
  header.top .wrap { flex-wrap: wrap; }
  header.top nav { order: 3; flex-basis: 100%; padding-bottom: 2px; }
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 56px; }

/* карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.row { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
a.card { display: block; text-decoration: none; color: inherit; transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { a.card:hover { border-color: var(--accent); } }
a.card:active { transform: scale(0.99); }
.card.archived { opacity: .6; }

/* пункт чеклиста: полоса статуса слева отделяет вопросы друг от друга */
.item { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; margin: 0 0 22px; box-shadow: var(--shadow); }
.item.on_review { border-left-color: var(--accent); }
.item.accepted { border-left-color: var(--ok); }
.item.returned { border-left-color: var(--bad); }
.item-head { display: flex; gap: 12px; align-items: flex-start; }
.item-head h3 { flex: 1; }
.num { flex: none; min-width: 40px; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font: 600 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: center; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 8px 0 12px 52px; color: var(--muted); font-size: 14px; }
.meta span + span::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 10px; background: var(--line); vertical-align: -1px; }
.item > * + * { margin-top: 12px; }
@media (max-width: 520px) { .meta { margin-left: 0; } .num { display: none; } }

/* текст пунктов и ответы */
.instruction { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 8px 0 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.instruction a, .answer a { font-weight: 600; }
.answer { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin: 10px 0; overflow-wrap: anywhere; }
.sources { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.hint { margin: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 4px; }

/* формы */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 5px; }
input[type=text], input[type=password], select, textarea { width: 100%; padding: 11px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 160ms var(--ease-out); }
input[type=file] { width: 100%; padding: 8px 0; font: inherit; color: var(--text); }
textarea { min-height: 84px; resize: vertical; }
textarea.tall { min-height: 240px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
label.check input { width: auto; }
.verdicts { display: grid; gap: 8px; margin: 8px 0; }
.verdicts label { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface-2); transition: border-color 160ms var(--ease-out); }
.verdicts label:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }

/* кнопки */
button, .btn { display: inline-block; padding: 10px 18px; font: inherit; font-weight: 600; border: 0; border-radius: var(--radius); cursor: pointer; text-decoration: none; background: var(--accent); color: var(--accent-text); transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms var(--ease-out); }
button:active, .btn:active { transform: scale(0.97); }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); } }
button:disabled, button.htmx-request { opacity: .6; cursor: progress; }
button.small { padding: 5px 12px; font-size: 14px; }
.inline { display: inline; margin: 0; }
@media (max-width: 520px) { form button:not(.small), .btn { width: 100%; text-align: center; } }

/* статусы */
.chip { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.chip.todo { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip.answered, .chip.accepted { background: var(--ok-bg); color: var(--ok); }
.chip.on_review { background: var(--info-bg); color: var(--info); }
.chip.returned { background: var(--bad-bg); color: var(--bad); }
.notice { padding: 11px 13px; border-radius: var(--radius); margin: 10px 0; font-size: 15px; overflow-wrap: anywhere; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.info { background: var(--info-bg); color: var(--info); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 14px; }
.progress > span { display: block; height: 100%; background: var(--ok); transition: width 300ms var(--ease-out); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--surface); }
.tabs a.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tabs a.active .badge { background: var(--accent-text); color: var(--accent); }

/* раскрывающиеся блоки */
details > summary { cursor: pointer; color: var(--muted); font-size: 15px; padding: 4px 0; list-style-position: inside; }
details[open] > summary { color: var(--text); font-weight: 600; }
details.ask, details.history, details.resend { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.qa { margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.qa .q { font-weight: 600; }

/* фото и видео */
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.photos img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.photos video { max-width: 100%; border-radius: var(--radius); }
@media (max-width: 520px) { .photos img { width: calc(50% - 4px); height: auto; aspect-ratio: 1; } }

/* история */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline li.staff { border-left-color: var(--accent); }
.timeline .when { color: var(--muted); font-size: 13px; }
.timeline .photos img { width: 72px; height: 72px; }

/* прочее */
.secret { font: 600 20px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .05em; padding: 8px 0; user-select: all; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* страницы администратора: шире и плотнее */
.wrap.wide { max-width: 1100px; }
.page-head { display: flex; gap: 12px 28px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .lead { margin-bottom: 0; }
.chain { display: flex; gap: 6px; flex-wrap: wrap; }
.chain-step { padding: 3px 11px; border-radius: 999px; font-size: 13px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chain-step.on { color: var(--text); background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.grid2 .card { margin-bottom: 0; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.card.compact { padding: 14px 16px; }
.card.compact label { margin: 10px 0 4px; font-size: 13px; }
.card.compact input[type=text], .card.compact input[type=password], .card.compact select { padding: 8px 10px; }
.card.compact details { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.card.compact .muted { margin: 6px 0 0; font-size: 13px; }
.row.actions { margin-top: 14px; }
.key-line { margin-top: 6px; }
.small-check { margin: 0 !important; font-size: 13px !important; }
.prices > div { flex: 1; min-width: 150px; }
.flags { display: grid; gap: 2px; margin-top: 4px; }
table.tight td, table.tight th { padding: 6px 6px; font-size: 14px; }

/* мастера */
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 4px 0 18px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.stepper .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper li.current { color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 2px var(--accent); }
.stepper li.current .n { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.stepper li.done .n { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.step-title { margin: 0 0 8px; font-size: 19px; }
.choices { display: grid; gap: 10px; margin: 10px 0; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .choices.three { grid-template-columns: 1fr; } }
.choice { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; font-weight: 400; transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.choice input { width: auto; margin-top: 4px; }
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.row.actions.wizard { flex-direction: row-reverse; justify-content: flex-end; margin-top: 18px; }
table.summary th { width: 140px; color: var(--muted); font-weight: 600; }
.row-bad td { background: var(--bad-bg); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.mono, textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.secret-cell { font: 600 15px/1.4 ui-monospace, Consolas, monospace; user-select: all; }
button.danger { background: var(--bad); color: #fff; }
.danger-zone { margin-top: 28px; padding-top: 10px; border-top: 1px solid var(--line); }
.item.preview { margin-bottom: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* аккуратная типографика и ровные ряды */
h1, h2, h3, .step-title { text-wrap: balance; }
p, li, .lead, .muted { text-wrap: pretty; }
h1 { font-size: 28px; letter-spacing: -0.015em; }
.card > .muted { margin: 4px 0; }
.card > .row:last-child:not(.between) { margin-top: 14px; }
.card .row .btn.secondary, .card .row button.secondary { padding: 6px 14px; font-size: 14px; }
.card .chip { vertical-align: 1px; }
.grid2 { align-items: stretch; }
.grid2 > .card { display: flex; flex-direction: column; }
.grid2 > .card > .muted:empty { display: none; }
.link-card .about { min-height: 2.9em; margin: 4px 0 6px; }
.link-card .stat { margin: 6px 0 10px; }
.link-card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 14px; }
.link-card .actions > :first-child { grid-column: 1 / -1; }
.link-card .actions > * { width: 100%; text-align: center; padding: 8px 12px; font-size: 14px; }

a.chip { text-decoration: none; }

/* выбор подразделений для роли */
.role-deps { margin-bottom: 12px; }
.role-deps > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text); font-size: 16px; padding: 4px 0; cursor: pointer; }
.dep-filter { display: block; width: 100%; margin: 10px 0 8px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.dep-list.short { max-height: 200px; }
.dep-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
.dep { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 7px 10px; border-radius: 8px; font-weight: 500; font-size: 15px; cursor: pointer; }
.dep input { width: auto; margin-top: 4px; flex: none; }
.dep small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.35; }
.dep:has(input:checked) { background: var(--info-bg); }
.dep[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .dep:hover { background: var(--surface-2); } }
.hint { font-style: normal; font-size: 12px; font-weight: 650; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.people { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.people li { font-size: 14.5px; line-height: 1.35; }
.people small { display: block; color: var(--muted); font-size: 12.5px; }
