@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; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500 800; font-display: swap; src: url(/static/fonts/unbounded-cyrillic.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: 500 800; font-display: swap; src: url(/static/fonts/unbounded-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; }
/* «Бенто и объём»: светлые плитки с мягкой цветной тенью, один синий акцент, бирюза для успеха,
   коралл для просрочек. Радиусы: 20px плитки, 12px поля и кнопки, капсула для чипов. */
:root {
  color-scheme: light dark;
  --bg: #e8ebf1;
  --surface: #ffffff;
  --surface-2: #f3f5f9;
  --text: #121826;
  --muted: #5b6577;
  --line: #dce1e9;
  --accent: #3056e8;
  --accent-text: #ffffff;
  --accent-2: #11a37f;
  --hot: #e2553f;
  --ok: #127a48;
  --ok-bg: #dff4e8;
  --warn: #8a5800;
  --warn-bg: #fcefd0;
  --bad: #b0281e;
  --bad-bg: #fde4e0;
  --info: #1d4f91;
  --info-bg: #e2ecfa;
  --shadow: 0 1px 1px rgb(18 24 38 / .04), 0 8px 18px -6px rgb(18 24 38 / .12), 0 26px 50px -24px rgb(48 86 232 / .28);
  --shadow-sm: 0 1px 1px rgb(18 24 38 / .04), 0 4px 10px -4px rgb(18 24 38 / .12);
  --radius: 12px;
  --radius-lg: 20px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f15;
    --surface: #161b25;
    --surface-2: #1b212d;
    --text: #e8ecf3;
    --muted: #97a1b2;
    --line: #262e3c;
    --accent: #7e9bff;
    --accent-text: #0b1220;
    --accent-2: #3fd0a5;
    --hot: #ff7a63;
    --ok: #74d79b;
    --ok-bg: #15301f;
    --warn: #f0c262;
    --warn-bg: #352a0c;
    --bad: #f29a92;
    --bad-bg: #3a1a17;
    --info: #94bcf6;
    --info-bg: #16294a;
    --shadow: 0 1px 1px rgb(0 0 0 / .3), 0 10px 24px -8px rgb(0 0 0 / .6), 0 26px 50px -26px rgb(126 155 255 / .35);
    --shadow-sm: 0 1px 1px rgb(0 0 0 / .3), 0 4px 12px -4px rgb(0 0 0 / .5);
  }
}
* { 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: 700 26px/1.2 var(--display); letter-spacing: -0.02em; margin: 0 0 8px; }
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; }

/* каркас: боковое меню для сотрудников; на узких экранах оно становится верхней полосой */
.shell { min-height: 100vh; }
.shell.with-side { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); scrollbar-width: thin; }
.brand { flex: none; font: 700 15px/1.2 var(--display); letter-spacing: -0.01em; color: var(--text); text-decoration: none; white-space: nowrap; padding: 4px 10px 16px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .group { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
nav a { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: 10px; font-size: 15px; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out); }
nav a.active { color: var(--text); background: var(--surface-2); font-weight: 650; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
nav a:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { nav a:hover { background: var(--surface-2); color: var(--text); } }
.who { margin-top: auto; padding: 14px 10px 0; display: grid; gap: 8px; font-size: 14px; border-top: 1px solid var(--line); }
.who a { color: var(--muted); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who form button { width: 100%; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
header.top .brand { padding: 0; }
@media (max-width: 900px) {
  .shell.with-side { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0; }
  .side nav { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side .group { display: none; }
  .who { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; }
  .who form button { width: auto; }
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; }
.with-side main.wrap { padding-left: 28px; padding-right: 28px; }
@media (max-width: 900px) { .with-side main.wrap { padding-left: 16px; padding-right: 16px; } }

/* карточки */
.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, form.htmx-request button[type=submit] { opacity: .6; cursor: progress; }
.upload { display: grid; gap: 4px; margin-top: 10px; }
.upload[hidden] { display: none; }
.upload progress { width: 100%; height: 8px; accent-color: var(--accent); }
.hx-error { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.hx-error button { padding: 6px 12px; font-size: 14px; }
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, .chip.na { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip.na { font-weight: 600; }
.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); }
.notice.na { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.item.na { border-left-color: var(--line); }
.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; }
.table-scroll { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* мастера */
.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: var(--bad-bg); }
.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; }

/* ================= Бенто и объём ================= */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* плитки: карточки, пункты и формы получают объём */
.card, .item { border-radius: var(--radius-lg); box-shadow: var(--shadow); border-color: var(--line); }
.item { border-left-width: 1px; position: relative; overflow: hidden; }
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.item.on_review::before { background: var(--accent); }
.item.accepted::before { background: var(--accent-2); }
.item.returned::before { background: var(--hot); }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea { border-radius: var(--radius); }
input[type=number], input[type=email] { width: 100%; padding: 11px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.instruction, .qa, .notice, .verdicts label, .choice, .dep-list, .dep-filter { border-radius: var(--radius); }
.photos img { border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .photos a:hover img { transform: translateY(-2px) rotate(-1deg); } }
button, .btn { border-radius: var(--radius); }
button:not(.secondary):not(.danger), .btn:not(.secondary) { box-shadow: 0 6px 16px -8px rgb(48 86 232 / .7); }
.chip { padding: 3px 11px; }
.chip.accepted, .chip.answered { background: color-mix(in oklab, var(--accent-2) 16%, var(--surface)); color: color-mix(in oklab, var(--accent-2) 70%, var(--text)); }
.chip.returned { background: color-mix(in oklab, var(--hot) 15%, var(--surface)); color: color-mix(in oklab, var(--hot) 80%, var(--text)); }
.progress { height: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.progress > span { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: inherit; transition: width 900ms var(--ease-out); }
a.card { transition: border-color 160ms var(--ease-out), box-shadow 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { a.card:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); } }
.tabs a { border-radius: 99px; transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.tabs a:active { transform: scale(0.97); }
.tabs a.active { box-shadow: 0 6px 16px -8px rgb(48 86 232 / .7); }

/* 3D-наклон с бликом: только мышь; на телефоне и при отключённых анимациях плитка неподвижна */
.tilt { position: relative; transform-style: preserve-3d; transition: transform 500ms var(--ease-out), box-shadow 300ms var(--ease-out); will-change: transform; }
.tilt.live { transition: transform 90ms linear, box-shadow 300ms var(--ease-out); }
.tilt .glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgb(255 255 255 / .55), transparent 55%); mix-blend-mode: soft-light; opacity: 0; transition: opacity 200ms ease; }
.tilt.live .glare { opacity: 1; }

/* бенто-сетка и плитки с цифрами */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.bento > * { margin: 0; min-width: 0; }
.bento .w2 { grid-column: span 2; } .bento .w3 { grid-column: span 3; } .bento .w4 { grid-column: span 4; } .bento .w6 { grid-column: 1 / -1; }
@media (max-width: 720px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento .w2 { grid-column: span 1; } .bento .w3, .bento .w4 { grid-column: 1 / -1; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; display: block; color: inherit; text-decoration: none; }
.tile h6, .eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.big-num { font: 800 34px/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-num small { font: 600 13px/1 "Onest", system-ui, sans-serif; color: var(--accent-2); margin-left: 6px; letter-spacing: 0; }
.big-num.hot { color: var(--hot); }
.hot-ring { position: relative; }
.hot-ring::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang), var(--hot), transparent 30% 70%, var(--hot));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: oso-spin 2.4s linear infinite; }
@keyframes oso-spin { to { --ang: 360deg; } }

/* карточка очереди: миниатюра, название, сколько ждёт */
a.card.qcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.qthumb { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(140deg, color-mix(in oklab, var(--accent) 35%, var(--surface)), var(--accent)); color: var(--accent-text); font: 700 13px var(--display); box-shadow: var(--shadow-sm); }
.qthumb img { width: 100%; height: 100%; object-fit: cover; }
.qthumb.mark { background: linear-gradient(140deg, color-mix(in oklab, var(--accent-2) 35%, var(--surface)), var(--accent-2)); }
.qcard strong { display: block; line-height: 1.3; }
.qcard .sub { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.qcard .when { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.queue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.queue-grid > .card { margin: 0; }
@media (max-width: 760px) { .queue-grid { grid-template-columns: minmax(0, 1fr); } }

/* герой страницы франчайзи */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; align-items: center; padding: 20px; margin-bottom: 18px; }
.hero .big-num { font-size: 48px; }
.hero .of { color: var(--muted); font-size: 14px; }
.hero .progress { margin: 6px 0 0; }
.hero .counts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* стопка заданий франчайзи: сверху текущее, следующие выглядывают снизу */
.deck-nav { display: grid; gap: 10px; margin: 4px 0 12px; }
.deck-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.deck-row[hidden] { display: none; }
.deck-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.deck-tools .search { margin: 0; }
.deck-tools input[type=search] { width: 100%; padding: 10px 14px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; box-shadow: var(--shadow-sm); }
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { padding: 6px 14px; font-size: 14px; border-radius: 99px; background: transparent; color: var(--muted); box-shadow: none; width: auto; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
@media (max-width: 520px) { .deck-tools { grid-template-columns: minmax(0, 1fr); } .seg { display: flex; } .seg button { flex: 1; } }
.toc > summary { color: var(--muted); font-size: 14px; }
.toc ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 46vh; overflow: auto; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li[hidden] { display: none; }
.toc a { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; }
.toc a::before { content: counter(toc); font: 600 12px/1 ui-monospace, Consolas, monospace; color: var(--muted); }
.toc a .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc a .chip { font-size: 11px; padding: 2px 8px; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { background: var(--surface-2); } }
.deck.list > .item[hidden] { display: none; }
.deck.list > .item { scroll-margin-top: 12px; }
.item.flash { box-shadow: 0 0 0 3px var(--accent), var(--shadow); transition: box-shadow 300ms var(--ease-out); }
.deck-nav .dots { display: flex; gap: 6px; flex-wrap: wrap; }
.deck-nav .dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; background: var(--line); box-shadow: none; transition: width 300ms var(--ease-out), background-color 300ms ease; }
.deck-nav .dots button[aria-current="true"] { width: 24px; background: var(--accent); }
.deck-nav .arrows { display: flex; gap: 6px; }
.deck-nav .arrows button { padding: 6px 12px; }
.deck.on { position: relative; }
.deck.on > .item { position: absolute; inset: 0 0 auto 0; height: 100%; margin: 0; transform-origin: 50% 0; transition: transform 520ms var(--ease-drawer), opacity 420ms var(--ease-drawer), visibility 0s linear 520ms; visibility: hidden; opacity: 0; pointer-events: none; }
.deck.on > .item[data-pos="0"], .deck.on > .item:not([data-pos]) { position: relative; height: auto; z-index: 3; visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; transform: none; }
.deck.on > .item[data-pos="1"] { z-index: 2; visibility: visible; opacity: .85; transform: translateY(16px) scale(.95); transition-delay: 0s; }
.deck.on > .item[data-pos="2"] { z-index: 1; visibility: visible; opacity: .5; transform: translateY(32px) scale(.9); transition-delay: 0s; }
.deck.on > .item[data-pos="-1"] { transform: translateY(-36px) rotateX(16deg) scale(.96); }
.deck.on > .item:not([data-pos="0"]) > * { visibility: hidden; }
.deck.on { margin-bottom: 34px; perspective: 1000px; }
.done-list > summary { font-weight: 650; color: var(--text); }
.done-list .item { margin-top: 14px; }

/* появление страницы: лёгкий подъём содержимого */
main.wrap > * { animation: oso-rise 420ms var(--ease-out) both; }
main.wrap > *:nth-child(2) { animation-delay: 40ms; } main.wrap > *:nth-child(3) { animation-delay: 80ms; } main.wrap > *:nth-child(4) { animation-delay: 120ms; } main.wrap > *:nth-child(n+5) { animation-delay: 160ms; }
@keyframes oso-rise { from { transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .tilt { transform: none !important; } main.wrap > * { animation: none; } .hot-ring::after { animation: none; } }
.item-head { flex-wrap: wrap; }
.item-head h3 { min-width: 0; flex: 1 1 60%; overflow-wrap: break-word; }

/* карточка проверки: слева ответ франчайзи, справа решение (прилипает при прокрутке) */
.review-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.review-split.single { grid-template-columns: minmax(0, 1fr); }
.review-split > .card { margin: 0; }
.review-split .decision { position: sticky; top: 16px; }
.verdicts.big label { padding: 14px 16px; font-weight: 600; }
.verdicts.big label:has(input:checked) { box-shadow: 0 10px 24px -14px rgb(18 24 38 / .5); }
.verdicts.big .v-ok:has(input:checked) { border-color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 14%, var(--surface)); }
.verdicts.big .v-note:has(input:checked) { border-color: var(--warn); background: var(--warn-bg); }
.verdicts.big .v-na:has(input:checked) { border-color: var(--muted); background: var(--surface-2); }
.verdicts label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.verdicts.big .v-bad:has(input:checked) { border-color: var(--hot); background: color-mix(in oklab, var(--hot) 12%, var(--surface)); }
@media (max-width: 860px) { .review-split { grid-template-columns: minmax(0, 1fr); } .review-split .decision { position: static; } }

/* страница прохождения: пункты компактными строками с цветной полосой */
.item-rows { display: grid; gap: 8px; margin-top: 16px; }
.item-rows > .card { margin: 0; padding: 12px 16px 12px 20px; border-radius: 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.item-rows > .card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.item-rows > .card.on_review::before { background: var(--accent); }
.item-rows > .card.accepted::before { background: var(--accent-2); }
.item-rows > .card.returned::before { background: var(--hot); }

/* вход: одна плитка по центру */
.login-wrap { max-width: 420px; margin: 8vh auto 0; }
.login-wrap h1 { text-align: center; }
.login-wrap .lead { text-align: center; margin-inline: auto; }
.login-wrap button { width: 100%; }

/* решение: подсказки, отмена, прежние решения */
.undo { align-items: center; }
.undo button { flex: none; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
.chip-btn { padding: 3px 11px; font-size: 13px; font-weight: 600; border-radius: 99px; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .chip-btn:hover { background: var(--info-bg); } }
.keys kbd { font: 600 12px ui-monospace, Consolas, monospace; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.similar { margin-top: 12px; }
.similar-row { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.similar-row .photos img { width: 84px; height: 84px; }

/* контраст границ полей и переключателей не ниже 3:1 */
:root { --line-strong: #8d98aa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --line-strong: #5b677a; } }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=search], select, textarea { border-color: var(--line-strong); }
.deck-nav .dots button { background: var(--line-strong); }
.deck-nav .dots button[aria-current="true"] { background: var(--accent); }
.live-notice { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; position: sticky; top: 8px; z-index: 5; box-shadow: var(--shadow); }
@media (pointer: coarse) {
  .deck-nav .arrows button, .seg button, .chip-btn, button.small { min-height: 44px; }
  .deck-nav .dots button { width: 12px; height: 12px; }
  .deck-nav .dots button[aria-current="true"] { width: 28px; }
}
@media print {
  .side, header.top, .deck-nav, .deck-tools, form button, .upload, .glare, nav.tabs, .live-notice, #live { display: none !important; }
  body, .shell { background: #fff; color: #000; display: block; }
  main.wrap, .wrap { max-width: none; padding: 0; }
  .card, .item, .tile { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .deck.on { display: block; margin: 0; perspective: none; }
  .deck.on > .item, .deck.on > .item[data-pos] { position: static; visibility: visible; opacity: 1; transform: none; margin: 0 0 12px; pointer-events: auto; }
  .deck.on > .item:not([data-pos="0"]) > * { visibility: visible; }
  .hot-ring::after, main.wrap > * { animation: none; }
  details > summary { list-style: none; }
  details:not([open]) > *:not(summary) { display: block; }
}
.with-side main.wrap { width: 100%; }  /* колонка сетки не должна сжиматься по содержимому */

/* страницы настроек: ряд чипов, панель кнопок, узкая форма, вложенная сетка полей */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toolbar { margin: 0 0 16px; }
.narrow { max-width: 520px; }
.grid2.inner { margin-bottom: 0; gap: 0 12px; align-items: start; }
.card .row.between > .chip { flex: none; }
@media (max-width: 720px) { .bento > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }  /* одинокая плитка на телефоне занимает всю строку */

/* данные заявки (поля карточки Битрикса): список «подпись: значение» и строка под заголовком */
.request-fields dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px 18px; margin: 6px 0 0; }
.request-fields dt { color: var(--muted); font-size: 14px; }
.request-fields dd { margin: 0; overflow-wrap: anywhere; }
.request-line { margin: -10px 0 16px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .request-fields dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .request-fields dd { margin-bottom: 8px; } }
