/* house.css — the WeYala house-style APPLICATION layer.
 *
 * tokens.css declares the palette/type/radii (the variables). This file APPLIES
 * them — the base typography, components, and layout modes every deliverable
 * shares, so nothing hand-rolls its own stylesheet again (#642 · Axis C:
 * mercurial → template; docs/73 §4, docs/48).
 *
 * REQUIRES tokens.css, linked FIRST:
 *   <link rel="stylesheet" href="/tokens.css">
 *   <link rel="stylesheet" href="/house.css">
 * It never re-declares :root — one palette, sourced once, every output.
 *
 * Modes: default (app/marketing) · .doc (reading column, reports) ·
 *        .deck > .slide (16:9 presentation) · print (@page). One layer, many outputs.
 */

/* ---- reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* the tactile grain, brand-canonical (opt out with .flat on <body>) */
body:not(.flat)::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--grain); opacity: .5; pointer-events: none;
}

/* ---- headings ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif); font-weight: 400;
  color: var(--ink); letter-spacing: .01em; line-height: 1.15;
  margin: 1.4em 0 .4em;
}
h1 { font-size: clamp(30px, 5vw, 42px); margin-top: .2em; }
h2 { font-size: clamp(23px, 3.4vw, 28px); padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
h3 { font-size: clamp(18px, 2.6vw, 21px); }
h4 { font-size: 17px; }

/* the mono eyebrow/kicker — a signature WeYala label */
.kicker, .eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 .4em;
}
/* editorial tick before every kicker — inherits the kicker's color */
.kicker::before {
  content: ""; display: inline-block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; vertical-align: middle; margin: -2px 10px 0 0;
}

/* ---- prose ---- */
p { margin: 0 0 1em; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--ink); font-weight: 600; }
em { color: var(--ink-soft); }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .25em 0; }
small, .muted { color: var(--muted); }
hr, .rule { border: none; border-top: 1px solid var(--rule); margin: 1.8em 0; }

/* ---- callout (blockquote) ---- */
blockquote, .callout {
  background: var(--card); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1em 0; padding: .8em 1.15em;
}
blockquote > :last-child, .callout > :last-child { margin-bottom: 0; }
.callout--olive { border-left-color: var(--olive); }
.callout--cobalt { border-left-color: var(--cobalt); }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .9em; }
th {
  background: var(--bg-deep); color: var(--ink-soft);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; text-align: left;
  padding: 8px 12px; border-bottom: 2px solid var(--rule);
}
td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
td strong { color: var(--accent); }
/* wide tables scroll inside their own box — never break the page layout */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- code ---- */
code {
  font-family: var(--font-mono); font-size: .82em;
  background: var(--bg-deep); padding: 1px 5px; border-radius: 5px; color: var(--ink-soft);
}
pre {
  background: var(--bg-deep); border: 1px solid var(--rule); border-radius: var(--radius-sm);
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.5;
}
pre code { background: none; padding: 0; }

/* ---- cards / disclosure / diagrams ---- */
.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 16px 18px;
}
details {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); padding: 6px 16px; margin: 12px 0;
}
summary {
  cursor: pointer; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .04em; color: var(--accent); padding: 6px 0;
}
img.diagram, .diagram {
  display: block; margin: 12px auto; max-width: 100%; max-height: 430px;
  padding: 14px; background: var(--card); border: 1px solid var(--rule);
  border-radius: 12px; break-inside: avoid;
}

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg-deep); color: var(--ink-soft); border: 1px solid var(--rule);
}
.badge--accent { background: var(--accent); color: var(--ink-on-accent); border-color: transparent; }
.badge--olive  { background: var(--olive);  color: var(--ink-on-accent); border-color: transparent; }
.badge--cobalt { background: var(--cobalt); color: var(--ink-on-accent); border-color: transparent; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  text-decoration: none; transition: transform .12s var(--ease), background .12s var(--ease);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--ink-on-accent); border-color: transparent; }
.btn--ghost { background: transparent; }

/* ---- layout modes ---- */
/* .doc — the reading column (reports, legibility, long-form) */
.doc { max-width: 820px; margin: 0 auto; padding: 22px 30px 56px; }

/* .deck / .slide — 16:9 presentation surface (seeds the deck skill, #641) */
.deck { max-width: 1120px; margin: 0 auto; padding: 24px 16px; }
.slide {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  padding: clamp(28px, 5%, 64px); margin: 0 0 22px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  break-inside: avoid;
}
/* direct-child only — nested .kicker inside cards/cols must stay in flow */
.slide > .kicker { position: absolute; top: clamp(20px, 4%, 40px); left: clamp(28px, 5%, 64px); }
.slide > .foot {
  position: absolute; bottom: clamp(20px, 4%, 40px); left: clamp(28px, 5%, 64px);
  right: clamp(28px, 5%, 64px); font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.slide h1, .slide h2 { margin: 0; border: none; }

/* slide layouts — the deck skill's vocabulary (#641) */
.slide .lead { font-size: clamp(16px, 2.2vw, 22px); color: var(--ink-soft); max-width: 46ch; margin: .6em 0 0; }
.slide--cover h1 { font-size: clamp(34px, 6.5vw, 68px); line-height: 1.04; }
.slide--statement h1 { font-size: clamp(30px, 5.5vw, 56px); max-width: 22ch; }
.slide--center { align-items: center; text-align: center; }
.slide--center .lead { margin-left: auto; margin-right: auto; }
.slide .cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4%, 48px); align-items: start; }
.slide .grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; margin-top: 1em; }
.slide .stat { font-family: var(--font-serif); font-size: clamp(46px, 10vw, 118px); line-height: .92; color: var(--accent); }
.slide .stat-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* dark surface (covers, section breaks) — still from tokens, never a rogue hex */
.slide--dark { background: var(--ink); color: var(--bg); border-color: transparent; }
.slide--dark h1, .slide--dark h2 { color: var(--bg); }
.slide--dark .lead { color: var(--accent-soft); }
.slide--dark .foot { color: var(--accent-soft); }

/* present mode — one slide fills the viewport; nav via keyboard/click.
   Print still shows every slide (one landscape page each). Scroll decks
   (plain .deck) stay valid — this is an opt-in modifier the shell adds. */
.deck--present { max-width: none; margin: 0; padding: 0; position: relative; height: 100svh; overflow: hidden; }
.deck--present .slide {
  position: absolute; inset: 0; width: 100vw; height: 100svh; aspect-ratio: auto;
  margin: 0; border: none; border-radius: 0; padding: clamp(32px, 6vw, 88px);
  overflow: hidden auto;
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.985);
  transition: opacity .5s var(--ease), transform .55s var(--ease), visibility 0s linear .5s;
}
.deck--present .slide.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .5s var(--ease), transform .55s var(--ease), visibility 0s;
}
/* the fancy bit — content rises in, staggered, when a slide activates */
@keyframes slideRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.deck--present .slide.is-active > *,
.deck--present .slide.is-active .cols > *,
.deck--present .slide.is-active .grid > * { animation: slideRise .6s var(--ease) both; }
.deck--present .slide.is-active > :nth-child(2) { animation-delay: .06s; }
.deck--present .slide.is-active > :nth-child(3) { animation-delay: .12s; }
.deck--present .slide.is-active > :nth-child(4) { animation-delay: .18s; }

/* page mode — the SAME DeckSpec as a scrolling report/web doc (write once, render
   everywhere). Slides become natural-height sections; present-mode chrome drops. */
.deck--page { max-width: 880px; padding: clamp(24px, 5vw, 56px) 20px; }
.deck--page .slide {
  aspect-ratio: auto; min-height: 0; justify-content: flex-start;
  background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  border-radius: 0; overflow: visible; padding: clamp(28px, 4vw, 48px) 0; margin: 0;
}
.deck--page .slide:last-child { border-bottom: 0; }
.deck--page .slide > .kicker { position: static; top: auto; left: auto; margin-bottom: .7em; }
.deck--page .slide > .foot { position: static; margin-top: 1.1em; }
.deck--page .slide__num, .deck--page .slide__accent { display: none; }
.deck--page .slide--cover, .deck--page .slide--center { text-align: left; align-items: stretch; }
.deck--page .slide--center .lead { margin-left: 0; margin-right: 0; }
.deck--page .slide--cover h1 { font-size: clamp(30px, 5vw, 52px); }
.deck--page .slide--dark { background: var(--ink); border-radius: 14px; padding: clamp(28px, 4vw, 48px); }

/* prose — report body copy (the fuller context a report carries vs a deck) */
.slide--prose { justify-content: flex-start; }
.prose { max-width: 64ch; margin-top: .6em; }
.prose p { font-size: 1.02em; line-height: 1.62; color: var(--ink-soft); margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose .em { font-family: var(--font-serif); font-style: italic; }
.deck--present .slide.is-active .cols > :nth-child(2),
.deck--present .slide.is-active .grid > :nth-child(2) { animation-delay: .1s; }
.deck--present .slide.is-active .grid > :nth-child(3) { animation-delay: .16s; }
.deck--present .slide.is-active .grid > :nth-child(4) { animation-delay: .22s; }
.deck--present .slide.is-active .grid > :nth-child(5) { animation-delay: .28s; }
.deck--present .slide.is-active .grid > :nth-child(6) { animation-delay: .34s; }
@media (prefers-reduced-motion: reduce) {
  .deck--present .slide, .deck--present .slide.is-active,
  .deck--present .slide.is-active > *,
  .deck--present .slide.is-active .cols > *,
  .deck--present .slide.is-active .grid > * { transition: none; animation: none; }
}

/* size up for presentation — fill the slide, squeeze the blank space (#642) */
.deck--present .slide { font-size: clamp(15px, 1.25vw, 19px); }
.deck--present .slide h2 { font-size: clamp(28px, 3.9vw, 48px); }
.deck--present .slide--statement h1 { font-size: clamp(34px, 5.2vw, 64px); }
.deck--present .slide--cover h1 { font-size: clamp(40px, 7.2vw, 84px); }
.deck--present .slide .lead { font-size: clamp(17px, 1.9vw, 26px); max-width: 54ch; }
.deck--present .slide .cols,
.deck--present .slide .grid { margin-top: clamp(24px, 4.5vh, 52px); gap: clamp(16px, 1.7vw, 28px); }
.deck--present .slide .card { padding: clamp(18px, 1.9vw, 30px); }
.deck--present .slide .card p { font-size: clamp(15px, 1.3vw, 19px); line-height: 1.5; }
.deck--present .slide .card .kicker { font-size: 12px; }
.deck--present .slide .tile-ico { width: clamp(46px, 3.6vw, 62px); height: clamp(46px, 3.6vw, 62px); border-radius: 14px; }
.deck--present .slide .tile-ico svg { width: 54%; height: 54%; }
.deck--present .slide .stat { font-size: clamp(96px, 17vw, 210px); }
.deck--present .slide .stat-label { font-size: clamp(14px, 1.5vw, 21px); }
.deck--present .slide .blockquote, .deck--present .slide blockquote { font-size: clamp(16px, 1.7vw, 23px); }

/* --- class it up: editorial index numeral, card depth, italic emphasis --- */
.slide__num {
  position: absolute; top: clamp(20px, 3.4vh, 44px); right: clamp(28px, 5%, 64px);
  font-family: var(--font-serif); font-size: clamp(54px, 7.5vw, 128px); line-height: 1;
  color: var(--accent); opacity: .12; pointer-events: none; user-select: none;
}
.slide--dark .slide__num { color: var(--bg); opacity: .17; }
.slide .card {
  box-shadow: 0 1px 1px rgba(26, 22, 18, .02), 0 16px 34px -20px rgba(26, 22, 18, .18);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.slide .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 3px rgba(26, 22, 18, .03), 0 24px 42px -18px rgba(26, 22, 18, .22);
}
/* italic serif emphasis — the editorial pull-accent (*word* in a spec) */
.em { font-family: var(--font-serif); font-style: italic; }

/* slim progress bar + tighter display kerning (presentation polish) */
.deck-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 11; background: transparent; }
.deck-progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s var(--ease); }
.deck--present .slide h1, .deck--present .slide h2 { letter-spacing: -.015em; }
@media print { .deck-progress { display: none; } }

/* ---- charts: on-brand, self-contained SVG (no external lib) ---- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .c-grid { stroke: var(--rule); stroke-width: 1; }
.chart .c-axis { stroke: var(--muted); stroke-width: 1.5; }
.chart .c-bar { fill: var(--accent); }
.chart .c-bar.olive { fill: var(--olive); }
.chart .c-bar.cobalt { fill: var(--cobalt); }
.chart .c-bar.muted { fill: var(--rule); }
.chart .c-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .c-dot { fill: var(--accent); }
.chart .c-area { fill: var(--accent); opacity: .1; }
.chart .c-val { font-family: var(--font-mono); font-size: 13px; font-weight: 600; fill: var(--ink-soft); }
.chart .c-lbl { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; fill: var(--muted); text-transform: uppercase; }
.chart .c-yval { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.slide--dark .chart .c-val { fill: var(--bg); }
.slide--dark .chart .c-lbl, .slide--dark .chart .c-yval { fill: var(--accent-soft); }
.slide--dark .chart .c-grid { stroke: rgba(255, 251, 239, .16); }
.chart-caption { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); margin-top: 12px; text-transform: uppercase; }

/* chart slides fill the desktop: top-align, let the chart take the height it needs */
.deck--present .slide:has(.chart), .deck--present .slide:has(.viz-slot) { justify-content: flex-start; }
.deck--present .slide .chart { margin-top: clamp(16px, 3vh, 32px); }
.deck--present .slide .chart svg { max-height: 56vh; margin: 0 auto; }

/* --- Fable elevation pass: locked editorial grid, framed bottom, eclipse-aware --- */
/* R1: headline pinned to one baseline; content rows center in the remaining height */
.deck--present .slide { justify-content: flex-start; padding-top: clamp(88px, 13vh, 140px); }
.deck--present .slide h2 { margin-top: 0; }
.deck--present .slide .grid,
.deck--present .slide .cols { flex: 1 1 auto; align-content: center; min-height: 0; }
.deck--present .slide--cover,
.deck--present .slide--statement,
.deck--present .slide--center { justify-content: center; padding-top: clamp(32px, 6vw, 88px); }

/* R3: running footline (hairline + folio) frames the bottom edge on every slide */
.deck--present .slide:not(:has(> .foot))::after {
  content: var(--deck-footer, ""); position: absolute;
  left: clamp(32px, 6vw, 88px); right: clamp(32px, 6vw, 88px); bottom: clamp(22px, 4vh, 40px);
  border-top: 1px solid var(--rule); padding-top: 12px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.deck--present .slide--dark:not(:has(> .foot))::after {
  border-top-color: rgba(255, 251, 239, .18); color: var(--accent-soft);
}
.deck--present .slide > .foot { border-top: 1px solid rgba(255, 251, 239, .18); padding-top: 12px; }
.deck--present .slide:not(.slide--dark) > .foot { border-top-color: var(--rule); }
/* keep the big numeral clear of the eclipse on graphic slides */
.slide:has(> .slide__accent) .slide__num { top: auto; bottom: clamp(48px, 9vh, 88px); }

/* R6: the tick is the slide-kicker's signature — not repeated inside every card */
.card .kicker::before { display: none; }
/* R7: kill display-type widows; give the cover a poster ceiling */
.slide h1, .slide h2, .slide .lead { text-wrap: balance; }
.deck--present .slide--cover h1 { font-size: clamp(44px, 8.4vw, 112px); letter-spacing: -.02em; }
/* R8: quiet the operator chrome while presenting */
.deck-nav { transition: opacity .4s var(--ease); }
.deck--present:not(:hover) .deck-nav { opacity: 0; }
/* touch devices have no hover — keep the nav visible so mobile users see it */
@media (hover: none) { .deck--present .deck-nav { opacity: 1; } }
/* R5 (labels): value labels carry weight; the hero bar argues in accent */
.chart .c-val { font-size: 17px; }
.chart .c-val--hero { fill: var(--accent); font-size: 22px; }

.deck-nav {
  position: fixed; bottom: 16px; right: 18px; z-index: 10;
  display: flex; align-items: center; gap: 2px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  color: var(--muted); background: var(--card); border: 1px solid var(--rule);
  border-radius: 999px; padding: 4px 6px;
  box-shadow: 0 2px 10px -4px rgba(0,0,0,.25);
}
.deck-count { padding: 0 6px; white-space: nowrap; color: var(--muted); }
.deck-btn {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  cursor: pointer; color: var(--ink-soft); font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .04em; line-height: 1;
  min-width: 34px; height: 34px; padding: 0 9px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s var(--ease), color .18s var(--ease), transform .1s var(--ease);
}
#deck-prev, #deck-next, #deck-full { font-size: 19px; padding: 0; }
.deck-btn--sep { margin-left: 4px; box-shadow: -1px 0 0 var(--rule); border-radius: 0 999px 999px 0; padding-left: 12px; }
.deck-btn:hover { background: var(--bg-deep); color: var(--accent); }
.deck-btn:active { transform: scale(.92); }
.deck-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  .deck-btn { min-width: 40px; height: 40px; }
  #deck-prev, #deck-next, #deck-full { font-size: 21px; }
}

/* ---- visual vocabulary: icon tiles + colored cards + accent graphic ---- */
.card.has-ico { display: flex; gap: 13px; align-items: flex-start; }
.tile-ico {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--bg-deep); color: var(--accent); border: 1px solid var(--rule);
}
.tile-ico svg { width: 21px; height: 21px; }
.card--sienna .tile-ico { background: var(--accent); color: var(--ink-on-accent); border-color: transparent; }
.card--olive  .tile-ico { background: var(--olive);  color: var(--ink-on-accent); border-color: transparent; }
.card--cobalt .tile-ico { background: var(--cobalt); color: var(--ink-on-accent); border-color: transparent; }
.card--muted  .tile-ico { background: var(--rule); color: var(--ink-soft); border-color: transparent; }
.card--sienna .kicker { color: var(--accent); }
.card--olive  .kicker { color: var(--olive); }
.card--cobalt .kicker { color: var(--cobalt); }
.card--muted  .kicker { color: var(--muted); }
/* a soft on-brand accent glow for cover / section slides (pure CSS, from tokens) */
/* eclipse: a crisp disc + hairline orbit (graphic, not a blurry glow) */
.slide__accent {
  position: absolute; right: -140px; top: -140px; width: 520px; height: 520px; border-radius: 50%;
  pointer-events: none; filter: none;
  background: radial-gradient(circle at 44% 44%, var(--accent) 0 61%, transparent 62%);
  opacity: .9;
}
.slide__accent::after {
  content: ""; position: absolute; inset: -13%; border-radius: 50%;
  border: 1.5px solid var(--accent-soft); opacity: .55;
}
.slide--dark .slide__accent { opacity: 1; }
.slide:not(.slide--dark) .slide__accent { opacity: .14; }
.slide--metric .stat { color: var(--accent); }
/* the big stat gets a colored underline rule */
.slide--center .stat + .stat-label { position: relative; padding-top: 14px; }
.slide--center .stat + .stat-label::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 44px; height: 3px; border-radius: 2px; background: var(--accent);
}

/* ---- responsive (mobile-friendly is a hard rule — verify at ~390px) ---- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .doc { padding: 18px 18px 40px; }
  th, td { padding: 7px 9px; }
  .slide { aspect-ratio: auto; min-height: 60vh; padding: 24px 20px; }
  .slide .cols, .slide .grid { grid-template-columns: 1fr; }
  /* deck present mode: the desktop editorial frame doesn't fit a ~390px scrolling slide */
  .slide__accent { width: 210px; height: 210px; right: -74px; top: -74px; }
  .deck--present .slide { padding-top: 62px; padding-bottom: 78px; }
  .deck--present .slide:not(.slide--cover):not(.slide--statement):not(.slide--center) { justify-content: flex-start; }
  .deck--present .slide .grid, .deck--present .slide .cols { flex: 0 0 auto; align-content: start; margin-top: clamp(16px, 3vh, 26px); }
  .deck--present .slide:not(:has(> .foot))::after { display: none; } /* pinned footline overlaps scrolling content on a phone */
  .deck--present .slide--cover h1 { font-size: clamp(38px, 12vw, 58px); }
  .deck--present .slide h1, .deck--present .slide h2 { padding-right: 56px; } /* clear the corner numeral */
  .slide__num { font-size: clamp(40px, 11vw, 58px); }
  .deck-nav { bottom: 12px; right: 12px; }
}
/* tablet: allow 2-up grids rather than a cramped many-across */
@media (min-width: 641px) and (max-width: 900px) {
  .slide .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- print / PDF (the legibility + deck export) ---- */
@page { margin: 14mm; }
@media print {
  body::before { display: none; }        /* no grain in print */
  body { background: #fff; }
  .deck--present, .deck--present .slide { position: static; height: auto; overflow: visible; }
  .slide, .deck--present .slide {
    display: flex; opacity: 1; visibility: visible; transform: none;
    page-break-after: always; border: none; aspect-ratio: auto; height: 100vh;
  }
  .slide.is-active > *, .slide .grid > *, .slide .cols > * { animation: none; }
  .slide:last-child { page-break-after: auto; }
  .deck-nav { display: none; }
  a { color: var(--ink); }
}

/* ================= STRUCTURAL TEMPLATES (Fable-designed) ================= */

/* =====================================================================
   tpl-slate — "console": dot-grid field · left accent rail · split
   terminal cover · hairline-topped tiles.
   ===================================================================== */
.deck--present.tpl-slate .slide { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.deck--present.tpl-slate .slide__accent { display: none; }
.deck--present.tpl-slate .slide::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 32%, transparent) 1px, transparent 1.4px);
  background-size: 26px 26px; background-position: 13px 13px;
}
.deck--present.tpl-slate .slide:not(.slide--cover):not(.slide--center) {
  border-left: 4px solid var(--accent);
}
.deck--present.tpl-slate .slide--dark { background: var(--bg-deep); color: var(--ink); }
.deck--present.tpl-slate .slide--dark h1, .deck--present.tpl-slate .slide--dark h2 { color: var(--ink); }
.deck--present.tpl-slate .slide--dark .lead { color: var(--ink-soft); }
.deck--present.tpl-slate .slide--dark .foot { color: var(--muted); }
.deck--present.tpl-slate .slide--dark:not(:has(> .foot))::after {
  border-top-color: var(--rule); color: var(--muted);
}
.deck--present.tpl-slate .kicker::before {
  width: 8px; height: 8px; border-radius: 2px; margin: -2px 9px 0 0;
}
.deck--present.tpl-slate .slide .slide__num {
  top: clamp(22px, 4vh, 40px); bottom: auto; right: clamp(32px, 6vw, 88px); left: auto;
  width: auto; font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  line-height: 1.6; letter-spacing: .12em; color: var(--muted); opacity: 1;
}
.deck--present.tpl-slate .slide .slide__num::before { content: "[ "; color: var(--accent); }
.deck--present.tpl-slate .slide .slide__num::after  { content: " ]"; color: var(--accent); }
.deck--present.tpl-slate .slide .card {
  background: var(--bg-deep); border: 1px solid var(--rule);
  border-top: 2px solid var(--accent); border-radius: 6px; box-shadow: none;
}
.deck--present.tpl-slate .slide .card:hover { transform: none; box-shadow: none; }
.deck--present.tpl-slate .slide .card--olive  { border-top-color: var(--olive); }
.deck--present.tpl-slate .slide .card--cobalt { border-top-color: var(--cobalt); }
.deck--present.tpl-slate .slide .card--muted  { border-top-color: var(--muted); }
.deck--present.tpl-slate .slide .tile-ico { border-radius: 6px; }
.deck--present.tpl-slate .slide--cover { padding-right: calc(36vw + clamp(28px, 4vw, 72px)); }
.deck--present.tpl-slate .slide--cover > .foot { right: calc(36vw + clamp(28px, 4vw, 72px)); }
.deck--present.tpl-slate .slide--cover:not(:has(> .foot))::after { right: calc(36vw + clamp(28px, 4vw, 72px)); }
.deck--present.tpl-slate .slide--cover .slide__num {
  top: 0; bottom: 0; right: 0; left: auto; width: 36vw;
  display: grid; place-content: center; justify-items: center; gap: clamp(10px, 2vh, 18px);
  background:
    radial-gradient(color-mix(in srgb, var(--muted) 45%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--bg);
  border-left: 1px solid var(--rule);
  font-family: var(--font-mono); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(110px, 15vw, 240px); line-height: 1; color: var(--accent); opacity: 1;
}
.deck--present.tpl-slate .slide--cover .slide__num::before {
  content: "deck // index"; font-size: 12px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
}
.deck--present.tpl-slate .slide--cover .slide__num::after {
  content: ""; width: 56px; height: 3px; border-radius: 2px; background: var(--accent);
}
@keyframes tplSlateCaret { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }
.deck--present.tpl-slate .slide--metric .stat { font-family: var(--font-mono); letter-spacing: -.05em; }
.deck--present.tpl-slate .slide--metric .stat::after {
  content: "_"; color: var(--accent-soft); animation: tplSlateCaret 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .deck--present.tpl-slate .slide--metric .stat::after { animation: none; }
}
@media (max-width: 640px) {
  .deck--present.tpl-slate .slide:not(.slide--cover):not(.slide--center) { border-left-width: 3px; }
  .deck--present.tpl-slate .slide--cover { padding-right: 20px; }
  .deck--present.tpl-slate .slide--cover > .foot { right: 20px; }
  .deck--present.tpl-slate .slide--cover .slide__num {
    top: 16px; right: 16px; bottom: auto; left: auto; width: auto;
    display: block; background: none; border: none; padding: 0;
    font-size: 13px; letter-spacing: .12em; color: var(--muted);
  }
  .deck--present.tpl-slate .slide--cover .slide__num::before { content: "[ "; font-size: inherit; letter-spacing: inherit; text-transform: none; color: var(--accent); }
  .deck--present.tpl-slate .slide--cover .slide__num::after  { content: " ]"; width: auto; height: auto; background: none; color: var(--accent); }
}
@media print {
  .deck--present.tpl-slate .slide::before { display: none; }
  .deck--present.tpl-slate .slide--metric .stat::after { content: none; }
}

/* =====================================================================
   tpl-mono — "Swiss sheet": top hairline rule · tiny mono folio ·
   ruled rows, no cards · everything left-aligned · red used once.
   ===================================================================== */
.deck--present.tpl-mono .slide { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.deck--present.tpl-mono .slide__accent { display: none; }
.deck--present.tpl-mono .slide::before {
  content: ""; position: absolute; top: clamp(26px, 4.5vh, 46px);
  left: clamp(32px, 6vw, 88px); right: clamp(32px, 6vw, 88px);
  height: 1px; background: var(--ink); pointer-events: none;
}
.deck--present.tpl-mono .slide--dark::before { background: color-mix(in srgb, var(--bg) 40%, transparent); }
.deck--present.tpl-mono .slide > .kicker {
  top: calc(clamp(26px, 4.5vh, 46px) + 12px); left: clamp(32px, 6vw, 88px);
}
.deck--present.tpl-mono .kicker { color: var(--ink); font-size: 10px; letter-spacing: .18em; }
.deck--present.tpl-mono .kicker::before {
  width: 7px; height: 7px; border-radius: 0; background: var(--accent); margin: -1px 9px 0 0;
}
.deck--present.tpl-mono .slide--dark .kicker { color: var(--bg); }
.deck--present.tpl-mono .slide .slide__num {
  top: calc(clamp(26px, 4.5vh, 46px) + 12px); bottom: auto; right: clamp(32px, 6vw, 88px);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; line-height: 1.6;
  letter-spacing: .18em; color: var(--ink); opacity: 1;
}
.deck--present.tpl-mono .slide--dark .slide__num { color: var(--bg); }
.deck--present.tpl-mono .slide h1, .deck--present.tpl-mono .slide h2 { font-weight: 600; letter-spacing: -.02em; }
.deck--present.tpl-mono .slide h2 { font-size: clamp(26px, 3.4vw, 42px); max-width: 30ch; }
.deck--present.tpl-mono .slide--cover h1 { font-size: clamp(40px, 6.6vw, 88px); max-width: 14ch; letter-spacing: -.025em; }
.deck--present.tpl-mono .slide--statement h1 { font-size: clamp(30px, 4.4vw, 52px); max-width: 26ch; }
.deck--present.tpl-mono .slide--cover { justify-content: flex-end; padding-bottom: clamp(72px, 14vh, 150px); }
.deck--present.tpl-mono .slide--center { align-items: flex-start; text-align: left; }
.deck--present.tpl-mono .slide--center .lead { margin-left: 0; margin-right: 0; }
.deck--present.tpl-mono .slide--center .stat + .stat-label::before {
  left: 0; transform: none; border-radius: 0; height: 2px;
}
.deck--present.tpl-mono .slide .stat {
  color: var(--ink); font-weight: 700; letter-spacing: -.03em; font-size: clamp(80px, 22vh, 220px);
}
.deck--present.tpl-mono .slide .stat-label { color: var(--ink-soft); }
.deck--present.tpl-mono .slide .card {
  background: transparent; border: none; border-top: 1px solid var(--ink);
  border-radius: 0; box-shadow: none; padding: clamp(14px, 2vh, 22px) 0 0;
}
.deck--present.tpl-mono .slide .card:hover { transform: none; box-shadow: none; }
.deck--present.tpl-mono .slide--dark .card { border-top-color: color-mix(in srgb, var(--bg) 45%, transparent); }
.deck--present.tpl-mono .slide .card .kicker { color: var(--ink); }
.deck--present.tpl-mono .slide--dark .card .kicker { color: var(--bg); }
.deck--present.tpl-mono .slide .tile-ico {
  width: 22px; height: 22px; border-radius: 0; background: transparent; border: none; color: var(--ink);
}
.deck--present.tpl-mono .slide .tile-ico svg { width: 100%; height: 100%; }
.deck--present.tpl-mono .card.has-ico { gap: 10px; }
.deck--present.tpl-mono .slide .grid,
.deck--present.tpl-mono .slide .cols { gap: clamp(20px, 3vw, 44px) clamp(24px, 3.4vw, 56px); }
.deck--present.tpl-mono .slide blockquote {
  background: transparent; border-left: 2px solid var(--accent);
  border-radius: 0; padding: .2em 0 .2em 1.1em;
}
.deck--present.tpl-mono .slide:not(.slide--dark):not(:has(> .foot))::after { border-top-color: var(--ink); }
.deck--present.tpl-mono .slide:not(.slide--dark) > .foot { border-top-color: var(--ink); }
@media (max-width: 640px) {
  .deck--present.tpl-mono .slide::before { top: 18px; left: 20px; right: 20px; }
  .deck--present.tpl-mono .slide > .kicker { top: 30px; left: 20px; }
  .deck--present.tpl-mono .slide .slide__num { top: 30px; right: 20px; }
  .deck--present.tpl-mono .slide--cover { padding-bottom: 56px; }
  .deck--present.tpl-mono .slide h1, .deck--present.tpl-mono .slide h2 { padding-right: 0; }
}

/* =====================================================================
   tpl-signal — "billboard": full-bleed color-block slides · solid color
   tiles · pill kickers · edge-bleed ghost numeral.
   ===================================================================== */
.deck--present.tpl-signal .slide { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.deck--present.tpl-signal .slide__accent { display: none; }
.deck--present.tpl-signal .slide h1, .deck--present.tpl-signal .slide h2 { font-weight: 700; letter-spacing: -.03em; }
.deck--present.tpl-signal .slide h2 { font-size: clamp(32px, 4.6vw, 60px); }
.deck--present.tpl-signal .kicker {
  display: inline-flex; align-items: center; width: fit-content;
  background: var(--ink); color: var(--card);
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  padding: 7px 14px; border-radius: 999px;
}
.deck--present.tpl-signal .kicker::before { display: none; }
.deck--present.tpl-signal .slide--dark .kicker { background: var(--accent); color: var(--ink-on-accent); }
.deck--present.tpl-signal .slide .slide__num {
  top: auto; bottom: clamp(8px, 2vh, 24px); right: -.08em; left: auto;
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(120px, 24vh, 260px); line-height: .8; letter-spacing: -.04em;
  color: var(--ink); opacity: .06;
}
.deck--present.tpl-signal .slide--statement { background: var(--ink); color: var(--card); border-color: transparent; }
.deck--present.tpl-signal .slide--statement h1 { color: var(--card); font-size: clamp(36px, 5.6vw, 72px); max-width: 20ch; }
.deck--present.tpl-signal .slide--statement .em { color: var(--accent); }
.deck--present.tpl-signal .slide--statement .lead { color: color-mix(in srgb, var(--card) 78%, transparent); }
.deck--present.tpl-signal .slide--statement .kicker { background: var(--accent); color: var(--ink-on-accent); }
.deck--present.tpl-signal .slide--statement blockquote {
  background: color-mix(in srgb, var(--card) 10%, transparent);
  border-left: 4px solid var(--accent); color: var(--card); border-radius: 0 10px 10px 0;
}
.deck--present.tpl-signal .slide--statement:not(:has(> .foot))::after {
  border-top-color: color-mix(in srgb, var(--card) 30%, transparent);
  color: color-mix(in srgb, var(--card) 70%, transparent);
}
.deck--present.tpl-signal .slide--statement .slide__num { color: var(--card); opacity: .12; }
.deck--present.tpl-signal .slide--cover,
.deck--present.tpl-signal .slide--metric {
  background: var(--accent); color: var(--ink-on-accent); border-color: transparent;
}
.deck--present.tpl-signal .slide--cover { justify-content: flex-end; padding-bottom: clamp(56px, 11vh, 120px); }
.deck--present.tpl-signal .slide--cover h1 {
  color: var(--ink-on-accent); font-size: clamp(48px, 9.6vw, 140px); line-height: .98; max-width: none;
}
.deck--present.tpl-signal .slide--cover .lead { color: color-mix(in srgb, var(--ink-on-accent) 88%, transparent); max-width: 44ch; }
.deck--present.tpl-signal .slide--cover .kicker,
.deck--present.tpl-signal .slide--metric .kicker { background: var(--card); color: var(--accent); }
.deck--present.tpl-signal .slide--cover > .foot { color: color-mix(in srgb, var(--ink-on-accent) 80%, transparent); border-top-color: color-mix(in srgb, var(--ink-on-accent) 35%, transparent); }
.deck--present.tpl-signal .slide--cover:not(:has(> .foot))::after,
.deck--present.tpl-signal .slide--metric:not(:has(> .foot))::after {
  border-top-color: color-mix(in srgb, var(--ink-on-accent) 35%, transparent);
  color: color-mix(in srgb, var(--ink-on-accent) 85%, transparent);
}
.deck--present.tpl-signal .slide--cover .slide__num,
.deck--present.tpl-signal .slide--metric .slide__num,
.deck--present.tpl-signal .slide--dark .slide__num { color: var(--card); opacity: .14; }
.deck--present.tpl-signal .slide--metric .stat { color: var(--ink-on-accent); font-weight: 700; font-size: clamp(110px, 26vh, 280px); }
.deck--present.tpl-signal .slide--metric .stat-label { color: color-mix(in srgb, var(--ink-on-accent) 88%, transparent); }
.deck--present.tpl-signal .slide--center .stat + .stat-label::before { background: var(--ink-on-accent); }
.deck--present.tpl-signal .slide .card {
  background: var(--bg-deep); border: none; border-radius: 18px; box-shadow: none;
}
.deck--present.tpl-signal .slide .card:hover { transform: translateY(-3px); box-shadow: none; }
.deck--present.tpl-signal .slide .card .kicker {
  display: block; background: transparent; color: var(--ink);
  padding: 0; border-radius: 0; font-size: 12px; letter-spacing: .1em;
}
.deck--present.tpl-signal .slide .card--sienna { background: var(--accent); }
.deck--present.tpl-signal .slide .card--olive  { background: var(--olive); }
.deck--present.tpl-signal .slide .card--cobalt { background: var(--cobalt); }
.deck--present.tpl-signal .slide .card--sienna,
.deck--present.tpl-signal .slide .card--olive,
.deck--present.tpl-signal .slide .card--cobalt { color: var(--ink-on-accent); }
.deck--present.tpl-signal .slide .card--sienna .kicker,
.deck--present.tpl-signal .slide .card--olive .kicker,
.deck--present.tpl-signal .slide .card--cobalt .kicker { color: var(--ink-on-accent); }
.deck--present.tpl-signal .slide .card strong { color: inherit; }
.deck--present.tpl-signal .slide .card--sienna .tile-ico,
.deck--present.tpl-signal .slide .card--olive .tile-ico,
.deck--present.tpl-signal .slide .card--cobalt .tile-ico {
  background: color-mix(in srgb, var(--ink-on-accent) 18%, transparent);
  color: var(--ink-on-accent); border: none;
}
@media (max-width: 640px) {
  .deck--present.tpl-signal .slide .slide__num { font-size: clamp(72px, 20vw, 110px); }
  .deck--present.tpl-signal .slide--cover { padding-bottom: 72px; }
  .deck--present.tpl-signal .slide--cover h1 { font-size: clamp(40px, 12.5vw, 60px); padding-right: 0; }
  .deck--present.tpl-signal .slide h2 { font-size: clamp(26px, 7.5vw, 34px); }
  .deck--present.tpl-signal .slide--metric .stat { font-size: clamp(80px, 24vw, 120px); }
}

/* ================= viz components (viz.ts): KPIs · sparkline · donut · waterfall · sankey ================= */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-family: var(--font-serif); font-size: clamp(30px, 4vw, 46px); line-height: 1.05; color: var(--ink); margin-top: 6px; }
.kpi-unit { font-size: .5em; color: var(--muted); margin-left: 3px; }
.kpi-delta { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.kpi-delta.up { color: var(--olive); background: color-mix(in srgb, var(--olive) 14%, transparent); }
.kpi-delta.down { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.spark { width: 100%; height: 30px; margin-top: 10px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.viz-donut { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.viz-donut svg { width: 200px; height: 200px; flex: none; }
.donut-seg { stroke: var(--accent); }
.donut-seg.olive { stroke: var(--olive); } .donut-seg.cobalt { stroke: var(--cobalt); } .donut-seg.muted { stroke: var(--rule); }
.donut-val { font-family: var(--font-serif); font-size: 34px; fill: var(--ink); }
.donut-lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; fill: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 9px; }
.donut-legend .lg { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--ink-soft); }
.donut-legend .lg b { color: var(--ink); }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.donut-legend .sw.olive { background: var(--olive); } .donut-legend .sw.cobalt { background: var(--cobalt); } .donut-legend .sw.muted { background: var(--rule); }

.viz-waterfall .wf.total { fill: var(--cobalt); }
.viz-waterfall .wf.up { fill: var(--olive); }
.viz-waterfall .wf.down { fill: var(--accent); }

.viz-sankey .sk-band { fill: var(--accent); opacity: .28; }
.viz-sankey .sk-band.olive { fill: var(--olive); } .viz-sankey .sk-band.cobalt { fill: var(--cobalt); } .viz-sankey .sk-band.muted { fill: var(--muted); }
.viz-sankey .sk-node { fill: var(--ink-soft); }
.viz-sankey .sk-node.olive { fill: var(--olive); } .viz-sankey .sk-node.cobalt { fill: var(--cobalt); } .viz-sankey .sk-node.muted { fill: var(--muted); }
.viz-sankey .sk-lbl { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-soft); }

/* stacked bar — composition of totals (balance sheet, sum-of-parts) */
.viz-stack .sb-seg { fill: var(--accent); stroke: var(--card); stroke-width: 1.5; }
.viz-stack .sb-seg.olive { fill: var(--olive); }
.viz-stack .sb-seg.cobalt { fill: var(--cobalt); }
.viz-stack .sb-seg.muted { fill: var(--ink-soft); }
/* labels sit ON saturated data fills — white reads in every theme (light + dark) */
.viz-stack .sb-seglbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; fill: #fff; text-transform: uppercase; opacity: .92; }
.viz-stack .sb-segval { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; fill: #fff; }

/* data table — financials / comps, optional in-cell magnitude bars */
.viz-table { margin: 0; }
.viz-table table { margin: 0; font-size: .95em; }
.ta-r { text-align: right; }
.viz-table td.has-bar { position: relative; font-family: var(--font-mono); }
.viz-table td.has-bar .cellbar { position: absolute; right: 0; top: 50%; transform: translateY(-50%); height: 24px; background: var(--accent-soft); opacity: .45; z-index: 0; border-radius: 2px; }
.viz-table td.has-bar .cellbar-v { position: relative; z-index: 1; }
/* styled cells — semantic status colors (theme-independent), e.g. a risk register */
.viz-table .tone-danger { color: #E5484D; font-weight: 600; }
.viz-table .tone-warn { color: #E8850C; font-weight: 600; }
.viz-table .tone-good { color: #2A9D5C; font-weight: 600; }
.viz-table .cell-underline { text-decoration: underline; text-decoration-color: #2A9D5C; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* gantt — a schedule: status-colored task bars on a week axis */
.viz-gantt .gt-grid { stroke: var(--rule); stroke-width: 1; }
.viz-gantt .gt-wk { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); letter-spacing: .04em; }
.viz-gantt .gt-lbl { font-family: var(--font-mono); font-size: 12.5px; fill: var(--ink-soft); }
.viz-gantt .gt-bar { fill: var(--accent); }
.viz-gantt .gt-bar.done, .viz-gantt .gt-mile.done { fill: var(--olive); }
.viz-gantt .gt-bar.active, .viz-gantt .gt-mile.active { fill: var(--accent); }
.viz-gantt .gt-bar.risk, .viz-gantt .gt-mile.risk { fill: #E5484D; } /* semantic warning — universal across themes */
.viz-gantt .gt-mile { fill: var(--cobalt); }
.viz-gantt .gt-now { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .85; }
.viz-gantt .gt-now-lbl { font-family: var(--font-mono); font-size: 10px; fill: var(--accent); letter-spacing: .06em; }
.gt-legend { display: flex; gap: 18px; justify-content: center; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.gt-legend .gl { display: inline-flex; align-items: center; gap: 6px; }
.gt-legend .gl::before { content: ""; width: 12px; height: 12px; border-radius: 3px; }
.gt-legend .gl.done::before { background: var(--olive); }
.gt-legend .gl.active::before { background: var(--accent); }
.gt-legend .gl.risk::before { background: #E5484D; }

/* scatter — points on two numeric axes (calibration, distribution) */
.viz-scatter .sc-dot { fill: var(--accent); fill-opacity: .78; }
.viz-scatter .sc-dot.olive { fill: var(--olive); } .viz-scatter .sc-dot.cobalt { fill: var(--cobalt); } .viz-scatter .sc-dot.muted { fill: var(--muted); }
.viz-scatter .sc-diag { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.viz-scatter .sc-xval { font-family: var(--font-mono); font-size: 12px; fill: var(--muted); }
.viz-scatter .sc-axlbl { font-family: var(--font-mono); font-size: 12px; fill: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }

/* heatmap — labeled grid, cell intensity = value */
.viz-heatmap .hm-cell { fill: var(--accent); }
.viz-heatmap .hm-row, .viz-heatmap .hm-col { font-family: var(--font-mono); font-size: 12px; fill: var(--ink-soft); }
.viz-heatmap .hm-val { font-family: var(--font-mono); font-size: 13px; font-weight: 600; fill: var(--ink); }
.viz-heatmap .hm-val.on { fill: #fff; }

/* ============================================================
   Front-door stitch (#983) — the shared tool-page top-bar.
   Every tool (workflow · task list · plan) wears the same slim
   chrome: the WeYala wordmark links back to the shell (app), a
   "← Tools" breadcrumb, and the tool's own sign-in control
   (wy-sync.js) slotted on the right. Additive nav only — the
   tool body below it is untouched.
   ============================================================ */
.wy-topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px clamp(14px, 4vw, 24px);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.wy-topbar .wy-mark {
  font-family: var(--font-serif); font-size: 22px; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap; line-height: 1;
}
.wy-topbar .wy-mark i {
  font-style: normal; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); margin-left: 2px; vertical-align: baseline;
}
.wy-topbar .wy-back {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; white-space: nowrap;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.wy-topbar .wy-back:hover { border-color: var(--accent); color: var(--accent); }
.wy-topbar .wy-topbar-slot {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: flex-end; min-width: 0;
}
@media (max-width: 520px) {
  .wy-topbar { gap: 9px; padding: 9px 14px; }
  .wy-topbar .wy-mark { font-size: 19px; }
  .wy-topbar .wy-topbar-slot { width: 100%; justify-content: flex-start; }
}
