/* Reusable pieces: cards, controls, tiles, tables, charts and the drawing pad. */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.note { color: var(--text-muted); font-size: 13px; }
.error { background: var(--surface-2); border-left: 3px solid var(--bad); padding: 10px 14px; border-radius: 6px; margin: 8px 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.grid.two > .card > .stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { background: var(--surface-2); border-radius: 9px; padding: 11px 14px; display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-value { font-size: 24px; font-weight: 680; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-secondary); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 12px; background: var(--surface-2); color: var(--text-secondary); padding: 3px 10px; border-radius: 99px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; padding: 2px 9px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.badge-pass, .badge-good { color: var(--good); }
.badge-fail, .badge-bad { color: var(--bad); }
.badge-warn { color: var(--warn); }
.badge-info { color: var(--text-muted); }

button { font: inherit; cursor: pointer; border-radius: 8px; padding: 7px 14px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
button.ghost { background: transparent; color: var(--text-primary); border-color: var(--line); font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
select, input[type="number"] { font: inherit; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }

.pick { display: flex; flex-wrap: wrap; gap: 5px; }
.pick button { background: transparent; color: var(--text-secondary); border-color: var(--line); padding: 4px 11px; font-size: 13px; font-weight: 500; }
.pick button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 650; }

.slider { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; margin-bottom: 11px; font-size: 13.5px; }
.slider output { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.slider-track { grid-column: 1 / -1; position: relative; display: block; }
.slider-track input { display: block; margin: 4px 0; }
/* Saved-value stops: tick marks under the track, so a stepped slider looks stepped. */
.slider-stops { position: absolute; left: 8px; right: 8px; top: 100%; height: 8px; pointer-events: none; }
.slider-stops i { position: absolute; left: calc(var(--at) * 100%); top: -2px; width: 2px; height: 8px; margin-left: -1px; border-radius: 1px; background: var(--text-muted); }
.slider.stepped { margin-bottom: 18px; }
.slider small { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; }
.slider.off { opacity: .55; }

.pix { image-rendering: pixelated; background: #fff; border-radius: 5px; border: 1px solid var(--img-border); display: block; filter: var(--img-filter); }
.pix.keep-tone { filter: none; border-color: var(--line); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-muted); max-width: 150px; }
.tile.clickable { cursor: pointer; background: none; border: 0; padding: 0; font-weight: 400; text-align: left; }
.tile.clickable[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.compare { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.compare.fan { position: relative; column-gap: 64px; }
.fan-tiles { row-gap: 38px; padding-top: 28px; }
.fan-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
/* On a phone the source image and its variants stack, so the variant tiles get the full width. */
@media (max-width: 620px) { .compare.fan { flex-direction: column; row-gap: 14px; } .compare.fan > div { width: 100%; } .fan-tiles { row-gap: 8px; padding-top: 0; } }
.sheet { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--img-border); background: #fff; display: block; filter: var(--img-filter); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); padding: 5px 8px; white-space: nowrap; }
td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
.table-view { margin-top: 10px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--text-secondary); }
.stage-group { border-top: 1px solid var(--line); }
.stage-group > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 2px; }
.stage-group > summary .note { margin-right: auto; }
.stage-group .table-wrap { padding-bottom: 8px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.explain-section { border-top: 1px solid var(--line); }
.explain-section > summary { cursor: pointer; padding: 10px 2px; font-weight: 600; }
.explain-body { padding: 0 2px 12px; overflow-wrap: anywhere; }
.explain-body p, .explain-body ol, .explain-body ul { margin: 0 0 10px; }
.explain-body ol, .explain-body ul { padding-left: 20px; }
.explain-body li { margin-bottom: 4px; }
.explain-body .table-wrap { margin-bottom: 10px; }
.explain-hash { word-break: break-all; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-secondary); font-size: 11px; }
.chart .title { fill: var(--text-primary); font-weight: 600; font-size: 12px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-line { stroke: var(--text-muted); stroke-width: 1; }
.chart .cell { stroke: var(--surface-1); stroke-width: 2; }
.chart .cell.hit { cursor: pointer; }
.chart .cell:hover, .chart .cell.on { stroke: var(--text-primary); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-secondary); margin: 2px 0 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 12.5px; box-shadow: 0 3px 12px rgb(0 0 0 / .2); max-width: 260px; }

.cycle { width: 100%; height: auto; max-height: 640px; display: block; }
.cycle .node rect { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.cycle .node:hover rect, .cycle .node:focus rect { stroke: var(--accent); stroke-width: 2.5; }
.cycle .node { cursor: pointer; outline: none; }
.cycle .name { fill: var(--text-primary); font-size: 14.5px; font-weight: 680; }
.cycle .line { fill: var(--text-secondary); font-size: 11.5px; }
.cycle .arrow { fill: none; stroke: var(--text-muted); stroke-width: 1.8; }
.cycle .arrow.back { stroke-dasharray: 5 5; stroke: var(--accent); }
.cycle .head { fill: var(--text-muted); }
.cycle .center { fill: var(--text-muted); font-size: 11.5px; }
.cycle .center-big { fill: var(--text-primary); font-size: 26px; font-weight: 700; }
.cycle-list { display: none; padding: 0; margin: 0; list-style: none; }
.cycle-list a { display: block; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; margin-bottom: 6px; color: var(--text-primary); text-decoration: none; }
.cycle-list span { display: block; color: var(--text-secondary); font-size: 13px; }
@media (max-width: 620px) { .cycle { display: none; } .cycle-list { display: block; } }

.lights { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.light { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; color: var(--text-primary); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.light:hover { outline: 1.5px solid var(--accent); }

.pad-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.pad { width: 100%; max-width: 320px; aspect-ratio: 1; touch-action: none; background: var(--pad-paper); border: 1px solid var(--line); border-radius: 10px; cursor: crosshair; display: block; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.result { background: var(--surface-2); padding: 12px; border-radius: 9px; }
.result h3 { margin: 0; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.result strong { font-size: 23px; display: block; }
.prob { display: grid; grid-template-columns: 74px 1fr 42px; gap: 6px; align-items: center; font-size: 12.5px; margin-top: 4px; }
.prob b { display: block; height: 7px; border-radius: 0 4px 4px 0; }
.prob-track { background: var(--surface-1); border-radius: 0 4px 4px 0; }
.prob span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.predict-compact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.predict-compact .pad { max-width: none; }
.panel-msg { min-height: 42px; margin-top: 6px; }
.result strong { line-height: 1.25; }
@media (max-width: 620px) { .predict-compact { grid-template-columns: minmax(0, 1fr); } }
.label-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.label-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.label-chip i { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.label-chip.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.label-chip.on:has(i:not([hidden])) { background: transparent; color: var(--text-primary); }
[data-tip]:not(button, a, input, canvas, img) { cursor: help; }
.stat[data-tip] .stat-label, th[data-tip], h2[data-tip], h3[data-tip] { text-decoration: underline dotted var(--text-muted); text-underline-offset: 3px; }
.hero { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.hero .big { font-size: 44px; font-weight: 720; line-height: 1; font-variant-numeric: tabular-nums; }
.cycle .node.active rect { fill: var(--accent); stroke: var(--accent); }
.cycle .node.active .name, .cycle .node.active .line { fill: var(--on-accent); }
.cycle-list a[aria-current] { outline: 2px solid var(--accent); }
.cycle .node.dim { opacity: .5; }
.cycle .node.selected rect { stroke: var(--accent); stroke-width: 2.5; }
.cycle .arrow.back.past { opacity: .4; }
.cycle .arrow.back.now { stroke-width: 2.6; }
.cycle .center.now { fill: var(--text-primary); font-weight: 650; }
.progress-control { margin-bottom: 8px; display: flex; align-items: flex-start; gap: 16px; }
.progress-detail { margin-top: 10px; }
.star-control { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; }
.star-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 8px; }
.star-box { background: var(--surface-2); border-radius: 8px; padding: 12px; }
.star-box h4 { margin: 0 0 6px; }
.star-box h4 span { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 5px; margin-right: 7px; background: var(--accent); color: var(--on-accent); }
.star-box p { margin: 0; font-size: 14px; }
.op-chip { cursor: pointer; outline: none; }
.op-chip rect { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.op-chip text { fill: var(--text-primary); font-size: 12.5px; pointer-events: none; }
.op-chip:hover rect, .op-chip:focus rect { stroke: var(--accent); }
.op-chip.on rect { fill: var(--series-4); stroke: var(--series-4); }
.op-chip.on text { fill: #111; font-weight: 650; }
.net-stack rect { fill: var(--series-1); transition: fill .15s; }
.net-stack.on rect { fill: var(--series-4); }
.net-stack rect.current { fill: var(--series-5); opacity: 1; }
.op-detail { margin-top: 12px; }
.demo { background: var(--surface-2); border-radius: 9px; padding: 12px 14px; margin-top: 10px; }
.demo h4 { margin: 0 0 8px; }
.demo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.demo-grid { display: grid; gap: 3px; }
.demo-cell { display: flex; align-items: center; justify-content: center; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.demo-cell.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 650; }
.demo-cell.out { cursor: pointer; }
.demo-arrow { font-size: 22px; color: var(--text-muted); }
.sys-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.sys-node { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; background: var(--surface-2); color: var(--text-primary); border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.sys-node span { font-size: 12px; color: var(--text-secondary); }
.sys-node[aria-pressed="true"] { border-color: var(--accent); }
.sys-workers { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.sys-workers i { width: 10px; height: 10px; border-radius: 2px; background: var(--series-1); }
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.kind { background: var(--surface-2); border-top: 4px solid; border-radius: 8px; padding: 12px; }
.kind h4 { margin: 8px 0 4px; }
.kind p { margin: 0; font-size: 13.5px; color: var(--text-secondary); }
.kind-image { min-height: 112px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.model-card { background: var(--surface-2); border-radius: 8px; padding: 12px; }
.model-card h3 { margin: 0 0 4px; font-size: 15px; }
.result h3 { color: var(--text-primary); }
.arm-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1px var(--text-secondary); }
.model-card p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-secondary); }
.batch-bar { display: flex; gap: 2px; height: 24px; margin: 2px 0 6px; }
.batch-bar span { display: flex; align-items: center; justify-content: center; min-width: 30px; border-radius: 3px; font-size: 12px; font-weight: 650; color: #000; }
.vote-net { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 12px; row-gap: 58px; }
.vote-net .result { position: relative; z-index: 1; border: 2px solid transparent; }
.vote-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vote-line-label { fill: var(--text-primary); font-size: 12px; paint-order: stroke; stroke: var(--surface-1); stroke-width: 4px; }
.label-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.arch-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 0; margin: 0 0 14px; list-style: none; counter-reset: arch; }
.arch-flow li { background: var(--surface-2); border-radius: 9px; padding: 10px 12px; counter-increment: arch; }
.arch-flow strong { display: block; }
.arch-flow strong::before { content: counter(arch) ". "; color: var(--text-muted); }
.arch-flow span { font-size: 13px; color: var(--text-secondary); }
/* On a phone the vote keeps its desktop shape, smaller: three models above, two below, the vote across
   the middle, and the coloured lines into it. A model card shows its answer and its top confidence. */
@media (max-width: 620px) {
  .vote-net { column-gap: 6px; row-gap: 44px; }
  .vote-net .result { padding: 7px; }
  .vote-net .result.vote { grid-column: 1 / -1 !important; }
  .vote-net .result:not(.vote) h3 { font-size: 10.5px; line-height: 1.25; }
  .vote-net .result:not(.vote) strong { font-size: 15px; overflow-wrap: anywhere; }
  .vote-net .result:not(.vote) .prob { grid-template-columns: minmax(0, 1fr) 30px; font-size: 11px; }
  .vote-net .result:not(.vote) .prob > span:first-child, .vote-net .result:not(.vote) .prob ~ .prob { display: none; }
  .vote-net .result:not(.vote) .note { font-size: 10.5px; }
  .vote-line-label { font-size: 10px; }
}
.visual-block { margin-bottom: 22px; }
.flow-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.flow-tag { font-weight: 650; font-size: 13px; min-width: 52px; }
.flow-step { background: var(--surface-2); border-radius: 8px; padding: 7px 11px; font-size: 13.5px; }
.flow-arrow { color: var(--text-muted); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; }
/* On a phone the pad's six tools share one row. */
@media (max-width: 620px) {
  .pad-wrap > .toolbar { flex-wrap: nowrap; width: 100%; gap: 4px; }
  .pad-wrap > .toolbar > button { flex: 1 1 0; min-width: 0; padding: 7px 2px; display: inline-flex; align-items: center; justify-content: center; }
}
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta { display: inline-block; margin-top: 8px; padding: 10px 18px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.finding { font-size: 16px; color: var(--text-primary); margin: 10px 0; }
.finding-takeaway { margin: 0; }
.finding-more { margin-top: 4px; font-size: 13px; }
.finding-more summary { cursor: pointer; color: var(--text-secondary); }
.finding-more p { margin: 6px 0 0; color: var(--text-secondary); }

/* Phone touch targets: about 44 px hit areas for sliders, folds, ticks and links in cards. Table links use padding. */
@media (max-width: 620px) {
  .lights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lights > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  input[type="range"] { min-height: 44px; }
  summary { min-height: 44px; padding-block: 12px; }
  .card a { padding-block: 12px; }
}

.brief-job { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.brief-flow { display: flex; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.brief-step { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.brief-step span { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 3px; }
.brief-step strong { font-size: 14.5px; font-weight: 600; }
.brief-arrow { align-self: center; font-size: 20px; color: var(--text-muted); }
.brief-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.brief-notes h3 { margin: 0 0 6px; }
.brief-notes p { margin: 0; }
.brief-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.stage-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
@media (max-width: 620px) { .brief-flow { flex-direction: column; } .brief-arrow { transform: rotate(90deg); } }

/* Presentation parts: one claim, one visual, a few bullets per slide. */
.part-head .chips { margin-bottom: 4px; }
.slide-index { margin-top: 14px; }
.slide-index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.slide-index a { text-decoration: none; color: var(--text-secondary); }
.slide-index a:hover { color: var(--text-primary); }
.slide-number { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.slide { display: flex; flex-direction: column; gap: 14px; padding: 26px 28px; scroll-margin-top: 16px; }
.slide-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.slide-top .slide-number { font-size: 15px; margin-right: 4px; }
.phase-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.phase-chip { text-decoration: none; }
.phase-chip:hover { color: var(--text-primary); }
.slide-claim { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.2; margin: 0; max-width: 48ch; text-wrap: balance; }
.slide-visual { display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; }
.slide-visual .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.slide-visual .stat-value { font-size: clamp(24px, 2.6vw, 36px); }
.slide-image { max-height: 46vh; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.slide-bullets { margin: 0; padding-left: 20px; font-size: 17px; line-height: 1.5; max-width: 70ch; }
.slide-bullets li { margin-bottom: 4px; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; align-items: stretch; }
.flow-step { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); position: relative; overflow-wrap: anywhere; }
.flow-step + .flow-step::before { content: "→"; position: absolute; left: -10px; top: 50%; transform: translate(-50%, -50%); color: var(--text-muted); }
.flow-step span { font-size: 13px; color: var(--text-secondary); }
.layers { display: grid; gap: 8px; }
.layer { display: grid; grid-template-columns: minmax(130px, 180px) minmax(130px, 200px) 1fr; gap: 12px; align-items: baseline; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; }
.layer-job { color: var(--text-secondary); }
.handoff-line { font-size: 17px; font-weight: 600; margin: 0; }
.part-nav { margin-top: 12px; }
.appendix { margin-top: 36px; padding-top: 18px; border-top: 2px solid var(--line); }
.appendix-title { font-size: 18px; margin: 0 0 14px; color: var(--text-secondary); }
.evidence-links { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.agenda-item { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-decoration: none; color: inherit; height: 100%; }
.agenda-item:hover { border-color: var(--accent); }
.agenda-item strong { font-size: 16px; }
.phase-map td:first-child { white-space: nowrap; }
.phase-map td a { white-space: nowrap; }
.phase-map tr:target, .phase-map tr.focus { background: var(--surface-2); }
@media (max-width: 860px) {
  .flow { flex-direction: column; }
  .flow-step + .flow-step::before { content: "↓"; left: 50%; top: -10px; }
  .layer { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 620px) {
  .slide { padding: 18px 16px; min-height: 0; }
  .slide-bullets { font-size: 15px; }
  .phase-map td:first-child, .phase-map td a { white-space: normal; }
}

/* Coverage: how much of the source repository each part presents (widgets/coverage.js). */
.cov-track { background: var(--surface-2); border-radius: 6px; height: 14px; margin: 12px 0 6px; overflow: hidden; }
.cov-bar { display: flex; height: 100%; min-width: 2px; }
.cov-seg { display: block; height: 100%; }
.cov-1 { background: var(--series-1); } .cov-2 { background: var(--series-2); }
.cov-3 { background: var(--series-3); } .cov-4 { background: var(--series-4); }
.cov-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-secondary); margin: 4px 0 12px; }
.cov-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.cov-rows { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.cov-rows li { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cov-rows .cov-track { margin: 0; }
.cov-rows .num { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.table-view input[type="search"] { font: inherit; width: 100%; max-width: 22em; margin: 8px 0; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }
@media (max-width: 640px) { .cov-rows li { grid-template-columns: 1fr auto; } .cov-rows .cov-track { grid-column: 1 / -1; grid-row: 2; } }

/* Slide graphics (widgets/slide-charts.js). */
.slide-visual { margin: 14px 0 10px; }
.slide-visual .chart { width: 100%; height: auto; }
.slide-facts .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.slide-facts .stat { padding: 7px 11px; }
.slide-facts .stat-value { font-size: 17px; }
.slide-caption { font-size: 13px; color: var(--text-secondary); margin: 0 0 8px; font-weight: 600; }
.slide-pair { margin: 0; align-items: start; }
.diagram { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: nowrap; gap: 22px; align-items: stretch; }
.dg-node { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 11px; border-radius: 10px;
  background: var(--surface-2); border-top: 4px solid var(--dg, var(--accent)); }
.diagram > .dg-node + .dg-node::before { content: '→'; position: absolute; left: -18px; top: 50%; transform: translateY(-50%); font-size: 18px; font-weight: 700; color: var(--text-muted); }
.dg-node strong { font-size: 14.5px; color: var(--text-primary); }
.dg-sub { font-size: 12.5px; line-height: 1.35; color: var(--text-secondary); overflow-wrap: anywhere; }
.dg-icon { width: 30px; height: 30px; fill: none; stroke: var(--dg, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dg-c1 { --dg: var(--series-1); } .dg-c2 { --dg: var(--series-2); } .dg-c3 { --dg: var(--series-3); } .dg-c4 { --dg: var(--series-4); } .dg-c5 { --dg: var(--series-5); }
.dg-good { --dg: var(--good); } .dg-bad { --dg: var(--bad); }
.diagram-with { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 18px; align-items: center; }
.diagram-image { max-width: 220px; }
.pairs { display: grid; gap: 10px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.pair .dg-node { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); }
.pair-arrow { align-self: center; font-size: 22px; font-weight: 700; color: var(--text-muted); }
.aug-fan { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.aug-fan .tiles { flex: 1 1 300px; }
.aug-rows { display: grid; gap: 8px; }
.aug-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aug-name { width: 84px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.aug-label { width: 72px; text-align: center; font-size: 12px; color: var(--text-muted); }
.class-cols { display: flex; flex-wrap: wrap; gap: 12px; }
.class-cols .tile { align-items: center; }
.shape-row .tile { align-items: center; font-size: 12.5px; }
@media (max-width: 640px) {
  .diagram { flex-direction: column; gap: 22px; }
  .diagram > .dg-node + .dg-node::before { content: '↓'; left: 50%; top: -20px; transform: translateX(-50%); }
  .diagram-with { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .pair-arrow { transform: rotate(90deg); justify-self: center; }
  .aug-label { width: 56px; }
}

.strip-scroll { overflow-x: auto; border-radius: 6px; }
.strip-scroll .strip { height: 150px; width: auto; max-width: none; }

/* Iterations page: one switcher for iterations 1 to 3 (pages/iterations.js). */
.iteration-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; position: sticky; top: 0; z-index: 2; background: var(--surface-0); padding: 8px 0; }
.iteration-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 400; }
.iteration-tab strong { font-size: 15px; }
.iteration-tab[aria-selected="true"] { border: 2px solid var(--accent); background: var(--surface-2); }
.iteration-tab:hover { border-color: var(--accent); }
.iteration-result { font-size: 13px; color: var(--text-secondary); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.iteration-head { margin: 4px 0 14px; }
.iteration-head h2 { font-size: clamp(20px, 2.2vw, 26px); margin: 4px 0 6px; }
.iteration-steps { justify-content: space-between; }
@media (max-width: 640px) { .iteration-tabs { grid-template-columns: 1fr; position: static; } }

/* One menu group for both views, with a toggle (nav.js). */
.nav-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin-bottom: 8px; background: var(--surface-2); border-radius: 9px; }
.nav-view { font-size: 12.5px; padding: 6px 4px; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); font-weight: 600; }
.nav-view[aria-pressed="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
/* At the top of a part or stage page: flip to the other view of the same work. */
.view-flip { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; margin-bottom: 14px; background: var(--surface-2); border-radius: 10px; max-width: 100%; }
.view-flip-item { display: flex; flex-direction: column; padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--text-secondary); font-size: 13.5px; }
.view-flip-item:hover { color: var(--text-primary); }
.view-flip-item[aria-current="page"] { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 2px rgb(0 0 0 / .12); font-weight: 600; }
.view-flip-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 860px) {
  .nav-views { flex-direction: column; align-items: stretch; }
  .nav-toggle { margin: 0 0 4px; width: 240px; position: sticky; left: 0; }
  .nav-list { display: flex; gap: 4px; }
}

/* The CRISP-DM wheel draws itself when an iteration is picked (widgets/crisp-cycle.js). */
.cycle .grow-mask { fill: none; stroke: #fff; stroke-width: 14; stroke-dasharray: 1; stroke-dashoffset: 1; animation-name: cycle-grow; animation-timing-function: ease-in-out; animation-fill-mode: both; }
.cycle .arrow-head { fill: none; stroke: none; animation: cycle-in .2s ease-out backwards; }
.cycle .pop { animation: cycle-in .35s ease-out backwards; }
@keyframes cycle-grow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cycle-in { from { opacity: 0; } }
.progress-replay { margin-left: auto; }
@media (prefers-reduced-motion: reduce) {
  .cycle .grow-mask { animation: none; stroke-dashoffset: 0; }
  .cycle .arrow-head, .cycle .pop { animation: none; }
}

/* The iteration stepper on the CRISP-DM cycle: stations on a track, not a slider. */
.progress-stepper { position: relative; flex: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.step-track { position: absolute; top: 19px; left: calc(50% / var(--n)); right: calc(50% / var(--n)); height: 4px; border-radius: 2px; background: var(--line); }
.step-fill { display: block; height: 100%; width: calc(var(--fill) * 100%); background: var(--accent); border-radius: 2px; transition: width .35s ease; }
.progress-tick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0 4px 6px; color: var(--text-secondary); font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 10px; }
.progress-tick:hover .step-dot { border-color: var(--accent); transform: scale(1.08); }
.step-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--surface-1); border: 3px solid var(--line); color: var(--text-secondary); transition: transform .15s, background .2s, border-color .2s; }
.progress-tick.done .step-dot { border-color: var(--accent); color: var(--accent); }
.progress-tick.on .step-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.progress-tick.on .step-name { color: var(--text-primary); font-weight: 700; }
.step-verdict { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.step-verdict.pass { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.step-verdict.fail { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.progress-control .progress-replay { margin-left: 0; align-self: center; }

/* Slide image grids fill the slide's width instead of stopping at fixed 64 px tiles. */
.slide-visual .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.slide-visual .pix { width: 100%; height: auto; aspect-ratio: 1; }
.slide-visual .tile { max-width: none; min-width: 0; }
.slide-visual .aug-fan { display: grid; grid-template-columns: minmax(110px, 24%) auto minmax(0, 1fr); gap: 14px; align-items: center; }
.slide-visual .aug-fan .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.slide-visual .shape-row { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.slide-visual .class-cols { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
.slide-visual .class-cols .tile { gap: 6px; }
.slide-visual .aug-row { display: grid; grid-auto-flow: column; grid-template-columns: 84px; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: center; }
.slide-visual .aug-row .pair-arrow { text-align: center; }
.slide-visual .aug-label { width: auto; }
@media (max-width: 640px) {
  .slide-visual .shape-row, .slide-visual .class-cols { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .slide-visual .aug-fan { grid-template-columns: 1fr; }
  .slide-visual .aug-fan .pair-arrow { transform: rotate(90deg); justify-self: center; }
  .slide-visual .aug-fan .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slide-visual .aug-fan > .tile { max-width: 160px; }
  .slide-visual .aug-row { grid-template-columns: 64px; gap: 4px; }
}

/* The conclusion dot at the bottom right of every slide graphic: small, flat, quiet until hovered. */
.slide-visual { position: relative; padding-bottom: 22px; }
.takeaway { position: absolute; right: 4px; bottom: 0; width: 14px; height: 14px; border-radius: 50%; cursor: help;
  background: var(--accent); opacity: .45; transition: opacity .15s, transform .15s; }
.takeaway:hover, .takeaway:focus-visible { opacity: 1; transform: scale(1.25); }

/* The same conclusion dot on stage-page cards, at the card's bottom right. */
.card.has-takeaway { position: relative; padding-bottom: 34px; }
.card-takeaway { right: 14px; bottom: 12px; }
.slider.off .slider-stops { display: none; }

/* Predict: inference runs only on this button (widgets/predict-panel.js). It leads the
   drawing toolbar above the canvas as a green play button. */
.pad-bar { flex-wrap: nowrap; gap: 4px; margin: 0; width: 100%; max-width: 320px; }
.predict-compact .pad-bar { max-width: none; }
/* The toolbar is exactly as wide as the canvas: its buttons share the width and shrink together. */
.pad-bar > button { flex: 1 1 0; min-width: 0; padding: 7px 2px; display: inline-flex; align-items: center; justify-content: center; }
.pad-bar > .predict-btn { flex-grow: 1.4; }
.predict-btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px; color: #fff; background: #1f9d55; border: 1px solid #188a49;
  border-radius: 8px; box-shadow: 0 2px 0 #13703b; transition: background .15s, transform .08s, box-shadow .08s; }
.predict-btn svg { width: 18px; height: 18px; fill: currentColor; }
.predict-btn:hover:not(:disabled) { background: #22b060; box-shadow: 0 3px 0 #13703b, 0 4px 12px rgb(31 157 85 / .35); transform: translateY(-1px); }
.predict-btn:active:not(:disabled) { background: #188a49; transform: translateY(2px); box-shadow: 0 0 0 #13703b, inset 0 2px 4px rgb(0 0 0 / .25); }
.predict-btn:disabled { background: var(--surface-2); color: var(--text-muted); border-color: var(--line); box-shadow: none; cursor: not-allowed; }
.predict-btn.busy { cursor: progress; }
.predict-btn.busy svg { animation: predict-spin .8s linear infinite; }
@keyframes predict-spin { to { transform: rotate(360deg); } }
.predict-results.stale .result, .predict-results.stale .vote-lines { opacity: .4; transition: opacity .2s; }
