/* Lathe. Spruce ink, brass for what the agent does, slate for what stays with people. */
:root {
  --ink: #0e2a2b;
  --ink-2: #173a3b;
  --ink-3: #24504f;
  --text: #17211f;
  --muted: #5b6865;
  --faint: #8a9592;
  --paper: #ffffff;
  --mist: #f5f6f4;
  --line: #dfe3de;
  --line-2: #c9cfc9;
  --brass: #9a6410;
  --brass-fill: #c08a2b;
  --brass-lit: #e6b862;
  --brass-wash: #faf3e3;
  --gain: #1b6e4d;
  --gain-wash: #e9f4ee;
  --warn: #a13d18;
  --warn-wash: #fbeee8;
  --person: #6a7774;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Public Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --r-s: 5px;
  --r-m: 8px;
  --r-l: 12px;
  --shadow: 0 1px 2px rgba(14, 42, 43, .06), 0 12px 32px -12px rgba(14, 42, 43, .22);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--paper); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.6vw, 52px); letter-spacing: -.02em; line-height: 1.06; }
h2 { font-size: clamp(23px, 2.6vw, 30px); }
h3 { font-size: 19px; line-height: 1.25; }
h4 { font-size: 13px; font-weight: 600; color: var(--muted); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brass-fill); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: var(--r-s); background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; transition: background .12s; white-space: nowrap; }
.btn:hover { background: var(--ink-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.quiet:hover { background: var(--mist); }
.btn.lit { background: var(--brass-lit); border-color: var(--brass-lit); color: var(--ink); }
.btn.lit:hover { background: #efc87e; }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.small { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn.danger { background: transparent; border-color: transparent; color: var(--warn); padding-inline: 8px; }
.btn.danger:hover { background: var(--warn-wash); }
.linkish { background: none; border: 0; padding: 0; color: var(--brass); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: #fff; }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:hover { border-color: var(--faint); }
.input:focus { outline: 2px solid var(--brass-fill); outline-offset: 0; border-color: var(--brass-fill); }
.input.bad { border-color: var(--warn); }
.error { color: var(--warn); font-size: 13px; }
.affix { display: flex; align-items: stretch; }
.affix > span { display: grid; place-items: center; padding: 0 10px; white-space: nowrap; border: 1px solid var(--line-2); background: var(--mist); color: var(--muted); font-size: 13px; }
.affix > span:first-child { border-right: 0; border-radius: var(--r-s) 0 0 var(--r-s); }
.affix > span:last-child { border-left: 0; border-radius: 0 var(--r-s) var(--r-s) 0; }
.affix > span:first-child + .input { border-radius: 0 var(--r-s) var(--r-s) 0; }
.affix > .input:first-child { border-radius: var(--r-s) 0 0 var(--r-s); }
.affix > span + .input:not(:last-child) { border-radius: 0; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 14px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 26px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick span { display: block; padding: 6px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; background: #fff; }
.pick small { color: var(--muted); }
.pick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick input:checked + span small { color: #b9cbc8; }
.pick input:focus-visible + span { outline: 2px solid var(--brass-fill); outline-offset: 2px; }
.choices { display: grid; gap: 6px; }
.choice { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-s); cursor: pointer; font-size: 14px; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--mist); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { margin: 3px 0 0; accent-color: var(--ink); }

/* ---------- tags ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--mist); color: var(--muted); white-space: nowrap; }
.tag.agent, .tag.connect { background: var(--brass-wash); color: var(--brass); }
.tag.good, .tag.keep, .tag.reviewed, .tag.live { background: var(--gain-wash); color: var(--gain); }
.tag.warn, .tag.replace, .tag.consolidate { background: var(--warn-wash); color: var(--warn); }
.tag.ink { background: var(--ink); color: #fff; }

/* ---------- public site ---------- */
.topbar { background: var(--ink); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 22px; font-weight: 500; text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 22px; height: 22px; }
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a:not(.btn) { padding: 8px 10px; font-size: 14px; text-decoration: none; color: #d5e0de; }
.topbar nav a:not(.btn):hover { color: #fff; }
.hero { background: var(--ink); color: #fff; padding: 46px 0 150px; }
.hero h1 { max-width: 21ch; }
.hero p.lede { max-width: 56ch; margin-top: 16px; font-size: 17px; color: #c9d6d4; }
.hero .row { margin-top: 24px; }
.hero-proof { margin-top: -112px; position: relative; }
.proof { background: #fff; border-radius: var(--r-l); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.proof-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--mist); font-size: 13px; color: var(--muted); }
.proof .wf { border: 0; border-radius: 0; }
.band { padding: 56px 0; }
.band.mist { background: var(--mist); border-block: 1px solid var(--line); }
.band > .wrap > h2 { max-width: 34ch; }
.band > .wrap > p.lede { max-width: 62ch; margin-top: 10px; color: var(--muted); font-size: 16px; }
.covers { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid var(--line); }
.covers li { padding: 16px 20px 18px 0; border-bottom: 1px solid var(--line); }
.covers h3 { font-size: 18px; }
.covers p { margin-top: 5px; color: var(--muted); font-size: 14px; }
.steps { margin-top: 26px; display: grid; gap: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(step); font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--brass); grid-row: span 2; }
.steps h3 { font-size: 18px; }
.steps p { color: var(--muted); font-size: 14.5px; max-width: 68ch; }
.pledges { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.pledges li { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); }
.pledges h3 { font-size: 17px; }
.pledges p { margin-top: 5px; color: var(--muted); font-size: 14px; }
.closing { background: var(--ink); color: #fff; padding: 52px 0; }
.closing h2 { max-width: 34ch; }
.closing p { margin-top: 8px; color: #c9d6d4; max-width: 56ch; }
.closing .row { margin-top: 20px; }
.foot { padding: 20px 0 28px; font-size: 13px; color: var(--muted); }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: var(--ink); color: #fff; padding: 28px 40px 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-side h2 { font-size: clamp(24px, 2.6vw, 34px); max-width: 16ch; }
.auth-side ul { margin-top: 18px; display: grid; gap: 10px; color: #c9d6d4; font-size: 14.5px; max-width: 42ch; }
.auth-side li { padding-left: 18px; position: relative; }
.auth-side li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; background: var(--brass-lit); border-radius: 1px; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 30px; }
.auth-card form { margin-top: 20px; }
.auth-card .btn { width: 100%; }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.rail { background: var(--ink); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.rail .brand { padding: 0 8px; }
.rail nav { display: grid; gap: 2px; }
.rail nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-s); text-decoration: none; color: #c5d3d1; font-size: 14px; font-weight: 500; }
.rail nav a svg { width: 17px; height: 17px; flex: none; }
.rail nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail nav a[aria-current='page'] { background: var(--ink-3); color: #fff; }
.rail nav a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--brass-lit); }
.rail .who { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; color: #b9cbc8; display: grid; gap: 2px; }
.rail .who strong { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .who button { justify-self: start; margin-top: 6px; background: none; border: 0; padding: 0; color: #b9cbc8; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.main { padding: 28px 32px 72px; min-width: 0; }
.page { width: min(940px, 100%); margin-inline: auto; }
.page.wide { width: min(1180px, 100%); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 64ch; }
.panel { border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.panel > header { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel > header h3 { font-size: 17px; }
.panel > .body { padding: 16px; }
.note { padding: 12px 14px; border-radius: var(--r-m); background: var(--mist); font-size: 14px; }
.note.brass { background: var(--brass-wash); }
.note.warn { background: var(--warn-wash); color: #6d2a11; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 14px; border-radius: var(--r-s); font-size: 14px; z-index: 50; box-shadow: var(--shadow); }

/* progress track: brief, blueprint, scope, build, live */
.track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; counter-reset: t; }
.track li { counter-increment: t; padding: 11px 14px 12px; border-right: 1px solid var(--line); font-size: 13px; color: var(--muted); background: #fff; }
.track li:last-child { border-right: 0; }
.track li strong { display: block; font-size: 14px; color: var(--faint); font-weight: 600; }
.track li strong::before { content: counter(t) '  '; font-family: var(--serif); font-size: 16px; }
.track li.done strong { color: var(--gain); }
.track li.now { background: var(--ink); color: #c9d6d4; }
.track li.now strong { color: #fff; }

/* ---------- brief editor ---------- */
.brief { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 28px; align-items: start; }
.brief-nav { position: sticky; top: 20px; display: grid; gap: 1px; counter-reset: s; }
.brief-nav button { counter-increment: s; display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; background: none; border: 0; border-radius: var(--r-s); cursor: pointer; font-size: 14px; color: var(--muted); }
.brief-nav button::before { content: counter(s); width: 20px; height: 20px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; font-size: 11.5px; font-weight: 600; }
.brief-nav button.done::before { content: ''; border-color: var(--gain); background: var(--gain) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.brief-nav button:hover { background: var(--mist); }
.brief-nav button[aria-current='step'] { background: var(--mist); color: var(--text); font-weight: 600; }
.brief-nav .saved { margin-top: 12px; padding: 0 10px; font-size: 12.5px; color: var(--faint); min-height: 18px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 26px; }
.section-head p { margin-top: 5px; color: var(--muted); max-width: 66ch; }
.card { border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.card > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.card > summary::-webkit-details-marker { display: none; }
.card > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .12s; flex: none; }
.card[open] > summary::before { transform: rotate(45deg); }
.card > summary strong { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.card > summary .meta { margin-left: auto; font-size: 13px; color: var(--muted); }
.card > .body { padding: 4px 14px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.add { width: 100%; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-m); background: none; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.add:hover { background: var(--mist); border-style: solid; }
.tool-table { display: grid; gap: 8px; }
.tool-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) 80px minmax(0, 1fr) 34px; gap: 8px; align-items: end; }
.tool-row.head { font-size: 12.5px; font-weight: 600; color: var(--muted); align-items: start; }
.tool-row .lbl { display: none; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.icon-btn { width: 34px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--r-s); color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--warn-wash); color: var(--warn); }
.icon-btn svg { width: 16px; height: 16px; }
.brief-foot { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.todo li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.review-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-list .mark { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.review-list .done .mark { border-color: var(--gain); background: var(--gain); }

/* ---------- blueprint ---------- */
.bp { display: grid; gap: 40px; }
.bp-head h1 { font-size: clamp(28px, 3.4vw, 40px); }
.bp-head .row { margin-top: 10px; color: var(--muted); font-size: 14px; }
.bp section > h2 { margin-bottom: 4px; }
.bp section > p.sub { color: var(--muted); max-width: 68ch; margin-bottom: 16px; }
.prose p { max-width: 70ch; font-size: 16px; line-height: 1.6; }
.prose p + p { margin-top: 10px; }
.from-studio { border-left: 3px solid var(--brass-fill); padding: 4px 0 4px 16px; }
.from-studio h4 { margin-bottom: 4px; }
.from-studio p { white-space: pre-wrap; max-width: 70ch; }
.ledger { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.ledger > div { padding: 16px 18px 6px; }
.ledger > div + div { border-left: 1px solid var(--line); background: var(--mist); }
.ledger h3 { font-size: 18px; margin-bottom: 6px; }
.ledger dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; }
.ledger dt { font-size: 14px; }
.ledger dt small { display: block; color: var(--muted); font-size: 12.5px; }
.ledger dd { font-weight: 600; text-align: right; white-space: nowrap; }
.ledger .total dt { font-weight: 600; }
.ledger .total dd { font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--gain); line-height: 1.1; }
.ledger .aside dd, .ledger .aside dt { color: var(--muted); font-weight: 400; }
.noticed li { padding: 9px 0 9px 18px; border-top: 1px solid var(--line); position: relative; max-width: 76ch; }
.noticed li::before { content: ''; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; background: var(--brass-fill); border-radius: 1px; }
.ready { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: center; }
.ready .score { font-family: var(--serif); font-size: 64px; line-height: 1; }
.ready .score small { display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 4px; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) 120px 34px; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.meter small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

.wfs { display: grid; gap: 14px; }
.wf { border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; break-inside: avoid; }
.wf-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 0; }
.wf-top h3 { font-size: 21px; }
.wf-top p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.wf-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; padding: 14px 18px 16px; }
.wf-cols h4 { margin-bottom: 6px; }
.wf-cols .today p { font-size: 14.5px; }
.wf-cols .today p + p { margin-top: 8px; }
.wf-cols .today .hurts { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chips span { padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 12.5px; color: var(--muted); }
.who-list { display: grid; gap: 7px; }
.who-list li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; font-size: 14.5px; align-items: baseline; }
.who-list .who { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--person); }
.who-list .who::before { content: ''; width: 9px; height: 9px; border: 1.5px solid var(--person); border-radius: 50%; flex: none; }
.who-list .agent .who { color: var(--brass); }
.who-list .agent .who::before { border-color: var(--brass-fill); background: var(--brass-fill); border-radius: 2px; }
.split { padding: 0 18px; }
.split-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e3e7e3; }
.split-bar i { display: block; background: var(--brass-fill); width: 0; transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.split-key { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.split-key b { color: var(--brass); font-weight: 600; }
.wf-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--line); }
.wf-figs div { padding: 11px 18px 13px; border-right: 1px solid var(--line); }
.wf-figs div:last-child { border-right: 0; }
.wf-figs dt { font-size: 12.5px; color: var(--muted); }
.wf-figs dd { font-weight: 600; font-size: 15px; }
.wf-figs .gain dd { color: var(--gain); }
.wf-why { padding: 10px 18px 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); background: var(--mist); border-radius: 0 0 var(--r-m) var(--r-m); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table td strong { font-weight: 600; }
.table td:first-child { min-width: 150px; }
.table td small { display: block; color: var(--muted); font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: p; }
.phase { counter-increment: p; border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; background: #fff; }
.phase h3::before { content: counter(p) '  '; color: var(--brass); }
.phase .window { font-size: 13px; color: var(--muted); font-weight: 600; }
.phase > p { font-size: 13.5px; color: var(--muted); margin: 6px 0 10px; }
.phase li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.phase li small { display: block; color: var(--muted); font-size: 12.5px; }
.plain-list li { padding: 9px 0; border-top: 1px solid var(--line); max-width: 78ch; }
.plain-list li:first-child { border-top: 0; padding-top: 0; }
.plain-list li strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 500; }
.plain-list li p { color: var(--muted); font-size: 14px; margin-top: 2px; }
details.fold > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
details.fold ul { margin-top: 10px; }
.next { background: var(--ink); color: #fff; border-radius: var(--r-l); padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.next p { color: #c9d6d4; margin-top: 4px; max-width: 54ch; }
.quote { border: 1px solid var(--brass-fill); border-radius: var(--r-m); padding: 16px 18px; background: var(--brass-wash); }
.quote dl { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 8px; }
.quote dt { font-size: 12.5px; color: var(--muted); }
.quote dd { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.quote p { margin-top: 10px; white-space: pre-wrap; font-size: 14.5px; }

/* ---------- build + thread ---------- */
.checks { display: grid; gap: 0; }
.checks label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 14.5px; }
.checks input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); }
.checks small { display: block; color: var(--muted); font-size: 13px; }
.checks h4 { padding: 14px 0 6px; }
.thread { display: grid; gap: 10px; }
.msg { padding: 10px 13px; border-radius: var(--r-m); background: var(--mist); max-width: 62ch; }
.msg.mine { background: var(--ink); color: #fff; justify-self: end; }
.msg header { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.msg.mine header { color: #b9cbc8; }
.msg p { white-space: pre-wrap; font-size: 14.5px; overflow-wrap: anywhere; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 12px; }
.compose textarea { min-height: 44px; }

/* ---------- studio ---------- */
.studio-top { background: var(--ink); color: #fff; }
.studio-top .wrap { display: flex; align-items: center; gap: 18px; height: 52px; width: min(1240px, 100% - 40px); }
.studio-top nav { display: flex; gap: 2px; margin-left: 10px; }
.studio-top nav a { padding: 6px 11px; border-radius: var(--r-s); font-size: 14px; text-decoration: none; color: #c5d3d1; }
.studio-top nav a[aria-current='page'] { background: var(--ink-3); color: #fff; }
.studio-top .end { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: 13px; color: #b9cbc8; }
.studio-main { width: min(1240px, 100% - 40px); margin: 24px auto 80px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { padding: 9px 14px; background: none; border: 0; border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--ink); }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: var(--mist); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.edit-wf { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.sticky-save { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 20px; z-index: 5; }

/* single-column grids must not grow to fit wide children (tables, long words) */
.bp, .stack, .wfs, .field, .tool-table, .thread, .choices, .checks, .who-list, .steps, .brief-nav { grid-template-columns: minmax(0, 1fr); }
.who-list li { grid-template-columns: 58px minmax(0, 1fr); }
.steps li { grid-template-columns: 44px minmax(0, 1fr); }

/* ---------- small screens ---------- */
.speakable { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: start; }
.speakable textarea { width: 100%; }
.back-to-talk { margin-bottom: 18px; padding: 10px 14px; border-radius: var(--r-m); background: var(--mist); font-size: 14px; }
code.link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 5px 8px; border-radius: var(--r-s); background: var(--mist); overflow-wrap: anywhere; user-select: all; }
/* The brief, recorded */
.rec { max-width: 680px; }
.rec-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.rec-stage .page-head { margin-bottom: 0; }
.rec-list h2 { font-size: 19px; margin-bottom: 8px; }
.rec-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rec-list li { position: relative; padding-left: 22px; }
.rec-list li::before { content: ''; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.rec-list.need { padding: 16px 18px; border-radius: var(--r-m); background: var(--brass-wash); }
.rec-list.need li { font-weight: 500; }
.rec-list.need li::before { background: var(--brass-fill); }
.rec-list.need p { margin-top: 10px; }
.rec-list.have li { color: var(--muted); }
.rec-list.have li::before { top: .3em; left: 0; width: 14px; height: 14px; background: var(--gain) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.rec-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-l); }
.rec-box strong { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); }
.rec-box p { color: var(--muted); font-size: 14px; }
.rec-box.live { border-color: var(--warn); }
.rec-box.busy { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rec-btn { width: 76px; height: 76px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.rec-btn:hover { background: var(--ink-3); }
.rec-btn svg { width: 30px; height: 30px; }
.rec-btn.on { background: var(--warn); animation: rec-pulse 1.6s ease-out infinite; }
.rec-btn.on i { width: 24px; height: 24px; border-radius: 5px; background: #fff; }
@keyframes rec-pulse { from { box-shadow: 0 0 0 0 rgba(161, 61, 24, .45); } to { box-shadow: 0 0 0 16px rgba(161, 61, 24, 0); } }
.rec-time { font-variant-numeric: tabular-nums; }
.rec-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rec-steps li { position: relative; padding-left: 26px; color: var(--faint); }
.rec-steps li::before { content: ''; position: absolute; left: 2px; top: .22em; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); box-sizing: border-box; }
.rec-steps li.now { color: var(--text); font-weight: 600; }
.rec-steps li.now::before { border-color: var(--brass-fill); border-top-color: transparent; animation: rec-spin .8s linear infinite; }
.rec-steps li.done { color: var(--muted); }
.rec-steps li.done::before { border-color: var(--gain); background: var(--gain); }
@keyframes rec-spin { to { transform: rotate(360deg); } }
.rec-type { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.rec-type .row { justify-content: flex-end; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.rec-said { padding: 12px 0; border-top: 1px solid var(--line); }
.rec-said p { white-space: pre-wrap; overflow-wrap: anywhere; }
.rec-thanks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 28px; border-radius: var(--r-l); background: var(--ink); color: #fff; }
.rec-thanks h1 { color: #fff; font-size: clamp(30px, 4vw, 40px); }
.rec-thanks p { color: #d5e0de; max-width: 52ch; }
.rec-thanks .btn.quiet { color: #fff; border-color: rgba(255, 255, 255, .28); }
.rec-thanks .btn.quiet:hover { background: rgba(255, 255, 255, .08); }
.noted { list-style: none; margin: 7px 2px 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--gain); }
.noted li { padding-left: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.3 4.7-5' fill='none' stroke='%231b6e4d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 2px 3px / 12px no-repeat; }
.mic svg { width: 17px; height: 17px; }
.mic span { font-variant-numeric: tabular-nums; }
.mic.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 18px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; background: var(--ink); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; min-height: 52px; font-size: 11.5px; color: #b9cbc8; text-decoration: none; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a[aria-current='page'] { color: #fff; box-shadow: inset 0 2px 0 var(--brass-lit); }
  .mobile-head { display: flex !important; }
  .brief { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rec-box { padding: 16px; gap: 14px; }
  .brief-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 6px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .brief-nav button { flex: none; width: auto; border: 1px solid var(--line); min-height: 40px; }
  .brief-nav .saved { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 20px; gap: 18px; }
  .auth-side ul { display: none; }
  .auth-main { place-items: start center; }
  .wf-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .phases { grid-template-columns: minmax(0, 1fr); }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .ledger > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .tool-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); }
  .tool-row.head { display: none; }
  .tool-row .lbl { display: block; }
  .tool-row > :first-child { grid-column: 1 / -1; }
  .tool-row .icon-btn { grid-column: 1 / -1; justify-self: end; width: 44px; height: 44px; margin: -6px -6px -8px 0; }
  .btn, .input, select.input { min-height: 44px; }
  .track { grid-template-columns: minmax(0, 1fr); }
  .track li { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
  .track li:last-child { border-bottom: 0; }
  .ready { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .edit-wf, .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { margin-top: 8px; }
}
@media (max-width: 620px) {
  .cols, .cols.three { grid-template-columns: minmax(0, 1fr); }
  .wf-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-figs div:nth-child(2) { border-right: 0; }
  .wf-figs div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .hero { padding: 30px 0 130px; }
  .band { padding: 40px 0; }
  .topbar nav a.hide-s { display: none; }
  .meter { grid-template-columns: minmax(0, 1fr) 70px 34px; }
  .next { padding: 20px; }
  .compose { grid-template-columns: minmax(0, 1fr); }
  .wrap, .narrow { width: calc(100% - 32px); }
  .studio-top nav a { padding: 6px 8px; }
}
.mobile-head { display: none; justify-content: space-between; align-items: center; margin: -18px -16px 16px; padding: 10px 16px; background: var(--ink); color: #fff; }
.mobile-head button { background: none; border: 0; color: #b9cbc8; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .rail, .tabbar, .mobile-head, .no-print, .topbar, .foot, .toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { font-size: 12px; }
  .bp { gap: 22px; }
  .next { background: none; color: var(--text); border: 1px solid var(--line); }
  .split-bar, .split-bar i, .bar > i, .ledger > div + div, .wf-why, .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  details.fold > ul { display: block; }
}
