/* DHNY portal. Visual language borrowed from the Q3 deal-review artifact: paper background, white cards with a
   1px border and 12px radius, Fraunces headings over Source Sans 3 body text, one navy accent (Penova navy) with a hairline of Penova gold.
   Fonts come from Google Fonts (see base.html); every font stack falls back to a system font, so the page is
   fine offline. No inline styles anywhere (the CSP forbids them). */

/* ---- design tokens ------------------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  --paper: #F6F7F4; --card: #FFFFFF; --ink: #1B2A41; --ink-2: #4A5568; --ink-3: #5F6B7A; --line: #DDE2E6;
  --accent: #1A3A5C; --accent-ink: #FFFFFF; --accent-soft: #E7EDF5; --focus: #1A3A5C;
  --gold: #C8A96E; /* decorative hairlines only (nav underline, hero rule, tile tops); never text */
  --on-fill: #FFFFFF; /* text on the ok / warn / hold / bad decision fills */
  --ok: #2E7D4F; --ok-soft: #E4F3EA; --warn: #B7791F; --warn-soft: #FBF1DC;
  --bad: #B23A3A; --bad-soft: #F9E4E4; --hold: #5B6B7F; --hold-soft: #E9EDF2;
  /* text-on-soft-background variants: the base colours stay for fills, bars and borders (AA 4.5:1 on the soft tints) */
  --ok-text: #27704A; --warn-text: #8A5A0B; --accent-text: #1A3A5C; --bad-ink: #FFFFFF;
  --shadow: 0 1px 2px rgba(27, 42, 65, 0.05), 0 6px 18px rgba(27, 42, 65, 0.05);
  --display: Fraunces, "Iowan Old Style", Georgia, serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 12px;
  --wrap: 1040px;
  /* names the older rules and templates use */
  --bg: var(--paper); --fg: var(--ink); --muted: var(--ink-2); --accent-fg: var(--accent-ink);
  --notice-bg: var(--accent-soft); --todo: var(--accent);
  --danger: var(--bad); --danger-bg: var(--bad-soft); --bad-bg: var(--bad-soft);
  --drop-bg: var(--paper); --chip-line: var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141A22; --card: #1D2530; --ink: #EEF2F5; --ink-2: #C2CAD3; --ink-3: #9AA5B3; --line: #2E3946;
    --accent: #3F6A99; --accent-ink: #FFFFFF; --accent-soft: #223449; --focus: #9DBCE0;
    --gold: #C8A96E; --on-fill: #0F1418;
    --ok: #6CC08B; --ok-soft: #1F3A2A; --warn: #E0B25A; --warn-soft: #3B3220;
    --bad: #E27A7A; --bad-soft: #3E2323; --hold: #A5B1C0; --hold-soft: #2A3341;
    --ok-text: var(--ok); --warn-text: var(--warn); --accent-text: #9DBCE0; --bad-ink: #0F1418;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141A22; --card: #1D2530; --ink: #EEF2F5; --ink-2: #C2CAD3; --ink-3: #9AA5B3; --line: #2E3946;
  --accent: #3F6A99; --accent-ink: #FFFFFF; --accent-soft: #223449; --focus: #9DBCE0;
  --gold: #C8A96E; --on-fill: #0F1418;
  --ok: #6CC08B; --ok-soft: #1F3A2A; --warn: #E0B25A; --warn-soft: #3B3220;
  --bad: #E27A7A; --bad-soft: #3E2323; --hold: #A5B1C0; --hold-soft: #2A3341;
  --ok-text: var(--ok); --warn-text: var(--warn); --accent-text: #9DBCE0; --bad-ink: #0F1418;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* ---- base ---------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--body);
}
h1, h2, h3 { font-family: var(--display); text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 8px; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--accent-text); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 4px; }
.num, .amt, .big, .tile-value { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--card); padding: 6px 12px; border-radius: 8px; }
.sr, .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: no-preference) {
  a, button, .btn, .rm-dot, .tile { transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s; }
}

/* ---- top bar ------------------------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.bar-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font: 700 18px/1 var(--display);
}
.brand-name { font: 700 18px/1 var(--display); letter-spacing: -0.01em; }
.brand-sub { font-weight: 500; color: var(--ink-3); }
.site-nav { order: 2; flex: 1 1 auto; min-width: 0; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.site-nav a:hover { background: var(--hold-soft); color: var(--ink); }
.site-nav a.active { background: var(--accent-soft); color: var(--accent-text); position: relative; }  /* soft pill plus a straight gold underline */
.site-nav a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 1px; background: var(--gold); }
.who { order: 3; margin-left: auto; display: flex; align-items: center; gap: 4px 10px; min-width: 0; }
.who-avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--hold-soft); color: var(--ink-2); font-weight: 700; font-size: 14px;
}
.who-name { font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.who-email { display: none; }  /* kept in the markup (and the name's tooltip) but not drawn: it pushed the account block onto a second row */
@media (max-width: 640px) {
  .brand { order: 1; }
  .who { order: 2; }
  .site-nav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
  .site-nav a { padding: 0 10px; }
  .site-nav::-webkit-scrollbar { display: none; }
  .who-name { display: none; }
}

#main, .rcard { scroll-margin-top: 128px; }
main { display: block; }
.page { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 48px; }
.site-footer { padding: 24px 16px 32px; color: var(--ink-3); font-size: 13px; text-align: center; }
.site-footer .gold-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); vertical-align: middle; margin-right: 4px; }
.site-footer .penova {
  font: 600 13px/1 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); text-decoration: none;
}
.site-footer .penova:hover, .site-footer .penova:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* ---- cards, notices, buttons --------------------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card-foot { margin: 14px 0 0; }
.stack { display: grid; gap: 16px; }
.section-title { margin-top: 28px; }
.auth-card { max-width: 32rem; margin: 24px auto; }
.notice {
  background: var(--accent-soft); border-left: 4px solid var(--accent-text); border-radius: 0 10px 10px 0;
  padding: 12px 16px; margin: 16px 0;
}
.notice.error, .rn-warn { border-left-color: var(--bad); background: var(--bad-soft); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.compact li { padding: 4px 0; }
form.inline { display: inline; margin: 0; }
button.link {
  background: none; border: 0; padding: 8px 0; font: inherit; color: var(--accent-text);
  text-decoration: underline; cursor: pointer; min-height: 44px;
}
a.button, button.button, .btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; min-height: 44px;
  border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
a.button:hover, button.button:hover, .btn.primary:hover { filter: brightness(1.08); }
a.button.secondary, button.button.secondary, .btn, .btn.secondary { background: var(--card); color: var(--accent-text); border-color: var(--accent-text); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.button { margin-top: 8px; }
button.button.danger { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
button.button[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
form.dropzone button.button, form.settings button.button { font: inherit; font-weight: 700; }

/* ---- pills --------------------------------------------------------------------------------------------- */
.pill, .badge, .pr-badge, .rn-badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; line-height: 1.5;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; background: var(--hold-soft); color: var(--hold);
  text-transform: none;
}
.pill.state-published, .pill.state-closed { background: var(--ok-soft); color: var(--ok-text); }
.pill.state-scoping, .pill.state-harvesting, .pill.state-draft_review, .pill.state-final_review { background: var(--accent-soft); color: var(--accent-text); }
.pr-approved, .pr-edited, .rn-succeeded { background: var(--ok-soft); color: var(--ok-text); }
.pr-rejected, .rn-failed, .rn-abandoned { background: var(--bad-soft); color: var(--bad); }

/* ---- facts, tables ------------------------------------------------------------------------------------- */
dl.facts { margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px; }
dl.facts div { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
dl.facts dt { color: var(--ink-3); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
dl.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 600; }
ul.history li { overflow-wrap: anywhere; }
ul.timeline { border-left: 2px solid var(--line); margin-left: 6px; }
ul.timeline li { position: relative; padding: 8px 0 8px 18px; border-bottom: 0; }
ul.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--accent-text);
}
.table-wrap, .rn-scroll { overflow-x: auto; }
.pr-table, .rn-table, table.data { width: 100%; border-collapse: collapse; font-size: 0.9375rem; background: var(--card); }
.pr-table th, .pr-table td, .rn-table th, .rn-table td, table.data th, table.data td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.pr-table th, .rn-table th, table.data th {
  color: var(--ink-3); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; white-space: nowrap;
}
.rn-table td, table.data td { font-variant-numeric: tabular-nums; }
.rn-warn { padding-left: 16px; }
.rn-pre {
  overflow-x: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  white-space: pre-wrap; font: 0.8125rem/1.45 var(--mono);
}

/* ---- rule proposals ------------------------------------------------------------------------------------ */
.pr-diff { overflow-x: auto; margin: 8px 0; padding: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: 0.8125rem/1.45 var(--mono); }
.pr-diff span { display: block; min-height: 1.45em; padding: 0 12px; white-space: pre-wrap; word-break: break-word; }
.pr-diff .pr-add { background: var(--ok-soft); }
.pr-diff .pr-del { background: var(--bad-soft); }
.pr-diff .pr-hunk { color: var(--accent-text); background: var(--accent-soft); }
.pr-diff .pr-meta { color: var(--ink-3); font-weight: 700; }
.pr-rationale { white-space: pre-wrap; }
.pr-form { display: block; margin: 16px 0 24px; padding-top: 8px; border-top: 1px solid var(--line); }
.pr-form label { display: block; font-weight: 600; margin: 8px 0 4px; }
.pr-form textarea, .pr-form input[type=text] { width: 100%; }
.pr-mono { font: 0.8125rem/1.45 var(--mono) !important; }

/* ---- form controls ------------------------------------------------------------------------------------- */
select, textarea, input[type="text"], input[type="search"], input[type="date"] {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-height: 44px; max-width: 100%;
}
textarea { min-height: 4.5rem; resize: vertical; }
form.settings fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 0 0 20px; padding: 14px 18px 18px; }
form.settings legend { font-weight: 700; padding: 0 6px; }
form.settings label.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; min-height: 44px; }
form.settings input[type=text], form.settings input[type=date], form.settings select { width: 100%; max-width: 28rem; }
form.settings .help { margin: 4px 0 0; font-size: 0.9375rem; color: var(--muted); }
form.settings .field { margin: 0 0 16px; }
form.settings .field > label { display: block; font-weight: 600; margin-bottom: 4px; }

/* ---- upload drop zone ---------------------------------------------------------------------------------- */
.dropzone-panel, .dropzone-slot { margin: 16px 0 0; }
form.dropzone { margin: 12px 0; }
.dz-area {
  display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center;
  min-height: 9rem; padding: 16px; margin-bottom: 12px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--paper);
}
form.dropzone.dragging .dz-area, .dz-area:hover { border-color: var(--accent-text); background: var(--accent-soft); }
.dz-area:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dz-prompt { font-weight: 700; }
.dz-input { max-width: 100%; margin-top: 8px; }
.htmx-indicator { display: none; margin-left: 8px; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.upload-result { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 4px 16px 12px; margin-top: 12px; }
.upload-result.failed { border-color: var(--bad); }
.rejected-note { color: var(--bad); }

/* ---- hero (quarter page) ------------------------------------------------------------------------------- */
.hero { background: linear-gradient(180deg, var(--accent-soft) 0%, var(--paper) 100%); border-top: 3px solid var(--gold); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 16px 56px; }
.hero-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.hero-title-row h1 { margin: 0; font-size: clamp(30px, 5vw, 44px); }
.hero-help { color: var(--ink-2); max-width: 65ch; margin: 8px 0 14px; font-size: 1.0625rem; }
.hero-actions { margin: 0 0 18px; }
.tiles { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: grid; gap: 6px; align-content: start; background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.tile-warn { border-top-color: var(--warn); }
.tile-label { margin: 0; }
.tile-value { font: 700 clamp(24px, 3.4vw, 34px)/1.1 var(--display); overflow-wrap: anywhere; }
.tile-of { font: 600 0.5em/1 var(--body); color: var(--ink-3); }
.tile-none { color: var(--ink-3); font-size: 0.6em; font-weight: 500; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- roadmap card and stepper -------------------------------------------------------------------------- */
.roadmap { max-width: var(--wrap); margin: 0 auto; padding: 16px 16px 0; }
.hero + .roadmap { margin-top: -40px; position: relative; padding-top: 0; }
.rm-live { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px 20px; }
.rm-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 14px; }
.rm-q {
  display: inline-flex; align-items: center; padding: 0 12px; min-height: 36px; border-radius: 999px;
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.rm-q:hover { background: var(--hold-soft); }
.rm-q.current { background: var(--accent-soft); color: var(--accent-text); }
.rm-sep { color: var(--ink-3); font-size: 11px; }
.rm-statusbox { margin-top: 4px; }
.rm-chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rm-chip {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 0 2px; font-size: 13px; line-height: 1.25; color: var(--ink-3); border: 0; background: none;
}
.rm-chip::before {
  content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.rm-chip:first-child::before { display: none; }
.rm-chip.done::before, .rm-chip.current::before { background: var(--accent); }
.rm-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--line); color: var(--ink-3); font-weight: 700; font-size: 14px;
}
.rm-chip.done .rm-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rm-chip.current .rm-dot { border-color: var(--accent-text); color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.rm-chip.done .rm-lab { color: var(--ink-2); }
.rm-chip.current .rm-lab { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) {
  .rm-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 10px 12px; }
  .rm-chip { flex-direction: row; text-align: left; gap: 10px; font-size: 14px; }
  .rm-chip::before { display: none; }
  .rm-dot { width: 28px; height: 28px; font-size: 13px; flex: none; }
}
.rm-status { margin: 14px 0 4px; overflow-wrap: anywhere; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rm-status.failed, .rm-error {
  color: var(--bad); background: var(--bad-soft); border-left: 4px solid var(--bad); border-radius: 0 10px 10px 0;
  padding: 8px 14px; margin: 10px 0; font-weight: 600;
}
.rm-actions { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.rm-title { font: 600 12px/1.4 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 12px 0 8px; }
.rm-buttons { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 0; padding: 0; }
.rm-item { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.rm-item form { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.rm-note { min-height: 44px; padding: 6px 10px; font: inherit; max-width: 100%; }
.rm-why { color: var(--ink-2); font-size: 13px; max-width: 16rem; overflow-wrap: anywhere; }

/* ---- review dashboard, deal review, late arrivals ------------------------------------------------------ */
/* review-late-begin: no fixed widths over 400px in this section (tests/test_portal_review.py checks it). */
.review .sub { color: var(--ink-2); max-width: 65ch; margin: 0 0 8px; }
.review .hint { font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.review .progress {
  display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin: 16px 0; box-shadow: var(--shadow);
}
.review .nums { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; font-variant-numeric: tabular-nums; }
.review .big { font: 700 30px/1 var(--display); }
.review .bar { display: block; width: 100%; height: 10px; border-radius: 6px; background: var(--hold-soft); overflow: hidden; }
.review .seg-approve { fill: var(--ok); background: var(--ok); }
.review .seg-approve-feedback { fill: var(--warn); background: var(--warn); }
.review .seg-deny { fill: var(--bad); background: var(--bad); }
.review .seg-pending { fill: var(--hold); background: var(--hold); }
.review .seg-none { fill: var(--accent); background: var(--accent); }
.review .bar .seg { stroke: var(--card); stroke-width: 1px; vector-effect: non-scaling-stroke; }  /* keeps adjacent segments apart in dark mode */
.review .legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--ink-2); }
.review .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.review .filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 16px 0; }
.review .filters label { display: grid; gap: 2px; font-size: 14px; color: var(--ink-2); flex: 1 1 10rem; }
.review textarea { width: 100%; }
.review button.apply, .review button.save {
  font: inherit; font-weight: 700; min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.review .list { display: grid; gap: 14px; }
.review .rcard {
  display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: 16px 18px; overflow-wrap: anywhere;
}
.review .rcard.dec-approve { border-left-color: var(--ok); }
.review .rcard.dec-approve-feedback { border-left-color: var(--warn); }
.review .rcard.dec-deny { border-left-color: var(--bad); }
.review .rcard.dec-pending { border-left-color: var(--hold); }
.review .top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.review .top h2 { font-size: 22px; margin: 0; }
.review .amt { font-weight: 700; font-size: 18px; }
.review .amt-none { font-weight: 600; font-size: 15px; color: var(--ink-3); }
.review .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--ink-2); }
.review .pill.st-qualified, .review .pill.dec-approve { background: var(--ok-soft); color: var(--ok-text); }
.review .pill.st-flagged, .review .pill.dec-approve-feedback { background: var(--warn-soft); color: var(--warn-text); }
.review .pill.st-excluded, .review .pill.dec-deny { background: var(--bad-soft); color: var(--bad); }
.review .pill.st-candidate, .review .pill.st-verified, .review .pill.dec-pending, .review .pill.dec-none { background: var(--hold-soft); color: var(--hold); }
.review .q { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.review .q b { color: var(--accent-text); }
.review .sources { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 14px; }
.review .sources a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.review .changed { background: var(--warn-soft); color: var(--ink); border-radius: 8px; padding: 8px 12px; margin: 0; }
.review .err { color: var(--bad); margin: 0; font-weight: 600; }
.review .ok { color: var(--ok-text); margin: 0; font-weight: 600; }
.review .decide { display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 12px; }
.review fieldset.choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.review .choice { position: relative; display: inline-flex; }
.review .choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.review .choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.review .choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.review .choice input:checked + span { color: var(--on-fill); border-color: transparent; }
.review .dc-approve input:checked + span { background: var(--ok); }
.review .dc-approve-feedback input:checked + span { background: var(--warn-text); }
.review .dc-deny input:checked + span { background: var(--bad); }
.review .dc-pending input:checked + span { background: var(--hold); }
.review .row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.review .rule { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; font-size: 14px; }
.review .stamp { font-size: 13px; color: var(--ink-2); }
.review button.small { font-size: 14px; }
.review .comment-ro, .review .hist-comment { margin: 0; font-style: italic; }
.review .rnote { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.review .rnote .comment-ro { font-size: 15px; }
.review .rnote-by { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.review .hist-list { margin: 0 0 8px; padding-left: 1.2rem; font-size: 14px; }
.review .history h3 { font-size: 0.95rem; margin: 8px 0 4px; }
.review .empty { color: var(--ink-3); padding: 24px 0; text-align: center; }
.review .foot { font-size: 13px; color: var(--ink-3); margin-top: 28px; max-width: 70ch; }
.review .dr-head { margin-bottom: 4px; }
.review .readonly-banner { margin-top: 12px; }
/* review-late-end */

@media (max-width: 520px) {
  .review .top h2 { font-size: 19px; }
  .card, .rm-live { padding: 16px; }
}

/* ---- home ---------------------------------------------------------------------------------------------- */
ul.quarter-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; box-shadow: var(--shadow); }
.quarter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; text-decoration: none; color: var(--ink); }
.quarter-row:hover strong { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.who button.link { padding: 0; min-height: 44px; font-size: 14px; }

/* ---- guide page (docs/runbook-jen.md rendered at /guide) ----------------------------------------------- */
.hero-compact .hero-inner { padding-bottom: 28px; }
.guide { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 0 32px; align-items: start; }
.guide-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.guide-toc { position: sticky; top: 84px; max-height: calc(100vh - 108px); overflow-y: auto; padding-right: 4px; }
.guide-toc ol, .guide-toc-m ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.guide-toc a, .guide-toc-m a {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 8px; border-left: 3px solid transparent;
  color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.3;
}
.guide-toc a:hover, .guide-toc-m a:hover { background: var(--hold-soft); color: var(--ink); }
.guide-toc a.active { background: var(--accent-soft); border-left-color: var(--accent-text); color: var(--accent-text); font-weight: 700; }
.toc-num { flex: none; min-width: 1.4em; font: 700 14px/1 var(--display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.guide-toc a.active .toc-num { color: var(--accent-text); }
.guide-toc-m { display: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); }
.guide-toc-m summary { cursor: pointer; padding: 12px 16px; min-height: 44px; font-weight: 700; color: var(--ink); list-style-position: inside; }
.guide-toc-m ol { padding: 0 8px 10px; }
@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { display: none; }
  .guide-toc-m { display: block; }
}

.guide-section, .guide-intro { padding: 26px 30px 28px; }
.guide-section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.guide-num { flex: none; font: 700 clamp(44px, 7vw, 64px)/0.9 var(--display); color: var(--accent-text); font-variant-numeric: lining-nums tabular-nums; }
.guide-section-head h2 { margin: 0; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.15; scroll-margin-top: 128px; }
.guide-body { font-size: 17px; line-height: 1.65; color: var(--ink); }
.guide-body > p, .guide-body > ul, .guide-body > ol, .guide-body > h3 { max-width: 70ch; }
.guide-body p { margin: 0 0 14px; }
.guide-body strong { font-weight: 700; color: var(--ink); }
.guide-body h3 { font-size: 1.2rem; margin: 28px 0 8px; scroll-margin-top: 128px; }
.guide-body h3::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--accent-text); margin-bottom: 10px; }
.guide-body ul, .guide-body ol { margin: 0 0 16px; padding-left: 1.35em; }
.guide-body li { margin: 0 0 6px; padding-left: 4px; }
.guide-body li::marker { color: var(--accent-text); font-weight: 700; }
.guide-body li > p { margin: 0; }
.guide-body a { text-underline-offset: 2px; }
.guide-body code {
  font: 0.88em var(--mono); background: var(--hold-soft); color: var(--ink); padding: 1px 6px; border-radius: 6px;
  overflow-wrap: anywhere;
}
.guide-body .table-wrap { margin: 6px 0 20px; border: 1px solid var(--line); border-radius: 10px; }
.guide-body table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.guide-body table.wide { min-width: 36rem; }
.guide-body th, .guide-body td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.guide-body thead th { background: var(--paper); color: var(--ink-2); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.guide-body tbody tr:last-child td { border-bottom: 0; }
.guide-body tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 55%, var(--card)); }
.guide-body tbody td:first-child { font-weight: 600; }
.guide-body blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 4px solid var(--hold); background: var(--hold-soft); border-radius: 0 10px 10px 0; max-width: 70ch; }
.guide-body blockquote > :last-child { margin-bottom: 0; }
.guide-body p.callout { padding: 12px 16px; border-left: 4px solid var(--accent-text); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.guide-body p.callout-note { border-left-color: var(--hold); background: var(--hold-soft); }
.guide-body p.callout-important { border-left-color: var(--warn); background: var(--warn-soft); }
@media (max-width: 520px) {
  .guide-section, .guide-intro { padding: 20px 18px 22px; }
  .guide-section-head { gap: 12px; }
  .guide-body { font-size: 16.5px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.help-link { font-size: 14px; }
.hero .help-link { margin: 0 0 14px; }
.guide-body .callout a, .guide-body blockquote a { color: var(--accent-text); }
