/* Layout: roast header band over one open sage surface; invoices are rows split by hairlines.
   The stamp route Диадок → Робот → ОМ is the single bold element; colour appears only where something needs action. */
@font-face { font-family: "Sofia Sans"; font-weight: 400 700; font-display: swap; src: url(/fonts/sofia-sans-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans"; font-weight: 400 700; font-display: swap; src: url(/fonts/sofia-sans-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sofia Sans"; font-weight: 400 700; font-display: swap; src: url(/fonts/sofia-sans-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: "Sofia Sans Extra Condensed"; font-weight: 600 800; font-display: swap; src: url(/fonts/sofia-xc-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans Extra Condensed"; font-weight: 600 800; font-display: swap; src: url(/fonts/sofia-xc-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sofia Sans Extra Condensed"; font-weight: 600 800; font-display: swap; src: url(/fonts/sofia-xc-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ground: #EDEFE6;
  --paper: #FFFFFF;
  --roast: #2A2320;
  --jute: #6A5E51;
  --faint: #8A7F72;
  --rule: #D3D5C8;
  --rule-strong: #C9CBBE;
  --stamp: #3B3D9E;
  --stamp-wash: #E2E3F3;
  --wait: #7A4F00;
  --wait-ring: #C98A12;
  --wait-wash: #F6E2B0;
  --no: #B33A2B;
  --no-wash: #F8E1DD;
  --series: #4B4FC4;
  --series-2: #B5692C;
  --cream: #F3EFE8;
  --f-text: "Sofia Sans", "Segoe UI", system-ui, sans-serif;
  --f-display: "Sofia Sans Extra Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--roast); font: 18px/1.45 var(--f-text); }
a { color: var(--stamp); }
a:hover { color: var(--roast); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--jute); }
.faint { color: var(--faint); }
.error { color: var(--no); font-weight: 700; }
.loading { color: var(--jute); padding: 40px 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 800 56px/1 var(--f-display); }
h2 { font: 700 32px/1.1 var(--f-display); }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }

/* header band */
.band { background: var(--roast); color: var(--cream); }
.band-inner { max-width: 1180px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-height: 64px; }
.wordmark { font: 800 27px/1 var(--f-display); color: var(--cream); text-decoration: none; padding: 10px 0; }
.wordmark:hover { color: #fff; }
.nav { display: flex; flex-wrap: wrap; gap: 0 24px; flex: 1 1 auto; align-self: stretch; }
.nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding-top: 3px; border-bottom: 3px solid transparent; color: #CFC6BA; text-decoration: none; font-weight: 500; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; font-weight: 700; border-bottom-color: var(--cream); }
.nav .badge { color: #CFC6BA; font-weight: 500; }
.who { display: flex; align-items: center; gap: 12px; color: #CFC6BA; font-size: 16px; padding: 8px 0; }
.who button { background: none; border: none; color: #CFC6BA; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0; font-size: 16px; }
.who button:hover { color: #fff; }
.sites { margin-left: -10px; }
.sites:empty { display: none; }
.sitelink { color: #CFC6BA; text-decoration: none; font-size: 15px; white-space: nowrap; padding-left: 12px; border-left: 1px solid rgba(207, 198, 186, .35); }
.sitelink:hover { color: #fff; text-decoration: underline; }

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 6px; border: 1.5px solid var(--roast); background: var(--roast); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: #000; color: #fff; }
.button.light { background: var(--cream); border-color: var(--cream); color: var(--roast); min-height: 44px; }
.button.light:hover { background: #fff; color: var(--roast); }
.button.ghost { background: var(--paper); color: var(--roast); border-color: var(--rule-strong); }
.button.ghost:hover { border-color: var(--roast); color: var(--roast); }
.button.danger { background: var(--paper); color: var(--no); border-color: var(--no); }
.button.danger:hover { background: var(--no-wash); color: var(--no); }
.button.big { min-height: 60px; padding: 0 34px; font-size: 20px; }
.button.small { min-height: 40px; padding: 0 14px; font-size: 16px; }
.button[disabled] { opacity: .5; cursor: default; }
.linklike { background: none; border: none; padding: 0; min-height: 44px; color: var(--stamp); font-weight: 700; text-decoration: underline; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.linklike:hover { color: var(--roast); }
.iconbutton { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--jute); cursor: pointer; border-radius: 6px; padding: 0; }
.iconbutton:hover { color: var(--roast); background: rgba(42,35,32,.06); }

/* page */
.view { display: block; max-width: 1180px; margin: 0 auto; padding: 36px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); outline: none; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.page-head .side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.search { display: flex; align-items: center; gap: 10px; flex: 0 1 400px; min-width: 0; min-height: 48px; padding: 0 14px; background: var(--paper); border: 1.5px solid var(--rule); border-radius: 6px; color: var(--jute); }
.search input { flex: 1 1 auto; min-width: 0; height: 44px; border: none; background: transparent; font-size: 18px; color: var(--roast); }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--stamp); box-shadow: 0 0 0 2px var(--stamp-wash); }
.section-rule { border-top: 2px solid var(--roast); padding-top: 26px; }

/* at-a-glance step summary */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
@media (max-width: 720px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .stepcard { padding: 12px 12px 8px; } .stepcard h3 { font-size: 22px; } .count b { font-size: 32px; } .count span { font-size: 14px; } }
.stepcard { background: var(--paper); border-radius: 8px; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 6px; }
.stepcard h3 { font: 700 26px/1 var(--f-display); display: flex; align-items: center; gap: 10px; }
.stepcard .counts { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.count { display: inline-flex; align-items: baseline; gap: 8px; background: none; border: none; padding: 4px 0; min-height: 44px; cursor: pointer; text-align: left; color: var(--roast); border-bottom: 3px solid transparent; }
.count b { font: 700 40px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.count span { font-size: 16px; color: var(--jute); }
.count.no b { color: var(--no); }
.count.wait b { color: var(--wait); }
.count.zero b { color: var(--faint); }
.count[aria-pressed="true"] { border-bottom-color: var(--roast); }
.count:hover span { color: var(--roast); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 0 28px; border-bottom: 1px solid var(--rule); }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0; margin-bottom: -1px; background: none; border: none; border-bottom: 3px solid transparent; font-size: 19px; color: var(--jute); cursor: pointer; }
.tab b { font-weight: 500; color: var(--faint); }
.tab[aria-pressed="true"] { color: var(--roast); font-weight: 700; border-bottom-color: var(--roast); }
.tab[aria-pressed="true"] b { color: var(--jute); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.filters label.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.filters input[type=checkbox], .check input { width: 22px; height: 22px; accent-color: var(--roast); }
.filters select, .select { height: 44px; padding: 0 36px 0 12px; border: 1.5px solid var(--rule-strong); border-radius: 6px; background: var(--paper); font-size: 17px; max-width: 100%; }
.activefilter { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 14px; border-radius: 20px; background: var(--roast); color: #fff; font-weight: 600; font-size: 16px; }
.activefilter button { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.listhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 20px; }
.listhead h2 { font-size: 30px; }

/* invoice rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { display: flex; flex-direction: column; gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.row.closed { opacity: .55; }
.row-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 44px; }
.row-main { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 24px; }
.row-head .who-name { font: 700 29px/1.1 var(--f-display); }
.row-head .sum { font: 700 29px/1.1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .meta { color: var(--jute); }
.row .meta a { font-weight: 700; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--no); }
.tag.muted-tag { color: var(--jute); }
.more { display: flex; justify-content: center; padding: 24px 0; }
.empty { padding: 40px 0; color: var(--jute); }

/* the stamp route */
.route { display: flex; align-items: flex-start; flex: 0 1 330px; min-width: 260px; padding-top: 2px; }
.stop { flex: 0 0 82px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.stop .label { font-size: 15px; font-weight: 700; line-height: 1.1; }
.stop .state { font-size: 15px; line-height: 1.1; }
.stop .state.done { color: var(--stamp); }
.stop .state.wait { color: var(--wait); font-weight: 700; }
.stop .state.no { color: var(--no); font-weight: 700; }
.stop .state.skip { color: var(--faint); }
.stop .state.refused { color: var(--no); font-weight: 700; }
.stop .state.annulled { color: var(--jute); font-weight: 700; }
.station { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; flex: none; }
.station svg { width: 22px; height: 22px; stroke-width: 2.8; }
.station.done { background: var(--stamp); color: #fff; border: none; box-shadow: 0 0 0 3px var(--ground), 0 0 0 5px var(--stamp); transform: rotate(-8deg); }
.station.wait { background: var(--wait-wash); color: var(--wait); border: 2px dashed var(--wait-ring); }
.station.no { background: var(--paper); color: var(--no); border: 2.5px solid var(--no); }
.station.skip { background: transparent; color: var(--faint); border: 2px dotted #A9AC9C; }
/* Диадок outcomes: refusal is a solid red stop, an annulled document is a struck-out ring. */
.station.refused { background: var(--no); color: #fff; border: none; box-shadow: 0 0 0 3px var(--ground), 0 0 0 5px var(--no); }
.station.annulled { background: transparent; color: var(--jute); border: 2.5px solid var(--jute); }
.station.open { outline: 3px solid var(--roast); outline-offset: 7px; }
.station:hover { filter: brightness(.96); }
.track { flex: 1 1 20px; min-width: 10px; height: 3px; margin: 23px -12px 0; border-radius: 2px; background: var(--rule); }
.track.done { background: var(--stamp); }
.route.big { flex: none; max-width: 780px; width: 100%; }
.route.big .stop { flex-basis: 160px; gap: 12px; }
.route.big .station { width: 66px; height: 66px; }
.route.big .station svg { width: 30px; height: 30px; }
.route.big .station.done { box-shadow: 0 0 0 4px var(--ground), 0 0 0 7px var(--stamp); }
.route.big .station.refused { box-shadow: 0 0 0 4px var(--ground), 0 0 0 7px var(--no); }
.route.big .label { font: 700 26px/1.1 var(--f-display); }
.route.big .state { font-size: 17px; }
.route.big .track { margin: 32px -40px 0; }
.stop .when { font-size: 14px; color: var(--jute); }
.chooser { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; padding: 12px 14px; border-radius: 8px; background: var(--paper); }
.chooser.left { justify-content: flex-start; align-self: flex-start; }
.chooser .title { font-weight: 700; margin-right: 6px; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 6px; font-size: 17px; font-weight: 700; cursor: pointer; background: var(--paper); color: var(--roast); border: 1.5px solid var(--rule-strong); }
.choice:hover { border-color: var(--roast); }
.choice.done[aria-pressed="true"] { background: var(--stamp); color: #fff; border-color: var(--stamp); }
.choice.wait[aria-pressed="true"] { background: var(--wait-wash); color: var(--wait); border: 1.5px dashed var(--wait-ring); }
.choice.no[aria-pressed="true"] { background: var(--no-wash); color: var(--no); border-color: var(--no); }
.choice.skip[aria-pressed="true"] { background: var(--ground); color: var(--jute); border: 1.5px dotted var(--jute); }
.choice.refused[aria-pressed="true"] { background: var(--no); color: #fff; border-color: var(--no); }
.choice.annulled[aria-pressed="true"] { background: var(--ground); color: var(--roast); border-color: var(--roast); }

/* toast */
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; max-width: calc(100% - 32px); padding: 8px 20px; border-radius: 8px; background: var(--roast); color: var(--cream); box-shadow: 0 6px 24px rgba(42,35,32,.25); }
.toast button { min-height: 44px; background: none; border: none; color: #fff; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.toast.bad { background: var(--no); color: #fff; }

/* forms */
.form { max-width: 840px; display: flex; flex-direction: column; }
.step { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 24px 0; border-top: 1px solid var(--rule); }
.step-num { flex: 0 0 52px; font: 700 40px/1 var(--f-display); color: var(--faint); }
.mark { width: 34px; height: 34px; margin: 4px; border-radius: 50%; background: var(--stamp); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--stamp); transform: rotate(-8deg); }
.mark svg { stroke-width: 3; }
.step-body { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.step-body h2 { font: 700 22px/1.2 var(--f-text); }
.fields { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.field { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field.narrow { flex: 0 1 220px; }
.field > label, .field > .label { font-size: 16px; color: var(--jute); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--rule-strong); border-radius: 6px; background: var(--paper); font-size: 19px; font-variant-numeric: tabular-nums; }
.field textarea { padding: 12px 14px; font-size: 18px; line-height: 1.45; resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--stamp); box-shadow: 0 0 0 2px var(--stamp-wash); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border: 2px solid var(--no); }
.hint { font-size: 16px; color: var(--jute); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 52px; padding: 0 20px; border-radius: 6px; border: 1.5px solid var(--rule-strong); background: var(--paper); font-size: 18px; font-weight: 600; cursor: pointer; }
.chip.small { min-height: 44px; padding: 0 14px; font-size: 17px; }
.chip:hover { border-color: var(--roast); }
.chip[aria-pressed="true"] { background: var(--roast); color: #fff; border-color: var(--roast); }
.contracts { display: flex; flex-direction: column; gap: 8px; }
.contract { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; border-radius: 6px; border: 1.5px solid var(--rule); background: var(--paper); text-align: left; cursor: pointer; font-size: 17px; }
.contract:hover { border-color: var(--roast); }
.contract[aria-pressed="true"] { border: 2px solid var(--roast); box-shadow: inset 0 0 0 1px var(--roast); }
.contract .top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 20px; }
.contract .name { font-size: 19px; font-weight: 700; }
.contract .po { color: var(--jute); font-variant-numeric: tabular-nums; }
.contract .rest { font-size: 16px; color: var(--jute); font-variant-numeric: tabular-nums; }
.contract .rest.crit { color: var(--no); font-weight: 700; }
.meter { display: block; height: 4px; border-radius: 2px; background: #E1E3D8; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--stamp); }
.meter.crit i { background: var(--no); }
.meter.warn i { background: var(--wait-ring); }
.lineitem { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--rule); }
.lineitem:last-of-type { border-bottom: none; }
.total { font: 700 30px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.notice { padding: 14px 16px; border-radius: 6px; background: var(--wait-wash); color: #4A3000; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.notice.bad { background: var(--no-wash); color: #7D241A; font-weight: 600; }
.notice a { color: var(--roast); font-weight: 700; }
.disclosure { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 48px; padding: 0; background: none; border: none; font-size: 18px; font-weight: 700; cursor: pointer; }
.disclosure svg { transition: transform .15s; }
.disclosure[aria-expanded="true"] svg { transform: rotate(90deg); }
.savebar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 24px 0 0 72px; border-top: 2px solid var(--roast); }

/* invoice card */
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 40px; }
.doc-head .left { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-head .contractor { font-size: 21px; font-weight: 600; color: var(--jute); }
.doc-head h1 { font-size: 60px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.doc-head .right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.amount-big { font: 700 46px/1.05 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 18px; border-radius: 6px; background: var(--no-wash); color: #7D241A; }
.banner .text { flex: 1 1 380px; min-width: 0; }
.banner .button { background: var(--paper); border-color: #D9A39A; color: #7D241A; }
.panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 8px; background: var(--paper); }
.routebox { display: flex; flex-direction: column; gap: 16px; padding: 28px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cols { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; }
.cols > .wide { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.cols > .narrow { flex: 2 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.lines { display: flex; flex-direction: column; }
.lines .l { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.lines .l .sub { font-size: 15px; color: var(--jute); font-variant-numeric: tabular-nums; }
.lines .l .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.lines .l.sumline { border-bottom: none; font-weight: 700; }
.details { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 28px; }
.details dt { color: var(--jute); }
.details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.history .by { font-size: 15px; color: var(--jute); }
.history .fresh { font-weight: 700; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--rule-strong); border-radius: 6px; background: var(--paper); font-size: 18px; }

/* register table */
.tablebox { overflow-x: auto; }
.table { min-width: 1000px; display: flex; flex-direction: column; }
.tr { display: grid; grid-template-columns: 170px 160px 90px minmax(0, 1fr) 150px 250px; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.tr.head { padding: 6px 0 10px; font-size: 15px; color: var(--jute); align-items: end; }
.tr.closed { color: var(--jute); }
.tr .amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr .numcell { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tr .numcell a { font-weight: 700; overflow-wrap: anywhere; }
.tr .numcell span { font-size: 15px; color: var(--jute); }
.statuses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; line-height: 1.1; }
.st svg { width: 15px; height: 15px; stroke-width: 3; }
.st.done { color: var(--stamp); font-weight: 500; }
.st.wait { color: var(--wait); }
.st.no { color: var(--no); }
.st.skip { color: var(--faint); font-weight: 500; }
.st.refused { color: var(--no); }
.st.annulled { color: var(--jute); }
.sumrow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; color: var(--jute); }
.exportbox { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; border-radius: 8px; background: var(--paper); }
.exportbox .groups { display: flex; flex-wrap: wrap; gap: 18px 48px; }
fieldset { margin: 0; padding: 0; border: none; min-width: 0; display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; }
legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input[type=radio] { accent-color: var(--roast); width: 22px; height: 22px; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }
.kpi { background: var(--paper); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--roast); }
a.kpi:hover { color: var(--roast); box-shadow: inset 0 0 0 2px var(--roast); }
.kpi .v { font: 700 46px/1.05 var(--f-display); font-variant-numeric: tabular-nums; }
.kpi .v.no { color: var(--no); }
.kpi .v.wait { color: var(--wait); }
.kpi .k { font-size: 16px; color: var(--jute); }
.rings { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px 0; max-width: 920px; }
.ringstop { flex: 0 0 210px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ring { width: 104px; height: 104px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--rule); }
.ring span { width: 80px; height: 80px; border-radius: 50%; background: var(--ground); display: flex; align-items: center; justify-content: center; font: 700 28px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.ringstop .label { font: 700 30px/1 var(--f-display); }
.ringstop .lines3 { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.ringstop .lines3 a { text-decoration: none; }
.ringstop .lines3 .no { color: var(--no); font-weight: 700; }
.ringstop .lines3 .wait { color: var(--wait); }
.ringstop .lines3 .done { color: var(--jute); }
.ringtrack { flex: 1 1 40px; min-width: 24px; height: 3px; margin: 51px -46px 0; border-radius: 2px; background: var(--rule); }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 16px 0; border-top: 1px solid var(--rule); }
.sev { flex: 0 0 170px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.sev.crit { color: var(--no); }
.sev.warn { color: var(--wait); }
.sev.trend { color: var(--stamp); }
.sev.info { color: var(--jute); }
.alerts .body { flex: 1 1 560px; min-width: 0; max-width: 820px; display: flex; flex-direction: column; gap: 4px; }
.alerts .body b { font-size: 19px; }
.token { background: var(--stamp-wash); color: #2B2D7A; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.charts { display: flex; flex-wrap: wrap; gap: 48px 56px; }
.charts > section { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.readout { min-height: 26px; color: var(--jute); }
.colchart { display: flex; gap: 8px; }
.yaxis { position: relative; width: 34px; flex: none; }
.yaxis span { position: absolute; right: 0; transform: translateY(50%); font-size: 14px; color: var(--jute); font-variant-numeric: tabular-nums; }
.plot { position: relative; flex: 1 1 auto; }
.plot .grid { position: absolute; left: 0; right: 0; height: 1px; background: #DCDED2; }
.plot .colset { position: absolute; inset: 0; display: flex; gap: 2px; align-items: stretch; }
.colbtn { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; align-items: flex-end; gap: 2px; background: transparent; border: none; padding: 0; cursor: pointer; }
.colbtn .stackcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.colbtn .val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.colbtn .bar { display: block; width: 24px; border-radius: 4px 4px 0 0; background: var(--series); }
.colbtn .bar.narrowbar { width: 14px; }
.colbtn .bar.s2 { background: var(--series-2); }
.colbtn .bar.partial { background: #A9ABE3; }
.colchart.dim .colbtn:not(.hot) .bar { opacity: .45; }
.xaxis { display: flex; gap: 2px; margin-left: 42px; padding-top: 8px; border-top: 1px solid #A9AC9C; }
.xaxis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 15px; color: var(--jute); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: flex; align-items: center; gap: 12px; }
.hbar .n { flex: 0 0 140px; min-width: 0; overflow-wrap: anywhere; }
.hbar .b { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
.hbar .b i { display: block; height: 22px; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--series); }
.hbar .b i.other { background: #A9AC9C; }
.hbar .b span { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.budgets { display: flex; flex-direction: column; }
.budget { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.budget .who-c { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; }
.budget .meter { flex: 2 1 320px; height: 10px; border-radius: 5px; }
.budget .fig { flex: 0 0 230px; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--jute); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; background: var(--series); }
.legend i.s2 { background: var(--series-2); }
.legend i.s3 { background: #1B8A72; }
.legend i.s4 { background: #B0476B; }
.colbtn .bar.s3 { background: #1B8A72; }
.colbtn .bar.s4 { background: #B0476B; }
.datatable { display: flex; flex-direction: column; max-width: 640px; }
.datatable .dr { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 2), 130px); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.datatable .dr span:not(:first-child) { text-align: right; }
.datatable .dr.head { color: var(--jute); font-size: 15px; }
.code { background: var(--roast); color: #EDE6DC; border-radius: 8px; padding: 18px 20px; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-x: auto; max-height: 560px; overflow-y: auto; }
.sequence { display: flex; flex-direction: column; }
.sequence > section { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 26px 0; border-top: 1px solid var(--rule); }
.sequence > section .body { flex: 1 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* settings */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.people li .grow { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; }
.refgroup { border-bottom: 1px solid var(--rule); }
.refgroup > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; font-weight: 700; font-size: 19px; }
.refgroup > summary::-webkit-details-marker { display: none; }
.refgroup > summary svg { transition: transform .15s; }
.refgroup[open] > summary svg { transform: rotate(90deg); }
.refgroup .inner { display: flex; flex-direction: column; gap: 10px; padding: 0 0 20px 30px; }
.refrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 12px 0; border-top: 1px dashed var(--rule); }
.refrow .field { flex: 1 1 180px; }
.refrow .field.wide { flex: 3 1 300px; }
.badge-off { font-size: 15px; color: var(--no); font-weight: 700; }

/* sign-in */
.login { max-width: 520px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 22px; }
.login .wordmark-big { font: 800 64px/1 var(--f-display); }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login .codeinput { font: 700 40px/1 var(--f-display); letter-spacing: .18em; text-align: center; height: 72px; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .band-inner { gap: 0 14px; }
  .wordmark { order: 0; font-size: 24px; }
  #new-link { order: 1; margin-left: auto; min-height: 40px; padding: 0 12px; font-size: 16px; }
  .nav { order: 2; flex-basis: 100%; gap: 0 18px; }
  .nav a { min-height: 44px; font-size: 16px; }
  .who { order: 1; padding: 0; }
  .who span { display: none; }
  .view { padding-top: 24px; }
  h1 { font-size: 44px; }
  .doc-head h1 { font-size: 44px; }
  .row-head .who-name, .row-head .sum { font-size: 25px; }
  .route { min-width: 0; flex-basis: 100%; }
  .route.big .stop { flex-basis: 100px; }
  .route.big .label { font-size: 21px; }
  .route.big .track { margin: 32px -20px 0; }
  .step-num { flex-basis: 100%; }
  .savebar { padding-left: 0; }
  .ringstop { flex-basis: 110px; }
  .ring { width: 84px; height: 84px; }
  .ring span { width: 64px; height: 64px; font-size: 22px; }
  .ringtrack { margin: 41px -20px 0; }
  .sev { flex-basis: 100%; }
  .budget .fig { flex-basis: 100%; align-items: flex-start; }
  .hbar .n { flex-basis: 100px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- training: practice banner, coach marks and the test ---------- */
.trainingbar { background: var(--wait-wash); color: #4A3000; border-bottom: 1px solid var(--wait-ring); }
.trainingbar .inner { max-width: 1180px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.trainingbar .grow { flex: 1; }
.trainingbar .linklike { color: #4A3000; font-weight: 700; }
.coach { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.coach .veil { position: fixed; background: rgba(28, 22, 19, .52); pointer-events: auto; }
.coach .spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 3px var(--wait-ring); pointer-events: none; transition: left .15s, top .15s, width .15s, height .15s; }
.coach .bubble { position: fixed; width: min(400px, calc(100vw - 24px)); padding: 18px 20px 16px; border-radius: 10px; background: var(--paper); color: var(--roast); pointer-events: auto;
  box-shadow: 0 18px 40px rgba(28, 22, 19, .28); display: flex; flex-direction: column; gap: 8px; }
.coach .bubble.modal { width: min(540px, calc(100vw - 24px)); padding: 26px 28px 22px; }
.coach .bubble h2 { margin: 0; font: 800 34px/1.05 var(--f-display); text-wrap: balance; }
.coach .bubble p { margin: 0; font-size: 18px; }
.coach .bubble .stepno { font-size: 14px; font-weight: 700; color: var(--jute); letter-spacing: .04em; }
.coach .bubble .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }
.coach .bubble .actions .grow { flex: 1; }
.coach .bubble .linklike { font-size: 16px; }
.coach .bubble.nudge { animation: nudge .35s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .coach .spot { transition: none; } .coach .bubble.nudge { animation: none; } }

.quiz { gap: 18px; max-width: 860px; }
.quiz-q { margin: 0; padding: 20px 22px; border: 0; border-radius: 8px; background: var(--paper); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.quiz-q legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; display: flex; gap: 12px; font-size: 20px; font-weight: 700; }
.quiz-q legend .num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ground); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.quiz-q .options { display: flex; flex-direction: column; gap: 8px; clear: both; }
.quiz-q .option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--rule-strong); border-radius: 6px; cursor: pointer; }
.quiz-q .option:hover { border-color: var(--roast); }
.quiz-q .option input { accent-color: var(--stamp); width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.quiz-q .option:has(input:checked) { border-color: var(--stamp); background: var(--stamp-wash); }
.quiz-q.wrong { box-shadow: inset 4px 0 0 var(--no); }
.quiz-q .explain { margin: 0; padding: 10px 14px; border-radius: 6px; background: var(--no-wash); color: #7D241A; }
.quiz-route { padding: 6px 0 2px; max-width: 520px; }
.quiz-done { max-width: 720px; gap: 18px; }
.quiz-done .lead { font-size: 20px; margin: 0; }

/* ---------- attention bell ---------- */
.bellbox { position: relative; }
.who .bell { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px; justify-content: center; text-decoration: none; border-radius: 22px; color: #CFC6BA; }
.who .bell svg { width: 22px; height: 22px; }
.who .bell.on { color: #fff; }
.who .bell:hover { background: rgba(255, 255, 255, .08); }
.bell .bellcount { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--no); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.bellpanel { position: absolute; right: -8px; top: calc(100% + 8px); z-index: 50; width: min(380px, calc(100vw - 24px)); padding: 18px 18px 16px; border-radius: 10px;
  background: var(--paper); color: var(--roast); box-shadow: 0 18px 40px rgba(28, 22, 19, .25); display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.bellpanel h2 { margin: 0; font: 800 28px/1.05 var(--f-display); }
.bellpanel p { margin: 0; }
.bellgroups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bellgroups a { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--rule); color: var(--roast); text-decoration: none; }
.bellgroups a:hover .text > span:first-child { text-decoration: underline; }
.bellgroups b { min-width: 40px; font: 700 26px/1 var(--f-display); color: var(--no); text-align: right; font-variant-numeric: tabular-nums; }
.bellgroups .text { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.bellgroups .text .muted { font-weight: 400; font-size: 15px; }
.bellpanel .field { flex: none; border-top: 1px solid var(--rule); padding-top: 12px; }
.idlestrip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--jute); font-weight: 600; }
.tag.idle { color: var(--jute); font-weight: 600; }
@media (max-width: 600px) { .bellpanel { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; max-height: calc(100vh - 96px); overflow-y: auto; } }
.coach .spot.look { pointer-events: auto; cursor: default; }
.coach .bubble .hint { padding: 8px 12px; border-radius: 6px; background: var(--wait-wash); color: #4A3000; font-size: 16px; font-weight: 600; }
