/* =============================================================================
   ALMA · site layer  (apps/web/public/css/site.css)                                         SITEKIT
   The shared layer for every page that is not the studio, on top of game-system.css (never forked: it adds,
   it does not override the kit's rules). Ported from the approved round 5 site.css.
   Loaded by views/partials/head.ejs (through site-top.ejs) after /fonts/fonts.css and game-system.css.

   Contents: tokens · shell and backdrop · brand · header (#site-nav) · footer · section and page heads ·
   banner strips · reveal motion · KPI tiles · chart cards on a 12-column grid · chart skins (bars, columns,
   lines, scatter, heatmap, donut, sparkline, meters, range bars, sankey) · pills, command marks, tooltips ·
   small shared bits (panel-card, check rows, notices, confirm dialog) · prose (legal pages).

   The data table (datatable.js and static [data-dt] tables) and the drawer are styled in insights.css.

   Tokens kept from the kit: --s1…--s8 spacing, --layer-1/2/3, --line, --gold, --cut, motion tokens.
   Chart series colours are --c0…--c6 (gold first, then cool steels); never --sN, which is spacing.
   Motion is transform and opacity only, off under prefers-reduced-motion, lighter in html.gm-lite.
   ============================================================================= */
:root {
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  /* chart series: gold first, then cool steels; good/warn/bad stay for status only */
  --c0: var(--gold);
  --c1: oklch(0.78 0.05 240);
  --c2: oklch(0.70 0.06 290);
  --c3: oklch(0.60 0.03 255);
  --c4: oklch(0.85 0.09 85 / 0.42);
  --c5: var(--good);
  --c6: var(--bad);
  --ice: oklch(0.86 0.07 215);
  /* command families (charts.js and the tables read these) */
  --c-image: var(--gold);
  --c-build: var(--ice);
  --c-video: var(--c1);
  --c-music: var(--c2);
  --c-speech: oklch(0.78 0.06 310);
  --c-chat: var(--c3);
  --c-book: oklch(0.80 0.10 60);
  --c-other: var(--fg-3);
  --grid-line: oklch(0.90 0.04 85 / 0.08);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body.site-body { min-height: 100vh; overflow-x: clip; }
.site { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.site > main { flex: 1 0 auto; min-width: 0; }
.site > main:focus { outline: none; }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }
code { font: 400 0.9em var(--f-mono); color: var(--gold); }
.muted { color: var(--fg-2); }
.hide { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: oklch(0.85 0.09 85 / 0.32); color: var(--fg); }

/* --- the space backdrop: the kit's art, a slow drift and a faint star twinkle ------------------- */
.site-backdrop img.on { opacity: var(--dim, 0.34); }
.site-backdrop picture { display: contents; }
.site-backdrop img { max-width: none; animation: site-sky 60s ease-in-out infinite alternate; }
/* the kit's img { max-width: 100% } would cap the 108% overscan, hence max-width: none above; the drift keeps inside it */
@keyframes site-sky { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.07) translate(-1.2%, -0.8%); } }
.site-stars { position: absolute; inset: 0; pointer-events: none; opacity: 0.55; background-image:
  radial-gradient(1px 1px at 12% 18%, oklch(0.95 0.03 85 / 0.9), transparent 60%), radial-gradient(1px 1px at 28% 62%, oklch(0.95 0.03 215 / 0.8), transparent 60%),
  radial-gradient(1.5px 1.5px at 46% 28%, oklch(0.95 0.05 85 / 0.9), transparent 60%), radial-gradient(1px 1px at 63% 74%, oklch(0.95 0.03 85 / 0.7), transparent 60%),
  radial-gradient(1px 1px at 78% 22%, oklch(0.95 0.03 215 / 0.9), transparent 60%), radial-gradient(1.5px 1.5px at 88% 56%, oklch(0.95 0.05 85 / 0.8), transparent 60%),
  radial-gradient(1px 1px at 6% 84%, oklch(0.95 0.03 85 / 0.7), transparent 60%), radial-gradient(1px 1px at 54% 92%, oklch(0.95 0.03 215 / 0.7), transparent 60%);
  animation: site-twinkle 7s ease-in-out infinite alternate; }
@keyframes site-twinkle { from { opacity: 0.25; } to { opacity: 0.7; } }
.gm-lite .site-backdrop img, .gm-lite .site-stars { animation: none; }

/* The site header (brand, #site-nav, the phone menu) lives in site-nav.css, shared with the studio. */

/* --- footer ------------------------------------------------------------------------- */
.footer { position: relative; margin-top: var(--s8); border-top: 1px solid var(--line); background: linear-gradient(180deg, oklch(0.11 0.024 262 / 0.5), oklch(0.09 0.02 262 / 0.92)); overflow: hidden; }
.footer-glow { position: absolute; left: 50%; top: -1px; width: min(560px, 70%); height: 1px; translate: -50% 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0.7; pointer-events: none; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: var(--s6); padding-block: var(--s7) var(--s6); }
.footer-about { display: grid; gap: var(--s3); justify-items: start; align-content: start; }
.footer-about p { color: var(--fg-2); font-size: 14px; max-width: 40ch; }
.footer-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.footer-col h2 { margin-bottom: 4px; color: var(--gold); }
.footer-col a { color: var(--fg-2); text-decoration: none; font-size: 14px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--fg); text-decoration: underline; text-decoration-color: var(--gold); }
.footer-col a:focus-visible { outline: none; color: var(--fg); box-shadow: 0 1px 0 var(--gold); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); padding-block: var(--s4) var(--s5); border-top: 1px solid var(--line); color: var(--fg-3); font-size: 13px; }
.footer-base span { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); } .footer-about { grid-column: 1 / -1; } }

/* --- section heads and page heads ---------------------------------------------------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--f-label); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.sec { padding-block: clamp(56px, 8vw, 104px) 0; }
.sec-head { display: grid; gap: var(--s3); max-width: 720px; margin-bottom: var(--s6); }
.sec-head h2 { font: 400 clamp(30px, 3.6vw, 46px)/1.08 var(--f-display); letter-spacing: 0.01em; text-wrap: balance; }
.sec-head p { color: var(--fg-2); font-size: 17px; line-height: 1.6; }
.sec-head.is-center { margin-inline: auto; text-align: center; justify-items: center; }
.page-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s4) var(--s6); padding-block: var(--s6) var(--s5); }
.page-head h1 { font: 400 clamp(32px, 4vw, 50px)/1.05 var(--f-display); letter-spacing: 0.01em; margin-top: 10px; text-wrap: balance; }
.page-head p { color: var(--fg-2); margin-top: 8px; max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 760px) { .page-head { grid-template-columns: minmax(0, 1fr); align-items: start; } }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--s3); grid-column: 1 / -1; margin-top: var(--s5); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); font: 400 24px/1.15 var(--f-display); letter-spacing: 0.02em; }
.section-title::before { content: ""; align-self: center; width: 8px; height: 8px; border: 1px solid var(--gold); transform: rotate(45deg); }
.section-title small { font: 500 14px/1.3 var(--f-body); color: var(--fg-3); letter-spacing: 0; }

/* --- banner strip (art header for app pages) ------------------------------------------- */
.banner { position: relative; overflow: hidden; isolation: isolate; clip-path: polygon(var(--cut-lg) 0, 100% 0, 100% calc(100% - var(--cut-lg)), calc(100% - var(--cut-lg)) 100%, 0 100%, 0 var(--cut-lg)); box-shadow: inset 0 0 0 1px var(--line); }
.banner > img, .banner > picture > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.banner > picture { display: contents; }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, oklch(0.12 0.024 262 / 0.94) 0%, oklch(0.12 0.024 262 / 0.7) 45%, oklch(0.12 0.024 262 / 0.18) 100%), linear-gradient(0deg, oklch(0.12 0.024 262 / 0.85), transparent 60%); }
.drift > img, .drift > picture > img, img.drift { animation: drift var(--t-drift) ease-in-out infinite alternate; }
.gm-lite .drift > img, .gm-lite .drift > picture > img { animation: none; }

/* --- reveal motion: staggered rise on scroll (transform and opacity only) ----------------
   site.js marks .rv elements that start below the fold with .rv-wait, then .is-in when they scroll in,
   so nothing on screen at load ever blinks. The kit's data-reveal="rise" works the same way. */
.rv { transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.rv.rv-wait { opacity: 0; transform: translateY(18px); }
.stagger > .rv:nth-child(2) { transition-delay: 70ms; } .stagger > .rv:nth-child(3) { transition-delay: 140ms; }
.stagger > .rv:nth-child(4) { transition-delay: 210ms; } .stagger > .rv:nth-child(5) { transition-delay: 280ms; }
.stagger > .rv:nth-child(6) { transition-delay: 350ms; } .stagger > .rv:nth-child(n+7) { transition-delay: 420ms; }
.stagger > .rv.rv-done { transition-delay: 0ms; }
/* the gold hairline sweep on hover */
.sweep { position: relative; overflow: hidden; }
.sweep::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); transform: translateX(-100%); opacity: 0; transition: transform 800ms var(--ease-out), opacity 300ms; pointer-events: none; }
.sweep:hover::after, .sweep:focus-within::after { transform: translateX(100%); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .rv, .rv.rv-wait { opacity: 1; transform: none; transition: none; }
  .sweep::after, .nav-sweep { display: none; }
  html { scroll-behavior: auto; }
  .site-backdrop img, .site-stars, .drift > img, .drift > picture > img { animation: none; }
}

/* --- focus rings that survive clipped corners: an inset ring instead of an outline -------- */
.kpi:focus-visible, .viz-card:focus-visible, .panel-card:focus-visible, .banner:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
a.panel-card:focus-visible, a.kpi:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }

/* --- KPI tiles -------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.kpi { --cut: 10px; position: relative; display: grid; gap: 6px; align-content: start; padding: var(--s4); min-width: 0; background: var(--layer-1); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); backdrop-filter: blur(14px); }
.kpi-label { font: 600 11.5px/1.2 var(--f-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-2); }
.kpi-value { font: 400 30px/1 var(--f-display); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value small { font: 500 14px/1 var(--f-body); color: var(--fg-2); }
.kpi-value.is-credit::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; vertical-align: 5px; border: 1px solid var(--gold); transform: rotate(45deg); }
.kpi-note { font-size: 12.5px; color: var(--fg-3); }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1.2 var(--f-label); letter-spacing: 0.06em; color: var(--fg-3); }
.kpi-delta.is-up, .kpi-delta.is-good { color: var(--good); } .kpi-delta.is-down, .kpi-delta.is-bad { color: var(--bad); } .kpi-delta.is-flat { color: var(--fg-3); }
.is-in .kpi-delta, .kpi.is-in .kpi-delta { animation: gm-in-left 600ms var(--ease-panel) 300ms backwards; }
.kpi .spark { width: 100%; height: 30px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- chart cards on a 12-column grid -------------------------------------------------------- */
.ins-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
@media (max-width: 1080px) { .span-3, .span-4, .span-5 { grid-column: span 6; } .span-6, .span-7, .span-8 { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ins-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s3); } .ins-grid > * { grid-column: 1 / -1; } }
.viz-card { --cut: 12px; position: relative; display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); align-content: start; padding: var(--s4) var(--s5) var(--s5); min-width: 0; background: var(--layer-1); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); backdrop-filter: blur(14px) saturate(1.1); }
.gm-lite .viz-card, .gm-lite .kpi, .gm-lite .panel-card { backdrop-filter: none; background: var(--layer-solid); }
.viz-head { display: flex; align-items: flex-start; gap: var(--s3); }
.viz-head > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.viz-head > .seg-mini { flex: none; display: inline-flex; align-self: start; }
.viz-head h2, .viz-head h3 { font: 400 19px/1.2 var(--f-display); letter-spacing: 0.02em; }
.viz-head p { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.viz-toggle { flex: none; height: 28px; padding: 0 10px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg-2); font: 600 11px/1 var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); transition: background var(--t-quick), color var(--t-quick); }
.viz-toggle:hover { color: var(--fg); background: var(--gold-tint); }
.viz-toggle[aria-pressed="true"] { color: var(--on-gold); background: var(--gold); box-shadow: none; }
.viz-toggle:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.viz-card.is-table .viz-plot { display: none; }
.viz-plot { min-width: 0; }
.viz-plot, [data-chart-table] { animation: gm-in-fade var(--t-panel) var(--ease-soft) backwards; }
.viz-table-wrap { position: relative; overflow-x: auto; max-height: 340px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.viz-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 0 10px 8px; background: oklch(0.17 0.03 262); font: 600 11px/1 var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.viz-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.viz-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.viz-table tbody tr:hover { background: oklch(0.85 0.09 85 / 0.05); }
.seg-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }

/* --- chart skins: legends, axes ----------------------------------------------------------- */
.cr { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-foot { display: flex; align-items: center; gap: 8px; margin-top: var(--s2); font-size: 12.5px; color: var(--fg-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px var(--s4); list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--fg-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; flex: none; background: var(--sc, var(--c0)); clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px); }
.legend i.is-dash { height: 2px; }
.legend-col { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
.legend-col li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; }
.legend-col b { color: var(--fg); font: 600 13px/1 var(--f-label); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.s0 { --sc: var(--c0); } .s1 { --sc: var(--c1); } .s2 { --sc: var(--c2); } .s3 { --sc: var(--c3); } .s4 { --sc: var(--c4); } .s5 { --sc: var(--c5); } .s6 { --sc: var(--c6); }
.ax-row { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font: 600 11px/1 var(--f-label); letter-spacing: 0.08em; color: var(--fg-3); }
.grid { stroke: var(--grid-line); stroke-width: 1; }
.axis { stroke: var(--line-2); stroke-width: 1; }

/* horizontal bars */
.hb { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.hb-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-l small { margin-left: 6px; color: var(--fg-3); font-size: 11.5px; }
.hb-b { width: 100%; height: 10px; overflow: visible; }
.hb-t { fill: oklch(0.90 0.04 85 / 0.06); }
.hb-f { fill: var(--sc, var(--c0)); transform-box: fill-box; transform-origin: left; }
.hb-f2 { fill: var(--c3); }
.hb-v { min-width: 3ch; text-align: right; font: 600 13px/1 var(--f-label); letter-spacing: 0.04em; color: var(--fg); font-variant-numeric: tabular-nums; }
.hb-row.is-on .hb-l { color: var(--fg); }
.rv .hb-f, .rv .col, .rv .dn-seg, .rv .hm i { transition: transform 900ms var(--ease-out), opacity 600ms var(--ease-soft); }
.rv.rv-wait .hb-f { transform: scaleX(0); }
.rv.rv-wait .col { transform: scaleY(0); }
.rv.rv-wait .hm i { opacity: 0; }
.rv .hb-row:nth-child(2) .hb-f { transition-delay: 40ms; } .rv .hb-row:nth-child(3) .hb-f { transition-delay: 80ms; } .rv .hb-row:nth-child(4) .hb-f { transition-delay: 120ms; }
.rv .hb-row:nth-child(5) .hb-f { transition-delay: 160ms; } .rv .hb-row:nth-child(n+6) .hb-f { transition-delay: 200ms; }
.col { fill: var(--sc, var(--c0)); transform-box: fill-box; transform-origin: bottom; }
.col.is-on { fill: var(--gold-hot); }
/* columns */
.cols { display: grid; gap: 4px; }
.col-plot, .ln-plot, .sc-plot { width: 100%; height: 160px; display: block; overflow: visible; }
.col-labels, .col-values { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); font: 600 10.5px/1.2 var(--f-label); letter-spacing: 0.04em; color: var(--fg-3); text-align: center; }
.col-labels span, .col-values span { overflow: hidden; white-space: nowrap; }
.col-values { color: var(--fg-2); }
/* lines: draw in with pathLength="1" (the kit's .gm-draw) */
.line { fill: none; stroke: var(--sc, var(--c0)); stroke-width: 2; stroke-linejoin: round; }
.line.is-dash { stroke-dasharray: 4 4; stroke-width: 1.5; }
.area { fill: var(--sc, var(--c0)); opacity: 0.16; }
.area.s0 { opacity: 0.22; }
.rv.rv-wait .line[pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rv.is-in .line[pathLength]:not(.is-dash) { stroke-dasharray: 1; animation: gm-draw 1100ms var(--ease-soft) backwards; }
.lns, .scs { display: grid; gap: 6px; min-width: 0; }
/* scatter */
.dot { stroke: var(--sc, var(--c0)); stroke-width: 7; stroke-linecap: round; opacity: 0.85; }
.dot.is-big { stroke-width: 11; }
.diag { stroke: var(--fg-3); stroke-width: 1; stroke-dasharray: 3 4; }
.scs { grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; }
.scs > .ax-y { grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); font: 600 10.5px/1 var(--f-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); text-align: center; }
.scs > .sc-plot { grid-row: 1; grid-column: 2; }
.scs > .ax-row, .scs > .ax-x, .scs > .legend { grid-column: 2; }
.ax-x { font: 600 10.5px/1 var(--f-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); text-align: center; }
/* heatmap */
.hm { display: grid; gap: 3px; min-width: 0; }
.hm-row { display: grid; grid-template-columns: 40px repeat(var(--hm-n, 26), minmax(0, 1fr)); gap: 3px; align-items: center; }
.hm-n6 { --hm-n: 6; } .hm-n7 { --hm-n: 7; } .hm-n8 { --hm-n: 8; } .hm-n12 { --hm-n: 12; } .hm-n14 { --hm-n: 14; } .hm-n24 { --hm-n: 24; } .hm-n26 { --hm-n: 26; }
.hm-l, .hm-head span { font: 600 10.5px/1 var(--f-label); letter-spacing: 0.06em; color: var(--fg-3); white-space: nowrap; overflow: hidden; }
.hm-head span { text-align: center; }
.hm i { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; background: oklch(0.90 0.04 85 / 0.05); font: 600 10px/1 var(--f-label); font-style: normal; color: var(--on-gold); clip-path: polygon(2px 0, 100% 0, 100% calc(100% - 2px), calc(100% - 2px) 100%, 0 100%, 0 2px); }
.hm i.l1 { background: oklch(0.85 0.09 85 / 0.18); } .hm i.l2 { background: oklch(0.85 0.09 85 / 0.34); } .hm i.l3 { background: oklch(0.85 0.09 85 / 0.52); }
.hm i.l4 { background: oklch(0.85 0.09 85 / 0.74); } .hm i.l5 { background: var(--gold); } .hm i.na { background: transparent; }
.hm i.l1, .hm i.l2 { color: var(--fg); }
.hm-scale { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 6px; font-size: 11.5px; color: var(--fg-3); }
.hm-scale i { width: 12px; aspect-ratio: 1; }
.hm-scale span { margin: 0 4px; }
/* donut */
.dn { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s4); align-items: center; }
.dn-fig { position: relative; width: 150px; aspect-ratio: 1; }
.dn-plot { width: 100%; height: 100%; transform: rotate(-90deg); }
.dn-track { fill: none; stroke: oklch(0.90 0.04 85 / 0.06); stroke-width: 14; }
.dn-seg { fill: none; stroke: var(--sc, var(--c0)); stroke-width: 14; }
.dn-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.dn-c b { font: 400 26px/1 var(--f-display); }
.dn-c small { font: 600 10.5px/1.2 var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
@media (max-width: 420px) { .dn { grid-template-columns: 120px minmax(0, 1fr); } .dn-fig { width: 120px; } }
/* sparkline, meters, range bars */
.spark { width: 100%; height: 28px; display: block; overflow: visible; }
.spark polyline, .spark .spark-l { fill: none; stroke: var(--sc, var(--gold)); stroke-width: 1.6; stroke-linejoin: round; }
.spark-a { fill: var(--sc, var(--gold)); opacity: 0.12; }
.spark.is-bad { --sc: var(--bad); } .spark.is-dim { --sc: var(--fg-3); } .spark.is-good { --sc: var(--good); }
.meter { display: inline-grid; grid-template-columns: minmax(48px, 1fr) auto; align-items: center; gap: 8px; min-width: 96px; }
.meter svg { width: 100%; height: 6px; }
.m-t { fill: oklch(0.90 0.04 85 / 0.08); }
.m-f { fill: var(--mc, var(--good)); }
.meter.is-good { --mc: var(--good); } .meter.is-warn { --mc: var(--warn); } .meter.is-bad { --mc: var(--bad); } .meter.is-gold { --mc: var(--gold); }
.meter b { font: 600 12.5px/1 var(--f-label); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; min-width: 3.4ch; text-align: right; }
.rb { display: grid; gap: 10px; }
.rb-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) minmax(90px, 0.8fr) minmax(0, 1.4fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.rb-l { display: grid; gap: 2px; min-width: 0; }
.rb-l small { color: var(--fg-3); font-size: 11.5px; }
.rb-b { width: 100%; height: 10px; }
.rb-t { fill: oklch(0.90 0.04 85 / 0.06); } .rb-f { fill: var(--c1); opacity: 0.7; } .rb-m { fill: var(--gold); }
.rb-v { font: 600 12.5px/1 var(--f-label); letter-spacing: 0.04em; color: var(--fg-2); white-space: nowrap; }
@media (max-width: 640px) { .rb-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l m" "b v"; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); } .rb-l { grid-area: l; } .rb-row .meter { grid-area: m; width: 120px; } .rb-b { grid-area: b; } .rb-v { grid-area: v; } }
/* sankey */
.sk-plot { width: 100%; height: auto; display: block; }
.sk-link { fill: none; stroke: var(--sc, var(--c0)); opacity: 0.32; transition: opacity var(--t-quick); }
.sk-link:hover { opacity: 0.6; }
.rv.rv-wait .sk-link { opacity: 0; }
.rv.is-in .sk-link { animation: site-flow 1200ms var(--ease-soft) backwards; }
@keyframes site-flow { from { opacity: 0; } }
.sk-node { fill: var(--sc, var(--fg-2)); }
.sk-t { fill: var(--fg); font: 500 13px var(--f-body); }
.sk-n { fill: var(--fg-3); font: 600 11.5px var(--f-label); letter-spacing: 0.04em; }
.only-narrow { display: none; }
@media (max-width: 640px) { .only-wide { display: none; } .only-narrow { display: block; } }

/* --- status pills, command marks, tooltips --------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; background: oklch(0.12 0.024 262 / 0.82); box-shadow: inset 0 0 0 1px var(--line-2); font: 600 11px/1 var(--f-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.pill i { width: 6px; height: 6px; background: var(--pc, var(--fg-3)); transform: rotate(45deg); flex: none; }
.pill.is-good { --pc: var(--good); color: var(--good); } .pill.is-warn { --pc: var(--warn); color: var(--warn); } .pill.is-bad { --pc: var(--bad); color: var(--bad); } .pill.is-gold { --pc: var(--gold); color: var(--gold); }
.cmd { display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px/1 var(--f-mono); color: var(--fg); white-space: nowrap; }
.cmd::before { content: ""; width: 7px; height: 7px; flex: none; border: 1px solid var(--fc, var(--gold)); background: var(--fc, var(--gold)); transform: rotate(45deg); }
.cmd[data-family="video"] { --fc: var(--c-video); } .cmd[data-family="music"] { --fc: var(--c-music); } .cmd[data-family="speech"] { --fc: var(--c-speech); } .cmd[data-family="book"] { --fc: var(--c-book); }
.cmd[data-family="chat"] { --fc: var(--c-chat); } .cmd[data-family="build"] { --fc: var(--c-build); } .cmd[data-family="other"] { --fc: var(--fg-3); }
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 10px); z-index: 60; width: max-content; max-width: 240px; padding: 7px 10px; background: var(--layer-solid); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 24px -10px oklch(0 0 0 / 0.7); color: var(--fg); font: 500 12.5px/1.35 var(--f-body); letter-spacing: 0; text-transform: none; white-space: normal; text-align: left; pointer-events: none; opacity: 0; transform: translate(-50%, -4px); transition: opacity var(--t-quick), transform var(--t-quick); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
[data-tip].tip-start::after { left: 0; transform: translate(0, -4px); }
[data-tip].tip-start:hover::after, [data-tip].tip-start:focus-visible::after { transform: none; }
[data-tip].tip-end::after { left: auto; right: 0; transform: translate(0, -4px); }
[data-tip].tip-end:hover::after, [data-tip].tip-end:focus-visible::after { transform: none; }
/* hidden tooltips still widen a phone's layout viewport, and touch has no hover: drop them there (aria-labels carry the text) */
@media (hover: none), (max-width: 640px) { [data-tip]::after { display: none; } }

/* --- small shared bits ------------------------------------------------------------------------- */
.panel-card { --cut: 12px; padding: var(--s5); background: var(--layer-1); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); backdrop-filter: blur(14px); }
.check-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.check-row input { appearance: none; width: 20px; height: 20px; margin: 1px 0 0; box-shadow: inset 0 0 0 1px var(--line-2); background: oklch(0.10 0.022 262 / 0.7); cursor: pointer; clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); display: grid; place-items: center; }
.check-row input::after { content: ""; width: 8px; height: 8px; background: var(--on-gold); transform: rotate(45deg) scale(0); transition: transform var(--t-quick) var(--ease-spring); }
.check-row input:checked { background: var(--gold); box-shadow: none; }
.check-row input:checked::after { transform: rotate(45deg) scale(1); }
.check-row input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.check-row a { color: var(--gold); }
.notice { --cut: 8px; display: flex; gap: 10px; align-items: center; padding: 10px var(--s4); background: var(--good-tint); box-shadow: inset 0 0 0 1px oklch(0.80 0.12 165 / 0.3); color: var(--fg); font-size: 14px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); animation: gm-in-up var(--t-panel) var(--ease-panel) backwards; }
.notice .ico { color: var(--good); flex: none; }
.notice.is-bad { background: var(--bad-tint); box-shadow: inset 0 0 0 1px oklch(0.74 0.14 25 / 0.35); }
.notice.is-bad .ico { color: var(--bad); }
.toast { z-index: 90; }
.copied, .is-copied { color: var(--good) !important; }
.btn .ico { width: 16px; height: 16px; }
.btn-lg .ico { width: 18px; height: 18px; }
.num { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .btn-lg { height: 48px; padding: 0 18px; font-size: 13px; letter-spacing: 0.1em; } }

/* --- the calm confirm dialog (ALMA.confirm in site.js): fades and rises, never shakes ------------- */
.site-confirm { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: var(--s4); background: var(--scrim); backdrop-filter: blur(6px); animation: fade var(--t-base) var(--ease-soft) both; }
.site-confirm .dialog { width: min(460px, 100%); }
.site-confirm .dialog-body p { color: var(--fg-2); line-height: 1.6; }
.site-confirm.is-out { opacity: 0; transition: opacity 180ms var(--ease-soft); }
.site-confirm .dialog-head h2 { font: 400 22px/1.2 var(--f-display); }

/* --- prose: legal pages and long text --------------------------------------------------------------- */
.prose { display: grid; gap: var(--s3); font-size: 16px; line-height: 1.7; color: var(--fg-2); max-width: 74ch; }
.prose h2 { margin-top: var(--s5); font: 400 24px/1.2 var(--f-display); letter-spacing: 0.02em; color: var(--fg); display: flex; align-items: baseline; gap: 12px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose h2::before { content: ""; flex: none; align-self: center; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s3); font: 600 13px/1.2 var(--f-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose ul, .prose ol { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.prose li { position: relative; padding-left: 20px; }
.prose li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }
.prose a { color: var(--gold); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose em { color: var(--fg-3); }
.prose code { font-size: 0.86em; padding: 1px 5px; background: oklch(0.10 0.022 262 / 0.7); box-shadow: inset 0 0 0 1px var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.prose th { text-align: left; padding: 0 12px 10px 0; font: 600 11px/1.2 var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); border-bottom: 1px solid var(--line-2); }
.prose td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose td:first-child { color: var(--fg); white-space: nowrap; }
.prose .table-scroll { overflow-x: auto; scrollbar-width: thin; }
@media (max-width: 640px) { .prose td:first-child { white-space: normal; } .prose table { min-width: 520px; } }
