/* My Knee Score: Advanced section. Tokens and base styles mirror ../index.html */
:root {
  --green-deep: #0e2b22;
  --green-ink:  #16382d;
  --green-soft: #23503f;
  --sage:       #7c9284;
  --gold:       #b58f47;
  --gold-pale:  #e6d5ac;
  --ivory:      #faf7ef;
  --paper:      #f3efe3;
  --text:       #22312a;
  --muted:      #45564c;
  --line:       rgba(22, 56, 45, 0.16);
  --warn:       #8c4a2f;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  font-family: var(--body);
  font-size: clamp(1.0rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  color: var(--text);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { width: min(1080px, 92%); margin-inline: auto; }
.wrap.narrow { width: min(760px, 92%); }
a { color: var(--green-ink); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
.eyebrow {
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
}
.eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(181,143,71,0.5); display: inline-block; padding: 0.3rem 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; color: var(--green-ink); }
h1 { font-size: clamp(2.2rem, 1.6rem + 2.8vw, 3.8rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); }

/* Header */
header {
  background: var(--green-deep); color: var(--ivory);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid rgba(230, 213, 172, 0.25);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.wordmark { font-size: 1.55rem; font-weight: 700; color: var(--ivory); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark span { color: var(--gold-pale); }
.nav ul { display: flex; gap: clamp(0.9rem, 2.5vw, 2rem); list-style: none; align-items: center; }
.nav ul a { color: var(--ivory); text-decoration: none; font-size: 1.1rem; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color 0.2s; }
.nav ul a:hover, .nav ul a[aria-current="page"] { border-color: var(--gold); }
.nav .start-link { color: var(--green-deep); background: var(--gold-pale); padding: 0.45rem 1rem; border-radius: 999px; font-weight: 600; border-bottom: none; }
.nav .start-link:hover { background: #fff; }
@media (max-width: 1100px) {
  .wordmark { font-size: 1.35rem; }
  .nav ul { gap: clamp(0.6rem, 1.6vw, 1.1rem); }
  .nav ul a { font-size: 0.95rem; white-space: nowrap; }
  .nav .start-link { padding: 0.4rem 0.85rem; }
}
@media (max-width: 760px) {
  .wordmark { font-size: 1.25rem; }
  .nav ul { gap: 0.6rem; }
  .nav ul a { font-size: 0.9rem; }
}
@media (max-width: 700px) {
  .nav ul li:not(:last-child):not(.nav-adv) { display: none; }
  .nav ul { gap: 0.9rem; }
  .nav .nav-long { display: none; }
}
@media (max-width: 700px) {
  .nav ul a { white-space: nowrap; }
}
@media (max-width: 440px) {
  .nav { gap: 0.6rem; }
  .wordmark { font-size: 1.25rem; }
  .nav ul { gap: 0.7rem; }
  .nav ul a { font-size: 0.95rem; }
  .nav .start-link { padding: 0.4rem 0.75rem; }
}
@media (max-width: 350px) {
  .wordmark { font-size: 1.1rem; }
  .nav ul { gap: 0.5rem; }
  .nav ul a { font-size: 0.88rem; }
  .nav .start-link { padding: 0.35rem 0.6rem; }
}

/* Buttons */
.btn {
  display: inline-block; font-family: var(--body); font-weight: 600; font-size: 1rem;
  text-decoration: none; border-radius: 999px; padding: 0.85rem 1.7rem; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--green-deep); }
.btn-gold:hover { background: var(--gold-pale); }
.btn-ghost { background: transparent; color: var(--ivory); border-color: rgba(250,247,239,0.45); }
.btn-ghost:hover { border-color: var(--gold-pale); color: var(--gold-pale); }
.btn-green { background: var(--green-ink); color: var(--gold-pale); border: none; }
.btn-green:hover { background: var(--green-soft); }
.btn-ghost-green { background: transparent; color: var(--green-ink); border: 1px solid var(--line); }
.btn-ghost-green:hover { border-color: var(--gold); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.92rem; }

/* Hero */
.hero {
  background: radial-gradient(1100px 500px at 85% -10%, rgba(181, 143, 71, 0.15), transparent 60%), var(--green-deep);
  color: var(--ivory);
}
.hero-slim { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem); }
.hero h1 { color: var(--ivory); max-width: 18em; margin-top: 0.6rem; }
.hero h1 em { font-style: italic; color: var(--gold-pale); }
.hero .lede { margin-top: 1.2rem; max-width: 40em; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem); color: rgba(250, 247, 239, 0.88); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.hero-note { font-size: 0.88rem; color: rgba(250,247,239,0.6); margin-top: 1rem; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.facts li { border: 1px solid rgba(230,213,172,0.35); border-radius: 999px; padding: 0.35rem 0.95rem; font-size: 0.92rem; color: rgba(250,247,239,0.85); }
.facts b { color: var(--gold-pale); font-weight: 600; }
.warn-note { margin-top: 1.2rem; display: inline-block; background: rgba(140,74,47,0.35); border: 1px solid rgba(230,213,172,0.35); border-radius: 10px; padding: 0.55rem 0.95rem; font-size: 0.92rem; }

/* Sections */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
section.paper { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { max-width: 44em; margin-bottom: clamp(1.6rem, 3vw, 2.4rem); }
.section-head p { margin-top: 0.9rem; color: var(--muted); }

/* Hub */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.chip {
  font-family: var(--body); font-size: 0.92rem; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--green-ink);
  border-radius: 999px; padding: 0.45rem 1rem;
}
.chip:hover { border-color: var(--gold); }
.chip.is-on { background: var(--green-ink); color: var(--gold-pale); border-color: var(--green-ink); font-weight: 600; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.score-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: 12px; padding: 1.3rem 1.3rem 1.2rem; text-decoration: none; color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.score-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(14,43,34,0.08); }
.score-card[hidden] { display: none; }
.sc-acronym { font-family: var(--display); font-size: 1.9rem; font-weight: 600; color: var(--green-ink); line-height: 1.05; }
.sc-name { font-weight: 600; font-size: 0.98rem; line-height: 1.4; }
.sc-meta { font-size: 0.88rem; color: var(--muted); }
.sc-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; padding-top: 0.6rem; }
.tag { font-size: 0.82rem; letter-spacing: 0.04em; border-radius: 999px; padding: 0.15rem 0.6rem; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.tag-warn { color: var(--warn); border-color: rgba(140,74,47,0.35); }
.coming { margin-top: 1.6rem; font-size: 0.95rem; color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about h2 { margin-bottom: 0.4rem; }
.about h3 { margin: 1.6rem 0 0.4rem; }
.about p { color: var(--muted); }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.side-card .eyebrow { margin-top: 1.2rem; margin-bottom: 0.4rem; }
.side-card .eyebrow:first-child { margin-top: 0; }
.ticks { list-style: none; }
.ticks li { position: relative; padding: 0.3rem 0 0.3rem 1.3rem; font-size: 0.95rem; color: var(--muted); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.85rem; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.cite { font-size: 0.88rem; color: var(--muted); margin-top: 0.4rem; overflow-wrap: anywhere; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* Questionnaire overlay */
.quiz-app { position: fixed; inset: 0; z-index: 60; background: var(--ivory); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.quiz-app[hidden] { display: none; }
.quiz-app.open { display: flex; flex-direction: column; }
.quiz-topbar { position: sticky; top: 0; z-index: 2; background: var(--green-deep); color: var(--ivory); padding: 0.9rem 0; border-bottom: 1px solid rgba(230, 213, 172, 0.25); }
.quiz-topbar-inner { display: flex; align-items: center; gap: 1rem; }
.quiz-exit { flex: none; background: transparent; color: var(--ivory); border: 1px solid rgba(250,247,239,0.45); border-radius: 999px; padding: 0.4rem 1rem; font-family: var(--body); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.quiz-exit:hover { border-color: var(--gold-pale); color: var(--gold-pale); }
.progress-track { flex: 1; height: 8px; background: rgba(250,247,239,0.18); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width 0.3s ease; }
.progress-meta { flex: none; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-pale); font-weight: 600; white-space: nowrap; }
.q-stage { flex: 1; padding: clamp(2rem, 6vw, 4rem) 0 3rem; }
.q-title { font-family: var(--display); font-weight: 600; color: var(--green-ink); font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2.1rem); line-height: 1.18; margin: 0 0.2rem 0.9rem; }
.q-title:focus { outline: none; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.1rem, 3vw, 1.7rem); }
.q-topic { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 700; display: block; margin-bottom: 0.9rem; }
.opts-stack { display: grid; gap: 0.5rem; }
.opts-stack input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opts-stack label {
  display: block; border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem;
  font-size: 1rem; cursor: pointer; background: var(--ivory); transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.opts-stack label:hover { border-color: var(--gold); }
.opts-stack input:checked + label { background: var(--green-ink); border-color: var(--green-ink); color: var(--gold-pale); font-weight: 600; }
.opts-stack input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }
.q-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; }
/* Tick boxes, date and number fields (FK43 "About you" questions) */
.opts-stack input[type="checkbox"]:checked + label::before { content: "\2713"; margin-right: 0.5rem; }
.q-fields { display: grid; gap: 0.9rem; }
.q-field { margin-top: 0.9rem; }
.q-fields .q-field { margin-top: 0; }
.q-field label { display: block; font-size: 0.92rem; font-weight: 600; color: var(--green-ink); margin-bottom: 0.35rem; }
.q-field input { width: 100%; max-width: 22rem; font: inherit; color: var(--text); padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); }
.q-field input:hover { border-color: var(--gold); }
.q-hint { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.q-period { margin: -0.5rem 0 0.9rem; }

/* Result */
.result { display: none; background: var(--green-deep); color: var(--ivory); border-radius: 16px; padding: clamp(1.6rem, 4vw, 2.5rem); text-align: center; }
.result.show { display: block; }
.result h3 { color: var(--gold-pale); }
.result h3:focus { outline: none; }
.dial { --value: 0; width: min(260px, 70vw); aspect-ratio: 2 / 1.1; margin: 1rem auto 0; position: relative; }
/* SVG arc: one even thickness, rounded ends. pathLength="100" makes the score the dash length. */
.dial-arc { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial-arc path { fill: none; stroke-width: 11; stroke-linecap: round; }
.dial-track { stroke: rgba(250, 247, 239, 0.14); }
/* 200 gap: no repeat dash at the far end. Opacity hides the end cap at 0. */
.dial-fill { stroke: var(--gold); stroke-dasharray: var(--value) 200; stroke-opacity: clamp(0, calc(var(--value) * 100), 1); }
@media (prefers-reduced-motion: no-preference) { .dial-fill { transition: stroke-dasharray 0.8s ease; } }
.dial-num { position: absolute; inset: auto 0 0 0; font-family: var(--display); font-size: clamp(2.8rem, 9vw, 4rem); font-weight: 600; color: var(--ivory); line-height: 1; }
.dial-num small { display: block; font-family: var(--body); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-pale); margin-top: 0.4rem; }
.result-band { font-family: var(--display); font-size: 1.6rem; margin-top: 1rem; color: var(--ivory); }
.result-dir { font-size: 0.85rem; color: rgba(250,247,239,0.6); margin-top: 0.2rem; }
.result-advice { max-width: 38em; margin: 1rem auto 0; color: rgba(250,247,239,0.88); text-align: left; background: rgba(250,247,239,0.06); border-radius: 12px; padding: 1rem 1.2rem; font-size: 0.95rem; }
.result-advice b { display: block; color: var(--gold-pale); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.3rem; }
.result-part .part-num { font-family: var(--display); font-size: 2rem; font-weight: 600; color: var(--ivory); margin-right: 0.4rem; }
.result-part .part-num small { font-family: var(--body); font-size: 0.8rem; color: var(--gold-pale); }
.ctx-list { margin: 0; padding-left: 1.1rem; }
.ctx-list li { margin-top: 0.3rem; }
.result .small { font-size: 0.85rem; color: rgba(250,247,239,0.55); margin-top: 1.2rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.5rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--green-ink); color: var(--gold-pale); padding: 0.6rem 1.2rem; border-radius: 999px; font-size: 0.92rem; z-index: 80; }

/* Slider-style tools (SK11, PK7) */
.tool-section { background: var(--paper); border-bottom: 1px solid var(--line); }
.tool-app { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.tool-items { display: grid; gap: 1rem; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; }
.item-head { display: flex; gap: 0.8rem; align-items: flex-start; margin-bottom: 0.8rem; }
.item-num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 600; background: var(--paper); color: var(--muted); }
.item.done .item-num { background: var(--green-ink); color: var(--gold-pale); }
.item-text { font-weight: 600; line-height: 1.4; }
.item-sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0.3rem; max-width: calc(var(--n) * 3.4rem); }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale label { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.2rem; cursor: pointer; background: var(--ivory); font-variant-numeric: tabular-nums; }
.scale label:hover { border-color: var(--gold); }
.scale input:checked + label { background: var(--green-ink); border-color: var(--green-ink); color: var(--gold-pale); font-weight: 600; }
.scale input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }
.scale-ends { max-width: calc(var(--n) * 3.4rem); display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }
.live { position: sticky; top: 5.5rem; background: var(--green-deep); color: var(--ivory); border-radius: 16px; padding: 1.4rem; text-align: center; }
.live .eyebrow { color: var(--gold-pale); }
.live .dial { width: 200px; }
.live .dial-num { font-size: 3rem; }
.live-band { font-family: var(--display); font-size: 1.4rem; margin-top: 0.6rem; }
.live-status { font-size: 0.85rem; color: rgba(250,247,239,0.65); margin-top: 0.3rem; }
.live .btn { margin-top: 0.8rem; width: 100%; }
.weights { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; }
.weights summary { cursor: pointer; font-weight: 600; }
.weights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; margin-top: 0.9rem; }
.weights-grid label { font-size: 0.82rem; color: var(--muted); display: block; }
.weights-grid input { width: 100%; font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--ivory); }
.weights p { font-size: 0.82rem; color: var(--muted); margin-top: 0.6rem; }
.report { margin-top: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; overflow-x: auto; }
.report table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.report th, .report td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); }
.report th { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.report td.num, .report th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report .note { font-size: 0.82rem; color: var(--muted); margin-top: 0.8rem; }
@media (max-width: 860px) {
  .tool-app { grid-template-columns: 1fr; }
  .live { order: -1; position: sticky; top: 4.4rem; z-index: 5; display: grid; grid-template-columns: auto 1fr 1fr; gap: 0.15rem 0.6rem; text-align: left; align-items: center; padding: 0.7rem 0.9rem; }
  .live .eyebrow, .live .dial { display: none; }
  .live .live-score { font-family: var(--display); font-size: 2.3rem; font-weight: 600; grid-row: span 3; padding-right: 0.3rem; }
  .live-band { grid-column: 2 / 4; margin: 0; font-size: 1.15rem; line-height: 1.1; }
  .live-status { grid-column: 2 / 4; margin: 0; font-size: 0.76rem; line-height: 1.3; }
  .live .btn { margin-top: 0.35rem; width: 100%; padding: 0.35rem 0.6rem; font-size: 0.85rem; }
}
@media (min-width: 861px) { .live .live-score { display: none; } }

/* Disclaimer + footer */
.disclaimer { background: var(--paper); border-block: 1px solid var(--line); padding: 2rem 0; font-size: 0.92rem; color: var(--muted); }
footer { background: var(--green-deep); color: rgba(250,247,239,0.75); padding: 2.2rem 0; font-size: 0.9rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.foot-find { flex-basis: 100%; margin: 0; font-size: 0.9rem; }
footer a { color: var(--gold-pale); text-decoration: none; display: inline-block; padding: 0.35rem 0; }
footer a:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .quiz-topbar-inner { flex-wrap: wrap; }
  .progress-meta { order: 3; width: 100%; text-align: center; }
}

/* PDF report: name box on the result screen */
.pdf-box { max-width: 26rem; margin: 1.4rem auto 0; text-align: left; }
.pdf-box label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--green-ink); }
.pdf-box input { width: 100%; font: inherit; color: var(--text); padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); }
.pdf-box input:hover { border-color: var(--gold); }
.pdf-box .btn { margin-top: 0.8rem; width: 100%; justify-content: center; }
.pdf-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }
.pdf-opt { font-weight: 400; }
.mail-box { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.mail-box label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--green-ink); }
.mail-box input { width: 100%; font: inherit; color: var(--text); padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); }
.mail-box input:hover { border-color: var(--gold); }
.mail-box .btn { margin-top: 0.8rem; width: 100%; justify-content: center; }
.mail-msg:empty { display: none; }
.result .mail-box { border-top-color: rgba(250,247,239,0.2); }
.result .mail-box label { color: var(--gold-pale); }
.result .pdf-box label { color: var(--gold-pale); }
.result .pdf-note { color: rgba(250,247,239,0.7); }

/* PDF report: only shown when printing it */
.pdf-report { display: none; }

@media print {
  header, footer, .disclaimer, .hero-actions, .quiz-topbar, .q-nav, .result-actions, .live .btn, .filters { display: none !important; }
  .quiz-app { position: static; }
  body.quiz-open main { display: none; }
  .result, .live { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .result *, .live * { color: #000 !important; }
}

/* PDF report layout (printed with "Save as PDF") */
@page report { size: A4; margin: 14mm 14mm 16mm; }
@media print {
  body.print-report { overflow: visible !important; background: #fff; }
  body.print-report > *:not(.pdf-report) { display: none !important; }
  body.print-report .pdf-report { display: block; page: report; }
  .pdf-report, .pdf-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: var(--text); }
  .pdf-report { font-family: var(--body); font-size: 10.5pt; line-height: 1.45; }
  .rp-head { display: flex; justify-content: space-between; align-items: center; background: var(--green-deep); border-radius: 10px; padding: 10pt 14pt; }
  .rp-head .rp-mark { font-family: var(--display); font-size: 18pt; font-weight: 600; color: var(--ivory); }
  .rp-head .rp-mark b { color: var(--gold); font-weight: 600; }
  .rp-head .rp-kind { font-size: 8.5pt; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-pale); }
  .rp-title { font-family: var(--display); font-size: 20pt; font-weight: 600; color: var(--green-ink); margin: 12pt 0 6pt; line-height: 1.15; }
  .rp-title em { color: var(--gold); font-style: italic; }
  .rp-meta { display: grid; grid-template-columns: 1.3fr 1.5fr 1fr; gap: 8pt; border: 1px solid var(--line); border-radius: 10px; padding: 8pt 12pt; background: var(--ivory); }
  .rp-k { display: block; font-size: 7.5pt; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
  .rp-v { display: block; font-weight: 600; color: var(--green-ink); }
  .rp-score { display: grid; grid-template-columns: 110pt 1fr auto; gap: 16pt; align-items: center; margin-top: 12pt; padding: 12pt 14pt; border: 1px solid var(--line); border-radius: 12px; break-inside: avoid; }
  .rp-ring { width: 110pt; height: 110pt; }
  .rp-ring circle { fill: none; stroke-width: 12; }
  .rp-ring-track { stroke: var(--paper); }
  .rp-ring-fill { stroke-linecap: round; }
  .rp-ring-fill.rp-good { stroke: var(--green-soft); }
  .rp-ring-fill.rp-fair { stroke: var(--gold); }
  .rp-ring-fill.rp-poor { stroke: var(--warn); }
  .rp-big { font-family: var(--display); font-size: 40pt; font-weight: 600; line-height: 1; color: var(--green-ink); }
  .rp-big small { font-family: var(--body); font-size: 10pt; font-weight: 500; color: var(--muted); }
  .rp-chip { display: inline-block; margin-top: 6pt; padding: 3pt 10pt; border-radius: 999px; font-weight: 700; font-size: 10pt; }
  .rp-bg-good { background: var(--green-soft); }
  .rp-bg-fair { background: var(--gold); }
  .rp-bg-poor { background: var(--warn); }
  .rp-chip.rp-bg-good, .rp-chip.rp-bg-poor { color: var(--ivory); }
  .rp-chip.rp-bg-fair { color: var(--green-deep); }
  .rp-dir { font-size: 9pt; color: var(--muted); margin-top: 4pt; }
  .rp-key p { font-size: 9pt; margin-top: 3pt; display: flex; align-items: center; gap: 6pt; }
  .rp-dot { display: inline-block; width: 9pt; height: 9pt; border-radius: 50%; }
  .rp-extra { display: flex; align-items: center; gap: 12pt; margin-top: 8pt; padding: 8pt 14pt; border: 1px solid var(--line); border-radius: 10px; background: var(--ivory); break-inside: avoid; }
  .rp-extra .rp-k { flex: 1; font-size: 8.5pt; }
  .rp-extra-num { font-family: var(--display); font-size: 20pt; font-weight: 600; color: var(--green-ink); }
  .rp-extra-num small { font-family: var(--body); font-size: 8.5pt; color: var(--muted); }
  .rp-extra .rp-chip { margin-top: 0; }
  .rp-sec { margin-top: 14pt; }
  .pdf-report h1, .pdf-report h2, .pdf-report p { margin-left: 0; margin-right: 0; }
  .pdf-report p { margin-bottom: 0; }
  .rp-sec h2 { font-family: var(--display); font-size: 14pt; font-weight: 600; color: var(--green-ink); border-bottom: 2px solid var(--gold); padding-bottom: 3pt; margin-bottom: 6pt; break-after: avoid; }
  .rp-bars { display: block; }
  .rp-bar + .rp-bar { margin-top: 5pt; }
  .rp-bar { display: grid; grid-template-columns: 120pt 1fr 44pt; gap: 10pt; align-items: center; break-inside: avoid; }
  .rp-bar-name { font-size: 9.5pt; }
  .rp-bar-track { height: 9pt; background: var(--paper); border-radius: 999px; overflow: hidden; }
  .rp-bar-fill { display: block; height: 100%; border-radius: 999px; }
  .rp-bar-fill.rp-good { background: var(--green-soft); }
  .rp-bar-fill.rp-fair { background: var(--gold); }
  .rp-bar-fill.rp-poor { background: var(--warn); }
  .rp-bar-val { text-align: right; font-weight: 700; font-size: 9.5pt; color: var(--green-ink); }
  .rp-list { padding-left: 14pt; margin: 0; }
  .rp-list li { margin-top: 2pt; }
  .rp-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .rp-table th { text-align: left; background: var(--green-ink); color: var(--gold-pale); font-weight: 600; padding: 4pt 6pt; }
  .rp-table td { padding: 4pt 6pt; border-bottom: 1px solid var(--line); vertical-align: top; }
  .rp-table tbody tr:nth-child(even) td { background: var(--ivory); }
  .rp-table tr { break-inside: avoid; }
  .rp-table td:first-child { width: 22pt; color: var(--muted); }
  .rp-table td:last-child { font-weight: 600; color: var(--green-ink); }
  .rp-track p { font-size: 9.5pt; margin-bottom: 6pt; }
  .rp-track .rp-table td { height: 18pt; }
  .rp-track .rp-table td:first-child { width: 90pt; color: var(--text); }
  .rp-track .rp-table td:nth-child(2) { width: 60pt; }
  .rp-foot { margin-top: 14pt; padding-top: 8pt; border-top: 1px solid var(--line); font-size: 8.5pt; color: var(--muted); }
  .rp-foot a { color: var(--green-soft); font-weight: 600; }
}
