/* ==========================================================================
   GreenScreen check result — redesign (Nov 2026)

   Built from landing/design/reference/result.html, driven by the tokens in
   leteni.css section 1.1. Prefix: .rr-

   The result renders into #gsn-results, directly below the hero on
   index.html. The summary band is full-bleed dark so it continues the hero;
   the requirements section below it sits on the page's light background,
   which is the same rhythm the reference page uses.

   Four states, never collapsed (see CLAUDE.md "Result-state rules"):
   match, cannot_classify, excluded, unavailable. cannot_classify is never
   styled or worded as an exclusion, and no score, percentage or confidence
   value appears anywhere.
   ========================================================================== */

.gsn-results:empty { display: none; }

.rr-container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Loading and transport failure ------------------------------------- */

.rr-status {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-6) var(--gutter);
  font-size: var(--fs-lede);
  color: var(--text-soft);
}
.rr-status--error { color: var(--ink); }

/* --- Progress while a check runs (dark band, like the result) ----------- */

.rr-progress { max-width: 640px; }
.rr-progress__h {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lede);
  font-weight: 500;
  color: var(--text-on-dark-strong);
}
.rr-progress__note {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-body);
  color: var(--text-on-dark);
}
.rr-progress__label {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-body);
  color: var(--text-on-dark);
}
.rr-progress__track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--line-dark);
  overflow: hidden;
}
.rr-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 1.1s ease-out;
}
.rr-progress[data-step="0"] .rr-progress__fill { width: 12%; }
.rr-progress[data-step="1"] .rr-progress__fill { width: 38%; }
.rr-progress[data-step="2"] .rr-progress__fill { width: 66%; }
.rr-progress[data-step="3"] .rr-progress__fill { width: 88%; }
.rr-progress[data-step="done"] .rr-progress__fill { width: 100%; transition-duration: 0.3s; }
.rr-progress__steps {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}
.rr-progress__step {
  position: relative;
  padding-left: 22px;
  font-size: var(--fs-small);
  color: var(--text-on-dark-soft);
}
.rr-progress__step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--text-on-dark-faint);
}
.rr-progress__step.is-active { color: var(--text-on-dark-strong); }
.rr-progress__step.is-active::before { border-color: var(--accent); }
.rr-progress__step.is-done::before { background: var(--accent); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .rr-progress__fill { transition: none; }
}

/* --- "How it works", moved below a result --------------------------------- */

/* The hero loses the row's bottom padding when the row moves out. */
.rd-hero--how-moved { padding-bottom: clamp(48px, 6vw, 72px); }
.rd-how-band { background: var(--forest-900); }
.rd-how-band .rd-how {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px var(--gutter) 44px;
}

/* ==========================================================================
   Summary band (dark) — shared by every state
   ========================================================================== */

.rr-summary {
  background: var(--forest-900);
  color: var(--text-on-dark);
}
.rr-summary__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(40px, 5vw, 56px) var(--gutter) clamp(48px, 6vw, 72px);
}

.rr-echo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  padding-bottom: 28px;
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--line-dark);
}
.rr-echo__label { font-size: var(--fs-label); color: var(--text-on-dark-faint); }
.rr-echo__text {
  flex: 1 1 360px;
  min-width: 0;
  font-size: var(--fs-lede);
  color: var(--text-on-dark);
}
.rr-echo__edit {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
.rr-echo__edit:hover { text-decoration: underline; }

/* A further matched activity, stacked below the first one's requirements. */
.rr-summary--also { border-top: 1px solid var(--line-dark); }
.rr-also__lead {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-lede);
  color: var(--text-on-dark);
}

.rr-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  align-items: flex-start;
}
.rr-head__main { flex: 1 1 560px; min-width: 0; }

.rr-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px var(--space-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  font-weight: 500;
}
.rr-pill--match {
  background: var(--accent-tint-dark);
  color: var(--accent);
}
/* cannot_classify and excluded share a neutral pill. Never red, never the
   accent: section 7 forbids colour carrying the meaning, so the words do. */
.rr-pill--neutral {
  background: rgba(255,255,255,0.08);
  color: var(--text-on-dark-soft);
}

.rr-h1 {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-result-h1);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--text-on-dark-strong);
  max-width: 20ch;
}
.rr-meta {
  margin: var(--space-3) 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--text-on-dark-soft);
}
.rr-note {
  margin: 20px 0 0;
  font-size: var(--fs-lede);
  color: var(--text-on-dark-soft);
  max-width: 56ch;
}

/* The "why this matched" sentence arrives a moment after the rest of the
   result, because it is written after the decision is final and fetched in
   its own request (see landing/assets/js/navigator.js). Fading it in makes
   its arrival read as part of the answer rather than as a flicker. */
.rr-note-in {
  animation: rr-note-in 220ms ease-out both;
}

@keyframes rr-note-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .rr-note-in { animation: none; }
}


/* --- "Where you stand" panel --- */

.rr-stand {
  flex: 1 1 340px;
  min-width: 0;
  max-width: 420px;
  background: var(--forest-800);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-panel);
  padding: var(--space-4);
}
.rr-stand__h {
  margin: 0;
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-on-dark-faint);
}
.rr-stand__dl { margin: var(--space-3) 0 0; }
.rr-stand__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px 0;
  border-top: 1px solid var(--line-dark);
}
.rr-stand__row:last-child { border-bottom: 1px solid var(--line-dark); }
.rr-stand__k { font-size: var(--fs-small); color: var(--text-on-dark-soft); }
.rr-stand__v {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-on-dark-strong);
  text-align: right;
}
.rr-stand__v--accent { color: var(--accent); }
.rr-stand__sub {
  display: block;
  font-size: var(--fs-label);
  font-weight: 400;
  color: var(--text-on-dark-faint);
}
.rr-chip-soon-dark {
  display: inline-block;
  padding: 2px 10px;
  background: var(--accent-tint-dark);
  color: var(--accent);
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  font-weight: 500;
}
.rr-stand__cta {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  background: var(--accent);
  color: var(--forest-900);
  border: 0;
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.rr-stand__cta:hover { background: #00AE6B; color: var(--forest-900); }
.rr-stand__cta svg { transition: transform 0.2s ease; }
.rr-stand__cta[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .rr-stand__cta svg { transition: none; } }

.rr-req[hidden] { display: none; }

/* --- Simple states: cannot_classify, excluded, unavailable --- */

.rr-body {
  margin: 20px 0 0;
  font-size: var(--fs-lede);
  color: var(--text-on-dark-soft);
  max-width: 62ch;
}
/* The closest taxonomy section on a cannot_classify result. Deliberately a
   quiet panel, not a card with an accent bar: the match state owns that
   treatment, and this must not read as a verdict. No score, bar or
   percentage ever appears here. */
.rr-nearmiss {
  margin: var(--space-4) 0 0;
  padding: var(--space-3);
  background: var(--forest-800);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  max-width: 62ch;
}
.rr-nearmiss__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
}
.rr-nearmiss__name {
  margin: 6px 0 0;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text-on-dark-strong);
}
.rr-nearmiss__body {
  margin: 8px 0 0;
  font-size: var(--fs-small);
  color: var(--text-on-dark-soft);
}

.rr-examples {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-width: 62ch;
}
.rr-examples li {
  font-size: var(--fs-small);
  color: var(--text-on-dark-link);
}
.rr-actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.rr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding-inline: 22px;
  border: 0;
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.rr-btn--accent { background: var(--accent); color: var(--forest-900); font-weight: 600; }
.rr-btn--accent:hover { background: #00AE6B; color: var(--forest-900); }
.rr-btn--ghost {
  background: transparent;
  color: var(--text-on-dark-strong);
  border: 1px solid var(--line-dark-3);
}
.rr-btn--ghost:hover { border-color: var(--accent); color: var(--text-on-dark-strong); }

.rr-source-dark {
  margin: var(--space-5) 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line-dark);
  font-size: var(--fs-label);
  line-height: 1.6;
  color: var(--text-on-dark-faint);
  max-width: 88ch;
}

/* ==========================================================================
   Requirements (light)
   ========================================================================== */

.rr-req {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(64px, 7vw, 96px) var(--gutter);
}
.rr-req__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-7);
  align-items: flex-start;
}
.rr-req__main { flex: 999 1 640px; min-width: 0; }

.rr-eyebrow {
  margin: 0 0 14px;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--green-700);
}
.rr-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2-small);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.rr-lede {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-lede);
  color: var(--text-soft);
  max-width: 62ch;
}

/* --- Step rail --- */

.rr-rail { list-style: none; margin: 48px 0 0; padding: 0; }
.rr-step { display: flex; gap: 20px; }
.rr-step__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
}
.rr-marker {
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rr-marker--done { background: var(--green-700); color: #FFFFFF; }
.rr-marker--n {
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
}
.rr-marker--doc {
  border-radius: var(--r-8);
  background: var(--forest-900);
  color: var(--accent);
}
.rr-step__line {
  flex: 1;
  width: 2px;
  background: var(--line-strong);
  margin-top: 6px;
}
.rr-step__line--done { background: var(--green-700); }

.rr-step__body { flex: 1; min-width: 0; padding: 2px 0 48px; }
.rr-step:last-child .rr-step__body { padding-bottom: 0; }
.rr-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
.rr-step__title { margin: 0; font-size: var(--fs-step); font-weight: 600; line-height: 1.3; }
.rr-step__status { font-size: var(--fs-label); font-weight: 500; color: var(--green-700); }
.rr-step__objective { margin: 4px 0 0; font-size: var(--fs-meta); color: var(--text-faint); }
.rr-step__text {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-small);
  color: var(--text-soft);
  max-width: 60ch;
}
.rr-step__text strong { color: var(--ink); font-weight: 600; }

/* --- Criterion cards --- */

.rr-crits {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rr-crit {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
}
.rr-crit__text { margin: 0; font-size: var(--fs-body); font-weight: 500; line-height: 1.45; }

.rr-refs {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rr-ref {
  padding: 3px 10px;
  background: var(--paper-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  color: var(--text-soft);
}

.rr-ev {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-3);
  padding-top: 14px;
  border-top: 1px dashed var(--line-dashed);
}
.rr-ev__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-soft);
}
.rr-ev__pill {
  padding: 2px 9px;
  background: var(--green-50);
  border-radius: var(--r-chip);
  font-size: var(--fs-mono-label);
  font-weight: 500;
  color: var(--green-700);
}

/* "Not required here". Rendered only from curated API data — the server sends
   none today (docs/redesign-api-contract.md D3), so this normally never
   appears. Kept so the card is already correct if that data is ever authored,
   and so nothing is tempted to infer it in the front end. */
.rr-na {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px var(--space-2);
  border: 1px dashed var(--line-dashed-2);
  border-radius: var(--r-card);
  padding: var(--space-3) 20px;
}
.rr-na__label { font-size: var(--fs-label); font-weight: 600; color: var(--text-soft); }
.rr-na__text {
  flex: 1 1 320px;
  min-width: 0;
  font-size: var(--fs-meta);
  color: var(--text-faint);
}

/* ==========================================================================
   Step 5 — evidence checklist (gated)
   ========================================================================== */

.rr-soon-pill {
  display: inline-block;
  padding: 2px 10px;
  background: var(--green-50);
  color: var(--green-700);
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  font-weight: 500;
}

.rr-ea {
  margin-top: 18px;
  background: var(--forest-900);
  color: var(--text-on-dark);
  border-radius: var(--r-panel);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  padding: clamp(24px, 3vw, 36px);
}
.rr-ea__copy { flex: 1 1 320px; min-width: 0; }
.rr-ea__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.12;
  color: var(--text-on-dark-strong);
}
.rr-ea__text {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-small);
  color: var(--text-on-dark-soft);
  max-width: 46ch;
}

.rr-ea__form {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-2);
}
.rr-ea__form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.rr-ea__legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--text-on-dark-strong);
}
.rr-radios { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.rr-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-ctl);
  font-size: var(--fs-meta);
  color: var(--text-on-dark-link);
  cursor: pointer;
}
.rr-radio input { margin: 0; accent-color: var(--accent); }
.rr-radio:has(input:checked) { border-color: var(--accent); color: var(--text-on-dark-strong); }

.rr-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--text-on-dark-strong);
}
.rr-input {
  min-height: var(--btn-h);
  box-sizing: border-box;
  width: 100%;
  padding: 0 14px;
  background: var(--forest-800);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--text-on-dark);
}
.rr-input::placeholder { color: var(--text-on-dark-faint); }
.rr-input[aria-invalid="true"] { border-color: #FF9A8B; }

.rr-ea__submit {
  min-height: var(--btn-h-lg);
  padding: 0 22px;
  background: var(--accent);
  color: var(--forest-900);
  border: 0;
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
}
.rr-ea__submit:hover { background: #00AE6B; }
.rr-ea__submit[disabled] { opacity: 0.6; cursor: default; }
.rr-ea__fine { margin: 0; font-size: var(--fs-label); color: var(--text-on-dark-faint); }
.rr-ea__fine a { color: var(--text-on-dark-link); }
.rr-ea__error { margin: 0; font-size: var(--fs-meta); color: #FFB4A6; }
.rr-ea__done { margin: 0; font-size: var(--fs-body); color: var(--text-on-dark-strong); }

/* Honeypot: off-screen, never announced, never focusable by tab order. */
.rr-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Aside cards
   ========================================================================== */

.rr-aside {
  flex: 1 1 300px;
  min-width: 0;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.rr-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: var(--space-4);
}
.rr-card__h { margin: 0; font-size: var(--fs-lede); font-weight: 600; line-height: 1.35; }
.rr-card__text { margin: 10px 0 0; font-size: var(--fs-small); color: var(--text-soft); }
.rr-card__label {
  margin: 18px 0 var(--space-1);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--green-700);
}
.rr-card__label--paid {
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
}
.rr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--text-soft);
}

.rr-card--dark {
  background: var(--forest-900);
  color: var(--text-on-dark);
  border: 0;
}
.rr-card--dark .rr-card__label { margin-top: 0; color: var(--accent); }
.rr-card--dark .rr-card__h {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--space-4);
  line-height: 1.15;
  color: var(--text-on-dark-strong);
}
.rr-card--dark .rr-card__text { color: var(--text-on-dark-soft); }
.rr-card--dark a {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.rr-card--dark a:hover { text-decoration: underline; }

.rr-source {
  margin: 4px 0 0;
  font-size: var(--fs-label);
  line-height: 1.6;
  color: var(--text-faint);
}

/* --- Focus ring on the dark surfaces --- */
.rr-summary :focus-visible,
.rr-ea :focus-visible,
.rr-card--dark :focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}
