/* Readiness Application Assistant demo — standalone page styles.
   Forked from meals-demo.css (2026-09-17), then reworked 2026-09-19 to
   follow crb-demo-style-guide.md (pacing model: streaming, proceed gates,
   trace label, wait block).

   COLOUR MODEL — read before changing any colour in this file.

   Brand is GREEN (reverted from a brief purple experiment, 2026-09-18).
   The purple is gone but the --accent indirection it introduced is kept
   on purpose: it separates "brand chrome" from "semantic status", which
   is the rule the Janus CFI style guide states as *semantic colour is for
   status only*. Swapping the brand again is now a two-line change here
   rather than an edit to every rule.

   1. CHROME = --accent (brand green). Panel frame, composer ring, tool
      chip, send button, links, section headings, Proceed button, trace
      dot, streaming caret. The CRB guide specifies amber for this role;
      this family of demos uses green.
   2. STATUS = semantic, and ONLY on status indicators. Red missing,
      amber partial, green met/cleared, grey not-applicable. Per the
      Janus CFI guide these colours must not be used decoratively
      elsewhere.

   Note that --accent and --green resolve to the same hex today. That is
   deliberate, not redundant: they mean different things, and a future
   brand change should move --accent alone. Never collapse them. */

:root {
  /* Brand / chrome */
  --accent: #3DBE5C;
  --accent-dark: #2fa04c;
  --accent-light: #E8F8ED;
  --accent-soft: #bfe9cb;

  /* Semantic status — success/"met"/"cleared". NOT chrome. */
  --green: #3DBE5C;
  --green-dark: #2fa04c;
  --green-light: #E8F8ED;
  --green-soft: #bfe9cb;

  /* Semantic status — "partial"/"not checkable here". The colour model at
     the top of this file already named amber for this role; these are the
     tokens for it. --amber-dark is the text-safe shade: raw --amber on
     white fails contrast at body sizes, so borders and tiles use --amber
     and anything with type on it uses --amber-dark.

     --amber-dark was #8A5D07 briefly and read as BROWN, not amber
     (Oliver, 2026-09-19). That came from chasing contrast too far: a
     saturated amber bright enough to look amber (#D97706, #C77700) only
     scores ~3.2-3.5 against white and fails AA for normal text. #B45309
     is the balance point — 5.02 against white, so it passes AA at body
     size, while staying an orange-amber rather than a brown. Do not
     darken it further to buy contrast; pick a larger/bolder type size
     instead. */
  --amber: #E0A93B;
  --amber-dark: #B45309;
  --amber-light: #FDF4E3;

  /* Neutral scale — the Janus CFI guide's "neutral grey hierarchy drives
     layout": borders, dividers, backgrounds and section labels come from
     here, never from a brand or status colour. */
  --near-black: #1A1A1A;
  --mid-grey: #555555;
  --light-grey: #CCCCCC;
  --white: #FFFFFF;
  --off-white: #F5F5F5;
  --border: #CCCCCC;

  /* Status pill container — ALWAYS this grey, never a tinted background.
     Janus CFI guide: "Never use a coloured background on a status pill."
     The dot and the label text carry the status colour instead. */
  --pill-bg: #f3f4f6;

  --tool-border: var(--accent);
  --tool-border-soft: var(--accent-soft);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', 'Calibri', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--near-black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }
.green { color: var(--accent); }

.inner { max-width: 1340px; margin: 0 auto; }

/* Outlined, not filled (Oliver, 2026-10-26) — white background, green
   border + text, no solid fill. Site-wide: every primary CTA (Send, Pay
   Now, Upload draft, Accept & Next, etc.) uses this one class. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 19px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  background: var(--white);
  color: var(--accent);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { background: var(--green-light); border-color: var(--accent-dark); color: var(--accent-dark); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Tool panel
   -------------------------------------------------------------------------- */

.tool-section {
  padding: 16px 0 0;
  background: var(--off-white);
}

.tool-layout {
  --frame-h: min(918px, calc(100vh - 112px));
  /* Frame width UNCHANGED from the two-column layout (Oliver, 2026-09-21
     correction) — removing the 260px side panel must not let .tool-panel
     stretch to fill the freed space. 1340px (.inner's max-width) minus
     the old 260px column and 20px gap = the panel's original width.
     margin: 0 auto — missed the first time, which left the capped-width
     frame flush against .inner's left edge instead of centered. */
  max-width: 1060px;
  margin: 0 auto;
}

.tool-panel {
  display: flex;
  flex-direction: column;
  height: var(--frame-h);
  min-height: 520px;
  border: 2px solid var(--tool-border);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #EDEDED;
}

.tool-chip {
  /* Transparent bg, medium-grey text (Oliver, 2026-09-22) — was near-black
     to match Start Over; before that, solid green fill/white text; before
     that, an outline chip with green text on white. */
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: .85rem;
  font-weight: 600;
  background: transparent;
  color: #727272;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool-chip-logo {
  display: block;
  border-radius: 50%;
  flex-shrink: 0;
}

.tool-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--white);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tool-cta:hover { background: var(--accent-dark); color: var(--white); }
.tool-cta:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }

.tool-btn {
  font: inherit;
  font-size: .85rem;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--near-black);
  cursor: pointer;
}
.tool-btn:hover { border-color: var(--near-black); }

.tool-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Right widened to match left at 80px (Oliver, 2026-10-28, same-day
     follow-up: "the right margin is too narrow still") — the prior
     asymmetric 40px/80px split still read as too tight on the right.
     Both sides equal now; .tool-header's badge (20px) matches neither. */
  padding: 10px 80px 28px 80px;
  /* Reserves the scrollbar's own track so it renders OUTSIDE the right
     padding rather than inside it (Oliver, 2026-09-21) — without this, a
     visible scrollbar ate into the right padding only, so report content
     (which runs flush to 0 at the table's last column on purpose) looked
     closer to the edge on the right than the left, which was never
     actually true on the left. */
  scrollbar-gutter: stable;
}

@media (max-width: 900px) {
  .tool-panel { height: auto; min-height: 0; }
  .tool-body { overflow-y: visible; }
}

/* --------------------------------------------------------------------------
   Mode switch — Review a draft / Ask a question (Oliver, 2026-09-21)
   -------------------------------------------------------------------------- */

.tool-mode-switch {
  display: flex;
  gap: 6px;
  /* Bottom margin tripled, 10px -> 30px (Oliver, 2026-09-21) — gap to the
     composer's top border below. */
  margin: 0 20px 30px;
}

/* Ask/Review are a real tablist and share one flex row; See a sample sits
   alongside them as a plain action button, not a member of the tablist
   (Oliver, 2026-09-21) — see the comment in index.html. */
.tool-mode-tablist {
  display: flex;
  gap: 6px;
  flex: 2 1 0;
}

.tool-mode-tab {
  flex: 1 1 0;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--mid-grey);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.tool-mode-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Locked while a flow is running (Oliver, 2026-09-22) — see setModesBusy()
   in readiness-demo.js. The active CTA driving the current run stays its
   normal amber-active look (is-active takes priority visually); the other
   two go visibly inert rather than silently swallowing clicks. */
.tool-mode-tab.is-disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* All three tabs share ONE colour treatment (Oliver, 2026-09-21) — was
   colour-coded per mode (slate/amber/green); now every tab uses the same
   slate that "See a sample" already had, active or not. Always white
   fill; a fixed 2px border-width throughout (only opacity/shade would
   ever need to change on .is-active, kept identical here on purpose) so
   there is no 1-2px layout shift when toggling. */
#readiness-mode-sample,
#readiness-mode-ask,
#readiness-mode-review {
  border-color: #B7C0C9;
  color: #3A4A5B;
}
#readiness-mode-sample:hover,
#readiness-mode-ask:hover,
#readiness-mode-review:hover {
  border-color: #3A4A5B;
}

/* Active workflow gets --amber, not the shared slate hover colour
   (Oliver, 2026-09-21): a deliberate one-off exception to this file's
   documented "amber is semantic-status-only" rule (see COLOUR MODEL at
   the top) — approved explicitly rather than introducing a parallel
   --tab-active token, since this IS the one chrome use of amber the CRB
   style guide already calls for (see "CHROME" note above). Stays amber
   until another workflow is chosen; "See a sample" never carries
   .is-active (it loads content rather than persisting as a mode), so it
   always reads as idle slate. */
#readiness-mode-sample.is-active,
#readiness-mode-ask.is-active,
#readiness-mode-review.is-active {
  border-color: var(--amber);
}

/* Once a run is underway, the active CTA's amber border stops carrying
   any information (Oliver, 2026-10-27: "I don't see the value of having
   it remain visually active") — the choice has already been acted on.
   Reverts to the same idle slate as the other two via .tool-layout's
   .is-running (set once in enterRunView(), see readiness-demo.js), rather
   than removing .is-active in JS — setModesBusy() still needs .is-active
   to know which CTA to leave undimmed while the other two lock. Scoped on
   .tool-layout, not .tool-body: the mode-switch tiles are a SIBLING of
   .tool-body (both children of .tool-panel inside .tool-layout), not a
   descendant of it. */
.tool-layout.is-running #readiness-mode-sample.is-active,
.tool-layout.is-running #readiness-mode-ask.is-active,
.tool-layout.is-running #readiness-mode-review.is-active {
  border-color: #B7C0C9;
}

/* --------------------------------------------------------------------------
   Composer
   -------------------------------------------------------------------------- */

.tool-input {
  position: relative;
  margin: 0 20px 8px;
  /* -15% on min-height and vertical padding (Oliver, 2026-09-21):
     72px -> 61px, 8/40px -> 7/34px. 34px bottom padding still clears the
     28-32px action buttons (.tool-input-send/.tool-input-upload), which
     sit at bottom: 8px via .tool-input-actions. */
  padding: 7px 16px 34px;
  min-height: 61px;
  border: 1px solid var(--tool-border-soft);
  border-radius: 8px;
  background: var(--white);
  cursor: text;
}

.tool-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-input-placeholder {
  position: absolute;
  top: 8px;
  left: 16px;
  right: 80px;
  pointer-events: none;
  color: #9A9A9A;
  font-size: .95rem;
  line-height: 1.5;
}

.tool-input-textarea {
  display: block;
  width: 100%;
  max-height: 130px;
  overflow-y: auto;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--near-black);
  background: transparent;
  outline: none;
  resize: none;
}

.tool-input-actions {
  position: absolute;
  right: 14px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Upload control. Was a bare 22px "+" circle, which nobody read as an
   upload affordance even with the banner telling them to upload a draft
   (Oliver, 2026-09-20). Now a labelled button: icon plus the words, in
   the brand green so it reads as the primary action in the composer. */
.tool-input-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  background: var(--white);
  color: var(--accent-dark);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tool-input-upload:hover { background: var(--accent-light); }
.tool-input-upload:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-input-upload svg { display: block; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Upload zone — NEW, no MEALS equivalent. Styled to sit directly below the
   composer, distinct from it rather than trying to force a file picker into
   a plain-text textarea.
   -------------------------------------------------------------------------- */

.upload-zone {
  position: relative;
  margin-top: 10px;
  border: 1.5px dashed var(--light-grey);
  border-radius: 10px;
  background: var(--off-white);
  padding: 20px;
}

.upload-zone-inner {
  text-align: center;
  transition: opacity .15s ease;
}
.upload-zone.is-dragover .upload-zone-inner,
#readiness-dropzone.is-dragover { opacity: .7; }

.upload-zone-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: .95rem;
}

.upload-zone-hint {
  margin: 0 0 14px;
  font-size: .82rem;
  color: var(--mid-grey);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.upload-zone-browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  background: var(--white);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
}
.upload-zone-browse:hover { background: var(--accent-light); }

.upload-zone-filename {
  margin: 10px 0 0;
  font-size: .82rem;
  color: var(--mid-grey);
}

.upload-zone-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--mid-grey);
  cursor: pointer;
  padding: 4px;
}
.upload-zone-close:hover { color: var(--near-black); }

/* --------------------------------------------------------------------------
   Review report rendering — NEW, no MEALS equivalent.

   Design direction: stat-card summary (Oliver, 2026-09-19, rebuilt from a
   reference screenshot of a Janus funding-gap dashboard — that file isn't
   on this machine, so this is matched by eye, not ported). The rules that
   make it work, in order of importance:

     1. RED IS USED ONCE. Exactly one stat card is the alert; the others
        stay near-black on white. An earlier version coloured all four
        states pastel, which made none of them read as a verdict.
     2. The FINDING outranks the REQUIREMENT. The verbatim requirement
        quote sits behind a <details> toggle, so what's wrong with the
        user's document is the loud thing — not what GCF asked for. The
        previous design inverted this and buried the finding under a
        decorated citation card.
     3. No boxes for findings. Hairline rows with a thin status rail, so
        22 findings don't read as 22 competing cards.

   TYPE SCALE IS INHERITED FROM THE WELCOME BANNER (.tool-welcome), per
   Oliver 2026-09-19 — do not introduce a separate scale here. Concretely:
   body copy .95rem, section headings .95rem/700/green (mirrors
   .tool-welcome h3), the report title 2rem (mirrors .tool-welcome h2),
   line-height inherited from body (1.6). Inter only — an earlier version
   pulled in Source Serif 4 and IBM Plex Mono, which is why it read as a
   different product than the rest of the page.
   -------------------------------------------------------------------------- */

/* No cap (Oliver, 2026-10-27: "plenty of real estate to the right of the
   ... column, restore the requirement column to its original size") — the
   720px cap here, not .stage-panel's (removed the same day), was the
   actual bottleneck squeezing the two-column table. The report now fills
   .tool-body's full available width (~1016px at .tool-layout's 1060px
   cap). */
.review-report { max-width: none; }

/* MEASURE — the ch-based ceilings this section used to describe
   (background prose/source note at 71ch, evidence block at 67ch) are
   GONE (Oliver, 2026-10-27, same day, on seeing the background prose
   still capped after the change above: "text being concentrated /
   compressed to the left side of the frame ... unacceptable" — the
   line-length-readability argument that justified them lost to this
   twice-repeated, explicit instruction). .review-bg-para,
   .review-bg-source and .review-evidence below no longer set max-width
   at all; they fill whatever width .review-report gives them, same as
   the table already did. */

/* ---- Background ----
   Descriptive context about the requesting entity, shown before any
   assessment. Deliberately quiet: no status colour, no cards, nothing
   that could be mistaken for a finding. Ends with a rule that separates
   "here is who is asking" from "here is what we found".

   The run opens directly on this prose (Oliver, 2026-09-18) — no heading,
   no facts strip, no title line above it. The old .review-bg-facts /
   .review-bg-title rules were removed with the markup they styled; the
   figures they showed are already stated in the narrative itself. */

.review-background { margin: 0 0 6px; }

.review-bg-para {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--near-black);
  margin: 0 0 12px;
}
.review-bg-para em { color: var(--mid-grey); font-style: italic; }

.review-bg-source {
  font-size: .88rem;
  color: var(--mid-grey);
  margin: 16px 0 0;
  padding: 0 0 26px;
  border-bottom: 1px solid #E4E4E7;
}

/* Title mirrors .tool-welcome h2 (2rem) but left-aligned — it's a report
   header, not a centred hero. The background section precedes it, so it
   needs top margin when it isn't the first thing in the report. */
.review-background + .review-title { margin-top: 26px; }

.review-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: 0 0 8px;
  /* Medium grey, not black (Oliver, 2026-10-26) — applies to headers and
     subheaders throughout, same rule as .fix-workflow-req. */
  color: var(--mid-grey);
}

.review-meta {
  margin: 0 0 4px;
  font-size: .95rem;
  color: var(--mid-grey);
}

/* ---- Stat cards ---- */

.review-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 20px;
}

.review-stat {
  /* 2px, doubled from 1px (Oliver, 2026-09-21). Width only, set once here
     so it applies to all three status variants below, which only ever
     override border-color, never border-width. */
  border: 2px solid #E4E4E7;
  border-radius: 8px;
  background: var(--white);
  padding: 20px 22px 18px;
  min-width: 0;
}

.review-stat-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-stat-tile {
  flex: 0 0 auto;
  /* White tile, +15% (Oliver, 2026-09-20). The tinted fills are gone; the
     icon's own colour carries the status now, matching the number and
     label beside it. */
  width: 39px;
  height: 39px;
  border-radius: 8px;
  background: var(--white);
  color: var(--near-black);
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-stat-tile svg { width: 22px; height: 22px; display: block; }

.review-stat-n {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
}

.review-stat-label {
  font-size: .95rem;
  font-weight: 700;
  margin: 14px 0 0;
}

.review-stat-hint {
  font-size: .88rem;
  color: var(--mid-grey);
  margin: 5px 0 0;
  line-height: 1.45;
}

/* The three stat cards each carry their own status colour (Oliver,
   2026-09-19): green = met, red = needs attention, amber = not checkable.
   Same structure in all three variants so they read as one set. */

/* The single alert card. Nothing else on the page may use these reds. */
.review-stat.is-alert { border-color: #E8B4AE; }
.review-stat.is-alert .review-stat-tile { color: #C0362B; }
.review-stat.is-alert .review-stat-n,
.review-stat.is-alert .review-stat-label { color: #C0362B; }
.review-stat.is-alert .review-stat-hint { color: #A32A20; }

.review-stat.is-met { border-color: var(--green-soft); }
.review-stat.is-met .review-stat-tile { color: var(--green-dark); }
.review-stat.is-met .review-stat-n,
.review-stat.is-met .review-stat-label { color: var(--green-dark); }
.review-stat.is-met .review-stat-hint { color: var(--green-dark); }

.review-stat.is-uncheckable { border-color: var(--amber); }
.review-stat.is-uncheckable .review-stat-tile { color: var(--amber-dark); }
.review-stat.is-uncheckable .review-stat-n,
.review-stat.is-uncheckable .review-stat-label { color: var(--amber-dark); }
.review-stat.is-uncheckable .review-stat-hint { color: var(--amber-dark); }

.review-footline {
  font-size: .88rem;
  color: var(--mid-grey);
  line-height: 1.55;
  margin: 0;
  padding: 13px 16px;
  background: #FAFAFA;
  border: 1px solid #F0F0F1;
  border-radius: 8px;
}
.review-footline strong { color: var(--near-black); font-weight: 700; }

/* "Show why" disclosure (Oliver, 2026-10-27: "the system never says why
   this did not apply") — same visual language as .review-req-toggle /
   .review-req-box, so this reads as the same kind of disclosure rather
   than a new pattern. */
.review-footline-toggle {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: var(--amber-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.review-footline-toggle::after { content: '▾'; font-size: .6rem; }
.review-footline-toggle[aria-expanded="true"]::after { content: '▴'; }
.review-footline-toggle:hover { text-decoration: underline; }

.review-footline-detail {
  margin: 10px 0 0;
  padding: 13px 15px;
  background: #FAFAFA;
  border: 1px solid #F0F0F1;
  border-radius: 8px;
}
.review-footline-detail p {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--mid-grey);
  margin: 0 0 10px;
}
.review-footline-detail p:last-child { margin-bottom: 0; }
.review-footline-detail p strong { color: var(--near-black); display: block; margin-bottom: 2px; }

/* ---- Section headings: mirror .tool-welcome h3 exactly ----
   Specificity note: the report renders INSIDE .stage-output, and
   `.stage-output h3 { font-size: 1.3rem }` appears later in this file at
   equal specificity (0-1-1) — so a plain `.review-report h3` loses the
   cascade and the headings render at 1.3rem. Doubling the class
   (.review-report.review-report) lifts this to 0-2-1 without reordering
   the file, which would be fragile against future edits down there. */

.review-report.review-report h3 {
  color: var(--accent);
  font-size: .95rem;
  font-weight: 700;
  margin: 30px 0 2px;
  padding-top: 20px;
  border-top: 1px solid #E4E4E7;
}

/* Per-status heading colour (Oliver, 2026-09-19). Doubled class to match
   the specificity of the base rule above.

   No section heading may be green except the cleared list — green reads as
   "fine", and a heading over five unmet requirements must not read as
   fine. Red for the two that are genuinely unresolved, amber for the two
   that are qualified.

   This is deliberately NOT the same mapping as the stat cards, where "Not
   checkable here" is amber: the card summarises a count, the section heads
   the items themselves. */
.review-report.review-report h3.status-missing,
.review-report.review-report h3.status-not_assessable { color: #C0362B; }
.review-report.review-report h3.status-partial,
.review-report.review-report h3.status-not_applicable { color: var(--amber-dark); }
.review-report.review-report h3.status-met { color: var(--green-dark); }
/* Unassessed = the check did not finish for these items. Neutral grey, not
   red: it is not a finding about the document, and must not read as a gap. */
.review-report.review-report h3.status-unassessed { color: var(--mid-grey); }

/* Partial-report warning above the verdict (see buildIncompleteWarningHtml
   in readiness-demo.js). Amber: a qualification on everything below it. */
.review-incomplete-warning {
  margin: 12px 0 16px;
  padding: 13px 16px;
  border-left: 4px solid var(--amber);
  background: var(--amber-light);
  border-radius: 0 8px 8px 0;
}
.review-incomplete-warning p { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--near-black); }
.review-incomplete-warning strong { color: var(--amber-dark); }
.review-section-hint {
  font-size: .88rem;
  color: var(--mid-grey);
  margin: 0 0 12px;
}

/* ---- Findings table ----
   One table per status (Oliver, 2026-09-19). Two columns: the requirement
   (name + expanded source ref beneath it) and what the check found. The
   source ref sits under the name rather than in a third column because it
   is an attribute of the requirement, not a peer fact — and the real refs
   vary too much in length ("§2.4" vs "§Proposal Details") for a narrow
   fixed column to hold them cleanly. */

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  margin: 0 0 6px;
  table-layout: fixed;   /* keeps the two columns stable as rows stream in */
}

.review-table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #A1A1AA;
  padding: 0 14px 8px 0;
  border-bottom: 1px solid #E4E4E7;
}
/* Last column no longer zeroes its own right padding (Oliver, 2026-09-21)
   — that, combined with a scrollbar rendering inside .tool-body's right
   padding on some browsers, made report content look flush against the
   right edge while the left side kept its full margin. 14px matches the
   gap already used between the two columns, so both sides of the table
   now breathe by the same amount. */
/* Restored to its original 34% (Oliver, 2026-10-27: widening "found" at
   this column's expense compressed the requirement labels — that wasn't
   the fix. The real unused space was .stage-panel's own max-width leaving
   room to the right of the whole table; see .stage-panel below. */
.review-col-req { width: 34%; }

.review-table td {
  padding: 14px 14px 14px 0;
  border-bottom: 1px solid #F1F1F3;
  vertical-align: top;
  overflow-wrap: break-word;   /* long requirement names must not blow the column */
}
.review-table tbody tr:last-child td { border-bottom: none; }

/* The requirement-quote row sits directly under its finding, so the
   finding's own bottom border would read as a separator between a row and
   its own disclosure. Suppress it while the quote is open. */
.review-finding:has(+ .review-req-row:not([hidden])) td { border-bottom: none; }

.review-finding-req {
  font-size: .95rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  /* Medium grey, not black (Oliver, 2026-10-26) — same rule as
     .fix-workflow-req / .review-title. */
  color: var(--mid-grey);
}
.review-finding-ref {
  display: block;
  margin-top: 4px;
  font-size: .8rem;
  font-weight: 400;
  color: #A1A1AA;
  line-height: 1.4;
}

.review-cell-found > p {
  font-size: .95rem;
  color: var(--near-black);
  margin: 0;
  line-height: 1.55;
}

/* The applicant's own words, pulled out so they can see what the tool read. */
.review-evidence {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--near-black);
  margin: 11px 0 0;
  padding: 9px 13px;
  background: #FAFAFA;
  border-left: 2px solid var(--green);
  border-radius: 0 6px 6px 0;
  display: inline-block;
}
.review-evidence b {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #A1A1AA;
  margin-bottom: 3px;
}

/* Requirement quote — collapsed by default. Now a <button> toggling a
   second <tr>, rather than a <details>, so the disclosure can span the
   full table width instead of being trapped in one cell. */
.review-req-toggle {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.review-req-toggle::after { content: '▾'; font-size: .6rem; }
.review-req-toggle[aria-expanded="true"]::after { content: '▴'; }
.review-req-toggle:hover { text-decoration: underline; }

/* The toggle takes its row's status colour, matching the section heading
   above it. Keyed off the parent <tr>'s existing status-* class, so no
   extra class is needed on the button itself. */
.review-finding.status-missing .review-req-toggle,
.review-finding.status-not_assessable .review-req-toggle { color: #C0362B; }
.review-finding.status-partial .review-req-toggle,
.review-finding.status-not_applicable .review-req-toggle { color: var(--amber-dark); }

.review-req-row > td { padding-top: 0; }

.review-req-box {
  margin: 0 0 14px;
  padding: 13px 15px;
  background: #FAFAFA;
  border: 1px solid #F0F0F1;
  border-radius: 8px;
}
.review-req-box .review-req-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #A1A1AA;
  margin-bottom: 6px;
}
.review-req-box p {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--mid-grey);
  margin: 0;
  max-width: none;
}
.review-req-box .review-req-source {
  display: block;
  font-size: .8rem;
  color: #A1A1AA;
  margin-top: 8px;
}

/* ---- Cleared list ----
   Hidden behind a button by default: these are reassurance, not action,
   and 45 of them listed under the gaps buries what the visitor came for.
   The count is stated in the line above the button regardless, so nobody
   wonders whether they were actually checked. */

.review-cleared {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid #E4E4E7;
}
.review-cleared-line {
  margin: 0 0 12px;
  font-size: .95rem;
  color: var(--mid-grey);
}
.review-cleared-line strong { color: var(--near-black); font-weight: 700; }

/* Link, not a button. This reveals items the copy just described as
   "nothing to act on", so a primary button gave it more visual weight
   than the content deserves. Still a <button> element for the
   aria-expanded toggle semantics — only the styling is link-like. */
.review-cleared-toggle {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .95rem;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.review-cleared-toggle:hover { color: var(--near-black); }
.review-cleared-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.review-met-list { margin: 14px 0 0; line-height: 2; }
.review-met-list code {
  font-family: inherit;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  display: inline-block;
  margin: 0 5px 5px 0;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .review-stats { grid-template-columns: minmax(0, 1fr); }
  .review-title { font-size: 1.6rem; }
}

/* Progressive-by-section streaming (Oliver, 2026-09-19): each status
   section and its findings fade/slide in as the report "generates" —
   not word-by-word typing (too slow for structured, many-item content;
   see readiness-demo.js's streamReport() for the pacing rationale). */
/* .review-background animates as ONE unit (it's appended in a single
   stream step), so its children are deliberately excluded below —
   animating both container and children double-fades them. */
.review-background,
/* .review-finding is deliberately NOT in this list any more: it's a <tr>
   since the table rewrite, and transform on a table row is unreliable
   across engines. Rows get their sense of arrival from the prose typing
   itself into them instead, which is the stronger signal anyway. */
.review-report h3,
.review-section-hint,
.review-table,
.review-cleared,
.review-met-list,
.review-stats,
.review-footline,
.review-title,
.review-meta {
  opacity: 0;
  transform: translateY(6px);
  animation: review-fade-in .35s ease forwards;
}
/* The background block animates as one unit, so its children must not
   also animate (double-fade). It has no h3 any more — the run opens
   straight on the prose — but any child is excluded here regardless. */
.review-background > * {
  opacity: 1;
  transform: none;
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .review-background,
  .review-report h3,
  .review-section-hint,
  .review-table,
  .review-cleared,
  .review-met-list,
  .review-stats,
  .review-footline,
  .review-title,
  .review-meta {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
@keyframes review-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Pacing components — per crb-demo-style-guide.md §8/§9/§10/§12.

   The guide's thesis: content never dumps. Each digestible chunk ends with
   a gate, and the user sets the pace. Amber in the guide maps to our
   purple --accent (see the colour note at the top of this file).
   -------------------------------------------------------------------------- */

/* §8 Proceed gate */
.thread-proceed { margin-top: 18px; }
.thread-proceed p { margin: 0 0 14px; color: var(--mid-grey); }
/* Two-button row only appears when a gate also offers a skip (Oliver,
   2026-09-21) — Proceed + Skip this step, both .btn-primary, same size. */
.thread-proceed-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* §9 Trace label — pulsing dot + short "what the tool is doing now" line.
   The dot is the accent colour at every stage; only the label text changes. */
.trace {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  font-size: .85rem;
  color: var(--mid-grey);
}
.trace::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: crb-pulse 1.2s ease-in-out infinite;
}
@keyframes crb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}
/* Guide §9: on reduced motion, show the dot without the animation. */
@media (prefers-reduced-motion: reduce) {
  .trace::before { animation: none; }
}

/* §10 Wait block — shown between hitting Proceed and the first content
   arriving. Removed as soon as content starts (never left alongside it). */
.thread-wait { margin-top: 16px; color: var(--mid-grey); }
.thread-wait p { margin: 0; }

/* §12 Closing callout — wraps up the run and prompts the next action.
   Mint-green fill (Oliver, 2026-10-26: "doesn't pop out enough, use mint
   green for the background") — supersedes the earlier plain-white
   "Option B" choice from 2026-09-21; matches .fix-paywall's background so
   the free and paid CTAs read as one consistent system. */
.stage-closing {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--green-light);
  /* Amber border (Oliver, 2026-10-26) — matches the email/timeframe
     fields inside it, same yellow used for the "needs clarification"
     state in the fix workflow. */
  border: 1px solid #EAB308;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  font-size: .92rem;
}
.stage-closing p { margin: 0 0 9px; }
.stage-closing p:last-child { margin-bottom: 0; }
.stage-closing strong { font-weight: 700; }
/* Larger headline (Oliver, 2026-10-26: "the headers font size for both
   cards need to increase") — shared with .fix-paywall-headline so the
   free and paid cards' opening lines read at the same weight. */
.stage-closing-headline,
.fix-paywall-headline {
  font-size: 1.08rem;
}
/* "N needing attention" stays a visible callout — reuses the same
   #C0362B already used for status-missing/status-not_assessable
   elsewhere in this file, rather than inventing a new red. */
.stage-closing .stage-closing-attn { color: #C0362B; }

/* Present in the DOM ONLY so Netlify's build-time crawler registers the
   "readiness-gaps" form (see index.html for why). Never meant to be seen:
   display:none rather than [hidden], because some crawlers skip elements
   hidden via the hidden attribute. */
.netlify-form-detect { display: none; }

/* The real gap-capture form, built into the closing callout per-report
   (Oliver, 2026-09-21). Reuses .crb-form-field/.crb-form-error from the
   contact modal so both forms look identical; only the container and
   submit button are new. */
.gap-form { margin-top: 12px; }
.gap-form p.gap-form-intro { margin: 0 0 10px; }
/* Email + timeframe side by side (Oliver, 2026-10-25) — stacked vertically
   this left most of the card empty; a row cuts that whitespace down
   without losing anything, since neither field needs the full width. */
.gap-form-fieldset { display: flex; flex-direction: row; align-items: flex-start; gap: 16px; }
/* Scoped shrink of the shared .crb-form-field styling (Oliver, 2026-09-21)
   — the contact modal keeps its original spacing; only the gap form, which
   needed to shrink ~30% overall, gets tighter field spacing/padding here. */
.gap-form .crb-form-field { flex: 1 1 240px; margin-bottom: 10px; max-width: 320px; }
@media (max-width: 560px) {
  .gap-form-fieldset { flex-direction: column; gap: 2px; }
  .gap-form .crb-form-field { max-width: none; }
}
.gap-form .crb-form-field label { font-size: .78rem; margin-bottom: 4px; }
.gap-form .crb-form-field input,
.gap-form .crb-form-field select {
  display: block;
  width: 100%;
  padding: 7px 10px;
  font-size: .85rem;
  /* Amber border (Oliver, 2026-10-26), overriding the shared grey
     .crb-form-field border — scoped to this form only, not the contact
     modal, which reuses the same base class. */
  border-color: #EAB308;
}

/* Custom timeframe dropdown (Oliver, 2026-09-21) — replaces the visible
   native <select> so the open-list popup is never OS dark-mode chrome.
   The real <select> (.gap-form-native-select) stays in the DOM for
   value/validity/Netlify-detection but is visually hidden. */
.gap-form-timeframe-field { position: relative; }
.gap-form-native-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.gap-form-timeframe-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font: inherit;
  font-size: .85rem;
  text-align: left;
  color: var(--near-black);
  background: var(--white);
  /* Amber, matching the email field (Oliver, 2026-10-26). */
  border: 1px solid #EAB308;
  border-radius: 6px;
  cursor: pointer;
}
.gap-form-timeframe-btn:focus-visible,
.gap-form-timeframe-btn[aria-expanded="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 190, 92, .12);
}
.gap-form-timeframe-btn svg { flex: none; color: var(--mid-grey); }
.gap-form-timeframe-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--white);
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
  max-height: 200px;
  overflow-y: auto;
}
.gap-form-timeframe-list li {
  padding: 7px 9px;
  font-size: .85rem;
  color: var(--near-black);
  border-radius: 4px;
  cursor: pointer;
}
.gap-form-timeframe-list li:hover,
.gap-form-timeframe-list li[aria-selected="true"] {
  background: var(--accent-light);
}
.gap-form-submit {
  margin-top: 4px;
}
.gap-form-done {
  margin: 0;
}
/* Confirmation headline — bold/green, same treatment the single-line
   version always had. Scoped to the first line only now that the block
   also contains the inline Print/Save button and a plain follow-up
   sentence, neither of which should inherit this styling (Oliver,
   2026-10-21 — moved the button inline, see wireGapForm()). */
.gap-form-done p:first-child {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--accent-dark);
}
.gap-form-done .btn-primary {
  margin-bottom: 12px;
}
.gap-form-done p:last-child {
  margin: 0;
  color: var(--mid-grey);
  font-size: .9rem;
}

/* Paid fix layer (Oliver, 2026-10-22 design session). Mint-on-white —
   swapped with .stage-closing (2026-10-22 feedback pass) so the paid
   $499.99 tile is the one that catches the eye, not the free box above it. */
.fix-paywall {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--green-light);
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: .92rem;
  /* Content column + logo sidebar (Oliver, 2026-10-27, approved from
     design-mockups/paywall-logo-placement.html) — flex keeps the logo
     vertically centered regardless of how tall the content column gets
     across the card's different states (pre-payment, mid-payment,
     generating). */
  display: flex;
  align-items: center;
  gap: 24px;
}
.fix-paywall-content { flex: 1 1 auto; min-width: 0; }
.fix-paywall-content p { margin: 0 0 10px; }
.fix-paywall-content p:last-of-type { margin-bottom: 12px; }
/* The logo's own PNG is transparent outside the green circle (verified
   byte-for-byte before building the mockup), so no background is needed
   here — the card's mint-green already shows straight through. */
.fix-paywall-logo {
  flex: 0 0 auto;
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fix-paywall-logo img {
  width: 110px;
  height: 110px;
  display: block;
}
@media (max-width: 760px) {
  .fix-paywall { flex-direction: column; }
  .fix-paywall-logo { width: auto; order: -1; }
}
.fix-checkout-mount { margin: 4px 0 14px; max-width: 420px; }
.fix-checkout-error { color: #C0362B; font-size: .85rem; }
.fix-paywall-email-label {
  display: block;
  margin: 2px 0 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--mid-grey);
}
.fix-paywall-email {
  display: block;
  width: 100%;
  max-width: 320px;
  padding: 9px 12px;
  margin-bottom: 12px;
  font: inherit;
  font-size: .9rem;
  border: 1.5px solid #EAB308;
  border-radius: 8px;
  background: var(--white);
}
.fix-paywall-email:read-only { background: var(--gray-100, #F3F4F6); color: var(--mid-grey); }
.fix-paywall-note {
  margin: 10px 0 0;
  color: var(--mid-grey);
  font-size: .85rem;
  text-align: center;
}

/* Payment trust &amp; transparency (Oliver, 2026-10-27 — "the payment flow
   comes off as a black box"). Four touchpoints, mocked up in
   design-mockups/payment-trust-options.html and approved per-section:
   1A (trust line above the card fields), 2B (two-line success, line 2
   doing double duty), 3A (fuller "Generating…" explanation), and the
   footnote shown as depicted in both the pre- and post-payment states. */
.fix-paywall-trust {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--mid-grey);
  margin: 0 0 10px !important;
}
.fix-paywall-footnote {
  margin: 10px 0 0 !important;
  font-size: .78rem;
  color: var(--light-grey);
  text-align: center;
}

/* Payment-success card (Option 5, icon + two-line, 2026-10-26 design
   session) — white card-in-card so it reads as its own moment against
   the mint-green paywall background. */
.fix-paywall-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--green-soft);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 10px;
}
.fix-paywall-success-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  margin-top: 1px;
}
.fix-paywall-success-main { font-size: 1.02rem; font-weight: 800; color: var(--near-black); margin: 0 0 2px !important; }
.fix-paywall-success-sub { font-size: .85rem; color: var(--mid-grey); margin: 0 !important; }

/* "Generating…" wait — the actual black box (longest silent stretch, see
   the 2026-10-27 session): surfaces real progress (what's being drafted,
   how many) and the true zero-retention fact (in-memory only, never
   written to disk) instead of a bare timer. */
.fix-paywall-generating-head { font-weight: 600; margin: 0 0 4px !important; }
.fix-paywall-generating-sub { font-size: .85rem; color: var(--mid-grey); margin: 0 !important; }
.fix-paywall-progress-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: fix-paywall-pulse 1.2s infinite ease-in-out;
}
@keyframes fix-paywall-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Fix workflow — dedicated screen (Oliver, 2026-10-25 redesign). Takes
   over .tool-body in place of the scrolling report (see renderFixWorkflow()
   in readiness-demo.js), not appended beneath it. */
.fix-workflow {
  margin-top: 16px;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-radius: 10px;
}
.fix-workflow h3, .fix-workflow h4 { margin: 0 0 10px; }
.fix-workflow p { margin: 0 0 12px; }
.fix-disclaimer {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--green-light);
  border-radius: 8px;
  font-size: .88rem;
}
.fix-workflow-intro p { color: var(--mid-grey); }
/* Matches the semantic colors already used inside each step (Oliver,
   2026-10-27): red for the actionable/gap count, amber for the
   informational count — same red as .fix-workflow-label-gap, same
   text-safe amber as the rest of the product. */
.fix-workflow-intro-actionable { color: #A33A32; }
.fix-workflow-intro-informational { color: var(--amber-dark); }

.fix-workflow-progress {
  margin: 0 0 14px;
  color: var(--mid-grey);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* Headers/subheaders are medium grey, not near-black (Oliver, 2026-10-26)
   — the requirement title and every section label, EXCEPT "The gap",
   which keeps its red as a semantic status indicator rather than a
   generic header. */
.fix-workflow-req { font-size: 1.05rem; color: var(--mid-grey); }
.fix-suggestion-source { font-weight: 400; color: var(--mid-grey); }
.fix-workflow-label {
  margin: 0 0 4px;
  color: var(--mid-grey);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fix-workflow-label-gap { color: #A33A32; }
.fix-workflow-gap {
  padding: 10px 12px;
  background: #FDF2F1;
  border: 1px solid #F3B4B4;
  border-radius: 6px;
  margin-bottom: 14px;
  /* Black body text (Oliver, 2026-10-27) — red-on-pink read as a system
     error notification rather than part of the workflow. The red border
     + "THE GAP" label (.fix-workflow-label-gap) already carry the
     semantic, so the text itself doesn't need to repeat it. */
  color: var(--near-black);
}
/* Rationale now lives inside the gap box as a second paragraph, not a
   disconnected sentence at the bottom of the card (Oliver, 2026-10-26) —
   see renderStep()'s gapParas. */
.fix-workflow-gap p { margin: 0 0 8px; }
.fix-workflow-gap p:last-child { margin-bottom: 0; }
.fix-workflow-fix-box {
  position: relative;
  padding: 10px 84px 10px 12px;
  background: #F7F7F8;
  border-radius: 6px;
  margin-bottom: 6px;
}
.fix-workflow-fix-text { margin: 0; white-space: pre-wrap; }
.fix-workflow-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: .78rem;
}
.fix-workflow-actions { display: flex; gap: 10px; margin: 0; flex-wrap: wrap; }
.fix-workflow-done .fix-disclaimer { margin-top: 4px; }

/* needs_clarification step — yellow border, not the gap's red or the
   action box's green, since this is neither a problem nor an instruction;
   it's a question waiting on the applicant. Grey fill + black text
   (Oliver, 2026-10-26) matches the action box's treatment exactly except
   for the border color, so the two "needs you" states read as one
   consistent system. */
.fix-workflow-question {
  padding: 10px 12px;
  background: #F7F7F8;
  border: 1px solid #EAB308;
  border-radius: 6px;
  margin-bottom: 10px;
  /* Not bold (Oliver, 2026-10-27: "no need for any of the callout box
     text to be bolded") — reverted from the 2026-10-26 treatment. */
  color: var(--near-black);
}
.fix-workflow-answer-input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  font: inherit;
  font-size: .9rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  resize: vertical;
}
.fix-workflow-answer-error { margin: 0 0 10px; color: #C0362B; font-size: .85rem; }

/* external_action step — action_guidance is the headline, not a drafted
   box, since there is no text to copy for the primary fix here. Green
   border (Oliver, 2026-10-26) marks it as the thing to actually go do,
   distinct from the question's yellow and the gap's red. */
.fix-workflow-action {
  padding: 10px 12px;
  background: #F7F7F8;
  border: 1px solid var(--accent);
  border-radius: 6px;
  margin-bottom: 14px;
  color: var(--near-black);
}

/* not_applicable / not_assessable step — neutral grey border, deliberately
   distinct from the gap's red, the question's amber, and the action's
   green (Oliver, 2026-10-26): nothing is wrong and nothing is asked of the
   applicant here, it's purely informational ("here's why no drafting is
   needed"), so it shouldn't borrow a semantic color that implies otherwise. */
.fix-workflow-note {
  padding: 10px 12px;
  background: #F7F7F8;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  margin-bottom: 14px;
  color: var(--mid-grey);
}

/* Optional secondary language, collapsed behind a disclosure (Oliver,
   2026-10-26) rather than shown as its own labeled box — the external_
   action's real fix is action_guidance above; this is supplementary, so
   it shouldn't visually compete for attention unless the applicant opens
   it. max-height could animate this open/closed, but <details>'s native
   toggle is enough here — no other disclosure exists yet in this file to
   match against. */
.fix-workflow-optional {
  margin-bottom: 6px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  overflow: hidden;
}
.fix-workflow-optional summary {
  cursor: pointer;
  padding: 9px 12px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--mid-grey);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
.fix-workflow-optional summary::-webkit-details-marker { display: none; }
.fix-workflow-optional-inner {
  position: relative;
  padding: 2px 84px 12px 12px;
  color: var(--mid-grey);
}
.fix-workflow-optional-inner .fix-workflow-copy { top: 2px; }

.tool-input-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
}
.tool-input-send:disabled { background: var(--accent-soft); cursor: default; }
.tool-input-send:not(:disabled):hover { background: var(--accent-dark); }

.tool-input.is-live {
  border-color: var(--tool-border);
  box-shadow: 0 0 0 3px rgba(61, 190, 92, .18);
}

/* --------------------------------------------------------------------------
   Streamed welcome
   -------------------------------------------------------------------------- */

.tool-welcome {
  max-width: 640px;
  margin: 0 auto;
  font-size: .95rem;
}

.tool-welcome p { margin: 0 0 14px; }
.tool-welcome p:last-child { margin-bottom: 0; }

.tool-welcome .welcome-kicker {
  text-align: center;
  color: var(--mid-grey);
  margin-bottom: 2px;
}

.tool-welcome h2 {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 10px;
  color: #727272;
}
.tool-welcome h2 .green { color: var(--accent); }

.tool-welcome .welcome-tagline {
  text-align: center;
  font-style: italic;
  color: var(--mid-grey);
  margin: 0 0 28px;
}

.tool-welcome h3 {
  color: #727272;
  font-size: .95rem;
  font-weight: 700;
  margin: 20px 0 8px;
}

.tool-welcome ul { padding-left: 20px; margin: 0 0 14px; }
/* line-height matches .tool-welcome p's inherited 1.6 (Oliver, 2026-09-21;
   previously 1.4, which is what actually caused the "inconsistent spacing"
   reported here — a wrapped bullet visibly denser than the paragraph text
   immediately above and below it in the same reading flow, not a margin
   problem). margin-bottom still separates one bullet from the next. */
.tool-welcome li { margin-bottom: 8px; line-height: 1.6; }

.tool-welcome.is-streaming::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: meals-caret 1s steps(1) infinite;
}
@keyframes meals-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.welcome-skip {
  display: block;
  margin: 18px auto 0;
  font: inherit;
  font-size: .85rem;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--mid-grey);
  cursor: pointer;
}
.welcome-skip:hover { border-color: var(--near-black); color: var(--near-black); }

/* --------------------------------------------------------------------------
   Chat thread
   -------------------------------------------------------------------------- */

.tool-body.is-running .tool-col-main { display: none; }
.tool-body.is-running { padding-top: 20px; }

.chat-bubble-user {
  background: #f7f7f7;
  border-radius: 6px;
  padding: 12px 20px;
  margin-bottom: 18px;
}
.chat-bubble-user.is-short { padding: 8px 16px; }

.chat-bubble-label {
  margin: 0 0 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mid-grey);
}

.chat-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: .9rem;
  line-height: 1.55;
  color: #2e2e2e;
}

.stage-panel {
  /* Left-aligned, not centered (Oliver, 2026-10-25) — "auto" right/left
     margins centered this column inside .tool-body, which pushed report
     content and the stat cards well to the right of the "Readiness
     Application Assistant" badge in the header above it. The 820px cap
     itself is gone (Oliver, 2026-10-27: "plenty of real estate to the
     right of the ... column") — report content now uses the full width
     .tool-body actually has available, same as .fix-workflow already did. */
  margin: 32px 0 0;
}

.stage-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  font-size: .85rem;
  color: var(--mid-grey);
}
.stage-status::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--tool-border);
  animation: meals-pulse 1.2s ease-in-out infinite;
}
@keyframes meals-pulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}
@media (prefers-reduced-motion: reduce) {
  .stage-status::before,
  .tool-welcome.is-streaming::after { animation: none; }
  .prompt-card:hover:not(:disabled) { transform: none; }
}

.stage-output { margin-top: 0; overflow-wrap: break-word; }
.stage-output h3 { font-size: 1.3rem; margin-top: 30px; }
.stage-output h4 { font-size: 1.02rem; margin-top: 24px; color: var(--accent); }
.stage-output hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.stage-output blockquote {
  margin: 16px 0;
  padding: 8px 18px;
  border-left: 3px solid var(--light-grey);
  color: var(--mid-grey);
}
.stage-output ol,
.stage-output ul { padding-left: 22px; margin: 0 0 12px; }
.stage-output li { margin-bottom: 6px; line-height: 1.55; }

.stage-output .citation-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin: 0 2px;
  border-radius: 999px;
  background: #dadada;
  color: #2e2e2e;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: text-top;
  white-space: nowrap;
}

.thread-text + .thread-text { margin-top: 4px; }

/* General-knowledge fallback label (Oliver, 2026-09-22) — shown instead of
   .answer-sources when the backend's used_general_knowledge flag is true.
   Amber, per this file's documented colour model (amber = "partial"/"not
   checkable here"): this is the same semantic family, an answer the tool
   could not verify against its own corpus. Always visible, never behind a
   <details> toggle — a trust-relevant flag shouldn't be optional to see. */
.answer-general-knowledge {
  margin-top: 14px;
  margin-bottom: 28px;
  padding: 10px 14px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: var(--amber-light);
  color: var(--amber-dark);
  font-size: .88rem;
  line-height: 1.5;
}

/* Answer sources — collapsed by default (a <details> element) so a long
   source list doesn't read as a wall of text under every answer. Each
   source is its own stacked block: project title first (parsed from
   citation_pointer in js/meals-demo.js's splitCitation()), page range and
   raw filename as small secondary lines — never leads with the filename. */
.answer-sources {
  margin-top: 14px;
  margin-bottom: 28px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
  font-size: .95rem;
  color: var(--mid-grey);
}
.answer-sources-label {
  font-weight: 700;
  color: var(--near-black);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.answer-sources-label::-webkit-details-marker { display: none; }
.answer-sources-label::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid var(--mid-grey);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s ease;
  flex: none;
}
.answer-sources[open] .answer-sources-label::before { transform: rotate(90deg); }
.source-count { font-weight: 400; color: var(--mid-grey); }
.answer-sources ul { margin: 10px 0 0; padding: 0; list-style: none; }
.source-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}
.source-item:first-child { border-top: none; padding-top: 4px; }
.source-title { color: var(--near-black); font-weight: 600; line-height: 1.4; font-size: 1rem; }
.source-pages { font-size: .88rem; color: var(--mid-grey); }
.source-file { font-size: .82rem; color: #9a9a9a; font-family: monospace; }

.stage-error {
  margin-top: 20px;
  padding: 14px 18px;
  border-left: 4px solid #D2544B;
  background: #FDF2F1;
  color: var(--near-black);
}

/* --------------------------------------------------------------------------
   Layout-dependent copy
   -------------------------------------------------------------------------- */
.only-narrow { display: none; }
@media (max-width: 900px) {
  .only-wide { display: none; }
  .only-narrow { display: inline; }
}

/* --------------------------------------------------------------------------
   Standalone CFI page header
   -------------------------------------------------------------------------- */

.crb-page-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid #EDEDED;
}
.crb-page-header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
}
.crb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--near-black);
  font-size: .95rem;
  font-weight: 600;
}
.crb-brand-logo {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .crb-brand-logo { height: 21px; }
}

/* --------------------------------------------------------------------------
   Contact modal
   -------------------------------------------------------------------------- */

.crb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.crb-modal {
  background: var(--white);
  border-radius: 12px;
  width: min(460px, 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.crb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.crb-modal-header h3 { font-size: 1.05rem; color: var(--near-black); margin: 0; }
.crb-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--mid-grey);
  cursor: pointer;
  padding: 0;
}
.crb-modal-close:hover { color: var(--near-black); }
.crb-modal-body { padding: 12px 24px 20px; }
.crb-modal-intro {
  margin: 0 0 1.125rem;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--mid-grey);
}
.crb-form-field { margin-bottom: 14px; }
.crb-form-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--near-black);
  margin-bottom: 5px;
}
.crb-form-field input,
.crb-form-field textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font: inherit;
  font-size: .9rem;
  color: var(--near-black);
  background: var(--white);
  outline: none;
  resize: vertical;
}
.crb-form-field input:focus,
.crb-form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 190, 92, .12);
}
.crb-modal-footer {
  padding: 0 24px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.crb-modal-submit {
  padding: 9px 24px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--white);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.crb-modal-submit:hover { background: var(--accent-dark); }
.crb-modal-cancel {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--near-black);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.crb-modal-cancel:hover { border-color: var(--near-black); }
.crb-form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.crb-form-error {
  margin: .875rem 0 0;
  padding: .625rem .75rem;
  font-size: .85rem;
  line-height: 1.5;
  color: #8c2f28;
  background: #fdf4f3;
  border: 1px solid #e6c4c0;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Success toast
   -------------------------------------------------------------------------- */

.crb-toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 700;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: #f6fdf8;
  border: 1.5px solid #b2dfc0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .10);
  width: 90%;
  max-width: 600px;
}
.crb-toast-icon { flex-shrink: 0; margin-top: 1px; }
.crb-toast-body { flex: 1; min-width: 0; }
.crb-toast-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--near-black);
  margin: 0 0 0.375rem;
}
.crb-toast-message {
  font-size: 0.875rem;
  color: var(--mid-grey);
  margin: 0;
  line-height: 1.55;
}
.crb-toast-message a { color: var(--accent); font-weight: 600; }
.crb-toast-close {
  background: none;
  border: none;
  color: var(--mid-grey);
  cursor: pointer;
  font-size: 1.0625rem;
  padding: 0;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.crb-toast-close:hover { color: var(--near-black); }

/* --------------------------------------------------------------------------
   Standalone page footer
   -------------------------------------------------------------------------- */

/* Single column throughout (Oliver, 2026-09-21) — this used to reserve a
   260px-wide second grid column so the disclaimer text stayed aligned
   under the main panel and out from under the (now-removed) side panel. */
.crb-page-footer {
  /* Matches .tool-layout's 1060px cap and centers within it (Oliver,
     2026-09-21) — the footer sits directly in .inner (1340px), which is
     wider than the frame above it now that the old 260px side panel is
     gone, so its centered text no longer lined up with the panel's own
     left/right edges. */
  max-width: 1060px;
  margin: 0 auto;
  font-size: .78rem;
  color: var(--mid-grey);
  border-top: 1px solid #EDEDED;
}
.crb-page-footer span {
  display: block;
  text-align: center;
  padding: 14px 16px;
}
.crb-page-footer a { color: inherit; }

/* --------------------------------------------------------------------------
   Short-screen adjustments
   -------------------------------------------------------------------------- */

@media (max-height: 880px) {
  .tool-body { padding: 20px 80px 20px 80px; }
  .tool-welcome,
  .tool-welcome p,
  .tool-welcome li { font-size: .88rem; }
  .tool-welcome h2 { font-size: 1.75rem; margin-bottom: 8px; }
  .tool-welcome h3 { font-size: .9rem; margin: 16px 0 6px; }
  .tool-welcome p,
  .tool-welcome ul { margin-bottom: 11px; }
  .tool-welcome li { margin-bottom: 5px; }
}
@media (max-height: 820px) {
  .tool-body { padding: 16px 80px 12px 80px; }
  .tool-welcome h2 { font-size: 1.6rem; margin-bottom: 8px; }
  .tool-welcome .welcome-kicker { margin-bottom: 0; }
}
@media (max-height: 760px) {
  .tool-body { padding: 8px 80px 6px 80px; }
  .tool-welcome,
  .tool-welcome p,
  .tool-welcome li { font-size: .82rem; }
  .tool-welcome h2 { font-size: 1.35rem; margin-bottom: 8px; }
  .tool-welcome h3 { font-size: .85rem; margin: 13px 0 5px; }
  .tool-welcome p,
  .tool-welcome ul { margin-bottom: 9px; }
  .tool-welcome li { margin-bottom: 4px; }
  .tool-input { min-height: 68px; padding: 10px 14px 38px; margin-bottom: 4px; }
  .tool-input-placeholder { font-size: .82rem; }
  .tool-input-actions { bottom: 8px; gap: 10px; }
  .tool-input-send { width: 28px; height: 28px; }
  .tool-input-upload { padding: 4px 9px; font-size: .78rem; }
}
@media (max-width: 700px) {
  .tool-body { padding: 28px 80px 32px 80px; }
  .tool-header { flex-wrap: wrap; gap: 10px; }
  .tool-actions { margin-left: 0; }
  .tool-welcome h2 { font-size: 1.6rem; }
}

/* --------------------------------------------------------------------------
   Print / Save Report (Oliver, 2026-10-21)
   -------------------------------------------------------------------------- */

@media print {
  /* Isolate .review-report from the rest of the page. visibility rather
     than display so layout isn't disturbed before the override below
     repositions the one element we keep, and so nothing inside it
     inherits a display:none from an ancestor. */
  body * { visibility: hidden; }
  .review-report, .review-report * { visibility: visible; }
  .review-report {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
  }

  /* Force open everything collapsed by default on screen — a visitor who
     never clicked "Show what's already cleared" or any "Show the
     requirement" toggle should still get a COMPLETE report on paper/PDF,
     since the whole point of this button is a copy they can share with
     us for support. More specific than the bare [hidden] rule earlier in
     this file (also !important), so this wins regardless of source
     order. */
  .review-report [hidden] { display: block !important; }

  /* The toggle buttons themselves are controls, not report content. */
  .review-cleared-toggle, .review-req-toggle, .review-footline-toggle { display: none !important; }

  /* Force the settled end-state of the entrance animation (opacity: 0 ->
     1 via animation: review-fade-in, see ~line 940) rather than relying
     on it having already finished by the time print fires. It will have,
     in every real case — the button that triggers window.print() only
     appears once the whole report has streamed in, seconds or minutes
     earlier — but print rendering is not guaranteed to respect
     mid-or-post animation state consistently across browsers, and the
     entire point of this feature is a reliably COMPLETE printed copy.
     Same override already applied for prefers-reduced-motion, just
     scoped to print instead. */
  .review-report h3,
  .review-section-hint,
  .review-table,
  .review-cleared,
  .review-met-list,
  .review-stats,
  .review-footline,
  .review-title,
  .review-meta {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
