/* Climate Rationale Builder demo — standalone page styles.
   Self-contained: no dependency on main.css. Includes base variables,
   reset, typography, and all tool chrome. */

:root {
  /* Brand palette */
  --green: #3DBE5C;
  --green-dark: #2fa04c;
  --green-light: #E8F8ED;
  --near-black: #1A1A1A;
  --mid-grey: #555555;
  --light-grey: #CCCCCC;
  --white: #FFFFFF;
  --off-white: #F5F5F5;
  --border: #CCCCCC;
  /* Tool chrome */
  --tool-border: #E5A93C;
  --tool-border-soft: #F0D6A2;
}

* { 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(--green); }
.green { color: var(--green); }

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: var(--white);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

/* Base card — visual properties overridden by .project-card specifics */
.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }

/* Several elements here are toggled via the `hidden` attribute but also carry an
   explicit `display` (grid, flex, block) in this file — which beats the browser's
   own `[hidden] { display: none }` and leaves them on screen with the attribute
   set. This restores the expected behaviour for all of them at once. */
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Tool panel — mirrors the Climate Rationale Builder panel in the product
   -------------------------------------------------------------------------- */

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

/* The mockup's two siblings: a 1120x918 frame and a 260px project panel beside
   it, 20px apart. The panel is stretched to the frame's height rather than
   sized by its own content, so the two read as one unit. */
.tool-layout {
  /* One height for both columns. Without it the grid row is sized by the
     project list's own content, which is taller than the frame — the panel then
     ran off the bottom of the screen while the frame stopped where it should. */
  --frame-h: min(918px, calc(100vh - 112px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

/* Fixed height, not content height. The mockup's frame is 918px tall with the
   composer sitting at the bottom of it — letting the panel grow with the intro
   pushed the composer off the bottom of a laptop screen. Capped against the
   viewport so it always fits, whatever the screen. */
.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;
}

/* Rounded rectangle, not a pill — the mockup's chip carries the "- Demo" suffix
   inline, which is why there is no separate status pill beside it. */
.tool-chip {
  border: 1px solid var(--tool-border);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: .85rem;
  font-weight: 600;
  color: #F0A33C;
  white-space: nowrap;
}

/* No centre element any more, so the actions carry themselves to the right. */
.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(--green);
  color: var(--white);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.tool-cta:hover { background: var(--green-dark); color: var(--white); }
.tool-cta:focus-visible { outline: 2px solid var(--green-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); }

/* Two columns: the streamed intro reads on the left while the four choices sit
   on the right, on screen from the start. Everything after a project is picked
   (the narrative, the stage output) spans both. */
/* Side column sized so the cards land ~30% narrower than they were (418px ->
   ~293px at 1280 viewport). The cards fill the column, so the column is the
   dial; card type scales down with it just below. */
/* The one part of the frame that scrolls. Everything else — header, composer —
   stays put, so the composer is always on screen. */
.tool-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 40px 28px;
}

/* The mockup draws the picker as a self-contained card rather than a column
   hanging off a divider: own border, own radius, titled header with a rule.
   It scrolls internally so the list can be longer than the frame is tall. */
.tool-col-side {
  display: flex;
  height: var(--frame-h);
  min-height: 520px;
}

.side-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  border: 1px solid #E6E8EB;
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.side-heading {
  flex: 0 0 auto;
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #E6E8EB;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--near-black);
}

/* position:relative so the "more below" affordance can be pinned to the bottom
   of the scroll VIEWPORT rather than to the end of the scrolling content. */
.side-card {
  position: relative;
}

.side-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 18px;
  scrollbar-gutter: stable;
}

/* There are 15 project cards and only about four fit. Nothing said so — the list
   just ended at the fold and read as the whole set. Two cues, both driven by the
   .has-more class the scroll handler toggles:
   a fade so the content is visibly cut off, and a label that names the action. */
.side-card::after {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 56px;
  border-radius: 0 0 11px 11px;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--white) 82%);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;   /* must never eat a click on the card underneath */
  /* A pseudo-element generates as the LAST child, so without this the fade
     painted on top of the pill below and washed it out to near-invisible —
     which read as "the CTA is barely there" rather than as a stacking bug. */
  z-index: 1;
}
.side-card.has-more::after { opacity: 1; }

/* Light pill with dark text. It was briefly solid charcoal, which read as a
   primary action competing with the project cards it sits over — this is a
   convenience for a scroll you can already do with the wheel, so it should be
   findable, not loud. It survives at this weight only because the z-index above
   stops the fade painting over it; the earlier pale version was invisible for
   that reason, not because it was too light. */
.side-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 2;                /* above .side-card::after — see the note there */
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 14px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: var(--near-black);
  white-space: nowrap;
  background: var(--white);
  border: 1px solid #D8DBDF;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  opacity: 0;
  transition: opacity .2s ease, background .15s ease, border-color .15s ease;
  /* Inert ONLY while hidden. It overlaps a project card, so leaving it
     click-through when visible meant every press on it fell straight through
     and launched whatever project sat underneath. */
  pointer-events: none;
  cursor: pointer;
}

.side-card.has-more .side-scroll-hint {
  opacity: 1;
  pointer-events: auto;
}

.side-card.has-more .side-scroll-hint:hover {
  background: var(--off-white);
  border-color: var(--light-grey);
}
.side-card.has-more .side-scroll-hint:active { transform: translateX(-50%) scale(.97); }

/* Down-chevron, drawn rather than shipped as an asset. */
.side-scroll-hint::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 2px solid var(--near-black);
  border-bottom: 2px solid var(--near-black);
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .side-card::after,
  .side-scroll-hint { transition: none; }
}

/* Holds the column's place while the intro streams, so the cards don't shove
   the layout around when they arrive. */
.side-waiting {
  margin: 0;
  font-size: .9rem;
  color: #9A9A9A;
}

/* Below the two-column threshold the frame goes back to growing with its
   content and the panel stacks underneath — a fixed 918px frame on a phone
   would leave the intro scrolling inside a letterbox. */
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-panel { height: auto; min-height: 0; }
  .tool-col-side { height: auto; min-height: 0; }
  .tool-body { overflow-y: visible; }
  .side-card-body { max-height: 60vh; }
  /* Once a project is selected on mobile, the sidebar compresses the workspace —
     hide it so the pipeline output has the full column. */
  .tool-layout.is-running .tool-col-side { display: none; }
}

/* The product's composer, reproduced: white field, amber border, placeholder at
   the top-left, circled + and the green send button at the bottom-right. It is
   inert — see the note element below — but it is styled at full strength rather
   than greyed out, because a dead-looking control makes the whole tool read as
   broken. */
.tool-input {
  position: relative;
  margin: 0 20px 8px;
  padding: 8px 16px 40px;
  min-height: 72px;
  /* Paler than the panel outline, as in the mockup — the composer shouldn't read
     as loudly as the frame around the whole tool. */
  border: 1px solid var(--tool-border-soft);
  border-radius: 8px;
  background: var(--white);
  cursor: text;
}

.tool-input:focus-visible {
  outline: 2px solid var(--green);
  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;
}

/* The freetext narrative textarea. Transparent so the surrounding .tool-input
   border/background show through; no native resize handle since the parent box
   is the visual container. */
.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;
}

/* Circled plus, drawn rather than iconised so the page keeps its zero
   third-party dependencies. */
.tool-input-plus {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1.5px solid #6B6B6B;
  border-radius: 50%;
}

.tool-input-plus::before,
.tool-input-plus::after {
  content: '';
  position: absolute;
  background: #6B6B6B;
  top: 50%;
  left: 50%;
}

.tool-input-plus::before { width: 10px; height: 1.5px; transform: translate(-50%, -50%); }
.tool-input-plus::after  { width: 1.5px; height: 10px; transform: translate(-50%, -50%); }

.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(--green);
  color: var(--white);
  cursor: pointer;
}

.tool-input-send:disabled { background: #CFE9D6; cursor: default; }
.tool-input-send:not(:disabled):hover { background: var(--green-dark); }

/* The real field, revealed only at a confirmation gate. */
.tool-input-field {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .95rem;
  color: var(--near-black);
  background: transparent;
  outline: none;
}

/* At the gap gate the composer is the answer box and the + is the uploader, so
   both are brought up to full strength — amber outline, darker placeholder, a
   solid plus. Deliberately NOT the green .is-live treatment: nothing here is
   actually accepted, and green would promise a working control. */
.tool-input.is-invited {
  border-color: var(--tool-border);
  box-shadow: 0 0 0 3px rgba(229, 169, 60, .14);
}

.tool-input.is-invited .tool-input-placeholder { color: #6B6B6B; }
.tool-input.is-invited .tool-input-plus { border-color: var(--near-black); }
.tool-input.is-invited .tool-input-plus::before,
.tool-input.is-invited .tool-input-plus::after { background: var(--near-black); }

/* A live composer gets a stronger amber ring — the same gold as the resting
   state, just brighter. It was green, which made the composer the one control
   on the page that changed colour family when it woke up; the tool chrome is
   gold throughout and the switch read as a different component. */
.tool-input.is-live {
  border-color: var(--tool-border);
  box-shadow: 0 0 0 3px rgba(229, 169, 60, .22);
}

/* Revealed when the composer is clicked, so the box explains itself instead of
   appearing to swallow input. Sits INSIDE the field, above the buttons. */
.tool-input-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--mid-grey);
  background: var(--off-white);
  border-left: 3px solid var(--tool-border);
  border-radius: 4px;
}

/* Give the note room so it never sits under the + / send buttons. */
.tool-input:has(.tool-input-note:not([hidden])) { padding-bottom: 60px; }

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

/* Narrower than it was, and a shade smaller: the mockup sets the copy at ~15px
   in a column roughly 56% of the frame. Both matter — at 16px in a 760px column
   the intro ran two lines past the bottom of the frame on a 900px-tall screen,
   hiding the one line that tells a visitor what to do next. */
.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; }

/* The heading block is centred like the product; the body copy that follows is
   left-aligned so long paragraphs stay readable. */
.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;
}

.tool-welcome h2 .green { color: var(--green); }

/* Kept in case the tagline line is ever restored; the mockup omits it, so
   nothing currently emits @tagline. */
.tool-welcome .welcome-tagline {
  text-align: center;
  font-style: italic;
  color: var(--mid-grey);
  margin: 0 0 28px;
}

/* Body-size, not heading-size — in the mockup these sit at the same scale as the
   surrounding paragraphs and are distinguished by weight and colour alone. */
.tool-welcome h3 {
  color: var(--green);
  font-size: .95rem;
  font-weight: 700;
  margin: 20px 0 8px;
}

.tool-welcome ul { padding-left: 20px; margin: 0 0 14px; }
.tool-welcome li { margin-bottom: 6px; }

/* Caret while the copy is still arriving. */
.tool-welcome.is-streaming::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--green);
  vertical-align: text-bottom;
  animation: crb-caret 1s steps(1) infinite;
}

@keyframes crb-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); }

/* --------------------------------------------------------------------------
   Project picker — the selection step, centred in the panel
   -------------------------------------------------------------------------- */

/* A single stack in the side column — the four cards read as a list of choices
   rather than a grid, and stay narrow enough to sit beside the intro. */
.project-grid {
  display: grid;
  /* minmax(0, 1fr), not 1fr. A bare `1fr` is minmax(AUTO, 1fr), and an auto
     minimum refuses to shrink below the widest item's max-content — so one
     unwrappable child (a nowrap badge, a long unbroken token) silently widens
     the whole column past its container and clips every card. This is the
     structural guard; capping the badge is the local one. */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

/* Grey fill on a near-invisible border, per the mockup — the cards read as wells
   inside the white panel rather than as a second layer of white-on-white. */
.project-card {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 13px 15px;
  border: 1px solid #E6E8EB;
  border-radius: 8px;
  background: #F7F8F9;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

/* The one sample project carrying a real downscaled climate data layer. Gold,
   because gold is this page's "tool chrome" colour and green is reserved for
   confirm/send — this is a property of the project, not an action to take. */
.project-card.has-downscaled {
  border: 2px solid var(--tool-border);
  background: #FFFDF9;
}

.project-card.has-downscaled:hover:not(:disabled) {
  border-color: #C98F26;
  box-shadow: 0 4px 16px rgba(229, 169, 60, .22);
}

/* Shrunk deliberately. At .68rem the label wrapped to two lines in a ~215px
   column and occupied as much of the card as the project title — it read as the
   headline rather than a tag. At .5rem it fits on one line, which halves the
   block's height on its own; nowrap guarantees that rather than leaving it to
   the column width.

   NOT halved literally: .34rem is 5.4px, below the point where uppercase
   letter-spaced text is legible at all. This is the smallest size that still
   reads. */
/* Selector must out-specify `.project-card p` (0-1-1) further down this file,
   which sets font-size: .875rem. As a bare `.project-card-badge` (0-1-0) the
   size below silently lost on both specificity AND source order, so the badge
   rendered at 14px. Combined with white-space: nowrap that gave it a 232px
   minimum width, which no 260px sidebar can hold — the grid column blew out past
   its container and clipped every card. Keep this selector at or above
   `.project-card p`.

   max-width is the belt to that braces: even if some future rule wins the
   font-size again, the badge clips instead of widening the whole column. */
.project-card .project-card-badge {
  display: inline-block;
  max-width: 100%;
  margin: 5px 0 0;
  padding: 2px 7px;
  font-size: .57rem;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  background: var(--green);
  border-radius: 3px;
}

.project-card:hover:not(:disabled) {
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
  transform: translateY(-2px);
}

.project-card:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.project-card.selected {
  border-color: var(--green);
  background: var(--green-light);
}

.project-card:disabled { opacity: .5; cursor: not-allowed; }

/* The country line is plain sentence case in the mockup, not the site's uppercase
   letterspaced eyebrow — it reads as part of the card's sentence, not a label. */
.project-card .eyebrow {
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--green);
}

.project-card h4 { margin: 4px 0 6px; font-size: .88rem; line-height: 1.3; }
.project-card p  { margin: 0; color: #4B5563; font-size: .875rem; line-height: 1.45; }

/* Each card carries its project's full narrative and scrolls it, so all four
   overviews are readable in place without the column growing to several
   screens. Capped rather than clamped: nothing is truncated, it just scrolls. */
.project-card-body {
  max-height: 84px;    /* ~5 lines of blurb, matching the mockup's card height */
  overflow-y: auto;
  overscroll-behavior: contain;      /* scrolling a card doesn't drag the page */
  padding-right: 8px;
  margin-top: 4px;
  /* Fades the last line so it reads as "more below" rather than a hard cut. */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
}

.project-card-body { scrollbar-width: none; }
.project-card-body::-webkit-scrollbar { display: none; }

.project-card-narrative {
  margin-top: 7px !important;
  white-space: pre-wrap;
  font-size: .825rem !important;
  color: #6B7280 !important;
}

/* Selecting a card opens it up — the chosen project is worth more room than the
   three you didn't pick. */
.project-card.selected .project-card-body {
  max-height: 200px;
  mask-image: none;
  -webkit-mask-image: none;
}

/* Layout-dependent copy — see the {{{wide:…}}} / {{{narrow:…}}} rule in
   crb-demo.js. Exactly one of the pair is shown at any width. */
.only-narrow { display: none; }
@media (max-width: 900px) {
  .only-wide { display: none; }
  .only-narrow { display: inline; }
}

/* Pre-run messaging (loading / unavailable / paused). Lives outside the stage
   panel so it is visible before a run has started. */
.picker-message {
  margin: 16px 0 0;
  padding: 14px 16px;
  font-size: .9rem;
  background: var(--off-white);
  border-left: 4px solid var(--light-grey);
  color: var(--mid-grey);
}

.picker-message.is-error {
  background: #FDF2F1;
  border-left-color: #D2544B;
  color: var(--near-black);
}

/* Running state: picking a project clears the panel to the workflow, the way
   submitting a narrative does in the product. The intro and the picker step
   aside; the thread takes the full width. */
.tool-body.is-running .tool-col-main { display: none; }

/* Sidebar stays visible throughout the workflow — no collapse on run start. */

.tool-body.is-running {
  /* The intro's breathing room is dead space once the workflow is running —
     the overview should start near the top of the frame. */
  padding-top: 20px;
}

.tool-body.is-running .stage-panel { margin-top: 0; }

/* The visitor's "submitted" message — the product puts user turns in a grey
   bubble and leaves assistant turns as plain text (.chat-bubble in styles.css). */
.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;
}

/* --------------------------------------------------------------------------
   Selected narrative — shown verbatim so the visitor sees exactly what the
   pipeline is being given
   -------------------------------------------------------------------------- */

.narrative-box {
  max-width: 800px;
  margin: 32px auto 0;
  padding: 24px;
  border-left: 3px solid var(--green);
  background: var(--off-white);
}

.narrative-box h3 { margin-top: 0; }

.narrative-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: .95rem;
  color: var(--mid-grey);
}

/* --------------------------------------------------------------------------
   Stage output
   -------------------------------------------------------------------------- */

.stage-panel {
  max-width: 820px;
  margin: 32px auto 0;
}

.tool-body.is-running .chat-bubble-user { margin-top: 0; }

.stage-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 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: crb-pulse 1.2s ease-in-out infinite;
}

@keyframes crb-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; }
  .project-card:hover:not(:disabled) { transform: none; }
}

.stage-output { margin-top: 20px; overflow-wrap: break-word; }

/* Single-line pulsating status indicator. Shows one generic message at a time
   rather than accumulating internal step detail. */
.trace {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  font-size: .85rem;
  color: var(--mid-grey);
}

/* Amber pulsing dot — matches the tool's border colour. */
.trace::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--tool-border);
  animation: crb-pulse 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .trace::before { animation: none; }
}

/* The mint callout — the product's .causal-chain-card. */
.causal-chain-card {
  background: #f0faf4;
  border: 1px solid #b2dfca;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 12px 0 0;
  line-height: 1.55;
  color: #1a1a1a;
}

.causal-chain-card > p:first-child { margin-top: 0; }
.causal-chain-card > p:last-child  { margin-bottom: 0; }

/* Blocks appended to the thread in emission order. */
.thread-wait { margin-top: 16px; color: var(--mid-grey); }
.thread-wait p { margin: 0; }
.thread-text + .thread-text { margin-top: 4px; }
.gap-lead { margin-top: 18px; }
.gap-card-slot { margin-top: 10px; }
.gap-card-slot + .thread-text { margin-top: 14px; }

/* "## Your Climate Rationale Draft" -> h3 (the section's own title).
   "### Section A: …"                -> h4 (a rank below it, and green, matching
   the product's green sub-headings). */
.stage-output h3 { font-size: 1.3rem; margin-top: 30px; }
.stage-output h4 {
  font-size: 1.02rem;
  margin-top: 24px;
  color: var(--green);
}
.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);
}

/* Tighten browser-default list margins inside streamed content. Without these
   ol/ul get ~1em top+bottom margin and 40px padding-left, making numbered
   question lists feel double-spaced relative to surrounding text. */
.stage-output ol,
.stage-output ul { padding-left: 22px; margin: 0 0 12px; }
.stage-output li { margin-bottom: 6px; line-height: 1.55; }

/* Inline citation bubbles — ported from .chat-markdown .citation-bubble in
   cfi-frontend/src/styles.css so they match the production look exactly. */
.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;
}

/* C.1 source accordion cards — ported from .chat-sources / .chat-source-*
   in cfi-frontend/src/styles.css.  Scoped to .c1-sources so they don't
   bleed into the gap-report's "Sources consulted" disclosure. */
.c1-sources { margin-top: 6px; }
.chat-sources { display: grid; gap: 10px; }

.chat-source-card {
  border: 1px solid #d1d9e0;
  border-radius: 5px;
  background: #fbfbfb;
  overflow: hidden;
}

.chat-source-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
}
.chat-source-summary::-webkit-details-marker { display: none; }

.chat-source-chevron {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #2e2e2e;
  border-bottom: 2px solid #2e2e2e;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.chat-source-card[open] .chat-source-chevron { transform: rotate(225deg); }

.chat-source-title {
  font-size: .85rem;
  line-height: 1.4;
  color: #2e2e2e;
}

.chat-source-divider { height: 1px; background: #d1d9e0; }

.chat-source-body {
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
  font-size: .83rem;
  line-height: 1.55;
  color: #2e2e2e;
}

.chat-source-row { margin: 0; }
.chat-source-label { font-weight: 600; }
.chat-source-value { font-weight: 400; }

.stage-closing {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--green-light);
  border-radius: 4px;
}

.stage-closing p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Gap report — ported from the product's .gap-report-* rules in
   cfi-frontend/src/styles.css. The --cov-* palette and the type scale are
   copied verbatim so the demo's evidence-coverage card is the one a visitor
   would see in the real tool. Keep in step with GapReportCard.tsx.
   -------------------------------------------------------------------------- */

.gap-lead { color: var(--mid-grey); }

.gap-report-card {
  --cov-strong: #7faa86;
  --cov-partial: #d9b878;
  --cov-gap: #cf9189;
  --cov-best: #93a8bd;
  --cov-na: #c2c6cc;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 12px;
}

.gap-report-heading { font-size: 17px; font-weight: 700; color: #1a1a1a; margin: 0 0 2px; }
.gap-report-summary { font-size: 13px; color: #555; margin: 0 0 14px; }
.gap-report-summary .cov-strong   { color: var(--cov-strong); font-weight: 700; }
.gap-report-summary .cov-partial  { color: #bd9a52; font-weight: 700; }
.gap-report-summary .cov-partial.is-zero { color: #888; font-weight: 400; }
.gap-report-summary .cov-gap      { color: #c17b72; font-weight: 700; }
.gap-report-summary .cov-gap.is-zero { color: #888; font-weight: 400; }
.gap-report-summary .cov-advisory { color: var(--cov-best); font-weight: 700; }

/* Rows STACK rather than sitting on one line. The previous layout put the label
   in a fixed 145px column beside the bar and indented the reason text by 155px,
   which on this narrow panel spent ~220px of every row on furniture and left the
   bar and the explanation squeezed. Full-width label → full-width bar → full-width
   reason reads better and fits far more text per line. */
.gap-report-rows { display: flex; flex-direction: column; gap: 18px; margin-bottom: 10px; }
.gap-report-row { display: flex; flex-direction: column; gap: 8px; }

/* --------------------------------------------------------------------------
   Downscaled point data — grouped and accented.

   The accent sits on the ROW, not the bar. The bar's colour is load-bearing
   (green = strong, clay = gap) and recolouring it gold to mark provenance would
   destroy the status coding — a Gap row must still read as a gap. Provenance and
   status are two different facts, so they get two different channels.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Downscaled point data — its OWN card, not a treatment inside the evidence card.

   Two in-card treatments were tried first and both failed for the same reason:
   this page's chrome is already gold (tool frame, chip, composer), so gold
   marking carries no information, and an accent on a row inside a list still
   reads as "another row in that list". Separating it into a distinct card is
   what makes it read as a different KIND of evidence.

   Mint reuses .causal-chain-card's palette — the product's existing callout
   colour — rather than inventing a new one for a single feature.
   -------------------------------------------------------------------------- */
.gap-report-site-card {
  position: relative;
  margin: 14px 0 0;
  padding: 16px 20px 18px;
  background: #f8f9fa;
  border: none;
  border-radius: 8px;
}
/* Long-dash grey border — CSS 'dashed' only renders short dashes, so we draw
   the stroke with an SVG overlay on the ::after pseudo-element instead. */
.gap-report-site-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect x='1' y='1' width='calc(100%25 - 2px)' height='calc(100%25 - 2px)' rx='7' ry='7' fill='none' stroke='%239ca3af' stroke-width='2' stroke-dasharray='16 7'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  pointer-events: none;
}

.gap-report-site-heading {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}

.gap-report-site-where {
  margin: 3px 0 0;
  font-size: 13px;
  color: #3f7355;
}

.gap-report-site-point {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

.gap-report-site-summary {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
}
.gap-report-site-summary .cov-strong { color: #1a6b35; font-weight: 700; }
.gap-report-site-summary .cov-gap    { color: #c0392b; font-weight: 700; }

/* Sub-headers inside the site card stay charcoal, not inheriting mint-green text */
.gap-report-site-card .gap-report-row-label { color: #2e2e2e; }

.gap-report-site-sub {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #cfeadb;
  font-size: 13px;
  line-height: 1.5;
  color: #4a6b58;
}

.gap-report-site-card .gap-report-rows { margin-top: 14px; gap: 16px; }

/* The track's default border is tuned for a white card and disappears on mint. */
.gap-report-site-card .gap-report-cov-track { border-color: #bcdccb; }
.gap-report-row-head { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }

.gap-report-row-label {
  font-size: 15px;
  font-weight: 700;
  color: #2e2e2e;
  line-height: 1.3;
  /* was a fixed 145px column — now its own full-width line */
  width: auto;
  min-width: 0;
}

.gap-report-row-reason {
  font-size: 14px; color: #777; line-height: 1.5;
  margin-left: 0;   /* was 155px, to clear the old label column */
}

.gap-report-cov { display: flex; align-items: center; gap: 12px; }

/* Primer's ProgressBar in the product; a track + fill here. Taller and outlined
   so the bar still reads as a measured quantity now that it carries the row. */
/* 14px -> 10.5px, exactly the 25% reduction asked for. Kept fractional rather
   than rounded to 10px so it is the requested figure and not an approximation;
   sub-pixel heights render fine and the difference is invisible either way.
   Radius drops with it — a 5px radius on a 10.5px bar reads as a lozenge. */
.gap-report-cov-track {
  flex: 1;
  height: 10.5px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid #d9d9d9;
  overflow: hidden;
}

.gap-report-cov-fill { height: 100%; border-radius: 3px; }

.gap-report-cov-status {
  font-size: 14px; font-weight: 500; flex-shrink: 0; text-align: left;
}

.gap-report-foot { font-size: 14px; color: #666; line-height: 1.4; margin: 0; }
.gap-report-foot--advisory { margin-top: 8px; }
.gap-report-foot--advisory .cov-advisory { color: var(--cov-best); font-weight: 700; }

/* The sources list is the evidence behind everything above it — the single most
   credibility-bearing thing on the page — and it was a 13px grey line of small
   print that read as a footnote. Promoted to something that looks like a control
   you are meant to press: gold-tinted panel, full width, its own disclosure
   arrow, and a count badge. */
.gap-report-sources {
  margin-top: 14px;
  border-top: 1px solid #e0e0e0;
  padding-top: 12px;
}

.gap-report-sources > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--near-black);
  background: #f3f4f6;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  list-style: none;          /* Safari/Firefox default marker */
  transition: background .15s ease, border-color .15s ease;
}
.gap-report-sources > summary::-webkit-details-marker { display: none; }

.gap-report-sources > summary:hover {
  background: #FBEFD9;
  border-color: var(--tool-border);
}
.gap-report-sources > summary:focus-visible {
  outline: 2px solid var(--tool-border);
  outline-offset: 2px;
}

/* Chevron, rotated by the open state so the control says which way it goes. */
.gap-report-sources > summary::before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--tool-border);
  border-bottom: 2px solid var(--tool-border);
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.gap-report-sources[open] > summary::before { transform: rotate(45deg); }
.gap-report-sources[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* "Open to see the N passages behind this report" — states the payoff, because
   a label alone does not tell anyone why they would click it. */
.gap-report-sources > summary::after {
  content: 'View evidence';
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #9A7326;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gap-report-sources[open] > summary::after { content: 'Hide'; }
.gap-report-sources-body {
  margin-top: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--tool-border-soft);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #FFFDF9;
}
.gap-report-source-group { margin-bottom: 10px; }

.gap-report-section-label {
  font-size: 13px; font-weight: 700; color: #666; margin: 0 0 6px;
  text-transform: uppercase; letter-spacing: .5px;
}
.gap-report-section-note {
  font-size: 13px; text-transform: none; font-weight: 400; color: #888; letter-spacing: normal;
}

.gap-report-srcdoc { margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; }
.gap-report-srcdoc-index { color: #1a1a1a; font-size: 13px; min-width: 20px; padding-top: 2px; flex-shrink: 0; }
.gap-report-srcdoc-title { font-weight: 600; font-size: 16px; color: #444; }
.gap-report-srcdoc-link  { color: #1a56db; text-decoration: underline; cursor: pointer; }
.gap-report-srcdoc-meta  { color: #666; font-size: 14px; }
.gap-report-srcdoc-passages { color: #888; font-size: 14px; }

.gap-report-srcdoc-excerpt,
.gap-report-srcdoc-passage > summary {
  font-size: 14px;
  color: #555;
  margin-top: 3px;
  font-style: italic;
  line-height: 1.5;
}

.gap-report-srcdoc-passage > summary {
  cursor: pointer;
  list-style: none;
}

.gap-report-srcdoc-passage > summary::-webkit-details-marker { display: none; }

.gap-report-srcdoc-passage > summary::after {
  content: ' Show passage';
  font-style: normal;
  font-weight: 600;
  color: #1a56db;
  white-space: nowrap;
}

.gap-report-srcdoc-passage[open] > summary::after { content: ' Hide'; }

/* Explicit rather than relying on the UA hiding non-summary children of a
   closed <details> — something in this stylesheet was overriding that, so the
   full passage rendered whether the disclosure was open or not. */
.gap-report-srcdoc-passage:not([open]) > .gap-report-srcdoc-full { display: none; }

.gap-report-srcdoc-full {
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #e8eaed;
  border: 1px solid #c8ccd2;
  border-radius: 4px;
  white-space: pre-wrap;
}


.gap-report-narrative { font-size: 16px; color: #555; font-style: italic; margin-bottom: 10px; }

.gap-report-concentration {
  margin-top: 4px; padding: 8px 10px; font-size: 12px;
  background: #fff8e5; border: 1px solid #eedfae; border-radius: 6px; color: #6b5a2a;
}

.gap-report-about { font-size: 14px; color: #777; line-height: 1.5; margin: 12px 0 0; }
.gap-report-about-title { color: #555; font-weight: 600; }

.gap-report-off-country-warning {
  margin: 10px 0 4px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  background: #f3f4f6; border: 1px solid #9ca3af; border-radius: 6px; color: #374151;
}

.gap-report-srcdoc-geo-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 11px; font-weight: 600; border-radius: 10px;
  background: #e8edff; color: #3a4fb0; vertical-align: middle;
}


/* --------------------------------------------------------------------------
   Controls and messaging
   -------------------------------------------------------------------------- */

.stage-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

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

.demo-disclaimer {
  margin-top: 24px;
  font-size: .85rem;
  color: var(--mid-grey);
}

/* --------------------------------------------------------------------------
   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: 1340px;
  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;
}

/* Sized by HEIGHT, with width:auto, so the 12:1 wordmark keeps its aspect ratio
   at every breakpoint. 26px in a 56px bar leaves the logo optically centred
   without crowding the rule underneath. The intrinsic width/height attributes
   in the markup reserve the box before the PNG decodes. */
.crb-brand-logo {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  /* The full wordmark is ~312px wide at 26px tall; below this it would crowd
     the header, so it steps down rather than wrapping or clipping. */
  .crb-brand-logo { height: 21px; }
}

/* --------------------------------------------------------------------------
   Contact tooltip — positioned by JS, fixed so it escapes overflow:hidden
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   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-body > p {
  font-size: .9rem;
  color: var(--mid-grey);
  margin: 0 0 16px;
  line-height: 1.5;
}

.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(--green);
  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(--green);
  color: var(--white);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

.crb-modal-submit:hover { background: var(--green-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); }

/* --------------------------------------------------------------------------
   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(--green); 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
   -------------------------------------------------------------------------- */

/* Mirror the main grid so the text column is exactly the same width as the
   main panel. The phantom second column (260px sidebar + 20px gap = 280px)
   pushes the text column to align perfectly regardless of viewport width. */
.crb-page-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(260px + 20px);
  font-size: .78rem;
  color: var(--mid-grey);
  border-top: 1px solid #EDEDED;
}

.crb-page-footer span {
  grid-column: 1;
  text-align: center;
  padding: 14px 16px;
}

.crb-page-footer a { color: inherit; }

@media (max-width: 900px) {
  .crb-page-footer { grid-template-columns: 1fr; }
}

/* Short screens. The frame is bounded by the viewport, so on an 800px-tall
   laptop the intro overran it and the one line telling a visitor what to do next
   fell below the fold. Type and rhythm tighten rather than the copy being cut.

   These live at the end of the file on purpose: they share specificity with the
   .tool-welcome / .tool-input base rules above, so source order is what decides.
   Placed earlier — as they were — the base rules silently won and only the
   properties with no later counterpart took effect. */
@media (max-height: 880px) {
  .tool-body { padding: 20px 40px 20px; }
  .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; }
}

/* One step tighter for 800px-tall laptops, where the tier above still left the
   closing instruction a line short of the composer. */
@media (max-height: 820px) {
  .tool-body { padding: 16px 40px 12px; }
  .tool-welcome h2 { font-size: 1.6rem; margin-bottom: 8px; }
  .tool-welcome .welcome-kicker { margin-bottom: 0; }
}

/* Smallest tier. A 918px design cannot fit a ~700px viewport outright, so this
   closes most of the gap; whatever is left scrolls inside .tool-body, which the
   composer no longer moves with. */
@media (max-height: 760px) {
  .tool-body { padding: 8px 36px 6px; }
  .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; }

  /* The composer's reserved bottom strip has to stay taller than the send
     button plus its offset, or the buttons sit on top of the placeholder — so
     the button shrinks with the padding rather than only the padding. */
  .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-plus { width: 19px; height: 19px; }
}

@media (max-width: 700px) {
  .tool-body { padding: 28px 20px 32px; }
  .tool-header { flex-wrap: wrap; gap: 10px; }
  .tool-actions { margin-left: 0; }
  .tool-welcome h2 { font-size: 1.6rem; }
}

/* Early Access — the lead-in above the form fields. */
.crb-modal-intro {
  margin: 0 0 1.125rem;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--mid-grey);
}

/* Honeypot. Off-screen rather than display:none — some bots skip fields that are
   explicitly hidden, and this one wants to be filled in. */
.crb-form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Shown in place of the success toast when the submission actually failed. */
.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;
}

/* Proceed gate — shown after the project overview finishes typing, so the
   visitor sets the pace instead of a 5s timer starting the run under them. */
.thread-proceed {
  margin-top: 18px;
}
.thread-proceed p {
  margin: 0 0 14px;
  color: var(--mid-grey);
}
