/* Validation page. On top of tokens.css, scenario_results.css (page head) and
   calibration.css (the document pages' frame: page tokens, head card, main
   column, headings). Layout 2 of the 2026-10-21 sketches (ives-notes
   validation-page/sketches_2026-10-21): summary tiles, then two-column metric
   cards. Model = blue and observed = orange, as Calibration's modeled /
   target. Light mode only, as the host applet. */

.val-page {
  height: auto;   /* a scrolling document, not the map's full-height frame */
  --series-observed: var(--series-target);
  --series-other: #b9b7ae;
  --series-alt: #8fb8ea;     /* a second basis of the model's own number (B1 netted) */
  --ind-partial-bg: #dcebfb;  --ind-partial-fg: #174f8f;
}
.calib-main.v-main { max-width: 1180px; }
.v-muted { color: var(--ink-muted); font-weight: 400; }

/* ---- intro line: independence key | Advanced switch ---- */
.v-intro-line {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 10px 0 12px; font-size: 12px; color: var(--ink-secondary);
}
.v-key { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.v-keyitem { white-space: nowrap; }

/* ---- chips ---- */
.v-chip {
  display: inline-block; font-size: 10.5px; font-weight: 700; line-height: 1.5;
  padding: 0 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px;
}
.v-ind-independent { background: var(--ok-bg); color: var(--ok-text); }
.v-ind-consistency { background: var(--bad-bg); color: var(--warn-text); }
.v-ind-partial { background: var(--ind-partial-bg); color: var(--ind-partial-fg); }
.v-ind-none { background: var(--ground-band); color: var(--brand-ink); }
.v-adv { background: var(--gold-soft); color: var(--brand-ink); }
.v-na { background: transparent; color: var(--brand-ink); border: 1px dashed var(--n-aa); font-weight: 600; }

/* ---- tiles ---- */
.v-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 6px; }
.v-tile {
  display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 10px 12px; color: inherit; text-decoration: none; min-width: 0;
}
.v-tile:hover { border-color: var(--n-aa); }
.v-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.v-tile b { display: block; font-size: 12px; color: var(--label-em); }
.v-tile span { display: block; font-size: 21px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-tile span sup { font-size: 12px; }
.v-tile small { display: block; font-size: 11px; color: var(--ink-muted); }
@media (max-width: 1100px) { .v-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- sections and cards ---- */
.v-section { scroll-margin-top: 12px; }
.v-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: start; }
.v-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 12px 14px; margin: 8px 0; min-width: 0; scroll-margin-top: 12px;
}
.v-card header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.v-main .v-card h3 { margin: 0 6px 0 0; color: var(--heading); font-size: 13.5px; }
.v-card-na { background: transparent; border-style: dashed; }
.v-reason { font-style: italic; }
.v-headline { font-size: 24px; font-weight: 700; color: var(--heading); margin: 6px 0 0; font-variant-numeric: tabular-nums; line-height: 1.2; }
.v-headline:empty { display: none; }
.v-headline.v-word { font-size: 18px; }
.v-headline sup { font-size: 13px; }
.v-sum { font-size: 12.5px; color: var(--ink-secondary); margin: 6px 0; max-width: 72ch; }
.v-foot { font-size: 11px; color: var(--ink-muted); margin: 2px 0 4px; }
.v-yard {
  font-size: 12px; color: var(--ink-secondary); border-left: 3px solid var(--hairline);
  padding-left: 8px; margin: 8px 0 4px; max-width: 72ch;
}
.v-ysrc { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }

/* ---- Technical detail fold ---- */
details.v-tech { margin-top: 8px; font-size: 12px; }
details.v-tech summary { cursor: pointer; color: var(--label-em); font-weight: 600; }
details.v-tech[open] summary { margin-bottom: 6px; }
.v-tnote { font-size: 12px; color: var(--ink-secondary); margin: 4px 0; max-width: 80ch; }
.v-tech-h { font-size: 11px; font-weight: 700; color: var(--label-em); margin: 8px 0 2px; }
.v-src { margin: 0; padding-left: 18px; font-size: 11.5px; color: var(--ink-secondary); }
.v-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 1px 10px; margin: 4px 0; font-size: 11.5px; }
.v-kv dt { color: var(--ink-muted); }
.v-kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.v-table-wrap { max-width: 100%; overflow-x: auto; margin: 6px 0; }
.v-table { border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; background: var(--surface); }
.v-table caption { text-align: left; font-size: 11px; font-weight: 700; color: var(--label-em); padding: 2px 0; }
.v-table th, .v-table td { border: 1px solid var(--hairline); padding: 3px 7px; text-align: right; white-space: nowrap; }
.v-table th { background: var(--th-bg); color: var(--label-em); font-weight: 600; }
.v-table td:first-child, .v-table th:first-child, .v-table td.v-txt { text-align: left; }
.v-table td.v-txt { white-space: normal; min-width: 8ch; }
.v-table td.v-absent { color: var(--n-bb); text-align: center; }

/* ---- charts (hand SVG, validation_page.py) ---- */
.v-chart { display: block; width: 100%; max-width: 480px; height: auto; margin: 8px 0 2px; }
.v-chart text { font-size: 10px; fill: var(--ink-muted); }
.v-chart.v-scatter { max-width: 340px; }
.v-chart.v-line-chart { max-width: 360px; }
.v-chart .v-lab { fill: var(--brand-ink); font-size: 10.5px; }
.v-chart .v-val { fill: var(--ink-secondary); font-size: 10px; font-variant-numeric: tabular-nums; }
.v-chart .v-bar.v-model, .v-chart .v-dot.v-model, .v-chart .v-pt.v-model { fill: var(--series-modeled); }
.v-chart .v-bar.v-obs, .v-chart .v-dot.v-obs { fill: var(--series-observed); }
.v-chart .v-bar.v-other, .v-chart .v-pt.v-other { fill: var(--series-other); }
.v-chart .v-bar.v-alt { fill: var(--series-alt); }
.v-chart .v-pt { fill-opacity: .85; }
.v-chart .v-ref { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.v-chart .v-axisline { stroke: var(--axis); stroke-width: 1; }
.v-chart .v-grid { stroke: var(--hairline); stroke-width: 1; }
.v-chart .v-track { stroke: var(--hairline); stroke-width: 1; }
.v-chart .v-moe { stroke: var(--n-33); stroke-width: 1; }
.v-chart .v-moe-band { stroke: var(--series-observed); stroke-opacity: .35; stroke-width: 7; stroke-linecap: round; }
.v-chart .v-dot { stroke: var(--surface); stroke-width: 1.5; }
.v-chart .v-line { fill: none; stroke: var(--series-modeled); stroke-width: 2; }
.v-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11.5px; color: var(--ink-secondary); margin: 4px 0; }
.v-legend span { white-space: nowrap; }
.v-sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.v-sw.v-model { background: var(--series-modeled); }
.v-sw.v-obs { background: var(--series-observed); }
.v-sw.v-other { background: var(--series-other); }
.v-sw.v-alt { background: var(--series-alt); }
.v-smalls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.v-small .v-chart { margin: 2px 0; }
.v-small-h { font-size: 12px; font-weight: 600; color: var(--brand-ink); margin-top: 6px; }

/* ==== Phone (≤760px): the head card's phone sizes come from calibration.css. */
@media (max-width: 760px) {
  .v-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v-tile span { font-size: 19px; }
  .v-grid, .v-smalls { grid-template-columns: 1fr; }
  .v-intro-line { font-size: 12.5px; }
  /* The charts scale down ~0.7 into a phone's card, text with them: these
     user-unit sizes land at ~10px on screen. */
  .v-chart text, .v-chart .v-val { font-size: 13px; }
  .v-chart .v-lab { font-size: 14px; }
  .v-chart.v-scatter text { font-size: 12px; }
  details.v-tech summary { padding: 7px 0; }
}
