/* Datatonia Showroom: one design system for the showroom page and the four demo pages.
   Every page loads this file first; a demo's own stylesheet holds only what is special to that demo.
   Type: Lora for headlines, the system sans for everything that is read or pressed, IBM Plex Mono for small labels and figures.
   Rule of the system: one thing to do at a time. The guide bar says what to do next; everything else waits behind it. */

@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-mono-600.woff2) format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-display: swap; src: url(fonts/lora-400.woff2) format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 600; font-display: swap; src: url(fonts/lora-600.woff2) format("woff2"); }

:root {
  color-scheme: light dark;
  --page: #faf9f5; --surface: #ffffff; --surface2: #f4f2ea; --hover: #efece2;
  --ink: #171614; --ink2: #47453f; --muted: #6d6b63;
  --grid: #e9e6dc; --axis: #d6d2c3; --field: #8f8b7b;
  --accent: #d97757; --accent-ink: #b4532f; --accent-soft: #fbefe9; --on-accent: #ffffff;
  --stage: #171513; --stage2: #23201c; --on-stage: #f4f0e8; --on-stage2: #bdb7a8;
  --good: #2f7d32; --warn: #b7791f; --bad: #c0392b; --goodtext: #256428; --warntext: #8a5a10; --badtext: #a32b1f;
  --good-soft: #edf5ec; --warn-soft: #fbf3e2; --bad-soft: #fbecea;
  --s1: #3f7cba; --s2: #d97757; --s3: #6b8748; --s4: #c2922b;
  --r-sm: 8px; --r: 14px; --r-lg: 22px; --maxw: 1120px;
  --ease: cubic-bezier(.16, 1, .3, 1); --dur: 220ms;
  --shadow-sm: 0 1px 2px rgba(28, 26, 24, .05), 0 2px 8px -2px rgba(28, 26, 24, .06);
  --shadow: 0 2px 4px rgba(28, 26, 24, .04), 0 14px 36px -14px rgba(28, 26, 24, .22);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 60px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #131210; --surface: #1c1a17; --surface2: #24221e; --hover: #2e2b26;
  --ink: #f2efe8; --ink2: #cfcbbf; --muted: #a09c8f;
  --grid: #2f2c27; --axis: #423e37; --field: #7d796c;
  --accent: #e08a6b; --accent-ink: #eb9d80; --accent-soft: #2e211b; --on-accent: #1c1a18;
  --stage: #2b2823; --stage2: #37332d;   /* raised, so the guide stands out from a dark page */
  --good: #5fae62; --warn: #d9a441; --bad: #e0705f; --goodtext: #7cc47f; --warntext: #e2b55c; --badtext: #f08c7d;
  --good-soft: #1b2a1c; --warn-soft: #2d2616; --bad-soft: #301c19;
  --s1: #6aa3dc; --s2: #e08a6b; --s3: #94b06c; --s4: #d9ad4b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 2px 4px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .8);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(150px + var(--bar-h)); }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font: 600 clamp(1.7rem, 3.4vw, 2.2rem)/1.15 var(--serif); letter-spacing: -.015em; }
h2 { font: 650 1.05rem/1.3 var(--sans); letter-spacing: -.005em; margin-bottom: .45rem; }
h3 { font: 650 .92rem/1.3 var(--sans); margin: 1.1rem 0 .4rem; }
p { margin: .3rem 0 .8rem; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: .82em; }
code { background: var(--surface2); border: 1px solid var(--grid); padding: .05em .35em; border-radius: 4px; }
pre { white-space: pre-wrap; background: var(--surface2); border: 1px solid var(--grid); padding: .7rem .8rem; border-radius: var(--r-sm); overflow-x: auto; margin: .5rem 0; }
pre code { background: none; border: 0; padding: 0; }
ul, ol { padding-left: 1.2rem; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.muted { color: var(--ink2); font-size: .93rem; }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.right { float: right; }
.sr-skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: var(--page); padding: .6rem .9rem; border-radius: var(--r-sm); font: 600 .85rem var(--sans); }
.sr-skip:focus { top: 10px; }

/* ---------------------------------------------------------------- layout */
.sr-wrap, main, .top, .tabs { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
main { padding-block: 0 2.5rem; display: block; }
@media (max-width: 600px) { .sr-wrap, main, .top, .tabs { padding-inline: 16px; } }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.row input[type=text] { flex: 1 1 240px; min-width: 0; }
.scroll { overflow: auto; max-height: 520px; }

/* ---------------------------------------------------------------- top bar (written by shell.js) */
.sr-bar { position: sticky; top: 0; z-index: 100; height: var(--bar-h); border-bottom: 1px solid transparent;      /* stays at the top, like datatonia.net */
  transition: border-color var(--dur) var(--ease); }
/* The frost lives on its own layer that is always there and only fades in: switching a blur on and off at every scroll
   rebuilt the layer each time (150-200 ms frames when scrolling up and down fast). Opacity alone stays on the compositor. */
.sr-bar::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--page) 82%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity var(--dur) var(--ease); will-change: opacity; }
html.sr-scrolled .sr-bar { border-bottom-color: var(--grid); }
html.sr-scrolled .sr-bar::before { opacity: 1; }
.sr-bar-in { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; gap: 16px; }
.sr-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 600 1.18rem var(--serif); letter-spacing: -.01em; min-height: 44px; flex: none; }
/* the Datatonia logo of datatonia.net: the stacked mark folded, the DAT◆TONIA wordmark unfolded (shell.js moves between them) */
.sr-logo { position: relative; display: flex; align-items: center; height: 36px; font: 600 21px/1 var(--mono); letter-spacing: -.02em; text-transform: uppercase; color: var(--ink); }
.sr-logo-mark { position: absolute; left: 0; top: 0; width: 36px; height: 36px; max-width: none; transform-origin: 0 0; overflow: visible; pointer-events: none; }
.sr-logo-mark polygon { opacity: 0; }
.sr-wordmark { display: flex; align-items: center; height: 26px; color: var(--ink2); }
.sr-wordmark .wm-l { display: inline-block; overflow: hidden; white-space: pre; max-width: .8em; }
.sr-wordmark .wm-dia { display: inline-block; flex: none; width: .4em; height: .706em; max-width: none; margin: 0 .01em; overflow: visible; }
@media (max-width: 480px) { .sr-logo { font-size: 17px; } .sr-brand { gap: 10px; font-size: 1.08rem; } }
/* every page but the front one: a plain way back to all the demos */
.sr-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border: 1px solid var(--grid); border-radius: 999px;
  background: var(--surface, #fff); color: var(--ink); text-decoration: none; font: 600 .86rem var(--sans, inherit); flex: none; }
.sr-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-back:hover { border-color: var(--accent); color: var(--accent); }
.sr-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .sr-back { padding: 0 12px 0 8px; } .sr-back span { display: none; } .sr-back { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; } }
.sr-nav { display: flex; gap: 2px; margin-left: auto; }
.sr-nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px; border-radius: 999px; color: var(--ink2); text-decoration: none; font: 500 .88rem var(--sans); white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.sr-nav a svg { width: 16px; height: 16px; flex: none; }
.sr-nav a:hover { background: var(--hover); color: var(--ink); }
.sr-nav a[aria-current="page"] { color: var(--on-stage); background: var(--stage); }
.sr-menu-btn { display: none; margin-left: auto; border-radius: 999px; }
.sr-nav-line { display: none; font: 400 .85rem var(--sans); color: var(--muted); margin-left: auto; padding-left: 12px; white-space: normal; text-align: right; }

/* the access chip shows only for a visitor who came with a private link */
.sr-access { position: relative; flex: none; display: none; margin-left: auto; }
/* the light/dark switch: always the last thing in the bar */
.sr-theme { order: 9; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; margin-left: auto;
  border: 1px solid var(--grid); border-radius: 50%; background: none; color: var(--ink2); cursor: pointer; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.sr-theme svg { width: 18px; height: 18px; }
.sr-theme:hover { border-color: var(--accent); color: var(--accent); }
.sr-theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-access="pass"] .sr-theme, html[data-access="ended"] .sr-theme { margin-left: 0; }
@media (max-width: 480px) { .sr-theme { width: 44px; height: 44px; } }
html[data-access="pass"] .sr-access, html[data-access="ended"] .sr-access { display: block; }
.sr-access > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--good) 55%, var(--axis)); border-radius: 999px; font: 500 .8rem var(--sans); color: var(--ink); background: var(--surface); white-space: nowrap; user-select: none; }
.sr-access > summary::-webkit-details-marker { display: none; }
.sr-access .sr-led { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
html[data-access="ended"] .sr-access > summary { border-color: var(--axis); }
html[data-access="ended"] .sr-access .sr-led { background: var(--warn); }
.sr-pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--axis); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; z-index: 110; font-size: .93rem; }
.sr-pop h2 { font-size: .95rem; margin-bottom: .35rem; }
.sr-pop p { margin: 0 0 .6rem; color: var(--ink2); }
.sr-pop ul { margin: .2rem 0 .7rem; padding-left: 1.1rem; color: var(--ink2); }
.sr-meter { height: 8px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--grid); overflow: hidden; margin: .5rem 0 .3rem; }
.sr-meter > span { display: block; height: 100%; background: var(--good); border-radius: inherit; }
.sr-meter-label { display: flex; justify-content: space-between; font: 500 .74rem var(--mono); color: var(--muted); }

@media (max-width: 860px) {
  .sr-menu-btn { display: inline-flex; }
  .sr-nav { display: none; position: absolute; left: 0; right: 0; top: var(--bar-h); z-index: 105; margin: 0; padding: 10px 16px 16px; flex-direction: column; gap: 4px; background: var(--page); border-bottom: 1px solid var(--grid); box-shadow: var(--shadow); }
  .sr-nav.open { display: flex; }
  .sr-nav a { min-height: 54px; font-size: 1rem; padding: 0 14px; border-radius: var(--r-sm); }
  .sr-nav a .sr-nav-line { display: block; }
  .sr-bar-in { gap: 10px; padding: 0 16px; position: relative; }
  .sr-access .sr-chip-long { display: none; }
}
@media (max-width: 480px) { html[data-access="pass"] .sr-menu-btn span, html[data-access="ended"] .sr-menu-btn span { display: none; } .sr-menu-btn { padding: 0 12px; } }

/* ---------------------------------------------------------------- buttons and fields */
button, select, input, textarea { font: inherit; color: var(--ink); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--axis); border-radius: 10px; background: var(--surface); color: var(--ink); font: 600 .9rem var(--sans); cursor: pointer; text-decoration: none; touch-action: manipulation;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 120ms var(--ease), box-shadow var(--dur) var(--ease); }
button:hover:not(:disabled), .btn:hover { background: var(--hover); border-color: var(--field); }
button:active:not(:disabled), .btn:active { transform: scale(.97); }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }
button svg, .btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary, button.primary, button[type=submit] { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn-primary:hover, button.btn-primary:hover:not(:disabled), button.primary:hover:not(:disabled), button[type=submit]:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-ink) 88%, var(--ink)); border-color: transparent; box-shadow: 0 8px 20px -8px var(--accent-ink); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; border-radius: 12px; }
.btn-ghost, button.ghost { background: transparent; }
.btn-danger, button.stop { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover, button.stop:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 85%, #000); }
.linkish, button.small { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent-ink); font: 500 .86rem var(--sans); text-decoration: underline; text-underline-offset: 3px; border-radius: 4px; }
.linkish:hover, button.small:hover:not(:disabled) { background: none; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea { min-height: 46px; padding: .5rem .8rem; background: var(--surface); border: 1px solid var(--field); border-radius: 10px; font: 400 1rem var(--sans); max-width: 100%; }
textarea { width: 100%; font: 400 .85rem/1.5 var(--mono); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; border-color: var(--accent-ink); }
label { font: 500 .86rem var(--sans); color: var(--ink2); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent-ink); }

/* chips: suggested things to tap */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .chip { min-height: 40px; padding: 0 15px; border-radius: 999px; font: 500 .92rem var(--sans); text-align: left; background: var(--surface); border: 1px solid var(--axis); line-height: 1.25; }
.chips button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- cards, tags, tables */
.card, .tile { background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.card.wide { margin-bottom: 16px; }
.card > :first-child { margin-top: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem var(--mono); color: var(--ink2); border: 1px solid var(--axis); border-radius: 999px; padding: .22em .75em; vertical-align: middle; white-space: nowrap; background: var(--surface); }
.tag.good { color: var(--goodtext); border-color: color-mix(in srgb, var(--good) 45%, var(--axis)); background: var(--good-soft); }
.tag.warn { color: var(--warntext); border-color: color-mix(in srgb, var(--warn) 45%, var(--axis)); background: var(--warn-soft); }
.tag.accent { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 50%, var(--axis)); background: var(--accent-soft); }
.tag svg { width: 12px; height: 12px; }
.dot { display: inline-block; width: .65em; height: .65em; border-radius: 50%; margin-right: .4em; background: var(--muted); }
.dot.pass { background: var(--good); } .dot.warn { background: var(--warn); } .dot.fail { background: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 16px 18px; }
.tile .label { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .value { font: 650 1.6rem/1.3 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .delta { font: 500 .8rem var(--sans); color: var(--ink2); }
.up { color: var(--goodtext); } .down { color: var(--badtext); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.section td { font: 650 .85rem var(--sans); background: var(--surface2); }
tr.total td { font-weight: 650; }
tr.clickable { cursor: pointer; } tr.clickable:hover, td button.cell:hover { background: var(--hover); }
td button.cell { min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-variant-numeric: tabular-nums; text-decoration: underline dotted var(--accent); text-underline-offset: 4px; border-radius: 3px; }
.notice { padding: .75rem 1rem; border-radius: var(--r-sm); border: 1px solid var(--axis); background: var(--surface); margin: 0 0 16px; font-size: .95rem; }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 60%, var(--axis)); background: var(--bad-soft); color: var(--badtext); }
.notice.good { border-color: color-mix(in srgb, var(--good) 50%, var(--axis)); background: var(--good-soft); color: var(--goodtext); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--axis)); background: var(--warn-soft); color: var(--warntext); }
.status { font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
details > summary { cursor: pointer; font: 500 .88rem var(--sans); color: var(--ink2); min-height: 32px; }
.deflist dt { font: 650 .9rem var(--sans); margin-top: .7rem; } .deflist dd { margin: 0; color: var(--ink2); font-size: .93rem; }
ul.plain { margin: 0; padding-left: 1.1rem; font-size: .93rem; color: var(--ink2); } ul.plain li { margin: .25rem 0; }

/* tabs inside a demo (the showroom's own navigation is the top bar) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--grid); overflow-x: auto; scrollbar-width: none; padding-inline: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { min-height: 46px; border: 0; border-radius: 0; background: none; color: var(--ink2); padding: 0 15px; font: 500 .92rem var(--sans); border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.tabs button:hover:not(:disabled) { background: none; color: var(--ink); border-bottom-color: var(--axis); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }

/* ---------------------------------------------------------------- demo page frame */
/* intro: the name of the demo and one sentence. Nothing else sits above the guide. */
.sr-intro { padding: 30px 0 4px; max-width: 720px; }
.sr-intro p { font-size: 1.08rem; color: var(--ink2); margin: .5rem 0 0; }
.sr-intro p strong { color: var(--ink); }

/* the guide: one step at a time (written by shell.js from the steps a page gives it) */
.sr-guide { position: sticky; top: calc(var(--bar-h) + 10px); z-index: 60; margin: 18px 0 22px; padding: 14px 8px 14px 20px; display: grid; grid-template-columns: 1fr auto auto; gap: 10px 12px; align-items: center;
  background: var(--stage); color: var(--on-stage); border-radius: var(--r); box-shadow: var(--shadow); }
.sr-guide-text { min-width: 0; }
.sr-guide-top { display: flex; align-items: center; gap: 10px; margin: 0 0 5px; font: 500 .72rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--on-stage2); }
.sr-guide-dots { display: inline-flex; gap: 5px; }
.sr-guide-dots i { width: 18px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--on-stage) 22%, transparent); transition: background var(--dur) var(--ease); }
.sr-guide-dots i.done { background: #7cc47f; }
.sr-guide-dots i.now { background: var(--accent); }
.sr-guide-learned { margin: 0 0 5px; padding-left: 22px; position: relative; color: #a9d9ab; font-size: .92rem; line-height: 1.4; }
.sr-guide-learned::before { content: ""; position: absolute; left: 2px; top: .32em; width: 11px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.sr-guide-say { margin: 0; font: 600 1.1rem/1.35 var(--sans); }
.sr-guide-go, a.btn.sr-guide-go { min-height: 46px; padding: 0 20px; border: 0; background: var(--accent); color: #1c1a18; font-weight: 650; border-radius: 10px; white-space: nowrap; }
.sr-guide-go:hover:not(:disabled), a.btn.sr-guide-go:hover { background: #e88d6f; }
.sr-guide-go[aria-busy="true"] { opacity: .7; cursor: progress; }
.sr-guide-go:focus-visible, .sr-guide-skip:focus-visible { outline-color: var(--on-stage); }
.sr-guide-skip { min-height: 40px; min-width: 40px; padding: 0; border: 0; background: none; color: var(--on-stage2); border-radius: 50%; }
.sr-guide-skip:hover:not(:disabled) { background: color-mix(in srgb, var(--on-stage) 14%, transparent); color: var(--on-stage); }
.sr-guide-off { margin: 12px 0 18px; }
:root[data-theme="dark"] .sr-guide { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
/* the part of the page the current step is about */
.sr-spot { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); scroll-margin-top: calc(230px + var(--bar-h)); }
@media (max-width: 860px) {
  html { scroll-padding-top: calc(200px + var(--bar-h)); }
  .sr-guide { top: 8px; grid-template-columns: 1fr auto; padding: 12px 6px 12px 14px; gap: 8px 6px; margin: 14px 0 18px; align-items: start; }
  .sr-guide-say { font-size: 1.02rem; }
  .sr-guide-go, a.btn.sr-guide-go { grid-column: 1 / -1; grid-row: 2; margin-right: 8px; }
  .sr-guide-skip { grid-column: 2; grid-row: 1; min-height: 32px; min-width: 32px; }
}

/* "Behind the scenes": opened from a button, shown beside the product (below it on a phone) */
.sr-scenes-btn { border-radius: 999px; min-height: 38px; padding: 0 14px; font-size: .86rem; }
.sr-scenes-btn[aria-expanded="true"] { background: var(--stage); color: var(--on-stage); border-color: var(--stage); }
.sr-scenes-btn .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #1c1a18; font: 600 .72rem/20px var(--mono); text-align: center; }
.sr-scenes > h2 { display: flex; align-items: center; gap: 8px; }
.sr-scenes > h2 svg { width: 18px; height: 18px; color: var(--accent-ink); }
/* a plain-language timeline of what a system did; the raw record sits in a "Technical details" fold under each entry */
.sr-timeline { list-style: none; margin: 0; padding: 0; }
.sr-timeline > li { position: relative; padding: 0 0 12px 30px; font-size: .95rem; }
.sr-timeline > li::before { content: ""; position: absolute; left: 6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); z-index: 1; }
.sr-timeline > li::after { content: ""; position: absolute; left: 10px; top: 14px; bottom: -4px; width: 2px; background: var(--grid); }
.sr-timeline > li:last-child::after { display: none; }
.sr-timeline > li.good::before { border-color: var(--good); background: var(--good); }
.sr-timeline > li.warn::before { border-color: var(--warn); background: var(--warn); }
.sr-timeline > li.bad::before { border-color: var(--bad); background: var(--bad); }
.sr-timeline small { display: block; color: var(--muted); font-size: .86rem; }

/* "More to try": everything beyond the guide, one fold per thing */
.sr-more { margin: 30px 0 0; }
.sr-more > h2 { font: 500 .74rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.sr-more > details { background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); margin-bottom: 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
.sr-more > details > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 20px; font: 650 1rem var(--sans); color: var(--ink); }
.sr-more > details > summary::-webkit-details-marker { display: none; }
.sr-more > details > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--dur) var(--ease); flex: none; }
.sr-more > details[open] > summary::after { transform: rotate(-135deg); }
.sr-more > details > summary:hover { background: var(--surface2); }
.sr-more > details > summary small { font: 400 .9rem var(--sans); color: var(--muted); }
.sr-more > details > summary .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #1c1a18; font: 600 .74rem/22px var(--mono); text-align: center; }
.sr-more > details > .sr-more-body { padding: 4px 20px 20px; }
@media (max-width: 600px) { .sr-more > details > summary small { display: none; } }

.sr-hint { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.sr-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 8px 28px; }
.sr-two > div > :first-child, .sr-more-body > :first-child { margin-top: 0; }
.sr-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px 24px; }
.sr-points b { display: block; margin-bottom: .2rem; } .sr-points span { color: var(--ink2); font-size: .95rem; }
/* the raw record behind a plain-language line */
.sr-tech > summary { font-size: .8rem; color: var(--muted); min-height: 28px; }
.sr-tech > div, .sr-tech > pre { font-size: .84rem; border-left: 3px solid var(--axis); padding-left: 10px; margin-top: 4px; color: var(--ink2); overflow-wrap: anywhere; }

/* "By invitation": a part that opens with a private access link */
.sr-lock { display: grid; grid-template-columns: 40px 1fr; gap: 2px 14px; align-items: start; border: 1px dashed var(--field); border-radius: var(--r); padding: 16px 18px; background: var(--surface2); margin: 12px 0; }
.sr-lock > svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--surface); border: 1px solid var(--axis); color: var(--accent-ink); grid-row: span 3; }
.sr-lock h3 { margin: 0; font-size: .98rem; }
.sr-lock p { margin: 0; color: var(--ink2); font-size: .95rem; grid-column: 2; }
.sr-lock .tag { justify-self: start; grid-column: 2; margin-top: 6px; }
html[data-access="pass"] .only-public { display: none !important; }
html:not([data-access="pass"]) .only-pass { display: none !important; }

/* the end of a demo page (written by shell.js): on to the next one */
.sr-onward { margin: 36px 0 0; padding: 24px 26px; border-radius: var(--r-lg); background: var(--stage); color: var(--on-stage); display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; }
.sr-onward h2 { font: 600 1.3rem/1.25 var(--serif); margin: 0 0 .3rem; color: inherit; }
.sr-onward p { margin: 0; color: var(--on-stage2); max-width: 60ch; font-size: .97rem; }
.sr-onward .btn { background: var(--accent); border-color: var(--accent); color: #1c1a18; min-height: 50px; padding: 0 22px; }
.sr-onward .btn:hover { background: #e88d6f; }
.sr-onward .btn svg { transition: transform var(--dur) var(--ease); }
.sr-onward .btn:hover svg { transform: translateX(3px); }
@media (max-width: 700px) { .sr-onward { grid-template-columns: 1fr; } .sr-onward .btn { width: 100%; } }
.sr-ask { margin: 18px 0 0; text-align: center; color: var(--ink2); font-size: .97rem; }
.sr-ask b { color: var(--ink); }
.sr-foot, footer { max-width: var(--maxw); margin: 32px auto 0; padding: 20px 24px 40px; color: var(--muted); font-size: .86rem; }
.sr-foot p { margin: 0 0 .4rem; max-width: 80ch; }
.sr-foot nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .86rem; margin-top: .6rem; }
.sr-foot nav a { color: var(--ink2); min-height: 32px; display: inline-flex; align-items: center; }

/* a short message under the bar (private link accepted, refused, ended) */
.sr-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 120; max-width: min(560px, calc(100vw - 32px)); padding: .75rem 1.1rem; border-radius: 12px; background: var(--stage); color: var(--on-stage); font-size: .95rem; box-shadow: var(--shadow); }
.sr-toast.bad { background: var(--bad); color: #fff; }

/* older blocks some demo pages still use until they move to the guide */
.sr-head { padding: 28px 0 6px; }
.sr-kicker { font: 500 .76rem var(--mono); color: var(--accent-ink); letter-spacing: .03em; margin: 0 0 .5rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sr-kicker a { color: var(--ink2); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; min-height: 44px; }
.sr-kicker svg { width: 14px; height: 14px; }
.sr-lede { font-size: 1.08rem; color: var(--ink2); max-width: 68ch; margin: .6rem 0 .8rem; }
.sr-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.sr-start { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--grid)); background: var(--accent-soft); border-radius: var(--r); padding: 16px 18px; margin: 14px 0; }
.sr-start h2 { font: 500 .76rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin: 0 0 .6rem; }
.sr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; counter-reset: step; }
.sr-steps > li { counter-increment: step; display: flex; }
.sr-steps button { flex: 1; display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; align-items: start; justify-content: start; text-align: left; min-height: 64px; padding: 12px 14px; font-weight: 400; }
.sr-steps button::before { content: counter(step); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--page); font: 600 .8rem var(--mono); }
.sr-steps b { font-weight: 650; display: block; } .sr-steps span { color: var(--ink2); font-size: .9rem; grid-column: 2; }
.sr-proof { margin: 34px 0 0; padding: 26px 0 0; border-top: 1px solid var(--grid); }
.sr-proof h2 { font: 500 .76rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; }
.sr-proof ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.sr-proof li { background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); padding: 16px 18px; }
.sr-proof li b { display: block; margin-bottom: .25rem; } .sr-proof li span { color: var(--ink2); font-size: .95rem; }

@media (prefers-reduced-motion: no-preference) {
  .sr-toast { animation: sr-drop 280ms var(--ease); }
  .sr-pop { animation: sr-pop 160ms var(--ease); }
  .sr-guide-say, .sr-guide-top { animation: sr-step 320ms var(--ease); }
  .sr-reveal { animation: sr-rise 420ms var(--ease) both; }
  @keyframes sr-drop { from { opacity: 0; transform: translate(-50%, 8px); } }
  @keyframes sr-pop { from { opacity: 0; transform: translateY(-4px); } }
  @keyframes sr-step { from { opacity: 0; transform: translateY(6px); } }
  @keyframes sr-rise { from { opacity: 0; transform: translateY(10px); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { .sr-bar, .sr-guide, .sr-onward, .sr-ask { display: none; } }

/* ================= phone layout ================= */
@media (max-width: 700px) {
  :root { --bar-h: 52px; }
  html { scroll-padding-top: calc(var(--bar-h) + 16px); scroll-padding-bottom: 150px; }
  .sr-intro { padding: 6px 0 12px; }
  .sr-intro h1 { font-size: 1.65rem; }
  .sr-intro p { font-size: .98rem; line-height: 1.5; margin-top: .35rem; }
  /* the guide is a slim bar at the bottom of the screen: within thumb reach, and it covers nothing at the top */
  .sr-guide { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 110; margin: 0;
    grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 8px; padding: 10px 4px 10px 14px; border-radius: 16px;
    box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .2); }
  .sr-guide-top { margin: 0 0 3px; font-size: .64rem; gap: 8px; }
  .sr-guide-dots i { width: 12px; height: 3px; }
  .sr-guide-say { font-size: .95rem; line-height: 1.3; }
  .sr-guide-learned { font-size: .82rem; margin-bottom: 3px; padding-left: 18px; }
  .sr-guide-go, a.btn.sr-guide-go { grid-column: 2; grid-row: 1; margin: 0; min-height: 44px; padding: 0 16px; max-width: 46vw; white-space: normal; text-align: center; line-height: 1.2; }
  .sr-guide-skip { grid-column: 3; grid-row: 1; min-height: 44px; min-width: 36px; }
  /* last step: the takeaway and one wide button; the closing sentence stays for screen readers only */
  .sr-guide[data-step="end"] { grid-template-columns: minmax(0, 1fr) auto; padding-right: 6px; }
  .sr-guide[data-step="end"] .sr-guide-go, .sr-guide[data-step="end"] a.btn.sr-guide-go { grid-column: 1 / -1; grid-row: 2; max-width: none; margin-right: 8px; }
  .sr-guide[data-step="end"] .sr-guide-skip { grid-column: 2; grid-row: 1; align-self: start; }
  .sr-guide[data-step="end"] .sr-guide-learned + .sr-guide-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sr-spot { scroll-margin-top: calc(var(--bar-h) + 16px); scroll-margin-bottom: 150px; }
  html:has(.sr-guide:not([hidden])) .sr-foot, html:has(.sr-guide:not([hidden])) body > footer:last-of-type { padding-bottom: 150px; }
  html:has(.sr-guide:not([hidden])) .sr-toast { bottom: 130px; }
  .sr-guide-off { margin: 0 0 10px; }
  .sr-scenes-btn { min-height: 44px; }
  .sr-more { margin-top: 26px; }
  .sr-more > details > summary { min-height: 56px; padding: 0 16px; }
  .sr-more > details > .sr-more-body { padding: 2px 16px 16px; }
  .sr-onward { margin-top: 26px; padding: 20px 18px; }
  .sr-foot, footer { margin-top: 20px; padding: 16px 16px 32px; }
}

/* The page for an address that does not exist (written by the guard, same on every demo) */
.sr-missing-list { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: grid; gap: 8px; }
.sr-missing-list a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--grid); border-radius: 10px; color: var(--ink2); text-decoration: none; }
.sr-missing-list a:hover { border-color: var(--field); background: var(--hover); }
.sr-missing-list b { display: block; color: var(--ink); }

/* text for screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
