/* Self-hosted fonts (SIL Open Font Licence): nothing loads from Google. */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/instrument-sans.e35fad09c70b.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/plex-mono-400.814fe1615d4d.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/plex-mono-500.6708425c446b.woff2") format("woff2"); }
/* Everything below this line up to "Portal additions" is the locked mock-up's stylesheet (D31). */
:root {
  --ground: #F2F4F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #131A26;
  --ink-2: #394356;
  --muted: #687184;
  --line: #E1E5EC;
  --line-strong: #CAD1DC;
  --accent: #2E4A9E;
  --accent-hover: #243C85;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAEFFB;
  --accent-line: #C8D3F1;
  --hero: #17265C;
  --hero-2: #213478;
  --hero-ink: #F5F7FF;
  --hero-muted: #B2BDE0;
  --hero-line: rgba(255,255,255,.16);
  --seg-ns: rgba(255,255,255,.34);
  --seg-wait: #F2B658;
  --seg-done: #5CC690;
  --ok: #16794B;
  --ok-soft: #E2F3E9;
  --warn: #9A5B00;
  --warn-soft: #FFF0D2;
  --bad: #B42318;
  --bad-soft: #FDEBE9;
  --ai-mark: #C8D3F1;
  --shadow: 0 1px 2px rgba(19,26,38,.05), 0 8px 24px rgba(19,26,38,.06);
  --shadow-hover: 0 2px 4px rgba(19,26,38,.07), 0 12px 32px rgba(19,26,38,.10);
  --radius: 12px;
  --font-ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0D121A; --surface: #141B26; --surface-2: #19212E;
    --ink: #E8ECF2; --ink-2: #C4CBD7; --muted: #8F99AB;
    --line: #253042; --line-strong: #324056;
    --accent: #93AAF3; --accent-hover: #AFC0F7; --accent-ink: #0D121A;
    --accent-soft: #1B2644; --accent-line: #33457A;
    --hero: #17224B; --hero-2: #1F2D5E; --hero-ink: #F0F3FF; --hero-muted: #A7B3D9; --hero-line: rgba(255,255,255,.12);
    --ok: #5CC690; --ok-soft: #12301F; --warn: #F2B658; --warn-soft: #33260E;
    --bad: #F2877C; --bad-soft: #3A1715; --ai-mark: #33457A;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0D121A; --surface: #141B26; --surface-2: #19212E;
  --ink: #E8ECF2; --ink-2: #C4CBD7; --muted: #8F99AB;
  --line: #253042; --line-strong: #324056;
  --accent: #93AAF3; --accent-hover: #AFC0F7; --accent-ink: #0D121A;
  --accent-soft: #1B2644; --accent-line: #33457A;
  --hero: #17224B; --hero-2: #1F2D5E; --hero-ink: #F0F3FF; --hero-muted: #A7B3D9; --hero-line: rgba(255,255,255,.12);
  --ok: #5CC690; --ok-soft: #12301F; --warn: #F2B658; --warn-soft: #33260E;
  --bad: #F2877C; --bad-soft: #3A1715; --ai-mark: #33457A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; left: -9999px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
svg.i { width: 14px; height: 14px; flex: none; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--hero); display: grid; place-items: center; }
.brand .mark svg { width: 18px; height: 18px; color: #fff; transform: rotate(12deg); }
.brand small { display: block; font-weight: 500; letter-spacing: .01em; text-transform: none; color: var(--muted); font-size: 12px; line-height: 1.2; }
.nav { display: flex; gap: 4px; }
.nav a, .nav span { padding: 6px 11px; border-radius: 8px; color: var(--ink-2); font-weight: 550; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav span { color: var(--muted); cursor: not-allowed; }
.search { position: relative; flex: 1; max-width: 480px; margin-left: auto; }
.search input { width: 100%; padding: 9px 38px 9px 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; background: var(--surface); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 6px; max-height: 70vh; overflow: auto; }
.results .label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 6px 10px 4px; font-weight: 600; }
.result { display: grid; grid-template-columns: auto 1fr auto; gap: 0 12px; align-items: center; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.result.sel, .result:hover { background: var(--accent-soft); }
.result .r-name { font-weight: 600; }
.result .r-name mark { background: transparent; color: var(--accent); }
.result .r-meta { color: var(--muted); font-size: 12.5px; }
.result .r-count { font-size: 12.5px; color: var(--ink-2); }
.results .empty { padding: 12px; color: var(--muted); }
.user { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10.5px; }

.mockbar { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mockbar-inner { max-width: 1280px; margin: 0 auto; padding: 7px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12.5px; color: var(--muted); }
.mockbar strong { color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 3px 11px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.mockbar .spacer { flex: 1; }

/* ---------- Layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }
.instructions { padding: 12px 16px; display: grid; gap: 8px; }
.instructions .instr { margin: 0; white-space: normal; }
.dlist { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.instructions .replies { font-size: 13px; display: grid; gap: 4px; }
.instructions .replies .wl { font-weight: 650; color: var(--ink-2); }
.instr-edit { display: grid; gap: 8px; }
.flow { padding: 10px 12px; }
.flow ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.fs a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; height: 100%; }
.fs a:hover { border-color: var(--line-strong); }
.fs .fn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--muted); flex: none; }
.fs .fn svg.i { width: 13px; height: 13px; }
.fs .ft { display: grid; gap: 1px; min-width: 0; }
.fs .ft b { font-size: 13.5px; font-weight: 650; line-height: 1.25; }
.fs .ft span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.fs.done .fn { background: var(--ok-soft); color: var(--ok); }
.fs.now a { border-color: var(--accent); background: var(--accent-soft); }
.fs.now .fn { background: var(--accent); color: var(--accent-ink, #fff); }
.fs.now .ft span { color: var(--accent); font-weight: 600; }
.fs.next .ft b { color: var(--ink-2); }
.stephead .jn form.inline { display: inline; }
@media (max-width: 900px) { .flow ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.instr-edit textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); font: inherit; resize: vertical; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.005em; }
.section-head .hint { color: var(--muted); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); line-height: 1.5; }
.pill svg.i { width: 12px; height: 12px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.plain { background: transparent; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 16px; color: var(--hero-ink); background: linear-gradient(135deg, var(--hero) 0%, var(--hero-2) 100%); padding: 26px 28px 24px; display: grid; gap: 22px; }
.hero .bgstar { position: absolute; right: -60px; top: -70px; width: 340px; height: 340px; color: #fff; opacity: .06; transform: rotate(18deg); pointer-events: none; }
.hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 24px; position: relative; }
.hero h1 { font-size: 28px; font-weight: 650; letter-spacing: -.015em; }
.hero .sub { color: var(--hero-muted); margin-top: 2px; }
.hero .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.btn.onhero { background: rgba(255,255,255,.1); border-color: var(--hero-line); color: var(--hero-ink); }
.btn.onhero:hover { background: rgba(255,255,255,.18); }
.hero .syncing { display: inline-flex; align-items: center; gap: 8px; color: var(--hero-ink); font-weight: 600; background: rgba(255,255,255,.1); border: 1px solid var(--hero-line); border-radius: 9px; padding: 7px 13px; }
.bignums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.bignum { padding: 2px 20px; border-left: 1px solid var(--hero-line); display: grid; gap: 2px; }
.bignum:first-child { border-left: 0; padding-left: 0; }
a.bignum { color: inherit; text-decoration: none; }
a.bignum:hover .k, a.bignum:focus-visible .k { text-decoration: underline; }
.bignum .v { font-size: 36px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bignum .v small { font-size: 18px; font-weight: 600; margin-left: 2px; color: var(--hero-muted); }
.bignum .k { color: var(--hero-muted); font-size: 13px; }
.pipeline { position: relative; display: grid; gap: 9px; padding-top: 18px; border-top: 1px solid var(--hero-line); }
.pipeline .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.pipeline .title { font-weight: 600; }
.pipeline .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--hero-muted); font-size: 13px; }
.pipeline .legend b { color: var(--hero-ink); font-variant-numeric: tabular-nums; }
.pipeline .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.pbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.1); gap: 2px; }
.pbar span { display: block; height: 100%; }

/* ---------- Attention lanes ---------- */
/* Where every job is up to (D65): six stages, each a filter for the client table */
.stages { padding: 16px 18px 18px; display: grid; gap: 12px; }
.stages-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.stages-head h2 { font-size: 16px; font-weight: 650; }
.stages-head .hint { color: var(--muted); font-size: 13px; }
.stages ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stage { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: var(--surface); }
.stage:hover { border-color: var(--line-strong); }
.stage .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stage .k { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.stage.none .n { color: var(--muted); }
.stage[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.stage.s-no_data { border-left-color: var(--bad); }
.stage.s-to_send { border-left-color: var(--warn); }
.stage.s-waiting { border-left-color: var(--accent-line); }
.stage.s-team { border-left-color: var(--accent); }
.stage.s-lock { border-left-color: var(--seg-done); }
.stage.s-done { border-left-color: var(--ok); }
@media (max-width: 1100px) { .stages ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stages ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.lane { display: grid; gap: 10px; }
.lane-head { display: flex; align-items: center; gap: 9px; padding: 0 2px; }
.lane-head .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.lane-head .ico svg { width: 14px; height: 14px; }
.lane.fix .ico { background: var(--bad-soft); color: var(--bad); }
.lane.chase .ico { background: var(--warn-soft); color: var(--warn); }
.lane.review .ico { background: var(--accent-soft); color: var(--accent); }
.lane-head h3 { font-size: 14.5px; font-weight: 650; }
.lane-head .n { margin-left: auto; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; display: grid; gap: 7px; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.acard:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.acard .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acard .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard .detail { color: var(--ink-2); font-size: 13.5px; }
.acard .foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.acard .foot .go { margin-left: auto; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.lane-empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.lane-empty svg { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .acard, .acard:hover { transition: none; transform: none; } }

/* ---------- Client table ---------- */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 5px 13px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19,26,38,.1); }
.tabs .c { color: var(--muted); font-weight: 500; margin-left: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.stagechip { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.stagechip .x { margin-left: 6px; opacity: .8; }
.chip .c { opacity: .7; margin-left: 3px; font-variant-numeric: tabular-nums; }
.filter { margin-left: auto; position: relative; }
.filter input { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); width: 220px; max-width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
th button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
th button:hover { color: var(--ink); }
td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.cell-client { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tile { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; flex: none; }
.tile.lg { width: 56px; height: 56px; border-radius: 15px; font-size: 19px; }
.c-name { font-weight: 650; }
.c-sub { color: var(--muted); font-size: 12.5px; }
.who { display: inline-flex; align-items: center; gap: 7px; }
.progress { display: grid; gap: 5px; min-width: 130px; }
.progress .t { font-size: 13px; color: var(--ink-2); }
.progress .t b { color: var(--ink); font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.track .fill { height: 100%; background: var(--ok); border-radius: 3px; }
.synccell { display: grid; gap: 4px; justify-items: start; }

/* ---------- Client page ---------- */
.crumbs { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.chead { overflow: hidden; }
.chead-main { padding: 22px 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 20px; align-items: center; }
.chead h1 { font-size: 27px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.chead .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.facts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.fact { display: grid; gap: 1px; }
.fact .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.fact .v { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.ring { display: grid; justify-items: center; gap: 4px; }
.ring svg { width: 84px; height: 84px; }
.ring .rt { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.3; }
.syncbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 13px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }
.syncbar .when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.syncbar .when strong { font-weight: 650; }
.syncbar .actions { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.accent { background: var(--accent); }
.steps { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; color: var(--muted); }
.step { display: inline-flex; align-items: center; gap: 7px; }
.step.done { color: var(--ok); font-weight: 550; }
.step.now { color: var(--accent); font-weight: 650; }
.spin { width: 13px; height: 13px; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.hero .spin { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.inline-edit { display: inline-flex; gap: 6px; align-items: center; }
.inline-edit input, .inline-edit select { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
.inline-edit input { width: 130px; }

.notice { display: flex; align-items: flex-start; gap: 11px; padding: 12px 16px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ink); }
.notice > svg { color: var(--ok); margin-top: 3px; width: 16px; height: 16px; flex: none; }
.notice.bad { background: var(--bad-soft); } .notice.bad > svg { color: var(--bad); }
.notice.warn { background: var(--warn-soft); } .notice.warn > svg { color: var(--warn); }
.notice .x { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 24px; align-items: start; }
.aside { display: grid; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); }
.itemtools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.group { overflow: hidden; }
.group-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.group-head h2 { font-size: 15px; font-weight: 650; }
.group-head .hint { color: var(--muted); font-size: 13px; }
.group-head .n { margin-left: auto; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 14px; padding: 16px 18px; border-top: 1px solid var(--line); align-items: start; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; margin-top: 1px; transition: border-color .12s, background .12s, color .12s; }
.tick svg.i { width: 14px; height: 14px; }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.tick.received { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick.not_needed { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.tick.ghost { border-style: dashed; cursor: default; }
.item .body { display: grid; gap: 3px; min-width: 0; }
.item .title { font-weight: 650; font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; line-height: 1.35; }
.item .sub { color: var(--ink-2); }
.item .why { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.item .why .wl { font-weight: 650; color: var(--ink-2); margin-right: 6px; }
.item .why strong { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.item.s-received .title, .item.s-not_needed .title { color: var(--muted); font-weight: 600; }
.item.s-received .sub, .item.s-not_needed .sub { color: var(--muted); }
.item .by { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item.s-received .by { color: var(--ok); }
.item.dropped { opacity: .62; }
.item.dropped .title span.t { text-decoration: line-through; text-decoration-color: var(--muted); }
.more { position: relative; }
.morebtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.morebtn:hover, .morebtn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-hover); padding: 4px; min-width: 200px; z-index: 5; display: grid; }
.menu button { text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; font-weight: 550; }
.menu button:hover { background: var(--surface-2); }
.reasons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); margin-top: 3px; }
.reasons .q { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.reasons input { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); min-width: 0; flex: 1 1 180px; }
.missed-add { display: flex; margin: 14px 20px 0; }
.missed-add input { flex: 1; width: auto; min-width: 0; }
.missed-add .attach { position: relative; }
.missed-add .attach:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.missed-hint { margin: 6px 20px 0; color: var(--muted); font-size: 12.5px; }
.missed-hint .has-files { color: var(--ink-2); font-weight: 600; }
.filechips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.filechip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 550; text-decoration: none; overflow-wrap: anywhere; }
.filechip:hover { border-color: var(--line-strong); color: var(--ink); }
.filechip svg.i { width: 13px; height: 13px; flex: none; }
.notes details.addressed { margin-top: 14px; border-top: 1px solid var(--line); }
.notes details.addressed > summary .okmark, .notes details.addressed .okmark { background: var(--ok-soft); color: var(--ok); }
.notes .reply { margin-top: 6px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.notes .reply .q { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.notes .item.s-query .okmark { background: var(--warn-soft); color: var(--warn); }
.notes .reply.query { background: var(--warn-soft); color: var(--ink); }
.notes .reply.query .q { color: var(--warn); }
.notes .warntext { color: var(--warn); font-weight: 600; }
.notes .note-answer { display: flex; margin-top: 8px; }
.notes .note-answer input { flex: 1; width: auto; min-width: 0; }
.notes .okmark { background: var(--surface-2); color: var(--ink-2); }
.group-empty { padding: 18px 20px; color: var(--muted); }

details.unclassified > summary { padding: 14px 20px; cursor: pointer; font-weight: 650; color: var(--ink-2); }
details.unclassified[open] > summary { border-bottom: 1px solid var(--line); }
.mini { width: 100%; border-collapse: collapse; min-width: 0; }
.mini td, .mini th { padding: 9px 20px; background: transparent; }
.mini tbody tr { cursor: default; }
.mini tbody tr:hover td { background: transparent; }

.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 650; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; display: grid; gap: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; position: relative; padding-bottom: 12px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .node { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); margin-top: 2px; display: grid; place-items: center; }
.timeline li.done .node { border-color: var(--ok); background: var(--ok); color: #fff; }
.timeline li.done .node svg { width: 10px; height: 10px; }
.timeline li.now .node { border-color: var(--accent); }
.timeline li.now .node::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.timeline .tl-t { font-weight: 600; }
.timeline .tl-s { color: var(--muted); font-size: 12.5px; }
.bigwait { display: flex; align-items: baseline; gap: 8px; }
.bigwait .v { font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.bigwait .k { color: var(--muted); }
.draft-meta { color: var(--muted); font-size: 12.5px; }
.stale { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-weight: 650; font-size: 13px; }
.stale .btn { margin-left: auto; }
.email { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 14px 16px; display: grid; gap: 11px; font-size: 13.5px; }
.email .subj { font-weight: 650; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.email .subj span { color: var(--muted); font-weight: 500; }
.email p { margin: 0; white-space: pre-wrap; }
.email .ai { border-left: 3px solid var(--ai-mark); padding-left: 10px; }
.email ol { margin: 0; padding-left: 22px; display: grid; gap: 5px; }
.email ol li small { display: block; color: var(--muted); font-size: 12.5px; }
.legend-ai { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.legend-ai i { width: 3px; height: 14px; background: var(--ai-mark); display: inline-block; border-radius: 2px; flex: none; }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-hover); z-index: 50; display: flex; gap: 8px; align-items: center; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .aside { position: static; }
  .lanes { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .mockbar-inner, main { padding-left: 16px; padding-right: 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav { display: none; }
  .user span.name { display: none; }
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 23px; }
  .bignums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .bignum:nth-child(3) { border-left: 0; padding-left: 0; }
  .bignum .v { font-size: 28px; }
  .chead-main { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .ring { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; align-items: center; gap: 12px; }
  .ring svg { width: 60px; height: 60px; }
  .facts { grid-column: 1 / -1; }
  .syncbar { padding: 12px 18px; }
  .syncbar .actions { margin-left: 0; }
  .filter { margin-left: 0; flex-basis: 100%; }
  .filter input { width: 100%; }
}

/* ---------- Portal additions ---------- */
.w0 { width: 0%; }
.w1 { width: 1%; }
.w2 { width: 2%; }
.w3 { width: 3%; }
.w4 { width: 4%; }
.w5 { width: 5%; }
.w6 { width: 6%; }
.w7 { width: 7%; }
.w8 { width: 8%; }
.w9 { width: 9%; }
.w10 { width: 10%; }
.w11 { width: 11%; }
.w12 { width: 12%; }
.w13 { width: 13%; }
.w14 { width: 14%; }
.w15 { width: 15%; }
.w16 { width: 16%; }
.w17 { width: 17%; }
.w18 { width: 18%; }
.w19 { width: 19%; }
.w20 { width: 20%; }
.w21 { width: 21%; }
.w22 { width: 22%; }
.w23 { width: 23%; }
.w24 { width: 24%; }
.w25 { width: 25%; }
.w26 { width: 26%; }
.w27 { width: 27%; }
.w28 { width: 28%; }
.w29 { width: 29%; }
.w30 { width: 30%; }
.w31 { width: 31%; }
.w32 { width: 32%; }
.w33 { width: 33%; }
.w34 { width: 34%; }
.w35 { width: 35%; }
.w36 { width: 36%; }
.w37 { width: 37%; }
.w38 { width: 38%; }
.w39 { width: 39%; }
.w40 { width: 40%; }
.w41 { width: 41%; }
.w42 { width: 42%; }
.w43 { width: 43%; }
.w44 { width: 44%; }
.w45 { width: 45%; }
.w46 { width: 46%; }
.w47 { width: 47%; }
.w48 { width: 48%; }
.w49 { width: 49%; }
.w50 { width: 50%; }
.w51 { width: 51%; }
.w52 { width: 52%; }
.w53 { width: 53%; }
.w54 { width: 54%; }
.w55 { width: 55%; }
.w56 { width: 56%; }
.w57 { width: 57%; }
.w58 { width: 58%; }
.w59 { width: 59%; }
.w60 { width: 60%; }
.w61 { width: 61%; }
.w62 { width: 62%; }
.w63 { width: 63%; }
.w64 { width: 64%; }
.w65 { width: 65%; }
.w66 { width: 66%; }
.w67 { width: 67%; }
.w68 { width: 68%; }
.w69 { width: 69%; }
.w70 { width: 70%; }
.w71 { width: 71%; }
.w72 { width: 72%; }
.w73 { width: 73%; }
.w74 { width: 74%; }
.w75 { width: 75%; }
.w76 { width: 76%; }
.w77 { width: 77%; }
.w78 { width: 78%; }
.w79 { width: 79%; }
.w80 { width: 80%; }
.w81 { width: 81%; }
.w82 { width: 82%; }
.w83 { width: 83%; }
.w84 { width: 84%; }
.w85 { width: 85%; }
.w86 { width: 86%; }
.w87 { width: 87%; }
.w88 { width: 88%; }
.w89 { width: 89%; }
.w90 { width: 90%; }
.w91 { width: 91%; }
.w92 { width: 92%; }
.w93 { width: 93%; }
.w94 { width: 94%; }
.w95 { width: 95%; }
.w96 { width: 96%; }
.w97 { width: 97%; }
.w98 { width: 98%; }
.w99 { width: 99%; }
.w100 { width: 100%; }
.pbar .ns { background: var(--seg-ns); } .pbar .wait { background: var(--seg-wait); } .pbar .done { background: var(--seg-done); }
.sw.ns { background: var(--seg-ns); } .sw.wait { background: var(--seg-wait); } .sw.done { background: var(--seg-done); }
.ring .bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring .fg { fill: none; stroke: var(--ok); stroke-width: 8; stroke-linecap: round; }
.ring .pct { fill: var(--ink); font-family: var(--font-ui); font-size: 17px; font-weight: 700; }
.grid-gap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cols-main { display: grid; gap: 16px; min-width: 0; }
.user form { display: inline; }
.user .linkbtn { color: var(--muted); font-weight: 550; }
.result { color: var(--ink); }
.result:hover { text-decoration: none; }
.results[hidden] { display: none; }
td a.rowlink { color: inherit; display: contents; }
tbody tr.clickable a { color: inherit; }
.acard { color: inherit; }
.acard:hover { text-decoration: none; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.menu form { display: grid; }
.menu button { width: 100%; }
form.inline { display: inline; }
.flash { max-width: 1280px; margin: 16px auto 0; padding: 0 24px; display: grid; gap: 10px; }
.htmx-request .spin-on-load { display: inline-block; }
.toast[hidden] { display: none; }
.email-source { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 18px; }
.auth-card .brand { justify-content: flex-start; }
.auth-card h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field input, .field select { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.field .help { color: var(--muted); font-size: 12.5px; }
.code-input { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.qr { display: grid; justify-items: center; gap: 8px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.qr img { width: 190px; height: 190px; image-rendering: pixelated; }
.secret { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); text-align: center; word-break: break-all; }
.errors { margin: 0; padding-left: 18px; color: var(--bad); }

/* Settings */
.settings { display: grid; gap: 20px; }
.settings .panel > .card-body { gap: 16px; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row-form .field { min-width: 180px; flex: 1; }
.mini select, .mini input { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); max-width: 100%; }
.linkbox { display: grid; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.linkbox code { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }
.table-controls { display: contents; }
.tabs a { border: 0; background: transparent; padding: 5px 13px; border-radius: 7px; font-weight: 600; color: var(--ink-2); }
.tabs a:hover { text-decoration: none; background: var(--surface); }
.tabs a[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19,26,38,.1); }
a.chip:hover { text-decoration: none; }
th a.thlink { color: inherit; }
th a.thlink:hover { color: var(--ink); text-decoration: none; }
.c-name a { color: inherit; }
#client { display: grid; gap: 24px; }
.itemtools a.chip.stagechip { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.stagechip .x { margin-left: 6px; opacity: .8; }
.chip .c { opacity: .7; margin-left: 3px; }
.menu a.menulink { padding: 8px 10px; border-radius: 7px; font-weight: 550; color: var(--ink); }
.menu a.menulink:hover { background: var(--surface-2); text-decoration: none; }
.item > form { display: contents; }
a.btn:hover { text-decoration: none; }

/* ---------- Checks, lanes and proof of work (D36) ---------- */
/* Roll-up: what Shuriken_AI did */
.did { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 28px; padding: 20px 24px; align-items: center; }
.did h2 { font-size: 17px; font-weight: 650; letter-spacing: -.005em; }
.didlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.didlist li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; align-items: baseline; color: var(--ink-2); }
.didlist .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.didlist b { color: var(--ink); font-variant-numeric: tabular-nums; }
.did .read { display: flex; flex-wrap: wrap; gap: 6px; }
.matters { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.matters h3 { font-size: 14.5px; font-weight: 650; display: inline; }
.matters .hint { font-size: 13px; color: var(--muted); }
.matters ol { margin: 4px 0 0; padding-left: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.matters li { padding-left: 2px; min-width: 0; }
.matters .mt { font-weight: 600; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.matters .mw { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.figs { display: grid; grid-template-columns: max-content max-content; gap: 3px 18px; margin: 6px 0 2px; font-size: 13.5px; }
.figs dt { color: var(--ink-2); }
.figs dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.figs .cap { grid-column: 1 / -1; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.figtable { width: auto; min-width: 0; border-collapse: collapse; margin: 6px 0 2px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.figtable caption, .journal .cap { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; padding-bottom: 4px; }
.figtable th, .figtable td { padding: 3px 12px 3px 0; text-align: right; white-space: nowrap; background: none; border-bottom: 0;
  text-transform: none; letter-spacing: normal; font-size: inherit; vertical-align: baseline; }
.figtable th[scope="row"] { text-align: left; font-weight: 400; color: var(--ink-2); white-space: normal; }
.figtable td { font-weight: 650; }
.figtable td.ok { color: var(--ok); } .figtable td.bad { color: var(--bad); }
.sub.waiting { color: var(--warn); }
.figtable thead th { color: var(--muted); font-size: 12px; font-weight: 650; }
.journal { margin-top: 8px; }
.item > div { min-width: 0; }   /* a wide table scrolls inside the item instead of running under the side panel */
.journal td:first-child { text-align: left; color: var(--muted); font-weight: 650; }
.lanetiles { display: grid; grid-template-columns: repeat(3, minmax(128px, 1fr)); gap: 10px; }
.lt { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.lt:hover { border-color: var(--line-strong); }
.lt .v { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.lt .k { font-weight: 650; font-size: 13.5px; }
.lt .s { color: var(--muted); font-size: 12px; }
.lt.ask .v { color: var(--accent); }
.lt.team .v { color: var(--warn); }
.lt.clear .v { color: var(--ok); }

/* Lanes */
.lane .group-head { flex-wrap: wrap; }
.lane .who { font-size: 12.5px; color: var(--muted); }
.lane-note { padding: 10px 20px; color: var(--ink-2); font-size: 13.5px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lane-ask .group-head h2::before, .lane-team .group-head h2::before, .lane-clear .group-head h2::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.lane-ask .group-head h2::before { background: var(--accent); }
.lane-team .group-head h2::before { background: var(--seg-wait); }
.lane-clear .group-head h2::before { background: var(--ok); }
.lane:first-of-type .item:first-child { border-top: 0; }

.tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick.square { border-radius: 7px; }
.okmark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-top: 1px; }
.okmark svg.i { width: 14px; height: 14px; }
.item .todo { color: var(--ink); font-size: 13.5px; margin-top: 3px; }
.item .todo .wl { font-weight: 650; margin-right: 6px; }
.item .first { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border-radius: 8px; padding: 7px 10px; margin-top: 6px; }
.item .first svg.i { margin-top: 3px; color: var(--accent); }
.item .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.item .tag { font-size: 12px; }
.item.compact { padding: 11px 18px; }
.item.compact .title { font-size: 14.5px; font-weight: 600; }

/* Drill-down: how Shuriken_AI worked it out */
details.how { margin-top: 5px; }
details.how > summary { list-style: none; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
details.how > summary::-webkit-details-marker { display: none; }
details.how > summary .chev { transition: transform .15s; }
details.how[open] > summary .chev { transform: rotate(90deg); }
.howbox { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 10px 14px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 13px; }
.howbox dt { color: var(--muted); font-weight: 650; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; padding-top: 2px; }
.howbox dd { margin: 0; color: var(--ink-2); }
.howbox dd strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.xlink { font-size: 12.5px; }

details.lanefold > summary { list-style: none; cursor: pointer; }
details.lanefold > summary::-webkit-details-marker { display: none; }
details.lanefold > summary .chev { transition: transform .15s; color: var(--muted); }
details.lanefold[open] > summary .chev { transform: rotate(90deg); }
details.lanefold:not([open]) > summary { border-bottom: 0; }

/* Accounts read */
.acctwrap { overflow-x: auto; }
.accts { width: 100%; border-collapse: collapse; font-size: 13px; }
.accts th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.accts td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.accts td.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.accts th.amt { text-align: right; }
.accts tr:last-child td { border-bottom: 0; }
.dotl { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dotl.ask { background: var(--accent); } .dotl.team { background: var(--seg-wait); } .dotl.clear { background: var(--ok); } .dotl.none { background: var(--line-strong); }

.lanes-col { display: grid; gap: 16px; }
a.lt { color: inherit; }
a.lt:hover { text-decoration: none; }
.item .why.flush { margin-top: 0; }
.xrefs { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.xrefs a { font-weight: 550; }
.accts.xrows { margin-top: 6px; max-width: 420px; }
.accts.xrows td, .accts.xrows th { padding: 4px 10px; }
@media (max-width: 1100px) {
  .did { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .lanetiles { grid-template-columns: 1fr; }
  .lt { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; }
  .lt .v { grid-row: span 2; }
  .howbox { grid-template-columns: 1fr; gap: 2px; }
  .howbox dd { margin-bottom: 6px; }
  .didlist li { grid-template-columns: 1fr; gap: 2px; }
}

/* Jobs (D43): done for you first, then a few jobs; flags only when a job is opened */
.jobsum { display: grid; gap: 4px; justify-items: start; padding: 14px 18px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); min-width: 210px; }
.jobsum .v { font-size: 34px; font-weight: 650; letter-spacing: -.02em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.jobsum .v.ok { color: var(--ok); }
.jobsum .v.ok svg.i { width: 30px; height: 30px; }
.jobsum .k { font-weight: 650; font-size: 13.5px; }
.jobsum .ls { font-size: 13px; color: var(--muted); max-width: 240px; }
.jobsum .linkbtn { margin-top: 6px; font-size: 13px; }
.cleared-line { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); }
.cleared-line b { color: var(--ok); }
.step { display: grid; gap: 12px; margin-bottom: 22px; }
.stephead { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 4px 2px; }
.stephead h2 { font-size: 17px; font-weight: 700; }
.stephead .jb { color: var(--muted); font-size: 13px; }
.stephead .jn { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.stepmark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--ink); color: var(--surface); font-variant-numeric: tabular-nums; }
.step.is-done .stepmark { background: var(--ok-soft); color: var(--ok); }
.step.is-next .stepmark { background: var(--accent); color: var(--accent-ink, #fff); }
.step .jobmark { font-size: 12.5px; }
.journals .jhead { display: grid; gap: 4px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.journals .jhead h3 { font-size: 14.5px; font-weight: 650; }
.journals .jhead .muted { font-size: 13px; }
.journals .table-wrap { padding: 6px 18px 12px; }
.jtable { width: 100%; }
.jtable td:first-child, .jtable thead th:first-child { text-align: left; white-space: normal; width: 100%; font-weight: 450; }
.jtable td.cr { padding-left: 18px; }
.jtable tr.jname th { text-align: left; white-space: normal; font-weight: 650; border-top: 1px solid var(--line); padding-top: 10px; }
.jtable tr.jname:first-child th { border-top: 0; }
.jtable tr.jname th .muted { font-weight: 400; }
.job-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 16px 20px; }
.job-head h2 { font-size: 15.5px; font-weight: 650; }
.job-head .jt { display: grid; gap: 2px; min-width: 0; }
.job-head .jb { color: var(--muted); font-size: 13px; }
.job-head .jn { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.jobmark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; }
.job.is-next { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.job.is-done .jobmark { background: var(--ok-soft); color: var(--ok); }
.job.is-done .job-head h2 { color: var(--muted); }
.job details.lanefold[open] > .job-head { border-bottom: 1px solid var(--line); }
.job .lane-note { border-bottom: 0; }
.job-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.job-foot .muted { font-size: 13px; }
.qmark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-top: 1px; }
.choices { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 13.5px; font-weight: 550; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice input { accent-color: var(--accent); margin: 0; }
details.stmts > summary { list-style: none; cursor: pointer; }
details.stmts > summary::-webkit-details-marker { display: none; }
details.stmts > summary .chevwrap { color: var(--muted); align-self: center; }
details.stmts[open] > summary .chevwrap svg { transform: rotate(90deg); }
details.stmts > .item { padding-left: 34px; }
.okmark.wait { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; }
.okmark.big { width: 40px; height: 40px; }
.okmark.big svg.i { width: 20px; height: 20px; }
.finish { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: var(--ok-soft); border-color: transparent; }
.finish h2 { font-size: 16px; font-weight: 650; }
.finish p { margin: 4px 0 0; color: var(--ink-2); max-width: 62ch; }
.c-next { color: var(--accent); font-weight: 600; }
@media (max-width: 760px) {
  .did { grid-template-columns: 1fr; }
  .jobsum { min-width: 0; }
  .job-head, .stephead { grid-template-columns: 30px minmax(0, 1fr); }
  .stephead .jn { grid-column: 2; flex-wrap: wrap; }
  .job-head .jn { grid-column: 2; white-space: normal; flex-wrap: wrap; }
  details.stmts > .item { padding-left: 18px; }
}
@media (prefers-reduced-motion: reduce) { details.stmts > summary .chevwrap svg { transition: none; } }
.journal .jnote { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.missed-add.message-add { display: grid; gap: 8px; margin: 14px 20px 14px; }
.message-add textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); resize: vertical; }
.message-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.message-actions .missed-hint { margin: 0; flex: 1 1 200px; }
.notes .t.msg { font-weight: 550; white-space: normal; }
/* "I've been through every item": a footer bar (beats form.inline's display) */
.notes form.missed-review { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.notes form.missed-review .by { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.notes form.missed-review .btn { background: var(--surface); }
.notes details.addressed + form.missed-review { margin-top: 0; }
/* ---------- Questions from Shuriken_AI (D63) ---------- */
.nav .navcount { display: inline-block; min-width: 19px; height: 19px; line-height: 19px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.qcallout { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-top: 18px; color: var(--ink); border-color: var(--accent-line); background: var(--accent-soft); }
.qcallout:hover { text-decoration: none; box-shadow: var(--shadow-hover); }
.qcallout .qmark { width: 34px; height: 34px; flex: none; margin: 0; background: var(--accent); color: var(--accent-ink); font-size: 17px; }
.qcallout .body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.qcallout .muted { font-size: 13.5px; }
.waiting { margin-top: 18px; }
.waiting .wrow { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--ink); }
.waiting .group-head + .wrow { border-top: 0; }
a.waiting, .waiting a.wrow:hover { text-decoration: none; background: var(--accent-soft); }
.waiting .wrow .qmark, .waiting .wrow .okmark { flex: none; margin: 0; }
.waiting .wrow .body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.waiting .wrow .muted { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting .wrow form { margin: 0; }
.waiting .wrow.none { color: var(--muted); font-size: 13.5px; gap: 8px; }
.waiting .wrow.none svg.i { width: 14px; height: 14px; color: var(--ok); }
.questions { max-width: 860px; }
.qprogress { padding: 16px 20px; display: grid; gap: 12px; }
.qprogress-top { display: flex; align-items: flex-start; gap: 16px; }
.qprogress-top > div { display: grid; gap: 2px; flex: 1; }
.qprogress-top .muted { font-size: 13.5px; }
.qpct { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.qbar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.qbar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s ease; }
.qviews .chip { text-decoration: none; }
.qviews .chip b { font-weight: 650; margin-left: 3px; font-variant-numeric: tabular-nums; opacity: .75; }
.qviews .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.qareas { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; }
.qareas a { color: var(--ink-2); font-weight: 550; }
.qareas a span { color: var(--muted); font-variant-numeric: tabular-nums; }
.qarea { display: grid; gap: 10px; scroll-margin-top: 80px; }
.qarea-h { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.qcard { padding: 16px 20px; display: grid; gap: 10px; scroll-margin-top: 80px; transition: box-shadow .15s; }
.qcard.s-waiting { box-shadow: var(--shadow); }
.qcard.s-answered, .qcard.s-settled { background: var(--surface-2); }
.qhead { display: flex; align-items: center; gap: 8px; }
.qnum { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.qtext { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.45; max-width: 70ch; }
.qcard.s-answered .qtext, .qcard.s-settled .qtext { font-weight: 550; color: var(--ink-2); }
.qprop { padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--ink); font-size: 14px; line-height: 1.5; max-width: 70ch; }
.qprop .k { display: block; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.qprop.decided { background: var(--ok-soft); }
.qprop.decided .k { color: var(--ok); }
.qthread { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qthread li { padding: 8px 12px; border-radius: 9px; font-size: 14px; line-height: 1.5; max-width: 70ch; border: 1px solid var(--line); background: var(--surface); }
.qthread li.ours { border-color: var(--accent-line); }
.qthread .who { display: block; font-size: 12px; font-weight: 650; color: var(--muted); }
.qthread .agreed { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.qthread .agreed svg { width: 14px; height: 14px; }
.qthread .tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.qactions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.qactions > form { display: contents; }
.qwrite { flex: 1 1 100%; }
.qwrite > summary { list-style: none; display: inline-flex; }
.qwrite > summary::-webkit-details-marker { display: none; }
.qactions > form + .qwrite { flex: 0 1 auto; }
.qwrite[open] { flex: 1 1 100%; }
.qwrite[open] > summary { margin-bottom: 8px; }
.qopen { flex: 1 1 100%; display: grid; gap: 8px; }
.qopen textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); resize: vertical; font: inherit; }
.qwrite form { display: grid; gap: 8px; }
.qwrite textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); resize: vertical; font: inherit; }
.qsend { display: flex; flex-wrap: wrap; gap: 8px; }
.qcard.htmx-request { opacity: .6; }
@media (max-width: 760px) {
  .qcallout { flex-wrap: wrap; }
  .waiting .wrow { flex-wrap: wrap; }
  .waiting .wrow .body { flex-basis: 100%; }
  .qcallout .btn { width: 100%; }
  .qcard { padding: 14px 16px; }
  .qarea, .qcard { scroll-margin-top: 140px; }
  .qactions .btn { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) { .qbar > span, .qcard { transition: none; } }
.qrules { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.qrules li { padding-left: 2px; }
.qrules li::marker { color: var(--accent); font-weight: 650; font-variant-numeric: tabular-nums; }
.qshow > summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 600; width: fit-content; }
.qshow[open] > summary { margin-bottom: 8px; }
/* Questions as sections of rules, one line each (D63) */
.questions { max-width: 1120px; min-width: 0; }
.qlayout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.qnav { padding: 8px; position: sticky; top: 84px; }
.qnav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.qnav a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; font-weight: 550; text-decoration: none; }
.qnav a:hover { background: var(--surface-2); }
.qnav a.on { background: var(--accent-soft); color: var(--accent); }
.qnav-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qnav-mark svg { width: 12px; height: 12px; }
.qnav a.done .qnav-mark { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.qnav a.on .qnav-mark { border-color: var(--accent-line); }
.qnav a.own { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding-top: 10px; }
.qnav-name { min-width: 0; line-height: 1.3; }
.qnav-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qnav a.done .qnav-n { color: var(--ok); }
.qsection { padding: 0; }
.qsection-head { padding: 18px 22px 12px; display: grid; gap: 4px; }
.qstep { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.qsection-head h3 { font-size: 19px; font-weight: 650; }
.qsection-head p { margin: 2px 0 0; font-size: 13.5px; max-width: 70ch; }
.qrows { list-style: none; margin: 0; padding: 0; counter-reset: qrow; }
.qrows > .qrow { counter-increment: qrow; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 22px; border-top: 1px solid var(--line); align-items: start; }
.qrows > .qrow::before { content: counter(qrow); font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); padding-top: 3px; }
.qrow-main { display: grid; gap: 6px; min-width: 0; }
.qrow-text { margin: 0; font-size: 14.5px; line-height: 1.5; max-width: 72ch; }
.qrow-text .pill { font-size: 11.5px; padding: 0 8px; vertical-align: 1px; }
.qrows > .qrow.s-answered .qrow-text, .qrows > .qrow.s-settled .qrow-text { color: var(--ink-2); }
.qrow-act { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; min-width: 160px; }
.qrow-act > form { display: contents; }
.qstate { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.qstate svg { width: 13px; height: 13px; }
.qstate.ok { color: var(--ok); } .qstate.accent { color: var(--accent); } .qstate.warn { color: var(--warn); }
.btn.linkish { border-color: transparent; background: transparent; color: var(--accent); padding-left: 6px; padding-right: 6px; }
.btn.linkish:hover { background: var(--accent-soft); }
.qchange { display: grid; gap: 8px; margin-top: 2px; }
.qchange[hidden] { display: none; }
.qchange textarea, .qadd textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); resize: vertical; font: inherit; }
.qrows > .qrow .qthread li { font-size: 13.5px; }
.qrows > .qrow .by { color: var(--muted); font-size: 12.5px; }
.qadd { display: grid; gap: 8px; padding: 0 22px 16px; }
.qarea-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-right: auto; }
.qarea-pick select { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: inherit; max-width: 240px; }
.qempty { padding: 4px 22px 16px; margin: 0; }
.qfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.qfoot > form { display: contents; }
.qfoot-nav { margin-left: auto; display: flex; gap: 8px; }
.qdone { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 650; }
.qdone svg { width: 15px; height: 15px; }
.qrows > .qrow.htmx-request, .qsection.htmx-request { opacity: .6; }
@media (max-width: 900px) {
  .qlayout { grid-template-columns: minmax(0, 1fr); }
  .qlayout > * { min-width: 0; }
  .qnav { position: static; }
  .qnav ol { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 2px; }
  .qnav-n { display: none; }
  .qnav a.own { margin-top: 0; border-top: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; padding-top: 7px; }
}
@media (max-width: 600px) {
  .qrows > .qrow { grid-template-columns: 22px minmax(0, 1fr); padding: 12px 16px; }
  .qrow-act { grid-column: 2; justify-content: flex-start; min-width: 0; }
  .qrow-act .btn { min-height: 36px; }
  .qsection-head, .qadd { padding-left: 16px; padding-right: 16px; }
  .qfoot { padding: 14px 16px; }
  .qfoot > form .btn { width: 100%; }
  .qfoot-nav { margin-left: 0; width: 100%; justify-content: space-between; }
}
.btn.agree { color: var(--ok); border-color: var(--line-strong); }
.btn.agree:hover { background: var(--ok-soft); border-color: var(--ok); }
.qrows > .qrow:hover { background: var(--surface-2); }
@media (max-width: 900px) { .qnav-name { white-space: nowrap; } }

/* The rule behind an item, on the client page (D66): agreed where it applies */
.rulebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: start; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--accent-line); border-radius: 10px; background: var(--surface-2); }
.rulebar .rule-line { display: grid; gap: 2px; min-width: 0; }
.rulebar .rk { font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: var(--accent); }
.rulebar .rt { font-size: 13px; color: var(--ink-2); }
.rulebar .rule-acts { display: flex; gap: 6px; align-items: center; }
.rulebar .qchange { grid-column: 1 / -1; }
.howbox .rulestate { color: var(--muted); }
@media (max-width: 520px) { .rulebar { grid-template-columns: minmax(0, 1fr); } }

/* The firm's own rule beside the closest of ours (D67) */
.qrelated { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--accent-line); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 13px; }
.qrelated .k { font-size: 11.5px; font-weight: 650; color: var(--accent); letter-spacing: .02em; }
.qrelated ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 2px; color: var(--ink-2); }
.qrelated b { font-variant-numeric: tabular-nums; margin-right: 4px; }

/* The quick start on the Questions tab (D70): the firm's call one card at a time, the rest in one click. */
.qstart { max-width: 760px; display: grid; gap: 16px; }
.qhello { padding: 18px 20px; display: grid; gap: 10px; }
.qhello h2 { margin: 0; font-size: 20px; }
.qhello p { margin: 0; }
.qhello-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.qundo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; background: var(--ok-soft); font-size: 14px; }
.qcardx { padding: 20px; display: grid; gap: 14px; }
.qcardx h3 { margin: 0; font-size: 18px; line-height: 1.4; }
.qcardx.done h3 { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.qcardx.done p { margin: 0; }
.qcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.qcard-pos { font-weight: 700; }
.qwritten { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.qwritten .k { font-weight: 700; margin-right: 4px; }
.qwhy { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
.qwhy .pill { font-size: 11.5px; padding: 0 8px; margin-right: 4px; vertical-align: 1px; }
.qimpact { display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); font-size: 14px; line-height: 1.5; }
.qimpact .k { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.qimpact ul { margin: 2px 0 0; padding-left: 18px; }
.qopts { display: grid; gap: 8px; }
.qopts > form { margin: 0; }
.qopt { width: 100%; min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; text-align: left;
        font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
        border-radius: 10px; cursor: pointer; }
.qopt:hover, .qopt:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.qopt.rec { border-color: var(--ok); }
.qopt.rec:hover, .qopt.rec:focus-visible { background: var(--ok-soft); }
.qother summary { cursor: pointer; font-size: 14px; color: var(--accent); padding: 6px 2px; }
.qother form { display: grid; gap: 8px; margin-top: 6px; }
.qother textarea { width: 100%; }
.qcard-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.qrest { padding: 18px 20px; display: grid; gap: 10px; }
.qrest h3 { margin: 0; font-size: 16px; }
.qrest p { margin: 0; line-height: 1.5; }
.qrest-act { display: flex; flex-wrap: wrap; gap: 8px; }
.qbackbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.qbackbar .muted { font-size: 13.5px; }
.qrows > .qrow .qopts { max-width: 70ch; }
.qrows > .qrow .qopt { min-height: 40px; font-size: 14px; }
@media (max-width: 640px) {
  .qcardx, .qhello, .qrest { padding: 16px; }
  .qcardx h3 { font-size: 17px; }
  .qrest-act > form, .qrest-act > .btn { flex: 1 1 100%; }
  .qrest-act .btn { width: 100%; justify-content: center; min-height: 44px; }
}

/* Google Drive set-up (D71, D72) */
.drive > * { min-width: 0; }
.drive code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; overflow-wrap: anywhere; }
.drive h3 { font-size: 14px; font-weight: 650; margin: 0; }
.drive-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.drive-nums > div { display: grid; gap: 2px; padding: 16px 20px; border-left: 1px solid var(--line); }
.drive-nums > div:first-child { border-left: 0; }
.drive-nums .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; }
.drive-nums .v small { font-size: 15px; font-weight: 600; color: var(--muted); }
.drive-nums .v.accent { color: var(--accent); } .drive-nums .v.ok { color: var(--ok); } .drive-nums .v.warn { color: var(--warn); } .drive-nums .v.bad { color: var(--bad); }
.drive-nums .k { color: var(--muted); font-size: 13px; }

.drive-guide { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.tree { margin: 0; padding: 18px 20px 20px; display: grid; gap: 2px; border-right: 1px solid var(--line); }
.tree figcaption { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.tr { position: relative; display: grid; grid-template-columns: 20px auto auto minmax(0, 1fr); align-items: center; gap: 0 8px; padding: 5px 8px; border-radius: 8px; font-size: 13.5px; }
.tr.l1 { margin-left: 22px; } .tr.l2 { margin-left: 44px; } .tr.l3 { margin-left: 66px; }
.tr::before { content: ""; position: absolute; left: -13px; top: -4px; height: calc(50% + 4px); width: 10px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 4px; }
.tr.l0::before { display: none; }
.tr.year { background: var(--accent-soft); }
.tico { display: grid; place-items: center; color: var(--muted); }
.tico svg { width: 17px; height: 17px; }
.tico.fo { color: #D9A82B; }
.tn { font-weight: 600; white-space: nowrap; }
.tr.l3 .tn { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.tnote { color: var(--muted); font-size: 12.5px; grid-column: 4; }
.tr:not(:has(.tag)) .tnote { grid-column: 3 / -1; }
.tag { font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.tag.bank { background: var(--accent-soft); color: var(--accent); }
.tag.loan { background: var(--warn-soft); color: var(--warn); }
.tag.ato { background: var(--ok-soft); color: var(--ok); }
.tag.done { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.rules { padding: 18px 20px 20px; display: grid; gap: 14px; align-content: start; }
.rule { display: grid; gap: 6px; }
.rk { font-weight: 650; font-size: 13.5px; }
.ex { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--ink-2); }
.ex > svg { width: 15px; height: 15px; flex: none; }
.ex.good > svg { color: var(--ok); } .ex.bad > svg { color: var(--bad); }
.ex span { color: var(--muted); }
.rules-foot { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }

.drow { border-top: 1px solid var(--line); }
.drow:first-of-type { border-top: 0; }
.drow > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(220px, 1.3fr) 150px minmax(0, 2fr) 24px; gap: 10px 16px; align-items: center; padding: 14px 20px; }
.drow > summary::-webkit-details-marker { display: none; }
.drow > summary:hover { background: var(--surface-2); }
.drow .cell-client > span:last-child { display: grid; min-width: 0; }
.drow .chevwrap svg { transition: transform .15s; }
.drow .chevwrap { color: var(--muted); }
.drow[open] .chevwrap svg { transform: rotate(90deg); }
.drive .lane-empty { margin: 16px 20px; }
.chks { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.chk { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; border: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
.chk::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.chk.ok::before { background: var(--ok); } .chk.part::before { background: var(--warn); } .chk.no::before { background: var(--bad); }
.chk.na { color: var(--muted); }
.dbody { padding: 4px 20px 18px 68px; display: grid; gap: 12px; }
.dsteps { margin: 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.5; }
.dstmt { min-width: 620px; border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.dstmt td, .dstmt th { padding: 8px 12px; font-size: 13.5px; vertical-align: top; }
.dstmt tbody tr { cursor: default; }
.dstmt tbody tr:hover td { background: transparent; }
.saveas { color: var(--muted); font-size: 12.5px; }
.loose { font-size: 13.5px; }
.dactions { display: flex; flex-wrap: wrap; gap: 8px; }

.find-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 20px; }
.find-bar .muted { font-size: 13px; }
.sub { border-top: 1px solid var(--line); }
.sub-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 20px 10px; }
.sub-head .muted { font-size: 13px; }
.sub-head .n { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.srow { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 10px 20px; padding: 12px 20px; border-top: 1px solid var(--line); align-items: start; }
.srow .cell-client > span:last-child { display: grid; min-width: 0; }
.srow .c-name { color: var(--ink); text-decoration: none; }
.sopts { display: grid; gap: 6px; min-width: 0; }
.sopt { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; }
.sopt .tico svg { width: 17px; height: 17px; }
.sname { display: grid; min-width: 0; }
.sname .tn { white-space: normal; overflow-wrap: anywhere; }
.sact { display: inline-flex; align-items: center; gap: 12px; }
.sub .unlinked { border-top: 1px solid var(--line); }
.unlinked { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); overflow: hidden; }
.ucard { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 -1px -1px 0; }
.ucard .tile { width: 30px; height: 30px; font-size: 11.5px; border-radius: 8px; }
.ubody { min-width: 0; display: grid; gap: 1px; }
.ubody .c-name { color: var(--ink); text-decoration: none; }
.uhand summary { cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 600; list-style: none; margin-top: 3px; }
.uhand summary::-webkit-details-marker { display: none; }
.uhand form { margin-top: 6px; }
.uhand input { width: 100%; min-width: 0; }

@media (max-width: 1000px) {
  .drive-guide { grid-template-columns: minmax(0, 1fr); }
  .tree { border-right: 0; border-bottom: 1px solid var(--line); }
  .drow > summary { grid-template-columns: minmax(0, 1fr) auto 24px; }
  .drow .chks { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .drive-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drive-nums > div:nth-child(odd) { border-left: 0; }
  .drive-nums > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tr { grid-template-columns: 20px minmax(0, 1fr); }
  .tr .tn { white-space: normal; overflow-wrap: anywhere; }
  .tr .tag, .tr .tnote, .tr:not(:has(.tag)) .tnote { grid-column: 2; justify-self: start; }
  .tr.l1 { margin-left: 14px; } .tr.l2 { margin-left: 28px; } .tr.l3 { margin-left: 42px; }
  .srow { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .sopt { grid-template-columns: 20px minmax(0, 1fr); }
  .sopt .tag, .sopt .sact { grid-column: 2; justify-self: start; }
  .tr::before { left: -9px; width: 7px; }
  .dbody { padding-left: 16px; padding-right: 16px; }
  .drow > summary { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .drow .chevwrap svg { transition: none; } }

/* The rulebook once answered (D73) */
.qsum { padding: 0; }
.qsum-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.qsum-nums > div { display: grid; gap: 2px; padding: 16px 20px; border-left: 1px solid var(--line); }
.qsum-nums > div:first-child { border-left: 0; }
.qsum-nums .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.qsum-nums .v.ok { color: var(--ok); } .qsum-nums .v.accent { color: var(--accent); } .qsum-nums .v.warn { color: var(--warn); }
.qsum-nums .k { color: var(--muted); font-size: 13px; }
.qsum-how { margin: 0; padding: 14px 20px 16px; font-size: 14px; line-height: 1.55; color: var(--ink-2); max-width: 90ch; }
@media (max-width: 640px) {
  .qsum-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qsum-nums > div:nth-child(3) { border-left: 0; }
  .qsum-nums > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* How a job runs (rulebook 16, batch 2): an owner reads the request, the follow-up email, the sign-off, due dates */
.req-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.req-acts > form { display: contents; }
.followup { display: grid; gap: 10px; margin-bottom: 12px; }
.followup-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.followup-head .muted { font-size: 12.5px; flex: 1; min-width: 0; }
.email.small { font-size: 13px; padding: 12px 14px; gap: 9px; }
.small-note { font-size: 12.5px; margin: 0 0 10px; }
.signoff .card-body { display: grid; gap: 10px; }
.signoff p { margin: 0; font-size: 13.5px; }
.signoff-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.signoff-who { font-weight: 600; }
.comments { display: grid; gap: 6px; margin-top: 8px; justify-items: start; }
.comments .cm, .loose .cm { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13.5px; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 7px 7px 0; max-width: 100%; }
.comments .cw, .loose .cw { font-weight: 650; }
.comments .ct, .loose .ct { flex-basis: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmform { width: 100%; }
.cmopts { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; margin: 6px 0; }
.cmopts label { display: inline-flex; gap: 6px; align-items: center; }
.loose { display: grid; gap: 6px; margin: 10px 0; }
.loose .lc { display: grid; gap: 2px; font-size: 13px; }
.signoff-holds { padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); border: 1px solid var(--line-strong); font-size: 13.5px; }
.signoff-holds ul { margin: 4px 0 0; padding-left: 18px; }
.signoff-hours { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.signoff-hours label { display: inline-flex; gap: 6px; align-items: center; }
.signoff-hours input { width: 76px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
td .overdue { color: var(--bad); font-weight: 650; }

/* The feedback panel (D104): docked at the right edge, over nothing but its own column; a bottom sheet on a phone. */
.fb-open { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 650; border: 0; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.fb-open:hover { filter: brightness(1.05); }
.fbpanel { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 100vw; z-index: 31; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.fbpanel[hidden] { display: none; }
.fbpanel .fbhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fbpanel .fbhead h2 { font-size: 15px; font-weight: 650; margin: 0; }
.fbpanel .fbbody { padding: 14px 16px; overflow: auto; display: grid; gap: 10px; align-content: start; }
.fbpanel .fbform { margin: 0; }
.fbpanel textarea { width: 100%; min-height: 120px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); font: inherit; resize: vertical; }
.fb-context, .fbpanel .fbctx { display: flex; flex-wrap: wrap; gap: 6px; }
.fbpanel .fbctx .chip, .fb-context .chip { cursor: default; }
.fbpanel .fbsent { padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.fbnum { font-weight: 700; color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.fb-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.fb-stages .arrow { color: var(--muted); }
.fb-group .group-head { cursor: pointer; }
@media (max-width: 720px) { .fbpanel { top: auto; width: 100vw; max-height: 80vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; } }
