:root {
  color-scheme: light;
  --ground: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --surface-hover: #f7f9fa;
  --line: #e0e7e9;
  --line-strong: #bfcdd0;
  --ink: #1b3037;
  --ink-2: #465c64;
  --ink-3: #5b6f77;
  --accent: #0a6f79;
  --accent-hover: #075c65;
  --accent-soft: #e6f2f3;
  --on-accent: #ffffff;
  --good: #27714d;
  --warn: #856216;
  --serious: #a04e26;
  --critical: #b23e42;
  --good-soft: #e8f3ec;
  --warn-soft: #faf2dd;
  --serious-soft: #fbede4;
  --critical-soft: #fae9ea;
  --radius: 12px;
  --sidebar-width: 212px;
  --header-height: 76px;
  --z-navigation: 20;
  --z-header: 30;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #121b1f;
    --surface: #1a262b;
    --surface-2: #243238;
    --surface-hover: #1e2e34;
    --line: #304149;
    --line-strong: #52666f;
    --ink: #e4edef;
    --ink-2: #becdd2;
    --ink-3: #96adb6;
    --accent: #79c7ce;
    --accent-hover: #9adbe0;
    --accent-soft: #223e45;
    --on-accent: #10292e;
    --good: #93d3ae;
    --warn: #e7c775;
    --serious: #f0b085;
    --critical: #f1a0a5;
    --good-soft: #203b2f;
    --warn-soft: #3d3521;
    --serious-soft: #432f27;
    --critical-soft: #432b32;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.025em; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
h3 { font-size: 17px; line-height: 1.4; letter-spacing: -.012em; font-weight: 650; margin: 0 0 18px; }
h4 { font-size: 13px; font-weight: 600; margin: 24px 0 8px; color: var(--ink-2); }
p { margin: 0 0 12px; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
.page { width: 100%; max-width: 1660px; margin: 0 auto; padding: 32px 36px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; }
.page > h1 + p { margin-top: -14px; }
.page > p { margin-bottom: 0; }
.page > .filters + p { margin-top: -12px; }
.topbar { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -.025em; }
.brand:hover { color: var(--ink); }
.brand-mark { display: block; width: 34px; height: 34px; color: var(--accent); }
.brand-name { display: flex; align-items: baseline; gap: 8px; }
.brand-tag { color: var(--ink-3); font-size: 11px; font-weight: 550; letter-spacing: .02em; }
.userbox { display: flex; align-items: center; justify-content: flex-end; gap: 20px; min-width: 0; font-size: 13px; }
.userbox form { margin: 0; }
.userbox .uname { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-2); font-weight: 600; overflow-wrap: anywhere; }
.userbox .linkbtn { color: var(--ink-3); padding: 6px 0; }
.stamp { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; font-size: 12px; padding: 5px 10px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stamp::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.stamp.stale { background: var(--warn-soft); color: var(--warn); }
.stamp.stale::before { background: currentColor; }
.nav { display: flex; background: var(--surface); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink-2); font-size: 14px; border-radius: 8px; font-weight: 500; transition: background-color .16s ease-out, color .16s ease-out; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.ico { display: inline-flex; flex: 0 0 20px; width: 20px; height: 20px; align-items: center; justify-content: center; }
.ico svg { display: block; width: 20px; height: 20px; }
@media (min-width: 1100px) {
  .signed-in { padding-top: var(--header-height); padding-left: var(--sidebar-width); }
  .signed-in .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-header); height: var(--header-height); }
  .nav { position: fixed; left: 0; top: var(--header-height); bottom: 0; width: var(--sidebar-width); flex-direction: column; gap: 6px; padding: 30px 16px; border-right: 1px solid var(--line); z-index: var(--z-navigation); overflow-y: auto; }
  .nav::before { content: "Рабочее пространство"; color: var(--ink-3); font-size: 11px; font-weight: 500; padding: 0 14px 12px; }
  .userbox .uname::before { content: ""; width: 28px; height: 28px; border-radius: 50%; background-color: var(--accent-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28' fill='none' stroke='%230a6f79' stroke-width='1.5'%3E%3Ccircle cx='14' cy='10.5' r='3'/%3E%3Cpath d='M8.5 21v-1.5a5.5 5.5 0 0 1 11 0V21'/%3E%3C/svg%3E"); flex-shrink: 0; }
}
.flash { margin: 24px 36px 0; padding: 13px 16px; background: var(--good-soft); border-radius: 8px; color: var(--good); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.error { color: var(--critical); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; line-height: 1.55; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card > p { max-width: 80ch; }
.card > .table-wrap + p, .card > form + p { margin-top: 16px; }
.card.narrow { width: 100%; max-width: 420px; margin: 48px auto; padding: 32px; }
.card.narrow h1 { margin-bottom: 24px; }
.signed-out .page { min-height: calc(100svh - var(--header-height)); align-content: center; padding-bottom: 100px; }
.signed-out .card.narrow { margin: 0 auto; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.inline { display: inline; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); min-width: 0; }
input, select, button, textarea { font: inherit; }
input:not([type=checkbox]):not([type=file]), select, textarea { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); width: 100%; min-width: 0; transition: border-color .16s ease-out, background-color .16s ease-out; }
input:not([type=checkbox]):not([type=file]), select { min-height: 42px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input[type=checkbox] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); flex: 0 0 16px; }
input[type=file] { width: 100%; min-width: 0; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--ground); font-size: 13px; }
input::file-selector-button { padding: 8px 12px; margin-right: 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
textarea { line-height: 1.6; resize: vertical; }
a:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.45; text-align: center; transition: background-color .16s ease-out, border-color .16s ease-out, color .16s ease-out; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn:active { background: var(--line); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.btn[disabled], input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.linkbtn:hover { color: var(--accent-hover); text-decoration: underline; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; color: var(--ink-2); white-space: nowrap; font-size: 13px; transition: background-color .16s ease-out, color .16s ease-out; }
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs a b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs a.on b { background: var(--surface); color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters input:not([type=checkbox]):not([type=hidden]), .filters select { width: auto; flex: 1 1 140px; font-size: 13px; }
.filters > input[name=q]:not([type=hidden]) { flex: 1.6 1 190px; }
.filters .btn { min-height: 42px; }
.filters .check { display: flex; align-items: center; gap: 8px; flex-direction: row; font-size: 12px; white-space: nowrap; }
.filters .check input { margin: 0; }
.tasklist { display: grid; gap: 16px; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 9px; min-width: 0; scroll-margin-top: 100px; }
.task-head { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; min-width: 0; }
.task-client { color: var(--ink); font-weight: 650; font-size: 17px; line-height: 1.4; letter-spacing: -.012em; overflow-wrap: anywhere; }
.task-client:hover { color: var(--accent); text-decoration: underline; }
.task-head > .task-client { margin-right: 5px; }
.task-title { font-weight: 500; overflow-wrap: anywhere; }
.task-details { max-width: 110ch; overflow-wrap: anywhere; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 6px; }
.act summary { list-style: none; }
.act summary::-webkit-details-marker { display: none; }
.act[open] { flex-basis: 100%; }
.act[open] > summary { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.act[open] > form { margin-top: 12px; padding: 18px; background: var(--ground); border-radius: 8px; }
.act .stack { max-width: 640px; }
.chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 5px; font-size: 11px; line-height: 1.5; font-weight: 550; background: var(--surface-2); color: var(--ink-2); }
.chip.prio { background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.prio-p1 .chip.prio { background: var(--critical-soft); color: var(--critical); }
.prio-p2 .chip.prio { background: var(--serious-soft); color: var(--serious); }
.prio-p3 .chip.prio { background: var(--warn-soft); color: var(--warn); }
.chip.freshchip { background: var(--accent-soft); color: var(--accent); }
.chip.done { background: var(--good-soft); color: var(--good); }
.chip.critical, .chip.ladder-СТОП { background: var(--critical-soft); color: var(--critical); }
.chip.ladder-Обещание { background: var(--serious-soft); color: var(--serious); }
.chip.ladder-Напомнить { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.list { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list:empty { border: 0; }
.row-card { display: flex; gap: 20px; padding: 18px 22px; color: var(--ink); align-items: center; border-bottom: 1px solid var(--line); transition: background-color .16s ease-out; }
.row-card:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.row-card:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.row-card:only-child { border-radius: var(--radius); }
.row-card:hover { background: var(--surface-hover); color: var(--ink); }
.row-card .name { font-weight: 600; font-size: 15px; margin-bottom: 4px; overflow-wrap: anywhere; }
.row-card:hover .name { color: var(--accent); }
.row-card .right { text-align: right; display: grid; gap: 5px; justify-items: end; flex-shrink: 0; }
.row-card .right .num { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 8px; }
.tile { padding: 0 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.tile + .tile { border-left: 1px solid var(--line); }
.tile .label, .label { font-size: 12px; line-height: 1.5; color: var(--ink-3); font-weight: 500; }
.tile .label { min-height: 36px; }
.tile .value { font-size: 26px; font-weight: 650; letter-spacing: -.035em; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile.critical .value { color: var(--critical); }
.tile .note { font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.line { display: flex; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.line:last-child { border-bottom: 0; padding-bottom: 0; }
.line > a { color: var(--ink); font-weight: 500; }
.line > a:hover { color: var(--accent); text-decoration: underline; }
.aging { display: flex; flex-wrap: wrap; gap: 7px; }
.table-wrap { overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }
.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; line-height: 1.5; }
.tbl th, .tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { background: var(--ground); color: var(--ink-3); font-size: 11px; font-weight: 550; line-height: 1.45; }
.tbl th:first-child { border-radius: 6px 0 0 6px; }
.tbl th:last-child { border-radius: 0 6px 6px 0; }
.tbl td:first-child { font-weight: 500; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-hover); }
.tbl .num { text-align: right; }
.tbl th.num { white-space: normal; }
.tbl .num .small { font-size: 11px; }
.tbl td.num > .small { display: block; margin-top: 2px; }
.tbl .bad, .tbl tr.bad td { color: var(--critical); }
.tbl .bad { font-weight: 600; }
.tbl .act { min-width: 80px; }
.tbl .act[open] { min-width: 280px; }
.chart-wrap { overflow-x: auto; }
.mchart { display: block; width: 100%; min-width: 540px; height: auto; }
.mchart .bar.y1 { fill: var(--line-strong); }
.mchart .bar.y2 { fill: var(--accent); }
.mchart .axis { fill: var(--ink-3); font-size: 11px; }
.legend { display: inline-flex; align-items: center; gap: 7px; margin-right: 18px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; background: var(--line-strong); }
.legend i.y2 { background: var(--accent); }
.client-head { display: grid; gap: 7px; }
.client-head + .kpis .tile .value { font-size: 22px; letter-spacing: -.025em; }
.client-head > .row { margin-top: 6px; }
.log { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.6; background: var(--ground); padding: 16px; border-radius: 8px; max-height: 260px; overflow: auto; }
code { font-size: 12px; word-break: break-all; }
.contact-form { display: grid; gap: 0; margin-top: 6px; padding: 0; border-top: 1px solid var(--line); }
.subtask { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 195px); gap: 16px; padding: 13px 0; align-items: center; border-bottom: 1px solid var(--line); }
.subtask .check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.subtask .check span { min-width: 0; overflow-wrap: anywhere; }
.subtask .check b { color: var(--ink); font-weight: 600; }
.subtask select { width: 100%; min-height: 36px; padding: 7px 9px; font-size: 12px; }
.contact-form > .row { margin-top: 16px; }
.row > select { width: auto; flex: 0 1 180px; }
.row > input.grow { width: auto; flex: 1 1 180px; }
.contact-form > .row .btn { min-height: 42px; }
.tasklist.compact { gap: 0; }
.compact .task { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 20px 0; }
.compact .task:first-child { padding-top: 0; }
.compact .task:last-child { border-bottom: 0; padding-bottom: 0; }
.check-card { display: grid; gap: 10px; }
.check-card.stop { border-color: var(--critical); }
.check-card .line { padding-top: 4px; }
/* --- разведка по точке ------------------------------------------------------------------- */
.acc > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary h3 { margin: 0; }
.acc > summary::after { content: "развернуть"; color: var(--ink-3); font-size: 12px; margin-left: auto; }
.acc[open] > summary::after { content: "свернуть"; }
.acc[open] > summary { margin-bottom: 18px; }
.cats { display: grid; gap: 0; }
.cat { border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.cat:last-child { border-bottom: 0; }
.cat > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 14px 0; min-height: 44px; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary:hover .cat-name { color: var(--accent); }
.cat-name { font-weight: 600; font-size: 15px; }
.cat-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.catform { padding: 4px 0 18px; }
.scoutrow { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.scoutrow.whole { background: var(--ground); border-radius: 8px; padding: 14px; border-top: 0; margin-bottom: 6px; }
.scoutrow.filled { border-left: 3px solid var(--accent); padding-left: 11px; }
.scoutrow-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.scoutrow-name { font-weight: 550; overflow-wrap: anywhere; }
.scoutrow.whole .scoutrow-name { font-weight: 700; letter-spacing: .02em; font-size: 12px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
/* пилюли: radio и checkbox скрыты, кликается подпись — палец попадает всегда */
.seg, .tags, .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.seg label, .tags label, .presets label { display: block; margin: 0; }
.seg input, .tags input, .presets input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span, .tags span, .presets span { display: flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 550; text-align: center; cursor: pointer;
  transition: background-color .16s ease-out, border-color .16s ease-out, color .16s ease-out; }
.seg.tight span { min-height: 38px; padding: 6px 10px; font-size: 12px; }
.seg span:hover, .tags span:hover, .presets span:hover { border-color: var(--ink-3); }
.seg input:checked + span, .presets input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tags input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tags.good input:checked + span { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.tags.bad input:checked + span { background: var(--critical-soft); border-color: var(--critical); color: var(--critical); }
.seg input:focus-visible + span, .tags input:focus-visible + span, .presets input:focus-visible + span {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.taggroup { display: grid; gap: 8px; }
.check.big { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--ink); }
.check.big input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }
.more { margin-top: 2px; }
.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; color: var(--accent); font-size: 13px; }
.more > summary::-webkit-details-marker { display: none; }
.more-body { display: grid; gap: 14px; padding: 14px; margin-top: 8px; background: var(--ground); border-radius: 8px; }
.savebar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; display: flex;
  padding-top: 14px; }
.savebar .btn { min-height: 48px; box-shadow: 0 4px 16px rgba(0, 0, 0, .16); }
.finishbar { display: flex; }
.finishbar .btn { min-height: 52px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 16px; }
.thumbs figure { margin: 0; display: grid; gap: 5px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.thumbs figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.thumbs form { margin: 0; }
.draft-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 11px 14px;
  background: var(--warn-soft); color: var(--warn); border-radius: 8px; font-size: 13px; }
.draft-note .btn { min-height: 34px; padding: 6px 11px; font-size: 12px; }
/* плашка очереди — липкая СВЕРХУ внутри страницы, а не поверх экрана:
   снизу уже стоят кнопка «Сохранить» и таб-панель, а сверху на телефоне — шапка с «Выйти»,
   и накрывать их плашкой нельзя. Скрипт вставляет её первым элементом в .page. */
.queue-bar { position: sticky; top: 8px; z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px;
  background: var(--serious-soft); color: var(--serious); border: 1px solid var(--serious); border-radius: 10px;
  font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.queue-bar .btn { min-height: 40px; }
.queue-bar .close { margin-left: 4px; border: 0; background: none; color: inherit; font-size: 20px; line-height: 1;
  cursor: pointer; min-height: 40px; min-width: 40px; }
@media (min-width: 1100px) { .queue-bar { top: calc(var(--header-height) + 12px); } }
@media (min-width: 760px) and (max-width: 1099px) {
  .page { padding: 28px 24px 48px; }
  .nav { padding: 10px 18px; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav a { flex: 1 0 auto; justify-content: center; font-size: 13px; gap: 8px; padding: 9px 12px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 0; }
  .tile:nth-child(3n + 1) { border-left: 0; }
  .flash { margin-left: 24px; margin-right: 24px; }
}
@media (min-width: 1100px) and (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 0; }
  .tile:nth-child(3n + 1) { border-left: 0; }
}
@media (max-width: 759px) {
  :root { --header-height: 68px; }
  html { scroll-padding-top: 16px; }
  .signed-in { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .page { padding: 24px 16px 32px; gap: 20px; }
  h1 { font-size: 25px; }
  h3 { font-size: 16px; margin-bottom: 16px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 12px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-name { gap: 6px; }
  .userbox { gap: 14px; flex-wrap: wrap; justify-content: flex-start; }
  .userbox .uname { font-size: 12px; }
  .userbox .linkbtn { min-height: 32px; }
  .stamp { font-size: 11px; padding: 4px 8px; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); z-index: var(--z-navigation); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .nav a { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 5px; padding: 8px 2px; min-height: 54px; font-size: 10px; border-radius: 7px; }
  .nav .ico, .nav .ico svg { width: 19px; height: 19px; flex-basis: 19px; }
  .flash { margin: 16px 16px 0; font-size: 13px; }
  .card { padding: 20px; }
  .card.narrow { padding: 26px 22px; margin: 20px auto; }
  .tabs { margin-right: -16px; padding-right: 16px; }
  .tabs a { min-height: 42px; padding: 9px 10px; font-size: 12px; }
  .filters { padding: 12px; gap: 10px; }
  .filters > input[name=q]:not([type=hidden]) { flex-basis: 100%; }
  .filters input:not([type=checkbox]):not([type=hidden]), .filters select { min-width: 0; }
  input:not([type=checkbox]):not([type=file]), select, textarea { font-size: 16px; }
  .filters input:not([type=checkbox]):not([type=hidden]), .filters select { font-size: 16px; }
  .btn, .btn.small { min-height: 44px; padding: 10px 13px; font-size: 13px; }
  .filters .btn { min-height: 44px; }
  .filters .check { min-height: 36px; }
  .task { padding: 18px; gap: 9px; scroll-margin-top: 16px; }
  .task-head { gap: 6px; }
  .task-head > .task-client { flex-basis: 100%; margin: 0 0 3px; }
  .task-client { font-size: 16px; }
  .task-actions { gap: 8px; }
  .task .linkbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
  .subtask { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 15px 0; }
  .subtask select { min-height: 44px; font-size: 16px; }
  .subtask .check { font-size: 13px; }
  .contact-form > .row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .contact-form > .row > * { width: 100%; }
  .row > select { flex: 1 1 150px; }
  .row-card { gap: 12px; padding: 16px; align-items: flex-start; }
  .row-card .name { font-size: 14px; }
  .row-card .right .num { font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 0; gap: 22px 0; }
  .tile { padding: 0 16px; gap: 8px; }
  .tile:nth-child(odd) { border-left: 0; }
  .tile .value { font-size: 23px; }
  .tile .label { min-height: 36px; }
  .tile .note { font-size: 11px; }
  .two { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .line { padding: 12px 0; }
  .tbl th, .tbl td { padding: 11px 9px; }
  .tbl { font-size: 12px; }
  .act[open] > form { padding: 14px; }
  .nav a.only-wide { display: none; }   /* .nav a задаёт display, поэтому селектор должен быть не слабее */
  .cat > summary { padding: 13px 0; }
  .cat-meta { margin-left: 0; flex-basis: 100%; }
  .scoutrow.whole { padding: 12px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .seg span, .tags span, .presets span { flex: 1 1 auto; font-size: 13px; padding: 8px 12px; }
  .savebar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .acc > summary::after { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 380px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .tabs { margin-right: -12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .card, .task { padding: 16px; }
  .row-card { flex-wrap: wrap; }
  .row-card .grow { flex-basis: 100%; }
  .row-card .right { display: flex; width: 100%; flex-wrap: wrap; align-items: center; gap: 8px; text-align: left; }
  .tile .value { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
