/* Client report page: header, title, section tabs, cover and footer, in light, dark and print.
   The report body itself is styled by report-view.css. */
:root {
  --paper: #FFFFFF; --mist: #F1F2F4; --ink: #15171A; --ink-2: #3D424A; --muted: #5D636D; --line: #DADDE2;
  --marker: #FFE14A; --marker-ink: #15171A; --you: #15171A; --them: #C4C8CF; --ci: #E7E9EC;
  --link: #2B47D9; --up: #13795B; --down: #B4322A;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-quote: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111214; --mist: #1A1C1F; --ink: #F3F4F5; --ink-2: #CDD0D5; --muted: #9AA0A9; --line: #2D3036;
    --you: #F3F4F5; --them: #4A4F57; --ci: #2A2D32; --link: #9DB0FF; --up: #4CC38A; --down: #F08A80;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .r-brand-logo:not(.is-sample-logo) { background: #FFFFFF; padding: 4px 8px; border-radius: 8px; }
}
:root[data-theme="dark"] {
  --paper: #111214; --mist: #1A1C1F; --ink: #F3F4F5; --ink-2: #CDD0D5; --muted: #9AA0A9; --line: #2D3036;
  --you: #F3F4F5; --them: #4A4F57; --ci: #2A2D32; --link: #9DB0FF; --up: #4CC38A; --down: #F08A80;
  color-scheme: dark;
}
:root[data-theme="dark"] .r-brand-logo:not(.is-sample-logo) { background: #FFFFFF; padding: 4px 8px; border-radius: 8px; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--font-display); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
#root { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; letter-spacing: -0.025em; }
p, ol, ul, figure { margin: 0; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.band { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; margin: 0 auto; width: 100%; min-width: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Marker: always behind text, never a text colour */
.mark { color: var(--marker-ink); background: var(--marker); padding: 0.02em 0.22em; border-radius: 0.16em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.mark.sweep { background-color: transparent; background-image: linear-gradient(var(--marker), var(--marker)); background-repeat: no-repeat; background-position: 0 72%; background-size: 100% 82%; animation: sweep 0.9s cubic-bezier(.2, .7, .2, 1) 0.15s both; }
@keyframes sweep { from { background-size: 0% 82%; } to { background-size: 100% 82%; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--marker); color: var(--marker-ink); font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.65; cursor: progress; }

/* Sample ribbon */
.sample-ribbon { background: var(--marker); color: var(--marker-ink); padding: 7px max(16px, env(safe-area-inset-left, 0px)); font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

/* Agency header */
.r-top { border-bottom: 1px solid var(--line); background: var(--paper); }
.r-top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 68px; padding-block: 12px; }
.r-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.r-brand-logo { display: block; max-height: 40px; max-width: 180px; width: auto; height: auto; object-fit: contain; flex: none; }
.r-brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); overflow-wrap: anywhere; }
.r-top-actions { display: flex; gap: 8px; }

/* Title and section tabs */
.r-body { padding-block: clamp(24px, 4vw, 40px) clamp(48px, 7vw, 80px); display: flex; flex-direction: column; gap: 28px; }
.r-head { display: flex; flex-direction: column; gap: 6px; }
.r-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.r-head h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.r-head .meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.r-nav { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.r-nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.r-nav .wrap::-webkit-scrollbar { display: none; }
.r-nav a { flex: none; display: inline-flex; align-items: center; min-height: 46px; padding: 0 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.r-nav a:hover { color: var(--ink); }
.r-nav a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* Agency call to action */
.r-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; border: 1.5px solid var(--ink); border-radius: 14px; padding: 20px 22px; }
.r-cta-text { display: flex; flex-direction: column; gap: 4px; max-width: 60ch; }
.r-cta-title { font-size: 18px; font-weight: 750; letter-spacing: -0.015em; }
.r-cta-sub { font-size: 14px; color: var(--muted); }
.r-cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Footer */
footer.r-foot { padding-block: 16px 24px; border-top: 1px solid var(--line); }
.r-foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.powered { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
.powered:hover { color: var(--ink); text-decoration: underline; }

/* Server-rendered summary (shown until the script runs, or without JavaScript) */
.section { display: flex; flex-direction: column; gap: 16px; }
.h2 { font-size: 22px; font-weight: 750; }
.headline { font-size: clamp(22px, 2.6vw, 28px); font-weight: 750; line-height: 1.2; }
.big-stat { display: flex; align-items: baseline; gap: 12px; }
.big-stat .pct { font-family: var(--font-mono); font-size: 52px; font-weight: 600; line-height: 1; }
.big-stat .range { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.no-js-note { border: 1.5px solid var(--ink); background: var(--mist); font-size: 15px; }
.method-box { background: var(--mist); border-color: var(--mist); }
.method-list { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }

.r-cover, .print-only { display: none; }

@media (max-width: 620px) {
  .r-top-row { min-height: 60px; }
  .r-brand-logo { max-height: 32px; max-width: 140px; }
  .r-top-actions .btn { min-height: 38px; padding: 0 12px; font-size: 14px; }
  .r-cta { padding: 16px; }
  .r-cta-actions, .r-cta-actions .btn { width: 100%; }
  .r-cta-actions .btn { white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mark.sweep { animation: none; background: var(--marker); }
}

/* ================================================================== Print and PDF (Letter or A4) */
@page { margin: 14mm 12mm 16mm; }

@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --paper: #FFFFFF; --mist: #F4F5F7; --ink: #15171A; --ink-2: #3D424A; --muted: #5D636D; --line: #D4D8DF;
    --marker: #FFE14A; --marker-ink: #15171A; --you: #15171A; --them: #B8BDC6; --ci: #E1E4EA; --link: #15171A;
    color-scheme: light;
  }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { background: #FFFFFF !important; color: #15171A !important; font-size: 9pt; line-height: 1.38; }
  .no-print, .r-nav, .sample-ribbon { display: none !important; }
  .print-only { display: block !important; }
  .band { padding-left: 0; padding-right: 0; }
  .wrap { max-width: none; }
  .r-body { padding-block: 0; gap: 14pt; }
  .mark, .mark.sweep { animation: none !important; background: #FFE14A !important; color: #15171A !important; }
  a { text-decoration: none; color: inherit; }

  .r-cover { display: flex !important; flex-direction: column; justify-content: space-between; min-height: 235mm; break-after: page; padding: 6mm 0 4mm; }
  .r-cover-brand { display: flex; align-items: center; gap: 10pt; }
  .r-cover-brand .r-brand-logo { max-height: 36pt; max-width: 170pt; background: transparent !important; padding: 0 !important; }
  .r-cover-brand .r-brand-logo.is-sample-logo { border-radius: 5pt; }
  .r-cover-brand .r-brand-name { font-size: 14pt; }
  .r-cover-main { display: flex; flex-direction: column; gap: 8pt; border-top: 2pt solid #15171A; padding-top: 18pt; }
  .r-cover-sample { align-self: flex-start; background: #FFE14A; font-family: var(--font-mono); font-size: 8pt; letter-spacing: 0.06em; text-transform: uppercase; padding: 2pt 8pt; border-radius: 3pt; }
  .r-cover-kicker { font-family: var(--font-mono); font-size: 9pt; letter-spacing: 0.08em; text-transform: uppercase; color: #5D636D; }
  .r-cover-title { font-size: 34pt; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
  .r-cover-meta { font-size: 11pt; color: #3D424A; }
  .r-cover-foot { border-top: 0.75pt solid #D4D8DF; padding-top: 8pt; font-size: 9.5pt; color: #3D424A; display: flex; flex-direction: column; gap: 2pt; }

  .r-cta { border: 1pt solid #15171A; border-radius: 6pt; padding: 8pt 10pt; break-inside: avoid; gap: 4pt; }
  .r-cta-title { font-size: 10.5pt; }
  .r-cta-sub, .r-cta-print { font-size: 8.5pt; }
  footer.r-foot { padding: 6pt 0 0; border-top: 0.5pt solid #D4D8DF; }
  .r-foot-brand { display: none; }
  .powered { font-size: 8pt; min-height: 0; }
}
