/* RBEM local test build — Agile Pangolin branding (visual reference: "Customers and Income" guide).
   Brand: Raleway throughout; dark brown #6f5538 for headings and key accents; light brown #8f6d47 for
   secondary accents; #080808 body text; restrained white and warm beige backgrounds.
   Grade colours follow the approved palette (Strong green, Stable yellow, Exposed amber/orange,
   Fragile red; no blue), are NOT brand colours, and must match rbem/wheel.py PALETTE (tests/test_wheel.py). */

/* Raleway served from this application (SIL Open Font License 1.1) — no external font service. */
@font-face {
  font-family: "Raleway";
  src: url("fonts/Raleway-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("fonts/Raleway-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  /* Agile Pangolin brand */
  --brown: #6f5538;          /* dark brown: primary headings and key accents */
  --brown-light: #8f6d47;    /* light brown: secondary accents */
  --ink: #080808;            /* main body text */
  --beige: #dcd5ce;          /* warm beige blocks, as in the guide */
  --beige-soft: #f4f0eb;     /* lighter warm beige for subtle areas */

  --ink-soft: #3b3631;
  --muted: #5e574f;
  --paper: #ffffff;          /* restrained white page background */
  --card: #ffffff;
  --line: #e1dad2;
  --line-soft: #ece7e1;
  --accent: var(--brown);    /* buttons and links */
  --accent-ink: #ffffff;
  --focus: #e3a21a;

  /* Approved grade palette: band = darker classification colour, fill = light raw-score fill */
  --strong: #2e7d4f;  --strong-fill: #a9d8b5;  --strong-tint: #eaf5ec;
  --stable: #d9ad1c;  --stable-fill: #f5e08c;  --stable-tint: #fcf5d9;
  --exposed: #b35309; --exposed-fill: #f8c48e; --exposed-tint: #fdeedd;
  --fragile: #b3261e; --fragile-fill: #f3a7a3; --fragile-tint: #fbe6e4;
  --prov: #6d5a9c;    --prov-tint: #f0ecf8;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(111, 85, 56, 0.06), 0 4px 14px rgba(111, 85, 56, 0.05);
  /* One brand typeface for headings, body, wheel labels and print */
  --serif: "Raleway", "Segoe UI", Arial, sans-serif;
  --sans: "Raleway", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
/* Lining figures so scores such as 6/9 sit on the line (Raleway defaults to old-style figures). */
body { margin: 0; font-family: var(--sans); line-height: 1.6; color: var(--ink); background: var(--paper);
       font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.wrap { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
.wrap-wide { max-width: 60rem; }
main.wrap { padding-top: 1.75rem; padding-bottom: 3.5rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--brown); letter-spacing: -0.01em; }
h1 { font-size: 1.95rem; line-height: 1.15; margin: 0.25rem 0 0.9rem; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.25rem 0 0.8rem; }
h3 { font-size: 1.12rem; line-height: 1.35; margin: 0; }
h4 { font-size: 0.9rem; font-weight: 700; margin: 1rem 0 0.2rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brown); }
p { margin: 0.5rem 0; }
a { color: var(--accent); }
.small { font-size: 0.875rem; color: var(--muted); }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 600; color: var(--brown-light); margin: 0; }
.print-only { display: none; }

/* Accessibility */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; }
.skip-link:focus { left: 0.5rem; z-index: 10; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Header, banner, footer */
/* Light header so the approved brown-and-grey logo is shown on a suitable background without recolouring. */
.site-header { background: #ffffff; color: var(--ink); border-bottom: 4px solid var(--brown-light); }
.site-header .wrap { padding-top: 0.6rem; padding-bottom: 0.6rem; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.1rem; }
.brand-link { display: block; line-height: 0; }
/* Height only: width follows the logo's own aspect ratio, so it is never stretched or cropped. */
.brand-logo { display: block; height: 4.75rem; width: auto; max-width: 100%; }
.brand-product { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--brown);
                 border-left: 1px solid var(--line); padding-left: 1.1rem; }
.test-banner { background: var(--prov-tint); border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.test-banner .wrap { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.site-footer { background: var(--beige); color: var(--brown); font-size: 0.85rem; }
.site-footer .wrap { padding-top: 1rem; padding-bottom: 2rem; }
/* Embedded layout (default): no header or footer of our own, so the page starts and ends close to
   its content inside the host website's frame. */
body.embedded main.wrap { padding-top: 1.25rem; padding-bottom: 1.5rem; }
body.embedded.journey main.wrap { padding-top: 0.9rem; }
.progress { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; }

/* Tags and badges */
.tag { display: inline-block; font-family: var(--sans); font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
       letter-spacing: 0.05em; padding: 0.1rem 0.45rem; border-radius: 999px; vertical-align: middle; }
.tag-prov { background: var(--prov); color: #fff; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.12rem 0.6rem; border-radius: 999px;
         border: 2px solid currentColor; background: #fff; vertical-align: middle; white-space: nowrap; }
.badge.grade-strong { color: var(--strong); }
.badge.grade-stable { color: #8a6d00; border-color: var(--stable); }
.badge.grade-exposed { color: var(--exposed); }
.badge.grade-fragile { color: var(--fragile); }
.badge-critical { color: #fff; background: var(--fragile); border-color: var(--fragile); }

/* Cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem;
        margin: 1rem 0; box-shadow: var(--shadow); }
.hero { margin: 0.5rem 0 1rem; }
.steps { padding-left: 1.25rem; }
.steps li { margin: 0.35rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.actions form { margin: 0; }
.definition { color: var(--muted); font-size: 1.05rem; }
.instruction { margin-bottom: 1rem; }

/* Buttons */
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); padding: 0.7rem 1.4rem; min-height: 44px;
  text-decoration: none; display: inline-block;
}
button.secondary { background: #fff; color: var(--accent); }
.nav { display: flex; flex-direction: row-reverse; justify-content: space-between; gap: 0.75rem; margin-top: 1.5rem; }

/* Questions and choices */
fieldset { border: 0; margin: 0 0 1.5rem; padding: 0; }
legend { font-weight: 600; font-size: 1.05rem; padding: 0; margin-bottom: 0.4rem; float: left; width: 100%; }
legend + * { clear: both; }
fieldset .options, fieldset .guidance, fieldset .error { clear: both; }
.question { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.qnum { display: inline-block; font-family: var(--sans); font-size: 0.72rem; font-weight: 700; background: var(--brown); color: #fff;
        border-radius: 4px; padding: 0.05rem 0.35rem; margin-right: 0.3rem; vertical-align: middle; }
.guidance { color: var(--muted); font-size: 0.95rem; margin-top: 0; }
.options { display: grid; gap: 0.5rem; }
.option { display: flex; gap: 0.65rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px;
          padding: 0.65rem 0.75rem; background: #fff; cursor: pointer; }
.option:hover { border-color: var(--brown-light); background: var(--beige-soft); }
.option input { margin-top: 0.3rem; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--brown); }
.option input:checked + span { font-weight: 600; }
.option .def { display: block; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
textarea { width: 100%; font: inherit; padding: 0.6rem; border: 1px solid var(--line); border-radius: 8px; }
.connection h2 .num, .num {
  display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; flex: none;
  border-radius: 50%; background: var(--brown); color: #fff; font-family: var(--sans); font-size: 0.95rem; font-weight: 700; }

/* Errors and notices */
.error-summary { border: 3px solid var(--fragile); border-radius: var(--radius); padding: 0.75rem 1rem; background: #fff; margin-bottom: 1rem; }
.error-summary h2 { margin-top: 0; font-size: 1.1rem; }
.error { color: var(--fragile); font-weight: 600; margin: 0.25rem 0 0.5rem; }
.has-error { border-left: 4px solid var(--fragile); padding-left: 0.75rem; }
.notice { background: var(--strong-tint); border-radius: 8px; padding: 0.6rem 0.9rem; }
.warning { background: var(--exposed-tint); border-left: 4px solid var(--exposed); border-radius: 8px; padding: 0.6rem 0.9rem; margin: 1rem 0; }
.missing { color: var(--fragile); }

/* Review */
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.review-head h2 { margin: 0; font-size: 1.1rem; }
.review-section dt { font-weight: 600; margin-top: 0.75rem; }
.review-section dd { margin: 0.15rem 0 0; }

/* ---------------------------------------------------------------------------
   Results
   --------------------------------------------------------------------------- */
.results-hero h1 { margin-bottom: 0.6rem; }
/* Warm beige block with dark text, as in the guide's highlighted panels */
.summary { background: var(--beige); border: 0; box-shadow: none; }
.summary .lead { font-size: 1.12rem; line-height: 1.7; margin: 0; }
.section-intro { color: var(--ink-soft); max-width: 40rem; }

/* Wheel */
.wheel-figure { margin: 0.5rem 0 0; padding: 1rem 0.5rem 0.75rem; }
.wheel { display: block; width: 100%; max-width: 40rem; height: auto; margin: 0 auto; }
.wheel .wheel-label { font-family: var(--sans); }
.wheel .wheel-label-name { font-size: 19px; font-weight: 700; }
.wheel .wheel-label-score { font-size: 17px; }
.wheel .wheel-label-critical { font-size: 15px; font-weight: 700; }
.wheel .wheel-band-label { font-family: var(--sans); }
.wheel-legend { list-style: none; padding: 0; margin: 0.75rem auto 0; max-width: 38rem; display: grid; gap: 0.4rem; font-size: 0.9rem; color: var(--ink-soft); }
.wheel-legend li { display: flex; gap: 0.6rem; align-items: flex-start; }
.swatch { flex: none; width: 1.6rem; height: 1rem; border-radius: 3px; margin-top: 0.2rem; }
.swatch-fill { background: linear-gradient(90deg, var(--strong-fill) 0 25%, var(--stable-fill) 25% 50%, var(--exposed-fill) 50% 75%, var(--fragile-fill) 75%); }
.swatch-band { background: linear-gradient(90deg, var(--strong) 0 25%, var(--stable) 25% 50%, var(--exposed) 50% 75%, var(--fragile) 75%); }
.swatch-dashed { background: var(--fragile); outline: 2px dashed var(--ink); outline-offset: -2px; }
.swatch-critical { background: none; color: var(--fragile); font-weight: 700; text-align: center; line-height: 1rem; }

/* Connections below the wheel (v3.1) */
.connections { display: grid; gap: 1rem; }
.connection-panel { margin: 0; }
.connection-boxes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.sysbox { border: 2px solid var(--line); border-radius: 10px; padding: 0.45rem 0.8rem; display: flex; flex-direction: column; min-width: 10rem; }
.sysbox strong { font-family: var(--serif); color: var(--ink); }
.sysbox span { font-size: 0.85rem; font-weight: 600; }
.grade-tint-strong { background: var(--strong-tint); border-color: var(--strong); }
.grade-tint-stable { background: var(--stable-tint); border-color: var(--stable); }
.grade-tint-exposed { background: var(--exposed-tint); border-color: var(--exposed); }
.grade-tint-fragile { background: var(--fragile-tint); border-color: var(--fragile); }
.arrow { font-size: 1.5rem; color: var(--muted); }
.label { font-weight: 700; }
q.participant { font-style: italic; }

/* Six systems as rows (approved list) */
.legend { list-style: none; padding: 0; font-size: 0.92rem; display: grid; gap: 0.35rem; }
.system-row { background: var(--card); border: 1px solid var(--line); border-left: 7px solid var(--line);
              border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1rem 0; box-shadow: var(--shadow); }
.grade-accent-strong { border-left-color: var(--strong); }
.grade-accent-stable { border-left-color: var(--stable); }
.grade-accent-exposed { border-left-color: var(--exposed); }
.grade-accent-fragile { border-left-color: var(--fragile); }
.neutral-accent { border-left-color: var(--brown); }
.system-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
.system-score { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.system-score meter { width: 6rem; height: 0.8rem; }
.raw { font-weight: 700; font-variant-numeric: tabular-nums; }
.grade-note { font-size: 0.95rem; background: var(--fragile-tint); border-radius: 8px; padding: 0.45rem 0.7rem; }
.finding { border-top: 1px solid var(--line-soft); padding-top: 0.55rem; margin-top: 0.65rem; }
.finding-label { font-weight: 700; margin-bottom: 0.1rem; }
details summary { cursor: pointer; color: var(--accent); font-size: 0.92rem; }

/* Stress test */
.affected { padding-left: 1.2rem; }
.affected li { margin: 0.6rem 0; }
.reveals { background: var(--beige-soft); border-radius: 8px; padding: 0.75rem 0.9rem; margin-top: 0.75rem; }
.reveals h3 { font-size: 1rem; margin-bottom: 0.3rem; }

/* Priorities */
.priorities { display: grid; gap: 1rem; }
.priority-card { background: var(--card); border: 1px solid var(--line); border-top: 7px solid var(--brown);
                 border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.priority-card.grade-accent-strong { border-top-color: var(--strong); border-left-color: var(--line); }
.priority-card.grade-accent-stable { border-top-color: var(--stable); border-left-color: var(--line); }
.priority-card.grade-accent-exposed { border-top-color: var(--exposed); border-left-color: var(--line); }
.priority-card.grade-accent-fragile { border-top-color: var(--fragile); border-left-color: var(--line); }
.priority-card.neutral-accent { border-top-color: var(--brown); }
.priority-num { text-transform: uppercase; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.priority-meta { font-size: 0.9rem; color: var(--muted); }
.step-type { color: var(--brown); }
.support-note { border-top: 1px solid var(--line-soft); padding-top: 0.5rem; margin-top: 0.75rem; }
.connection-intro { font-weight: 600; }

/* Tester diagnostics: never customer-facing, never printed */
.diagnostics { margin-top: 2.5rem; font-size: 0.85rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; }

.connections-heading { margin: 1.75rem 0 0.75rem; font-size: 1.2rem; }

/* ---------------------------------------------------------------------------
   Questionnaire journey (redesign, D45): one question per screen, spacious and calm
   --------------------------------------------------------------------------- */
/* Compact header on question screens so a whole question fits on a normal desktop screen. */
.journey .brand-logo { height: 3.25rem; }
.journey .site-header .wrap { padding-top: 0.4rem; padding-bottom: 0.4rem; }
.journey .test-banner { font-size: 0.8rem; }
.journey .test-banner .wrap { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.journey-main { max-width: 44rem; padding-top: 0.9rem; }

/* One continuous, understated progress bar for the whole journey (no percentages shown). */
.journey-progress { background: var(--beige-soft); border-bottom: 1px solid var(--line-soft); }
.journey-progress .wrap { max-width: 44rem; padding-top: 0.45rem; padding-bottom: 0.35rem; }
.progress-bar { display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden;
                background: var(--line); color: var(--brown-light); -webkit-appearance: none; appearance: none; }
.progress-bar::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.progress-bar::-webkit-progress-value { background: var(--brown-light); border-radius: 999px; transition: width 0.3s ease; }
.progress-bar::-moz-progress-bar { background: var(--brown-light); border-radius: 999px; }
.progress-label { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }
.progress-section { font-weight: 700; color: var(--brown); }

.screen-head { margin-bottom: 0.7rem; }
.scenario-hint { margin: 0.6rem 0 0; padding-left: 0.75rem; border-left: 3px solid var(--brown-light); }
.connection-guidance-heading { margin-top: 1rem; text-transform: none; letter-spacing: 0; font-size: 0.95rem; }

/* Connections screens: more breathing room (owner feedback) */
.connection-screen .screen-head { margin: 0.75rem 0 1.5rem; }
.connection-screen .screen-head h1 { margin: 0.35rem 0 0.6rem; }
.connection-screen .diagram { margin: 0.5rem 0 1.75rem; }
.connection-screen .card { padding: 1.5rem 1.5rem 0.5rem; margin: 0 0 1.25rem; }
.connection-screen .field { margin-bottom: 1.6rem; }
.connection-screen .field-label { display: block; margin-bottom: 0.45rem; }
.connection-screen .definitions { margin: 0 0 1.25rem; }
.connection-screen .nav { margin-top: 1.75rem; }
.screen-intro { margin: 0.75rem 0 1.75rem; }
.screen-intro p { margin: 0.9rem 0; }
.screen-head .definition { font-size: 0.98rem; margin: 0.25rem 0 0; }
.screen-head h1 { margin-top: 0.4rem; }
.screen-intro p { font-size: 1.08rem; max-width: 38rem; line-height: 1.7; }
.screen-form .question { background: none; border: 0; box-shadow: none; padding: 0; }
.question legend { float: none; width: 100%; margin-bottom: 0.7rem; }
.question-heading { display: block; font-size: 1.35rem; line-height: 1.28; font-weight: 700; color: var(--ink); margin: 0; }
/* Headings receive focus only so screen readers start at the question; they are not controls, so no
   focus ring is drawn on them (owner feedback: no orange outline around the heading area). */
[tabindex="-1"][data-focus-on-load]:not(.error-summary):focus,
[tabindex="-1"][data-focus-on-load]:not(.error-summary):focus-visible { outline: none; }
.question + .question { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }

/* Large answer cards: whole card is the click/touch target; the radio stays visible for clarity. */
.cards { display: grid; gap: 0.5rem; }
.answer-card { position: relative; display: flex; gap: 0.8rem; align-items: flex-start; min-height: 3rem;
               padding: 0.7rem 1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff;
               cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.answer-card:hover { border-color: var(--brown-light); background: var(--beige-soft); }
.answer-card input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.2rem 0 0; accent-color: var(--brown); }
.answer-card:has(input:checked) { border-color: var(--brown); background: var(--beige-soft); }
.answer-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.answer-card input:checked + .answer-text { font-weight: 600; }
.answer-card .def { display: block; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
/* Brief confirmation after a confirmed save */
.answer-card.is-saved::after { content: "✓"; position: absolute; right: 0.9rem; top: 0.75rem; font-weight: 700;
                               color: var(--strong); font-size: 1.2rem; }
/* About 600 ms of clear confirmation after the server confirms the save, before moving on. */
.screen-form.is-confirmed .answer-card.is-saved { border-color: var(--strong); background: var(--strong-tint); }
.screen-form.is-confirmed .save-status { color: var(--strong); font-weight: 600; }
/* Continue visually hidden for mouse/touch users with automatic advance on (single-answer screens).
   It stays focusable and is shown again as soon as it receives keyboard focus. */
.screen-form.hide-continue .nav .continue:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; min-height: 0; }
.screen-form.hide-continue .nav { justify-content: flex-end; }
.screen-form.is-saving .answer-card { cursor: progress; }
.save-status { min-height: 1.4rem; margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--muted); }
.save-status.is-error { color: var(--fragile); font-weight: 600; }
.save-status button { margin-left: 0.5rem; padding: 0.3rem 0.9rem; min-height: 36px; }

/* Continue on the right, Back on the left */
.journey .nav { align-items: center; margin-top: 0.6rem; }
.button.secondary, a.button.secondary { background: #fff; color: var(--accent); }
.autoadvance { margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--line-soft); font-size: 0.9rem; }
.autoadvance label { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 600; cursor: pointer; }
.autoadvance input { width: 1.1rem; height: 1.1rem; accent-color: var(--brown); }
.autoadvance .hint { margin: 0.2rem 0 0; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.35rem; }

/* Connections and stress-test fields */
.field { margin-bottom: 1.1rem; }
.field-label { font-weight: 600; }
select { width: 100%; font: inherit; padding: 0.65rem 0.6rem; min-height: 48px; border: 2px solid var(--line);
         border-radius: 8px; background: #fff; color: var(--ink); }
select:focus-visible, textarea:focus-visible { border-color: var(--brown); }
.diagram { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.25rem 0 1rem; }
.diagram-box { flex: 1 1 10rem; max-width: 16rem; text-align: center; padding: 0.7rem 0.9rem; border: 2px solid var(--brown-light);
               border-radius: 10px; background: var(--beige-soft); font-weight: 700; color: var(--brown); }
.diagram-box.is-empty { border-style: dashed; color: var(--muted); font-weight: 600; background: #fff; }
.diagram-arrow { font-size: 1.6rem; color: var(--brown-light); }
.definitions { margin: 0.5rem 0 0; }
.definitions dt { font-weight: 700; margin-top: 0.6rem; }
.definitions dd { margin: 0.1rem 0 0; color: var(--ink-soft); }
.reconfirm { margin-top: 0; }

/* Welcome: continuing and starting new are clearly different */
.choice-card h2 { margin-top: 0; font-size: 1.25rem; }
.continue-card { border-left: 6px solid var(--brown); }
.new-card { background: var(--beige-soft); box-shadow: none; }
.assessment-list { padding-left: 1.2rem; }
.assessment-list li { margin: 0.35rem 0; }
.change-link { margin-left: 0.5rem; font-size: 0.9rem; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (min-width: 40rem) {
  h1 { font-size: 2.2rem; }
}

/* Phones: let the wheel use the full screen width so its labels stay as large as possible */
@media (max-width: 39.99rem) {
  .brand-logo { height: 3.75rem; }
  .brand-product { border-left: 0; padding-left: 0; font-size: 1rem; width: 100%; }
  .wheel-figure { margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; padding: 0.5rem 0.25rem; }
  .wheel-legend { padding: 0 0.75rem; }
  .sysbox { min-width: 0; }
  .connection-boxes { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.4rem 0.6rem; }
  .connection-boxes .sysbox { grid-column: 2; }
  .connection-boxes .arrow { grid-column: 2; transform: rotate(90deg); width: 1.5rem; text-align: center; line-height: 1; }
  .journey .brand-logo { height: 2.6rem; }
  .journey .brand-product { display: none; }
  .question-heading { font-size: 1.2rem; }
  .diagram { flex-direction: column; gap: 0.3rem; }
  .connection-screen .card { padding: 1.1rem 1rem 0.25rem; }
  .diagram-box { width: 100%; max-width: none; flex-basis: auto; }
  .diagram-arrow { transform: rotate(90deg); }
  .nav { flex-direction: column; align-items: stretch; }
  .nav .button, .nav button { width: 100%; text-align: center; }
}

/* ---------------------------------------------------------------------------
   Print / Save as PDF (A4 portrait)
   --------------------------------------------------------------------------- */
@page { size: A4; margin: 14mm 14mm 16mm; }

@media print {
  html { font-size: 10.5pt; }
  body { background: #fff; color: #000; line-height: 1.45; }
  .wrap, .wrap-wide { max-width: none; padding: 0; }
  main.wrap { padding: 0; }
  .skip-link, .test-banner, .site-footer, .actions, .nav, form, .diagnostics, details, .no-print { display: none !important; }
  .print-only { display: block; }
  .site-header { background: #fff; color: #000; border-bottom: 2px solid var(--brown-light); margin-bottom: 4mm; }
  .site-header .wrap { padding: 0 0 2mm; }
  .brand-logo { height: 14mm; width: auto; }
  .card, .system-row, .priority-card, .question { box-shadow: none; }
  .card, .system-row, .priority-card { border-color: #cfc6bc; }
  .summary { background: var(--beige); }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 18pt; margin-bottom: 2mm; }
  h2 { margin-top: 5mm; font-size: 14pt; }
  .summary { padding: 3mm 4mm; }
  .summary .lead { font-size: 10.5pt; line-height: 1.5; }
  .section-intro { font-size: 9pt; margin: 0 0 1mm; }
  .wheel-figure { padding: 2mm; margin-top: 2mm; }
  .wheel { max-width: 104mm; }
  .wheel-legend { font-size: 8.5pt; gap: 1mm; margin-top: 1mm; }
  .wheel-figure, .connection-panel, .system-row, .priority-card, .finding, .reveals, .summary { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  .connections-heading { break-before: page; margin-top: 0; }
  .systems-section { break-before: page; }
  .priorities { display: block; }
  .priority-card { margin-bottom: 3mm; padding: 3mm 4mm; }
  .priority-card h4 { margin: 2mm 0 0.5mm; }
  .priority-card p { margin: 0.5mm 0; }
  .tag-prov { border: 1px solid var(--prov); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-note { font-size: 8pt; color: #555; margin: 0 0 2mm; }
}
