/* Pipeline Radar · white, quiet, professional.
   Layout: fixed left sidebar (nav + pipeline stages + run status) · top bar (title, search, actions)
   · pages: Overview (KPIs, charts, priorities, AI brief) · Pipeline board · Investors · Signals · Archived.
   Deliberately single-theme (light), per the brief. */
:root {
  color-scheme: light;
  --page: #f6f7f9; --surface: #ffffff; --surface-2: #f3f5f8; --surface-3: #eceff4;
  --ink: #0e1726; --ink-2: #475467; --muted: #8a94a6; --line: #e5e8ee; --line-2: #eef0f4;
  --accent: #2b59e0; --accent-2: #eaf0fe; --accent-ink: #ffffff;
  --rel-1: #86b6ef; --rel-2: #2a78d6; --rel-3: #104281;            /* ordinal blue ramp: general → B2B → logistics */
  /* actions: validated categorical hues (blue · orange · violet) + neutral greys; green stays reserved for 'good' status */
  --go: #1f63c2; --go-bg: #e8f1fc; --nudge: #b8471a; --nudge-bg: #fdefe8;
  --hold: #4a3aa7; --hold-bg: #efedfa; --quiet: #5f6b7d; --quiet-bg: #f0f2f5;
  --passed: #8a94a6; --passed-bg: #f3f4f6; --bad: #c4372c; --bad-bg: #fdecea; --good: #0b7a46; --good-bg: #e6f5ed;
  --a-go: #2a78d6; --a-nudge: #eb6834; --a-hold: #4a3aa7; --a-quiet: #c3cad5; --a-passed: #e3e6ec;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -6px rgba(16, 24, 40, .08);
  --r: 12px;
  --f-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font: 14px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 20px; padding: 18px 14px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.brand b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 2px; }
.nav-label { font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-2); color: var(--accent); }
.nav a .n { margin-left: auto; font: 500 12px var(--f-mono); color: var(--muted); }
.nav a[aria-current="page"] .n { color: var(--accent); }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.side-run { margin-top: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.side-run .row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.side-run .row b { color: var(--ink); font-weight: 500; }
.safe { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--good); font-weight: 500; }
.safe.warn { color: var(--bad); }

.top { position: sticky; top: 0; z-index: 5; background: rgba(246, 247, 249, .88); backdrop-filter: saturate(1.4) blur(10px);
  display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.top .crumb { font-size: 13px; color: var(--muted); white-space: nowrap; }
.top .grow { flex: 1; }
.search { position: relative; width: min(320px, 100%); }
.search input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 12px 8px 34px; font-size: 13.5px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted); }
.page { padding: 8px 28px 56px; display: grid; gap: 20px; align-content: start; outline: none; }

/* ---------- buttons, pills ---------- */
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 13px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: #cfd5df; background: #fbfcfd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #2450cf; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #1d2738; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { box-shadow: none; background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: #f1c6c1; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.block { width: 100%; justify-content: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.6; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before, .pill.nodot::before { display: none; }
.pill.go { background: var(--go-bg); color: var(--go); } .pill.nudge { background: var(--nudge-bg); color: var(--nudge); }
.pill.hold { background: var(--hold-bg); color: var(--hold); } .pill.quiet { background: var(--quiet-bg); color: var(--quiet); }
.pill.passed { background: var(--passed-bg); color: var(--passed); } .pill.plain { background: var(--surface-2); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 5px; font: 500 11.5px/1.5 var(--f-mono); padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.badge { display: inline-flex; align-items: center; gap: 4px; font: 500 11.5px/1.5 var(--f-mono); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.badge.new { background: var(--accent); color: #fff; } .badge.up { background: var(--good-bg); color: var(--good); }
.badge.down { background: var(--bad-bg); color: var(--bad); } .badge.sig { background: var(--accent-2); color: var(--accent); }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-h h2, .card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.card-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-b { padding: 14px 18px 18px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* hero + stat tiles */
.hero { padding: 20px 22px; display: grid; gap: 14px; background:
  radial-gradient(120% 140% at 100% 0%, #eef3ff 0%, rgba(238, 243, 255, 0) 55%), var(--surface); }
.hero .eyebrow { font: 500 11.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hero-nums { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; }
.hero-num b { display: block; font-size: 52px; line-height: 1; font-weight: 600; letter-spacing: -.03em; }
.hero-num span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.hero p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.since { display: flex; flex-wrap: wrap; gap: 6px; }
.dist { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.dist span { display: block; height: 100%; }
.c-go { background: var(--a-go); } .c-nudge { background: var(--a-nudge); } .c-hold { background: var(--a-hold); } .c-quiet { background: var(--a-quiet); } .c-passed { background: var(--a-passed); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.tile .lbl { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .val { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile .val small { font-size: 14px; color: var(--muted); font-weight: 500; }
.delta { font: 500 12px var(--f-mono); }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.tile .foot { font-size: 12px; color: var(--muted); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text.axis { font: 11px var(--f-mono); fill: var(--muted); }
.chart .grid line { stroke: var(--line-2); stroke-width: 1; }
.chart .base { stroke: #d4d9e1; stroke-width: 1; }
.chart .hl { fill: transparent; }
.chart g.col:hover .hl { fill: var(--surface-2); }
.chart g.col:hover .seg { filter: brightness(1.1); }
.chart .lbl { font: 500 11.5px var(--f-mono); fill: var(--ink-2); }
.chart .th { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }
.chart .th-lbl { font: 500 10.5px var(--f-mono); fill: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: 132px minmax(0, 1fr) 30px; align-items: center; gap: 10px; font-size: 13px; background: none; border: 0; padding: 4px; margin: 0 -4px; border-radius: 7px; text-align: left; cursor: pointer; color: var(--ink-2); width: calc(100% + 8px); }
.hbar:hover { background: var(--surface-2); }
.hbar .nm { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.hbar .track { display: block; height: 10px; border-radius: 0 4px 4px 0; overflow: hidden; background: var(--surface-2); }
.hbar .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.hbar b { font: 500 12.5px var(--f-mono); color: var(--ink); text-align: right; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .2); max-width: 260px; }
.tip b { font: 600 13px var(--f-sans); }
.tip .k { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 6px; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; }
.tip .row span { color: #b6c0d1; }

/* ---------- logos & people ---------- */
.logo { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); font: 600 11.5px var(--f-sans); color: #fff; }
.logo img { width: 20px; height: 20px; object-fit: contain; }
.logo.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 15px; } .logo.lg img { width: 28px; height: 28px; }
.logo.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; } .logo.sm img { width: 16px; height: 16px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div { min-width: 0; }
.who b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- tables ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { border-color: #cfd5df; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font: 500 11.5px var(--f-mono); opacity: .7; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font: 500 11.5px var(--f-mono); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button:hover { color: var(--ink); }
th button[data-dir="desc"]::after { content: "↓"; } th button[data-dir="asc"]::after { content: "↑"; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td.sum { color: var(--ink-2); font-size: 13px; max-width: 380px; min-width: 220px; }
table.pri td.sum { min-width: 180px; max-width: 300px; }
table.pri td, table.pri th { padding-left: 12px; padding-right: 12px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.score { display: flex; align-items: center; gap: 10px; }
.score b { font: 600 13.5px var(--f-mono); width: 24px; text-align: right; }
.meter { position: relative; height: 6px; width: 76px; background: var(--surface-3); border-radius: 3px; flex: none; }
.meter .f { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); }
.meter .th { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; border-radius: 1px; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--accent); opacity: .08; }
.spark-th { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; }
.spark-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.spark-none { font: 400 11.5px var(--f-mono); color: var(--muted); }

/* ---------- AI brief ---------- */
.brief-list { display: grid; gap: 10px; }
.rec { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.rec:hover { border-color: #cfd5df; box-shadow: var(--shadow-2); }
.rec .why { font-size: 13px; color: var(--ink-2); }
.rec .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-orb { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #2b59e0, #7a5af8); display: grid; place-items: center; flex: none; }
.ai-orb svg { width: 15px; height: 15px; stroke: #fff; }
.runs { display: grid; }
.runs div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); }
.runs .ok { color: var(--good); } .runs .bad { color: var(--bad); }
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; }
.proof div { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink-2); }
.proof strong { display: block; font: 500 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.rules { display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.rules p { margin: 0; }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 10px; align-content: start; min-height: 260px; transition: background .15s, border-color .15s; }
.col.over { background: var(--accent-2); border-color: var(--accent); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 0; font-weight: 600; font-size: 13.5px; }
.col-h .n { font: 500 12px var(--f-mono); color: var(--muted); }
.col-h .avg { margin-left: auto; font: 500 11.5px var(--f-mono); color: var(--muted); }
.col-sub { font-size: 12px; color: var(--muted); padding: 0 4px 2px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 9px; cursor: grab; box-shadow: var(--shadow-1); transition: box-shadow .15s, border-color .15s, opacity .15s; }
.kcard:hover { border-color: #cfd5df; box-shadow: var(--shadow-2); }
.kcard.dragging { opacity: .45; cursor: grabbing; }
.kcard .top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kcard .sig { font-size: 12.5px; color: var(--ink-2); }
.kcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.kscore { font: 600 12.5px var(--f-mono); border-radius: 7px; padding: 1px 7px; flex: none; }
.kscore.hi { background: var(--go-bg); color: var(--go); } .kscore.mid { background: var(--surface-2); color: var(--ink-2); } .kscore.lo { background: var(--surface-2); color: var(--muted); }

/* ---------- signals feed ---------- */
.feed-day { font: 500 11.5px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 14px 18px 6px; }
.sig-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 18px; border-top: 1px solid var(--line-2); }
.sig-row .s a { color: var(--ink); text-decoration: none; font-weight: 500; }
.sig-row .s a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.sig-row .s small { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.sig-row.rejected .s a { text-decoration: line-through; color: var(--muted); }
.fb { display: flex; gap: 4px; }
.fb-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; width: 30px; height: 28px; cursor: pointer; font-size: 13px; line-height: 1;
  opacity: .6; filter: grayscale(1); transition: opacity .15s, filter .15s; }
.fb-btn:hover { opacity: 1; filter: none; }
.fb-btn.on { opacity: 1; filter: none; border-color: var(--accent); background: var(--accent-2); }

/* evidence rows (drawer) */
.ev { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: start; }
.ev .d { font: 500 12.5px var(--f-mono); color: var(--ink-2); padding-top: 1px; }
.ev .s a { color: var(--ink); text-decoration: none; }
.ev .s a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.ev .s small { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.ev.rejected .s a { text-decoration: line-through; color: var(--muted); }
.strip { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.strip i { display: block; height: 14px; border-radius: 3px; background: var(--surface-3); }
.strip i.r1 { background: var(--rel-1); } .strip i.r2 { background: var(--rel-2); } .strip i.r3 { background: var(--rel-3); }
.strip-axis { display: flex; justify-content: space-between; font: 400 11px var(--f-mono); color: var(--muted); margin-top: 5px; }

/* archived */
.arch-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.arch-row:first-child { border-top: 0; }
.arch-why { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }

.empty { padding: 28px; text-align: center; color: var(--ink-2); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .chips { flex: 1; }

/* ---------- drawer ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(14, 23, 38, .28); backdrop-filter: blur(2px); }
dialog.drawer { margin: 0 0 0 auto; height: 100%; width: min(580px, 100%); }
dialog.drawer[open] .drawer-inner { animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-inner { background: var(--surface); height: 100%; overflow-y: auto; display: grid; align-content: start; gap: 22px;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 24px 36px; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(16, 24, 40, .08); }
.d-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.d-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.d-head .firm { color: var(--ink-2); font-size: 13.5px; }
.close { border: 1px solid var(--line); background: var(--surface); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1; }
.d-sec { display: grid; gap: 10px; }
.d-sec > h3 { margin: 0; font: 500 11.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kv3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kv3 div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.kv3 span { display: block; font-size: 12px; color: var(--muted); }
.kv3 b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 11px; font-size: 14px; color: var(--ink); width: 100%; font-weight: 400; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.locked { display: grid; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.locked div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
.locked span { color: var(--muted); }
.mail { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mail .row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--line); }
.mail .row label { padding: 0 12px; font-size: 12.5px; color: var(--muted); }
.mail input, .mail textarea { border: 0; background: transparent; padding: 10px 12px 10px 0; font-size: 14px; width: 100%; color: var(--ink); }
.mail textarea { min-height: 220px; padding: 12px; resize: vertical; line-height: 1.55; display: block; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* toast, progress, loading */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%) translateY(16px); z-index: 70;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; opacity: 0; transition: .22s; pointer-events: none;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .25); max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button { background: transparent; border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 7px; padding: 3px 9px; cursor: pointer; font-size: 12.5px; }
.progress { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s; }
.loading { display: grid; gap: 16px; padding-top: 12px; }
.skel { height: 130px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), #fff, var(--surface-2)); background-size: 200% 100%; animation: sh 1.4s infinite; }
.skel.tall { height: 320px; }
@keyframes sh { to { background-position: -200% 0; } }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
  .span-6, .span-3 { grid-column: span 6; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .nav-stages, .side .nav-label { display: none; }
  .nav { grid-auto-flow: column; overflow-x: auto; max-width: 100%; }
  .side-run { display: none; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .page { padding: 8px 16px 48px; }
  .span-6, .span-3 { grid-column: span 12; }
}
@media (max-width: 560px) {
  .search { width: 100%; order: 5; }
  .hero-num b { font-size: 40px; }
  .grid2, .kv3 { grid-template-columns: 1fr; }
  .ev, .sig-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ev .d, .sig-row > .logo { display: none; }
  .arch-row { grid-template-columns: minmax(0, 1fr) auto; }
  .arch-why { grid-column: 1 / -1; grid-row: 2; }
  .locked div { grid-template-columns: 1fr; gap: 2px; }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 28px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* lighter text density */
.card-h p { display: none; }
.clamp1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.sample { display: inline-flex; align-items: center; font: 500 11px var(--f-mono); color: var(--nudge); background: var(--nudge-bg); border-radius: 5px; padding: 0 6px; letter-spacing: 0; text-transform: none; cursor: help; }
