/* Tester page, Barmajiyat brand. Colours are the brand kit's tokens (barmajiyat-brand-kit/css/tokens.css),
   light by default and dark from the OS setting. Logical properties only, so the same rules serve Arabic
   (rtl) and English (ltr). Sizes in rem so system text size applies. */

@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('fonts/IBMPlexSansArabic-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('fonts/IBMPlexSansArabic-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('fonts/IBMPlexSansArabic-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('fonts/IBMPlexSansArabic-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* Brand tokens (light). */
:root {
  color-scheme: light;
  --surface: #f4f6f5;
  --surface-raised: #ffffff;
  --surface-sunken: #e8edec;
  --line: #d3dbda;
  --line-strong: #7d8f92;
  --ink: #0b2a30;
  --ink-muted: #4f6467;
  --petrol: #0e3b43;
  --petrol-strong: #082a30;
  --petrol-soft: #ddeaea;
  --on-petrol: #ffffff;
  --coral: #c2410c;
  --coral-strong: #a3360a;
  --coral-soft: #fce9df;
  --on-coral: #ffffff;
  --success: #1f6b45;
  --warning: #8a5300;
  --danger: #a3123a;
  --focus: #c2410c;
  --shadow-sm: 0 1px 2px rgba(11, 42, 48, 0.08);
  --shadow-md: 0 8px 24px rgba(11, 42, 48, 0.12);

  /* Page roles built on the tokens. Soft fills are tints of the brand's state colours;
     text on each keeps 4.5:1 or better (checked in test/page.test.mjs). */
  --on-success: #ffffff;
  --success-soft: #e2f0e8;
  --danger-soft: #fbe7ec;
  --warning-soft: #f8edd9;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --tap: 48px;
  --font-sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

/* Brand tokens (dark), from the OS setting. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #081a1e;
    --surface-raised: #0f252a;
    --surface-sunken: #051316;
    --line: #1f3a3f;
    --line-strong: #5e787c;
    --ink: #e6efee;
    --ink-muted: #9db3b5;
    --petrol: #7cc4ce;
    --petrol-strong: #a6dbe2;
    --petrol-soft: #12363d;
    --on-petrol: #04181c;
    --coral: #f47c4b;
    --coral-strong: #ff9d74;
    --coral-soft: #3a1a0e;
    --on-coral: #1a0904;
    --success: #6ccb98;
    --warning: #e6b04a;
    --danger: #f2708f;
    --focus: #f47c4b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
    --on-success: #04181c;
    --success-soft: #10301f;
    --danger-soft: #3a1220;
    --warning-soft: #33270f;
  }
}

/* iOS: follow the system text size (Dynamic Type), in the brand face. */
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; font-family: var(--font-sans); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--surface); scroll-padding-block-end: 6.5rem; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
bdi { unicode-bidi: isolate; }

.screen {
  max-inline-size: 34rem;
  margin-inline: auto;
  min-block-size: 100dvh;
  padding-block: 1rem 7.5rem;
  padding-inline: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.screen--white { padding-block-end: 2rem; }
.screen[data-screen="done"] { padding-block: 2.5rem 2rem; }

h1 { margin: 0; font-size: 1.75rem; line-height: 1.4; font-weight: 700; color: var(--ink); }
h1:focus { outline: none; }
h2 { margin: 0; font-size: 1.05rem; line-height: 1.6; font-weight: 600; }
p { margin: 0; }
.lead { font-size: 1.05rem; color: var(--ink-muted); }
.sub { color: var(--ink-muted); font-size: 0.9rem; }
.hint { font-size: 0.875rem; color: var(--ink-muted); }
.muted { color: var(--ink-muted); font-weight: 400; font-size: 0.875rem; }
.label { font-size: 0.8rem; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
:lang(ar) .label, :lang(ar).label { text-transform: none; letter-spacing: 0; font-size: 0.875rem; }
.eyebrow { font-size: 0.875rem; font-weight: 600; color: var(--petrol); }
.footer { margin-block-start: auto; }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--success); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 1rem; }
.note, .callout {
  padding-block: 0.75rem;
  padding-inline: 1rem;
  border-radius: var(--radius-lg);
  background: var(--warning-soft);
  color: var(--ink);
  font-size: 0.9rem;
}
.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.row > .btn { flex: 1 1 8rem; }

/* Top bar: logo at the start, language at the end. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-block-size: var(--tap); }
.logo { display: inline-flex; align-items: center; }
.logo img { display: block; inline-size: 132px; block-size: auto; }
.brandbar { margin-block-end: 1rem; }
.eyebrow + h1 { margin-block-start: -0.75rem; }
.title-block { display: flex; flex-direction: column; gap: 0.25rem; }

/* Back chevron points the reading direction's "back". */
[dir="rtl"] .back-chev, [dir="rtl"] .chev { display: inline-block; transform: scaleX(-1); }
/* "›" is already mirrored by the bidi algorithm in Arabic; flipping it again pointed it backwards. */
[dir="rtl"] .card-cta .chev { transform: none; }

label { font-size: 0.9rem; font-weight: 600; }
input[type="email"], input[type="text"], textarea {
  inline-size: 100%;
  min-block-size: 3.25rem;
  padding-block: 0.6rem;
  padding-inline: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  font: inherit;
  font-size: 1rem;
  background: var(--surface-raised);
  color: var(--ink);
}
textarea { resize: vertical; min-block-size: 7rem; line-height: 1.75; }
::placeholder { color: var(--ink-muted); opacity: 1; }

/* Brand focus ring: 2px coral on every interactive element. */
:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .add-media:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-block-size: var(--tap);
  min-inline-size: var(--tap);
  padding-inline: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
/* The view's one coral moment: its main action. */
.btn.primary { background: var(--coral); border-color: var(--coral); color: var(--on-coral); min-block-size: 3.25rem; box-shadow: var(--shadow-sm); }
/* Secondary filled action in petrol, when a view already has its coral. */
.btn.strong { background: var(--petrol); border-color: var(--petrol); color: var(--on-petrol); }
.btn.success { background: var(--success-soft); border-color: var(--success); color: var(--ink); inline-size: 100%; }
.btn.small { min-block-size: var(--tap); font-size: 0.875rem; padding-inline: 0.9rem; }
.btn.choice { justify-content: flex-start; inline-size: 100%; min-block-size: 3.5rem; border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: 0.45; cursor: default; }
.link {
  background: none;
  border: 0;
  padding: 0;
  min-block-size: var(--tap);
  color: var(--petrol);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
}
.link.small { font-size: 0.875rem; align-self: flex-start; }
.back { display: inline-flex; align-items: center; gap: 0.3rem; }
.lang-switch { padding-inline: 0.75rem; border: 1px solid var(--line); border-radius: 999px; min-block-size: 2.5rem; min-inline-size: var(--tap); padding-block: 0.25rem; position: relative; }
/* Keep the tap area at 48px while the pill reads smaller. */
.lang-switch::after { content: ""; position: absolute; inset: -4px 0; }

.icon { inline-size: 1.1em; block-size: 1.1em; flex: none; }

/* Progress meter beside "N of M done" (visual only; the text says it). */
.meter {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  inline-size: 100%;
  block-size: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
  color: var(--petrol);
}
.meter::-webkit-progress-bar { background: var(--surface-sunken); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--petrol); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--petrol); border-radius: 999px; }
.meter--done::-webkit-progress-value { background: var(--success); }
.meter--done::-moz-progress-bar { background: var(--success); }

/* My apps */
.cards { display: flex; flex-direction: column; gap: 0.75rem; }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font: inherit;
  line-height: 1.75;
  text-align: start;
  inline-size: 100%;
}
.card--action { cursor: pointer; }
.card--needs { border: 2px solid var(--petrol); box-shadow: var(--shadow-md); }
.card--waiting { background: var(--surface); border-style: dashed; border-color: var(--line-strong); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-title { font-size: 1.15rem; font-weight: 700; }
.card-text { font-size: 0.9rem; color: var(--ink-muted); }
.card-foot { display: flex; align-items: center; gap: 0.75rem; margin-block-start: 0.25rem; }
.card-foot .meter { flex: 1; }
.card-cta { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.95rem; font-weight: 700; color: var(--petrol); white-space: nowrap; }
/* The first app that needs the tester carries the coral. */
.cards > .card--needs:first-child .card-cta { color: var(--coral); }
.progress { font-size: 0.875rem; color: var(--ink-muted); white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; padding-block: 0.15rem; padding-inline: 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.badge--live { background: var(--petrol); color: var(--on-petrol); }
.badge--pending_review, .badge--processing { background: var(--warning-soft); color: var(--ink); }
.badge--done { background: var(--success-soft); color: var(--ink); }
.badge--cancelled, .badge--nothing { background: var(--surface-sunken); color: var(--ink-muted); }
.wait-dot { inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--warning); flex: none; }
.empty { padding: 1.75rem 1rem; text-align: center; color: var(--ink-muted); background: var(--surface-raised); border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); }

/* Panels */
.panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.panel--done { flex-direction: row; align-items: center; gap: 0.6rem; background: var(--success-soft); border-color: transparent; color: var(--ink); font-weight: 600; }
.panel--done .ok-mark { display: inline-flex; color: var(--success); }
.panel--wrong { border: 2px solid var(--danger); box-shadow: var(--shadow-md); }
.you-said { display: flex; align-items: center; gap: 0.4rem; color: var(--danger); font-weight: 700; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
[data-section="checks"] { display: flex; flex-direction: column; gap: 0.6rem; }

/* Install steps */
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.step { display: flex; gap: 0.75rem; align-items: flex-start; }
.step--later { opacity: 0.6; }
.step-num {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 2rem; block-size: 2rem; border-radius: 50%;
  background: var(--surface-sunken); color: var(--ink); font-weight: 700; font-size: 0.875rem;
}
.step--current .step-num { background: var(--petrol); color: var(--on-petrol); }
.step-num--done { background: var(--success); color: var(--on-success); }
.step-body { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; min-inline-size: 0; padding-block-start: 0.15rem; }
.step-title { font-weight: 600; line-height: 1.6; }
.step-detail { font-size: 0.9rem; color: var(--ink-muted); }
.account { font-weight: 700; color: var(--ink); word-break: break-all; }
.shot { inline-size: 100%; max-inline-size: 18rem; border-radius: var(--radius-lg); border: 1px solid var(--line); }

/* Check list */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.check-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  inline-size: 100%; min-block-size: 3.5rem;
  padding-block: 0.6rem; padding-inline: 1rem;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  font: inherit; color: var(--ink); text-align: start; cursor: pointer; line-height: 1.6;
}
.check-row--next { border: 2px solid var(--petrol); box-shadow: var(--shadow-sm); }
.check-title { font-size: 0.95rem; font-weight: 600; }

/* Verdict pills: colour + icon + text */
.pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; white-space: nowrap; padding-block: 0.15rem; padding-inline: 0.6rem; border-radius: 999px; }
.pill--todo { color: var(--ink-muted); }
.pill--next { background: var(--petrol); color: var(--on-petrol); }
.pill--works { color: var(--ink); background: var(--success-soft); }
.pill--works .icon { color: var(--success); }
.pill--wrong { color: var(--ink); background: var(--danger-soft); }
.pill--wrong .icon { color: var(--danger); }
.pill--couldnt { color: var(--ink-muted); background: var(--surface-sunken); }

/* One check */
.tag { align-self: flex-start; padding-block: 0.15rem; padding-inline: 0.6rem; border-radius: 999px; background: var(--warning-soft); color: var(--ink); font-size: 0.8rem; font-weight: 600; }
.steps { margin: 0; padding-inline-start: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.steps li::marker { color: var(--petrol); font-weight: 700; }
.fallback-tag { font-size: 0.75rem; font-weight: 600; color: var(--ink-muted); }
.fallback .fallback-tag { display: block; margin-block-end: 0.25rem; }
.video { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-xl); }
.video summary { display: flex; align-items: center; gap: 0.6rem; min-block-size: 3.25rem; padding-inline: 1rem; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--petrol); list-style: none; }
.video summary::-webkit-details-marker { display: none; }
.video video { display: block; inline-size: 100%; max-block-size: 70vh; border-end-start-radius: var(--radius-xl); border-end-end-radius: var(--radius-xl); background: #000; }
.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.875rem; color: var(--ink-muted); }
.pager { display: flex; justify-content: space-between; gap: 0.5rem; }
.save-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.9rem; min-block-size: 1.5rem; }
.save-line progress { inline-size: 8rem; accent-color: var(--petrol); }

/* Pinned answer buttons */
.answer-bar {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding-block: 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
  padding-inline: max(1rem, calc((100vw - 34rem) / 2 + 1rem));
  background: var(--surface-raised);
  border-block-start: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(11, 42, 48, 0.08);
}
.verdict { min-block-size: 3.5rem; flex-direction: column; gap: 0.1rem; font-size: 0.85rem; padding-inline: 0.4rem; line-height: 1.3; }
.verdict--works { background: var(--success); border-color: var(--success); color: var(--on-success); }
.verdict--wrong { border: 2px solid var(--danger); color: var(--danger); }
.verdict--couldnt { color: var(--ink-muted); }
.verdict[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 4px var(--ink); }

/* Files */
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.file-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding-inline: 0.75rem; border-radius: 999px; background: var(--surface-sunken); font-size: 0.875rem; }
.add-media {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-block-size: 4.5rem; padding: 0.75rem;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); cursor: pointer; font-weight: 600; color: var(--petrol);
  background: var(--surface);
}
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
legend { font-weight: 600; margin-block-end: 0.4rem; }
.radio { display: flex; align-items: center; gap: 0.75rem; min-block-size: var(--tap); font-weight: 500; }
.radio input { inline-size: 1.25rem; block-size: 1.25rem; accent-color: var(--petrol); }

/* All done */
.done-mark {
  display: inline-flex; align-items: center; justify-content: center; align-self: center;
  inline-size: 5.5rem; block-size: 5.5rem; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--success-soft) 45%, transparent);
  margin-block: 0.5rem 0.75rem;
}
.done-mark .icon { inline-size: 2.75rem; block-size: 2.75rem; }
[data-screen="done"] > h1, [data-screen="done"] > .lead { text-align: center; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.count { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.85rem; border-radius: var(--radius-lg); font-size: 0.8rem; color: var(--ink); line-height: 1.5; }
.count span:last-child { display: inline-flex; align-items: center; gap: 0.25rem; }
.count-n { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
.count--works { background: var(--success-soft); }
.count--works .icon { color: var(--success); }
.count--wrong { background: var(--danger-soft); }
.count--wrong .icon { color: var(--danger); }
.count--couldnt { background: var(--surface-sunken); color: var(--ink-muted); }
.quoted { font-size: 1.3rem; }

/* ---- Motion (motion-plan.md, approved 2026-11-22) -------------------------------------------
   Only when the OS allows motion. js/motion.js adds .is-new to elements that just appeared and
   .is-arrival / .slide-in to a screen that just opened. Every element's resting state is its final,
   visible state; these only add a short entrance. Exponential ease-out; one spring (verdict press). */
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); }
.ok .icon { color: var(--success); }
.done-mark { position: relative; }
.wait-dot { position: relative; }

@media (prefers-reduced-motion: no-preference) {
  /* 1. My apps: cards rise in one after another (420 ms, 60 ms stagger). */
  .card.is-new { animation: rise 420ms var(--ease-out) backwards; }
  .cards > .is-new:nth-child(2) { animation-delay: 60ms; }
  .cards > .is-new:nth-child(3) { animation-delay: 120ms; }
  .cards > .is-new:nth-child(4) { animation-delay: 180ms; }
  .cards > .is-new:nth-child(5) { animation-delay: 240ms; }
  .cards > .is-new:nth-child(n+6) { animation-delay: 300ms; }

  /* 2. Waiting for Apple / getting ready: the badge dot breathes with a fading ring (2.4 s loop). */
  .wait-dot { animation: breathe 2.4s ease-in-out infinite; }
  .wait-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: var(--warning); animation: ring 2.4s ease-out infinite;
  }

  /* 3. "N of M done" bar fills from the start edge (700 ms, after 150 ms): js/motion.js steps the
        <progress> value, since its fill can't be animated in CSS everywhere. */

  /* 4. The next check row glows once (900 ms). */
  .check-row--next.is-new { animation: glow 900ms ease-out 300ms; }

  /* 5. Saved: the tick draws itself (380 ms), then the word fades in (200 ms). */
  .ok.is-new .icon path { stroke-dasharray: 1; animation: draw 380ms var(--ease-out) backwards; }
  .ok.is-new { animation: text-in 200ms ease-out 300ms backwards; }

  /* 6. Verdict buttons: press in, spring back (260 ms); the answer that just saved springs once. */
  .verdict { transition: transform 260ms var(--ease-spring); }
  .verdict:active { transform: scale(0.96); transition-duration: 80ms; }
  main:not(.is-arrival) .verdict.is-new { animation: press 260ms var(--ease-spring); }

  /* 7. Next check slides in from the reading direction (320 ms). The answer bar stays put. */
  main.slide-in > :not(.answer-bar) { animation: slide-ltr 320ms var(--ease-out) backwards; }
  [dir="rtl"] main.slide-in > :not(.answer-bar), main[dir="rtl"].slide-in > :not(.answer-bar) { animation-name: slide-rtl; }

  /* 8. Something's wrong / I couldn't: the panel opens (280 ms), its send button settles last (+120 ms). */
  [data-panel].is-new { animation: open 280ms var(--ease-out) backwards; transform-origin: 50% 0; }
  [data-panel].is-new .btn.primary { animation: settle 300ms var(--ease-out) 120ms backwards; }

  /* 9. All done: one ripple (700 ms), the tick draws (450 ms), tiles rise with 70 ms stagger;
        the numbers count up in motion.js (600 ms). Over by about 1.3 s. */
  .done-mark::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--success); opacity: 0; pointer-events: none;
  }
  .done-mark.is-new { animation: pop-in 450ms var(--ease-out) backwards; }
  .done-mark.is-new::after { animation: ripple 700ms var(--ease-out) 120ms; }
  .done-mark.is-new path { stroke-dasharray: 1; animation: draw 450ms var(--ease-out) 150ms backwards; }
  .count.is-new { animation: rise 420ms var(--ease-out) 450ms backwards; }
  .counts > .is-new:nth-child(2) { animation-delay: 520ms; }
  .counts > .is-new:nth-child(3) { animation-delay: 590ms; }

  /* 10. Install step marked Done: number cross-fades to a tick; the next number fills petrol (240 ms). */
  main:not(.is-arrival) .step-num--done.is-new { animation: swap-in 240ms var(--ease-out) backwards; }
  main:not(.is-arrival) .step--current .step-num.is-new { animation: fill-num 240ms var(--ease-out) backwards; }
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes breathe { 50% { transform: scale(1.6); } }
@keyframes ring { from { opacity: 0.55; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@keyframes glow { 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--petrol) 22%, transparent); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes text-in { from { color: transparent; } }
@keyframes press { from { transform: scale(0.96); } }
@keyframes slide-ltr { from { opacity: 0; transform: translateX(16px); } }
@keyframes slide-rtl { from { opacity: 0; transform: translateX(-16px); } }
@keyframes open { from { opacity: 0; transform: scale(0.98); } }
@keyframes settle { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85); } }
@keyframes ripple { from { opacity: 0.6; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes swap-in { from { opacity: 0; transform: scale(0.7); } }
@keyframes fill-num { from { background: var(--surface-sunken); color: var(--ink); } }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
