/* ==========================================================================
   Core Values Exercise stylesheet
   Dark by default, light on request or by system preference.
   ========================================================================== */

:root {
  --bg: #0b1020;
  --bg-elev: #121a31;
  --bg-elev-2: #17203c;
  --line: #253156;
  --line-soft: #1c2645;
  --text: #eaf0ff;
  --text-dim: #9db0d8;
  --text-faint: #6f83ad;
  --accent: #4d8dff;
  --accent-strong: #2f6ff0;
  --accent-ink: #ffffff;
  --accent-wash: rgba(77, 141, 255, 0.14);
  --yes: #6d6af2;
  --yes-wash: rgba(109, 106, 242, 0.16);
  --mid: #45a8f5;
  --mid-wash: rgba(69, 168, 245, 0.15);
  --no: #b18cff;
  --no-wash: rgba(177, 140, 255, 0.16);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --radius-sm: 11px;
  --maxw: 780px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --step: 200ms;

  /* Type scale. One ladder, used everywhere, so hierarchy stays consistent:
     brand > section title > focal word > tier/stat > section head >
     body > small (secondary) > xs (uppercase micro-labels). */
  --fs-brand: clamp(1.6rem, 5.5vw, 2.4rem);
  --fs-title: clamp(1.5rem, 4vw, 2rem);
  --fs-focal: clamp(1.7rem, 6vw, 2.3rem);
  --fs-tier: 1.375rem;
  --fs-stat: 1.5rem;
  --fs-section: 1.125rem;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
}

:root[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-elev: #ffffff;
  --bg-elev-2: #eef2fb;
  --line: #d3dcee;
  --line-soft: #e4eaf7;
  --text: #101829;
  --text-dim: #4e5d7c;
  --text-faint: #75839f;
  --accent: #2f6ff0;
  --accent-strong: #1e58cf;
  --accent-ink: #ffffff;
  --accent-wash: rgba(47, 111, 240, 0.1);
  --yes: #4f46e5;
  --yes-wash: rgba(79, 70, 229, 0.12);
  --mid: #1a7fc7;
  --mid-wash: rgba(26, 127, 199, 0.12);
  --no: #7b5bd4;
  --no-wash: rgba(123, 91, 212, 0.12);
  --shadow: 0 16px 38px rgba(19, 36, 74, 0.13);
  --shadow-sm: 0 3px 12px rgba(19, 36, 74, 0.09);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f5f7fc;
    --bg-elev: #ffffff;
    --bg-elev-2: #eef2fb;
    --line: #d3dcee;
    --line-soft: #e4eaf7;
    --text: #101829;
    --text-dim: #4e5d7c;
    --text-faint: #75839f;
    --accent: #2f6ff0;
    --accent-strong: #1e58cf;
    --accent-ink: #ffffff;
    --accent-wash: rgba(47, 111, 240, 0.1);
    --yes: #4f46e5;
    --yes-wash: rgba(79, 70, 229, 0.12);
    --mid: #b8811a;
    --mid-wash: rgba(184, 129, 26, 0.13);
    --no: #7b5bd4;
    --no-wash: rgba(123, 91, 212, 0.12);
    --shadow: 0 16px 38px rgba(19, 36, 74, 0.13);
    --shadow-sm: 0 3px 12px rgba(19, 36, 74, 0.09);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(58rem 30rem at 12% -8%, var(--accent-wash), transparent 65%),
    radial-gradient(46rem 26rem at 92% 4%, var(--yes-wash), transparent 62%);
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.018em; margin: 0; }
p { margin: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

.muted { color: var(--text-dim); font-weight: 400; }

/* ------------------------------- top bar -------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex; align-items: center; gap: 0.55rem;
}

.wordmark { color: var(--accent); font-size: 1.5rem; }
/* The wordmark is the page title, so it stays the largest type anywhere on
   screen: this clamp sits above the value-card name at every viewport width. */
.wordmark-text { font-weight: 700; letter-spacing: -0.01em; font-size: var(--fs-brand); }
.topbar-actions { margin-left: auto; display: flex; gap: 0.4rem; }

.icon-btn {
  background: transparent; border: 1px solid var(--line);
  color: var(--text-dim); border-radius: 999px;
  padding: 0.34rem 0.78rem; font: inherit; font-size: var(--fs-sm);
  cursor: pointer; transition: color var(--step), border-color var(--step), background var(--step);
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-wash); }

/* Sun / moon theme toggle: keep the glyph big and bold so it reads at a glance. */
#themeBtn { padding: 0.28rem 0.6rem; }
#themeBtn [data-theme-icon] { font-size: 1.3rem; line-height: 1; }
/* Auto mode: a day/night split circle (yellow sun half, black moon half). */
#themeBtn [data-theme-icon].auto-dot {
  display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em;
  border-radius: 50%; border: 1px solid rgba(128, 128, 128, 0.45);
  background: linear-gradient(90deg, #f6c945 0 50%, #101010 50% 100%);
}

/* ------------------------------- stepper -------------------------------- */

.stepper { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem 0.6rem; }

.stepper-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.4rem;
}
.stepper-list li { flex: 1; display: flex; flex-direction: column; }

/* The active section's name, centred over its own bar segment. */
.stepper-list .lbl {
  min-height: 1.15em; margin-bottom: 0.4rem; line-height: 1.15; text-align: center;
  font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); font-weight: 650; white-space: nowrap;
}

.stepper-list .bar {
  display: block; height: 3px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.stepper-list .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 320ms ease; }
/* ------------------------------- layout --------------------------------- */

.wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 2rem 1.25rem 3rem;
  flex: 1;
}

/* Fade only, no transform: a transform here would become the containing block
   for the fixed dragged card on the ranking screen and throw its position off. */
.screen { animation: rise 300ms ease both; }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }

.eyebrow {
  font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 0.55rem;
}

/* -------------------------------- intro --------------------------------- */

/* ---------------------------- instructions ------------------------------ */

.instructions {
  display: grid; gap: 0.9rem; color: var(--text-dim);
  font-size: var(--fs-body);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 1.2rem 0;
}

/* Instruction-page actions sit in normal flow, not pinned to the corner. */
/* Single-action page buttons (Next between pages): centered, one shared size. */
.page-actions { margin-top: 1.6rem; display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.page-actions .btn { min-width: 10rem; }
.instructions p { color: var(--text-dim); }
.rating-list {
  margin: 0.15rem 0; padding-left: 1.35rem;
  display: grid; gap: 0.4rem;
  color: var(--text); font-weight: 640;
}
.rating-list li { padding-left: 0.15rem; }

/* ----------------------------- ranking list ------------------------------ */
.rank-list { list-style: none; margin: 1.2rem 0; padding: 0; display: grid; gap: 0.5rem; }
.rank-row {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  transition: opacity var(--step), border-color var(--step), box-shadow var(--step), transform var(--step);
}
.rank-num { flex: none; width: 1.7rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.rank-body { flex: 1; min-width: 0; }
.rank-name { display: block; font-weight: 640; }
.rank-desc { display: block; font-size: var(--fs-sm); color: var(--text-dim); }
.rank-handle { flex: none; cursor: grab; color: var(--text-faint); font-size: 1.15rem; line-height: 1; padding: 0.2rem 0.4rem; touch-action: none; user-select: none; }
.rank-handle:active { cursor: grabbing; }
/* The dragged card lifts like it's being held: bigger, tilted, shadowed. */
.rank-row.dragging { border-color: var(--accent); box-shadow: var(--shadow); transform: scale(1.03) rotate(-1.5deg); }
.rank-row.below-cut { opacity: 0.5; }
.rank-row.below-cut .rank-num { color: var(--text-faint); }
/* Standalone tier dividers between rows. Not attached to any card, so a
   dragged card never carries its header away. */
/* All three tier headers (Core / Secondary / Values) share one style. */
.rank-tier {
  list-style: none; line-height: 1; text-transform: uppercase;
  color: var(--accent); font-size: var(--fs-tier); letter-spacing: 0.01em; font-weight: 800;
  margin: 1rem 0 0.15rem;
}
.rank-tier:first-child { margin-top: 0; }
.rank-list { margin-top: 1.2rem; }
/* The gap left behind is a quiet resting slot, not a highlighted box. */
/* The single drop target: a clear tinted slot, not a card, so the held card
   and its landing spot never read as two blanks. */
.rank-placeholder { border: 2px dashed var(--accent); border-radius: var(--radius-sm); background: var(--accent-wash); list-style: none; }

/* --------------------------- sort handoff summary ------------------------ */
/* A read-only tally: hairline rows, no fill, so it never reads like buttons. */
.summary-list { list-style: none; margin: 1.6rem 0; padding: 0; }
.summary-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid var(--line-soft);
}
.summary-list li:first-child { border-top: 1px solid var(--line-soft); }
.summary-label { font-weight: 640; }
.summary-count { font-size: var(--fs-stat); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
/* Tint each count to its pile; the labels stay in the default text colour. */
.summary-count.t-yes { color: var(--yes); }
.summary-count.t-mid { color: var(--mid); }
.summary-count.t-no  { color: var(--no); }
.start-form { margin-top: 2rem; }
.start-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.text-input {
  flex: 1 1 15rem; min-width: 0;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.78rem 0.95rem; font: inherit;
  transition: border-color var(--step), box-shadow var(--step);
}
.text-input::placeholder { color: var(--text-faint); }
.text-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.text-input.input-error, .text-input.input-error:focus {
  border-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.28) !important;
}


.fineprint { margin-top: 0.85rem; font-size: var(--fs-sm); font-style: italic; color: var(--text-faint); }

/* -------------------------------- buttons -------------------------------- */

.btn {
  font: inherit; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 0.78rem 1.3rem; cursor: pointer;
  transition: transform 120ms ease, background var(--step), border-color var(--step), color var(--step), opacity var(--step);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* ------------------------------ round shell ------------------------------ */

.round-head { margin-bottom: 1.4rem; }
.round-head h1 { font-size: var(--fs-title); margin-bottom: 0.4rem; }
.round-sub { color: var(--text-dim); font-size: var(--fs-sm); }
.round-sub.tagline { font-style: italic; }

/* --------------- kept-values list (start of Rate Others) -----------------
 * Deliberately flat: plain text with a small accent dot, so it reads as a
 * display list and never as a row of clickable buttons.
 * ------------------------------------------------------------------------ */
.value-grid {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.5rem 1.1rem;
}
/* When the grid stands alone (no instructions note under it), frame it with
   the same hairlines that separate sections elsewhere. */
#screen-rankintro .value-grid {
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 1.3rem 0; margin-bottom: 0;
}
.value-grid li {
  display: flex; align-items: baseline; gap: 0.55rem;
  font-size: var(--fs-body); color: var(--text);
}
.value-grid li::before {
  content: ""; flex: none; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translateY(-0.15em);
}

.progress { margin-bottom: 0.85rem; }
.progress-foot { margin-top: 1.35rem; margin-bottom: 0; }
.progress-meta {
  display: flex; justify-content: center; gap: 1rem;
  font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: 0.4rem;
}
.progress-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 260ms ease; }

/* ------------------------------- the card -------------------------------- */

.card-stage { perspective: 1000px; margin-bottom: 0.7rem; }

.value-card {
  /* Grounded between hairlines, no fill, so it never reads like the buttons. */
  background: none; border: none; box-shadow: none; cursor: default;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 1.6rem 1.2rem; min-height: 7rem;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center;
}
.value-name { font-size: var(--fs-focal); margin-bottom: 0.6rem; }
.value-desc { color: var(--text-dim); font-size: var(--fs-body); max-width: 52ch; margin: 0.1rem auto 0; }

.value-card[data-leaving="me"] { animation: flyRight 200ms ease forwards; }
.value-card[data-leaving="notMe"] { animation: flyLeft 200ms ease forwards; }
.value-card[data-leaving="meh"] { animation: flyDown 200ms ease forwards; }
.value-card[data-entering] { animation: rise 220ms ease both; }

@keyframes flyRight { to { opacity: 0; transform: translateX(28%) rotate(7deg); } }
@keyframes flyLeft  { to { opacity: 0; transform: translateX(-28%) rotate(-7deg); } }
@keyframes flyDown  { to { opacity: 0; transform: translateY(16%) scale(0.94); } }

/* ------------------------------- choices --------------------------------- */

.choices { display: grid; gap: 0.6rem; }
.choices-3 { grid-template-columns: 1fr; }
.choices-2 { grid-template-columns: 1fr 1fr; }

@media (min-width: 620px) {
  .choices-3 { grid-template-columns: repeat(3, 1fr); }
}

.btn-choice {
  background: var(--bg-elev); border-color: var(--line); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.95rem 1rem;
}
/* Choices sit flat and neutral, lighting up in their own colour on hover. */
.choice-yes:hover { border-color: var(--yes); background: var(--yes-wash); }
.choice-mid:hover { border-color: var(--mid); background: var(--mid-wash); }
.choice-no:hover  { border-color: var(--no);  background: var(--no-wash); }

.choice-yes:active { background: var(--yes); border-color: var(--yes); color: #fff; }
.choice-mid:active { background: var(--mid); border-color: var(--mid); color: #fff; }
.choice-no:active  { background: var(--no);  border-color: var(--no);  color: #fff; }

@media (min-width: 620px) {
  .choices-3 { grid-template-areas: "no mid yes"; }
  .choices-3 .choice-no  { grid-area: no; }
  .choices-3 .choice-mid { grid-area: mid; }
  .choices-3 .choice-yes { grid-area: yes; }
  .choices-2 { grid-template-areas: "yes no"; }
  .choices-2 .choice-no  { grid-area: no; }
  .choices-2 .choice-yes { grid-area: yes; }
}

.round-foot {
  margin-top: 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.round-foot .btn { padding: 0.5rem 0.95rem; font-size: var(--fs-sm); }
.tally { font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tally strong { color: var(--text); }
/* Each running count is tinted to match its choice button. */
.tally .t-yes, .tally .t-yes strong { color: var(--yes); }
.tally .t-mid, .tally .t-mid strong { color: var(--mid); }
.tally .t-no,  .tally .t-no strong  { color: var(--no); }

.hint {
  font-size: var(--fs-sm); color: var(--text-dim);
  background: var(--bg-elev); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 0.75rem 0.95rem; margin-bottom: 1rem;
}

/* -------------------------- selectable value list ------------------------- */

.list-scroll {
  max-height: 52vh; overflow-y: auto;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--bg-elev); padding: 0.45rem;
  display: grid; gap: 0.4rem;
  overscroll-behavior: contain;
}

.pick {
  width: 100%; text-align: left; font: inherit; color: var(--text);
  background: transparent; border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.72rem 0.85rem;
  display: flex; align-items: center; gap: 0.75rem; cursor: pointer;
  transition: border-color var(--step), background var(--step), opacity var(--step);
}
.pick:hover:not(:disabled) { border-color: var(--accent); }
.pick:disabled { opacity: 0.4; cursor: not-allowed; }

.pick .box {
  flex: none; width: 1.22rem; height: 1.22rem; border-radius: 6px;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 0.72rem; color: transparent; transition: all var(--step);
}
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.pick[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.pick .txt { min-width: 0; }
.pick .nm { font-weight: 640; display: block; }
.pick .ds { font-size: var(--fs-sm); color: var(--text-dim); display: block; }
.pick .tag {
  margin-left: auto; flex: none;
  font-size: 0.63rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-wash);
  border-radius: 999px; padding: 0.16rem 0.5rem; font-weight: 700;
}

.sticky-actions {
  position: sticky; bottom: 0; margin-top: 1.1rem;
  padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap;
}

/* ------------------------------- results --------------------------------- */

.results-head { margin-bottom: 1.6rem; }
.results-head h1 { font-size: var(--fs-title); margin-bottom: 0.4rem; }

/* Hairline-divided rows, no fill, so the list never reads like buttons. */
.results-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.results-list li:not(.results-tier) { padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--line-soft); }
.results-list li:first-child { border-top: 1px solid var(--line-soft); }
/* "Secondary Values" matches the "Core Values" title above it. */
.results-list .results-tier {
  background: none; border: none; padding: 0; margin: 1.7rem 0 0.6rem;
  font-size: var(--fs-title); font-weight: 700; color: var(--text);
  letter-spacing: -0.018em; text-transform: none;
}
.results-list .rn { font-weight: 650; }
.results-list .rd { font-size: var(--fs-sm); color: var(--text-dim); }

/* One centered, wide "Save as PDF"; Start Over lives in the header. */
.export-bar { margin-top: 1.6rem; display: flex; justify-content: center; }
.export-bar .btn { min-width: 16rem; }

.breakdown {
  background: var(--bg-elev); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.breakdown h2 { font-size: var(--fs-section); margin-bottom: 0.35rem; }

/* ------------------------------ radar chart ------------------------------
 * Hand-rolled SVG spider chart: six axes, integer grid rings, one filled
 * shape. Colours come from the theme so it works in light and dark.
 * ----------------------------------------------------------------------- */
.radar { display: block; width: 100%; max-width: 26rem; height: auto; margin: 0.4rem auto 0; }
.radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-spoke { stroke: var(--line); stroke-width: 1; }
.radar-area { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--accent); }
.radar-label { fill: var(--text); font-size: 12px; font-weight: 600; dominant-baseline: middle; }
.radar-count { fill: var(--text-dim); font-size: 11px; font-variant-numeric: tabular-nums; dominant-baseline: middle; }

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

.site-foot {
  position: relative; z-index: 1;
  text-align: center; padding: 1.5rem 1.25rem 2.5rem;
  font-size: var(--fs-sm); color: var(--text-faint);
}
.site-foot::before {
  content: ""; display: block; width: 2.5rem; height: 1px;
  margin: 0 auto 1.25rem; background: var(--line);
}

/* ------------------------------ preferences ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* -------------------------- PDF report (print) --------------------------- */
/* "Save PDF" builds #report and opens the print dialog; choosing "Save as
   PDF" produces this styled, light-themed document. Backgrounds are forced on
   so the header/footer bands and bars survive the export. Extend buildReport()
   and these rules for more pages, branding, or richer layout. */

.report { display: none; }

@media print {
  @page { margin: 0; }
  html, body { background: #fff; margin: 0; }
  body::before, .topbar, main, .skip-link, .site-foot { display: none !important; }

  .report {
    display: block; color: #101829; background: #fff; font-family: var(--font);
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  .report-head { background: #2f6ff0; color: #fff; padding: 34px 46px 28px; }
  .report-brand { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
  .report-sub { font-size: 13px; opacity: 0.92; margin: 6px 0 0; }

  .report-body { padding: 30px 46px 8px; }

  /* Every section header (Core / Secondary / Values Cluster) is one type. */
  .report-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 0 0 24px; }
  .report-col { break-inside: avoid; }
  .rv-tier, .report-clusters h2 {
    font-size: 15px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 700;
    color: #2f6ff0; margin: 0 0 11px; padding-bottom: 6px; border-bottom: 1px solid #d3dcee;
  }
  .report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .report-list li { break-inside: avoid; border-left: 3px solid #2f6ff0; padding: 1px 0 1px 12px; }
  .rv-name { display: block; font-weight: 700; font-size: 15px; }
  .rv-desc { display: block; font-size: 10.5px; color: #4e5d7c; margin-top: 1px; }
  /* Fixed ink colours so the radar prints cleanly on white. */
  .report .radar { max-width: 340px; margin: 0 auto; }
  .report .radar-grid,
  .report .radar-spoke { stroke: #d3dcee; }
  .report .radar-area { fill: rgba(47, 111, 240, 0.16); stroke: #2f6ff0; }
  .report .radar-dot { fill: #2f6ff0; }
  .report .radar-label { fill: #1c2740; }
  .report .radar-count { fill: #4e5d7c; }

  .report-foot { margin-top: 26px; padding: 15px 46px;
    border-top: 1px solid #d3dcee; color: #75839f; font-size: 10.5px;
    display: flex; justify-content: space-between; }
}
