/* Results page (/score/:id) — instrument-style panel. Reuses site.css's
   tokens only (--ink, --bone, --orange, --stone, --line, --serif, --sans);
   Bodoni Moda for numerals, Manrope for text, matching the rest of the
   site. No new colours. */

.score-page { padding: 32px 0 64px; }

/* Overrides site.css's generic `section { padding: clamp(64px, 9vw, 120px)
   0; }` (marketing-page rhythm) — found live, contributing a real chunk of
   "the results page is too long": every panel here is a literal <section>,
   so it was silently inheriting up to 240px (120 top + 120 bottom) of
   padding meant for the studio's own pages, on top of this file's own
   40px margin-top. */
.panel-section { margin-top: 20px; padding: 0; }
.pending-note { color: var(--stone); }
.business-summary-note { color: var(--stone); font-size: 0.9em; margin-top: -4px; }

/* ---------- typography scale ---------- */
/* One scale for every section's prose, so nothing looks bigger/smaller
   than its neighbour by accident, and a future section needs no
   font-size of its own to fit in — found live: "Do these two first" read
   larger than "The twelve dimensions"/"Foundation" purely because those
   two had (different) per-section overrides and this one had none.
   font-size/line-height/color are inherited CSS properties, so setting
   them once here on .panel-section reaches every descendant paragraph,
   list item, and heading below unless overridden — same reasoning
   docs/RUBRIC.md's report email now shares (see lib/reportEmail.js).
   The score line's own numeral and the plan cards' own price
   (public/assets/plans.css, a component used well beyond this page) are
   the only two exceptions and keep their existing, deliberately large,
   display sizing — this block is placed early in the file specifically
   so that everything below with its own explicit font-size (buttons, the
   dimension/Foundation marks, the score line itself) keeps overriding it
   by ordinary cascade: equal specificity, declared later. The plan card's
   own body text (tagline/feature list/delivery promise) and name sit one
   step above this scale on purpose (--card-body-size/14px — see
   public/assets/plans.css), not at parity with it: a card reads as a
   distinct, bordered component, not just more panel-section prose. */
.panel-section {
  font-size: var(--body-size);
  line-height: 1.6;
  color: var(--stone);
}
.panel-section h2 {
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 16px;
}
.panel-section h3,
.panel-section h4 {
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
}

/* ---------- collapsible sections (twelve dimensions / Foundation /
   "What AI says about you") — native <details>/<summary>, collapsed by
   default; public/assets/score.js remembers a visitor's own choice per
   section in sessionStorage and forces every one open when printing. ---------- */

.collapsible-section > summary {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none; /* Firefox/Chrome: removes the default disclosure triangle */
}
.collapsible-section > summary::-webkit-details-marker { display: none; } /* Safari: same, older marker mechanism */

.collapsible-section > summary h2 { margin-bottom: 0; }

.collapsible-line {
  flex: 1 1 100%;
  order: 3; /* wraps onto its own full-width line under the heading/chevron row */
  /* font-size/color: inherited from .panel-section's typography scale (body tier) */
}

.collapsible-chevron {
  margin-left: auto;
  color: var(--stone);
  font-size: 0.8rem;
}
.collapsible-chevron::before { content: '▾'; }
.collapsible-section[open] > summary .collapsible-chevron::before { content: '▴'; }

.collapsible-body { margin-top: 16px; }

@media print {
  /* A visitor's own collapsed sections must never go missing from a
     printed page — public/assets/score.js's beforeprint handler already
     forces every <details> open; this just drops the now-redundant
     click affordance from the printed output. */
  .collapsible-chevron { display: none; }
}

/* ---------- score line ---------- */

.score-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.score-numeral {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1;
  color: var(--ink);
}
.score-outof {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--stone);
}
.score-foundation {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--stone);
  margin-left: auto;
  align-self: center;
}

/* ---------- group scores (always free) ---------- */
/* One row per group, stacked — not a joined "A 6 of 6 · B 2 of 2 · ..."
   line, which read as a single run-on row on both desktop and mobile. */

ul.group-scores-line {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--stone);
}
.group-scores-line li {
  padding: 6px 0;
}
.group-scores-line li + li {
  border-top: 1px solid var(--line);
}

/* ---------- "Do these two first" ---------- */

.top-fixes-list { list-style: decimal; padding-left: 22px; }
.top-fixes-list li { margin-bottom: 10px; max-width: 62ch; }

/* ---------- Blueprint hook (directly after "Do these two first", before
   the plan cards — lib/scorePage.js's renderBlueprintHook) ---------- */
/* A bordered panel, unlike every plain .panel-section around it — this is
   an offer, not a finding, and should read as one at a glance. */
.blueprint-hook {
  border: 1px solid var(--line);
  padding: 14px 20px;
  /* Tighter than .panel-section's own 20px — the border itself already
     separates this panel from "Do these two first" above it, so the usual
     section-to-section gap (meant for plain, borderless prose) reads as
     more space than a bordered offer panel needs. */
  margin-top: 12px;
}
/* Tighter than .panel-section h2's own 16px — this heading has nothing
   above it inside the same bordered panel, so the usual gap (meant to
   separate a heading from the section before it) isn't needed here. */
.blueprint-hook h2 { margin-bottom: 8px; }
.blueprint-hook-lines { list-style: none; margin: 0 0 12px; }
.blueprint-hook-lines li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.blueprint-hook-lines li:first-child { border-top: none; }
.blueprint-hook-sentence { margin-bottom: 16px; }
.blueprint-hook-cta { display: inline-block; }
.blueprint-hook-delivery { margin: 10px 0 0; }

/* ---------- 12D Blueprint checkout ---------- */

.blueprint-desc { color: var(--stone); max-width: 56ch; margin-bottom: 14px; }
/* .checkout-button, not an id: Phase 4A generalised the Blueprint-only
   checkout button to render per-plan-key ids (public/assets/plans.js) —
   Pulse's #pulse-checkout-button needs the exact same styling. */
.checkout-button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bone);
  cursor: pointer;
  transition: background 0.15s;
}
.checkout-button:hover { background: var(--orange); border-color: var(--orange); }
.checkout-button:disabled { opacity: 0.6; cursor: default; }
.checkout-message { margin-top: 10px; /* font-size/color: inherited (body tier) */ }

/* ---------- the twelve dimensions ---------- */
/* One vertical sequence, single column at every width — not a grid of
   quadrants. Groups stack top to bottom in rubric order (product,
   organisation, person, symbol); each group is full width. */

.dim-groups { max-width: 720px; }

.dim-group + .dim-group { margin-top: 48px; }

.dim-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.dim-group-header h3 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* font-size/color: inherited from .panel-section's typography scale (sub-heading tier) */
}
.dim-group-subtotal {
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--stone);
  white-space: nowrap;
}
.dim-group-desc {
  max-width: 62ch;
  margin: 6px 0 16px;
  /* font-size/color: inherited from .panel-section's typography scale (body tier) */
}

.score-dim-list { list-style: none; }
.dim-row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.dim-row:first-child { border-top: none; }

.dim-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--stone);
}
.dim-mark.mark-full { border-color: var(--ink); color: var(--ink); }
.dim-mark.mark-half { border-color: var(--stone); color: var(--stone); }
.dim-mark.mark-none { border-color: var(--orange); color: var(--orange); }
.dim-mark.mark-pending { border-color: var(--line); color: var(--line); }

.dim-body { flex: 1 1 auto; min-width: 0; }
/* font-size/color: inherited from .panel-section's typography scale (.dim-name is an h4: sub-heading tier; .dim-finding/.dim-fix: body tier) */
.dim-name { font-family: var(--sans); font-weight: 600; margin-bottom: 4px; }
.dim-finding { max-width: 56ch; }
.dim-fix { margin-top: 6px; max-width: 56ch; }
.dim-fix strong { color: var(--ink); }

/* ---------- Foundation ---------- */

.foundation-performance { margin-bottom: 14px; /* font-size/color: inherited (body tier) */ }

.foundation-list { list-style: none; }
.foundation-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.foundation-row:first-child { border-top: none; }
/* Not an h3/h4 (it sits inline with the state/detail in one flex row), so
   the sub-heading tier is given explicitly rather than by tag — same
   role as .dim-name (a bold row label), same size. */
.foundation-check-name { font-weight: 600; font-size: 14px; color: var(--ink); flex: 0 0 auto; }
.foundation-check-state { font-weight: 600; /* font-size: inherited (body tier); colour stays semantic (pass/fail/pending) below */ }
.foundation-row.check-pass .foundation-check-state { color: var(--ink); }
.foundation-row.check-fail .foundation-check-state { color: var(--orange); }
.foundation-row.check-pending .foundation-check-state { color: var(--stone); }
.foundation-check-detail { flex: 1 1 100%; max-width: 60ch; /* font-size/color: inherited (body tier) */ }

/* ---------- "What AI says about you" ---------- */
/* The takeaway sentence itself has no rule of its own — it renders exactly
   once, in the collapsed section's own <summary> line (.collapsible-line),
   not as a separate element in the body (lib/geoPage.js's own comment on
   renderGeoSection explains why). */

.geo-engine { max-width: 640px; }
.geo-engine + .geo-engine { margin-top: 32px; }
.geo-engine h3 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  /* font-size/color: inherited (sub-heading tier) */
}
.geo-engine h4 { font-family: var(--sans); font-weight: 600; margin-bottom: 4px; /* font-size/color: inherited (sub-heading tier) */ }

.geo-block { padding: 14px 0; border-top: 1px solid var(--line); }
.geo-block:first-child { border-top: none; padding-top: 0; }
.geo-asked { margin-bottom: 4px; font-style: italic; /* font-size/color: inherited (body tier) */ }
.geo-answer { max-width: 56ch; white-space: pre-line; /* font-size/color: inherited (body tier) — already stone, so .geo-not-mentioned/.geo-unavailable need no colour override of their own any more */ }
.geo-sources { margin-top: 6px; /* font-size/color: inherited (body tier) */ }

mark.ai-mention {
  background: none;
  color: var(--ink);
  font-weight: 600;
  padding: 0;
}

/* ---------- last line ---------- */

.last-line p { max-width: 62ch; /* font-size/color: inherited (body tier) */ }
.last-line a { color: var(--ink); text-decoration: underline; }

/* ---------- email capture ---------- */

.email-capture-desc { margin-bottom: 14px; max-width: 56ch; /* font-size/color: inherited (body tier) */ }

.email-capture form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 420px;
}
.email-capture input {
  flex: 1 1 220px;
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.email-capture input:focus { border-bottom-color: var(--ink); }
.email-capture button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bone);
  cursor: pointer;
  transition: background 0.15s;
}
.email-capture button:hover { background: var(--orange); border-color: var(--orange); }
.email-capture button:disabled { opacity: 0.6; cursor: default; }
.email-message { margin-top: 10px; /* font-size/color: inherited (body tier) */ }
