/* Report page (UX revision 2026-10, docs/designs/report-dataviz.md). Loaded by report.html
   only, after app.css. Chart colors are validated tokens; text never uses series colors. */

:root {
  --chart-seller: #C8231B;
  --chart-ours: #2F55C8;
  --chart-context: var(--pencil);
  --chart-band: var(--marker);
}
/* Dark chart tokens: following the OS unless "Licht" was chosen, or chosen with the toggle
   (same rule as the tokens in app.css). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chart-seller: #E8483D;
    --chart-ours: #6F88EC;
  }
}
:root[data-theme="dark"] {
  --chart-seller: #E8483D;
  --chart-ours: #6F88EC;
}

html { scroll-padding-top: 72px; }

/* ---- Contents and summary bar --------------------------------------------------------- */
.toc { margin-top: var(--space-md); }
.toc-title { font: 700 .8125rem/1.4 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--pencil); }
.toc ul { list-style: none; margin: var(--space-xs) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-md); }
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
/* Phones: one row that scrolls sideways inside itself (the page never scrolls sideways). */
@media (max-width: 560px) {
  .toc ul { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
}

.summary-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 8px var(--gutter);
  font-size: 1rem;
}
.summary-bar p { max-width: 1120px; margin: 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-bar[hidden] { display: none; }
.summary-stamp { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; }
.summary-no { color: var(--correction); }
.summary-partly { color: var(--verdict-partly); }
.summary-yes { color: var(--verdict-yes); }
@media (prefers-reduced-motion: no-preference) {
  .summary-bar { animation: bar-in 200ms ease-out; }
}
@keyframes bar-in { from { transform: translateY(-100%); } to { transform: none; } }

/* ---- Verdict hero ---------------------------------------------------------------------- */
.hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.hero-seller { font: 600 1.5rem/1.1 var(--mono); color: var(--pencil); text-decoration-color: var(--chart-seller); text-decoration-thickness: 3px; }
.assume-inline { color: var(--pencil); }

/* ---- Charts ---------------------------------------------------------------------------- */
.chart { margin: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.chart-svg { display: block; overflow: visible; }
.chart-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.c-axis, .c-track { stroke: var(--rule); stroke-width: 1; }
.c-ref { stroke: var(--chart-context); stroke-width: 2; }
.c-band { fill: var(--chart-band); }
/* Range rows (web/charts.range_plot): the min-max span behind the median dot (guides,
   /advies fair prices). */
.c-span { stroke: var(--chart-context); stroke-width: 6; stroke-linecap: round; opacity: .35; }
.c-label, .c-value, .c-axis-label { fill: var(--ink); font: 400 1rem var(--body); }
.c-value { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.c-muted, .c-axis-label, .c-ref-label { fill: var(--pencil); }
.c-ref-label { font: 400 .875rem var(--body); }
.c-axis-label { font-size: .875rem; font-family: var(--mono); }
.c-strong { font-weight: 700; }
/* A paper halo keeps labels readable where they cross the lifetime line. */
.c-label, .c-value, .c-ref-label { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.hero-seller { line-height: 1.4; }
.c-seller line { stroke: var(--chart-seller); stroke-width: 4; }
.c-ours circle, .c-dot-recommended circle { fill: var(--chart-ours); stroke: var(--paper); stroke-width: 2; }
.c-dot-quote circle { fill: var(--chart-seller); stroke: var(--paper); stroke-width: 2; }
.c-dot-context circle { fill: var(--chart-context); }
/* Beyond the axis (more than 30 years, or never): an open dot at the end. */
.c-overflow circle { fill: var(--paper); stroke: var(--chart-ours); stroke-width: 3; }
.c-dot-quote.c-overflow circle { stroke: var(--chart-seller); }
.c-dot-context.c-overflow circle { stroke: var(--chart-context); }
.wf-start rect { fill: var(--chart-seller); }
.wf-step rect { fill: var(--chart-context); }
.wf-end rect { fill: var(--chart-ours); }
.c-mark { outline: none; }
.c-mark:focus-visible circle, .c-mark:focus-visible rect, .c-mark:focus-visible line { stroke: var(--ink); stroke-width: 3; }
.key-band { display: inline-block; width: 18px; height: 12px; background: var(--chart-band); vertical-align: middle; }
.chart-table summary, .basis summary, .delete-confirm summary, .refine summary, .seller-toggle summary {
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700;
}
.chart-table summary::before, .basis summary::before, .refine summary::before, .seller-toggle summary::before {
  content: "▸"; display: inline-block; width: 1.1em; color: var(--pencil);
}
.chart-table[open] summary::before, .basis[open] summary::before, .refine[open] summary::before, .seller-toggle[open] summary::before { content: "▾"; }
.chart-table[open] summary { margin-bottom: var(--space-sm); }
.chart-table td.wrap { padding-left: 16px; }
@media (forced-colors: active) {
  .c-band { fill: url(#en-hatch); forced-color-adjust: none; }
  .c-mark circle, .c-mark rect { fill: CanvasText; }
  .c-seller line { stroke: CanvasText; }
}

/* ---- KPI pair and stat tile ------------------------------------------------------------ */
.kpi-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.kpi, .stat-tile { border-top: 2px solid var(--rule); padding-top: var(--space-sm); display: flex; flex-direction: column; gap: 4px; }
.kpi-main { border-top-color: var(--ink); }
.kpi-label { font-weight: 700; }
.kpi-value { font: 600 2rem/1.15 var(--mono); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .kpi-pair { grid-template-columns: 1fr; } }

/* ---- Gap toggle: CSS only, works without JS -------------------------------------------- */
.seller-toggle[open] .seller-view { margin-top: var(--space-sm); }
.seller-view { border-left: 3px solid var(--chart-seller); padding-left: var(--space-md); }
.seller-view ul { margin: var(--space-xs) 0 0; padding-left: 1.2em; }

/* ---- Subsidy chips --------------------------------------------------------------------- */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-xs); font-size: 1rem; }

/* ---- What this rests on ---------------------------------------------------------------- */
.basis-sub { font-size: 1.125rem; margin-top: var(--space-md); }

/* ---- Next steps -------------------------------------------------------------------------- */
.questions, .share, .refine { display: flex; flex-direction: column; gap: var(--space-sm); }
.questions h3, .share h3, .refine h3 { font-size: 1.25rem; }
.questions ol { margin: 0; padding-left: 1.4em; }
.questions li + li { margin-top: var(--space-xs); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.btn-new { min-height: 48px; }
.choices { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); }
.js-only[hidden] { display: none; }

/* ---- Measurement blocks (components/measure.html): "Wat ga je nu doen?" and the fake door.
   Flat on paper under a hairline rule (DESIGN.md: rules, not cards; no colour). Compact, so
   /advies stays within 6 phone screens: the answers sit two to a row on a phone, each a
   48px target with the body size. The fake door is one quiet line at the end. ------------ */
.measure[hidden], .measure [hidden] { display: none; }
.measure { max-width: 62ch; border-top: 1px solid var(--rule); padding-top: var(--space-md); }
.report-row .measure { margin-top: var(--space-md); }
.fake-door { margin-block: var(--space-lg); }
.measure-title { font: 700 1.25rem/1.3 var(--display); margin: 0; }
.fake-door .measure-title { font: inherit; font-weight: 700; }
.measure-ask { display: flex; flex-direction: column; gap: var(--space-xs); }
.measure-ask p { margin: 0; }
.measure-thanks { margin: 0; }
.measure-thanks:focus { outline: none; }
.whatnow .choices {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--space-sm); margin-top: var(--space-xs);
}
.whatnow .btn-secondary { padding: 6px 12px; line-height: 1.3; text-align: left; justify-content: flex-start; }
.fake-door-offer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.link-button {
  font: inherit; color: var(--verdict-yes); background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: .15em; cursor: pointer; min-height: 44px;
}

/* ---- Footer line ----------------------------------------------------------------------- */
.report-foot { border-top: 1px solid var(--rule); padding-top: var(--space-md); color: var(--pencil); font-size: 1rem; }
.foot-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.foot-line a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.delete-confirm { display: inline; }
.delete-confirm summary { color: var(--ink); text-decoration: underline; font-weight: 400; }
.delete-box { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); padding: var(--space-sm) 0; color: var(--ink); }
.print-only { display: none; }

/* ---- Print: verdict and figures on page 1, assumptions on page 2 ------------------------ */
@media print {
  :root { --chart-seller: #555; --chart-ours: #000; --chart-context: #888; }
  html { scroll-padding-top: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .summary-bar, .toc, .site-header nav, .skip-link, .js-only, .actions, .share, .refine,
  .measure, .slot, .chart-table summary, .delete-confirm, .btn-new,
  .lang-hint, .ref-note, .report-foot a { display: none !important; }
  .report-row { padding-top: 10pt; gap: 8pt; }
  .page-title { font-size: 20pt; }
  .report-row { grid-template-columns: 170pt minmax(0, 1fr); }
  .report-row h2 { font-size: 13pt; }
  .report-head .toc { display: none; }
  figure.chart { zoom: .8; }
  .seller-toggle:not([open]) { display: none; }
  .figure { font-size: 24pt; }
  figure.chart, .kpi-pair, .stat-tile, .questions { break-inside: avoid; }
  .chart-table:not([open]) { display: none !important; }
  .report-row h2 { font-size: 15pt; }
  /* Page 1: verdict and the gap chart. Page 2: what the result rests on. Then the rest. */
  .stack { gap: 12pt; }
  .stack > * { order: 10; }
  .report-head { order: 0; }
  #verdict { order: 1; }
  #gap { order: 2; }
  #basis { order: 3; break-before: page; }
  #payback { break-before: page; }
  #payback { order: 4; }
  .basis > * { display: block; }
  .c-band { fill: url(#en-hatch); }
  .c-span { opacity: 1; stroke: #bbb; }
  .mark-sweep { background: none; animation: none; }
  .print-only { display: block; }
  .report-foot { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid #999; background: #fff; }
  .report-foot .foot-line { display: none; }
  .report-foot p { overflow-wrap: anywhere; word-break: break-all; padding: 0 8pt; }
  body.print-questions main > * { display: none !important; }
  body.print-questions main #next, body.print-questions main .stack { display: block !important; }
  /* A /r/<code> report sits inside the page shell (report_shell.html): keep the shell. */
  body.print-questions main > #report-root { display: block !important; }
  body.print-questions .stack > :not(#next) { display: none !important; }
  body.print-questions #next .evidence-col > :not(.questions) { display: none !important; }
}

/* ---- v1.2: success moments, method stamp, "how do we get this", what-ifs --------------- */
.done-list { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-md); font-size: 1rem; }
.done-mark { font-weight: 700; }
.method-stamp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-md); color: var(--pencil); }
.method-stamp a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.method-stamp ul { margin: var(--space-xs) 0 var(--space-sm); padding-left: 1.2em; }
.method-stamp summary, .how summary, .whatif summary {
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center;
}
.method-stamp summary { display: block; padding: 10px 0; min-height: 0; }
.how summary, .whatif summary { font-weight: 700; }
.method-stamp summary::before, .how summary::before, .whatif summary::before {
  content: "▸"; display: inline-block; width: 1.1em; color: var(--pencil);
}
.method-stamp details[open] summary::before, .how[open] summary::before, .whatif[open] summary::before { content: "▾"; }
.how[open], .whatif[open] { display: flex; flex-direction: column; gap: var(--space-sm); }
.how ul { margin: 0; padding-left: 1.2em; }
.rests-on a { color: var(--ink); }
.unknown-note { color: var(--pencil); }
.cert { display: block; font-weight: 400; font-size: .875rem; color: var(--pencil); }
.sizes-table, .tips-table { font-size: .9375rem; }
.sizes-table th .tag { margin-top: 2px; }
.sizes-table td, .tips-table td { white-space: nowrap; }

.tips { display: flex; flex-direction: column; gap: var(--space-sm); border-top: 1px solid var(--rule); padding-top: var(--space-md); }
.tips h3 { font-size: 1.25rem; margin: 0; }
.tips-controls { display: flex; flex-direction: column; gap: var(--space-md); }
.tips-controls[hidden] { display: none; }
.seg { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.seg legend { font-weight: 700; padding: 0; margin-bottom: var(--space-xs); }
.seg-list { flex-direction: column; align-items: stretch; }
.seg .option { min-height: 48px; }
.tips-result { font: 600 1.5rem/1.2 var(--mono); font-variant-numeric: tabular-nums; margin: 0; }
[data-nojs-table][hidden] { display: none; }

.hp-curve { border-left: 3px solid var(--rule); padding-left: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); }
.hp-curve h3 { font-size: 1.25rem; margin: 0; }
.stateless-share { margin-top: var(--space-xs); }
.report-root { min-height: 40vh; }

@media print {
  .method-stamp details > ul { display: block; }
  .tips-controls, .stateless-share, .method-stamp a { display: none !important; }
  [data-nojs-table] { display: block !important; }
  .whatif:not([open]) { display: none; }
}
.caveats .safety-note { margin-bottom: var(--space-sm); }

/* ---- Enhub items: perfect foresight in the gap; what we measure and what we estimate ---- */
.gap-foresight summary, .provenance summary {
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700;
}
.gap-foresight summary::before, .basis .provenance summary::before {
  content: "▸"; display: inline-block; width: 1.1em; color: var(--pencil);
}
.gap-foresight[open] summary::before, .basis .provenance[open] summary::before { content: "▾"; }
.gap-foresight p { margin: var(--space-xs) 0; }
.provenance { margin-top: var(--space-md); }
.provenance-table { font-size: 1rem; }
.provenance-table th, .provenance-table td { vertical-align: top; padding-right: 12px; }
/* Phones: one block per route, each figure with its column name (no sideways scroll). */
@media (max-width: 640px) {
  .provenance-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .provenance-table tr, .provenance-table th[scope="row"], .provenance-table td { display: block; }
  .provenance-table tr { border-bottom: 1px solid var(--rule); padding: var(--space-sm) 0; }
  .provenance-table th[scope="row"], .provenance-table td { border-bottom: 0; padding: 2px 0; }
  .provenance-table th[scope="row"] { font-weight: 700; }
  .provenance-table td::before { content: attr(data-label) ": "; color: var(--pencil); }
}
@media print { .gap-foresight > *, .provenance > * { display: block; } }

/* ---- "Deel je uitslag": the share-card action on the report and /advies (web/card_routes.py) */
.card-share-form { display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
.card-share-form p { margin: 0; }
@media print { .card-share { display: none !important; } }
