/* Website styles. Tokens are copied from the platform (shared/design-system/tokens.css) so the site and the product share one look:
   same palette, same type, same status shapes. Flat: no gradients, a shadow only on what floats. */
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/atkinson-hyperlegible-next-latin-wght.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Mono"; src: url("fonts/atkinson-hyperlegible-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("fonts/barlow-semi-condensed-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --brand-primary: #0b57a4; --brand-link: #0b57a4; --brand-primary-hover: #0a4e94; --brand-secondary: #e85d04;
  --brand-ink: #12202b; --brand-page: #f4f6f5; --brand-tint: #e1e9ee; --brand-on-primary: #ffffff;
  --surface: #ffffff; --surface-sunk: #e8edeb; --line: #c9d3cf; --line-strong: #5b6a74;
  --text: var(--brand-ink); --text-muted: #44525c; --text-subtle: #5b6a74; --on-secondary: var(--brand-ink);
  --st-healthy-fg: #0b6b50; --st-healthy-bg: #d9f0e7;
  --st-degraded-fg: #6f4400; --st-degraded-bg: #fcebc0;
  --st-down-fg: #ffffff; --st-down-bg: #a8231b;
  --st-nodata-fg: #44525c; --st-nodata-bg: #eaeeed; --st-nodata-edge: #5b6a74;
  --state-healthy-fill: #0ca30c; --state-degraded-fill: #fab219; --state-down-fill: #d03b3b; --state-nodata-fill: #898781;
  --font-ui: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, Consolas, monospace;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", var(--font-ui);
  --radius-sm: 3px; --radius-md: 4px; --radius-lg: 8px;
  --elev-float: 0 6px 20px rgba(18, 32, 43, 0.16), 0 1px 3px rgba(18, 32, 43, 0.12);
}
/* The platform's own dark values, used for the hero band only */
.on-dark {
  --brand-primary: #5ba6ee; --brand-link: #7db9f5; --brand-primary-hover: #8cc3f7; --brand-on-primary: #0b1620;
  --text: #e8eef2; --text-muted: #b7c3cb; --line: #2b3844; --line-strong: #8d9ca7;
  background: var(--brand-ink); color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font: 400 17px/1.55 var(--font-ui); color: var(--text); background: var(--brand-page); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-link); }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.narrow { max-width: 780px; }
.sr { position: absolute; left: -9999px; }
.skip { position: absolute; left: -9999px; background: var(--brand-ink); color: #fff; padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
/* two-ring focus, as the platform */
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; box-shadow: 0 0 0 5px var(--surface); }
.on-dark :focus-visible { box-shadow: 0 0 0 5px var(--brand-ink); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0 0 .45em; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 6.4vw, 5rem); }
h2 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; margin-bottom: 1.1rem; color: var(--text-muted); }
.eyebrow::before { content: ""; width: 10px; height: 10px; background: var(--brand-secondary); border-radius: 50%; }  /* the "now" marker */
.lead { font-size: 1.28rem; color: var(--text-muted); max-width: 33em; line-height: 1.5; }
.sub { color: var(--text-muted); max-width: 40em; font-size: 1.18rem; margin-bottom: 2.4rem; }
.fine { font-size: .9rem; color: var(--text-muted); }

/* Buttons: 4px radius, 2px border, as the platform */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand-primary); color: var(--brand-on-primary); border: 2px solid var(--brand-primary); border-radius: var(--radius-md); padding: 0 22px; min-height: 48px; font: 600 1rem var(--font-ui); text-decoration: none; cursor: pointer; transition: background-color .12s, border-color .12s; }
.btn:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); color: var(--brand-on-primary); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--brand-tint); border-color: var(--line-strong); color: var(--text); }
.on-dark .btn-ghost:hover { background: var(--line); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }

/* Header: the kit header (surface, thin divider, display-font title) */
.nav { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1.5rem var(--font-display); }
.brand svg { color: var(--brand-primary); }
.menu { display: flex; align-items: center; gap: 26px; }
.menu a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; font-size: .98rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu a:not(.btn):hover { border-bottom-color: var(--brand-secondary); }
.menu-btn { display: none; font: 600 1rem var(--font-ui); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 0 14px; min-height: 44px; color: var(--text); }

/* Hero */
.hero { padding: 84px 0 96px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 56px; align-items: center; }
.hero .lead { color: var(--text-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 1.6rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--text-muted); font-size: .98rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--mask-check) no-repeat center / contain; mask: var(--mask-check) no-repeat center / contain; }
:root { --mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.2 11.6L2.6 8l1.4-1.4 2.2 2.2 5.8-5.8L13.4 4.4z'/%3E%3C/svg%3E"); }


/* Sections */
.sec { padding: 104px 0; }
.sec.alt { background: var(--surface); border-block: 1px solid var(--line); }
.sec.sunk { background: var(--surface-sunk); }
.cards { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.alt .card { background: var(--brand-page); }
.card h3 { font-size: 1.4rem; }
.card p { color: var(--text-muted); margin: 0; }
.card-hi { border: 2px solid var(--brand-primary); background: var(--brand-tint) !important; }
.card-hi h3 { color: var(--brand-primary); }

/* Steps with the diagram */
.steps { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { border-top: 3px solid var(--brand-primary); padding-top: 18px; }
.steps p { color: var(--text-muted); margin: 0; }
.steps .num { font: 600 .95rem var(--font-mono); color: var(--text-muted); display: block; margin-bottom: 6px; }
.diagram { margin: 0; background: var(--brand-page); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.diagram svg { width: 100%; height: auto; display: block; font-family: var(--font-ui); }
.d-node { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.d-node-tint { fill: var(--brand-tint); stroke: var(--line-strong); stroke-width: 1.5; }
.d-box { fill: var(--brand-primary); }
.d-box-row { fill: var(--brand-on-primary); fill-opacity: .16; }
.d-box-text { fill: var(--brand-on-primary); font-size: 14px; }
.d-text { fill: var(--text); font-size: 14px; }
.d-title { fill: var(--text); font-size: 15px; font-weight: 600; }
.d-muted { fill: var(--text-muted); font-size: 13px; }
.d-radio { stroke: var(--brand-secondary); stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; fill: none; }
.d-wire { stroke: var(--brand-primary); stroke-width: 2.5; fill: none; }
.d-zone { fill: none; stroke: var(--brand-primary); stroke-width: 1.5; stroke-dasharray: 3 6; }
.d-dot { fill: var(--state-healthy-fill); stroke: var(--line-strong); }
.d-mark { fill: var(--brand-secondary); }
@keyframes dash { to { stroke-dashoffset: -40; } }
.d-radio { animation: dash 2.6s linear infinite; }
@media (prefers-reduced-motion: reduce) { .d-radio { animation: none; } html { scroll-behavior: auto; } }

/* Snapshot window: a platform screen, drawn with the kit's components */
.snap { background: var(--brand-page); color: var(--brand-ink); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--elev-float); text-align: left; --text: var(--brand-ink); --text-muted: #44525c; --line: #c9d3cf; --line-strong: #5b6a74; --brand-primary: #0b57a4; --brand-on-primary: #fff; --brand-link: #0b57a4; }
.snap-head { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.snap-title { font: 600 1.15rem var(--font-display); margin-right: auto; display: flex; align-items: center; gap: 10px; }
.snap-title svg { color: var(--brand-primary); }
.snap-body { padding: 16px; display: grid; gap: 16px; }
.snap figcaption, .snap-cap { padding: 0 16px 14px; font-size: .8rem; color: var(--text-muted); }
.snap-hero { margin: 0; }
.snap-hero .snap-cap { background: var(--brand-page); }

.live { display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px 2px 8px; border: 1px solid var(--st-healthy-fg); border-radius: 999px; background: var(--st-healthy-bg); color: var(--st-healthy-fg); font-size: .8rem; font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); }
.kpi-l { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.kpi-v { font: 600 1.9rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi-v small { font: 400 .9rem var(--font-ui); color: var(--text-muted); }
.kpi-s { font-size: .8rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.good { color: var(--st-healthy-fg); font-weight: 500; }

.shape { width: 12px; height: 12px; flex: none; }
.c-healthy { color: var(--st-healthy-fg); } .c-degraded { color: var(--st-degraded-fg); } .c-down { color: var(--st-down-bg); } .c-nodata { color: var(--st-nodata-fg); }


.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border: 1px solid transparent; border-radius: 999px; font-size: .8rem; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.pill.healthy { background: var(--st-healthy-bg); color: var(--st-healthy-fg); }
.pill.degraded { background: var(--st-degraded-bg); color: var(--st-degraded-fg); border-color: var(--st-degraded-fg); }
.pill.down { background: var(--st-down-bg); color: var(--st-down-fg); border-color: var(--st-down-bg); }
.pill.nodata { background: var(--st-nodata-bg); color: var(--st-nodata-fg); border: 1px dashed var(--st-nodata-edge); }
.pill.neutral { background: transparent; color: var(--text); border-color: var(--line-strong); padding-left: 8px; }
.pill .shape { color: currentColor; }

.ktable-wrap { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); overflow-x: auto; }
.ktable { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.ktable th { padding: 8px 12px; text-align: left; font-size: .75rem; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid var(--line-strong); white-space: nowrap; }
.ktable td { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ktable tr:last-child td { border-bottom: 0; }
.ktable .num { text-align: right; }
.ktable td:first-child { font-weight: 500; }

.kcard { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.kcard[data-state="down"] { border-left: 4px solid var(--st-down-bg); }
.kcard[data-state="degraded"] { border-left: 4px solid var(--st-degraded-fg); }
.kcard-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.kcard-m { font-size: .8rem; color: var(--text-muted); }
.kcard + .kcard { margin-top: -4px; }

/* Tabs: the platform's tab style */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); margin-bottom: 40px; }
@media (max-width: 960px) { .tabs { overflow-x: auto; scrollbar-width: thin; } }
.tabs button { font: 500 1.02rem var(--font-ui); padding: 0 22px; min-height: 52px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { background: var(--brand-tint); color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--brand-primary); }
.panel { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.panel[hidden] { display: none; }
.panel h3 { font-size: 1.9rem; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { padding-left: 30px; position: relative; color: var(--text); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px; background: var(--st-healthy-fg); -webkit-mask: var(--mask-check) no-repeat center / contain; mask: var(--mask-check) no-repeat center / contain; }


/* Two-column blocks */
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-secondary); border-radius: var(--radius-md); padding: 24px 28px; }
.note p:last-child { margin: 0; }
.spec { width: 100%; border-collapse: collapse; background: var(--brand-page); border: 1px solid var(--line); border-radius: var(--radius-md); }
.spec th, .spec td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { width: 38%; color: var(--text-muted); font-weight: 500; }
.spec tr:last-child > * { border-bottom: 0; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 20px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 18px 0; min-height: 48px; font-size: 1.05rem; }
details[open] { border-color: var(--line-strong); }
details p { color: var(--text-muted); }

/* CTA band */
.cta { background: var(--brand-primary); color: var(--brand-on-primary); }
.cta h2, .cta p { color: var(--brand-on-primary); }
.form { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 28px; display: grid; gap: 14px; box-shadow: var(--elev-float); }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form input, .form select, .form textarea { font: 400 1rem var(--font-ui); padding: 0 12px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.form textarea { padding: 10px 12px; }
.form .fine { color: var(--text-muted); margin: 0; }
.form .btn { justify-self: start; }

.foot { padding: 32px 0; font-size: .9rem; color: var(--text-muted); background: var(--surface); border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.foot-in a { margin-left: auto; }

@media (max-width: 960px) {
  .hero-grid, .two, .panel { grid-template-columns: 1fr; gap: 40px; }
  .cards.three, .steps { grid-template-columns: 1fr; }
  .cards.four { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: block; }
  .menu { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 18px; }
  .menu.open { display: flex; }
  .menu a:not(.btn) { padding: 14px 0; }
  .sec { padding: 72px 0; }
  .hero { padding: 56px 0 64px; }
}
@media (max-width: 560px) { .cards.four { grid-template-columns: 1fr; } }

/* ---- Proportional state bar: each segment's width is its share of the total (flex-grow = count), so the bar always matches the counts beneath it ---- */
.sbarwrap { display: grid; gap: 8px; }
.sbar { --t: 214; display: flex; gap: 2px; height: 14px; }   /* --t is the total; each segment sets --n, its count */
.sbar i { display: block; flex: 0 0 calc((100% - 6px) * var(--n) / var(--t)); box-sizing: border-box; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--state-healthy-fill); }
.sbar i.degraded { background: var(--state-degraded-fill); }
.sbar i.down { background: var(--state-down-fill); }
.sbar i.nodata { background: var(--state-nodata-fill); border-style: dashed; }
.slegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .86rem; align-items: center; }
.slegend li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.slegend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.slegend small { color: var(--text-muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.slegend .tot { margin-left: auto; color: var(--text-muted); }
.slegend .tot b { color: var(--text); }

/* Tab strip inside a screen */
.stabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); overflow: hidden; }
.stabs span { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 38px; font-size: .86rem; font-weight: 500; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.stabs span.on { color: var(--text); font-weight: 600; border-bottom-color: var(--brand-primary); }
.tbadge { display: inline-block; min-width: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .75rem; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.tbadge.alert { background: var(--st-down-bg); border-color: var(--st-down-bg); color: var(--st-down-fg); }

.snap-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sel { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: .8rem; }
.sel::after { content: ""; width: 7px; height: 7px; border: solid var(--text-muted); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.sbtn { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 2px solid var(--brand-primary); border-radius: var(--radius-md); color: var(--brand-primary); font-size: .8rem; font-weight: 600; background: var(--surface); }
.kpi-v .spark { display: inline-block; vertical-align: middle; margin-left: 8px; }
.spark { stroke: var(--brand-primary); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sect-t { font: 600 1rem var(--font-display); margin: 4px 0 -4px; }
.kcard-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.kcard-top .kcard-h { flex-direction: column; align-items: flex-start; gap: 4px; }

/* ---- Phone screens (the app: large title, grouped lists, tab bar) ---- */
.phones { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: flex-start; margin: 0; }
.ph-cap { flex-basis: 100%; text-align: center; font-size: .8rem; color: var(--text-muted); margin: 0; }
.ph { width: 276px; height: 612px; display: flex; flex-direction: column; background: var(--brand-page); color: var(--brand-ink); border: 8px solid var(--brand-ink); border-radius: 36px; overflow: hidden; box-shadow: var(--elev-float); font-size: .86rem; line-height: 1.4; --text: var(--brand-ink); --text-muted: #44525c; --line: #c9d3cf; --line-strong: #5b6a74; --brand-primary: #0b57a4; --brand-link: #0b57a4; --brand-on-primary: #fff; }
.ph-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px 4px; font-size: .78rem; font-weight: 600; }
.ph-sig { width: 34px; height: 10px; border: 1.5px solid var(--brand-ink); border-radius: 3px; position: relative; }
.ph-sig::after { content: ""; position: absolute; inset: 1px; right: 8px; background: var(--brand-ink); border-radius: 1px; }
.ph-body { flex: 1; min-height: 0; overflow: hidden; padding: 4px 14px 0; display: grid; gap: 10px; align-content: start; }
.ph-back { color: var(--brand-link); font-size: .86rem; margin-bottom: -4px; }
.ph-title { font: 600 1.9rem/1.05 var(--font-display); margin: 0; }
.ph-verdict { font: 600 1.5rem/1.1 var(--font-display); margin: 0; }
.ph-sub { color: var(--text-muted); font-size: .8rem; margin: 0; }
.grp { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grp-t { font-size: .75rem; font-weight: 600; color: var(--text-muted); padding: 0 4px; margin: 2px 0 -4px; }
.gr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.gr:last-child { border-bottom: 0; }
.gr > span { min-width: 0; }
.gr small { display: block; color: var(--text-muted); font-size: .75rem; }
.gr b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.gr b small { display: inline; font-weight: 400; }
.gr .big { font: 600 1.15rem var(--font-display); }
.gr-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 5px; font-size: .75rem; font-weight: 600; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-tabs { display: flex; justify-content: space-around; padding: 7px 4px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.ph-tabs span { display: grid; justify-items: center; gap: 2px; font-size: .75rem; color: var(--text-muted); min-width: 56px; }
.ph-tabs span.on { color: var(--brand-primary); font-weight: 600; }
.ph-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph-info { background: var(--brand-tint); border-radius: 8px; padding: 9px 11px; font-size: .78rem; }
.ph-info b { display: block; }
.ph .pill { font-size: .75rem; }
.ph .sbar { height: 12px; }
.ph .slegend { gap: 3px 10px; font-size: .78rem; }
@media (max-width: 960px) { .ph { width: min(276px, 100%); } }

.gr .pill { flex: none; }
.gr .pill.neutral { padding-right: 8px; }

/* Mobile: 44px tap targets for standalone links, hero table fits without sideways scroll */
.brand { min-height: 44px; }
.status a, .foot-in a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 560px) {
  .snap-hero .ktable th:nth-child(3), .snap-hero .ktable td:nth-child(3) { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .snap-head { flex-wrap: wrap; }
  .slegend .tot { margin-left: 0; flex-basis: 100%; }
}

/* Let grid children shrink below their content so snapshots fit a 320 px phone */
.hero-grid > *, .two > *, .panel > *, .cards > * { min-width: 0; }
.snap { max-width: 100%; }
@media (max-width: 560px) {
  .kpi-v .spark { display: none; }
  .kpi { padding: 10px 12px; min-width: 0; }
  .kpi-v { font-size: 1.6rem; overflow-wrap: anywhere; }
  .snap-body { padding: 12px; }
}

/* =====================================================================
   Story pass: one color per chapter (platform tokens only), chapter labels,
   bridges, a progress bar, a chapter rail and scroll-driven motion.
   Motion is off for prefers-reduced-motion, and nothing is hidden without JS.
   ===================================================================== */

/* Dark chapters use the platform's own dark values, surfaces included */
.on-dark { --surface: #17212a; --surface-sunk: #0b1116; --brand-tint: #1f2d38; --brand-page: #0f161b; }
/* A screen drawn inside a dark chapter keeps its own light tokens */
.snap, .ph { --surface: #ffffff; --surface-sunk: #e8edeb; --brand-tint: #e1e9ee; --brand-page: #f4f6f5; --brand-ink: #12202b; }

/* Chapter backgrounds: ink, page, tint, white, sunk, ink, tint, page, sunk, blue */
.sec.tint { background: var(--brand-tint); border-block: 1px solid var(--line); }
.sec.tint .card { background: var(--surface); }
.sec.on-dark { border-block: 0; }

/* Chapter label */
.chapter { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font: 400 .9rem var(--font-mono); color: var(--text-muted); }
.chapter b { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 400; color: var(--text); background: var(--surface); }
.chapter::after { content: ""; flex: 0 1 96px; height: 1px; background: var(--line-strong); }
.on-dark .chapter b { background: transparent; }
.chapter .now { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-secondary); }   /* the "now" marker */

/* Bridge: one line that hands the story to the next chapter */
.bridge { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 64px 0 0; font: 600 clamp(1.2rem, 2.4vw, 1.6rem)/1.2 var(--font-display); color: var(--text-muted); text-align: center; }
.bridge::after { content: ""; width: 18px; height: 18px; background: var(--brand-secondary); -webkit-mask: var(--mask-down) no-repeat center / contain; mask: var(--mask-down) no-repeat center / contain; }
:root { --mask-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 5l6 6 6-6-1.4-1.4L8 8.2 3.4 3.6z'/%3E%3C/svg%3E"); }

/* Scroll progress bar */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 70; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--brand-secondary); transform-origin: left; transform: scaleX(0); }

/* Chapter rail (wide screens only) */
.rail { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 60; display: none; flex-direction: column; gap: 2px; }
.rail a { position: relative; display: block; width: 28px; height: 28px; }
.rail a::before { content: ""; position: absolute; inset: 9px; border: 2px solid var(--line-strong); border-radius: 50%; background: #ffffff; transition: inset .15s, background-color .15s; }
.rail a.on::before { inset: 6px; background: var(--brand-secondary); border-color: var(--brand-ink); }
.rail a span { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); padding: 4px 10px; border-radius: var(--radius-sm); background: var(--brand-ink); color: #ffffff; font-size: .8rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }
@media (min-width: 1360px) { .rail { display: flex; } }

/* Scroll-driven motion (only when JS runs and motion is allowed) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal:not(.in) { opacity: 0; transform: translateY(22px); }
  .js .reveal { transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
  .js .hero .snap.reveal:not(.in) { transform: translateX(28px); }
  .js .sbar { clip-path: inset(0 100% 0 0); }
  .js .sbar.in { clip-path: inset(0 0 0 0); transition: clip-path 1.2s cubic-bezier(.2,.7,.2,1) .25s; }
  .js .slegend li { opacity: 0; transition: opacity .5s; }
  .js .sbar.in ~ .slegend li { opacity: 1; transition-delay: calc(.9s + var(--k, 0) * .12s); }
  .js .spark polyline { stroke-dasharray: 100; stroke-dashoffset: 100; }
  .js .snap.in .spark polyline { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s ease .4s; }
  .js .diagram .seq { opacity: .14; }
  .js .diagram.in .seq { opacity: 1; transition: opacity .8s ease; transition-delay: calc(var(--i, 0) * .6s); }
  .panel:not([hidden]) { animation: panelIn .45s cubic-bezier(.2,.7,.2,1); }
  @keyframes panelIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---- Pilot band: bold, on the platform's orange (ink text, 4.73:1), with one clear button ---- */
.status { background: var(--brand-secondary); color: var(--on-secondary); border-block: 1px solid var(--brand-ink); }
.status-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding: 36px 0; }
.status-copy { flex: 1 1 520px; min-width: 0; }
.status-tag { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 4px 12px 4px 10px; border: 2px solid var(--brand-ink); border-radius: 999px; font: 600 .95rem var(--font-ui); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-ink); }
.status-line { margin: 0; font: 400 1.15rem/1.45 var(--font-ui); max-width: 52em; }
.status-line strong { display: block; margin-bottom: 4px; font: 600 clamp(1.6rem, 3.2vw, 2.3rem)/1.1 var(--font-display); }
.btn-ink { background: var(--brand-ink); border-color: var(--brand-ink); color: #ffffff; }
.btn-ink:hover { background: #0b57a4; border-color: #0b57a4; color: #ffffff; }
.btn-lg { min-height: 56px; padding: 0 32px; font-size: 1.1rem; }
@media (prefers-reduced-motion: no-preference) { .status-dot { animation: pulse 2s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .35; } } }
@media (max-width: 960px) { .status-in { padding: 28px 0; } .status .btn { width: 100%; } }

/* ---- Four apps, serialized: each app keeps its heading, screen and text together ---- */
.app-index { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 40px; }
.app-index a { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--brand-page); color: var(--text); text-decoration: none; }
.app-index a:hover { border-color: var(--line-strong); background: var(--brand-tint); }
.app-index b { font: 400 .9rem var(--font-mono); color: var(--text-muted); }
.app-index span { font: 600 1.35rem var(--font-display); }
.app-index small { color: var(--text-muted); font-size: .86rem; }

.app { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); grid-template-areas: "head fig" "list fig"; grid-template-rows: auto 1fr; gap: 20px 56px; align-items: start; padding: 64px 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.app-head { grid-area: head; }
.app > .snap { grid-area: fig; }
.app > .ticks { grid-area: list; }
.app-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-size: .9rem; color: var(--text-muted); }
.app-tag b { padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font: 600 .85rem var(--font-mono); color: var(--text); background: var(--brand-page); }
.app h3 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: .3em; }
.app-lead { font-size: 1.15rem; color: var(--text-muted); margin: 0; }

/* Phone apps: each screen pairs with its own text */
.app-phones { grid-template-columns: 1fr; grid-template-areas: "head" "pairs" "note"; }
.pairs { grid-area: pairs; display: grid; grid-template-columns: 1fr 1fr; gap: 48px 40px; }
.app-note { grid-area: note; margin: 0; }
.pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.pair-text h4 { font: 600 1.5rem/1.1 var(--font-display); margin: 0 0 14px; }

@media (max-width: 1180px) { .pairs { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .app-index { display: none; }   /* on phones the four apps simply run in order; no tab-like cards to scroll back to */
  .app { grid-template-columns: 1fr; grid-template-areas: "head" "fig" "list"; gap: 24px; padding: 48px 0; }
  .app-phones { grid-template-areas: "head" "pairs" "note"; }
}
@media (max-width: 700px) {
  .pair { grid-template-columns: 1fr; justify-items: center; gap: 20px; }
  .pair-text { width: 100%; }
}

/* ---- Floating back-to-top button ---- */
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 65; width: 52px; height: 52px; padding: 0; display: grid; place-items: center; border: 2px solid #ffffff; border-radius: 50%; background: var(--brand-primary); color: #ffffff; cursor: pointer; box-shadow: var(--elev-float); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s, background-color .12s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--brand-primary-hover); }
.to-top span { width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--mask-up) no-repeat center / contain; mask: var(--mask-up) no-repeat center / contain; }
:root { --mask-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 11l6-6 6 6-1.4 1.4L8 7.8l-4.6 4.6z'/%3E%3C/svg%3E"); }
@media (min-width: 1360px) { .to-top { right: 64px; } }   /* clear of the chapter rail */
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Links on the blue pilot band must stay readable */
.cta a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Leanrange mark: box, radio waves and sensor on one line; the sensor takes the secondary color (a fill, never text) */
.lr-hi { fill: var(--brand-secondary); }
