/* Hallmark · shape: app screen · genre: modern-minimal · theme: Console (deal 2/3, seed premium-roofing-insurance-claims-crm-67cf·384d64e6·2026-11-15·r0) · redesign: restyle
 * nav: kept (sidebar shell, 10 destinations) · signature: kept (the claims pipeline board) · states: loading, empty, error, full · console: graphite
 * axes: dark/grotesk-sans/chromatic-amber · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H3 E4 S4 R4 V4 · weakest: H, the kept layout still opens the dashboard on a hero; restyled flat, plain label as the headline, no gradient */
/* Hallmark · reworded "Every square. Every storm. Every dollar." to "Supplement claims command center" · 54 names the eyebrow it sat under; the plain label became the heading */
/* Hallmark · reworded "Approved · Build", "Completed · Invoiced" to "Approved, Build", "Completed, Invoiced" · 63 names middle-dot joins */
/* Hallmark · waive 72 · div.panel bottom -427px is the closed details.adv grid, laid out by the browser but never painted · nothing crowds a visible edge */
@import url("./tokens.css");
@import url("./base.css");

/* ---------- app tokens: roles, data series and documents (all colour lives here) ---------- */
:root {
  --font-figure: var(--font-outlier);
  --color-scrim: color-mix(in oklab, var(--color-paper-3) 72%, transparent);
  --color-hover: color-mix(in oklab, var(--color-ink) 6%, transparent);
  --color-select: color-mix(in oklab, var(--color-accent) 10%, transparent);
  /* categorical series for roof planes and edge types: amber, cool, green, sand, ink, clay */
  --series-1: var(--color-accent); --series-2: var(--color-cool); --series-3: var(--color-ok);
  --series-4: oklch(80% 0.07 60); --series-5: var(--color-ink-2); --series-6: oklch(72% 0.11 35);
  /* NOAA SPC convective outlook categories (their published key, muted to the ground) */
  --spc-tstm: oklch(86% 0.06 145); --spc-mrgl: oklch(64% 0.1 145); --spc-slgt: oklch(88% 0.13 95);
  --spc-enh: oklch(78% 0.13 60); --spc-mdt: oklch(64% 0.15 25); --spc-high: oklch(76% 0.13 330);
  /* paper documents (estimates, invoices, agreements) */
  --doc-ink: oklch(21% 0.01 250); --doc-ink-2: oklch(35% 0.012 250); --doc-muted: oklch(50% 0.012 250);
  --doc-rule: oklch(91% 0.004 250); --doc-rule-2: oklch(83% 0.006 250); --doc-band: oklch(96% 0.004 90);
  --doc-paper: oklch(100% 0 0); --doc-ok: oklch(52% 0.11 150); --doc-bad: oklch(52% 0.16 30); --doc-accent: oklch(50% 0.11 70);
  /* legacy names still read by inline styles in the scripts */
  --text: var(--color-ink); --muted: var(--color-muted); --dim: var(--color-muted); --line: var(--color-rule); --line2: var(--color-rule-2);
  --accent: var(--color-accent); --accent2: var(--color-ink-2); --amber: var(--color-accent); --green: var(--color-ok); --red: var(--color-bad); --pink: var(--color-accent);
  --panel: var(--color-paper-2); --panel2: var(--color-paper-2); --panel3: var(--color-paper-3); --bg: var(--color-paper);
  --mono: var(--font-outlier); --radius: var(--radius-card);
  --control-h: 36px;
  --color-field-edge: color-mix(in oklab, var(--color-muted) 70%, var(--color-rule-2));
}

/* ---------- foundation ---------- */
html, body { height: 100%; }
body { overflow: clip; font-size: var(--text-sm); line-height: 1.5; }
a { color: var(--color-ink); text-decoration-color: var(--color-rule-2); }
a:hover { color: var(--color-accent); }
h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--color-ink); }
h4 { font-size: var(--text-sm); }
.ic { flex: none; display: block; }
.mono { font-family: var(--font-figure); font-size: 0.92em; font-variant-numeric: tabular-nums slashed-zero; }
.muted { color: var(--color-muted); }
.dim { color: var(--color-muted); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; }
.row.gap { gap: var(--space-sm); }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.mt { margin-top: var(--space-md); }
.mb { margin-bottom: var(--space-md); }
code { font-family: var(--font-outlier); font-size: 0.95em; background: var(--color-paper-3); border: 1px solid var(--color-rule); padding: 0 var(--space-2xs); border-radius: 4px; }
pre.code { margin: 0 0 var(--space-xs); padding: var(--space-sm); background: var(--color-paper-3); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-ink-2); white-space: pre-wrap; word-break: break-all; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); height: 100vh; }
.sidebar { background: var(--color-paper-3); border-right: 1px solid var(--color-rule); display: flex; flex-direction: column; padding: var(--space-md) var(--space-sm); overflow-y: auto; z-index: var(--z-sticky-nav); }
.brand { display: flex; gap: var(--space-sm); align-items: center; padding: 0 var(--space-xs) var(--space-md); }
.brand-mark { width: 36px; height: 36px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--color-paper-2); border: 1px solid var(--color-rule-2); color: var(--color-accent); }
.brand-name { font-weight: 500; font-size: var(--text-md); letter-spacing: -0.01em; }
.brand-sub { font-size: var(--text-xs); color: var(--color-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group { margin-top: var(--space-md); }
.nav-label { font-size: var(--text-xs); color: var(--color-muted); padding: 0 var(--space-xs) var(--space-2xs); }
.nav a { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--control-h); padding: 0 var(--space-xs); border-radius: var(--radius-pill); color: var(--color-ink-2); text-decoration: none; font-weight: 500; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.nav a:hover { background: var(--color-hover); color: var(--color-ink); }
.nav a.active { background: var(--color-paper-2); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-rule); }
.nav a.active .ic { color: var(--color-ink); }
.nav .badge { margin-left: auto; font-family: var(--font-figure); font-size: var(--text-xs); padding: 0 var(--space-xs); border-radius: 4px; border: 1px solid var(--color-rule-2); color: var(--color-ink-2); }
.nav .badge.warn { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }
.side-foot { margin-top: auto; padding: var(--space-md) var(--space-xs) 0; font-size: var(--text-xs); color: var(--color-muted); border-top: 1px solid var(--color-rule); }
.side-foot .row { gap: var(--space-xs); }

.main { overflow-y: auto; overflow-x: clip; position: relative; }
.topbar { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-xl); background: var(--color-paper); border-bottom: 1px solid var(--color-rule); }
.icon-btn.menu-btn { display: none; }
.crumb { font-weight: 500; white-space: nowrap; color: var(--color-ink); }
.crumb span { color: var(--color-muted); }
.gsearch { position: relative; flex: 1; max-width: 460px; margin-left: var(--space-sm); }
.gsearch input { padding-left: var(--space-xl); }
.gsearch .ic { position: absolute; left: var(--space-sm); top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.gsearch kbd { position: absolute; right: var(--space-xs); top: 50%; transform: translateY(-50%); font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); border: 1px solid var(--color-rule-2); border-radius: 4px; padding: 0 var(--space-2xs); }
.gs-results { position: absolute; top: calc(100% + var(--space-2xs)); left: 0; right: 0; background: var(--color-paper-2); border: 1px solid var(--color-rule-2); border-radius: var(--radius-card); padding: var(--space-2xs); max-height: 420px; overflow: auto; z-index: var(--z-dropdown); }
.gs-item { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-pill); cursor: pointer; }
.gs-item:hover, .gs-item.sel { background: var(--color-hover); }
.gs-item small { color: var(--color-muted); display: block; font-size: var(--text-xs); }
.gs-type { font-size: var(--text-xs); color: var(--color-muted); margin-left: auto; }
.top-actions { margin-left: auto; display: flex; gap: var(--space-xs); align-items: center; position: relative; }
.qa-menu { position: absolute; right: 0; top: calc(100% + var(--space-2xs)); background: var(--color-paper-2); border: 1px solid var(--color-rule-2); border-radius: var(--radius-card); padding: var(--space-2xs); min-width: 220px; z-index: var(--z-dropdown); }
.qa-menu button { display: flex; gap: var(--space-sm); align-items: center; width: 100%; min-height: var(--control-h); padding: 0 var(--space-sm); border: 0; background: none; color: var(--color-ink); border-radius: var(--radius-pill); cursor: pointer; text-align: left; }
.qa-menu button:hover { background: var(--color-hover); }

.view { padding: var(--space-lg) var(--space-xl) var(--space-3xl); max-width: var(--container); margin: 0 auto; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--space-xs); justify-content: center; min-height: var(--control-h); padding: 0 var(--space-md); border-radius: var(--radius-pill); border: 1px solid var(--color-rule-2); background: var(--color-paper-2); color: var(--color-ink); cursor: pointer; font-weight: 500; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.btn:hover { background: var(--color-paper); border-color: var(--color-muted); color: var(--color-ink); }
.btn:active { background: var(--color-paper-3); }
.btn.primary, .btn.amber { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn.primary:hover, .btn.amber:hover { background: color-mix(in oklab, var(--color-accent) 88%, var(--color-ink)); color: var(--color-accent-ink); }
.btn.glass { background: var(--color-paper-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--color-hover); }
.btn.danger { color: var(--color-bad); }
.btn.danger:hover { background: var(--color-bad-soft); border-color: var(--color-bad); color: var(--color-bad); }
.btn.sm { min-height: 30px; padding: 0 var(--space-sm); font-size: var(--text-xs); }
.btn.rec { background: var(--color-bad); border-color: var(--color-bad); color: var(--color-paper-3); }
.btn[disabled] { background: var(--color-paper-3); border-color: var(--color-rule); color: var(--color-muted); cursor: not-allowed; pointer-events: none; }
.icon-btn { width: var(--control-h); height: var(--control-h); display: inline-grid; place-items: center; border-radius: var(--radius-pill); border: 1px solid var(--color-rule); background: var(--color-paper-2); color: var(--color-ink-2); cursor: pointer; position: relative; flex: none; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.icon-btn:hover { color: var(--color-ink); background: var(--color-paper); }
.icon-btn.on { color: var(--color-paper-3); background: var(--color-bad); border-color: var(--color-bad); }
.icon-btn.on-perf { color: var(--color-accent); border-color: var(--color-accent); background: var(--color-accent-soft); }

.fgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md); }
.fld { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.fld label { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.s1{grid-column:span 1}.s2{grid-column:span 2}.s3{grid-column:span 3}.s4{grid-column:span 4}.s5{grid-column:span 5}.s6{grid-column:span 6}
.s7{grid-column:span 7}.s8{grid-column:span 8}.s9{grid-column:span 9}.s10{grid-column:span 10}.s12{grid-column:span 12}
input, select, textarea { width: 100%; min-height: var(--control-h); background: var(--color-paper-3); color: var(--color-ink); border: 1px solid var(--color-field-edge); border-radius: var(--radius-pill); padding: var(--space-xs) var(--space-sm); outline: none; min-width: 0; transition: background-color var(--dur-micro) var(--ease-out); }
input::placeholder, textarea::placeholder { color: var(--color-muted); }
input:hover, select:hover, textarea:hover { border-color: var(--color-muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
input[disabled], select[disabled] { color: var(--color-muted); background: var(--color-paper); cursor: not-allowed; }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: var(--space-xl); }
select option { background: var(--color-paper-2); }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--color-ink-2); padding: 0; flex: none; }
input[type=date] { color-scheme: dark; }
.chk { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; user-select: none; }
.fld.chkfld { justify-content: flex-end; padding-bottom: var(--space-xs); }
.filled { animation: fillIn var(--dur-long) var(--ease-out); }
@keyframes fillIn { from { background-color: var(--color-accent-soft); } }
.dictating { outline: 2px solid var(--color-bad) !important; outline-offset: 1px; }
.form-sec { grid-column: span 12; margin-top: var(--space-xs); padding-top: var(--space-sm); border-top: 1px solid var(--color-rule); font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-2); }

/* ---------- surfaces ---------- */
.panel { background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-lg); position: relative; }
.panel-title { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); letter-spacing: 0; margin-bottom: var(--space-2xs); }
.ph { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); flex-wrap: wrap; }
.ph h3 { font-size: var(--text-md); letter-spacing: -0.01em; }
.ph .link { margin-left: auto; font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.ph .link:hover { color: var(--color-accent); }
.ph .sub { color: var(--color-muted); font-size: var(--text-xs); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-md); margin-bottom: var(--space-md); }
.stack > * + * { margin-top: var(--space-md); }
.empty { text-align: center; color: var(--color-muted); padding: var(--space-xl) var(--space-sm); font-size: var(--text-sm); }
.empty .ic { margin: 0 auto var(--space-xs); color: var(--color-rule-2); }
.skeleton { color: var(--color-muted); font-size: var(--text-sm); padding: var(--space-md) 0; display: flex; gap: var(--space-sm); align-items: center; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--color-rule); border-top-color: var(--color-accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { font-size: var(--text-xs); color: var(--color-muted); background: var(--color-paper-3); border-radius: var(--radius-pill); padding: var(--space-sm); }
.note.warn { background: var(--color-accent-soft); color: var(--color-ink-2); }
.chip { --c: var(--color-muted); display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-xs); font-weight: 500; padding: 1px var(--space-xs); border-radius: 4px; color: var(--c); background: color-mix(in oklab, var(--c) 12%, transparent); border: 1px solid color-mix(in oklab, var(--c) 30%, transparent); white-space: nowrap; }

/* page heads: a band with a faint wireframe of the roof behind the title */
.band { position: relative; overflow: hidden; border-radius: var(--radius-card); padding: var(--space-lg); margin-bottom: var(--space-md); border: 1px solid var(--color-rule); background: var(--color-paper-2); }
.band-art { position: absolute; right: -40px; top: -72px; width: 640px; height: 280px; opacity: 0.5; pointer-events: none; will-change: transform; }
.band-in { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.band h2 { font-size: var(--text-2xl); max-width: 30ch; }
.band p { color: var(--color-muted); margin: var(--space-xs) 0 0; max-width: 64ch; }
.band-act { display: flex; gap: var(--space-xs); flex-wrap: wrap; align-items: center; }

/* ---------- dashboard hero (kept layout, restyled flat) ---------- */
.hero { position: relative; height: 420px; border-radius: var(--radius-card); overflow: hidden; margin-bottom: var(--space-md); border: 1px solid var(--color-rule); background: var(--color-paper-3); }
.px-layer { position: absolute; pointer-events: none; will-change: transform; }
.px-grid-wrap { display: none; }
.px-grid { position: absolute; left: -20%; right: -20%; top: 50%; height: 120%; background-image: linear-gradient(var(--color-rule) 1px, transparent 1px), linear-gradient(90deg, var(--color-rule) 1px, transparent 1px); background-size: 56px 56px; transform: rotateX(64deg); transform-origin: 50% 0; -webkit-mask-image: linear-gradient(to bottom, var(--color-ink) 0%, transparent 70%); mask-image: linear-gradient(to bottom, var(--color-ink) 0%, transparent 70%); }
.px-contours { right: -4%; top: -14%; width: 72%; height: 130%; opacity: 0.6; }
.hero-3d { position: absolute; right: -2%; top: 0; width: 62%; height: 100%; }
.hero-3d canvas { display: block; }
.hero-copy { position: absolute; left: var(--space-xl); top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; max-width: 520px; z-index: var(--z-raised); }
.hero h1 { font-size: var(--text-3xl); line-height: 1.05; margin: 0 0 var(--space-sm); max-width: 16ch; }
.hero p { color: var(--color-ink-2); font-size: var(--text-md); max-width: 46ch; margin: 0 0 var(--space-lg); }
.hero-chips { position: absolute; right: var(--space-lg); bottom: var(--space-lg); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; z-index: var(--z-raised); }
.glass-chip { background: var(--color-paper-2); padding: var(--space-sm) var(--space-md); min-width: 136px; }
.glass-chip small { display: block; color: var(--color-muted); font-size: var(--text-xs); }
.glass-chip b { font-family: var(--font-figure); font-weight: 400; font-size: var(--text-lg); font-variant-numeric: tabular-nums slashed-zero; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-bottom: var(--space-md); background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis > .panel { border: 0; border-radius: 0; }
.kpi { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-md); min-width: 0; }
.kpi > div { min-width: 0; }
.kpi-ic { display: none; }
.kpi-l { font-size: var(--text-xs); color: var(--color-muted); }
.kpi-v { font-family: var(--font-figure); font-size: var(--text-2xl); font-weight: 400; letter-spacing: -0.03em; line-height: 1.2; font-variant-numeric: tabular-nums slashed-zero; }
.kpi-s { font-size: var(--text-xs); color: var(--color-muted); }

.sbar { display: grid; grid-template-columns: 196px 1fr 104px; gap: var(--space-sm); align-items: center; padding: var(--space-2xs) 0; font-size: var(--text-sm); }
.sbar-track { height: 8px; border-radius: 2px; background: var(--color-paper-3); overflow: hidden; }
.sbar-fill { height: 100%; border-radius: 2px; background: var(--c); transform-origin: left center; animation: barIn var(--dur-long) var(--ease-out) both; }
@keyframes barIn { from { transform: scaleX(0); } }
.sbar-n { display: flex; align-items: center; gap: var(--space-xs); color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbar-n i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.sbar-v { text-align: right; font-family: var(--font-figure); font-variant-numeric: tabular-nums slashed-zero; }
.sbar-v small { color: var(--color-muted); }

.donut { width: 132px; height: 132px; border-radius: 50%; position: relative; flex: none; }
.donut-c { position: absolute; inset: 14px; border-radius: 50%; background: var(--color-paper-2); color: var(--color-ink); display: grid; place-content: center; z-index: 1; text-align: center; }
.donut-c b { font-family: var(--font-figure); font-weight: 400; font-size: var(--text-xl); display: block; }
.donut-c small { color: var(--color-muted); font-size: var(--text-xs); }
.legend-list { display: grid; gap: var(--space-xs); font-size: var(--text-sm); flex: 1; }
.legend-list div { display: flex; align-items: center; gap: var(--space-xs); color: var(--color-ink-2); }
.legend-list i { width: 10px; height: 10px; border-radius: 2px; }
.legend-list b { margin-left: auto; font-family: var(--font-figure); font-weight: 400; color: var(--color-ink); font-variant-numeric: tabular-nums slashed-zero; }

.list-item { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover .li-t { color: var(--color-accent); }
.li-ic { width: 32px; height: 32px; border-radius: var(--radius-pill); display: grid; place-items: center; border: 1px solid var(--color-rule); color: var(--color-muted); flex: none; }
.li-body { min-width: 0; }
.li-t { font-weight: 500; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--dur-micro) var(--ease-out); }
.li-s { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-r { margin-left: auto; text-align: right; font-size: var(--text-xs); white-space: nowrap; }
.overdue { color: var(--color-bad) !important; }
.mfc { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
.mfc:last-child { border-bottom: 0; }
.mfc img { width: 40px; height: 40px; border-radius: var(--radius-pill); flex: none; filter: grayscale(1) contrast(1.05); }
.mfc b { font-size: var(--text-sm); font-weight: 500; }
.mfc small { display: block; color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfc-r { margin-left: auto; text-align: right; flex: none; }
.mfc-r b { font-family: var(--font-figure); font-weight: 400; }
.mfc-r small { font-size: var(--text-xs); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-md); }
.search { position: relative; min-width: 220px; flex: 0 1 320px; }
.search .ic { position: absolute; left: var(--space-sm); top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.search input { padding-left: var(--space-xl); }
.toolbar select { width: auto; min-width: 160px; }
.seg { display: inline-flex; background: var(--color-paper-3); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); padding: var(--space-3xs); max-width: 100%; overflow-x: auto; }
.seg button { white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-2xs); border: 0; background: none; min-height: 30px; padding: 0 var(--space-sm); border-radius: 4px; cursor: pointer; color: var(--color-muted); font-weight: 500; font-size: var(--text-xs); transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.seg button:hover { color: var(--color-ink); }
.seg button.on { background: var(--color-paper-2); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-rule-2); }
.tb-stat { color: var(--color-muted); font-size: var(--text-xs); margin-left: auto; }
.tb-stat b { color: var(--color-ink); font-family: var(--font-figure); font-weight: 400; }

/* ---------- kanban: open lanes, cards are the only boxes ---------- */
.board { display: flex; gap: var(--space-md); overflow-x: auto; padding: var(--space-3xs) var(--space-3xs) var(--space-md); }
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-thumb { background: var(--color-rule-2); border-radius: 4px; }
.col { --c: var(--color-muted); flex: 0 0 280px; display: flex; flex-direction: column; max-height: calc(100vh - 248px); min-height: 380px; border-radius: var(--radius-card); background: var(--color-paper-3); padding: 0 var(--space-2xs); transition: background-color var(--dur-short) var(--ease-out); }
.col-h { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-2xs) var(--space-2xs); }
.col-h .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.col-h h4 { font-size: var(--text-sm); font-weight: 500; }
.col-h .cnt { margin-left: auto; font-family: var(--font-figure); font-size: var(--text-xs); color: var(--color-muted); }
.col-sum { padding: 0 var(--space-2xs) var(--space-xs); font-family: var(--font-figure); font-size: var(--text-xs); color: var(--color-muted); border-bottom: 2px solid var(--c); font-variant-numeric: tabular-nums slashed-zero; }
.col-body { flex: 1; overflow-y: auto; padding: var(--space-sm) var(--space-3xs); display: flex; flex-direction: column; gap: var(--space-xs); }
.col.over { background: var(--color-select); }
.col-empty { border: 1px dashed var(--color-rule-2); border-radius: var(--radius-pill); padding: var(--space-md) var(--space-xs); text-align: center; color: var(--color-muted); font-size: var(--text-xs); }
.card { background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); padding: var(--space-sm); cursor: grab; touch-action: none; user-select: none; position: relative; flex: none; transition: border-color var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out); }
.card:hover { border-color: var(--color-rule-2); }
.card.dragging { opacity: 0.35; }
.card.ghost { position: fixed; left: 0; top: 0; z-index: var(--z-tooltip); pointer-events: none; cursor: grabbing; border-color: var(--color-accent); transition: none; }
.card.landed { animation: landed var(--dur-long) var(--ease-out); }
@keyframes landed { from { border-color: var(--color-accent); } }
.c-top { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; }
.c-top b { font-size: var(--text-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-days { margin-left: auto; font-family: var(--font-figure); font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.c-sub { font-size: var(--text-xs); color: var(--color-muted); margin: var(--space-3xs) 0 var(--space-xs); }
.c-meta { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; font-size: var(--text-xs); color: var(--color-muted); }
.c-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid var(--color-rule); font-size: var(--text-xs); gap: var(--space-xs); color: var(--color-muted); }
.c-foot b { font-family: var(--font-figure); font-weight: 400; color: var(--color-ink); font-variant-numeric: tabular-nums slashed-zero; }
.supp-pill { color: var(--color-accent); font-family: var(--font-figure); font-size: var(--text-xs); }
.pri { width: 8px; height: 8px; border-radius: 2px; background: var(--color-rule-2); flex: none; }
.pri.high { background: var(--color-bad); }
.pri.normal { background: var(--color-muted); }
.pri.low { background: var(--color-rule-2); }
.board.compact .col.is-empty { flex: 0 0 48px; }
.board.compact .col.is-empty .col-h { flex-direction: column; padding: var(--space-sm) 0; gap: var(--space-sm); }
.board.compact .col.is-empty .col-h h4 { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: var(--text-xs); color: var(--color-muted); }
.board.compact .col.is-empty .col-h .cnt { margin: 0; }
.board.compact .col.is-empty .col-sum, .board.compact .col.is-empty .col-body { display: none; }
.board.compact .col.is-empty.over { flex-basis: 180px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
.panel .tbl-wrap, .drawer .tbl-wrap, .modal .tbl-wrap { border-radius: var(--radius-pill); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tbl th { text-align: left; font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid var(--color-rule); background: var(--color-paper-3); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; }
.tbl td { padding: var(--space-sm); border-bottom: 1px solid var(--color-rule); vertical-align: middle; }
.tbl td.num, .tbl td.r.num { font-family: var(--font-figure); font-size: 0.92em; font-variant-numeric: tabular-nums slashed-zero; }
.tbl tbody tr { transition: background-color var(--dur-micro) var(--ease-out); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: var(--color-hover); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl.edit td { padding: var(--space-2xs); }
.tbl.edit input, .tbl.edit select { min-height: 32px; padding: var(--space-2xs) var(--space-xs); font-size: var(--text-sm); }
.tbl tfoot td { font-weight: 500; background: var(--color-paper-3); }
.cell-main { font-weight: 500; }
.cell-sub { font-size: var(--text-xs); color: var(--color-muted); }

/* ---------- drawer, modal, toasts ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: var(--z-modal); pointer-events: none; overflow: clip; }
.drawer-wrap:not(.open) .drawer { visibility: hidden; transition: transform var(--dur-long) var(--ease-out), visibility 0s linear var(--dur-long); }
.drawer-scrim { position: absolute; inset: 0; background: var(--color-scrim); opacity: 0; transition: opacity var(--dur-short) var(--ease-out); }
.drawer { position: absolute; right: 0; top: 0; height: 100%; width: min(800px, 100%); background: var(--color-paper); border-left: 1px solid var(--color-rule-2); transform: translateX(104%); transition: transform var(--dur-long) var(--ease-out); display: flex; flex-direction: column; }
.drawer-wrap.open { pointer-events: auto; }
.drawer-wrap.open .drawer-scrim { opacity: 1; }
.drawer-wrap.open .drawer { transform: none; }
.drawer-h { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-rule); display: flex; gap: var(--space-sm); align-items: flex-start; }
.drawer-h h3 { font-size: var(--text-xl); margin-top: var(--space-3xs); }
.drawer-h .sub { color: var(--color-muted); font-size: var(--text-xs); margin-top: var(--space-2xs); }
.drawer-h .icon-btn { margin-left: auto; }
.drawer-h select { width: auto; }
.drawer-b { flex: 1; overflow-y: auto; padding: var(--space-lg); }
.drawer-f { padding: var(--space-sm) var(--space-lg); border-top: 1px solid var(--color-rule); display: flex; gap: var(--space-xs); align-items: center; background: var(--color-paper-3); flex-wrap: wrap; }
.tabs { display: flex; gap: var(--space-2xs); padding: 0 var(--space-lg); border-bottom: 1px solid var(--color-rule); overflow-x: auto; flex: none; }
.tab { border: 0; background: none; min-height: 40px; padding: 0 var(--space-sm); cursor: pointer; color: var(--color-muted); font-weight: 500; font-size: var(--text-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: var(--space-xs); align-items: center; transition: color var(--dur-micro) var(--ease-out); }
.tab:hover { color: var(--color-ink); }
.tab.on { color: var(--color-ink); border-color: var(--color-accent); }
.tab .badge { font-family: var(--font-figure); font-size: var(--text-xs); color: var(--color-muted); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: var(--space-md); background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; }
.stat { background: var(--color-paper-2); padding: var(--space-sm); }
.stat small { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.stat b { font-family: var(--font-figure); font-weight: 400; font-size: var(--text-lg); font-variant-numeric: tabular-nums slashed-zero; }

.modal-wrap { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--space-lg); background: var(--color-scrim); opacity: 0; pointer-events: none; transition: opacity var(--dur-short) var(--ease-out); }
.modal-wrap.open { opacity: 1; pointer-events: auto; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--color-paper); border: 1px solid var(--color-rule-2); border-radius: var(--radius-card); transform: translateY(8px); transition: transform var(--dur-short) var(--ease-out); }
.modal.wide { width: min(1000px, 100%); }
.modal-wrap.open .modal { transform: none; }
.modal-h { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-rule); display: flex; align-items: center; gap: var(--space-sm); }
.modal-h h3 { font-size: var(--text-md); display: flex; gap: var(--space-xs); align-items: center; }
.modal-h .icon-btn { margin-left: auto; }
.modal-b { padding: var(--space-lg); overflow-y: auto; }
.modal-f { padding: var(--space-sm) var(--space-lg); border-top: 1px solid var(--color-rule); display: flex; gap: var(--space-xs); justify-content: flex-end; flex-wrap: wrap; background: var(--color-paper-3); }

.toasts { position: fixed; right: var(--space-lg); bottom: var(--space-lg); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-xs); align-items: flex-end; }
.toast { display: flex; gap: var(--space-sm); align-items: center; background: var(--color-paper-2); border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); max-width: 420px; animation: toastIn var(--dur-short) var(--ease-out); }
.toast .ic { color: var(--color-ok); }
.toast.error .ic { color: var(--color-bad); }
.toast.info .ic { color: var(--color-accent); }
.toast.out { opacity: 0; transition: opacity var(--dur-short) var(--ease-out); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.dict-hud { position: fixed; left: 50%; bottom: var(--space-lg); transform: translateX(-50%); z-index: var(--z-toast); display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md); border-radius: var(--radius-card); width: min(660px, calc(100% - 32px)); background: var(--color-paper-2); border: 1px solid var(--color-bad); }
.dict-orb { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--color-bad); color: var(--color-paper-3); flex: none; }
.dict-main { flex: 1; min-width: 0; }
.dict-field { font-size: var(--text-xs); color: var(--color-bad); font-weight: 500; }
.dict-text { font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 21px; }
.dict-help { font-size: var(--text-xs); color: var(--color-muted); }
.dict-help b { color: var(--color-ink); font-weight: 500; }
.waves { display: flex; gap: var(--space-2xs); align-items: center; height: 20px; }
.waves i { width: 3px; height: 18px; border-radius: 2px; background: var(--color-bad); animation: wave 1s ease-in-out infinite; transform-origin: center; }
.waves i:nth-child(2) { animation-delay: .1s } .waves i:nth-child(3) { animation-delay: .2s } .waves i:nth-child(4) { animation-delay: .3s } .waves i:nth-child(5) { animation-delay: .4s }
@keyframes wave { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }

/* ---------- estimator ---------- */
.est-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(370px, .9fr); gap: var(--space-md); align-items: start; margin-bottom: var(--space-md); }
.est-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: var(--space-md); }
.est-3d { height: 220px; padding: 0; overflow: hidden; background: var(--color-paper-3); }
.est-3d .est-canvas { position: absolute; inset: 0; }
.est-3d-cap { position: absolute; left: var(--space-md); bottom: var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); z-index: 1; pointer-events: none; }
.est-3d-cap b { color: var(--color-ink); font-family: var(--font-figure); font-weight: 400; }
.big { font-family: var(--font-figure); font-size: 2.6rem; font-weight: 400; letter-spacing: -0.04em; font-variant-numeric: tabular-nums slashed-zero; line-height: 1.1; margin: var(--space-2xs) 0 var(--space-sm); }
.unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: var(--space-sm); background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); overflow: hidden; }
.unit-grid div { background: var(--color-paper-3); padding: var(--space-xs) var(--space-sm); min-width: 0; }
.unit-grid span { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.unit-grid b { font-family: var(--font-figure); font-weight: 400; font-size: var(--text-md); font-variant-numeric: tabular-nums slashed-zero; }
.stackbar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; margin: var(--space-sm) 0 var(--space-xs); background: var(--color-paper-3); gap: var(--space-3xs); }
.stackbar i { display: block; height: 100%; }
.meas { font-size: var(--text-xs); color: var(--color-muted); }
.meas b { color: var(--color-ink); font-family: var(--font-figure); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-lg); }
.tool-group h4 { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink); margin-bottom: var(--space-xs); display: flex; gap: var(--space-xs); align-items: center; }
.tool-group h4 .ic { color: var(--color-accent); }
.tool-group label { display: flex; gap: var(--space-xs); align-items: flex-start; padding: var(--space-2xs) 0; font-size: var(--text-sm); cursor: pointer; border-bottom: 1px solid var(--color-rule); }
.tool-group label input { margin-top: var(--space-3xs); }
.tool-group label small { color: var(--color-muted); display: block; font-size: var(--text-xs); }
.tool-group label .qty { margin-left: auto; font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tool-group label:has(input:checked) .tn { color: var(--color-muted); text-decoration: line-through; }
.cat-h td { background: var(--color-paper-3); font-weight: 500; font-size: var(--text-xs); color: var(--color-ink-2); }
details.adv { grid-column: span 12; border-top: 1px solid var(--color-rule); padding-top: var(--space-2xs); }
details.adv > summary { cursor: pointer; padding: var(--space-sm) 0; font-weight: 500; font-size: var(--text-sm); list-style: none; display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: '+'; width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; border: 1px solid var(--color-rule-2); color: var(--color-accent); font-family: var(--font-figure); }
details.adv[open] > summary::before { content: '–'; }
details.adv > .fgrid { padding: var(--space-2xs) 0 var(--space-md); }

/* ---------- storm intel ---------- */
.storm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--space-md); margin-bottom: var(--space-md); }
.gauge { width: 150px; height: 150px; border-radius: 50%; position: relative; flex: none; }
.gauge::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--color-paper-2); }
.gauge-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.gauge-c b { font-family: var(--font-figure); font-weight: 400; font-size: 2.2rem; letter-spacing: -0.04em; line-height: 1; }
.gauge-c small { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-2xs); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2xs) var(--space-md); font-size: var(--text-sm); margin: 0; }
.kv dt { color: var(--color-muted); }
.kv dd { margin: 0; font-weight: 500; }
.alert-card { padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); }
.alert-card:last-child { border-bottom: 0; }
.alert-card h4 { font-size: var(--text-sm); display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.alert-card p { margin: var(--space-2xs) 0 0; font-size: var(--text-xs); color: var(--color-muted); }
.fc-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(124px, 1fr); gap: 1px; overflow-x: auto; background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); }
.fc { background: var(--color-paper-2); padding: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-2xs); }
.fc.night { background: var(--color-paper-3); }
.fc img { width: 44px; height: 44px; border-radius: var(--radius-pill); filter: grayscale(1) contrast(1.05); }
.fc .fc-n { font-size: var(--text-xs); font-weight: 500; }
.fc .fc-t { font-family: var(--font-figure); font-size: var(--text-xl); font-weight: 400; }
.fc .fc-s { font-size: var(--text-xs); color: var(--color-muted); min-height: 32px; line-height: 1.35; }
.meter { height: 6px; background: var(--color-paper-3); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; }
.fc .flags { display: flex; gap: var(--space-2xs); flex-wrap: wrap; min-height: 16px; }
.fc .flags span { font-size: var(--text-xs); padding: 0 var(--space-2xs); border-radius: 4px; }
#stormMap { height: 480px; border-radius: var(--radius-pill); overflow: hidden; border: 1px solid var(--color-rule); background: var(--color-paper-3); }
.leaflet-container { background: var(--color-paper-3) !important; font: inherit !important; isolation: isolate; z-index: 0; }
#stormMap .leaflet-tile-pane, #heatMap .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(0.9) brightness(0.8) contrast(0.95); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--color-paper-2) !important; color: var(--color-ink) !important; box-shadow: none !important; border: 1px solid var(--color-rule-2); }
.leaflet-popup-content { margin: var(--space-sm) !important; font-size: var(--text-sm); line-height: 1.45; }
.leaflet-bar a { background: var(--color-paper-2) !important; color: var(--color-ink) !important; border-color: var(--color-rule-2) !important; }
.leaflet-control-attribution { background: var(--color-scrim) !important; color: var(--color-muted) !important; }
.leaflet-control-attribution a { color: var(--color-ink-2) !important; }
.map-legend { display: flex; gap: var(--space-md); flex-wrap: wrap; font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-sm); }
.map-legend span { display: inline-flex; align-items: center; gap: var(--space-xs); }
.map-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.res-links { display: grid; gap: 0; }
.res-links a { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); text-decoration: none; color: var(--color-ink); transition: color var(--dur-micro) var(--ease-out); }
.res-links a:last-child { border-bottom: 0; }
.res-links a:hover { color: var(--color-accent); }
.res-links small { display: block; color: var(--color-muted); font-size: var(--text-xs); }
.outlook { padding-left: var(--space-md); margin: 0; }
.outlook li { margin-bottom: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); }
.outlook b { color: var(--color-ink); font-weight: 500; }
.risk-canvas { width: 100%; height: 150px; display: block; }

/* heatmap & canvassing */
.heat-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr); gap: var(--space-md); align-items: start; margin-bottom: var(--space-md); }
.heat-stage { padding: 0; overflow: hidden; }
#heatMap { height: 620px; background: var(--color-paper-3); }
#heatMap.drawing, #heatMap.drawing .leaflet-interactive { cursor: crosshair !important; }
.heat-side { display: flex; flex-direction: column; gap: var(--space-md); max-height: 760px; overflow-y: auto; position: sticky; top: 72px; }
.heat-layers { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); }
.heat-layers .chk { font-size: var(--text-xs); }
.heat-layers .chk i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.place-row { --c: var(--color-muted); display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); cursor: pointer; }
.place-row:last-child { border-bottom: 0; }
.place-row.on .li-t { color: var(--color-accent); }
.place-row .li-s { white-space: normal; }
.pdot { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; margin-top: var(--space-2xs); }
.pdot.hot { background: var(--color-bad); animation: hotBlink 1.6s ease-in-out infinite; }
@keyframes hotBlink { 50% { opacity: 0.35; } }
.hot-row { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
.hot-row:last-child { border-bottom: 0; }
.hot-rank { width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; font-family: var(--font-figure); font-size: var(--text-xs); border: 1px solid var(--color-accent); color: var(--color-accent); flex: none; }
path.alert-ring { animation: ringPulse 1.4s ease-in-out infinite; }
@keyframes ringPulse { 50% { stroke-opacity: .25; } }

/* ---------- vault ---------- */
.vault-stage { height: 440px; position: relative; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--color-rule); margin-bottom: var(--space-md); background: var(--color-paper-3); cursor: grab; touch-action: pan-y; }
.vault-stage.grabbing { cursor: grabbing; }
.vault-stage canvas { display: block; }
.vault-hint { position: absolute; left: var(--space-md); top: var(--space-md); font-size: var(--text-xs); color: var(--color-muted); z-index: 2; display: flex; gap: var(--space-xs); align-items: center; pointer-events: none; }
.vault-sel { position: absolute; right: var(--space-lg); top: var(--space-md); z-index: 2; text-align: right; pointer-events: none; }
.vault-sel b { display: block; font-size: var(--text-xl); font-weight: 500; }
.vault-sel small { color: var(--color-muted); font-family: var(--font-figure); }
.folder-chips { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-bottom: var(--space-md); }
.folder-chips button { --c: var(--color-muted); display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 32px; padding: 0 var(--space-sm); border-radius: var(--radius-pill); border: 1px solid var(--color-rule); background: var(--color-paper-2); cursor: pointer; font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-2); transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.folder-chips button i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.folder-chips button.on { color: var(--color-ink); border-color: var(--color-accent); }
.folder-chips button span { font-family: var(--font-figure); color: var(--color-muted); }
.dropzone { border: 1px dashed var(--color-rule-2); border-radius: var(--radius-pill); padding: var(--space-lg); text-align: center; color: var(--color-muted); margin-bottom: var(--space-md); transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.dropzone.hot { border-color: var(--color-accent); background: var(--color-select); color: var(--color-ink); }
.dropzone .ic { margin: 0 auto var(--space-xs); color: var(--color-accent); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-sm); }
.file { border-radius: var(--radius-pill); overflow: hidden; background: var(--color-paper-3); display: flex; flex-direction: column; }
.file .thumb { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--color-paper); overflow: hidden; cursor: pointer; color: var(--color-ink-2); position: relative; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .ext { position: absolute; left: var(--space-xs); top: var(--space-xs); font-family: var(--font-figure); font-size: var(--text-xs); padding: 0 var(--space-2xs); border-radius: 4px; background: var(--color-paper-3); color: var(--color-ink-2); border: 1px solid var(--color-rule); }
.file .meta { padding: var(--space-xs) var(--space-sm); font-size: var(--text-xs); }
.file .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: var(--text-sm); }
.file .meta small { color: var(--color-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .acts { display: flex; gap: var(--space-3xs); padding: 0 var(--space-xs) var(--space-xs); }
.file .acts button { flex: 1; min-height: 30px; border: 1px solid var(--color-rule); background: var(--color-paper-2); color: var(--color-ink-2); border-radius: 4px; cursor: pointer; display: grid; place-items: center; transition: color var(--dur-micro) var(--ease-out); }
.file .acts button:hover { color: var(--color-accent); }
.preview-frame { width: 100%; height: 70vh; border: 0; background: var(--doc-paper); border-radius: var(--radius-pill); }
.preview-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: var(--radius-pill); }

/* ---------- documents ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--space-md); align-items: start; }
.doc-preview { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; border-radius: var(--radius-card); padding: var(--space-md); background: var(--color-paper-3); border: 1px solid var(--color-rule); }
.paper { background: var(--doc-paper); color: var(--doc-ink); border-radius: 2px; padding: var(--space-xl); max-width: 860px; margin: 0 auto; }
.doc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: var(--space-md); background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; }
.doc-tiles > .panel { border: 0; border-radius: 0; }
.doc-tile { display: flex; gap: var(--space-md); align-items: flex-start; text-decoration: none; color: inherit; transition: background-color var(--dur-micro) var(--ease-out); }
.doc-tile:hover { background: var(--color-paper); color: inherit; }
.doc-tile h3 { font-size: var(--text-lg); }
.doc-tile p { margin: var(--space-2xs) 0 var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.doc-tile .kpi-ic { display: grid; width: 36px; height: 36px; border-radius: var(--radius-pill); place-items: center; border: 1px solid var(--color-rule-2); color: var(--color-accent); flex: none; }
.doc-tile .arr { margin-left: auto; color: var(--color-muted); align-self: center; }
.sigpad-wrap { background: var(--doc-paper); border-radius: var(--radius-pill); position: relative; height: 130px; border: 1px solid var(--color-rule-2); }
.sigpad-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; border-radius: var(--radius-pill); }
.sigpad-wrap .sig-line { position: absolute; left: var(--space-md); right: var(--space-md); bottom: 28px; border-bottom: 1px dashed var(--doc-rule-2); pointer-events: none; }
.sigpad-wrap .sig-x { position: absolute; left: var(--space-md); bottom: 32px; color: var(--doc-muted); font-weight: 500; pointer-events: none; }
.sigpad-wrap .btn { position: absolute; right: var(--space-xs); top: var(--space-xs); background: var(--doc-band); color: var(--doc-ink-2); border-color: var(--doc-rule); }
.clause-ed { padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); }
.clause-ed .row { gap: var(--space-sm); }
.clause-ed textarea { margin-top: var(--space-xs); font-size: var(--text-sm); }
.clause-ed.off { opacity: 0.55; }
.clause-ed.off textarea { display: none; }
.sop-sec { margin-bottom: var(--space-md); }
.sop-sec .ph { margin-bottom: var(--space-xs); }
.sop-num { width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; font-family: var(--font-figure); font-size: var(--text-xs); border: 1px solid var(--color-rule-2); color: var(--color-accent); flex: none; }
.sop-step { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
.sop-step:last-child { border-bottom: 0; }
.sop-step input[type=checkbox] { margin-top: var(--space-2xs); }
.sop-step .t { flex: 1; font-size: var(--text-sm); color: var(--color-ink-2); }
.sop-step.done .t { color: var(--color-muted); text-decoration: line-through; }
.sop-step textarea { font-size: var(--text-sm); }
.sop-prog { height: 4px; background: var(--color-paper-3); border-radius: 2px; overflow: hidden; flex: 1; max-width: 160px; }
.sop-prog i { display: block; height: 100%; background: var(--color-ok); }
.io-card { display: flex; flex-direction: column; gap: var(--space-sm); }
.io-card .ic-lg { width: 40px; height: 40px; border-radius: var(--radius-pill); display: grid; place-items: center; border: 1px solid var(--color-rule-2); color: var(--color-accent); }
.io-card p { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }
.logo-prev { width: 140px; height: 64px; border: 1px dashed var(--doc-rule-2); border-radius: var(--radius-pill); display: grid; place-items: center; overflow: hidden; background: var(--doc-paper); color: var(--doc-muted); font-size: var(--text-xs); }
.logo-prev img { max-width: 100%; max-height: 100%; }
.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--color-rule); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); overflow: hidden; }
.ai-step { background: var(--color-paper-2); padding: var(--space-md); min-width: 0; }
.ai-step h4 { display: flex; gap: var(--space-xs); align-items: center; margin-bottom: var(--space-2xs); }
.ai-step p { font-size: var(--text-xs); color: var(--color-muted); margin: 0 0 var(--space-xs); }
.ai-step p b { color: var(--color-ink); font-weight: 500; }

/* ---------- roof builder ---------- */
.roof-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr); gap: var(--space-md); align-items: start; margin-bottom: var(--space-md); }
.roof-stage { padding: 0; overflow: hidden; }
.roof-tools { display: flex; gap: var(--space-xs); flex-wrap: wrap; align-items: center; padding: var(--space-sm); border-bottom: 1px solid var(--color-rule); }
.roof-tools .btn.on { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }
.roof-tools select { min-height: 30px; }
.roof-sep { width: 1px; height: 20px; background: var(--color-rule-2); margin: 0 var(--space-2xs); }
.roof-map { height: 600px; background: var(--color-paper-3); position: relative; }
.roof-map.drawing, .roof-map.drawing .leaflet-interactive { cursor: crosshair !important; }
.roof-hint { display: flex; gap: var(--space-xs); align-items: center; padding: var(--space-xs) var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); border-top: 1px solid var(--color-rule); }
.roof-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: var(--space-md); }
.roof-3d { height: 280px; }
.roof-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--space-xs); text-align: center; color: var(--color-muted); z-index: 500; pointer-events: none; padding: var(--space-lg); }
.roof-empty .ic { color: var(--color-accent); }
.roof-empty b { color: var(--color-ink); font-weight: 500; font-size: var(--text-md); }
.roof-steps { margin: var(--space-sm) 0; padding-left: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); }
.roof-steps li { margin-bottom: var(--space-xs); }
.roof-steps b { color: var(--color-ink); font-weight: 500; }
.rv { background: var(--color-ink); border: 2px solid var(--color-paper-3); border-radius: 50%; box-shadow: 0 0 0 1px var(--color-accent); }
.edge-lbl, .facet-lbl { background: none; border: 0; }
.edge-lbl span, .facet-lbl span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; }
.edge-lbl span { background: var(--color-paper-3); color: var(--color-ink); font-family: var(--font-figure); font-size: var(--text-xs); padding: 0 var(--space-2xs); border-radius: 4px; border: 1px solid var(--color-rule); }
.facet-lbl span { background: var(--doc-paper); color: var(--doc-ink); font-size: var(--text-xs); padding: var(--space-3xs) var(--space-xs); border-radius: 4px; }
.roof-tip { background: var(--color-paper-2) !important; color: var(--color-ink) !important; border: 1px solid var(--color-rule-2) !important; font-size: var(--text-xs); }
.roof-tip::before { display: none; }
.swatch { display: block; width: 12px; height: 12px; border-radius: 2px; }
.tbl tr.row-sel td { background: var(--color-select); }

#printRoot { display: none; }

/* ---------- performance mode: no 3D hero, parallax or entrance motion ---------- */
body.perf .hero { height: 300px; }
body.perf .hero-3d, body.perf .px-contours { display: none; }
body.perf .band-art { display: none; }
body.perf .sbar-fill { animation: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1360px) { .hero-chips { display: none; } }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform var(--dur-short) var(--ease-out); }
  .sidebar.open { transform: none; }
  .icon-btn.menu-btn { display: inline-grid; }
  .est-layout, .grid-2, .grid-2-1, .storm-grid, .doc-layout, .heat-layout, .roof-layout { grid-template-columns: minmax(0, 1fr); }
  .est-side, .doc-preview, .heat-side, .roof-side { position: static; max-height: none; }
  .hero-3d { width: 100%; right: 0; opacity: 0.4; }
  .hero-chips { display: none; }
  .ai-grid { grid-template-columns: minmax(0, 1fr); }
  #heatMap { height: 480px; }
  .roof-map { height: 480px; }
}
@media (max-width: 680px) {
  .view { padding: var(--space-md) var(--space-md) var(--space-3xl); }
  .topbar { padding: var(--space-xs) var(--space-md); gap: var(--space-xs); }
  .gsearch kbd, .crumb { display: none; }
  .gsearch { margin-left: 0; }
  .fgrid > .fld, .fgrid > .form-sec { grid-column: span 12; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-3, .doc-tiles { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { height: 480px; }
  .hero-copy { left: var(--space-md); right: var(--space-md); }
  .hero h1 { font-size: var(--text-2xl); }
  .band { padding: var(--space-md); }
  .band h2 { font-size: var(--text-xl); }
  .sbar { grid-template-columns: 110px 1fr 80px; }
  .paper { padding: var(--space-lg) var(--space-md); }
  .big { font-size: 2.1rem; }
  .col { flex-basis: 260px; }
  .top-actions .btn span { display: none; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  html, body { background: var(--doc-paper) !important; overflow: visible !important; height: auto !important; }
  .app, .drawer-wrap, .modal-wrap, .toasts, .dict-hud { display: none !important; }
  #printRoot { display: block !important; }
  #printRoot .paper { padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sbar-fill, .waves i, .pdot.hot, path.alert-ring, .spinner { animation: none; }
}
