:root {
  --surface: #E1EBF0; --surface-raised: #ffffff; --surface-sunken: #D2E1E8;
  --ink: #17313E; --ink-muted: #4A6574; --ink-faint: #476675;
  --line: #C8D9E1; --line-strong: #5F8191;
  --accent: #2E5C72; --accent-soft: #CBE0E8; --on-accent: #ffffff;
  --closed: #3F5967; --closed-soft: #E9F0F3;
  --calm: #1D5F6B; --calm-soft: #D3E8EC; --aqua: #477A91;
  --shadow: 0 1px 0 rgba(23, 49, 62, .04), 0 10px 30px -12px rgba(23, 49, 62, .22);
  --focus: var(--ink);
  --r-sm: 12px; --r-md: 22px; --r-lg: 28px; --r-pill: 999px;
  --display: "Avenir Next", "Century Gothic", Futura, "Trebuchet MS", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 3vw, 40px);
  --caution: #8a4b00; --caution-soft: #fff1dc;
  --shadow-pop: 0 12px 32px rgba(15, 32, 41, .16);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --t-xs: 12px; --t-sm: 13px; --t-base: 15px; --t-md: 18px; --t-lg: 28px;
  --dur-1: 120ms; --dur-2: 250ms; --ease: ease;
  --target: 40px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --surface: #0F2029; --surface-raised: #16303C; --surface-sunken: #0B171E;
  --ink: #E1EBF0; --ink-muted: #A9BEC8; --ink-faint: #93AAB6;
  --line: #244757; --line-strong: #5F8697;
  --accent: #D6AA58; --accent-soft: #20404E; --on-accent: #0F2029;
  --closed: #B3C7D1; --closed-soft: #12262F;
  --calm: #A9CDD4; --calm-soft: #14323A; --aqua: #A9CDD4;
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
  --caution: #ffc875; --caution-soft: #3a2a10;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); }
body { color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
code { font-family: var(--mono); font-size: .9em; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
.label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* Shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 28px 20px; background: var(--surface-sunken); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 24px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); text-decoration: none; padding: 0 12px; }
.mark { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--aqua); }
#nav { display: grid; gap: 4px; align-content: start; flex: 1; }
.nav-group { margin: 20px 12px 6px; }
#nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: var(--r-pill); color: var(--ink-muted); text-decoration: none; font-size: 14px; }
#nav a:hover { color: var(--ink); background: var(--surface-sunken); }
#nav a[aria-current="page"] { background: var(--surface-raised); box-shadow: var(--shadow); color: var(--ink); font-weight: 600; }
.side-foot { display: grid; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 3px; }
.seg button { font: inherit; font-size: 13px; padding: 6px 10px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-raised); box-shadow: var(--shadow); color: var(--ink); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px var(--gutter) 20px; }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.02; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
#view { padding: 4px var(--gutter) 48px; flex: 1; outline: none; }
footer { padding: 16px var(--gutter) 28px; color: var(--ink-muted); font-size: 13px; }

/* Buttons */
.btn { min-height: var(--target); font: inherit; font-size: 14px; font-weight: 500; padding: 10px 20px; border-radius: var(--r-pill); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:hover { border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { min-height: 32px; padding: 5px 14px; font-size: var(--t-sm); }
.btn.caution { background: var(--caution-soft); color: var(--caution); border-color: var(--caution); }
.tag.caution { color: var(--caution); background: var(--caution-soft); border-color: var(--caution); }
.tag { display: inline-block; font-size: 12px; line-height: 18px; padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--ink-muted); white-space: nowrap; }
.tag.accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.tag.closed { color: var(--closed); background: var(--closed-soft); border-color: transparent; }
.tag.calm { color: var(--calm); background: var(--calm-soft); border-color: var(--calm); }

/* Grid and cards */
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: 1 / -1; }
.card { background: var(--surface-raised); box-shadow: var(--shadow); border-radius: var(--r-md); padding: 24px; min-width: 0; }
.card-head { margin-bottom: 18px; }
.card-head h2 { font-size: 28px; line-height: 1.1; }
.card-head p { color: var(--ink-muted); margin-top: 4px; font-size: 14px; }
.caveat { color: var(--ink-muted); font-size: 13px; margin-top: 16px; max-width: 70ch; }
.empty { color: var(--ink-muted); }

/* KPIs */
.kpi .n { font-weight: 300; font-family: var(--display); font-size: clamp(2.6rem, 4.4vw, 4.2rem); line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.kpi .label { margin-top: 10px; }
.kpi.accent .n { color: var(--accent); }

/* Funnel */
.funnel { display: grid; gap: 12px; }
.f-row { display: grid; grid-template-columns: 140px 1fr 110px; gap: 16px; align-items: center; }
.f-label { color: var(--ink-muted); font-size: 13px; }
.f-track { height: 14px; background: var(--surface-sunken); border-radius: var(--r-pill); overflow: hidden; }
.f-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--aqua)); min-width: 6px; border-radius: var(--r-pill); }
.f-val { font-family: var(--display); font-size: 24px; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.1; }
.f-val small { display: block; font-family: var(--sans); font-size: 11px; color: var(--ink-muted); letter-spacing: .04em; }

/* Fit */
.fit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.fit-list { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; border-top: 1px solid var(--line); }
.fit-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 10px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: var(--r-sm); }
.fit-item:hover { background: var(--surface-sunken); }
.fit-item[aria-pressed="true"] { background: var(--accent-soft); }
.fit-score { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.fit-role { color: var(--ink-muted); font-size: 13px; }
.radar h3 { font-size: 26px; }
.radar .sub { color: var(--ink-muted); margin: 4px 0 14px; font-size: 14px; }
.radar svg { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; }
.radar-note { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 14px; }
.dim-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.dim-list li { display: grid; grid-template-columns: 84px 1fr 22px; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-muted); }
.dim-bar { height: 4px; background: var(--line); border-radius: var(--r-pill); position: relative; }
.dim-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: var(--r-pill); }
.dim-list b { font-weight: 400; color: var(--ink); text-align: right; }

/* Charts */
.swarm svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; color: var(--ink-muted); font-size: 13px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.legend .l-int::before { background: var(--accent); } .legend .l-rej::before { background: var(--ink-faint); } .legend .l-wait::before { border: 1.5px solid var(--ink); }
.bars { display: grid; gap: 14px; }
.b-row { display: grid; grid-template-columns: 90px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.b-label { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; }
.b-track { height: 10px; background: var(--surface-sunken); border-radius: var(--r-pill); overflow: hidden; }
.b-track i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.b-val { text-align: right; font-variant-numeric: tabular-nums; }
.waiting { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 340px; overflow-y: auto; }
.waiting li { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.waiting .d { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.waiting .d small { font-family: var(--sans); font-size: 10px; color: var(--ink-muted); margin-left: 0; letter-spacing: .08em; }

/* Tracker table */
.controls { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; color: var(--ink-muted); background: transparent; border: 1px solid var(--line-strong); padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); font-weight: 500; }
input[type="search"], .input { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); padding: 9px 16px; min-width: min(100%, 280px); border-radius: var(--r-pill); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-muted); padding: 12px 12px 12px 0; cursor: pointer; user-select: none; border-bottom: 1px solid var(--line-strong); }
th[aria-sort] { color: var(--accent); }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
td.num, th.num { text-align: right; padding-right: 20px; }
td.score { font-family: var(--display); font-size: 20px; }
td.muted { color: var(--ink-muted); } td.date { font-family: var(--mono); font-size: 13px; color: var(--ink-muted); }
tr.row:hover td { background: var(--surface-sunken); }
button.edit { font: inherit; font-size: 12px; color: var(--ink-muted); background: transparent; border: 1px solid var(--line-strong); padding: 4px 14px; border-radius: var(--r-pill); cursor: pointer; }
button.edit:hover { color: var(--ink); border-color: var(--accent); }

/* Steady */
.steady { background: var(--surface-raised); box-shadow: var(--shadow); border-radius: var(--r-md); padding: 28px; display: grid; gap: 4px; }
.steady .k { display: inline-flex; align-items: center; gap: 10px; color: var(--closed); font-weight: 600; font-size: 14px; }
.steady .k::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 4px color-mix(in srgb, var(--aqua) 22%, transparent); }
.steady .when { color: var(--ink-muted); font-size: 14px; margin-top: 2px; }
.steady .big { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; margin: 8px 0 12px; letter-spacing: -.02em; }
.steady .trail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 6px 0 12px; }
.steady .trail div { padding-top: 10px; border-top: 3px solid var(--accent); font-size: 13px; color: var(--ink-muted); display: grid; }
.steady .trail div:last-child { border-top-color: var(--closed); }
.steady .trail b { color: var(--ink); font-weight: 600; font-size: 14px; }
.steady .row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.steady .wit { font-family: var(--display); font-size: 19px; margin-top: 16px; box-shadow: inset 0 -2px 0 var(--aqua); width: fit-content; max-width: 100%; }
.meter .track { height: 12px; background: var(--surface-sunken); border-radius: var(--r-pill); position: relative; margin: 14px 0 10px; }
.meter .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--aqua)); border-radius: var(--r-pill); min-width: 4px; }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.meter .est { font-family: var(--display); font-size: 44px; line-height: 1.05; margin-top: 6px; }
.dots { display: flex; gap: 8px; margin: 12px 0; }
.dots i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); }
.dots i.on { background: var(--aqua); border-color: var(--aqua); }

/* Soon pages */
.soon { max-width: 760px; }
.soon h2 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.05; margin: 10px 0 14px; }
.soon ul { margin: 18px 0 0; padding-left: 20px; color: var(--ink-muted); }
.soon li { margin: 6px 0; }
.soon .lede { font-size: 18px; color: var(--ink-muted); max-width: 52ch; }

/* Step form */
.wiz-wrap { display: grid; place-items: start center; padding-top: 8px; }
.wiz { width: min(680px, 100%); background: var(--surface-raised); box-shadow: var(--shadow); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 44px); }
.prog { display: flex; gap: 6px; margin-bottom: 10px; }
.prog i { height: 4px; flex: 1; border-radius: var(--r-pill); background: var(--line); }
.prog i.on { background: var(--accent); }
.wiz h2 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.06; margin: 10px 0 8px; }
.wiz .hint { color: var(--ink-muted); margin-bottom: 20px; }
.opts { display: grid; gap: 10px; margin-top: 18px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { font: inherit; text-align: left; padding: 14px 18px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; display: grid; gap: 2px; }
.opt small { color: var(--ink-muted); font-size: 13px; }
.opt:hover { border-color: var(--accent); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] strong { color: var(--accent); }
.wiz .big-input { width: 100%; font: inherit; font-size: 20px; padding: 14px 18px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.wiz textarea.big-input { min-height: 120px; resize: vertical; font-size: 16px; }
.pick-list { display: grid; gap: 8px; margin-top: 14px; max-height: 340px; overflow-y: auto; }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }
.review { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.review li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.start { text-align: left; font: inherit; color: var(--ink); background: var(--surface-raised); box-shadow: var(--shadow); border: 1px solid transparent; border-radius: var(--r-md); padding: 24px; cursor: pointer; display: grid; gap: 8px; }
.start:hover { border-color: var(--accent); }
.start h3 { font-size: 26px; line-height: 1.1; }
.start p { color: var(--ink-muted); font-size: 14px; }

/* Dialog */
dialog { background: var(--surface-raised); color: var(--ink); border: 0; box-shadow: var(--shadow); border-radius: var(--r-lg); padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog form { padding: clamp(20px, 4vw, 36px); }
dialog h2 { font-size: 30px; }
dialog .sub { margin: 4px 0 22px; color: var(--ink-muted); }
dialog .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
dialog .grid.five { grid-template-columns: repeat(5, 1fr); }
dialog label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-muted); }
dialog label.wide { margin-top: 14px; }
dialog input, dialog select, dialog textarea { font: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); padding: 10px 12px; border-radius: var(--r-sm); width: 100%; }
dialog fieldset { margin: 18px 0 0; padding: 0; border: 0; }
dialog legend { padding: 0; margin-bottom: 8px; color: var(--ink-muted); font-size: 12px; }
.row-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 22px; font-size: 14px; border-radius: var(--r-pill); max-width: calc(100vw - 32px); z-index: 10; }
#toast[hidden] { display: none; }
body.dragging .main { outline: 2px dashed var(--accent); outline-offset: -8px; }

@media (max-width: 1100px) {
  .c3, .c4, .c5, .c6, .c7, .c8 { grid-column: span 6; }
  .fit { grid-template-columns: 1fr; }
}
@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: 12px; padding: 14px var(--gutter); border-right: 0; border-bottom: 1px solid var(--line); }
  #nav { display: flex; flex: 1 1 100%; order: 3; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  #nav a { white-space: nowrap; flex: none; } .nav-group { display: none; }
  .side-foot { grid-auto-flow: column; margin-left: auto; }
}
@media (max-width: 640px) {
  .c3, .c4, .c5, .c6, .c7, .c8 { grid-column: 1 / -1; }
  .f-row { grid-template-columns: 1fr auto; } .f-track { grid-column: 1 / -1; grid-row: 2; }
  .opts.two { grid-template-columns: 1fr; }
  dialog .grid, dialog .grid.five { grid-template-columns: 1fr 1fr; }
  .waiting li { grid-template-columns: 64px 1fr; } .waiting li .tag { grid-column: 2; justify-self: start; }
  .steady .row, .review li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: no-preference) { .f-bar, .dim-bar i, .b-track i, .meter .fill { transition: width .25s ease; } }

/* layout fixes */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.kpis .kpi { padding: 22px 24px; }
.fit-list { max-height: 400px; }
.fit-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.radar svg { width: 100%; max-height: 340px; }
.waiting li { grid-template-columns: 84px minmax(0, 1fr) auto; }
.waiting li > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.c4 .waiting li { grid-template-columns: 72px minmax(0, 1fr); }
.c4 .waiting li .tag { grid-column: 2; justify-self: start; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* proposed updates */
.prop-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); margin-top: 18px; }
.prop { display: flex; flex-direction: column; gap: 6px; }
.prop.done { opacity: .6; }
.prop-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.prop-head h3 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 400; }
.prop .label { margin-top: 10px; }
.prop-change { margin: 0; font-family: var(--display); font-size: 19px; }
.prop blockquote { margin: 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-sunken); color: var(--ink-muted); font-style: italic; }
.prop .wiz-nav { margin-top: 14px; }
.controls .tag { padding: 9px 16px; line-height: 1.2; }

/* Follow-ups */
.fu-list { display: grid; gap: 12px; }
.card.fu { padding: 16px 22px; }
.fu-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
.fu-row .d { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.fu-row .d small { font-family: var(--sans); font-size: 10px; color: var(--ink-muted); margin-left: 0; letter-spacing: .08em; }
.fu-who { min-width: 0; overflow-wrap: anywhere; }
.fu-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.fu-controls { display: flex; gap: 22px; flex-wrap: wrap; }
.fu-controls .label { display: block; margin-bottom: 6px; }
.fu-me { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fu-panel label { display: block; }
.fu-panel .label { display: block; margin-bottom: 6px; }
.fu-panel input, .fu-panel textarea { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); color: var(--ink); }
.fu-panel textarea { line-height: 1.55; resize: vertical; }
.fu-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fb { margin-top: 18px; display: grid; gap: 12px; }
.fb-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-auto { font-size: 14px; }
@media (max-width: 720px) { .fu-row { grid-template-columns: 64px minmax(0, 1fr); } .fu-row .tag, .fu-row .btn { grid-column: 2; justify-self: start; } .fu-me { grid-template-columns: 1fr; } }

/* Craft */
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row-head .seg { grid-auto-columns: auto; }
.craft-table { width: 100%; border-collapse: collapse; }
.craft-table th { text-align: left; font-size: 13px; color: var(--ink-muted); font-weight: 500; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.craft-table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.craft-table .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 22px; }
.craft-table th.num { text-align: right; padding-right: 22px; }
.rate { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rate .bar { width: 120px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; display: inline-block; }
.rate .bar i { display: block; height: 100%; background: var(--accent); }
.small-note { margin-top: 14px; font-size: 13.5px; }
.craft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.craft-prompt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 18px 20px; display: grid; gap: 12px; align-content: start; }
.craft-prompt h3 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 0; }
.prompt-text { font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.craft-pick select { width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); color: var(--ink); }
.craft-pick .label { display: block; margin-bottom: 6px; }
@media (max-width: 980px) { .craft-grid { grid-template-columns: 1fr; } }
.card .seg button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: none; }

/* Proof */
.proof-big { font-family: var(--display); font-weight: 300; font-size: clamp(2.6rem, 4.4vw, 3.6rem); line-height: 1; letter-spacing: -.02em; margin: 0 0 18px; }
.chk { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chk li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.chk i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-style: normal; font-size: 11px; }
.chk li.ok i { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chk li.ok > span { color: var(--ink-muted); }
.chk .btn { padding: 4px 12px; min-height: 0; }
.chk select { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 6px 12px; max-width: 220px; }
.stepper { display: inline-flex; gap: 6px; }
.small { font-size: 13px; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.gr { background: var(--surface-sunken); border-radius: var(--r-sm); padding: 12px 14px; display: grid; }
.gr b { font-family: var(--display); font-weight: 300; font-size: 2rem; line-height: 1; }
.gr span { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.gr-M b { color: var(--accent); } .gr-E b, .gr-Q b { color: var(--closed); }
.sub-h { font-size: 18px; margin: 18px 0 4px; }
.unlock { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.tag.warn { color: var(--closed); background: var(--closed-soft); border-color: transparent; white-space: normal; }
@media (max-width: 720px) { .grades { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chk li { grid-template-columns: 22px minmax(0, 1fr); } .chk li > :last-child { grid-column: 2; justify-self: start; } }

/* Folder connection */
.folder { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-raised); box-shadow: var(--shadow); }
.folder .label { margin: 0; }
.fd-name { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--calm); flex: none; box-shadow: 0 0 0 4px var(--calm-soft); }
.dot.off { background: var(--ink-muted); box-shadow: 0 0 0 4px var(--surface-sunken); }
.fd-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.fd-files li { display: flex; gap: 8px; color: var(--ink); }
.fd-files li.off { color: var(--ink-muted); }
.fd-files em { font-style: normal; }
.fd-note { margin: 0; font-size: 13px; color: var(--ink-muted); }
.fd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.folder .btn { padding: 8px 16px; font-size: 13px; }
.folder .btn.accent { width: 100%; }
#conflict .row-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 900px) { .folder { flex: 1 1 100%; order: 2; } }
@media (max-width: 900px) {
  .folder { grid-template-columns: 1fr auto; align-items: center; padding: 12px 16px; gap: 8px 12px; }
  .folder .label, .fd-files { display: none; }
  .fd-note { grid-column: 1 / -1; }
  .fd-note.muted { display: none; }
  .fd-actions { justify-content: flex-end; }
  .folder .btn.accent { width: auto; }
}

/* Accessibility */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--surface); text-decoration: none; font-size: 14px; }
.skip:focus { top: 12px; }
button.fit-item { width: 100%; font: inherit; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.fit-list li { display: block; }
.th-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.start-t { display: block; font-family: var(--display); font-size: 26px; font-weight: 400; line-height: 1.1; }
.prop-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 400; }
#title:focus { outline: none; }

input::placeholder, textarea::placeholder { color: var(--ink-muted); opacity: 1; }

.main { min-width: 0; }
.th-btn { min-height: 32px; padding: 4px 10px 4px 0; }
th { position: relative; }

/* Windows high contrast (forced colors): keep shapes that carry meaning */
@media (forced-colors: active) {
  .card, .kpi { border: 1px solid CanvasText; box-shadow: none; }
  .f-bar, .meter .fill, .dim-bar i, .b-track i { background: Highlight; forced-color-adjust: none; }
  .meter .track, .dim-bar, .b-track { background: Canvas; border: 1px solid CanvasText; }
  .dots i { border: 2px solid CanvasText; }
  .dots i.on { background: Highlight; border-color: Highlight; forced-color-adjust: none; }
  .dot { background: CanvasText; box-shadow: none; }
}

.soon-try { margin-top: 26px; display: grid; gap: 10px; justify-items: start; }
.soon-try .prompt-text { width: 100%; max-width: 60ch; }

/* Phones: keep the folder card from pushing the page content down */
@media (max-width: 720px) {
  .folder .fd-note.muted, .folder .fd-files, .folder .label + .fd-note { display: none; }
}

/* Semantic lists (funnel, gates, sources) keep the old look */
ol.funnel, ul.bars { list-style: none; margin: 0; padding: 0; }
ol.funnel { display: grid; gap: 12px; }
li.f-row, li.b-row { margin: 0; padding: 0; }
.b-row .sr { position: absolute; }
li.b-row { position: relative; }

/* Header: one primary action, the rest under More */
.actions details.more { position: relative; }
.actions details.more > summary { list-style: none; cursor: pointer; }
.actions details.more > summary::-webkit-details-marker { display: none; }
.actions details.more > summary::after { content: "\25BE"; margin-left: 8px; font-size: 11px; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 4px; min-width: 200px; padding: 8px; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-pop); }
.more-menu .btn { justify-content: flex-start; text-align: left; border-color: transparent; }
.more-menu .btn:hover { background: var(--accent-soft); }
@media (forced-colors: active) { .more-menu { border: 1px solid CanvasText; } }

/* First-run card */
.welcome { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; border-color: var(--accent); }
.welcome h2 { margin: 4px 0 6px; }
.welcome p { max-width: 62ch; margin: 0; color: var(--ink-muted); }
.welcome-act { display: flex; gap: 8px; flex-wrap: wrap; }
.proof-empty { max-width: 66ch; margin: 0 0 18px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; }

/* Callout: a short note inside a page. Use role="status" only when it appears after an action. */
.callout { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s-3); padding: 14px var(--s-4); border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.callout > i { font-style: normal; font-weight: 600; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: var(--t-xs); border: 1.5px solid currentColor; }
.callout p { max-width: 62ch; }
.callout strong { font-weight: 600; }
.callout.info { background: var(--accent-soft); border-color: var(--accent); }
.callout.info > i { color: var(--accent); }
.callout.calm { background: var(--calm-soft); border-color: var(--calm); }
.callout.calm > i { color: var(--calm); }
.callout.caution { background: var(--caution-soft); border-color: var(--caution); }
.callout.caution > i { color: var(--caution); }

/* Field: label above, hint and error below. The error is text, never colour alone. */
.field { display: grid; gap: var(--s-2); max-width: 420px; }
.field .hint { color: var(--ink-muted); font-size: var(--t-sm); }
.field .err { color: var(--caution); font-size: var(--t-sm); font-weight: 500; }
.field .input, .field textarea, .field select { width: 100%; min-height: var(--target); }
.field textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); padding: 9px 16px; border-radius: var(--r-sm); }
.field .input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border: 2px solid var(--caution); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .tag { transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
}

/* hireframe wordmark: colours come from tokens, so it follows the theme */
:root { --gold: #D6AA58; --wm-ai: #477A91; --wm-disc: #477A91; }
:root[data-theme="dark"] { --wm-ai: #D6AA58; --wm-disc: #A9CDD4; }
.wm { display: inline-block; height: 30px; width: auto; vertical-align: middle; }
.wm .i { fill: var(--ink); } .wm .a { fill: var(--wm-ai); } .wm .o { fill: var(--gold); }
/* Hireframe mark: corner brackets and a gold core in a deep steel ring (light); no ring on dark */
.wm .f { fill: none; stroke: #2E5C72; stroke-width: 7.5; stroke-linecap: round; stroke-linejoin: round; } .wm .r { fill: #2E5C72; }
:root[data-theme="dark"] .wm .f { stroke: var(--wm-disc); } :root[data-theme="dark"] .wm .r { fill: none; } :root[data-theme="dark"] .wm .o { r: 11.5px; }
.brand .wm { height: 32px; }
