/* cgms-labs · Obscura — tokens, layout and components. */

@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/golos-text-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/golos-text-latin-400-normal.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: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/golos-text-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/golos-text-latin-500-normal.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: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/golos-text-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/golos-text-latin-600-normal.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: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.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; }

/* ---- Tokens ------------------------------------------------------------- */
:root, [data-theme="day"] {
  --bg: #F0F0E9;
  --surface: #FFFFFF;
  --surface-2: #F7F7F2;
  --text: #21221E;
  --text-2: #5D6055;
  --line: #D2D2C7;
  --line-strong: #7B7E72;
  --accent: #655039;
  --accent-soft: #EFE7DA;
  --ink-on-primary: #FFFFFF;
  --ok: #2D6A3C;
  --pending: #36597B;
  --warn: #855600;
  --bad: #A2322A;
  --bad-soft: #F8E9E6;
  --warn-soft: #F6EEDC;
  --focus: #655039;
  --overlay: rgba(33, 34, 30, 0.42);
  --shadow: 0 10px 40px rgba(33, 34, 30, 0.16);
  color-scheme: light;
}
[data-theme="night"] {
  --bg: #171716;
  --surface: #232320;
  --surface-2: #1D1D1B;
  --text: #F1F0E9;
  --text-2: #B6B6AB;
  --line: #3D3D38;
  --line-strong: #8A8A7F;
  --accent: #D8C39E;
  --accent-soft: #2E2A22;
  --ink-on-primary: #171716;
  --ok: #9ECDA5;
  --pending: #AFC6DE;
  --warn: #E4BD74;
  --bad: #F29B91;
  --bad-soft: #33211F;
  --warn-soft: #302A1D;
  --focus: #D8C39E;
  --overlay: rgba(0, 0, 0, 0.62);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/24px 'Golos Text', 'Noto Sans', system-ui, sans-serif;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
p { margin: 0 0 8px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .addr { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.9em; letter-spacing: 0; overflow-wrap: anywhere; }
.mono-num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.small { font-size: 13px; line-height: 20px; }
.skip { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: var(--text); color: var(--bg); z-index: 50; }
.skip:focus { top: 8px; }

/* ---- Shell -------------------------------------------------------------- */
.top { border-bottom: 1px solid var(--line-strong); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top__in { max-width: 1440px; margin: 0 auto; padding: 0 32px; min-height: 56px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; }
.brand__mark { width: 18px; height: 18px; color: var(--text); }
.nav ul { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--text-2); border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.top__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tool { display: inline-flex; align-items: center; gap: 6px; }
.tool__l { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.tool select { min-height: 36px; padding: 4px 28px 4px 8px; }
.catalog { font-size: 14px; color: var(--text-2); white-space: nowrap; padding: 8px 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 2px; font-size: 14px; cursor: pointer; }
.chip--role { cursor: default; background: transparent; }
.chip--attn { border-color: var(--warn); }
.chip__net { color: var(--text-2); }
.banners { max-width: 1440px; margin: 0 auto; padding: 8px 32px 0; }
.banner { display: flex; gap: 10px; align-items: center; margin: 0 0 4px; padding: 8px 12px; border: 1px solid var(--line-strong); font-size: 14px; background: var(--surface-2); }
.banner--attn { border-color: var(--warn); background: var(--warn-soft); }
.main { max-width: 1440px; margin: 0 auto; padding: 24px 32px 96px; outline: none; }
.foot { max-width: 1440px; margin: 0 auto; padding: 16px 32px 32px; color: var(--text-2); font-size: 13px; border-top: 1px solid var(--line); }
.view--enter { animation: fadein 180ms ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---- Typography --------------------------------------------------------- */
.h1 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.025em; font-weight: 500; }
.h1--work { font-size: clamp(34px, 3.6vw, 56px); }
.h3 { font-size: 16px; font-weight: 600; margin: 16px 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lede { max-width: 64ch; color: var(--text-2); margin-top: 12px; font-size: 17px; line-height: 26px; }
.eyebrow, .lbl, .zone__label, .band__title, .frame__who, .subhead { font-size: 12.5px; line-height: 18px; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 500; color: var(--text-2); }
.band__title { color: var(--text); }
.big { font-size: clamp(40px, 5vw, 56px); line-height: 1.05; font-weight: 500; letter-spacing: -0.03em; margin: 0; font-variant-numeric: tabular-nums; }
.big__unit { font-size: 0.42em; letter-spacing: 0.02em; color: var(--text-2); font-weight: 500; }
.mid { font-size: 26px; line-height: 32px; letter-spacing: -0.015em; margin: 2px 0 4px; font-weight: 500; }
.hint { color: var(--text-2); font-size: 14px; line-height: 21px; }
.hint--indent { padding-left: 34px; }
.caption { font-size: 14px; margin-top: 6px; }
.caption--demo { color: var(--text-2); }
.caption--quote { color: var(--pending); }
.caption--bad { color: var(--bad); }
.crumb { margin-bottom: 16px; font-size: 14px; }
.crumb a { color: var(--text-2); }

/* ---- Page structure ----------------------------------------------------- */
.pagehead { padding: 8px 0 24px; }
.pagehead--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.band { border-top: 1px solid var(--line-strong); padding: 20px 0 24px; }
.band__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bands { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 0 40px; margin-top: 28px; }
.bands > .band { min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; align-items: start; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin-top: 12px; }
.actions .why { flex-basis: 100%; }
.sub { margin-top: 12px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.plain { list-style: none; display: grid; gap: 8px; }
.plain li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- A/B typographic zones --------------------------------------------- */
.ab { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); border: 1px solid var(--line-strong); background: var(--surface); }
.ab__arrow { display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--text-2); }
.ab__arrow svg { width: 24px; height: 24px; }
.zone { padding: 24px 28px 28px; min-width: 0; }
.zone__label { margin-bottom: 10px; }
.bigfield { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line-strong); padding-bottom: 6px; margin-bottom: 4px; }
.bigfield input.big, .bigfield output.big { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; outline-offset: 4px; }
.bigfield input.big[aria-invalid="true"] { color: var(--bad); }
.bigfield select { flex: none; }
.bigfield--out { border-bottom-style: dashed; }
.addr-full { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; margin: 6px 0; padding: 8px 10px; border: 1px solid var(--line-strong); background: var(--surface-2); }

/* ---- Forms -------------------------------------------------------------- */
.field { display: grid; gap: 6px; margin-top: 14px; min-width: 0; }
.field > label, .field__l { font-size: 14px; font-weight: 500; }
.field--inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.field--wallet { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
input[type="text"], input:not([type]), input[type="search"], input[inputmode], select, textarea {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--surface); min-width: 0; max-width: 100%;
}
.bigfield input.big { min-height: 56px; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select option:disabled { color: var(--text-2); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.err { display: flex; gap: 8px; align-items: flex-start; color: var(--bad); font-size: 14px; line-height: 20px; margin: 6px 0 0; }
.err[hidden] { display: none; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--text); flex: none; }
.check label { cursor: pointer; }
.why { color: var(--text-2); font-size: 13.5px; line-height: 20px; margin: 6px 0 0; }

/* option rows (executor, wallet account, client) */
.opts { border: 0; margin: 0; padding: 0; display: grid; gap: 0; }
.opt { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--text); }
.opt label { display: grid; gap: 2px; cursor: pointer; min-width: 0; }
.opt__t { font-weight: 500; }
.opt__d { font-size: 13.5px; line-height: 20px; color: var(--text-2); overflow-wrap: anywhere; }
.opt--on .opt__t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.opt--dis label { cursor: not-allowed; }
.opt--dis .opt__t { color: var(--text-2); }

/* visibility modes */
.modes { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.mode { position: relative; border: 1px solid var(--line-strong); padding: 14px 16px 12px 48px; background: var(--surface); }
.mode input { position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; accent-color: var(--text); margin: 0; }
.mode label { cursor: pointer; }
.mode__t { font-weight: 600; }
.mode__line { font-size: 14px; line-height: 21px; margin: 6px 0 0; }
.mode__who { display: inline-block; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-right: 4px; }
.mode--on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.mode--dis { opacity: 0.8; }
.mode--dis label { cursor: not-allowed; color: var(--text-2); }
.consequence { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 21px; margin-top: 14px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 2px; border: 1px solid var(--text); cursor: pointer; font-weight: 500; text-align: center; line-height: 20px; }
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink-on-primary); }
.btn--secondary { background: transparent; }
.btn--secondary:hover { background: var(--surface); }
.btn--quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 4px; padding: 0 10px; }
.btn--danger.btn--secondary, .btn--danger.btn--quiet { color: var(--bad); border-color: var(--bad); }
.btn--danger.btn--primary { background: var(--bad); border-color: var(--bad); color: var(--ink-on-primary); }
.btn[aria-disabled="true"] { background: transparent; color: var(--text-2); border: 1px dashed var(--line-strong); cursor: not-allowed; text-decoration: none; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; min-height: 24px; }
.helpbtn { width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; line-height: 1; flex: none; }
.helpbtn:hover { border-color: var(--text); }

/* ---- Status ------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; line-height: 20px; font-weight: 500; white-space: normal; }
.pill svg, .shape svg { width: 10px; height: 10px; flex: none; }
.pill svg, .shape svg { fill: currentColor; stroke: currentColor; }
.pill--done, .shape--done { color: var(--ok); }
.pill--pending, .shape--pending { color: var(--pending); }
.pill--attn, .shape--attn { color: var(--warn); }
.pill--bad, .shape--bad { color: var(--bad); }
.pill--idle, .shape--idle { color: var(--text-2); }
.shape { display: inline-flex; align-items: center; justify-content: center; width: 16px; flex: none; }
.statusline { display: flex; align-items: center; gap: 16px; }
.statusline .shape { width: 22px; }
.statusline .shape svg { width: 18px; height: 18px; }
.statusline--work { font-size: 26px; line-height: 32px; font-weight: 500; margin: 6px 0 14px; }
.src { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--line); padding: 1px 6px; white-space: nowrap; justify-self: start; }
.tag { display: inline-block; font-size: 13px; padding: 1px 8px; border: 1px solid var(--line-strong); }

/* ---- Notices ------------------------------------------------------------ */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-strong); background: var(--surface); margin: 16px 0; }
.notice > .shape { margin-top: 4px; }
.notice__t { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.notice--attn { border-color: var(--warn); background: var(--warn-soft); }
.notice--bad { border-color: var(--bad); background: var(--bad-soft); }
.notice--aml { display: block; border: 2px solid var(--text); background: var(--surface); padding: 18px 20px; font-size: 16px; line-height: 25px; }
.notice--aml .notice__t { font-size: 20px; }
.summary { border: 2px solid var(--bad); padding: 14px 18px; margin-bottom: 20px; background: var(--bad-soft); outline: none; }
.summary__t { font-weight: 600; }
.summary ul { padding-left: 20px; }
.summary a { color: var(--bad); }
.diff { border: 1px solid var(--warn); padding: 12px 16px; margin: 16px 0 0; background: var(--warn-soft); }
.diff__t { display: flex; gap: 10px; font-weight: 600; }

/* ---- The disclosure frame (signature element) --------------------------- */
.frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.frame { position: relative; border: 1px solid var(--line-strong); padding: 22px 16px 12px; margin-top: 10px; background: var(--surface); min-width: 0; }
.frame__who { position: absolute; top: -10px; left: 12px; margin: 0; padding: 0 8px; background: var(--bg); color: var(--text); }
.frame--private { border: 1.5px solid var(--accent); }
.frame--private .frame__who { color: var(--accent); }
.frame--claim { border-style: dashed; }
.insp .frame__who, .dlg .frame__who, .zone .frame__who { background: var(--surface); }
.frame .kv__row { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }

/* ---- Key/value ---------------------------------------------------------- */
.kv { margin: 0; display: grid; }
.kv__row { display: grid; grid-template-columns: minmax(140px, 0.36fr) minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv__row:last-child { border-bottom: 0; }
.kv dt { color: var(--text-2); font-size: 14px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv--tech dd { font-size: 14px; }

/* ---- Dock (bottom band) ------------------------------------------------- */
.dock { margin-top: 28px; border-top: 2px solid var(--text); background: var(--bg); }
.dock__in { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 18px 0 8px; flex-wrap: wrap; }
.dock__act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 260px; }
.dock__act .why { text-align: right; max-width: 36ch; }
.dock__state { margin: 0; }
.ledger { margin: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 8px 32px; }
.ledger div { display: grid; gap: 2px; }
.ledger dt { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.ledger dd { margin: 0; font-size: 18px; font-weight: 500; }
.ledger .muted { font-size: 13px; font-weight: 400; }
@media (min-width: 1024px) and (min-height: 640px) {
  .page--send .dock { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -1px 0 var(--line); }
  html:has(.page--send) { scroll-padding-bottom: 140px; }
}
.dock--review { position: static; }
.checks { list-style: none; display: grid; gap: 6px; margin-top: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 21px; flex-wrap: wrap; }
.checks li .shape { margin-top: 5px; }
.checks li.no span:not(.shape) { color: var(--text); }
.checks li span:not(.shape) { flex: 1 1 200px; }
.more--checks { border-top: 0; padding: 8px 0 0; }
.assent { border-top: 1px solid var(--line-strong); padding: 20px 0; }

/* ---- Tables ------------------------------------------------------------- */
.tablewrap { position: relative; overflow-x: auto; border-top: 1px solid var(--line-strong); max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 0 12px; height: 52px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl--tight td { height: 44px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tbody tr { transition: background-color 120ms ease; }
.tbl tbody tr:hover { background: var(--surface); }
.tbl .empty { color: var(--text-2); padding: 24px 0; height: auto; }
.empty-state { color: var(--text-2); padding: 24px 0; border-top: 1px solid var(--line); }

/* ---- Toolbar / segmented ------------------------------------------------ */
.toolbar { display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; margin: 4px 0 16px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); }
.seg__b { min-height: 40px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; }
.seg__b:last-child { border-right: 0; }
.seg__b[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg__n { font-variant-numeric: tabular-nums; opacity: 0.8; margin-left: 4px; }
.skeleton { display: grid; gap: 10px; }
.skeleton div { height: 44px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); border-bottom: 1px solid var(--line); }

/* ---- Order detail -------------------------------------------------------- */
.orderhead { padding-bottom: 8px; }
.orderhead .h1 { margin: 6px 0 12px; }
.next { font-size: 18px; line-height: 27px; max-width: 70ch; }
.orderhead__amts { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 24px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); padding: 16px 0; margin: 18px 0 8px; }
.orderhead__amts > div { min-width: 0; }
.masked { letter-spacing: 0.1em; }
.driver { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 20px; align-items: center; border: 1px dashed var(--line-strong); padding: 10px 16px; margin: 16px 0; background: var(--surface-2); }
.driver__l { margin: 0; font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-2); }
.driver__e { margin: 0; }
.driver__a { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.driver__a .why { display: none; }
.milestones { list-style: none; display: grid; }
.ms { display: grid; grid-template-columns: 20px minmax(160px, 1fr) minmax(0, 1.6fr) 92px 120px; gap: 12px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.ms__t { font-weight: 500; }
.ms__s { color: var(--text); }
.ms--idle .ms__t, .ms--idle .ms__s { color: var(--text-2); }
.ms__time { color: var(--text-2); font-size: 14px; }
.subhead { margin: 20px 0 4px; }
.steps { list-style: none; display: grid; gap: 0; }
.steps__i { display: grid; grid-template-columns: 20px minmax(140px, 0.6fr) 1fr; gap: 12px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); }
.steps__i--idle .steps__t { color: var(--text-2); }
.deadlines { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line-strong); }
.deadlines li { padding: 12px 14px; border-right: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.deadlines li:last-child { border-right: 0; }
.deadlines li.past { background: var(--surface-2); }
.deadlines__k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.deadlines__v { font-size: 22px; line-height: 28px; font-weight: 500; }
.deadlines__r { font-size: 14px; }
.deadlines__d { font-size: 13px; line-height: 19px; color: var(--text-2); margin-top: 4px; }
.dl__rel { color: var(--text-2); font-size: 0.92em; }
.more { border-top: 1px solid var(--line-strong); padding: 14px 0; }
.more > summary { cursor: pointer; font-weight: 500; min-height: 32px; list-style-position: outside; }
.more[open] > summary { margin-bottom: 10px; }
.chron { list-style: none; display: grid; }
.chron li { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.chron__t { color: var(--text-2); font-size: 14px; }
.lead-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result { margin-top: 8px; }

/* ---- Work (role) screens ------------------------------------------------ */
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--text); border-bottom: 1px solid var(--line-strong); margin-bottom: 12px; }
.strip__i { min-width: 0; overflow-wrap: anywhere; padding: 14px 16px 12px 0; border-right: 1px solid var(--line); padding-left: 16px; }
.strip__i:first-child { padding-left: 0; }
.strip__i:last-child { border-right: 0; }
.works { display: grid; gap: 0; margin-top: 12px; }
.work { border-top: 1px solid var(--line-strong); padding: 18px 0 22px; display: grid; grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr); gap: 24px; }
.work > * { min-width: 0; }
.work__head { display: grid; gap: 8px; align-content: start; }
.work__t { font-size: 20px; line-height: 26px; }
.work--current { border-top: 2px solid var(--text); }
.work--current .work__t::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.incident { border-top: 1px solid var(--line); padding: 12px 0; }
.checklist { list-style: none; display: grid; }
.checklist__i { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.checklist__t { font-weight: 500; margin: 0; }
.rolegrid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); }
.rolecard { display: grid; gap: 4px; padding: 16px 16px 16px 0; text-decoration: none; border-bottom: 1px solid var(--line); min-height: 100%; }
.rolecard__t { font-weight: 600; font-size: 18px; }
.rolecard__d { color: var(--text-2); font-size: 14px; }

/* help */
.qa { border-top: 1px solid var(--line-strong); }
.qa__i { border-bottom: 1px solid var(--line); }
.qa__i > summary { cursor: pointer; font-size: 19px; line-height: 27px; padding: 14px 0; font-weight: 500; }
.qa__a { padding: 0 0 16px; max-width: 72ch; }
.gloss { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.gloss div { border-bottom: 1px solid var(--line); padding: 10px 0; }
.gloss dt { font-weight: 600; }
.gloss dd { margin: 4px 0 0; color: var(--text-2); font-size: 14.5px; }

/* design sheet */
.ds-theme { background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); padding: 16px; }
.swatches { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.swatches li { display: flex; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border: 1px solid var(--line-strong); flex: none; }
.pillrow { display: flex; gap: 12px; flex-wrap: wrap; }
.bars { margin: 0; display: grid; gap: 8px; }
.bars__row { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr 80px; gap: 12px; align-items: center; }
.bars__track { height: 14px; border: 1px solid var(--line-strong); }
.bars__bar { display: block; height: 100%; background: var(--text); }
.bars__l { font-size: 14px; }
.bars__v { text-align: right; }

/* ---- Dialog & inspector -------------------------------------------------- */
dialog { color: var(--text); }
dialog::backdrop { background: var(--overlay); }
.dlg { border: 1px solid var(--line-strong); border-radius: 2px; padding: 0; background: var(--surface); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.dlg--wide { width: min(760px, calc(100vw - 32px)); }
.dlg__inner { padding: 24px; }
.dlg__title { font-size: 24px; line-height: 30px; margin: 4px 0 14px; }
.dlg__body { max-height: 60vh; overflow: auto; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.dlg--wallet { border-top: 4px solid var(--text); }
.dlg[open] { animation: fadein 180ms ease-out; }
.insp { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); border: 0; border-left: 1px solid var(--line-strong); padding: 0; background: var(--surface); box-shadow: var(--shadow); }
.insp__frame { margin: 16px; min-height: calc(100% - 32px); border: 1px solid var(--line-strong); padding: 20px; }
.insp[open] .insp__frame { animation: reveal 250ms ease-out; }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.insp__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.insp__title { font-size: 26px; line-height: 32px; margin-top: 4px; }
.insp__body p { max-width: 60ch; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 12px 18px; max-width: min(560px, calc(100vw - 32px)); font-size: 15px; box-shadow: var(--shadow); }
.toast--attn { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1320px) {
  .tool__l { display: none; }
  .top__in { gap: 16px; }
  .nav a { padding: 0 8px; }
}
@media (max-width: 1180px) {
  .top__in { flex-wrap: wrap; row-gap: 0; padding-top: 6px; }
  .nav { order: 3; flex-basis: 100%; margin-left: -8px; }
}
@media (max-width: 1180px) {
  .bands { grid-template-columns: 1fr 1fr; }
  .bands > .band:first-child { grid-column: 1 / -1; }
  .frames { grid-template-columns: 1fr 1fr; }
  .ledger { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 900px) {
  .top__in { flex-wrap: wrap; gap: 4px 16px; padding: 6px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { padding: 0 10px 0 0; margin-right: 8px; }
  .top__tools { margin-left: auto; }
  .tool__l { display: none; }
  .banners, .main, .foot { padding-left: 16px; padding-right: 16px; }
  .ab { grid-template-columns: 1fr; }
  .ab__arrow { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 36px; }
  .ab__arrow svg { transform: rotate(90deg); }
  .zone { padding: 18px 16px 20px; }
  .bands { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .frames { grid-template-columns: 1fr; }
  .orderhead__amts { grid-template-columns: 1fr; gap: 12px; }
  .deadlines { grid-template-columns: 1fr 1fr; }
  .deadlines li:nth-child(2) { border-right: 0; }
  .deadlines li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ms { grid-template-columns: 20px 1fr; gap: 2px 12px; }
  .ms > :nth-child(n+3) { grid-column: 2; }
  .steps__i { grid-template-columns: 20px 1fr; }
  .steps__s { grid-column: 2; }
  .work { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip__i:nth-child(2) { border-right: 0; }
  .strip__i:nth-child(3) { padding-left: 0; }
  .rolegrid { grid-template-columns: 1fr; }
  .gloss { grid-template-columns: 1fr; }
  .driver { grid-template-columns: 1fr; }
  .driver__a { justify-content: flex-start; }
  .dock__act { align-items: stretch; min-width: 0; width: 100%; }
  .dock__act .why { text-align: left; }
  .ledger { grid-template-columns: 1fr 1fr; gap: 10px 16px; width: 100%; }
  .kv__row { grid-template-columns: 1fr; gap: 2px; }
  .checklist__i { grid-template-columns: 1fr; gap: 6px; }
  .chron li { grid-template-columns: 70px 1fr; }
  .chron li .src { grid-column: 2; }
  .insp { width: 100vw; border-left: 0; }
  .insp__frame { margin: 8px; }
  .catalog { font-size: 13px; }
}
@media (max-width: 420px) {
  .strip { grid-template-columns: minmax(0, 1fr); }
  .strip__i, .strip__i:nth-child(3) { padding-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .chip__net { display: none; }
  .deadlines { grid-template-columns: 1fr; }
  .deadlines li { border-right: 0; border-bottom: 1px solid var(--line); }
  .ledger { grid-template-columns: 1fr; }
  .bars__row { grid-template-columns: 1fr; }
  .tool select { max-width: 124px; }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 60ms !important; transition-duration: 60ms !important; }
  .insp[open] .insp__frame { animation: fadein 60ms linear; }
}
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation-duration: 60ms !important; transition-duration: 60ms !important; }
[data-motion="reduced"] .insp[open] .insp__frame { animation: fadein 60ms linear; }

@media print {
  .top, .foot, .driver, .actions, .dock__act, .banners { display: none !important; }
}
