/* Piece styles on top of viz-design-system 2.1.0 (tokens.css, kit/kit.css). Every colour comes from a token. */
body {background: var(--viz-background); color: var(--viz-foreground); font: var(--viz-type-body)/var(--viz-type-line-height) var(--viz-font-body);}
a {color: var(--viz-link); text-underline-offset: 3px;}
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {outline: 3px solid var(--viz-focus); outline-offset: 3px;}
h1, h2, h3 {font-family: var(--viz-font-heading);}
main h2 {font-size: var(--viz-type-section); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .75rem; max-width: 40ch;}
main h3 {font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 0 0 .5rem;}
p {max-width: 72ch; margin: 0 0 1rem;}
code {font-size: .9em; overflow-wrap: anywhere;}
.block {margin-top: 3.25rem; scroll-margin-top: 1rem;}
.lede {color: var(--viz-muted); max-width: 70ch;}
.note {font-size: var(--viz-type-small); color: var(--viz-muted);}
.subhead {margin-top: 2.25rem !important;}
section.hero .hero-dek {max-width: 50rem;}

/* Tables */
.table-scroll {margin: 1.25rem 0 1rem;}
table.data th[scope=row] {font-weight: 600;}
table.data td, table.data th {vertical-align: top;}
table.taxonomy {min-width: 46rem;}
table.examples {min-width: 44rem;}
table.data th.num-head {text-align: right;}
table.data tr.selected > * {background: var(--viz-track);}
table.data tr.selected > th {box-shadow: inset 4px 0 0 var(--viz-highlight);}
table.examples tbody th {padding-inline-start: .7rem;}

/* Task-flow diagram: inline SVG drawn in kit tokens, so it follows the theme. Ink labels on ruled stage boxes, arrows in
   the strong rule colour, amber only for the line that matters. The wide drawing shows from 760 px, the stacked one below. */
.diagram-frame {margin: 1.5rem 0 1rem; padding: 1.25rem 1rem; background: var(--viz-surface); border: 1px solid var(--viz-rule); border-radius: 6px;}
svg.flow {display: block; width: 100%; height: auto; margin-inline: auto; overflow: visible;}
svg.flow-wide {max-width: 960px;}
svg.flow-tall {display: none; max-width: 22rem;}
.flow .flow-box {fill: var(--viz-background); stroke: var(--viz-rule); stroke-width: 1;}
.flow .flow-top {stroke: var(--viz-rule-strong); stroke-width: 2;}
.flow text {font-family: var(--viz-font-body);}
.flow .flow-label {fill: var(--viz-foreground); font-weight: 600;}
.flow .flow-arrow {fill: none; stroke: var(--viz-rule-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;}
.flow .flow-key {fill: var(--viz-highlight); font-weight: 600;}
.flow .flow-note {fill: var(--viz-muted);}
.text-alternative {border-inline-start: 2px solid var(--viz-rule-strong); padding-inline-start: 1rem;}

/* Measures and plan panels */
/* The three measure cards read as one ruled strip, the kit's KPI table look: strong top rule, hairline column rules. */
.three-col {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 1.25rem 0 1.5rem; background: var(--viz-surface); border-top: 2px solid var(--viz-rule-strong); border-bottom: 1px solid var(--viz-rule);}
.two-col {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem;}
.panel {background: var(--viz-surface); border: 1px solid var(--viz-rule); border-top: 2px solid var(--viz-rule-strong); border-radius: 0 0 6px 6px; padding: 1.1rem 1.25rem 1.25rem; min-width: 0;}
.panel h3 {margin-top: 0;}
.panel p {font-size: .97rem;}
.panel p:last-child {margin-bottom: 0;}
.three-col > .panel {background: none; border: 0; border-radius: 0; padding: .9rem 1rem 1rem;}
.three-col > .panel + .panel {border-left: 1px solid var(--viz-rule);}
.three-col > .panel h3 {font-family: var(--viz-font-body); font-size: var(--viz-type-label); font-weight: 600; line-height: 1.4; color: var(--viz-muted); margin-bottom: .4rem;}
.panel ol {padding-left: 1.2rem; margin: 0 0 1rem;}
.panel li {margin: .45rem 0;}
dl.terms {margin: 0; max-width: 72ch;}
dl.terms dt {font-weight: 600; margin-top: 1.1rem;}
dl.terms dd {margin: .2rem 0 0;}
ul.readings {padding-left: 1.2rem; max-width: 72ch;}
ul.readings li {margin: .45rem 0;}

/* Reader sections: glossary, experience callouts, notes lists, comparison tables, link rows. */
dl.glossary {display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; max-width: 72ch; margin: 1rem 0 0;}
dl.glossary dt {font-weight: 600;}
dl.glossary dd {margin: 0;}
.callout {border-left: 3px solid var(--viz-rule-strong); padding: .25rem 0 .25rem 1rem; max-width: 72ch;}
ul.notes {padding-left: 1.2rem; max-width: 72ch;}
ul.notes li {margin: .45rem 0;}
.block.use {margin-bottom: 2rem;}
pre.prompt {white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; margin: 1rem 0 0; padding: 1rem; font-family: var(--viz-font-figures); font-size: .875rem; line-height: 1.55; background: var(--viz-panel); color: var(--viz-foreground); border: 1px solid var(--viz-rule); border-radius: 6px;}
table.uses {min-width: 40rem;}
table.uses td, table.uses th {vertical-align: top;}
table.uses td {max-width: 38ch;}
table.worth {min-width: 46rem;}
table.pair {min-width: 22rem; max-width: 40rem;}
table.volume {min-width: 30rem; max-width: 48rem;}
table.pair tr.total > * {border-top: 2px solid var(--viz-rule-strong); font-weight: 600;}
table.pair tr.volume > * {color: var(--viz-muted);}
/* Collapsed reader sections (kit disclosure marker): the full example set, the request table, the diagram in words. */
main details.kit-disclosure {margin: 1rem 0; border-top: 1px solid var(--viz-rule); border-bottom: 1px solid var(--viz-rule);}
main details.kit-disclosure > summary {font-weight: 600;}
main details.kit-disclosure[open] {padding-bottom: .5rem;}
details.text-alternative {border-inline-start: 0; padding-inline-start: 0;}
details.text-alternative > p {border-inline-start: 2px solid var(--viz-rule-strong); padding-inline-start: 1rem;}
.links {display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; max-width: none;}
.links a {min-height: 44px; display: inline-flex; align-items: center;}

/* Example selector */
.selector {margin: 1.25rem 0;}
.selector label {display: block; font-weight: 600; margin-bottom: .4rem;}
select {font: inherit; min-height: 44px; padding: .45rem .75rem; max-width: 100%; color: var(--viz-foreground); background: var(--viz-panel); border: 1px solid var(--viz-border); border-radius: 6px;}
/* Example tiles: the kit's KPI table look and display figures (D31): ruled strip, Public Sans tabular lining figures. */
.metrics {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 1rem 0; background: var(--viz-surface); border-top: 2px solid var(--viz-rule-strong); border-bottom: 1px solid var(--viz-rule);}
.metric {padding: .9rem 1rem 1rem; min-width: 0;}
.metric + .metric {border-left: 1px solid var(--viz-rule);}
.metric span, .metric small {display: block;}
.metric span {font-size: var(--viz-type-label); color: var(--viz-muted);}
.metric strong {display: block; font-family: var(--viz-font-body); font-variant-numeric: tabular-nums lining-nums; font-size: clamp(1.9rem, 3.4vw, var(--viz-type-kpi)); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; color: var(--viz-foreground); margin-block: .2rem .15rem;}
.metric small {font-size: var(--viz-type-label); color: var(--viz-muted);}
.lesson {padding: .8rem 1rem; border-inline-start: 4px solid var(--viz-accent); background: var(--viz-surface); max-width: none;}

footer.site p {max-width: none;}
section.method details > *:not(summary) {max-width: 72ch;}
section.method ul {padding-left: 1.2rem;}

/* Sections far below the first screen skip layout until scrolled near (they stay in the accessibility tree and in print). */
@media screen {#examples, #misses, #uses, #rollout, #worth, #ai, section.method {content-visibility: auto; contain-intrinsic-size: auto 1200px;}}

@media (max-width: 959px) {
  .three-col {grid-template-columns: minmax(0, 1fr);}
  .three-col > .panel + .panel {border-left: 0; border-top: 1px solid var(--viz-rule);}
}
@media (max-width: 759px) {
  .two-col {grid-template-columns: minmax(0, 1fr); gap: .75rem;}
  .metrics {grid-template-columns: repeat(2, minmax(0, 1fr));}
  .metric {padding: .75rem .75rem .85rem 0;}
  .metric + .metric {border-left: 0;}
  .metric:nth-child(even) {padding-left: .75rem; border-left: 1px solid var(--viz-rule);}
  .metric:nth-child(n+3) {border-top: 1px solid var(--viz-rule);}
  .three-col > .panel {padding-inline: .75rem;}
  .diagram-frame {padding: 1rem .75rem;}
  svg.flow-wide {display: none;}
  svg.flow-tall {display: block;}
  dl.glossary {grid-template-columns: minmax(0, 1fr);}
  dl.glossary dd {margin-bottom: .5rem;}
  /* Key figures on a phone: keep label, figure and context aligned across each row of two. */
  table.kpis tbody td {display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start;}
  table.kpis tbody td > * {align-self: end;}
  table.kpis tbody td > .kpi-figure, table.kpis tbody td > .kpi-context {align-self: start;}
}
@media print {
  header.site, .kit-skip, .selector, .metrics, .lesson, .theme-toggle {display: none;}
  body {background: #ffffff; color: #000000; font-size: 10pt; line-height: 1.4;}
  .block {margin-top: 1.25rem;}
  .three-col, .two-col {display: block;}
  .panel {margin-bottom: 10pt; break-inside: avoid;}
  table.taxonomy, table.examples, table.uses, table.worth, table.pair, table.volume {min-width: 0; font-size: 8pt;}
  table.data tr.selected > * {background: transparent;}
  thead {display: table-header-group;}
  tr {break-inside: avoid;}
  section.method details > * {display: block;}
  svg.flow-wide {display: block;}
  svg.flow-tall {display: none;}
  a {color: #000000;}
}
