/* Svidok case registry. Navy and gold from the trident; the cross-stitch of Ukrainian embroidery is the one recurring motif:
   status is crosses sewn along a thread, and pages end their heading in a gold running stitch. Everything else stays quiet. */
:root {
  --navy: #002753; --rail: #061B3A; --rail-2: #0C2A55; --gold: #EEA700; --gold-ink: #7A5200;
  --page: #F4F6F9; --sheet: #FFFFFF; --sunk: #EDF1F6; --ink: #0D1B2E; --steel: #566780; --line: #DCE2EB; --line-2: #EBEFF5; --line-strong: #BCC7D8;
  --new: #1E5AA8; --review: #96600A; --verified: #16794C; --lawyer: #5B3FA3; --closed: #6B7A90; --alert: #B42318;
  --new-bg: #E4EEFB; --review-bg: #FFF1D1; --verified-bg: #DFF3E8; --lawyer-bg: #ECE6F8; --closed-bg: #EAEEF3; --alert-bg: #FDE9E7;
  --focus: rgba(238, 167, 0, .55);
  --r-s: 4px; --r-m: 8px; --r-l: 14px;
  --shadow-pop: 0 18px 48px -12px rgba(0, 20, 50, .35), 0 2px 8px rgba(0, 20, 50, .12);
  --f-display: 'Manrope', 'Inter', 'Segoe UI', sans-serif; --f-body: 'Inter', 'Segoe UI', Arial, sans-serif; --f-mono: 'IBM Plex Mono', Consolas, monospace;
  --rail-w: 244px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #08142B; --sheet: #0E2040; --sunk: #0A1A35; --ink: #E9EFF8; --steel: #9FB0C8; --line: #20375D; --line-2: #172C4D; --line-strong: #3A5788;
    --rail: #040F24; --rail-2: #0A2149; --gold-ink: #F4B71E;
    --new: #7DB1FF; --review: #F4B71E; --verified: #5ED39C; --lawyer: #B7A0FF; --closed: #9FB0C8; --alert: #FF8C7C;
    --new-bg: #112B52; --review-bg: #3A2D0B; --verified-bg: #0F3324; --lawyer-bg: #261C4A; --closed-bg: #172C4D; --alert-bg: #3A1412;
    --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14.5px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; letter-spacing: -.015em; margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--new); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-s); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--sheet); padding: 8px 14px; z-index: 99; border-radius: var(--r-m); }
.num { font-variant-numeric: tabular-nums; } .mono { font-family: var(--f-mono); font-size: .92em; }
.muted { color: var(--steel); } .small { font-size: 13px; } .hidden { display: none !important; } .nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- frame: rail + stage ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: #C9D5E8; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; color: #fff; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand b { font: 800 1.12rem var(--f-display); letter-spacing: -.01em; line-height: 1.05; display: block; }
.brand span { font-size: 12.5px; color: #8FA3C2; font-weight: 500; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m); color: #C9D5E8; text-decoration: none; font-weight: 600; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--rail-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--rail-2); color: #fff; }
.nav a[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav .count { margin-left: auto; background: var(--gold); color: #3B2800; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 8px; min-width: 22px; text-align: center; }
.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.me b { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me span { font-size: 12.5px; color: #8FA3C2; }
.rail-links { display: flex; gap: 6px; }
.rail-links a, .rail-links button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: var(--r-m); border: 1px solid rgba(255, 255, 255, .16); background: transparent; color: #C9D5E8; font: 600 13px var(--f-body); text-decoration: none; cursor: pointer; }
.rail-links a:hover, .rail-links button:hover { background: var(--rail-2); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #3B2800; display: grid; place-items: center; font: 800 13px var(--f-display); flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; } .avatar.quiet { background: var(--sunk); color: var(--steel); border: 1px solid var(--line); }

.stage { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: var(--sheet); position: sticky; top: 0; z-index: 15; }
.gsearch { position: relative; flex: 1; max-width: 520px; }
.gsearch .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--steel); width: 17px; height: 17px; }
.gsearch input[type="search"] { width: 100%; padding: 9px 44px 9px 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--page); font: inherit; color: var(--ink); }
.gsearch kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 12px var(--f-body); color: var(--steel); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: var(--sheet); }
.top .push { margin-left: auto; }
.chip-live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--steel); text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.chip-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--verified); box-shadow: 0 0 0 3px var(--verified-bg); } .chip-live.off i { background: var(--alert); box-shadow: 0 0 0 3px var(--alert-bg); }
.page { padding: 30px 32px 90px; max-width: 1240px; width: 100%; }

/* ---------- page heading with the running stitch ---------- */
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 26px; position: relative; }
.head h1 { font-size: 30px; letter-spacing: -.025em; } .head .sub { color: var(--steel); margin-top: 4px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: repeating-linear-gradient(90deg, var(--gold) 0 9px, transparent 9px 15px); opacity: .9; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--steel); text-decoration: none; font-weight: 600; font-size: 13.5px; margin-bottom: 14px; } .back:hover { color: var(--ink); }

/* ---------- sheets: ruled surfaces, not cards ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-s); }
.sheet + .sheet { margin-top: 18px; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 16px 22px 0; }
.sheet-h h2 { font-size: 16px; } .sheet-h .aside { margin-left: auto; color: var(--steel); font-size: 13px; }
.sheet-b { padding: 14px 22px 22px; }
.sheet-b.flush { padding: 0; }
.rule { height: 1px; background: var(--line-2); margin: 0; border: 0; }
.cols { display: grid; gap: 28px; align-items: start; } .cols.main-side { grid-template-columns: minmax(0, 1fr) 330px; } .cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cols.main-side, .cols.thirds { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .cols.even { grid-template-columns: minmax(0, 1fr); } }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 13.5px var(--f-body); padding: 8px 14px; min-height: 36px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--sheet); color: var(--ink); cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: var(--steel); }
.btn.solid { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.solid:hover { background: #00356f; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #3B2800; } .btn.gold:hover { filter: brightness(1.05); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--steel); } .btn.quiet:hover { background: var(--sunk); color: var(--ink); }
.btn.warn { color: var(--alert); border-color: color-mix(in srgb, var(--alert) 45%, var(--line)); } .btn.warn:hover { background: var(--alert-bg); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .lbl { font-weight: 600; font-size: 13px; color: var(--ink); }
.in, select, textarea, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date] {
  font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-m); padding: 8px 11px; min-height: 38px; width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--steel); }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23566780' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--navy); min-height: 0; padding: 0; }
.err { color: var(--alert); font-size: 13.5px; margin-top: 8px; } .ok { color: var(--verified); font-size: 13.5px; }
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.toggle input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .18s; cursor: pointer; flex: none; padding: 0; border: 0; min-height: 0; }
.toggle input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.toggle input:checked { background: var(--verified); } .toggle input:checked::after { transform: translateX(18px); }
.toggle input.danger:checked { background: var(--alert); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--sheet); }
.seg button { border: 0; background: transparent; padding: 7px 13px; font: 600 13px var(--f-body); color: var(--steel); cursor: pointer; border-right: 1px solid var(--line); } .seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; } .seg button:hover:not([aria-pressed="true"]) { background: var(--sunk); color: var(--ink); }
.seg button[disabled] { cursor: default; }

/* ---------- the cross-stitch status ---------- */
.stitches { display: inline-flex; gap: 2px; vertical-align: middle; }
.stitches svg { width: 11px; height: 11px; } .stitches .x { stroke: var(--line-strong); stroke-width: 2.2; stroke-linecap: round; fill: none; } .stitches .on .x, .stitches .x.on { stroke: var(--gold); }
.state { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.state .stitches .x.on { stroke: currentColor; }
.state.new { color: var(--new); } .state.in_review { color: var(--review); } .state.verified { color: var(--verified); } .state.with_lawyer { color: var(--lawyer); } .state.closed { color: var(--closed); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 1px 9px; }
.prio.p1 { background: var(--review-bg); color: var(--review); } .prio.p2 { background: var(--alert-bg); color: var(--alert); }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--sunk); color: var(--steel); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; margin: 2px 4px 2px 0; border: 1px solid var(--line-2); }
.tag button { all: unset; cursor: pointer; padding: 0 2px; line-height: 1; } .tag button:hover { color: var(--alert); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--steel); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--sheet); white-space: nowrap; position: sticky; top: 0; }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; } .tbl th button:hover { color: var(--ink); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .12s; } .tbl tbody tr:hover { background: color-mix(in srgb, var(--gold) 7%, var(--sheet)); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td:first-child, .tbl th:first-child { padding-left: 18px; width: 40px; }
.tbl .edge-1 td:first-child { box-shadow: inset 3px 0 0 var(--gold); } .tbl .edge-2 td:first-child { box-shadow: inset 3px 0 0 var(--alert); }
.tbl .id { font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
.tbl .id:hover { text-decoration: underline; }
.tbl .where { font-weight: 600; } .tbl .gist { color: var(--steel); max-width: 330px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .when { white-space: nowrap; } .tbl .when span { display: block; color: var(--steel); font-size: 12.5px; }
.pager { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--steel); }
.pager .push { margin-left: auto; display: flex; gap: 10px; align-items: center; } .pager select { width: auto; min-height: 32px; padding-top: 3px; padding-bottom: 3px; }

/* ---------- toolbar and filters ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .find { position: relative; flex: 1 1 320px; max-width: 460px; } .toolbar .find .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--steel); }
.toolbar .find input[type="search"] { padding-left: 40px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--sheet); border-radius: 999px; padding: 6px 14px; font: 600 13px var(--f-body); color: var(--steel); cursor: pointer; transition: all .12s; }
.pill:hover { border-color: var(--steel); color: var(--ink); } .pill[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.drawer { padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--sheet); margin-bottom: 14px; }
.drawer .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: -2px 0 14px; align-items: center; }
.active-filters .tag { background: var(--navy); color: #fff; border-color: var(--navy); } .active-filters .tag button { color: #fff; }
.bulk { position: fixed; left: calc(var(--rail-w) + (100vw - var(--rail-w)) / 2); transform: translateX(-50%); bottom: 22px; background: var(--rail); color: #fff; border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-pop); z-index: 30; max-width: min(900px, 92vw); }
.bulk select, .bulk input { width: auto; min-width: 140px; min-height: 34px; padding: 4px 10px; }
.bulk .btn { min-height: 34px; } .bulk .btn.quiet { color: #C9D5E8; } .bulk .btn.quiet:hover { background: var(--rail-2); color: #fff; }

/* ---------- overview ---------- */
.queue { display: grid; }
.queue a { display: flex; align-items: center; gap: 18px; padding: 16px 22px; text-decoration: none; color: inherit; border-top: 1px solid var(--line-2); transition: background .12s; }
.queue a:first-child { border-top: 0; } .queue a:hover { background: color-mix(in srgb, var(--gold) 8%, var(--sheet)); }
.queue b { font: 800 30px/1 var(--f-display); letter-spacing: -.03em; min-width: 52px; font-variant-numeric: tabular-nums; } .queue b.hot { color: var(--alert); }
.queue span { display: block; font-weight: 600; } .queue small { color: var(--steel); font-size: 13px; } .queue .go { margin-left: auto; color: var(--steel); }
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ledger div { padding: 18px 22px; border-left: 1px solid var(--line-2); } .ledger div:first-child { border-left: 0; }
.ledger b { display: block; font: 800 34px/1 var(--f-display); letter-spacing: -.035em; font-variant-numeric: tabular-nums; } .ledger span { color: var(--steel); font-size: 13px; }
@media (max-width: 760px) { .ledger { grid-template-columns: repeat(2, 1fr); } .ledger div:nth-child(3) { border-left: 0; } .ledger div:nth-child(n+3) { border-top: 1px solid var(--line-2); } }
.chart { color: var(--navy); width: 100%; height: 150px; display: block; } @media (prefers-color-scheme: dark) { .chart { color: var(--gold); } }
.chart rect:hover { fill: var(--gold); }
.capacity { padding: 0 22px 20px; } .capacity .row { display: flex; flex-wrap: wrap; gap: 3px; margin: 14px 0 12px; }
.capacity .row svg { width: 14px; height: 14px; } .capacity .x { stroke-width: 2.4; }
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--sunk); margin: 6px 0 14px; } .stack i { display: block; height: 100%; }
.legend { display: grid; gap: 7px; } .legend a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 500; } .legend a:hover { color: var(--new); }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .legend em { margin-left: auto; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 11px; padding: 0 22px 20px; } .bar { display: grid; grid-template-columns: minmax(80px, 150px) 1fr 34px; gap: 12px; align-items: center; text-decoration: none; color: inherit; font-size: 13.5px; }
.bar .track { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; } .bar .track i { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
@media (prefers-color-scheme: dark) { .bar .track i { background: var(--gold); } }
.bar:hover .track i { background: var(--gold); } .bar em { font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- the dossier (one report) ---------- */
.dossier { padding: 24px 26px 8px; }
.tagline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.idtag { display: inline-flex; align-items: center; gap: 10px; background: var(--sunk); border: 1px solid var(--line); border-radius: 6px 22px 22px 6px; padding: 7px 16px 7px 12px; }
.idtag::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--steel); }
.idtag b { font: 500 22px var(--f-mono); letter-spacing: -.01em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 28px; padding: 20px 0 22px; }
.facts div span { display: block; color: var(--steel); font-size: 12.5px; margin-bottom: 1px; } .facts div b { font-weight: 600; overflow-wrap: anywhere; }
.track { padding: 20px 0 2px; border-top: 1px solid var(--line-2); }
.track ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.track li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.track li::before { content: ''; position: absolute; top: 15px; left: 28px; right: -4px; height: 0; border-top: 2px dashed var(--line); }
.track li:last-child::before { display: none; } .track li.done::before { border-top-color: var(--gold); }
.track button { all: unset; cursor: pointer; display: grid; gap: 8px; justify-items: start; position: relative; z-index: 1; } .track button[disabled] { cursor: default; }
.track .knot { width: 30px; height: 30px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--line); display: grid; place-items: center; color: var(--line); transition: all .15s; }
.track .knot svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.track li.done .knot { border-color: var(--gold); color: #3B2800; background: var(--gold); }
.track li.now .knot { border-color: var(--navy); background: var(--navy); color: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 35%, transparent); }
@media (prefers-color-scheme: dark) { .track li.now .knot { border-color: var(--gold); background: var(--rail); } }
.track button:not([disabled]):hover .knot { border-color: var(--steel); }
.track label { font-weight: 600; font-size: 13px; cursor: inherit; color: var(--steel); } .track li.now label { color: var(--ink); }
.track li.done .knot svg path, .track li.now .knot svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: sew .55s ease-out .15s forwards; }
@keyframes sew { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .track li.done .knot svg path, .track li.now .knot svg path { animation: none; stroke-dashoffset: 0; } }
@media (max-width: 640px) { .track label { font-size: 11.5px; } .track li::before { left: 24px; } }
.section { padding: 22px 26px; border-top: 1px solid var(--line-2); } .section > h2 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.section > h2 .ico { color: var(--steel); } .section > h2 .aside { margin-left: auto; font: 500 13px var(--f-body); color: var(--steel); }
.story { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.65; max-width: 70ch; }
.qa { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 10px 22px; margin: 0; } .qa dt { color: var(--steel); font-size: 13px; padding-top: 1px; } .qa dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 640px) { .qa { grid-template-columns: 1fr; gap: 2px; } .qa dd { margin-bottom: 10px; } }
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.plate { border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; background: var(--sheet); }
.plate img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; cursor: zoom-in; background: var(--sunk); }
.plate .cap { padding: 11px 13px 13px; display: grid; gap: 8px; font-size: 13px; }
.fp { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 12.5px; color: var(--steel); }
.verdict { display: flex; gap: 7px; align-items: center; font-weight: 600; font-size: 13px; } .verdict.good { color: var(--verified); } .verdict.bad { color: var(--alert); }
.vault { padding: 18px 20px; } .vault h3 { font-size: 15px; display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.vault.open { background: var(--review-bg); border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.vault dl { margin: 12px 0 0; display: grid; grid-template-columns: 62px 1fr; gap: 6px 10px; } .vault dt { color: var(--steel); font-size: 13px; } .vault dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rail-card { padding: 18px 20px; } .rail-card h3 { font-size: 15px; margin-bottom: 14px; } .rail-card .field + .field { margin-top: 14px; }
.sticky { position: sticky; top: 84px; display: grid; gap: 16px; }
.cluster { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dupe { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; } .dupe:first-of-type { border-top: 0; }
.dupe .why { color: var(--steel); font-size: 13px; flex: 1 1 220px; }
.note { padding: 14px 0; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: 30px 1fr; gap: 6px 12px; } .note:first-of-type { border-top: 0; padding-top: 2px; }
.note .who { font-weight: 700; } .note .when { color: var(--steel); font-size: 12.5px; margin-left: 8px; font-weight: 500; } .note p { white-space: pre-wrap; overflow-wrap: anywhere; grid-column: 2; margin-top: -4px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; } .timeline::before { content: ''; position: absolute; left: 14px; top: 6px; bottom: 6px; border-left: 2px dashed var(--line); }
.timeline li { position: relative; padding: 0 0 18px 40px; } .timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: absolute; left: 4px; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--line); display: grid; place-items: center; color: var(--steel); }
.timeline .dot .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.timeline .dot.key { border-color: var(--gold); color: var(--gold-ink); background: var(--review-bg); } .timeline .dot.bad { border-color: var(--alert); color: var(--alert); }
.timeline b { font-weight: 600; } .timeline small { display: block; color: var(--steel); font-size: 12.5px; margin-top: 1px; }
.revision { border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 12px 14px; margin-top: 10px; font-size: 13.5px; } .revision del { color: var(--alert); } .revision ins { color: var(--verified); text-decoration: none; }
details.fold > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; padding: 2px 0; } details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--steel); border-bottom: 2px solid var(--steel); transform: rotate(-45deg); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(45deg); }
.danger-zone { border: 1px dashed color-mix(in srgb, var(--alert) 55%, var(--line)); border-radius: var(--r-s); padding: 16px 20px; }

/* ---------- activity log ---------- */
.feed { list-style: none; margin: 0; padding: 0; } .feed li { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: start; padding: 14px 22px; border-top: 1px solid var(--line-2); } .feed li:first-child { border-top: 0; }
.feed .what { font-weight: 600; } .feed .what a { font-family: var(--f-mono); font-size: 13px; font-weight: 500; } .feed small { color: var(--steel); display: block; font-size: 12.5px; } .feed time { color: var(--steel); font-size: 12.5px; white-space: nowrap; text-align: right; }
.feed .ev { width: 30px; height: 30px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; color: var(--steel); } .feed .ev.key { background: var(--review-bg); color: var(--gold-ink); } .feed .ev.bad { background: var(--alert-bg); color: var(--alert); }
.feed .ev .ico { width: 15px; height: 15px; }

/* ---------- health, empty, skeleton ---------- */
.health { display: grid; } .health > div { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line-2); } .health > div:first-child { border-top: 0; }
.health .name { font-weight: 600; min-width: 190px; } .health .val { color: var(--steel); }
.dotok, .dotbad, .dotna { width: 10px; height: 10px; border-radius: 50%; flex: none; } .dotok { background: var(--verified); box-shadow: 0 0 0 4px var(--verified-bg); } .dotbad { background: var(--alert); box-shadow: 0 0 0 4px var(--alert-bg); } .dotna { background: var(--closed); box-shadow: 0 0 0 4px var(--closed-bg); }
.empty { text-align: center; padding: 56px 24px; } .empty svg.art { width: 150px; margin: 0 auto 16px; display: block; color: var(--line); }
.empty h3 { font-size: 18px; margin-bottom: 6px; } .empty p { color: var(--steel); max-width: 46ch; margin: 0 auto 18px; }
.skel { background: linear-gradient(90deg, var(--sunk) 25%, var(--line-2) 50%, var(--sunk) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-s); }
@keyframes shimmer { to { background-position: -200% 0; } } @media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- dialogs and toasts ---------- */
dialog { border: 0; border-radius: var(--r-l); padding: 0; background: var(--sheet); color: var(--ink); max-width: min(540px, 94vw); width: 100%; box-shadow: var(--shadow-pop); animation: pop .16s ease-out; }
dialog.wide { max-width: min(980px, 96vw); } dialog::backdrop { background: rgba(2, 12, 32, .6); backdrop-filter: blur(2px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } } @media (prefers-reduced-motion: reduce) { dialog { animation: none; } }
.dlg-h { padding: 22px 26px 0; } .dlg-h h2 { font-size: 20px; } .dlg-b { padding: 14px 26px 6px; } .dlg-f { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 26px 22px; flex-wrap: wrap; }
dialog img.big { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; border-radius: var(--r-s); }
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 100; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--rail); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-pop); max-width: 380px; animation: pop .18s ease-out; font-weight: 500; }
.toast .ico { color: var(--gold); } .toast.bad { background: var(--alert); } .toast.bad .ico { color: #fff; }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.signin-art { background: var(--rail); color: #fff; padding: 56px 56px 40px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.signin-art img { height: 84px; width: auto; align-self: flex-start; }
.signin-art h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin-top: auto; max-width: 14ch; }
.signin-art p { color: #A9BBD6; margin-top: 16px; max-width: 44ch; font-size: 15.5px; }
.signin-art .band { height: 22px; margin-top: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='22' viewBox='0 0 44 22'%3E%3Cg fill='none' stroke='%23EEA700' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M11 3l8 8-8 8-8-8z'/%3E%3Cpath d='M27 5l10 10M37 5L27 15'/%3E%3C/g%3E%3C/svg%3E"); background-repeat: repeat-x; opacity: .9; }
.signin-form { display: grid; place-items: center; padding: 40px 24px; }
.signin-form form { width: 100%; max-width: 380px; display: grid; gap: 16px; } .signin-form h2 { font-size: 26px; letter-spacing: -.025em; } .signin-form .field input { min-height: 44px; }
.signin-form .btn { min-height: 46px; font-size: 15px; }
@media (max-width: 860px) { .signin { grid-template-columns: 1fr; } .signin-art { padding: 28px 24px; min-height: 0; } .signin-art h1 { margin-top: 28px; font-size: 28px; } .signin-art p, .signin-art .band { display: none; } .signin-art img { height: 56px; } }

/* ---------- printable case file ---------- */
.printdoc { background: #fff; color: #000; max-width: 820px; margin: 0 auto; padding: 34px 40px; border: 1px solid var(--line); font-size: 13px; }
.printdoc h1 { font-size: 21px; } .printdoc h2 { font-size: 15px; border-bottom: 1px solid #999; padding-bottom: 3px; margin: 20px 0 8px; }
.printdoc .story { font-size: 13.5px; background: #f3f3f3; padding: 10px 12px; max-width: none; } .printdoc img { max-width: 100%; max-height: 420px; display: block; margin: 6px 0; }
.printdoc .qa dt { color: #444; } .printdoc p { margin: 4px 0; } .printdoc .mono { font-size: 12px; }

/* ---------- small screens: the rail becomes a bottom bar ---------- */
.tabbar, .mtop { display: none; }
@media (max-width: 900px) {
  .app { display: block; } .rail, .top { display: none; } .page { padding: 20px 16px 110px; }
  .mtop { display: flex; align-items: center; gap: 12px; background: var(--rail); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .mtop img { height: 30px; } .mtop b { font: 800 16px var(--f-display); } .mtop .push { margin-left: auto; } .mtop button { all: unset; cursor: pointer; padding: 6px; border-radius: 8px; } .mtop button:hover { background: var(--rail-2); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; background: var(--rail); z-index: 40; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255, 255, 255, .12); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 7px 4px; color: #9FB2D0; text-decoration: none; font-size: 11.5px; font-weight: 600; border-radius: 10px; } .tabbar a[aria-current="page"] { color: #fff; background: var(--rail-2); } .tabbar a[aria-current="page"] .ico { color: var(--gold); }
  .head h1 { font-size: 25px; } .bulk { left: 50%; bottom: 84px; }
  .tbl .hide-s { display: none; } .sheet-h, .sheet-b, .section, .dossier { padding-left: 16px; padding-right: 16px; } .sticky { position: static; } .vault, .rail-card { padding-left: 16px; padding-right: 16px; }
  #toasts { bottom: 84px; right: 12px; left: 12px; } .toast { max-width: none; }
}
@media print {
  body { background: #fff; } .rail, .top, .mtop, .tabbar, .noprint, #toasts, .skip { display: none !important; } .app { display: block; } .page { padding: 0; max-width: none; }
  .printdoc { border: 0; padding: 0; max-width: none; } .printdoc .photoblock { break-inside: avoid; }
}
