/* Olaivi website: shared components.
   Colours, type, depth and motion tokens live in brand.css; rules are explained in brand.md.
   Page-only rules live beside each page: home.css, products.css, standards.css, tour.css,
   demo-requests.css and app.css. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body, h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
img, svg { display: block; }
a { color: inherit; text-underline-offset: .25em; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
a, button, summary, input, select { touch-action: manipulation; }
[hidden] { display: none !important; }

/* Page canvas: Chalk with two pre-blurred glows and a tiny noise tile (no filter: blur).
   A column, so on a page shorter than the window the footer sits on the bottom edge. */
body {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  color: var(--text);
  background-color: var(--surface);
  background-image:
    radial-gradient(56rem 36rem at 88% 4%, rgb(182 185 255 / .2), rgb(182 185 255 / 0) 64%),
    radial-gradient(44rem 32rem at -6% 56%, rgb(255 241 199 / .55), rgb(255 241 199 / 0) 66%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .19 0 0 0 0 .14 0 0 0 0 .26 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: 100% 64rem, 100% 64rem, 128px 128px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body > main { flex: 1 0 auto; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
/* A plain h1 takes the product page title role (28 / 34 on phones, 36 / 42 from 48rem). */
h1 { font-size: var(--type-title); line-height: var(--leading-title); letter-spacing: -.028em; }
h2 { font-size: var(--type-section); line-height: var(--leading-section); }
h3 { font-size: var(--type-subheading); line-height: var(--leading-subheading); }

/* The marketing hero, beside an illustration (homepage, visit tour): 72 / 76, 56 / 60 from
   1024 to 1279 px so it keeps its lines beside the picture, 48 / 52 on phones. */
.hero-title {
  margin-top: 1.5rem;
  font-size: var(--type-hero); line-height: var(--leading-hero);
  font-weight: 700; letter-spacing: -.034em;
}
/* One lead paragraph per page, straight under its title. Under a hero it keeps the hero's
   rhythm: 24 px, 20 px from 1024 to 1279 px, 12 px on phones. */
.lead {
  max-width: 30rem; margin-top: .75rem;
  font-size: var(--type-lead); line-height: var(--leading-lead);
  color: var(--ink-muted); text-wrap: pretty;
}
.hero-title + .lead { margin-top: 1.5rem; }
@media (min-width: 64rem) and (max-width: 79.99rem) {
  .hero-title { font-size: 3.5rem; line-height: 3.75rem; letter-spacing: -.032em; }
  .hero-title + .lead { margin-top: 1.25rem; }
}
@media (max-width: 47.99rem) {
  .hero-title { margin-top: .75rem; letter-spacing: -.036em; }
  .hero-title + .lead { margin-top: .75rem; }
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sr, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; z-index: 30; top: .75rem; left: 1rem;
  padding: .75rem 1.25rem; border-radius: var(--radius-pill);
  background: var(--plum); color: var(--paper); font-weight: 650; text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip:focus { transform: none; }
.skip:focus-visible { outline-color: var(--plum); }

/* Icons from icons.svg: <svg class="icon"><use href="icons.svg#name"/></svg> */
.icon {
  width: 1.5rem; height: 1.5rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Layout ---------- */
:root { --gutter: 1rem; --max: 82rem; }
@media (min-width: 48rem) { :root { --gutter: 2rem; } }
@media (min-width: 88rem) { :root { --gutter: 4rem; } }

.wrap {
  width: 100%; max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto; padding-inline: var(--gutter);
}
.section { padding-block: 4rem; }
@media (min-width: 64rem) { .section { padding-block: 6rem; } }
/* A product page (plain h1 title on the gutter: directory, Records and standards, demo request,
   patient app) starts its content at one shared distance under the header. */
.page-top { padding-top: 2.5rem; }
@media (max-width: 47.99rem) { .page-top { padding-top: 1.5rem; } }
/* A quiet way on at the end of a page's content: one or two .link actions, never a primary pill. */
.page-next { display: flex; flex-wrap: wrap; gap: 0 2rem; margin-top: 2.5rem; }

/* ---------- Header and footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 5rem;
}
.identity, .brand {
  display: inline-flex; flex: none; align-items: center; min-height: 2.75rem; border-radius: .5rem;
}
.identity img, .brand img { width: 6.5rem; height: auto; }
.site-header nav, .site-footer nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
  margin-inline-end: -.875rem;  /* the last link's text sits on the content edge; its pill may overhang */
}
.site-header nav a, .site-footer nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .875rem;
  border-radius: var(--radius-pill);
  font: 600 var(--type-nav)/var(--leading-nav) var(--font-body); letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-quick) ease;
}
@media (hover: hover) {
  .site-header nav a:hover, .site-footer nav a:hover { background: rgb(220 215 242 / .55); }
}
/* The current page: a Soft iris pill and a weight change, in the header or the footer. */
.site-header nav a[aria-current="page"],
.site-footer nav a[aria-current="page"] {
  font-weight: 700; color: var(--selection-fg); background: var(--selection-bg);
  box-shadow: inset 0 0 0 1px rgb(48 36 67 / .08);
}

.site-footer {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem;
  margin-top: 4.5rem; padding-block: 1.75rem 2.5rem;
}
.site-footer::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  height: 1px; background: var(--hairline);
}
.site-footer .identity img, .site-footer .brand img { width: 5.25rem; }

/* Phones: the links take their own row under the logo, starting on the gutter. The first link's
   text sits on the gutter, in line with the logo and the title. Only when the first link is the
   current page does it keep its side padding, so its pill starts on the gutter and never reaches
   past it into the screen edge. Phones have no hover pill. */
@media (max-width: 47.99rem) {
  .site-header { flex-wrap: wrap; row-gap: 0; min-height: 0; padding-top: .375rem; }
  .site-header nav { width: 100%; gap: 0; margin-inline: 0; }
  .site-header nav a { padding: 0 .75rem; }
  .site-footer { margin-top: 3.5rem; }
}
@media (max-width: 23.75rem) {
  .site-header nav a, .site-footer nav a { padding: 0 .5rem; font-size: var(--type-small); }
  .site-footer nav { margin-inline-end: -.5rem; }
}
@media (max-width: 47.99rem) {
  .site-header nav a:first-child:not([aria-current="page"]) { padding-left: 0; }
}

/* ---------- Actions ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .875rem;
  min-height: 3.5rem; padding: 0 1.5rem; border: 0; border-radius: var(--radius-pill);
  font: 650 1rem/1.5rem var(--font-body); letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-quick) ease;
}
.btn:active { transform: translateY(0); }

/* One primary action per screen: Plum pill with an arrow well and a two-sparkle cluster. */
.btn-primary {
  padding: 0 .5rem 0 1.625rem;
  color: var(--action-primary-fg);
  background: var(--radiant-plum);
  box-shadow: var(--shadow-action);
}
/* Hover lifts only where a pointer can hover, so a tap on a phone never leaves a stuck state. */
@media (hover: hover) {
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgb(255 251 245 / .16), 0 3px 6px rgb(48 36 67 / .14), 0 18px 34px -12px rgb(48 36 67 / .6);
  }
  .btn-primary:hover .btn-arrow .icon { transform: translateX(2px); }
  .btn-secondary:hover {
    background: var(--white); transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgb(48 36 67 / .24), var(--shadow-2);
  }
  .link:hover { text-decoration-color: var(--plum); }
  .link:hover .icon { transform: translateX(2px); }
  .icon-button:hover { background: var(--white); transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgb(48 36 67 / .24), var(--shadow-2); }
  .pill:not(:disabled):hover { transform: translateY(-1px); }
  .plain-link:hover { text-decoration-color: var(--plum); }
  .stage-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow-2); }
}
.btn-arrow {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: rgb(255 251 245 / .12); box-shadow: inset 0 0 0 1px rgb(255 251 245 / .16);
}
.btn-arrow .icon { width: 1.25rem; height: 1.25rem; stroke-width: 2; transition: transform var(--dur-base) var(--ease-out); }

.sparkles { position: absolute; top: -.875rem; right: 1.25rem; width: 1.375rem; height: 1.375rem; color: var(--poppy); pointer-events: none; }
.sparkles .icon { position: absolute; }
.sparkles .spark-lg { inset: 0; width: 1.375rem; height: 1.375rem; }
.sparkles .spark-sm { top: -.3125rem; right: -.625rem; width: .625rem; height: .625rem; }
/* On phones a page's main action may run the full width (.is-block): 52 px, label on the left,
   arrow well on the right, sparkles over the label's end. */
@media (max-width: 47.99rem) {
  .btn-primary.is-block { width: 100%; justify-content: space-between; min-height: 3.25rem; }
  .btn-primary.is-block .sparkles { right: 3.5rem; }
}

/* Secondary: a quiet pill, or a quiet underlined link. */
.btn-secondary {
  color: var(--text);
  background: rgb(255 255 255 / .86);
  box-shadow: inset 0 0 0 1px var(--edge), var(--shadow-1);
}
.link {
  display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; border-radius: .375rem;
  font-weight: 650; letter-spacing: -.005em;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em;
  text-decoration-color: var(--periwinkle);
  transition: text-decoration-color var(--dur-quick) ease;
}
.link .icon { width: 1.125rem; height: 1.125rem; stroke-width: 2; transition: transform var(--dur-base) var(--ease-out); }
/* A link whose words may wrap: inline, so it wraps like text, with the last word and the glyph
   held together in .link-tail so the glyph never jumps to the far edge. Padding keeps the
   44 px target. <a class="link link-inline">Read the <span class="link-tail">guide<svg …/></span></a> */
.link-inline { display: inline-block; padding-block: .625rem; }
.link-tail { white-space: nowrap; }
.link-inline .icon { display: inline-block; margin-left: .375rem; vertical-align: -.1875rem; }

/* Compact secondary pill for an action inside a row or a card (Mark reviewed, Download PDF):
   44 px, 16 / 24 text and an 18 px leading glyph. Use with .btn-secondary. */
.btn-compact { min-height: 2.75rem; gap: .5rem; padding: 0 1.25rem 0 1rem; }
.btn-compact .icon { width: 1.125rem; height: 1.125rem; stroke-width: 2; }
/* Quiet text action: a button that reads as a link (the .link underline) inside a pill-shaped
   hover and focus area, for a secondary action beside a primary one (Cancel visit) or a
   low-stakes action in a row (Delete test request). */
.btn-quiet {
  padding: 0 1rem; color: var(--text); background: none;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em;
  text-decoration-color: var(--periwinkle);
  transition: background-color var(--dur-quick) ease, text-decoration-color var(--dur-quick) ease;
}
@media (hover: hover) {
  .btn-quiet:hover { background: rgb(220 215 242 / .5); text-decoration-color: var(--plum); }
}
/* Phones have no hover area to pad for, so the text sits flush: under a full-width pill it starts
   on the pill's left edge, as the homepage's quiet demo link does. */
@media (max-width: 47.99rem) {
  .btn-quiet { min-height: 2.75rem; padding-inline: 0; }
}

/* Round icon-only control, e.g. pause and play. */
.icon-button {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none;
  padding: 0; border: 0; border-radius: 50%;
  color: var(--plum); background: rgb(255 255 255 / .9); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--edge), var(--shadow-1);
  transition: background-color var(--dur-quick) ease, transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.icon-button .icon { grid-area: 1 / 1; width: 1.25rem; height: 1.25rem; stroke-width: 2.25; }

/* Legacy action classes from before version 1.2. No website page uses them now: the demo
   request form and the patient app moved to .btn and .link. New work uses .btn. */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .5rem 1.25rem; border: 1px solid transparent; border-radius: var(--radius-pill);
  font: 650 1rem/1.5rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.pill.primary { background: var(--radiant-plum); color: var(--action-primary-fg); box-shadow: var(--shadow-action); }
.pill.outline { border-color: var(--ink-muted); color: var(--ink); background: var(--surface); }
.pill:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.plain-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 650;
  text-decoration-thickness: 1.5px; text-underline-offset: .3em; text-decoration-color: rgb(48 36 67 / .45);
  transition: text-decoration-color var(--dur-quick) ease;
}
.section-intro p { color: var(--muted); max-width: 48ch; margin-top: .5rem; }
.section-intro .plain-link { margin-top: .5rem; }

/* ---------- Labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .625rem;
  padding: .3125rem 1rem .3125rem .3125rem; border-radius: var(--radius-pill);
  background: rgb(255 255 255 / .8); box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow-1);
  font: 600 var(--type-small)/var(--leading-small) var(--font-body); color: var(--ink-muted);
}
.eyebrow-icon {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%;
  color: var(--plum); background: var(--radiant-iris);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / .85), 0 4px 10px -4px rgb(127 130 224 / .7);
}
.eyebrow-icon .icon { width: 1rem; height: 1rem; stroke-width: 2; }

.tag {
  display: inline-flex; align-items: center; padding: 0 .5rem; border-radius: var(--radius-pill);
  font: 600 var(--type-small)/var(--leading-small) var(--font-body); color: var(--ink-muted);
  background: var(--chalk); box-shadow: inset 0 0 0 1px var(--hairline);
}
.chip {
  display: inline-flex; align-items: center; gap: .3125rem;
  min-height: 1.75rem; padding: .25rem .625rem .25rem .5rem; border-radius: var(--radius-pill);
  font: 650 var(--type-small)/var(--leading-small) var(--font-body); white-space: nowrap;
}
.chip .icon { width: 1rem; height: 1rem; stroke-width: 2; }
.chip-muted { color: var(--ink-muted); background: var(--chip-muted-bg); }
.chip-outline { color: var(--plum); background: var(--white); box-shadow: inset 0 0 0 1px var(--edge); }
.chip-solid { color: var(--paper); background: var(--plum); box-shadow: 0 4px 10px -4px rgb(48 36 67 / .6); }

/* ---------- Surfaces ---------- */
.card {
  border-radius: var(--radius-card); background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow-2);
}
.card-float { box-shadow: inset 0 0 0 1px rgb(48 36 67 / .05), var(--shadow-3); }

/* Icon tile: one size, one radius, one stroke. Radiant when it marks the current item: the
   selected stage ([aria-current="step"]), the open group of a disclosure list (details[open])
   or a step a script or the markup marks with .is-radiant. A page with no current item in view
   may also head each item of one static list of three or fewer with .is-radiant (brand.md §2). */
.icon-tile {
  position: relative;
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem; flex: none;
  border-radius: var(--radius-tile); color: var(--plum);
  background: var(--tile-wash);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), inset 0 0 0 1px rgb(48 36 67 / .06);
  transition: box-shadow var(--dur-state) var(--ease-out);
}
.icon-tile .icon { width: 1.5rem; height: 1.5rem; }
.icon-tile.is-radiant,
[aria-current="step"] .icon-tile,
details[open] > summary .icon-tile {
  background: var(--radiant-iris);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / .8), inset 0 -6px 12px rgb(127 130 224 / .2), 0 10px 20px -8px rgb(127 130 224 / .75);
}

/* Speech-bubble badge: radiant iris body with a 3 px white ring and top-left sheen (drawn
   in the SVG), a pre-blurred Periwinkle halo behind, and a Plum glyph centred on the circle.
   Tail points down-right; add .bubble-left to point it down-left. */
.bubble {
  --bubble-size: 4.75rem;
  position: relative; isolation: isolate;
  display: grid; place-items: center;
  width: var(--bubble-size); height: var(--bubble-size); color: var(--plum);
}
.bubble::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3CradialGradient id='f' cx='21' cy='14' r='48' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23DCD7F2'/%3E%3Cstop offset='.52' stop-color='%23B6B9FF'/%3E%3Cstop offset='1' stop-color='%237F82E0'/%3E%3C/radialGradient%3E%3CradialGradient id='s' cx='25' cy='17' r='14' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.8'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='%23fff' stroke='%23fff' stroke-width='6' stroke-linejoin='round'%3E%3Ccircle cx='32' cy='30' r='23'/%3E%3Cpath d='M49.4 44.6Q51.6 51.6 57.2 56.4Q49.4 56 41.6 51.2Z'/%3E%3C/g%3E%3Cg fill='url(%23f)'%3E%3Ccircle cx='32' cy='30' r='23'/%3E%3Cpath d='M49.4 44.6Q51.6 51.6 57.2 56.4Q49.4 56 41.6 51.2Z'/%3E%3C/g%3E%3Cellipse cx='25' cy='17' rx='13' ry='7.5' fill='url(%23s)' transform='rotate(-24 25 17)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.bubble::after {
  content: ""; position: absolute; inset: -30% -30% -36%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(34% 22% at 50% 80%, rgb(48 36 67 / .16), rgb(48 36 67 / 0) 100%),
    radial-gradient(closest-side, rgb(182 185 255 / .6), rgb(182 185 255 / .22) 58%, rgb(182 185 255 / 0));
}
.bubble-left::before { transform: scaleX(-1); }
.bubble > .icon { width: 37.5%; height: 37.5%; margin-bottom: 6.25%; stroke-width: 1.9; }

/* ---------- Stage cards: a numbered sequence with a Poppy handoff line ---------- */
/* Step badge: one numbered mark for every sequence. A 22 px Plum disc with a Paper numeral and a
   2 px white ring. Inline as <span class="step-badge">1</span> (a form section number), or pinned
   to the corner of each icon tile in a numbered list (.stage-list, or an <ol class="numbered">). */
.step-badge,
:is(.stage-list, .numbered) .icon-tile::after {
  display: grid; place-items: center; width: 1.375rem; height: 1.375rem; flex: none; border-radius: 50%;
  font: 700 .875rem/1.375rem var(--font-body); letter-spacing: 0; color: var(--paper); background: var(--plum);
  box-shadow: 0 0 0 2px var(--raised), 0 3px 6px -2px rgb(48 36 67 / .5);
}
:is(.stage-list, .numbered) { counter-reset: step; }
:is(.stage-list, .numbered) > li { counter-increment: step; }
:is(.stage-list, .numbered) .icon-tile::after {
  content: counter(step);
  position: absolute; top: -.4375rem; right: -.4375rem;
}

.stage-list {
  --stage-gap: .875rem;
  list-style: none; padding: 0;
  display: grid; gap: var(--stage-gap);
}
.stage-list > li { position: relative; }
.stage-card {
  position: relative; width: 100%; height: 100%;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1rem;
  padding: 1.125rem 1.25rem 1.375rem 1.125rem; border: 0; border-radius: var(--radius-card);
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: rgb(255 255 255 / .55);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-state) ease;
}
.stage-card[aria-current="step"] {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px rgb(48 36 67 / .05), var(--shadow-2);
}
.stage-text { display: grid; gap: .125rem; }
.stage-title { font: 700 1rem/1.5rem var(--font-body); }
.stage-caption { font-size: var(--type-small); line-height: var(--leading-small); color: var(--ink-muted); text-wrap: balance; }
/* The selected card's shape cue: a progress track at 3:1 or more, filled with Plum while the
   visit runs and full once a stage is chosen. */
.stage-progress {
  position: absolute; left: 1.25rem; right: 1.25rem; bottom: .625rem; height: 3px; border-radius: 3px;
  background: var(--control-track); overflow: hidden;
  opacity: 0; transition: opacity var(--dur-state) ease;
}
.stage-progress i { display: block; height: 100%; border-radius: inherit; background: var(--plum); transform-origin: left center; }
[aria-current="step"] > .stage-progress { opacity: 1; }

/* The handoff: a dotted track between cards, with a Poppy line drawn up to the current stage
   and a small Poppy marker where it arrives. Without JS it shows the static state. */
.stage-list > li:not(:last-child)::before,
.stage-list > li:not(:last-child)::after {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  left: 2.625rem; top: calc(100% - .5rem); width: 2px; height: calc(var(--stage-gap) + 1rem);
  margin-left: -1px; border-radius: 2px;
}
.stage-list > li:not(:last-child)::before { background: repeating-linear-gradient(180deg, var(--divider) 0 3px, rgb(203 194 205 / 0) 3px 7px); }
.stage-list > li:not(:last-child)::after {
  background: linear-gradient(180deg, rgb(243 107 83 / .4), var(--poppy));
  transform-origin: center top;
  transition: transform var(--dur-scene) var(--ease-out);
}
.stage-list > li:not(:first-child) > .stage-card::before {
  content: ""; position: absolute; z-index: 2; left: 2.625rem; top: -4px;
  width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: var(--poppy); box-shadow: 0 0 0 3px rgb(243 107 83 / .18);
  transition: opacity var(--dur-state) ease, transform var(--dur-state) var(--ease-out);
}
/* The arrival marker steps aside while its card shows the focus ring. */
.stage-list > li > .stage-card:focus-visible::before { visibility: hidden; }
/* Line state follows the selected stage on any ancestor. */
[data-stage="0"] .stage-list > li::after,
[data-stage="1"] .stage-list > li:nth-child(n + 2)::after { transform: scale(0); }
[data-stage="0"] .stage-list > li:not(:first-child) > .stage-card::before,
[data-stage="1"] .stage-list > li:nth-child(n + 3) > .stage-card::before { opacity: 0; transform: scale(.4); }
.stage-list.is-pending > li::after { transform: scale(0); }
.stage-list.is-pending > li > .stage-card::before { opacity: 0; transform: scale(.4); }
.stage-list > li:nth-child(2)::after { transition-delay: 120ms; }
.stage-list > li:nth-child(2) > .stage-card::before { transition-delay: 380ms; }
.stage-list > li:nth-child(3) > .stage-card::before { transition-delay: 500ms; }

@media (min-width: 48rem) {
  .stage-list { --stage-gap: 2.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage-list > li:not(:last-child)::before,
  .stage-list > li:not(:last-child)::after {
    left: calc(100% + .5rem); top: 50%; width: calc(var(--stage-gap) - 1rem); height: 2px;
    margin: -1px 0 0;
  }
  .stage-list > li:not(:last-child)::before { background: repeating-linear-gradient(90deg, var(--divider) 0 3px, rgb(203 194 205 / 0) 3px 7px); }
  .stage-list > li:not(:last-child)::after { background: linear-gradient(90deg, rgb(243 107 83 / .4), var(--poppy)); transform-origin: left center; }
  .stage-list > li:not(:first-child) > .stage-card::before { left: -4px; top: 50%; margin: -3.5px 0 0; }
}

/* ---------- Forms and outcome messages ---------- */
/* Marks drawn as masks in currentColor, so they take the state ink (and a system colour in
   forced-colours mode). */
:root {
  --mark-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M8.5 12.25l2.5 2.5 4.75-5'/%3E%3C/svg%3E");
  --mark-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 4.9a2 2 0 0 1 3.4 0l6.9 11.9a2 2 0 0 1-1.7 3H5.1a2 2 0 0 1-1.7-3z'/%3E%3Cpath d='M12 9.5v4M12 16.6h.01'/%3E%3C/svg%3E");
  --mark-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M12 7.75v5M12 16.1h.01'/%3E%3C/svg%3E");
}

/* A text field or select inside a .field: 12 px corners, a control-track edge so the box itself
   identifies the control, 16 / 24 values and a 48 px minimum height. Labels, groups and choice
   chips stay with their page. */
.field :is(input, select, textarea) {
  width: 100%; min-width: 0; min-height: 3rem; margin: 0;
  padding: .6875rem .9375rem;
  border: 1px solid var(--control-track); border-radius: var(--radius-input);
  font: 400 1rem/1.5rem var(--font-body); color: var(--text);
  background-color: var(--white);
  box-shadow: inset 0 1px 2px rgb(48 36 67 / .06);
  transition: border-color var(--dur-quick) ease, box-shadow var(--dur-quick) ease;
}
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23302443' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.25 12 14.75l5.5-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .875rem center; background-size: 1.25rem;
}
@media (hover: hover) {
  .field :is(input, select, textarea):hover { border-color: var(--ink-muted); }
}
/* Focus: a Plum edge and a soft Periwinkle ring inside the shared 3 px Plum outline. */
.field :is(input, select, textarea):focus-visible {
  border-color: var(--plum);
  box-shadow: inset 0 1px 2px rgb(48 36 67 / .06), 0 0 0 3px rgb(182 185 255 / .55);
}
/* Inline errors: the red edge appears only with its message, so colour never carries the error
   alone. The page writes the message (no browser bubble) and focuses the first field to fix. */
.field :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field :is(input, select, textarea)[aria-invalid="true"]:focus-visible { box-shadow: inset 0 0 0 1px var(--error), 0 0 0 3px rgb(182 185 255 / .55); }
.field-error {
  display: flex; align-items: flex-start; gap: .375rem;
  font: 600 1rem/1.5rem var(--font-body); color: var(--error);
}
.field-error::before {
  content: ""; flex: none; width: 1.125rem; height: 1.125rem; margin-top: .1875rem;
  background: currentColor;
  -webkit-mask: var(--mark-error) center / contain no-repeat; mask: var(--mark-error) center / contain no-repeat;
}

/* Outcome message after an action (role="status"): the reserved state ink on a faint tint of the
   same ink, after its mark (check, warning or error). Without data-tone it is a quiet note for work
   in progress. An empty live region stays in the accessibility tree but takes no space. */
.status-note {
  display: flex; align-items: flex-start; gap: .5rem;
  width: fit-content; max-width: 100%; padding: .75rem 1rem; border-radius: var(--radius-input);
  font: 600 1rem/1.5rem var(--font-body); color: var(--ink-muted);
  background: var(--chalk); box-shadow: inset 0 0 0 1px var(--hairline);
  text-wrap: pretty;
}
.status-note a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.status-note:empty {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden;
  clip-path: inset(50%); box-shadow: none;
}
.status-note[data-tone]::before {
  content: ""; flex: none; width: 1.25rem; height: 1.25rem; margin-top: .125rem;
  background: currentColor;
  -webkit-mask: var(--tone-mark) center / contain no-repeat; mask: var(--tone-mark) center / contain no-repeat;
}
.status-note[data-tone="success"] { --tone-mark: var(--mark-check); color: var(--success); background: rgb(33 90 68 / .07); box-shadow: inset 0 0 0 1px rgb(33 90 68 / .18); }
.status-note[data-tone="warning"] { --tone-mark: var(--mark-warning); color: var(--warning); background: rgb(114 80 13 / .07); box-shadow: inset 0 0 0 1px rgb(114 80 13 / .18); }
.status-note[data-tone="error"] { --tone-mark: var(--mark-error); color: var(--error); background: rgb(152 63 50 / .07); box-shadow: inset 0 0 0 1px rgb(152 63 50 / .2); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .rise { animation: rise var(--dur-scene) var(--ease-out) both; }
  .rise.d1 { animation-delay: 60ms; }  .rise.d2 { animation-delay: 120ms; }
  .rise.d3 { animation-delay: 180ms; } .rise.d4 { animation-delay: 240ms; }
  .rise.d5 { animation-delay: 300ms; } .rise.d6 { animation-delay: 360ms; }
  .rise.d7 { animation-delay: 420ms; } .rise.d8 { animation-delay: 480ms; }
  .rise.d9 { animation-delay: 540ms; }
  /* Idle float: ≤ 6 px, ≥ 4 s period. It runs only once a script owns the pause control
     (data-cycle is set), and that control stops it. */
  [data-cycle] .float { animation: float var(--loop-period) var(--ease-in-out) infinite alternate; }
  /* Sparkles twinkle once about a second after load, and again on hover or focus. */
  .sparkles { animation: twinkle var(--dur-scene) var(--ease-out) 1s both; }
  .btn-primary:hover .sparkles .icon,
  .btn-primary:focus-visible .sparkles .icon { animation: twinkle var(--dur-scene) var(--ease-out); }
  .btn-primary:hover .sparkles .spark-sm,
  .btn-primary:focus-visible .sparkles .spark-sm { animation-delay: 90ms; }
}
html[data-motion="paused"] .float { animation-play-state: paused; }
html[data-motion="paused"] .sparkles,
html[data-motion="paused"] .sparkles .icon { animation: none; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes twinkle {
  0% { transform: none; }
  40% { transform: scale(1.28) rotate(16deg); }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Forced colours ---------- */
/* Windows contrast themes drop shadows, fills and tints, so every control and surface whose edge
   is drawn with them gets a system-colour border, and the drawn marks keep a visible ink. */
@media (forced-colors: active) {
  .btn-primary, .btn-secondary, .icon-button, .stage-card { border: 1px solid ButtonText; }
  .chip, .tag, .card, .status-note,
  .site-header nav a[aria-current="page"], .site-footer nav a[aria-current="page"] { border: 1px solid CanvasText; }
  .field-error::before, .status-note[data-tone]::before { forced-color-adjust: none; background: CanvasText; }
  /* The current stage loses its white fill, shadow and radiant tile, so it takes a thicker
     Highlight edge, and its progress track keeps a visible track and fill. */
  .stage-card[aria-current="step"] { border: 3px solid Highlight; }
  .stage-progress { forced-color-adjust: none; background: GrayText; }
  .stage-progress i { background: Highlight; }
}
/* The wordmark in a dark contrast theme is the reverse master (Paper lettering, Poppy lower
   hand), swapped in by each page's <picture>; the master itself is never recoloured. */
