/* Group Map: one stylesheet. Tokens first, then layout, components, the map, print.
   No inline styles anywhere: the page runs under default-src 'self'. */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url(../fonts/bricolage-display-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: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url(../fonts/bricolage-display-lat-ext.woff2) format("woff2");
  unicode-range: U+0100-017F, U+0218-021B, U+1E9E, U+2020, U+2113, U+20A0-20AB, U+20AD-20C0; }

:root {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-s: 10px;
  --radius-xs: 7px;
  --rail: 214px;
  --rail-folded: 58px;
  --inspector: 380px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 140ms;
  --t: 240ms;

  --c-person: #FF5C8A; --c-company: #8B6CFF; --c-unit: #1FC9A4; --c-account: #FFC233; --c-card: #FF8A3D;
  --c-contract: #4FA8FF; --c-supplier: #B5DE3F; --c-system: #A3AFC2; --c-other: #D98CFF;
  --g-a: #3DDC97; --g-b: #5BC0FF; --g-c: #FFC233; --g-d: #FF8A3D; --g-x: #8C93AD; --g-h: #FF4FD8;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090B16;
  --bg-2: #0F1224;
  --field: #0C0F1F;
  --panel: rgba(21, 25, 48, .72);
  --panel-solid: #151933;
  --panel-2: rgba(255, 255, 255, .04);
  --panel-3: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #EEF0FF;
  --text-2: #C9CEEA;
  --muted: #959DC4;
  --accent: #8B6CFF;
  --accent-2: #00E0B8;
  --accent-ink: #FFFFFF;
  --warn: #FFB020;
  --danger: #FF5C7A;
  --ok: #3DDC97;
  --halo: #090B16;
  /* F6 (0.5.3): fills that carry white or dark text, and grade colours used as text, at 4.5:1 or better. */
  --accent-fill: #6A47F5; --danger-fill: #D62E52; --warn-fill: var(--warn);
  --g-a-t: var(--g-a); --g-b-t: var(--g-b); --g-c-t: var(--g-c); --g-d-t: var(--g-d); --g-h-t: var(--g-h);
  --dot: rgba(255, 255, 255, .06);
  --glow: 0 0 0 1px rgba(139, 108, 255, .35), 0 8px 40px rgba(139, 108, 255, .28);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --aurora-1: rgba(139, 108, 255, .22);
  --aurora-2: rgba(0, 224, 184, .13);
  --aurora-3: rgba(255, 92, 138, .12);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F4FB;
  --bg-2: #E9EBF7;
  --field: #FFFFFF;
  --panel: rgba(255, 255, 255, .78);
  --panel-solid: #FFFFFF;
  --panel-2: rgba(18, 20, 42, .035);
  --panel-3: rgba(18, 20, 42, .07);
  --line: rgba(18, 20, 42, .10);
  --line-2: rgba(18, 20, 42, .18);
  --text: #12142A;
  --text-2: #2E3352;
  --muted: #59608A;
  --accent: #6A47F5;
  --accent-2: #00A889;
  --accent-ink: #FFFFFF;
  --warn: #B26E00;
  --danger: #D62E52;
  --ok: #138A57;
  --halo: #F3F4FB;
  --accent-fill: var(--accent); --danger-fill: var(--danger); --warn-fill: #E09000;
  --g-a-t: #0F7A4D; --g-b-t: #0A6AA8; --g-c-t: #8A6100; --g-d-t: #B04A00; --g-h-t: #B0198F;
  --dot: rgba(18, 20, 42, .07);
  --glow: 0 0 0 1px rgba(106, 71, 245, .25), 0 8px 30px rgba(106, 71, 245, .18);
  --shadow: 0 10px 30px rgba(30, 30, 80, .12);
  --aurora-1: rgba(106, 71, 245, .12);
  --aurora-2: rgba(0, 168, 137, .09);
  --aurora-3: rgba(255, 92, 138, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, var(--aurora-1), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, var(--aurora-2), transparent 60%),
    radial-gradient(900px 700px at 60% 120%, var(--aurora-3), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--font-body); font-weight: 650; }
p { margin: 0 0 .6em; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
small { font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot-mark { width: 44px; height: 44px; border-radius: 14px; background: conic-gradient(from 0deg, var(--c-person), var(--c-company), var(--c-unit), var(--c-account), var(--c-person)); animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.app { height: 100vh; display: grid; grid-template-rows: auto auto 1fr; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px) saturate(1.4);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.band { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.band svg { width: 16px; height: 16px; }
.band-demo { background: repeating-linear-gradient(135deg, #FFC233 0 18px, #FFB020 18px 36px); color: #1C1300; }
.band-open { background: linear-gradient(90deg, var(--accent-2), #5BC0FF); color: #001A15; }
.band-standin { background: repeating-linear-gradient(135deg, #2B2140 0 18px, #3A2D57 18px 36px); color: #F3EDFF; }
.band-standin button { background: rgba(255,255,255,.18); }
.band button { background: rgba(0,0,0,.14); border: 0; border-radius: 99px; padding: 3px 10px; font-weight: 700; cursor: pointer; color: inherit; }
.main { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--inspector); min-height: 0; transition: grid-template-columns var(--t) var(--ease); }
.main.no-inspector { grid-template-columns: var(--rail) minmax(0, 1fr) 0; }
.main.rail-folded { --rail: var(--rail-folded); }

/* ---------- top bar controls ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 99px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; min-height: 28px; display: inline-flex; align-items: center; gap: 6px; transition: background var(--t-fast), color var(--t-fast); white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; }
.seg button[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent-ink); box-shadow: 0 4px 14px rgba(139,108,255,.35); }
.topbar .seg button:not([aria-pressed="true"]) { color: var(--text-2); }
.seg button:not([aria-pressed="true"]):hover { color: var(--text); background: var(--panel-2); }
.search { position: relative; flex: 1; max-width: 460px; min-width: 160px; }
.search input { width: 100%; padding: 8px 12px 8px 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--field); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.search input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.search > svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font: 11px var(--font-mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 360px; overflow: auto; padding: 6px; border-radius: var(--radius-s); background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; }
.results button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 9px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
.results button[aria-selected="true"], .results button:hover { background: var(--panel-3); }
.results .hint { padding: 8px 10px; color: var(--muted); }
.results small { color: var(--muted); margin-left: auto; font-size: 12px; }
.save { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; padding: 5px 10px; border-radius: 99px; border: 1px solid transparent; background: transparent; cursor: default; }
.save .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.save.unsaved .dot, .save.saving .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.save.saving .dot { animation: pulse 1s ease-in-out infinite; }
.save.error, .save.conflict { color: var(--danger); border-color: var(--danger); cursor: pointer; }
.save.error .dot, .save.conflict .dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }

.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), border-color var(--t-fast); flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--text); border-color: var(--line-2); }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.icon-btn.small { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.small svg { width: 14px; height: 14px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; line-height: 1.5; }
.chip svg { width: 13px; height: 13px; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.accent { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.chip.warn { color: #1C1300; background: var(--warn-fill); border-color: transparent; }
.chip.danger { color: #fff; background: var(--danger-fill); border-color: transparent; }
.chip.ok { color: #00140B; background: var(--ok); border-color: transparent; }
.chip.ghost { background: transparent; }
.chip.lock { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.audience-chip { min-height: 28px; }
.lang-seg button { padding: 5px 9px; font: 700 12px var(--font-mono); letter-spacing: .04em; }
.audience-chip.open { color: #001A15; background: var(--accent-2); border-color: transparent; }
.grade { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 7px; font: 800 12px var(--font-mono); color: #0B0D17; }
.grade-A { background: var(--g-a); } .grade-B { background: var(--g-b); } .grade-C { background: var(--g-c); }
.grade-D { background: var(--g-d); } .grade-X { background: var(--g-x); }
.grade-H { background: var(--g-h); color: #1A0016; }
.tbd { display: inline-block; padding: 0 6px; border-radius: 5px; font: 700 12px var(--font-mono); letter-spacing: .05em; color: var(--muted); border: 1px dashed var(--line-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 650; color: var(--text); transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--c-person))); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 20px rgba(139,108,255,.32); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(139,108,255,.48); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--c-person))); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 28px; padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.small svg { width: 14px; height: 14px; }
.btn.link { min-height: 28px; background: transparent; border-color: transparent; padding: 4px 6px; color: var(--accent); }

/* ---------- rail ---------- */
/* The rail (SPEC 9f, N2): the stages, and under the open stage its items with counts. Folded: icons only. */
.rail { display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 24px; border-right: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); overflow-x: hidden; overflow-y: auto; min-width: 0; }
.rail-head { display: flex; justify-content: flex-end; padding: 0 2px 6px; }
.rail.is-folded .rail-head { justify-content: center; }
.rail-stage { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 650; font-size: 14px; cursor: pointer; text-align: left; transition: background var(--t-fast), color var(--t-fast); }
.rail-stage svg { width: 19px; height: 19px; flex: none; }
.rail-stage:hover { color: var(--text); background: var(--panel-2); }
.rail-stage[aria-current="page"] { color: var(--text); background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.rail-stage[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent); }
.rail-text { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; flex: 1; }
.rail-n { font: 700 12px var(--font-mono); opacity: .7; }
.rail.is-folded .rail-stage { justify-content: center; padding: 6px; }
.rail.is-folded .rail-text { display: none; }
.rail-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin: 2px 0 8px 8px; padding-left: 4px; border-left: 1px solid var(--line); }
.rail-items button { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.rail-items button svg { width: 15px; height: 15px; flex: none; }
.rail-items button .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-items button:hover { color: var(--text); background: var(--panel-2); }
.rail-items button[aria-selected="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rail-items .count { flex: none; font: 700 12px var(--font-mono); padding: 0 5px; border-radius: 99px; background: var(--panel-3); }
.rail-items button[aria-selected="true"] .count { background: var(--accent-fill); color: var(--accent-ink); }
.rail.is-folded .rail-items { margin: 2px 0 8px; padding-left: 0; border-left: 0; justify-items: center; }
.rail.is-folded .rail-items button { justify-content: center; width: 40px; padding: 4px; }
.rail.is-folded .rail-items .t { display: none; }
.rail .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger-fill); color: #fff; font-size: 12px; line-height: 18px; text-align: center; flex: none; }
.rail.is-folded .badge { position: absolute; top: 2px; right: 2px; }
.rail .sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ---------- work area ---------- */
.work { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.page { height: 100%; overflow: auto; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { display: flex; align-items: center; gap: 10px; }
.page-head .stage-tag { font: 700 12px var(--font-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.page-head p { margin: 2px 0 0; color: var(--muted); max-width: 720px; }
.tabs { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button[aria-selected="true"] { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs .count { font: 700 12px var(--font-mono); padding: 0 6px; border-radius: 99px; background: var(--panel-3); }
.tabs button[aria-selected="true"] .count { background: var(--accent-fill); color: var(--accent-ink); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(16px); min-width: 0; }
.card + .card { margin-top: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; align-content: start; }
.field > span { font-size: 12px; font-weight: 650; color: var(--muted); }
.field .err { color: var(--danger); font-size: 12px; }
.field .help { color: var(--muted); font-size: 12px; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--glow); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error, .field-error:focus { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 35%, transparent); }
input.bare { border-color: transparent; background: transparent; padding: 4px 6px; }
input.bare:hover { border-color: var(--line); }
input.bare:focus { background: var(--field); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.claim-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 6px; align-items: center; }
.claim-meta { display: grid; grid-template-columns: minmax(0, 1.4fr) 70px minmax(0, 1fr); gap: 6px; }
.claim-meta select, .claim-meta input { padding: 5px 7px; font-size: 12.5px; }

/* ---------- inspector ---------- */
.inspector { border-left: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px) saturate(1.3); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.no-inspector .inspector { display: none; }
.insp-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.insp-head h3 { font-size: 19px; line-height: 1.2; word-break: break-word; }
.insp-head .kind { font: 700 12px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.insp-body { overflow-y: auto; padding: 12px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.insp-sec { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.insp-sec:last-child { border-bottom: 0; }
.insp-sec h4 { display: flex; align-items: center; gap: 8px; }
.insp-sec h4 .grow + * { margin-left: auto; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; align-items: start; font-size: 13px; }
.kv > dt { color: var(--muted); font-weight: 600; }
.kv > dd { margin: 0; min-width: 0; word-break: break-word; }
.list { display: grid; gap: 4px; }
ul.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--panel-2); border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; color: inherit; min-width: 0; }
.list-item:hover { border-color: var(--line-2); background: var(--panel-3); }
.list-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-item small { color: var(--muted); }
.list-item.archived { opacity: .55; }
/* An icon dropped into a list row or a muted line, with no size of its own (0.5.0: the question panel drew them
   at full width). */
.list-item > svg:not([width]) { width: 16px; height: 16px; flex: none; }
p.muted > svg:not([width]) { width: 14px; height: 14px; vertical-align: -2px; }
.swatch { width: 14px; height: 14px; flex: none; }
.type-badge { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #0B0D17; }
.type-badge svg { width: 20px; height: 20px; }
.claim { display: grid; gap: 6px; padding: 9px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.claim-top { display: flex; align-items: center; gap: 8px; }
.claim-top label { font-size: 12px; font-weight: 650; color: var(--muted); }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: 13px; }
.callout svg { width: 18px; height: 18px; flex: none; color: var(--warn); margin-top: 1px; }
.callout.info { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.callout.info svg { color: var(--accent); }
.callout.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.callout.ok svg { color: var(--ok); }
.minimap { position: relative; overflow: hidden; width: 100%; height: 200px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }

/* ---------- map ---------- */
.map-wrap { position: absolute; inset: 0; }
.map-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.map-svg:active { cursor: grabbing; }
.map-bg { fill: url(#gm-dots); }
.map-tools { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; z-index: 5; flex-wrap: wrap; }
.map-tools > * { pointer-events: auto; }
/* With the panel open the work area is narrow: the toolbar wraps onto a second line, nothing is cut off. */
.map-tools > .toolbar { flex-wrap: wrap; max-width: 100%; row-gap: 4px; }
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 5px; }
.toolbar .divider { width: 1px; align-self: stretch; background: var(--line); margin: 3px 2px; }
.legend { position: absolute; left: 14px; bottom: 14px; z-index: 5; width: 250px; max-height: calc(100% - var(--tools-h, 52px) - 42px); overflow: auto; padding: 10px; font-size: 12.5px; transition: width var(--t) var(--ease); }
.legend.collapsed { width: auto; }
.legend-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 14px; border-radius: 99px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.legend-chip svg { width: 16px; height: 16px; }
.ll.ll-off { display: none; }
.legend-chip .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent-fill); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.pop.legend-pop { max-height: calc(100vh - 160px); overflow: auto; font-size: 13px; }
.legend-head { display: flex; align-items: center; gap: 6px; }
.legend-head h4 { flex: 1; }
.legend-group { margin-top: 8px; }
.legend-group h5 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 3px 6px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; color: var(--text-2); text-align: left; }
.legend-item:hover { background: var(--panel-3); color: var(--text); }
.legend-item[aria-pressed="false"] { opacity: .38; }
.legend-item[aria-pressed="false"] .t { text-decoration: line-through; }
.legend-item svg { flex: none; width: 18px; height: 18px; }
.legend-item .n { margin-left: auto; font: 12px var(--font-mono); color: var(--muted); }
.legend-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.map-hint { position: absolute; right: 14px; bottom: 14px; z-index: 5; padding: 8px 12px; font-size: 12px; color: var(--muted); max-width: 380px; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }

.node { cursor: pointer; }
.node .shape { stroke: var(--halo); stroke-width: 2.5; transition: filter var(--t-fast); }
.node .glyph { fill: none; stroke: rgba(10, 12, 24, .82); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.node.grade-C .shape { stroke-dasharray: 5 3; stroke: var(--text-2); }
.node.grade-D .shape { stroke-dasharray: 1.5 3.5; stroke-linecap: round; stroke: var(--text-2); }
.node.grade-X .shape { stroke-dasharray: 1.5 3.5; stroke-linecap: round; stroke: var(--muted); fill-opacity: .45; }
/* Grade H (SPEC 9b): a guess to be investigated, in its own colour and dash, never mistaken for a fact. */
.node.grade-H .shape { stroke-dasharray: 9 4 2 4; stroke: var(--g-h); stroke-width: 3; fill-opacity: .55; }
.node .hmark circle { fill: var(--g-h); stroke: var(--halo); stroke-width: 1.5; }
.node .hmark path { fill: none; stroke: #1A0016; stroke-width: 1.6; stroke-linecap: round; }
/* Label scale (SPEC 9a.1, 9f): --lscale is 1/zoom (map-labels.js labelScale), so a name keeps its 12 px on screen. */
.node .label { font: 650 calc(12px * var(--lscale, 1)) var(--font-body); fill: var(--text); paint-order: stroke; stroke: var(--halo); stroke-width: calc(4px * var(--lscale, 1)); stroke-linejoin: round; pointer-events: none; }
.node .sub { font: 600 calc(12px * var(--lscale, 1)) var(--font-body); fill: var(--muted); paint-order: stroke; stroke: var(--halo); stroke-width: calc(3.5px * var(--lscale, 1)); pointer-events: none; visibility: hidden; }
.node.sub-on .sub, .node:hover .sub, .node:focus-visible .sub, .node.selected .sub { visibility: visible; }
.node.label-off .label { visibility: hidden; }
.node.label-off:hover .label, .node.label-off:focus-visible .label, .node.label-off.selected .label { visibility: visible; }
.node .sub.warn { fill: var(--warn); }
.node .tbd-tag { font: 800 9px var(--font-mono); fill: var(--muted); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; letter-spacing: .06em; }
.node .ring-sel { fill: none; stroke: var(--accent-2); stroke-width: 3; opacity: 0; }
.node.selected .ring-sel { opacity: 1; filter: drop-shadow(0 0 6px var(--accent-2)); }
.node:hover .shape, .node:focus-visible .shape { filter: brightness(1.12) drop-shadow(0 0 8px rgba(255,255,255,.25)); }
.node:focus { outline: none; }
.node:focus-visible .ring-sel { opacity: 1; stroke: var(--accent); }
.node.archived { opacity: .45; }
.node .lock { fill: var(--warn); stroke: var(--halo); stroke-width: 1.2; }
.node .pin { fill: var(--accent-2); stroke: var(--halo); stroke-width: 1.5; }
.node .flag { fill: var(--warn); stroke: var(--halo); stroke-width: 1.5; }
.node .flag-mark { fill: #1C1300; font: 900 11px var(--font-body); pointer-events: none; }
.node .toggle { fill: var(--panel-solid); stroke: var(--line-2); stroke-width: 1.5; cursor: pointer; }
.node .toggle-t { font: 800 10px var(--font-mono); fill: var(--text); pointer-events: none; }
.node.cluster .shape { fill: var(--panel-3); stroke: var(--line-2); stroke-dasharray: 4 3; stroke-width: 1.5; }
.node.cluster .label { fill: var(--muted); font-weight: 700; }
.node.root .label { font: 800 calc(15px * var(--lscale, 1)) var(--font-display); }
.seg-arc { stroke: var(--halo); stroke-width: 1.5; cursor: pointer; transition: opacity var(--t-fast); }
.seg-arc.unassigned { fill: url(#gm-stripes); }
.seg-arc.tbd { fill: url(#gm-hatch); }
.ring-bg { fill: none; stroke: var(--panel-3); }

.link { fill: none; stroke-width: 1.6; stroke-opacity: .75; transition: stroke-opacity var(--t-fast); }
.link.grade-C { stroke-dasharray: 7 4; }
.link.grade-D { stroke-dasharray: 1.5 4; stroke-linecap: round; }
.link.grade-X { stroke-dasharray: 1.5 4; stroke-linecap: round; stroke: var(--g-x) !important; stroke-opacity: .6; }
.link.grade-H { stroke-dasharray: 9 4 2 4; stroke: var(--g-h) !important; stroke-opacity: .9; }
.link.derived { stroke-opacity: .55; }
.lmark circle { fill: var(--g-h); stroke: var(--halo); stroke-width: 1.5; }
.lmark path { fill: none; stroke: #1A0016; stroke-width: 1.6; stroke-linecap: round; }
.link.ghost { stroke: var(--muted) !important; stroke-dasharray: 2 5; stroke-linecap: round; stroke-opacity: .5; }
.link.archived { stroke-opacity: .25; }
.link.tree { stroke-width: 1.8; }
.link.on-path { stroke-width: 4; stroke-opacity: 1; filter: drop-shadow(0 0 5px var(--accent-2)); }
.link-hit { fill: none; stroke: transparent; stroke-width: 12; cursor: pointer; }
.link-label { font: 700 12px var(--font-mono); fill: var(--text); paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.link-label.tbd { fill: var(--muted); }
.link-label.lock { fill: var(--warn); }
.map-svg.dimming .node:not(.hl), .map-svg.dimming .link:not(.hl), .map-svg.dimming .link-label:not(.hl) { opacity: .4; }
.map-svg.dimming .seg-arc { opacity: .5; }
.map-svg.dimming .node.hl .seg-arc { opacity: 1; }
.map-svg .node, .map-svg .link, .map-svg .link-label { transition: opacity var(--t) var(--ease); }

/* ---------- questions tree ---------- */
.qtree { display: grid; gap: 4px; }
.qrow { display: grid; grid-template-columns: 22px 54px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.qrow:hover { border-color: var(--line-2); }
.qrow.selected { border-color: var(--accent); box-shadow: var(--glow); }
.qrow.np { opacity: .5; }
.qrow.np .qtext { text-decoration: line-through; text-decoration-color: var(--muted); }
.qrow .num { font: 800 13px var(--font-mono); color: var(--accent); }
.qrow .qtext { min-width: 0; }
.qrow .qtext strong { font-weight: 650; }
.qrow .qmeta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.qrow.gate { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, var(--panel)), var(--panel)); }
.twist { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; border-radius: 6px; padding: 0; }
.twist svg { width: 16px; height: 16px; transition: transform var(--t) var(--ease); }
.twist[aria-expanded="false"] svg { transform: rotate(-90deg); }
.twist:hover { background: var(--panel-3); color: var(--text); }
.indent-1 { margin-left: 26px; } .indent-2 { margin-left: 52px; } .indent-3 { margin-left: 78px; } .indent-4 { margin-left: 104px; }
.gate-ans { font: 800 12px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; }
.gate-ans.yes { background: var(--ok); color: #00140B; }
.gate-ans.no { background: var(--danger); color: #fff; }
.gate-ans.unknown { background: var(--panel-3); color: var(--muted); border: 1px dashed var(--line-2); }
.prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.req { display: grid; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.req-head { display: flex; align-items: center; gap: 8px; }
.req-head svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.req.overdue { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* ---------- tables ---------- */
.stack > * { min-width: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(16px); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--panel-solid); z-index: 1; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th button { border: 0; background: transparent; padding: 10px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.data th button:hover { color: var(--text); }
table.data th .static { padding: 10px; display: block; }
table.data td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tr.selected { background: color-mix(in srgb, var(--accent) 14%, transparent); }
table.data tr.archived td { opacity: .5; }
/* The per-item conflict dialog of the hosted store (store/supabase.js). */
.conflict-item { border-top: 1px solid var(--line); padding-top: 10px; }
.conflict-item h4 { margin: 0; }
.conflict-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.conflict-table th { text-align: left; font-size: 12px; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.conflict-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data select.bare { border-color: transparent; background: transparent; padding: 3px 4px; width: auto; min-height: 28px; }
.cell-name { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.toolbar-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-row input[type="search"] { max-width: 280px; }
.toolbar-row select { width: auto; }

/* ---------- findings ---------- */
.findings-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.col-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.col-head .bar { width: 10px; height: 26px; border-radius: 4px; }
.col-head .bar.fact { background: var(--ok); }
.col-head .bar.assessment { background: var(--c-company); }
.fcard { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: transform var(--t) var(--spring), border-color var(--t-fast), box-shadow var(--t-fast); text-align: left; width: 100%; color: inherit; margin-bottom: 10px; }
.fcard:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.fcard.selected { border-color: var(--accent); box-shadow: var(--glow); }
.fcard h3 { font-size: 15px; }
.fcard .amount { font: 800 20px var(--font-display); }
.fcard.fact { border-left: 4px solid var(--ok); }
.fcard.assessment { border-left: 4px solid var(--c-company); }
/* Hypotheses (SPEC 9b): guesses carry the pink H colour and a question mark wherever they show. */
.hyp-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-head .bar.open { background: var(--g-h); }
.col-head .bar.confirmed { background: var(--ok); }
.col-head .bar.refuted { background: var(--muted); }
.fcard.hcard { border-left: 4px dashed var(--g-h); }
.fcard.hcard.confirmed { border-left: 4px solid var(--ok); }
.fcard.hcard.refuted { opacity: .62; filter: grayscale(.85); border-left-color: var(--muted); }
.fcard.hcard p { margin: 0; }
.chip.hyp { background: color-mix(in srgb, var(--g-h) 18%, transparent); color: var(--text); border: 1px dashed var(--g-h); gap: 5px; }
button.chip.hyp { cursor: pointer; font: inherit; }
button.chip.hyp:hover { background: color-mix(in srgb, var(--g-h) 30%, transparent); }
.hmark-ico { flex: none; vertical-align: middle; }
.hmark-ico circle { fill: var(--g-h); }
.hmark-ico path { fill: none; stroke: #1A0016; stroke-width: 1.7; stroke-linecap: round; }
.hyp-line { display: flex; align-items: center; gap: 6px; color: var(--g-h-t); }
.claim-row.is-hyp { border-left: 3px dashed var(--g-h); padding-left: 8px; }
.hyp-select { max-width: 100%; }
.hyp-toggle { display: inline-flex; align-items: center; gap: 6px; }
.hyp-toggle[aria-pressed="false"] { opacity: .6; }
.hyp-toggle[aria-pressed="true"] { border-color: var(--g-h); }
.badge-hyp { cursor: help; }

/* ---------- gaps and leaks ---------- */
.gap-group { margin-bottom: 18px; }
.gap-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gap { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 6px; }
.gap:hover { border-color: var(--line-2); }
.gap .gi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); }
.gap .gi svg { width: 16px; height: 16px; }
.gap.intel .gi { color: var(--accent); } .gap.overdue .gi { color: var(--danger); } .gap.structure .gi { color: var(--c-unit); }
.gap.shares .gi { color: var(--warn); } .gap.grades .gi { color: var(--g-d); } .gap.sources .gi { color: var(--muted); }
.gap .gt { min-width: 0; }
.gap .gt strong { display: block; font-weight: 650; }
.gap .gt small { color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.figure { padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.figure small { display: block; color: var(--muted); font-weight: 650; font-size: 12px; }
.figure strong { display: block; font: 800 22px var(--font-display); margin-top: 2px; font-variant-numeric: tabular-nums; }
.figure.leak { background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 26%, transparent), color-mix(in srgb, var(--warn) 14%, transparent)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.figure.leak.neg { background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 22%, transparent), transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.figure .note { font-size: 12px; color: var(--muted); }
.refusal { display: grid; gap: 4px; }

/* ---------- share ---------- */
.share-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100% - 70px); min-height: 480px; }
.share-preview { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); min-height: 420px; }
.audience-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: left; width: 100%; color: inherit; }
.audience-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--glow); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.audience-opt svg { width: 20px; height: 20px; color: var(--accent); }
.audience-opt strong { display: block; }
.audience-opt small { color: var(--muted); }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.counts div { padding: 8px; border-radius: 10px; background: var(--panel-2); text-align: center; }
.counts strong { display: block; font: 800 18px var(--font-display); }
.counts small { color: var(--muted); font-size: 12px; }

/* ---------- dialogs, toasts, tooltip ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 20px; padding: 0; background: var(--panel-solid); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.5); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(5, 6, 14, .55); backdrop-filter: blur(4px); }
dialog[open] { animation: pop var(--t) var(--spring); }
@keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { flex: 1; font-size: 18px; }
.dlg-body { padding: 16px 18px; overflow: auto; max-height: calc(100vh - 200px); display: grid; gap: 12px; }
.dlg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
/* D1 (0.5.3): a failed save shows in the footer, beside the buttons, so it is in view without scrolling. */
.dlg-foot .form-err { flex: 1 1 260px; margin-right: auto; padding: 8px 10px; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--panel-3); }
.steps span.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop var(--t) var(--spring); max-width: 560px; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--ok); } .toast.warn svg { color: var(--warn); } .toast.error svg { color: var(--danger); }
.tooltip { position: fixed; z-index: 90; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12.5px; max-width: 280px; }
.tooltip strong { display: block; }
.tooltip small { color: var(--muted); }

@media (max-width: 1180px) {
  :root { --inspector: 330px; }
  .findings-cols, .hyp-cols, .grid-2 { grid-template-columns: 1fr; }
  .share-layout { grid-template-columns: 1fr; height: auto; }
}
@media (max-width: 900px) {
  .main, .main.no-inspector { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .inspector { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); z-index: 50; box-shadow: var(--shadow); }
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- print (Share: Print or PDF) ---------- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { height: auto; overflow: visible; background: #fff !important; color: #111; }
  [data-theme] { --halo: #ffffff; --text: #111; --muted: #555; --panel: #fff; --panel-2: #fff; --panel-3: #eee; --line: #ccc; --line-2: #999; }
  .topbar, .rail, .inspector, .map-tools, .legend .icon-btn, .map-hint, .toasts, .tooltip, .band-open button, .no-print { display: none !important; }
  .app, .main { display: block; height: auto; }
  .work { overflow: visible; }
  .page { overflow: visible; height: auto; padding: 0; }
  .map-wrap, .share-preview { position: relative; height: 170mm; border: 0; }
  .legend { position: absolute; box-shadow: none; backdrop-filter: none; }
  .print-title { display: block !important; font: 800 18px var(--font-display); margin-bottom: 6px; }
  .share-layout { display: block; }
  .share-layout > :first-child { display: none; }
}
.print-title { display: none; }

/* ---------- inspector, areas and forms (0.1.0) ---------- */
.insp-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.insp-scroll .insp-body { overflow: visible; }
.insp-head .grow { min-width: 0; }
.chips-row { margin-top: 6px; gap: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.type-swatch { flex: none; }
.span-2 { grid-column: 1 / -1; }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; margin: 0; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.nowrap { flex-wrap: nowrap; }
.hint { color: var(--muted); font-size: 12px; }
.err { color: var(--danger); font-size: 12px; }
.err:empty { display: none; }
.warn-text { color: var(--warn); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.warn-text svg { width: 13px; height: 13px; }
.stack.tight { gap: 4px; }
.callout > div { display: grid; gap: 4px; min-width: 0; }
.callout[hidden] { display: none; }
.callout.danger { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.callout.danger svg { color: var(--danger); }
.callout ul { margin: 0; padding-left: 18px; }
.refusal { display: grid; gap: 3px; }
.suggest { color: var(--text-2); font-style: italic; }
.quote { margin: 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--panel-3); border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.note { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.seg.small button { padding: 3px 9px; font-size: 12px; }
.mini-lock { width: 13px; height: 13px; color: var(--warn); flex: none; }
.claim-row { grid-template-columns: none; padding: 9px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.claim-row.ro { display: flex; align-items: center; gap: 8px; background: transparent; padding: 5px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.claim-row.ro .v { flex: 1; min-width: 0; word-break: break-word; }
.claim-top .k, .claim-row .k { font-size: 12px; font-weight: 650; color: var(--muted); min-width: 92px; }
.claim-top > input, .claim-top > select, .claim-top > textarea { flex: 1; min-width: 0; }
.grade-select { font: 700 12px var(--font-mono); }
.grade-select.g-A { color: var(--g-a-t); } .grade-select.g-B { color: var(--g-b-t); } .grade-select.g-C { color: var(--g-c-t); }
.grade-select.g-D { color: var(--g-d-t); } .grade-select.g-X { color: var(--muted); } .grade-select.g-H { color: var(--g-h-t); }
.id-list { display: grid; gap: 6px; }
.chip.removable { padding-right: 3px; }
.chip.removable .x { border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; margin: -6px -8px -6px -3px; border-radius: 99px; padding: 0; }
.chip.removable .x:hover { background: var(--panel-2); }
.chip.removable .x svg { width: 11px; height: 11px; }
.chip.type { background: transparent; }
ol.steps { display: grid; gap: 12px; padding-left: 20px; margin: 0; }
ol.steps > li { padding-left: 4px; }
ol.steps > li::marker { font: 800 13px var(--font-mono); color: var(--accent); }
.gap.money .gi { color: var(--c-unit); } .gap.evidence .gi { color: var(--g-d); }
.hatch-bg { fill: color-mix(in srgb, var(--warn) 22%, transparent); } .hatch-fg { fill: var(--warn); }
.stripe-bg { fill: var(--panel-3); } .stripe-fg { fill: var(--line-2); }
.map-host { inset: 0; }
.stage-tag { font: 700 12px var(--font-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.split-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--panel-3); border: 1px solid var(--line); }
.split-bar > span { min-width: 3px; }
.split-bar .seg-tbd { background: repeating-linear-gradient(45deg, var(--warn) 0 3px, transparent 3px 7px); }
.split-bar .seg-unassigned { background: repeating-linear-gradient(-45deg, var(--line-2) 0 2px, transparent 2px 6px); }
.dot-sw { display: inline-grid; place-items: center; width: 14px; flex: none; }
.dot-sw i { width: 10px; height: 10px; border-radius: 99px; display: block; }
.link-ends { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-ends .end { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; color: var(--text); font-weight: 650; }
.link-ends .end:hover { border-color: var(--accent); }
.link-ends .verb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.link-ends .verb svg { width: 14px; height: 14px; }
.list-item.path { align-items: flex-start; }
.list-item.path.on { border-color: var(--accent); box-shadow: var(--glow); }
.list-item .t.wrap { white-space: normal; overflow: visible; }
.list-item .num { font: 800 12px var(--font-mono); color: var(--accent); min-width: 16px; }
.list.hubs { list-style: none; padding: 0; margin: 0; }
.hub-track { display: block; height: 4px; border-radius: 4px; background: var(--panel-3); margin-top: 4px; overflow: hidden; }
.hub-bar { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }
.type-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.type-counts .tc { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--panel-2); }
.type-counts strong { font: 800 17px var(--font-display); }
.type-counts small { color: var(--muted); font-size: 12px; }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 5px; color: var(--text-2); font-size: 13px; }
kbd { font: 700 12px var(--font-mono); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--panel-3); }
.statement { font-size: 14px; line-height: 1.5; }
.req .btn.link { justify-self: start; text-align: left; }
.req.archived { opacity: .55; }
code.path { font: 12px var(--font-mono); padding: 1px 6px; border-radius: 6px; background: var(--panel-3); word-break: break-all; }
.gate-seg .g-yes[aria-pressed="true"] { background: var(--ok); color: #00140B; }
.gate-seg .g-no[aria-pressed="true"] { background: var(--danger); color: #fff; }
.gate-seg .g-unknown[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
/* areas */
.q-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.figure.warn strong { color: var(--warn); } .figure.danger strong { color: var(--danger); }
.tree-tools { margin-bottom: 8px; }
.qrow .qtext small { display: block; margin-top: 1px; }
.qrow.archived { opacity: .5; }
.qrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.board { margin-top: 26px; display: grid; gap: 12px; }
.board > .row p { margin: 0; max-width: 560px; }
.req-group h4 { margin-bottom: 8px; }
.req-group.danger h4 { color: var(--danger); }
details.req-group summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.toolbar-row { margin-bottom: 12px; gap: 10px; }
.search.inline { flex: 0 1 340px; }
.grade-strip { margin-bottom: 12px; gap: 12px; }
.grade-strip .gs { display: inline-flex; align-items: center; gap: 5px; }
.grade-strip b { font: 700 13px var(--font-mono); }
.clip { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.nk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-right: 4px; }
.nk svg { width: 13px; height: 13px; }
.nk.lock { color: var(--warn); }
table.data td.act { white-space: nowrap; text-align: right; }
table.data td.act .icon-btn + .icon-btn { margin-left: 4px; }
table.data input.bare { width: 100%; min-width: 140px; font-weight: 600; }
table.data .btn.link { padding: 2px 0; text-align: left; }
table.data th .sort-ic { width: 12px; height: 12px; }
.link-type { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lt-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.share-side { overflow: auto; min-height: 0; }
.share-side h3 { font-size: 15px; }
.share-actions { position: sticky; bottom: 0; z-index: 2; gap: 8px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: 0 -6px 18px rgba(0, 0, 0, .18); }
.share-actions p { margin: 0; }
.share-preview .print-title { position: absolute; top: 10px; left: 14px; z-index: 3; }
@media print { .page-head { display: none; } }

/* Per-claim open switch (SPEC 9a.1): a lock that is warm while restricted, accent when shown in the Open view. */
.lock-toggle { color: var(--warn); }
.lock-toggle.is-open { color: var(--accent-2); border-color: var(--accent-2); }
.alias-locks { display: flex; flex-direction: column; gap: 6px; }
.alias-lock { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 2px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--text-2); }
.alias-lock.is-open { border-color: var(--accent-2); color: var(--text); }
.alias-lock .icon-btn.small { width: 28px; height: 28px; margin: -2px; border-radius: 999px; }

/* Equal checks (SPEC 9b): a hit lists the links that produced it and asks, never concludes. */
.worth-group { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.worth-list { gap: 8px; }
/* The checks as a page (Analysis, Worth a look): the panel's sections without the panel's own scroll and padding. */
.page .checks-body { overflow: visible; padding: 0 0 40px; max-width: 880px; }
.worth-row { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.worth-row p { margin: 0; }
.worth-row > .row > svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.worth-links { gap: 6px; }
.worth-sub { margin: 14px 0 2px; font-size: 13px; letter-spacing: .02em; color: var(--text-2); }
.worth-row .worth-src { color: var(--muted); }
.worth-links .chip-btn { gap: 6px; }
.gap.task-doer .gi { color: var(--warn); } .gap.task-5w1h .gi { color: var(--accent); } .gap.task-told .gi { color: var(--g-d); }
.chip-btn { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); cursor: pointer; text-align: left; max-width: 100%; }
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--accent-2); color: var(--text); }

/* Intake (SPEC 9b): the quick note in the top bar and the Unprocessed notes. */
.quick { position: relative; flex: 1; max-width: 360px; min-width: 160px; }
.quick input { width: 100%; padding: 8px 12px 8px 36px; border-radius: 99px; border: 1px dashed var(--line); background: var(--field); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.quick input:focus { border-color: var(--accent); border-style: solid; box-shadow: var(--glow); }
.quick > svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.intake { max-width: 860px; }
.intake h3 { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.intake-note { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.intake-note.done { opacity: .78; }
.intake-note.archived { opacity: .55; }
.intake-note .note-text { margin: 0; font-size: 15px; }
.lock-note { display: flex; align-items: center; gap: 6px; }
.lock-note svg { width: 14px; height: 14px; flex: none; }

/* Journal (SPEC 9b): an item's history in the inspector. */
.history { display: flex; flex-direction: column; gap: 8px; }
.hist-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.hist-fields { margin: 0; padding-left: 16px; font-size: 13px; color: var(--text-2); }
.hist-fields li { overflow-wrap: anywhere; }
.hist-fields svg { width: 12px; height: 12px; vertical-align: -1px; }

/* Plans (SPEC 9c): the seven-step rail on the left, the open step on the right. Cleared view only. */
.fcard-wrap { margin-bottom: 10px; }
.fcard-wrap .fcard { margin-bottom: 0; }
.fcard-actions { display: flex; gap: 8px; padding: 6px 4px 0; }
.plan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 18px; }
.plan-card { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: left; color: inherit; }
.plan-card h3 { font-size: 15px; }
.plan-card p { margin: 0; }
.plan-sub { margin: 4px 0 10px; font-size: 15px; color: var(--text-2); }
.plan-back { padding: 0 0 4px; display: block; }
.plan-grid { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 18px; align-items: start; }
.plan-rail { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; position: sticky; top: 0; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); counter-reset: none; }
.plan-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.plan-step:hover:not(:disabled) { background: var(--panel-3); }
.plan-step:disabled { cursor: not-allowed; }
.plan-step .num { flex: none; width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font: 800 12px var(--font-mono); background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); }
.plan-step .num svg { width: 15px; height: 15px; }
.plan-step .txt { display: grid; gap: 1px; min-width: 0; }
.plan-step .txt strong { font-size: 13.5px; }
.plan-step .txt small { color: var(--muted); font-size: 12px; }
.plan-step.done .num { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.plan-step.current .num { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.plan-step.next .num { border-color: var(--accent); color: var(--accent); border-style: dashed; }
.plan-step.locked { opacity: .62; }
.plan-step.locked .num { color: var(--muted); }
.plan-step.viewing { background: var(--panel-3); border-color: var(--line-2); }
.plan-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 16px 18px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.plan-step-head { display: flex; align-items: flex-start; gap: 12px; }
.plan-step-head .roman { font: 800 26px/1 var(--font-display); color: var(--accent); min-width: 44px; }
.plan-step-head p { margin: 2px 0 0; max-width: 680px; }
.plan-block { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-block h4 { display: flex; align-items: center; gap: 8px; }
.plan-block > p { margin: 0; max-width: 720px; }
.plan-rows { display: grid; gap: 6px; }
.plan-row { display: flex; align-items: flex-start; gap: 8px; }
.plan-row .grow { min-width: 0; }
.plan-row .grow input, .plan-row .grow textarea { width: 100%; }
.plan-row .side { flex: none; max-width: 46%; }
.plan-row.broken input { border-color: var(--danger); }
.plan-row.add { padding-top: 4px; }
.plan-ro { margin: 0; white-space: pre-wrap; }
.plan-finding { display: grid; gap: 6px; }
.plan-finding h4 { font-size: 15px; }
.plan-finding p { margin: 0; }
.plan-finding .amount { font: 800 20px var(--font-display); }
.form-grid.mission { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-foot p { margin: 0; }
.plan-missing { font-size: 13px; }
.plan-missing ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.ok-text { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.ok-text svg { width: 16px; height: 16px; }
.assume-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 13px; }
.assume { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.assume select { padding: 2px 6px; font-size: 12px; }
.assume.broken { border-color: var(--danger); color: var(--danger); }
.assume svg { width: 13px; height: 13px; }
@media (max-width: 1180px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-rail { position: static; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- COAs (SPEC 9c, step III on) ---------- */
.coa-summary { gap: 8px; }
.coa-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.coa-card { min-width: 0; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); }
.coa-card.open { border-color: var(--line-2); box-shadow: var(--shadow); }
.coa-card.out { background: var(--panel); }
.coa-card.out .coa-head { opacity: .62; filter: grayscale(.85); }
.coa-card.archived { opacity: .55; }
.coa-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.coa-head:hover { background: var(--panel-3); }
.coa-head > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.coa-id { font: 700 12px var(--font-mono); color: var(--accent); flex: none; }
.coa-title { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.coa-head .chip { flex: none; }
.coa-body .form-grid { align-items: start; }
.coa-body .field { align-content: start; }
.coa-dots { display: inline-flex; gap: 3px; flex: none; }
.coa-dots .dot { width: 9px; height: 9px; border-radius: 99px; border: 1.5px solid var(--muted); }
.coa-dots .dot.pass { background: var(--ok); border-color: var(--ok); }
.coa-dots .dot.fail { background: var(--danger); border-color: var(--danger); }
.coa-reason { margin: 0; padding: 0 12px 10px; color: var(--text-2); }
.coa-body { display: grid; gap: 14px; padding: 4px 12px 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.coa-sub { display: grid; gap: 8px; }
.coa-sub h5 { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: 12.5px; cursor: pointer; text-align: left; }
.chip-toggle svg { width: 13px; height: 13px; }
.chip-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip-toggle.broken { border-color: var(--danger); color: var(--danger); }
.chip-toggle:disabled { cursor: default; }
.screen-row { display: grid; grid-template-columns: minmax(0, 1.1fr) auto; gap: 6px 12px; align-items: start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.screen-row.pass { border-left: 3px solid var(--ok); }
.screen-row.fail { border-left: 3px solid var(--danger); }
.screen-q { display: grid; gap: 2px; min-width: 0; }
.screen-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.screen-controls .seg button { padding: 4px 10px; font-size: 12.5px; }
.screen-controls select { max-width: 240px; }
.screen-note { grid-column: 1 / -1; }
.screen-note input { width: 100%; }
.screen-hint { grid-column: 1 / -1; }
.coa-actions { gap: 8px; align-items: center; }
@media (max-width: 1360px) {
  .screen-row { grid-template-columns: minmax(0, 1fr); }
  .screen-controls { justify-content: flex-start; }
}
.wg-rows { display: grid; gap: 8px; }
.wg-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 40px 10px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.wg-row .field input, .wg-row .field select, .wg-row .field textarea { width: 100%; }
.wg-row .wg-remove { position: absolute; top: 6px; right: 6px; }
.wg-back { padding-top: 10px; border-top: 1px dashed var(--line); }
.compare-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
table.compare.many { min-width: 640px; }
table.compare th, table.compare td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.compare thead th { background: var(--panel-2); font-weight: 650; }
table.compare thead th .chip { margin-top: 4px; }
table.compare tbody th { color: var(--muted); font-weight: 600; width: 132px; }
table.compare tbody th small { display: block; font-weight: 500; }
table.compare .baseline { background: color-mix(in srgb, var(--muted) 8%, transparent); color: var(--text-2); }
table.compare .compare-title { font-size: 13px; margin-top: 2px; }
table.compare .compare-sep th { color: var(--text-2); background: var(--panel-2); font-size: 12px; }
table.compare .compare-sep th .chip { margin-left: 8px; }
table.compare .compare-total th, table.compare .compare-total td { border-bottom: 0; }
table.compare td.score select { width: 100%; min-width: 90px; }
.card.recommend, .card.decision { display: grid; gap: 8px; }

/* Step VII (SPEC 9c): the task checklist, the SOPs, each person's sheet. */
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "box what what rm" ". who by ."; gap: 6px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-row > input[type="checkbox"] { grid-area: box; width: 16px; height: 16px; accent-color: var(--accent); justify-self: center; }
.task-row > .task-box { grid-area: box; }
.task-row .task-what { grid-area: what; min-width: 0; }
.task-row .task-what input { width: 100%; }
.task-row > select { grid-area: who; width: 100%; min-width: 0; }
.task-row > input[type="date"] { grid-area: by; width: 100%; min-width: 0; }
.task-row > .icon-btn, .task-row > .task-rm { grid-area: rm; }
.task-row.done .task-what input, .task-row.done .task-what .plan-ro { text-decoration: line-through; color: var(--muted); }
.task-row.add { border-bottom: 0; }
.sop-card { display: grid; gap: 10px; }
.sop-card .form-grid { align-items: start; }
.sop-card .field { align-content: start; }
.sop-title { min-width: 0; overflow-wrap: anywhere; }
.sop-steps { margin: 0; padding-left: 20px; }
.sheet-preview { border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: #14121f; padding: 4px 8px; max-height: 420px; overflow: auto; }
.sheet-preview main { max-width: 640px; padding: 12px 8px; }
.sheet-preview h1 { font-size: 20px; margin: 0 0 4px; }
.sheet-preview h2 { font-size: 15px; margin: 16px 0 6px; }
.sheet-preview h2.part { margin-top: 22px; padding-top: 10px; border-top: 1px solid #e4e1f0; }
.sheet-preview .meta, .sheet-preview .by, .sheet-preview .np { color: #5c5873; font-size: 13px; }
.sheet-preview ul, .sheet-preview ol { padding-left: 22px; margin: 0; }

/* Cross-links (SPEC 9c): a COA on a broken assumption, the raised CCIRs. */
.coa-reason.broken { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); }
.coa-reason.broken svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.card.decision .coa-reason.broken { padding: 0; }
.ccir-raised .list-item { align-items: flex-start; }
.ccir-raised .list-item svg { width: 16px; height: 16px; flex: none; color: var(--danger); margin-top: 2px; }
.ccir-raised .t { display: grid; gap: 2px; min-width: 0; }

/* ---------- Register > Figures (0.4.0, SPEC 9d) ---------- */
.fg-tab .toolbar-row { margin-bottom: 0; }
.fg-editrow:not(.banner) { padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.fg-grid { font-variant-numeric: tabular-nums; }
.fg-grid th, .fg-grid td { white-space: nowrap; }
.fg-grid th.num .static { text-align: right; }
.fg-grid th.fg-year { padding: 6px 10px; color: var(--text-2); text-transform: none; letter-spacing: 0; font: 600 12.5px var(--font-mono); position: static; background: transparent; }
.fg-grid td.fg-cell { padding: 2px 3px; position: relative; text-align: right; min-width: 64px; }
.fg-grid .fg-val { border: 0; background: transparent; color: var(--text); font: 12.5px var(--font-mono); padding: 5px 6px; min-height: 28px; width: 100%; text-align: right; cursor: pointer; border-radius: 6px; }
.fg-grid .fg-val:hover, .fg-grid .fg-val:focus-visible { background: var(--panel-3); }
.fg-grid .fg-input { width: 100%; min-width: 96px; font: 12.5px var(--font-mono); text-align: right; padding: 5px 6px; }
.fg-grid tr.fg-yearrow > *, .fg-grid tr.fg-yearrow + tr > * { border-top: 1px solid var(--line-2, var(--line)); }
.fg-grid tr.fg-rowsrow td { padding: 2px 3px; }
.fg-grid .fg-input::placeholder { color: var(--muted); font-style: italic; opacity: .9; }
.fg-grid .fg-input:disabled { opacity: .3; }
.fg-grid td.other .fg-input { border-style: dashed; }
.fg-grid td.fg-gap { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.gap.figgap .gi { color: var(--accent); }
.fg-gaptag { font: 600 12px var(--font-body); color: var(--warn); letter-spacing: .04em; text-transform: uppercase; padding-right: 6px; }
.fg-grid td.disagree { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 16%, transparent) 0 3px, transparent 3px 7px); }
.fg-mark { position: absolute; top: 0; right: 0; border: 0; background: transparent; padding: 1px; color: var(--warn); cursor: pointer; line-height: 0; border-radius: 4px; }
.fg-mark svg, .fg-key svg { width: 11px; height: 11px; }
.fg-key { color: var(--warn); display: inline-flex; vertical-align: -1px; }
.fg-annual { text-align: right; font: 12.5px var(--font-mono); }
.fg-annual small { font-family: var(--font-body); }
.fg-section h3 { margin: 0; }
.fg-covers .mono { white-space: nowrap; }
.fg-import .row.wrap { align-items: flex-end; }
.fg-import .field input, .fg-import .field select { min-width: 150px; }
.fg-map { max-height: 260px; overflow: auto; }
.fg-refused { max-height: 180px; overflow: auto; }

/* v0.4.0 map switches (SPEC 9d): the principal's fixed colour, the neutral node, the TBD size, the split inside */
:root { --principal: #FFFFFF; --neutral-node: #5D6478; }
[data-theme="light"] { --principal: #14182A; --neutral-node: #A6ACBC; }
.node .shape.tbd-size { stroke: var(--text-2, var(--muted)); stroke-width: 1.6; stroke-dasharray: 4 3; fill-opacity: .35; }
.node g.split .seg-in { stroke: var(--halo); stroke-width: 1.2; }
.node g.split .seg-in.principal { stroke-width: 1.6; }
.node g.split .split-edge { fill: none; stroke-width: 1.5; pointer-events: none; }
.node g.split .split-edge:not(.coloured) { stroke: var(--halo); }
.node g.split .split-edge.coloured { stroke-width: 3.5; }
.tip-table { border-collapse: collapse; margin-top: 2px; font-size: 12px; }
.tip-table td { padding: 1px 6px 1px 0; }
.tip-table td.num { text-align: right; font-family: var(--font-mono); }
.map-tools .layer-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-tools .layer-tools { flex-wrap: nowrap; }
.legend .size-settings { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.legend .size-set { display: grid; gap: 2px; font: 600 12px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.legend .size-set select { width: auto; min-width: 0; padding: 3px 6px; font: 600 12px var(--font-body); text-transform: none; letter-spacing: 0; }
.legend .size-key { display: flex; align-items: flex-end; gap: 10px; padding: 4px 0 2px; }
.legend .size-key figure { margin: 0; display: grid; justify-items: center; gap: 2px; font: 600 12px var(--font-mono); color: var(--text-2, var(--muted)); }

/* v0.4.0 Exposure beside the map */
.exposure-panel { position: absolute; right: 14px; top: calc(var(--tools-h, 60px) + 26px); width: 340px; max-width: calc(100% - 28px); max-height: calc(100% - var(--tools-h, 60px) - 44px); overflow: auto; z-index: 4; padding: 12px 14px; }
.exposure-panel .ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exposure-panel h4 { margin: 0; font: 700 14px var(--font-display, var(--font-body)); }
.exposure-panel h5 { margin: 12px 0 4px; font: 700 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.exposure-panel p { margin: 6px 0; }
.exposure-panel .size-settings { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.exposure-panel .size-set { display: grid; gap: 2px; font: 600 12px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.exposure-panel .size-set select { width: auto; padding: 3px 6px; font: 600 12px var(--font-body); text-transform: none; letter-spacing: 0; }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex-row { display: grid; grid-template-columns: 20px 1fr; gap: 6px; align-items: start; }
.ex-rank { font: 700 12px var(--font-mono); color: var(--muted); text-align: right; padding-top: 2px; }
.ex-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ex-name { padding: 0; text-align: left; font-weight: 650; }
.ex-val { font: 700 12.5px var(--font-mono); white-space: nowrap; }
.ex-bar { height: 6px; border-radius: 3px; background: var(--panel-3); margin: 3px 0; overflow: hidden; }
.ex-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.ex-why { margin: 2px 0 0; padding-left: 16px; }
.ex-row.ex-tbd .ex-val { color: var(--warn); font: 800 12px var(--font-mono); letter-spacing: .06em; }
.layer-tools .btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 24%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent) 70%, transparent); color: var(--text); }
.layer-tools .btn[aria-pressed="false"] { color: var(--text-2, var(--muted)); }

/* Analysis > Numbers (0.4.0, SPEC 9d) */
.nb-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.nb-set { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.nb-set select { width: auto; min-width: 90px; }
.nb-title { margin: 6px 0 8px; font-size: 15px; }
.nb-sub { margin: 18px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nb-figure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 8px 10px; max-width: 920px; }
.nb-chart { display: block; height: auto; font-family: var(--font-mono); font-size: 11px; overflow: visible; }
.nb-axis text { fill: var(--muted); font-size: 11px; }
.nb-axis .domain { stroke: var(--line); }
.nb-names text { fill: var(--text); font-family: var(--font-sans, inherit); font-size: 12px; }
.nb-grid { stroke: var(--line); stroke-opacity: .55; }
.nb-line { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.nb-year.latest .nb-line { stroke: var(--accent); stroke-width: 2.6; }
.nb-pt { fill: var(--panel-solid); stroke: var(--muted); stroke-width: 1.5; cursor: pointer; }
.nb-year.latest .nb-pt { stroke: var(--accent); }
.nb-pt.disagree { stroke: var(--warn); stroke-width: 2.5; }
.nb-endlabel { fill: var(--muted); font-weight: 700; }
.nb-year.latest .nb-endlabel { fill: var(--text); }
.nb-gap { stroke: var(--warn); stroke-dasharray: 3 2; }
.nb-chart rect.nb-bar, .nb-chart g[role="button"] { cursor: pointer; }
rect.nb-bar { fill: color-mix(in srgb, var(--accent) 55%, transparent); stroke: var(--accent); stroke-width: 1; }
rect.nb-bar.above { fill: color-mix(in srgb, var(--accent) 80%, transparent); }
rect.nb-bar.tbd { stroke: var(--warn); stroke-dasharray: 4 3; }
rect.nb-bar.fixed { fill: color-mix(in srgb, var(--accent) 75%, transparent); }
rect.nb-bar.variable { stroke: var(--accent); }
.nb-var-bg { fill: color-mix(in srgb, var(--accent) 12%, transparent); } .nb-var-fg { fill: var(--accent); }
.nb-val, .nb-median-label, .nb-endlabel { paint-order: stroke; stroke: var(--panel-solid); stroke-width: 4px; stroke-linejoin: round; }
.nb-val { fill: var(--text); font-size: 11.5px; }
.nb-plate { fill: var(--panel-solid); pointer-events: none; }
.nb-in { fill: var(--accent-ink, #fff); font-size: 11px; font-weight: 700; pointer-events: none; }
.nb-key { fill: var(--muted); font-size: 11.5px; }
.nb-median { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; }
.nb-median-label { fill: var(--text); font-size: 11px; font-weight: 700; }
.nb-chart [tabindex]:focus { outline: none; }
.nb-chart [tabindex]:focus-visible { stroke: var(--text); stroke-width: 3; }
.nb-chart g[tabindex]:focus-visible rect { stroke: var(--text); stroke-width: 2.5; }
.nb-table th, .nb-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.nb-table .num { text-align: right; }
.nb-empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); max-width: 920px; }

/* ---------- 0.5.0: who does what (SPEC 9e) ---------- */
/* Each role its own colour, but the shape and the letter carry it: the colour is a help, never the only sign. */
[data-theme="dark"] { --r-does: #00E0B8; --r-covers: #5BC0FF; --r-decides: #FFC233; --r-checks: #FF7AA2; --r-receives: #B7BFD6; }
[data-theme="light"] { --r-does: #00866D; --r-covers: #1F7FC9; --r-decides: #A86A00; --r-checks: #C93466; --r-receives: #5C6485; }
.r-does { --rc: var(--r-does); } .r-covers { --rc: var(--r-covers); } .r-decides { --rc: var(--r-decides); }
.r-checks { --rc: var(--r-checks); } .r-receives { --rc: var(--r-receives); }
.rmark { flex: none; overflow: visible; vertical-align: middle; }
.rmark .rm-shape { stroke: var(--rc); stroke-width: 1.6; stroke-linejoin: round; }
.rmark.told .rm-shape { fill: color-mix(in srgb, var(--rc) 12%, transparent); stroke-dasharray: 2.6 2; }
.rmark.seen .rm-shape { fill: var(--rc); }
.rmark .rm-letter { font: 800 9px var(--font-mono); text-anchor: middle; dominant-baseline: central; fill: var(--rc); pointer-events: none; }
.rmark.seen .rm-letter { fill: #0B0D17; }
.rmark .rm-dispute { fill: var(--danger); stroke: var(--halo); stroke-width: .8; }
.kind-dot { display: inline-block; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); }
.chip.kind-chip { gap: 6px; background: transparent; }

.seen-switch { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.seen-switch svg { width: 13px; height: 13px; }
.seen-switch.is-seen { border-style: solid; border-color: color-mix(in srgb, var(--ok) 60%, transparent); background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--text); }
.seen-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pick { position: relative; min-width: 0; }
.pick input { width: 100%; }
.pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); display: grid; gap: 2px; padding: 4px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.pick-list[hidden] { display: none; }
.pick-opt { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.pick-opt[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.pick-opt .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-opt small { color: var(--muted); }
.pick-opt.create { color: var(--accent-2); font-weight: 650; }
.pick-opt.current .t { font-weight: 700; }
.pick-opt svg { width: 14px; height: 14px; flex: none; }
.pick-chip { padding-right: 3px; }
.pick-chip.new { border-style: dashed; border-color: var(--accent-2); }
.pick-chip small { color: var(--accent-2); font-weight: 700; }
.pick-chip .icon-btn.small { width: 28px; height: 28px; margin: -4px -6px -4px -2px; border-radius: 99px; }
.pick-chip .icon-btn.small svg { width: 11px; height: 11px; }

.task-card { gap: 14px; }
.sitting-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.sitting-bar .k { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }
.sitting-bar .k svg { width: 15px; height: 15px; color: var(--accent); }
.sitting-bar select { flex: 1 1 260px; width: auto; min-width: 0; }
.sitting-bar select + select { flex: 0 1 210px; }
.sitting-bar input[type="date"] { flex: 0 0 auto; width: auto; }
.sitting-bar small { flex-basis: 100%; }
.proc-step { align-items: end; }
.proc-step .field:first-child { flex: 1; min-width: 0; }
.proc-step .field:last-child { width: 92px; flex: none; }
.card-sec { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.card-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.role-rows { display: grid; gap: 6px; }
.role-row { display: grid; grid-template-columns: 22px minmax(110px, 1fr) minmax(150px, 240px) auto 124px minmax(0, auto) 28px; gap: 8px; align-items: center; }
.role-row .who-name { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-row .who-name small { color: var(--accent-2); }
.role-add { align-items: stretch; }
.role-add .pick { flex: 1; }
.role-add select { flex: 0 1 260px; width: auto; }
.card-lines { display: grid; gap: 6px; }
.card-line { display: grid; grid-template-columns: 168px minmax(0, 1fr) 76px 30px; gap: 8px; align-items: center; }
.card-line .k { display: grid; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.card-line .k small { color: var(--warn); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card-line textarea { min-height: 58px; }
.card-line .src-note { grid-column: 2 / -1; margin-top: -3px; }
.card-line .seen-switch { justify-content: center; }
.lock-gap { display: grid; place-items: center; color: var(--muted); }
.lock-gap svg { width: 14px; height: 14px; }
.src-note { font-size: 12px; }
.task-card .keys { border-top: 1px dashed var(--line); padding-top: 8px; }
/* T2 (0.6.0): the card in four steps, the sitting above them. */
.card-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; }
.card-step { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.card-step:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card-step .num { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 99px; border: 1px solid currentColor; font-size: 12px; font-variant-numeric: tabular-nums; }
.card-step .num svg { width: 14px; height: 14px; }
.card-step.done { color: var(--text); }
.card-step.done .num { color: var(--ok); }
.card-step[aria-current="step"] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.card-step[aria-current="step"] .num { background: var(--accent-fill); border-color: transparent; color: #fff; }
.card-step.failed, .card-step.failed .num { color: var(--danger); border-color: var(--danger); }
.card-step.failed[aria-current="step"] .num { background: var(--danger-fill); color: #fff; }
.card-step-body { display: grid; gap: 12px; min-height: 180px; align-content: start; }
.field-err { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: 12px; }
.field-err svg { width: 14px; height: 14px; flex: none; }

.proc-strip { gap: 6px; margin-bottom: 4px; }
.proc-strip .chip-btn { gap: 6px; }
.chip-btn svg { width: 13px; height: 13px; flex: none; }
.chip-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
.chip-btn .count { font: 700 12px var(--font-mono); padding: 0 5px; border-radius: 99px; background: var(--panel-3); }
.sitting-line { align-items: center; }
.tasks-table td { vertical-align: top; }
.tasks-table .who-cell { display: grid; gap: 3px; }
.who { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tasks-table .cell-name strong { display: block; }
.tasks-table td.cell-name { display: table-cell; min-width: 170px; }
.tasks-table td.cell-proc { min-width: 120px; }
.tasks-table .cell-proc small { display: block; font-size: 12px; }
.claim-row.ro.task-line { align-items: flex-start; }
.task-line .k { flex: none; width: 118px; min-width: 0; padding-top: 1px; }
.line-lock { display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.line-lock svg { width: 14px; height: 14px; }
.role-line { display: flex; align-items: flex-start; gap: 8px; }
.role-line .k { min-width: 64px; font-size: 12px; font-weight: 650; color: var(--muted); padding-top: 2px; }
.role-line .v { display: grid; gap: 3px; flex: 1; min-width: 0; }
.callout.dispute { background: color-mix(in srgb, var(--danger) 9%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.callout.dispute svg { color: var(--danger); }
.steps-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.step-n { font: 800 12px var(--font-mono); color: var(--accent); min-width: 16px; text-align: right; }
@media (max-width: 760px) {
  .card-line { grid-template-columns: minmax(0, 1fr) 76px 30px; }
  .card-line .k { grid-column: 1 / -1; }
  .card-line .src-note { grid-column: 1 / -1; }
  .role-row { grid-template-columns: 22px minmax(0, 1fr) 28px; }
  .role-row > select, .role-row > .seen-switch, .role-row > input, .role-row > .src-note, .role-row > span:empty { grid-column: 2 / -1; }
}

/* The Work tab: the matrix (SPEC 9e) */
.rmark.ghost .rm-shape { fill: none; stroke: var(--muted); stroke-dasharray: 2 2.2; opacity: .8; }
.rmark.ghost .rm-letter { fill: var(--muted); }
.mx-scroll { overflow: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-solid); padding: 6px 0 0; }
.mx-chart { display: block; font-family: var(--font-body); font-size: 12.5px; overflow: visible; }
.mx-col-band { fill: var(--panel-2); }
.mx-col-sel { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.mx-head { cursor: pointer; }
.mx-head-hit { fill: transparent; }
.mx-head-text { fill: var(--text-2); font-size: 12px; font-weight: 650; }
.mx-head:hover .mx-head-text, .mx-head:focus-visible .mx-head-text { fill: var(--text); text-decoration: underline; }
.mx-head-text.tbd-head { fill: var(--muted); font-weight: 600; }
.mx-rule { stroke: var(--line-2, var(--line)); }
.mx-group { cursor: pointer; }
.mx-group.none { cursor: default; }
.mx-group-bg { fill: color-mix(in srgb, var(--accent) 9%, transparent); stroke: color-mix(in srgb, var(--accent) 26%, transparent); }
.mx-group-text { fill: var(--text); font-size: 12.5px; font-weight: 700; dominant-baseline: central; }
.mx-row { cursor: pointer; }
.mx-row-bg { fill: transparent; }
.mx-row:hover .mx-row-bg { fill: var(--panel-3); }
.mx-row.selected .mx-row-bg { fill: color-mix(in srgb, var(--accent) 20%, transparent); }
/* The label column of a wide chart stays in view while the chart scrolls sideways (stickyScroll in work-tab.js). */
.sticky-lab { transform: translateX(var(--sx, 0px)); }
.lab-bg, .lab-cover { fill: var(--panel-solid); }
.mx-row:hover .lab-bg { fill: color-mix(in srgb, var(--text) 7%, var(--panel-solid)); }
.mx-row.selected .lab-bg { fill: color-mix(in srgb, var(--accent) 20%, var(--panel-solid)); }
.mx-row:focus-visible .lab-bg { stroke: var(--text); stroke-width: 2; }
.mx-chart [tabindex]:focus { outline: none; }
.mx-row:focus-visible .mx-row-bg, .mx-group:focus-visible .mx-group-bg, .mx-head:focus-visible .mx-head-hit { stroke: var(--text); stroke-width: 2; }
.mx-step { fill: var(--accent); font: 800 11px var(--font-mono); text-anchor: end; dominant-baseline: central; }
.mx-task { fill: var(--text); dominant-baseline: central; }
.mx-tbd { fill: var(--muted); font: 700 10.5px var(--font-mono); dominant-baseline: central; }
.mx-hidden { fill: var(--muted); font-size: 11px; font-style: italic; dominant-baseline: central; }
.work-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.work-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.work-legend.top { margin: 0 0 10px; gap: 2px 12px; line-height: 1.35; }
.work-legend.top .lg-mark { width: 16px; height: 16px; }
.lg-mark { overflow: visible; flex: none; }
.dis-note { color: var(--danger); }
.work-table tr[tabindex] { cursor: pointer; }
.work-table .grp-row th { position: static; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); padding: 9px 10px 7px; background: color-mix(in srgb, var(--accent) 9%, var(--panel-solid)); }
.work-table .cell-task { min-width: 200px; }
.work-table .cell-kind { white-space: nowrap; }
.work-table .who { white-space: nowrap; }
.work-table tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Work tab, Flow (0.5.0): one process as lanes. */
.fl-lane { fill: transparent; }
.fl-lane.alt { fill: var(--panel-2); }
.fl-lane.nobody { fill: color-mix(in srgb, var(--danger) 6%, transparent); }
.fl-lane.selected { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.fl-lane-lab.person { cursor: pointer; }
.fl-lane-name { fill: var(--text); font-weight: 700; font-size: 12.5px; dominant-baseline: central; }
.fl-lane-lab.nobody .fl-lane-name { fill: var(--danger); }
.fl-lane-lab.hidden .fl-lane-name { fill: var(--muted); font-style: italic; font-weight: 600; }
.fl-lane-lab.person:hover .fl-lane-name, .fl-lane-lab.person:focus-visible .fl-lane-name { text-decoration: underline; }
.fl-lane-lab.person:focus-visible .lab-bg { stroke: var(--text); stroke-width: 2; }
.fl-col-head { fill: var(--muted); font: 700 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; dominant-baseline: central; }
.fl-col-head.unknown { fill: var(--danger); }
.fl-unknown-rule { stroke: var(--danger); stroke-opacity: .5; stroke-dasharray: 4 4; }
.fl-edge { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.fl-edge.receives { stroke: var(--text-2); stroke-opacity: .8; }
.fl-edge.told { stroke-dasharray: 4 3; }
.fl-edge.on { stroke: var(--accent); stroke-width: 2.4; }
.fl-head { fill: var(--muted); }
.fl-node { cursor: pointer; }
.fl-box { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 1.4; }
.fl-box.seen { stroke: var(--text-2); }
.fl-box.told { stroke-dasharray: 5 3.5; }
.fl-box.nobody { stroke: var(--danger); fill: color-mix(in srgb, var(--danger) 8%, var(--panel-solid)); }
.fl-node:hover .fl-box { fill: var(--panel-3); }
.fl-node.selected .fl-box { fill: color-mix(in srgb, var(--accent) 22%, var(--panel-solid)); stroke: var(--accent); stroke-width: 2; }
.fl-node:focus-visible .fl-box { stroke: var(--text); stroke-width: 2.4; }
.fl-chart [tabindex]:focus { outline: none; }
.fl-step { fill: var(--accent); font: 800 12px var(--font-mono); dominant-baseline: central; }
.fl-step.unknown { fill: var(--danger); }
.fl-name { fill: var(--text); font-size: 12.5px; font-weight: 600; dominant-baseline: central; }
.fl-sys-bg { fill: color-mix(in srgb, var(--text) 8%, transparent); stroke: var(--line-2); }
.fl-sys-text { fill: var(--text-2); font-size: 10.5px; font-weight: 600; dominant-baseline: central; }
.fl-break-bg { fill: var(--panel-solid); stroke: var(--danger); stroke-width: 1.6; }
.fl-break-line { fill: none; stroke: var(--danger); stroke-width: 1.8; stroke-linecap: round; }
.fl-stub { stroke: var(--danger); stroke-width: 1.6; stroke-dasharray: 3 3; }
.fl-break-text { fill: var(--danger); font-size: 11px; font-weight: 650; }
.fl-break-count { color: var(--danger); }
.fl-breaks { margin-top: 12px; }
.fl-breaks ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.fl-break-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text-2); padding: 3px 6px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; }
.fl-break-btn:hover, .fl-break-btn:focus-visible { background: var(--panel-3); color: var(--text); }
.fl-table .fl-break-cell { color: var(--danger); }

/* Work tab, Person (0.5.0): one person's whole load. */
.pv-figures { margin: 4px 0 12px; }
.pv-figures .figure .note { margin-top: 4px; }
.pv-touches { display: grid; gap: 6px; margin: 0 0 12px; }
.pv-touch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pv-touch-label { min-width: 150px; color: var(--muted); font: 700 12px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.pv-proc { fill: var(--muted); font-size: 11.5px; dominant-baseline: central; }
.pv-cover { fill: var(--text-2); font-size: 12.5px; dominant-baseline: central; }
.pv-cover.none { fill: var(--warn); font-weight: 700; }
.pv-cover.hidden { fill: var(--muted); font-style: italic; }
.pv-bar { fill: var(--accent); fill-opacity: .85; }
.pv-bar.shared { fill: url(#pv-hatch); stroke: var(--accent); stroke-width: 1.2; }
.pv-hatch-bg { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.pv-hatch-fg { fill: var(--accent); fill-opacity: .8; }
.pv-bar-empty { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.pv-hours-text { fill: var(--text); font: 650 12px var(--font-mono); dominant-baseline: central; }
.pv-hours-text.none { fill: var(--muted); font-family: var(--font-body); font-style: italic; }
.pv-table .pv-nocover { color: var(--warn); font-weight: 700; }

/* Map, Work view (0.5.0) */
.node.kind-task .shape { fill: var(--panel-solid); stroke: var(--line-2); stroke-width: 1.2; }
.node.kind-task .ring-sel, .node.kind-head .ring-sel { display: none; }
.node.kind-task.selected .shape { stroke: var(--accent-2); stroke-width: 2.4; filter: drop-shadow(0 0 6px var(--accent-2)); }
.node.kind-task:focus-visible .shape { stroke: var(--accent); stroke-width: 2.4; }
.node.kind-task .label { font-weight: 600; stroke-width: 0; }
.node.wk .label { font-size: calc(13px * var(--lscale, 1)); }
.node.kind-task .kind-bar { pointer-events: none; }
.node.kind-head .label { font: 750 calc(12.5px * var(--lscale, 1)) var(--font-display); fill: var(--text-2); }
.node.kind-head.col-head .label { font: 800 calc(12px * var(--lscale, 1)) var(--font-body); fill: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.node.kind-head:not(.inert) { cursor: pointer; }
.node.kind-head:not(.inert):hover .label, .node.kind-head:focus-visible .label { fill: var(--text); text-decoration: underline; }
.node.kind-head.selected .label { fill: var(--accent-2); text-decoration: underline; }
.link.wl { stroke-opacity: .85; }
.link.w-checks { stroke-linecap: round; }
.link.w-system, .link.w-unit { stroke: var(--muted); stroke-opacity: .6; }
.link.w-does { stroke: var(--r-does); } .link.w-covers { stroke: var(--r-covers); } .link.w-decides { stroke: var(--r-decides); }
.link.w-checks { stroke: var(--r-checks); } .link.w-receives { stroke: var(--r-receives); }
.legend-item.static { cursor: default; }
.legend-item.static:hover { background: none; color: inherit; }
.kind-card { fill: var(--panel-solid); stroke: var(--line-2); stroke-width: 1; }
.legend-group.two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2px; }
.legend-group.two-col h5 { grid-column: 1 / -1; }
.legend-group.two-col .legend-item { padding: 2px 4px; gap: 6px; font-size: 12px; }

/* Share, Work charts and sheets (0.5.0) */
.share-side .seg { display: flex; flex-wrap: wrap; border-radius: 16px; }
.share-side .seg button { flex: 1 1 auto; justify-content: center; padding: 5px 10px; }
.seg-label { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: -4px; }
.sheet-row { display: grid; gap: 8px; justify-items: start; padding-top: 10px; border-top: 1px solid var(--line); }
.sheet-row .field { width: 100%; }
.share-preview.is-chart { background: var(--panel-solid); }
.share-chart { position: absolute; inset: 0; overflow: auto; padding: 44px 14px 14px; }
.share-chart-in { width: max-content; }
.share-chart-svg { display: block; overflow: visible; }
.share-chart .nb-empty { margin: 0 auto; max-width: 420px; }
.xl-text { fill: var(--text-2); font-family: var(--font-body); font-size: 12px; dominant-baseline: central; }
/* The Process sheet's charts are drawn here, off screen, then serialized; nothing in it is ever seen. */
.sheet-render { position: fixed; left: -30000px; top: 0; width: 6000px; pointer-events: none; }
@media print {
  /* White paper whether or not the print dialog prints backgrounds. */
  .share-preview.is-chart { background: #fff !important; }
  /* The charts' label column and secondary text, which the older print block below leaves dark. */
  [data-theme] { --panel-solid: #fff; --text-2: #333; }
  .share-chart { position: absolute; inset: 0; overflow: hidden; padding: 34px 0 0; }
  .share-chart-in { width: 100%; height: 100%; }
  .share-chart-svg { width: 100%; height: 100%; }
}

/* 0.6.0 Part A: the same top on every screen (SPEC 9f). Two rows of fixed height that never wrap, so the first
   content row sits at the same height on every screen of a stage. */
.page-top { display: grid; gap: 4px; margin-bottom: 12px; min-width: 0; }
.page-title-row, .page-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; height: 40px; }
.page-title-row > *, .page-filter-row > * { flex: none; }
.page-title-row > .grow { flex: 1 1 0; min-width: 0; }
.page-title { font-size: 20px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto !important; min-width: 0; }
.page-count { font: 700 13px var(--font-mono); color: var(--muted); padding: 1px 8px; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--line); }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-filter-row .page-search { flex: 0 1 260px; min-width: 140px; max-width: 260px; }
.page-search input, .search input[type="search"] { padding-left: 36px; }
.page-filter-row select { width: auto; max-width: 200px; min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
/* A select gives way before the row runs past the page: a filter chip that appears must stay in sight. */
.page-filter-row > select { flex: 0 1 auto; min-width: 104px; }
.page-filter-row .nb-set { white-space: nowrap; }
.page-filter-row .note { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.page-filter-row > .grow { flex: 1 1 0; min-width: 0; }
.more-filters { flex: none; }
.badge-n { font: 700 12px var(--font-mono); padding: 0 6px; border-radius: 99px; background: var(--accent-fill); color: var(--accent-ink); }
.filter-chip { cursor: pointer; min-height: 28px; }
.filter-chip svg { width: 12px; height: 12px; }
.info-btn svg { width: 15px; height: 15px; }
.sub-seg { flex: none; }
/* A banner (the sitting, possible duplicates) takes one line; what it holds opens from its button. */
.banner { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 4px 12px; border-radius: 12px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13px; white-space: nowrap; min-width: 0; }
.banner.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.banner > svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.banner.warn > svg { color: var(--warn); }
.banner .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The popover: the intro behind the info button, More filters, menus, the legend. */
.pop { position: fixed; z-index: 120; padding: 12px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; background: var(--panel-solid); font-size: 13px; border-radius: 14px; }
.info-pop { display: grid; gap: 6px; }
.info-pop p { margin: 0; color: var(--text-2); line-height: 1.5; }
.more-pop { gap: 10px; }
.menu-pop { padding: 6px; }
.menu { display: grid; gap: 2px; min-width: 200px; }
.menu button { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.menu button:hover, .menu button:focus-visible { background: var(--panel-3); }
.menu button svg { width: 15px; height: 15px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu-chev { width: 12px !important; height: 12px !important; }
@media print { .page-top, .banner, .pop { display: none !important; } }
/* Inside a stack (the List, the Table) the stack's own gap already parts the top from the content: the first content
   row starts at the same height as on the other screens of the stage. */
.stack > .page-top { margin-bottom: 2px; }
.page-filter-row .nb-set select { min-width: 0; max-width: 180px; }
.page-filter-row .nb-set > span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- 0.6.0 Part A: the detail panel (P2) ---------- */
/* Docked on the right only while something is selected; resized by its left edge, folded to a 44 px strip. */
.inspector { position: relative; overflow: visible; }
/* The panel's content never makes the row taller than the window: it scrolls inside the panel. */
.main { grid-template-rows: minmax(0, 1fr); }
.inspector { min-height: 0; }
.panel-in { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-resize { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 3; touch-action: none; }
.panel-resize::after { content: ""; position: absolute; left: 4px; top: 50%; width: 2px; height: 40px; margin-top: -20px; border-radius: 2px; background: var(--line-2); opacity: 0; transition: opacity var(--t-fast); }
.panel-resize:hover::after, .panel-resize:focus-visible::after, .panel-resize.is-dragging::after { opacity: 1; background: var(--accent); }
.main:has(.panel-resize.is-dragging) { transition: none; user-select: none; }
.panel-bar { position: absolute; top: 16px; right: 16px; z-index: 2; }
.inspector .insp-head { padding-right: 52px; }
.inspector .insp-head > .icon-btn:last-child { margin-right: -2px; }
.inspector .insp-head h3:focus { outline: none; }
.main.panel-folded .panel-bar, .main.panel-folded .panel-resize { display: none; }
.panel-strip { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0; border: 0; background: transparent; color: var(--text-2); cursor: pointer; min-width: 0; min-height: 28px; }
.panel-strip:hover { background: var(--panel-2); color: var(--text); }
.panel-strip-name { writing-mode: vertical-rl; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 60vh; }
.panel-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); }
.fold-sec > summary { display: flex; align-items: center; gap: 8px; min-height: 28px; font-weight: 700; cursor: pointer; list-style: none; }
.fold-sec > summary::-webkit-details-marker { display: none; }
.fold-sec > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--t-fast); }
.fold-sec[open] > summary::before { transform: rotate(45deg); }
.fold-sec .count, .link-group h5 .count { font: 700 12px var(--font-mono); padding: 0 6px; border-radius: 99px; background: var(--panel-3); color: var(--muted); }
.link-groups { display: grid; gap: 10px; }
.link-group h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 12.5px; color: var(--text-2); }
.lt-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.link-group .list-item .icon-btn.ghost { opacity: .55; }
.link-group .list-item:hover .icon-btn.ghost, .link-group .list-item .icon-btn.ghost:focus-visible { opacity: 1; }
/* The work area is a container, so its tables can fold columns when the panel takes room (see .col-opt). */
.work { container-type: inline-size; container-name: work; }
.fold-extra, .fold-extra2 { display: none; }
table.data td .clip { max-width: clamp(60px, 17cqw, 280px); }
@container work (max-width: 1150px) {
  table.data .col-opt2 { display: none; }
  table.data .fold-extra2 { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 12px 0 0; font-size: 12.5px; color: var(--text-2); vertical-align: top; }
}
@container work (max-width: 900px) {
  table.data .col-opt { display: none; }
  table.data .fold-extra { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 12px 0 0; font-size: 12.5px; color: var(--text-2); vertical-align: top; }
  .cell-name { min-width: 180px; }
  table.data input.bare { min-width: 140px; }
}
/* The task list has eleven columns, so it folds a step earlier than the other tables. */
@container work (max-width: 1400px) {
  .tasks-table .col-opt2 { display: none; }
  .tasks-table td.cell-name { min-width: 250px; }
  .tasks-table .fold-extra2 { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 12px 0 0; font-size: 12.5px; color: var(--text-2); vertical-align: top; }
}
@container work (max-width: 1000px) {
  .tasks-table .col-opt { display: none; }
  .tasks-table .fold-extra { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 12px 0 0; font-size: 12.5px; color: var(--text-2); vertical-align: top; }
}
/* Hungarian headers and labels run longer than the English ones the folds above were measured with. In Hungarian
   the clipped cells are a little narrower, each fold comes a step earlier, and the long header over the last
   optional column may take two lines, so no table scrolls sideways at a 1280 or a 1440 window. */
:root[lang="hu"] table.data td .clip { max-width: clamp(60px, 12cqw, 280px); }
:root[lang="hu"] table.data th.col-opt2 { white-space: normal; line-height: 1.25; min-width: 96px; }
@container work (max-width: 1250px) {
  :root[lang="hu"] table.data .col-opt2 { display: none; }
  :root[lang="hu"] table.data .fold-extra2 { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 12px 0 0; font-size: 12.5px; color: var(--text-2); vertical-align: top; }
  :root[lang="hu"] .tasks-table td.cell-name { min-width: 180px; }
  :root[lang="hu"] .tasks-table td.col-opt .chip { white-space: normal; text-align: left; }
}
@container work (max-width: 1060px) {
  :root[lang="hu"] table.data .col-opt { display: none; }
  :root[lang="hu"] table.data .fold-extra { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 12px 0 0; font-size: 12.5px; color: var(--text-2); vertical-align: top; }
  :root[lang="hu"] .cell-name { min-width: 180px; }
}
table.data td > .btn.link { max-width: clamp(80px, 20cqw, 260px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

/* ---- the login gate (SPEC 9g, block E; auth/screens.js) ---- */
.gate-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(420px, 100%); display: grid; gap: 14px; padding: 24px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--glow); }
.gate-card.wide { width: min(560px, 100%); }
.gate-card h2 { margin: 0; font-size: 20px; }
.gate-card p { margin: 0; }
.gate-head { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); }
.gate-head .boot-mark { width: 24px; height: 24px; border-radius: 8px; animation: none; }
.gate-actions { flex-wrap: wrap; justify-content: space-between; }
.gate-notice { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-3); }
.gate-notice svg { width: 16px; height: 16px; flex: none; }
.form-err { color: var(--danger); font-size: 13px; font-weight: 650; margin: 0; }
.form-err[hidden] { display: none; }
.gate-enrol { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.gate-qr { width: 176px; height: 176px; border-radius: 10px; background: #fff; padding: 6px; }
.gate-secret { user-select: all; -webkit-user-select: all; word-break: break-all; font-size: 14px; padding: 8px 10px; border-radius: 8px; background: var(--panel-3); }
.gate-cover { position: fixed; inset: 0; z-index: 1000; overflow: auto; background: color-mix(in srgb, var(--panel-solid) 72%, transparent); backdrop-filter: blur(6px); }
.gate-helper { border-top: 1px dashed var(--line-2); padding-top: 10px; font-size: 12.5px; }
.gate-helper summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.gate-helper > * + * { margin-top: 8px; }
.gate-helper-table { border-collapse: collapse; width: 100%; }
.gate-helper-table th, .gate-helper-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.gate-helper-code { min-width: 6ch; }
.gate-card:has(.gate-helper[open]) { width: min(900px, 100%); }
.signout-chip { cursor: pointer; flex: none; }
/* The real-set switch is hidden behind a login that holds the demo set only; .seg button sets display itself. */
.seg button[hidden] { display: none; }
/* The way out stays on the screen in a narrow window: the chip folds to its icon (its title and label keep the
   words), and under 1240px the brand's word goes and the two fields give way. */
@media (max-width: 1400px) {
  .signout-chip span { display: none; }
}
@media (max-width: 1240px) {
  .topbar .brand span { display: none; }
  .topbar .search, .topbar .quick { min-width: 110px; }
}
.band-trial { background: repeating-linear-gradient(135deg, #1D3B5C 0 18px, #244A73 18px 36px); color: #EAF4FF; }

/* ---------- 0.7.0 block E2: the Admin screen ---------- */
/* Its rail entry sits at the foot of the rail, under a line, apart from the five stages. */
.rail-sep { margin-top: auto; min-height: 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; flex: none; }
.rail-admin { flex: none; }
.admin-page { max-width: 1100px; }
.admin-refused { margin: 24px 0; color: var(--muted); }
.admin-sec { margin: 0 0 28px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); display: grid; gap: 12px; }
.admin-sec h3 { margin: 0; }
.admin-sec > p { margin: 0; }
.admin-part { padding-top: 12px; border-top: 1px solid var(--line); }
.admin-part:first-of-type { border-top: 0; padding-top: 0; }
.admin-part h4 { margin: 0; }
.admin-table td, .admin-table th { vertical-align: middle; }
/* table.data th has no padding of its own (its button or .static carries it): these heads are plain text. */
table.data.admin-table th, table.data.admin-counts th, table.data.changes-table th { padding: 10px; }
.admin-acts { text-align: right; white-space: nowrap; }
.admin-agent { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; }
.admin-counts { max-width: 420px; }
.admin-counts tr.total td { font-weight: 700; border-top: 1px solid var(--line-2); }
.admin-confirm { align-items: flex-end; }
.admin-export .export-age { display: inline-flex; align-items: center; gap: 6px; }
.admin-export .export-age svg { width: 16px; height: 16px; flex: none; color: var(--ok, currentColor); }
.admin-export .export-age.stale svg { color: var(--warn, currentColor); }
.secret-row { align-items: stretch; }
.secret-box { flex: 1; min-width: 0; font-size: 15px; letter-spacing: .04em; user-select: all; }
/* The Changes (Register) and the person in the inspector's History. */
.changes-table td { vertical-align: top; }
.changes-foot { margin-top: 12px; }
.hist-who { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.hist-who svg { width: 14px; height: 14px; }
