/* HealthTab Training — our own course engine, styled with htpoc's design system (docs/ui/DESIGN.md in htpoc).
   Block spacing is still calibrated against the Rise 360 export served at /rise. */

/* Instrument Sans for everything, DM Mono for numbers that are data; self-hosted, as htpoc does. */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/instrument-sans-latin-ext-400-normal-a97d6ada.woff2") format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/instrument-sans-latin-400-normal-4b9b380a.woff2") format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/instrument-sans-latin-ext-500-normal-34ff8fee.woff2") format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/instrument-sans-latin-500-normal-f8d60ec1.woff2") format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url("/assets/instrument-sans-latin-ext-600-normal-f4db233f.woff2") format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url("/assets/instrument-sans-latin-600-normal-927304fe.woff2") format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/instrument-sans-latin-ext-700-normal-7d5236f8.woff2") format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/instrument-sans-latin-700-normal-6fe77867.woff2") format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/dm-mono-latin-ext-400-normal-119d55ca.woff2") format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/dm-mono-latin-400-normal-e597f56f.woff2") format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/dm-mono-latin-ext-500-normal-004a48e6.woff2") format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/dm-mono-latin-500-normal-81d9951d.woff2") format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback'; font-style: normal; font-weight: 400; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans'); size-adjust: 101.82%; ascent-override: 95.27%; descent-override: 24.55%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback'; font-style: normal; font-weight: 500; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans'); size-adjust: 103.21%; ascent-override: 93.98%; descent-override: 24.22%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback'; font-style: normal; font-weight: 600; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Liberation Sans Bold'), local('LiberationSans-Bold'); size-adjust: 97.13%; ascent-override: 99.87%; descent-override: 25.74%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback'; font-style: normal; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Liberation Sans Bold'), local('LiberationSans-Bold'); size-adjust: 98.42%; ascent-override: 98.56%; descent-override: 25.4%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto Regular'), local('Roboto-Regular'); size-adjust: 102.31%; ascent-override: 94.81%; descent-override: 24.44%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback Roboto'; font-style: normal; font-weight: 500; src: local('Roboto'), local('Roboto Regular'), local('Roboto-Regular'); size-adjust: 103.7%; ascent-override: 93.54%; descent-override: 24.11%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback Roboto'; font-style: normal; font-weight: 600; src: local('Roboto Bold'), local('Roboto-Bold'); size-adjust: 103.39%; ascent-override: 93.82%; descent-override: 24.18%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans Fallback Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'); size-adjust: 104.76%; ascent-override: 92.59%; descent-override: 23.86%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Mono Fallback'; font-style: normal; font-weight: 400 500; src: local('Menlo'), local('Menlo-Regular'), local('DejaVu Sans Mono'), local('Droid Sans Mono'), local('Courier New'), local('CourierNewPSMT'), local('Liberation Mono'); size-adjust: 99.98%; ascent-override: 99.22%; descent-override: 31.01%; line-gap-override: 0%; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF,U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ---------- tokens ----------
   From htpoc's design system (docs/ui/DESIGN.md, the web kit app/assets/stylesheets/ui/web.css). Light theme only:
   the course has no dark mode. Names follow DESIGN.md so a value can be checked against it. */
:root {
  --brand-primary: #00a3e0; --brand-secondary: #003a5d; --brand-tertiary: #6dcff6;
  --background-page: #ebeef0; --background-surface: #ffffff; --background-surface-subtle: #f2f6f9; --background-surface-strong: #c5cace;
  --background-brand: #003a5d; --background-brand-subtle: #e5f6fc; --background-brand-tint: #bde4f7;
  --background-selected: #6dcff6; --background-hover: #f5f6f7; --background-hover-on-subtle: #eceef0;
  --background-tint: #0000000d; --background-tint-strong: #00000017; --background-glass: #ffffffbf; --background-scrim-strong: #0a151d66;
  --background-inverse: #231f20; --background-success-subtle: #ddf3d8; --background-error-subtle: #f4c1dc;
  --background-normal: #65c74f; --background-normal-subtle: #ddf3d8; --background-borderline: #ffca43; --background-borderline-subtle: #fff3d6;
  --background-high: #f65b51; --background-high-subtle: #fddbd9;
  --text-default: #003a5d; --text-secondary: #5f6063; --text-tertiary: #939598; --text-strong: #231f20;
  --text-action: #0077c0; --text-link: #000000; --text-on-action: #ffffff; --text-error: #ce0058; --text-success: #43b02a;
  --text-normal: #0f5307; --text-borderline: #6e4a00; --text-high: #8a1c00;
  --border-default: #c5cace; --border-subtle: #dde1e4; --border-action: #0077c0; --border-error: #ce0058; --border-glass: #fffffff2;
  --icon-default: #003a5d; --icon-secondary: #6d6e71; --icon-tertiary: #939598;
  --button-fill-background: #231f20; --button-fill-background-hover: #3a3637; --button-fill-background-pressed: #48494c;
  --button-fill-text: #ffffff; --button-fill-chip: #2e2a2b;
  --toast-success: #357a2d;
  --overlay-black-4: #0000000a; --overlay-black-8: #00000014; --overlay-black-12: #0000001f; --overlay-white-8: #ffffff14; --overlay-white-50: #ffffff80;

  --ring-soft: 0 0 0 1px rgba(0, 30, 50, .09);
  --lift: 0 1px 2px rgba(0, 30, 50, .06), 0 2px 8px -3px rgba(0, 30, 50, .10);
  --lift-hover: 0 2px 4px rgba(0, 30, 50, .06), 0 14px 28px -12px rgba(0, 30, 50, .30);
  --lift-selected: 0 1px 2px rgba(0, 30, 50, .08);
  --lift-fill-hover: 0 14px 28px -12px rgba(0, 30, 50, .5);
  --shadow-pop: 0 0 0 1px #dde1e4, 0 20px 50px -16px rgba(0, 30, 50, .3);
  --shadow-card: 0 6px 20px 0 #003a5d12;
  --shadow-sheet: 0 24px 60px 0 #003a5d2e;
  --field-rest: 0 1px 2px rgba(0, 30, 50, .04);
  --glimmer: rgba(0, 163, 224, .9); --glimmer-on-fill: rgba(109, 207, 246, .95);

  --font-ui: "Instrument Sans", "Instrument Sans Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DM Mono", "DM Mono Fallback", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius-card: 28px; --radius-field: 12px; --radius-sheet: 24px; --radius-auth: 32px;
  --control-s: 40px; --control-m: 48px; --control-l: 56px;

  --ease: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-move: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 150ms; --dur-base: 220ms; --dur-base-out: 160ms; --dur-slow: 320ms; --dur-page: 420ms;
  --dur-press: 80ms; --dur-lift: 300ms; --dur-glimmer: 2400ms; --press-scale: .985; --enter-distance: 8px;

  --sidebar-width: 30rem;
  --container-max: 104rem;  /* 920px content + 60px side padding, as Rise */
  --text-max: 76.2rem;      /* Rise's text column */
}
@media (min-width: 600px) { :root { --radius-card: 32px; --radius-auth: 40px; } }
@media (min-width: 1024px) { :root { --radius-auth: 48px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 62.5%; -webkit-text-size-adjust: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* One thin rounded bar in the course nav, as htpoc's web app draws its panels' scrollbars. */
.sidebar, .sidebar * {
  &::-webkit-scrollbar { width: 12px; height: 12px; }
  &::-webkit-scrollbar-track { background: transparent; }
  &::-webkit-scrollbar-thumb { background: rgb(0 0 0 / .3); border-radius: 9999px; border: 3px solid transparent; background-clip: padding-box; }
  &::-webkit-scrollbar-thumb:hover { background-color: rgb(0 0 0 / .5); }
  &::-webkit-scrollbar-button { display: none; }
}
body { margin: 0; background: var(--background-page); color: var(--text-default); font-family: var(--font-ui); font-size: 1.6rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
img { max-width: 100%; height: auto; }
a { color: var(--text-link); font-weight: 600; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-ui); color: var(--text-default); font-weight: 600; text-wrap: balance; }
p { margin: 0; }
strong, b { font-weight: 600; }
[hidden] { display: none !important; }
mark { background: var(--background-brand-tint); color: inherit; border-radius: 3px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--border-action); outline-offset: 2px; }
@media (hover: none) { :focus-visible { outline: none; } }

/* Text links: black, 600, no underline at rest; with a mouse a line draws in from the left. */
:where(.text__body, .image-aside__text, .process__description, .note__body, .lg__description, .quiz__feedback, .quiz__hint, .sim__task-text, .buttons__description, .steps__detail, .cover__description, .sign-in__help, .legend__text) a {
  color: var(--text-link); font-weight: 600; text-decoration: none;
  background: linear-gradient(var(--border-default), var(--border-default)) no-repeat 0 100% / 0 1.5px;
  transition: background-size var(--dur-slow) var(--ease), opacity var(--dur-fast) var(--ease);
}
:where(.text__body, .image-aside__text, .process__description, .note__body, .lg__description, .quiz__feedback, .quiz__hint, .sim__task-text, .buttons__description, .steps__detail, .cover__description, .sign-in__help, .legend__text) a:active { opacity: .64; }

/* ---------- buttons (htpoc's .btn.fill / .outline / .ghost) ---------- */
.btn {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: .8rem;
  height: var(--control-m); padding: 0 2.2rem; border: 0; border-radius: 9999px; cursor: pointer; text-decoration: none; text-align: center;
  font-family: var(--font-ui); font-size: 1.6rem; font-weight: 600; letter-spacing: -.1px; line-height: 1.2; white-space: nowrap;
  background: var(--background-tint); color: var(--text-default);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease),
              box-shadow var(--dur-lift) var(--ease), transform var(--dur-lift) var(--ease);
}
.btn .icon { width: 2rem; height: 2rem; }
.btn--primary { background: var(--button-fill-background); color: var(--button-fill-text); }
.btn--secondary { background: var(--background-surface); color: var(--text-default); box-shadow: var(--ring-soft), var(--lift); }
.btn--block { display: flex; width: 100%; }
/* The primary button's round arrow chip: the label on the left, the chip at the right end. */
.btn--chip { justify-content: space-between; padding: 4px; }
.btn--chip .btn__label { padding: 0 1.8rem 0 2.2rem; }
.btn__chip { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--button-fill-chip); }
.btn__chip > * { grid-area: 1 / 1; }
.btn__chip .icon { width: 2.2rem; height: 2.2rem; transition: transform var(--dur-fast) var(--ease); }
.btn--secondary .btn__chip { background: var(--background-tint); }
.btn--l { height: var(--control-l); font-size: 1.7rem; }
.btn--l .btn__chip { width: 48px; height: 48px; }
/* One glimmer of light along the border on hover (never across the fill). */
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(105deg, transparent 38%, var(--glimmer) 50%, transparent 62%) no-repeat; background-size: 300% 100%; background-position: 130% 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.btn--primary::after { --glimmer: var(--glimmer-on-fill); z-index: 1; }
.btn:not(.btn--primary, .btn--secondary)::after { display: none; }
:is(.btn, .btn--primary, .btn--secondary):active:not(:disabled) { transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.btn--primary:active:not(:disabled) { background: var(--button-fill-background-pressed); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background-color: var(--background-tint-strong); }
  .btn--primary:hover:not(:disabled) { background: var(--button-fill-background-hover); transform: translateY(-1px); box-shadow: var(--lift-fill-hover); }
  .btn--primary:hover:not(:disabled) .btn__chip .icon--arrow-right { transform: translateX(3px); }
  .btn--secondary:hover:not(:disabled) { background: var(--background-surface); transform: translateY(-1px); box-shadow: var(--ring-soft), var(--lift-hover); }
  :is(.btn--primary, .btn--secondary):hover:not(:disabled)::after { background-position: -30% 0; transition: background-position var(--dur-glimmer) var(--ease-move); }
  :is(.btn, .btn--primary, .btn--secondary):active:not(:disabled) { transform: scale(var(--press-scale)); }
}
@media (prefers-reduced-motion: reduce) { .btn::after { display: none; } }

/* A round icon button: the menu toggle, search, the sim and card navs. */
.icobtn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--icon-default); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.icobtn .icon { width: 2.4rem; height: 2.4rem; }
.icobtn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .icobtn:hover { background: var(--background-tint); } }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex: none; }

/* Progress ring in the sidebar and overview: 2px brand-primary over an 8% black track, a tick once complete. */
.ring { position: relative; width: 2rem; height: 2rem; flex: none; }
.ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--overlay-black-8); stroke-width: 2; }
.ring__arc { fill: none; stroke: var(--brand-primary); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 50.27; stroke-dashoffset: 50.27; transition: stroke-dashoffset var(--dur-page) var(--ease); }
.ring__check { position: absolute; inset: 0; border-radius: 50%; background: var(--text-success); color: #fff; display: grid; place-items: center; font-size: 1.4rem; opacity: 0; transform: scale(.6); transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.is-complete .ring__check { opacity: 1; transform: none; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-primary); }
.logo svg { display: block; width: 100%; height: 100%; }
.logo__symbol { width: 36px; height: 36px; }
.logo__wordmark { width: 108px; height: 18px; }

/* ---------- brand split (DESIGN.md: the web sign-in and the kiosk Welcome) ----------
   The page ground with the big symbol in brand-tertiary behind frosted glass, the headline on the left and one surface card. */
.brand { --gi: 8px; position: relative; isolation: isolate; overflow: hidden; background: var(--background-surface-subtle); }
.brand--full { min-height: 100vh; min-height: 100dvh; }
.brand__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; container: brandbg / size; }
.brand__symbol { position: absolute; right: 0; top: 50%; translate: 0 -50%; width: min(100cqh, 100cqw - var(--gi)); aspect-ratio: 1; color: var(--brand-tertiary); }
.brand__symbol svg { display: block; width: 100%; height: 100%; }
.brand__glass { position: absolute; inset: var(--gi); border-radius: 24px; background: color-mix(in srgb, var(--background-surface) 58%, transparent);
  -webkit-backdrop-filter: blur(48px); backdrop-filter: blur(48px); box-shadow: 4px 4px 70px rgba(0, 0, 0, .1), inset 0 0 0 1px var(--border-glass); }
.brand__in { position: relative; min-height: inherit; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "copy" "card";
  gap: 2.4rem; align-content: start; padding: 2.8rem calc(var(--gi) + 1.6rem) 3.2rem; }
.brand__top { grid-area: top; display: flex; align-items: center; justify-content: space-between; }
.brand__copy { grid-area: copy; display: flex; flex-direction: column; gap: 1.6rem; }
.brand__title { font-size: 3.5rem; font-weight: 600; line-height: 1.07; letter-spacing: -.03em; color: var(--text-default); }
.brand__accent { color: var(--brand-primary); }
.brand__tagline { max-width: 46rem; font-size: 1.8rem; line-height: 1.5; letter-spacing: -.1px; color: var(--text-secondary); text-wrap: pretty; }
.brand__card { grid-area: card; position: relative; width: 100%; background: var(--background-surface); border-radius: var(--radius-card); padding: 2.8rem 2rem;
  box-shadow: 0 1px 2px rgba(0, 30, 50, .06), 0 24px 60px -24px rgba(0, 30, 50, .28); }
@media (min-width: 600px) {
  .brand { --gi: 16px; }
  .brand__glass { border-radius: 40px; background: var(--background-glass); -webkit-backdrop-filter: blur(80px); backdrop-filter: blur(80px); }
  .brand__in { padding: 4.4rem calc(var(--gi) + 4rem) 4.8rem; gap: 3.2rem; }
  .brand__title { font-size: 6rem; }
  .brand__card { max-width: 52rem; padding: 3.6rem; border-radius: 36px; }
}
@media (min-width: 1024px) {
  .brand { --gi: 20px; }
  .brand__glass { border-radius: 48px; }
  .brand__in { max-width: 132rem; margin: 0 auto; grid-template-columns: minmax(0, 1fr) 46rem; grid-template-rows: auto 1fr;
    grid-template-areas: "top card" "copy card"; column-gap: 6.4rem; padding: 5.4rem 7.4rem 5.4rem; }
  .brand__copy { align-self: center; padding-bottom: 4rem; }
  .brand__title { font-size: clamp(5.6rem, 5.2vw, 7.6rem); }
  .brand__card { align-self: center; max-width: none; padding: 4rem 4rem 3.6rem; }
}
.logo { --logo: 1; }
@media (min-width: 600px) { .brand__top .logo__symbol { width: 44px; height: 44px; } .brand__top .logo__wordmark { width: 132px; height: 22px; } }

/* ---------- cover page ---------- */
.brand--cover { min-height: min(100vh, 76rem); }
.cover__card { display: flex; flex-direction: column; gap: 2.4rem; }
.cover__description { font-size: 1.6rem; line-height: 1.6; color: var(--text-secondary); }
.cover__description p + p { margin-top: 1.2rem; }
.cover__progress { display: flex; align-items: center; gap: 1.2rem; font-size: 1.4rem; font-weight: 600; color: var(--text-strong); }
.cover__progress-track { flex: 1; height: 6px; border-radius: 9999px; background: var(--overlay-black-8); overflow: hidden; }
.cover__progress-bar, .sidebar__progress-bar { height: 100%; width: 100%; border-radius: inherit; background: var(--brand-primary); transform-origin: left; transform: scaleX(0); transition: transform var(--dur-page) var(--ease); }
.cover__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem 2.4rem; }
.cover__start { min-width: 22rem; }

.cover__body { width: 100%; max-width: 80rem; margin: 0 auto; padding: 6.4rem 2rem 9.6rem; }
.overview { display: flex; flex-direction: column; gap: 2.4rem; }
.overview__group { background: var(--background-surface); border-radius: var(--radius-card); padding: 2.8rem 1.6rem 1.2rem; box-shadow: var(--ring-soft), var(--shadow-card); }
.overview__section { display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem 1.2rem; font-size: 2rem; line-height: 1.25; letter-spacing: -.3px; }
.overview__number { flex: none; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--background-brand-subtle); color: var(--text-action); font-size: 1.4rem; font-weight: 600; letter-spacing: 0; }
.overview__list, .sidebar__list { list-style: none; margin: 0; padding: 0; }
.overview__item + .overview__item .overview__link::before { content: ""; position: absolute; left: 6.4rem; right: 1.2rem; top: 0; border-top: 1px solid var(--border-subtle); }
.overview__link { position: relative; display: flex; align-items: center; gap: 1.6rem; min-height: 6rem; padding: 1.2rem; border-radius: 16px; color: var(--text-default); text-decoration: none; font-size: 1.7rem; font-weight: 600; line-height: 1.3; transition: background-color var(--dur-fast) var(--ease); }
.overview__link:active { background-color: var(--overlay-black-8); }
.overview__icon { flex: none; display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--background-surface-subtle); color: var(--icon-secondary); font-size: 2rem; }
.overview__title { flex: 1; }
@media (hover: hover) and (pointer: fine) {
  .overview__link:hover { background-color: var(--background-hover); }
  .overview__link:hover::before, .overview__item:has(.overview__link:hover) + .overview__item .overview__link::before { opacity: 0; }
}
@media (min-width: 600px) { .overview__group { padding: 3.2rem 2.4rem 1.6rem; } }

/* ---------- lesson layout: the sidebar on the page ground, the lesson in one white panel beside it ---------- */
.body--lesson { background: var(--background-page); }
.lesson { min-height: 100vh; }
.lesson-rule { position: relative; height: 3px; background: var(--border-subtle); }
.lesson-rule__fill { height: 100%; width: 100%; background: var(--brand-primary); transform-origin: left; transform: scaleX(0); transition: transform var(--dur-page) var(--ease); }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-width); background: var(--background-page);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 20; transition: transform var(--dur-slow) var(--ease);
}
.sidebar__header { flex: none; position: relative; padding: 2.4rem 2rem 1.6rem 2.4rem; overflow: hidden; min-height: 13.6rem; }
.sidebar__header-content { transition: transform var(--dur-base) var(--ease), opacity var(--dur-base-out) var(--ease); }
.sidebar--searching .sidebar__header-content { transform: translateY(calc(-100% - 2rem)); opacity: 0; }
.sidebar__search-btn { position: absolute; top: 1.8rem; right: 1.2rem; z-index: 2; transition: transform var(--dur-base) var(--ease), opacity var(--dur-base-out) var(--ease), background-color var(--dur-fast) var(--ease); }
.sidebar--searching .sidebar__search-btn { opacity: 0; transform: translateY(-1.5rem); pointer-events: none; }
.sidebar__course { display: flex; flex-direction: column; align-items: flex-start; gap: 1.6rem; padding-right: 4.8rem; color: var(--text-default); text-decoration: none; font-size: 2.2rem; font-weight: 600; line-height: 1.2; letter-spacing: -.3px; margin-bottom: 2.4rem; }
.sidebar__course .logo__symbol { width: 32px; height: 32px; }
.sidebar__progress { display: flex; flex-direction: column; gap: .8rem; font-size: 1.3rem; font-weight: 600; color: var(--text-secondary); }
.sidebar__progress-track { height: 4px; border-radius: 9999px; background: var(--overlay-black-8); overflow: hidden; }
.sidebar__search { position: absolute; left: 1.6rem; right: 1.6rem; top: 2rem; z-index: 3; display: flex; align-items: center; height: 48px; background: var(--background-surface); border-radius: 9999px; padding: 0 .6rem 0 1.6rem; box-shadow: var(--ring-soft), var(--lift);
  transform: translateY(calc(-100% - 2.4rem)); visibility: hidden; transition: transform var(--dur-base) var(--ease), visibility 0s var(--dur-base); }
.sidebar--searching .sidebar__search { transform: none; visibility: visible; transition: transform var(--dur-base) var(--ease), visibility 0s; }
.sidebar__search:focus-within { box-shadow: inset 0 0 0 2px var(--border-action), var(--lift); }
.sidebar__search-icon { color: var(--icon-secondary); font-size: 2rem; display: flex; flex: none; }
.sidebar__search-input { flex: 1; min-width: 0; margin: 0 .8rem; border: 0; background: transparent; font-family: var(--font-ui); font-size: 1.6rem; color: var(--text-strong); }
.sidebar__search-input::placeholder { color: var(--text-tertiary); opacity: 1; }
.sidebar__search-input:focus { outline: none; }
.sidebar__search-close { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; padding: 0; color: var(--icon-secondary); cursor: pointer; font-size: 2rem; transition: background-color var(--dur-fast) var(--ease); }
.sidebar__nav { padding: .8rem 1.2rem 3.2rem; flex: 1; }
.sidebar__section { display: flex; align-items: baseline; gap: .8rem; margin: 2.4rem 1.2rem .8rem; font-size: 1.2rem; font-weight: 600; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.sidebar__section-number { color: var(--text-tertiary); }
.sidebar__item { margin: 0; }
.sidebar__link { display: flex; align-items: center; gap: 1.2rem; min-height: 44px; padding: 1rem 1.2rem; border-radius: 12px; color: var(--text-default); text-decoration: none; font-size: 1.5rem; font-weight: 500; line-height: 1.3; transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.sidebar__link:active { background-color: var(--overlay-black-8); }
.sidebar__item--current .sidebar__link { background: var(--background-surface); font-weight: 600; box-shadow: var(--ring-soft), var(--lift); }
.sidebar__link-title { flex: 1; }
.sidebar__scrim { display: none; }
.sidebar__results { padding: 0 1.2rem 2rem; }
.search__result { display: block; padding: 1.2rem; border-radius: 12px; text-decoration: none; color: var(--text-default); font-weight: 400; transition: background-color var(--dur-fast) var(--ease); }
.search__section { display: block; font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); }
.search__title { display: block; font-size: 1.5rem; font-weight: 600; margin: .2rem 0; }
.search__snippet { display: block; font-size: 1.4rem; color: var(--text-secondary); line-height: 1.45; }
.search__empty { font-size: 1.4rem; color: var(--text-secondary); padding: 1.2rem; }
@media (hover: hover) and (pointer: fine) {
  .sidebar__link:hover { background-color: var(--overlay-black-4); }
  .sidebar__item--current .sidebar__link:hover { background-color: var(--background-surface); }
  .search__result:hover { background-color: var(--overlay-black-4); }
  .sidebar__search-close:hover { background-color: var(--background-tint); }
}

.lesson__content { position: relative; margin: 1.2rem 1.2rem 1.2rem var(--sidebar-width); min-height: calc(100vh - 2.4rem); display: flex; flex-direction: column;
  background: var(--background-surface); border-radius: var(--radius-card); box-shadow: var(--ring-soft); overflow: clip; }
.lesson--nav-closed .sidebar { transform: translateX(-100%); }
.lesson--nav-closed .lesson__content { margin-left: 1.2rem; }
.lesson__menu-btn { position: fixed; top: 2.4rem; left: calc(var(--sidebar-width) + 1.6rem); z-index: 30; background: var(--background-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--ring-soft); }
.lesson--nav-closed .lesson__menu-btn { left: 2.4rem; }

.lesson-header { padding: 8rem 0 0; }
.lesson-header__inner { max-width: 104rem; margin: 0 auto; padding: 0 6rem 6.4rem; }
.lesson-header__inner > * { max-width: var(--text-max); margin-left: auto; margin-right: auto; }
.lesson-header__counter { font-size: 1.3rem; font-weight: 600; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 1.2rem; }
.lesson-header__title { font-size: 4.4rem; font-weight: 600; line-height: 1.08; letter-spacing: -1.3px; }
.lesson-header__description { margin-top: 1.6rem; font-size: 1.9rem; line-height: 1.5; letter-spacing: -.1px; color: var(--text-secondary); }

.blocks { flex: 1; padding-bottom: 6.4rem; }
@media (max-width: 767px) { .blocks { padding-bottom: 4rem; } }
/* The previous lesson, parked just above the fold. */
.lesson-nav { display: flex; align-items: center; justify-content: center; gap: 1.2rem; padding: 1.6rem 2rem; background: var(--background-surface-subtle); color: var(--text-default); text-decoration: none; font-size: 1.5rem; transition: background-color var(--dur-fast) var(--ease); }
.lesson-nav .icon { font-size: 2rem; color: var(--icon-secondary); }
.lesson-nav__label { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.2rem; }
.lesson-nav__kicker { font-weight: 500; color: var(--text-secondary); }
.lesson-nav__title { font-weight: 600; }

.lesson-footer { margin-top: auto; background: var(--background-surface-subtle); animation: footerUp var(--dur-page) var(--ease) both; }
@keyframes footerUp { from { opacity: 0; transform: translateY(var(--enter-distance)); } }
@media (prefers-reduced-motion: reduce) { .lesson-footer { animation: none; } }
.lesson-footer__next { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; padding: 4.8rem 2rem 5.6rem; color: var(--text-default); text-decoration: none; text-align: center; transition: background-color var(--dur-fast) var(--ease); }
.lesson-footer__label { display: flex; flex-direction: column; gap: .6rem; }
.lesson-footer__kicker { font-size: 1.3rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.lesson-footer__title { font-size: 2.6rem; font-weight: 600; line-height: 1.15; letter-spacing: -.6px; text-wrap: balance; }
.lesson-footer__chip { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--button-fill-background); color: var(--button-fill-text); font-size: 2.2rem; transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.lesson-footer__next:active .lesson-footer__chip { transform: scale(.94); }
/* the lesson's last gate locks the footer until the content above is complete */
.lesson-footer__next:is(.is-locked, .is-pending) { pointer-events: none; cursor: default; }
.lesson-footer__next:is(.is-locked, .is-pending) :is(.lesson-footer__label, .lesson-footer__chip) { opacity: .4; }
.lesson-footer__chip .icon[hidden] { display: none; }
.lesson-footer .lesson-footer__next.is-course-complete .lesson-footer__chip { background: var(--text-success); color: #fff; }
.lesson-footer__hint { display: inline-flex; align-items: center; gap: .8rem; font-size: 1.5rem; line-height: 1.4; color: var(--text-secondary); }
.lesson-footer__hint[hidden] { display: none; }
.lesson-footer__hint svg { flex: none; width: 1.8rem; height: 1.8rem; }
@media (hover: hover) and (pointer: fine) {
  .lesson-nav:hover, .lesson-footer__next:hover { background-color: var(--background-hover-on-subtle); }
  /* DESIGN.md's primary lift, but the arrow stays put: on an icon-only button the nudge reads as the icon slipping */
  .lesson-footer__next:hover .lesson-footer__chip { background: var(--button-fill-background-hover); transform: translateY(-1px); box-shadow: var(--lift-fill-hover); }
}

/* ---------- blocks ---------- */
.block { position: relative; }
.block__inner { max-width: 104rem; margin: 0 auto; padding: 0 6rem; }
/* Default block width is Rise's text column, centred in the 920px content box. */
.block__inner > * { max-width: var(--text-max); margin: 0 auto; }
/* Blocks that use the full content width instead. */
.block--gallery .block__inner > *,
.block--image-hero .block__inner > *,
.block--image-aside .block__inner > *,
.block--flashcard .block__inner > * { max-width: none; }
.block--embed .block__inner > * { max-width: 70rem; }
.block--video .block__inner > * { max-width: 76rem; }
/* Rise never upscales an image past its natural size. */
.gallery__img, .image-hero__img { display: block; max-width: 100%; width: auto; height: auto; margin: 0 auto; border-radius: 16px; }
/* Rise does stretch the text-aside image to fill its column. */
.image-aside__img { display: block; width: 100%; height: auto; border-radius: 16px; }
.block--animate { opacity: 0; transform: translateY(1.6rem); transition: opacity var(--dur-page) var(--ease), transform var(--dur-page) var(--ease); }
.block--animate.is-visible { opacity: 1; transform: none; }
/* Text-aside blocks fade in place while the image slides in from the side it sits on. */
.block--image-aside.block--animate { transform: none; }
.block--image-aside .image-aside__figure { transform: translateX(-2.4rem); transition: transform var(--dur-page) var(--ease) var(--dur-fast); }
.block--image-aside.image-aside--reverse .image-aside__figure { transform: translateX(2.4rem); }
.block--image-aside.is-visible .image-aside__figure { transform: none; }
.is-gated { display: none; }
@media (prefers-reduced-motion: reduce) {
  .block--animate { opacity: 1; transform: none; transition: none; }
  .block--image-aside .image-aside__figure { transform: none; transition: none; }
}

/* padding scale: Rise's paddingTop/paddingBottom 0–8 → rem (3 = default 30px) */
[data-pt="0"] { padding-top: 0; } [data-pb="0"] { padding-bottom: 0; }
[data-pt="1"] { padding-top: 1rem; } [data-pb="1"] { padding-bottom: 1rem; }
[data-pt="2"] { padding-top: 2rem; } [data-pb="2"] { padding-bottom: 2rem; }
[data-pt="3"] { padding-top: 3rem; } [data-pb="3"] { padding-bottom: 3rem; }
[data-pt="4"] { padding-top: 4.5rem; } [data-pb="4"] { padding-bottom: 4.5rem; }
[data-pt="5"] { padding-top: 6rem; } [data-pb="5"] { padding-bottom: 6rem; }
[data-pt="6"] { padding-top: 7.5rem; } [data-pb="6"] { padding-bottom: 7.5rem; }
[data-pt="7"] { padding-top: 9rem; } [data-pb="7"] { padding-bottom: 9rem; }
[data-pt="8"] { padding-top: 10.5rem; } [data-pb="8"] { padding-bottom: 10.5rem; }

/* text */
.text__heading { font-size: 2.8rem; font-weight: 600; line-height: 1.15; letter-spacing: -.7px; padding: .8rem 0; }
.text__subheading { font-size: 2.2rem; font-weight: 600; line-height: 1.25; letter-spacing: -.3px; padding: .8rem 0; }
.text__body, .image-aside__text, .process__description { font-size: 1.8rem; line-height: 1.65; color: var(--text-strong); }
/* Instrument Sans sets a narrow word space; long-form reading needs a little more than the UI does */
.text__body, .image-aside__text, .process__description, .note, .tryit, .quiz__choice, .quiz__feedback, .lesson-header__description, .flashcard, .lg__card, .steps__text { word-spacing: .06em; }
.text__body p + p, .image-aside__text p + p, .process__description p + p { margin-top: 2rem; }
.text__body ul, .text__body ol { padding-left: 2.4rem; }
.text__body li + li { margin-top: .6rem; }
.text__body li::marker { color: var(--text-tertiary); }
/* A block ends at its padding, whether its text ends in a paragraph or a list. */
.text__body > :last-child { margin-bottom: 0; }
/* A paragraph block straight after another text block reads as the next paragraph, not a new
   section: space them as paragraphs in one block are, not with both blocks' padding. */
.block--text:not(.block--note):has(+ .block--paragraph) { padding-bottom: 2rem; }
.block--text:not(.block--note) + .block--paragraph { padding-top: 0; }
/* Spacing by what meets what, not by the padding each block was imported from Rise with.
   A heading always has the same room above it, so the block before gives up its bottom padding. */
.block:has(+ .block > .block__inner > .text__heading:first-child),
.block:has(+ .block > .block__inner > div > .text__subheading:first-child),
.block:has(+ .block > .block__inner > .text__subheading:first-child) { padding-bottom: 0; }
.block:has(> .block__inner > .text__heading:first-child),
.block:has(> .block__inner > div > .text__subheading:first-child),
.block:has(> .block__inner > .text__subheading:first-child) { padding-top: 4rem; }
/* A heading on its own introduces what follows (a video, a note, a subheading), so it sits close to it. */
.block.block--text:not(.block--note):not(:has(.text__body)):has(.text__heading, .text__subheading) { padding-bottom: 0; }
.block.block--text:not(.block--note):not(:has(.text__body)):has(.text__heading, .text__subheading) + .block.block { padding-top: 1.2rem; }
.block.block--text:not(.block--note):not(:has(.text__body)):has(.text__heading, .text__subheading) + .block:has(> .block__inner > div > .text__subheading:first-child),
.block.block--text:not(.block--note):not(:has(.text__body)):has(.text__heading, .text__subheading) + .block:has(> .block__inner > .text__subheading:first-child) { padding-top: 1.6rem; }
/* After a note, the same 40px whatever follows; a hero photo sits the same distance above the text that opens a lesson. */
.block.block--note + .block.block--video { padding-top: 1rem; }
.block.block--image-hero { padding-bottom: 0; }
.block.block--image-hero + .block.block { padding-top: 2.4rem; }
/* Attachments belong to the text above them; a run of them is one list. */
.block + .block.block--attachment { padding-top: 2rem; }
.block--attachment + .block.block--attachment { padding-top: 1.2rem; }
/* The legend keeps the web app's result colours (ok, warn, high): the chip is the app's own status pill. */
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.legend__row { display: grid; grid-template-columns: minmax(12rem, max-content) 1fr; align-items: center; gap: 2rem; padding: 1.4rem 1.8rem; border-radius: 1.6rem; background: var(--background-surface); box-shadow: var(--ring-soft), var(--lift); }
.legend__chip { justify-self: start; display: inline-flex; align-items: center; gap: .8rem; padding: .6rem 1.4rem .6rem 1rem; border-radius: 99rem; font-size: 1.5rem; font-weight: 600; background: var(--tone-bg); color: var(--tone-fg); box-shadow: inset 0 0 0 .15rem var(--tone-ring); }
.legend__dot { width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--tone-ring); }
.legend__text { font-size: 1.7rem; line-height: 1.5; color: var(--text-strong); }
.legend__row--ok { --tone-bg: var(--background-normal-subtle); --tone-fg: var(--text-normal); --tone-ring: var(--background-normal); }
.legend__row--warn { --tone-bg: var(--background-borderline-subtle); --tone-fg: var(--text-borderline); --tone-ring: var(--background-borderline); }
.legend__row--high { --tone-bg: var(--background-high-subtle); --tone-fg: var(--text-high); --tone-ring: var(--background-high); }
.legend__caption { margin-top: 1.2rem; font-size: 1.5rem; color: var(--text-secondary); }
@media (max-width: 600px) { .legend__row { grid-template-columns: 1fr; gap: .8rem; } }
/* a note sits a little closer to the text it adds to, the same everywhere, whatever padding the block was imported with */
.block:has(+ .block--note) { padding-bottom: 3rem; }
.block.block--note { padding-top: 1rem; padding-bottom: 3rem; }
.note { display: flex; gap: 1.6rem; background: var(--background-brand-subtle); border-radius: 20px; padding: 2.4rem 2.8rem 2.4rem 2.4rem; }
.note__icon { flex: none; display: grid; place-items: center; width: 3.6rem; height: 3.6rem; margin-top: -.4rem; border-radius: 50%; background: var(--background-surface); color: var(--brand-primary); font-size: 2.2rem; }
.note__body { font-size: 1.6rem; line-height: 1.6; color: var(--text-default); }
.note__body p + p { margin-top: 1.2rem; }
.video__watched { margin: 1rem 0 0; font-size: 1.4rem; line-height: 1.4; color: var(--text-secondary); }
.video__watched[hidden] { display: none; }
.caption { font-size: 1.4rem; line-height: 1.45; color: var(--text-secondary); padding: 1.2rem 0 0; margin: .4rem 0 0; }

/* images */
.zoomable { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.zoomable-img { cursor: zoom-in; }
/* Rise lets this row overhang the container on the image side, so it runs about 1000px wide. */
.image-aside { display: flex; align-items: center; margin-left: -7.9rem; width: calc(100% + 7.9rem); }
.image-aside--reverse .image-aside { flex-direction: row-reverse; margin-left: 0; margin-right: -7.9rem; }
.image-aside__figure { margin: 0; flex: 0 0 66.6%; min-width: 0; }
.image-aside--large .image-aside__figure { flex-basis: 73.3%; }
.image-aside--small .image-aside__figure { flex-basis: 50%; }
.image-aside__text { flex: 1; min-width: 0; padding-left: 6rem; }
.image-aside--reverse .image-aside__text { padding-left: 0; padding-right: 6rem; }
.image-hero { margin: 0; }
.image-hero .caption { max-width: var(--text-max); margin: .75rem auto 0; }
.block--full-bleed .block__inner { padding: 0; max-width: none; }
.block--full-bleed .block__inner > * { margin-left: 0; max-width: none; }
.image-full { margin: 0; }
.image-full__media { position: relative; width: 100%; max-height: 70rem; min-height: 20rem; overflow: hidden; background-position: 50%; background-size: cover; background-repeat: no-repeat; }
.image-full__media > img { display: block; width: 100%; max-height: 70rem; opacity: 0; }
.image-full__caption { max-width: 104rem; margin: .75rem auto 0; padding: 0 6rem; }
.gallery__stage { position: relative; }
.gallery__viewport { overflow: hidden; border-radius: 16px; transition: height var(--dur-slow) var(--ease-move); }
.gallery__track { display: flex; align-items: flex-start; transition: transform var(--dur-slow) var(--ease-move); }
.gallery__slide { flex: 0 0 100%; min-width: 0; margin: 0; }
.gallery__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: var(--background-surface); color: var(--icon-default); box-shadow: var(--ring-soft), var(--lift); cursor: pointer; font-size: 2.4rem;
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.gallery__arrow:active { transform: translateY(-50%) scale(.94); }
.gallery__arrow--prev { left: -7.2rem; } .gallery__arrow--next { right: -7.2rem; }
.gallery__dots { list-style: none; display: flex; justify-content: center; gap: .8rem; margin: 2rem 0 0; padding: 0; }
.gallery__dot { display: block; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 9999px; background: var(--overlay-black-12); cursor: pointer; transition: background-color var(--dur-fast) var(--ease), transform var(--dur-base) var(--ease); }
.gallery__dot.is-active { background: var(--text-default); transform: scale(1.25); }
.gallery__captions { margin-top: 1rem; }
@media (hover: hover) and (pointer: fine) {
  .gallery__arrow:hover { box-shadow: var(--ring-soft), var(--lift-hover); }
  .gallery__dot:hover:not(.is-active) { background: var(--text-tertiary); }
}

/* ---------- simulators (kiosk and web app, framed in lesson mode) ---------- */
.block--simulator-kiosk .block__inner > *, .block--simulator-web .block__inner > * { max-width: 92rem; }
.block--simulator-phone .block__inner > * { max-width: 46rem; }
.sim { display: flex; flex-direction: column; gap: 1.2rem; }
/* The try-it banner: what to do in the simulator, on a soft card with its call to action. */
.sim__task { display: flex; gap: 1.6rem; align-items: baseline; background: var(--background-surface-subtle); border-radius: 20px; padding: 1.8rem 2.4rem 1.8rem 1.8rem; font-size: 1.6rem; line-height: 1.55; color: var(--text-default);
  transition: background-color var(--dur-slow) var(--ease); }
.sim.is-done .sim__task { background: var(--background-success-subtle); }
.sim__task-text p { margin: 0; }
.sim__task-text p + p { margin-top: .6rem; }
.sim__badge { flex: none; display: inline-flex; align-items: center; gap: .4rem; height: 2.8rem; padding: 0 1.2rem; border-radius: 9999px; font-size: 1.3rem; font-weight: 600; white-space: nowrap; }
.sim__badge .icon { width: 1.6rem; height: 1.6rem; }
.sim__badge--todo { background: var(--button-fill-background); color: var(--button-fill-text); }
.sim__badge--done { display: none; padding-left: .8rem; background: var(--toast-success); color: #fff; }
.sim.is-done .sim__badge--todo { display: none; }
.sim.is-done .sim__badge--done { display: inline-flex; animation: badgeIn var(--dur-base) var(--ease); }
@keyframes badgeIn { from { opacity: 0; transform: scale(.9); } }
/* lesson mode fits the tablet (1280 x 800 in its bezel) or the browser window to the frame */
.sim__wrap { position: relative; width: 100%; aspect-ratio: 1340 / 910; overflow: hidden; }
.block--simulator-web .sim__wrap { aspect-ratio: 1324 / 900; }
.block--simulator-phone .sim__wrap { aspect-ratio: 446 / 950; }
/* the phone sits inside its frame with lesson mode's own margin above it, so the block adds none and the frame tucks up into it */
.block--simulator-phone { padding-top: 0; }
.block--simulator-phone .sim__wrap { margin-top: -2.4rem; }
/* a tablet with no task banner above it: lesson mode leaves 23 px over the tablet in the frame, so tuck it up and the gap above reads the same 60 px as everywhere else */
.block--simulator:not(.block--simulator-phone) .sim:not(:has(.sim__task)) .sim__wrap { margin-top: -2.3rem; }
.sim__wrap:fullscreen { aspect-ratio: auto; background: var(--background-surface); }
.sim__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* a swapped-in simulator fades in over the old one once it has drawn (simulator#swapTo) */
.sim__frame { transition: opacity var(--dur-base) var(--ease); }
.sim__frame.is-entering { opacity: 0; }
.sim__bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.sim__caption { flex: 1; min-width: 20rem; margin: 0; font-size: 1.4rem; line-height: 1.45; color: var(--text-secondary); }
.sim__btn { display: inline-flex; align-items: center; gap: .6rem; height: 36px; padding: 0 1.4rem 0 1.2rem; border: 0; border-radius: 9999px; background: var(--background-tint); font-family: var(--font-ui); font-size: 1.4rem; font-weight: 600; color: var(--text-strong); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.sim__btn:first-of-type { margin-left: auto; }
.sim__btn .icon { width: 1.8rem; height: 1.8rem; }
.sim__btn:active { transform: scale(var(--press-scale)); }
@media (hover: hover) and (pointer: fine) { .sim__btn:hover { background: var(--background-tint-strong); } }

.embed, .video { position: relative; width: 100%; margin: 0 auto; }
.media-card { border-radius: 20px; overflow: hidden; box-shadow: var(--ring-soft), var(--shadow-card); background: #000; }
.embed { aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.embed__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__poster { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background-size: cover; background-position: center; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.embed__poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,21,29,.6), rgba(10,21,29,0) 50%); }
.embed__play { position: relative; z-index: 1; display: grid; place-items: center; width: 7.2rem; height: 7.2rem; border-radius: 50%; background: var(--background-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--text-strong); font-size: 3.6rem; box-shadow: var(--shadow-sheet); transition: transform var(--dur-fast) var(--ease); }
.embed__poster:active .embed__play { transform: scale(.96); }
.embed__title { position: absolute; left: 2.4rem; bottom: 2rem; z-index: 1; color: #fff; font-size: 1.6rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.video__player { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video .caption { margin-top: 0; }
@media (hover: hover) and (pointer: fine) { .embed__poster:hover .embed__play { transform: scale(1.06); } }

/* attachment */
.attachment { display: flex; align-items: center; gap: 2rem; padding: 2.4rem 2.4rem; background: var(--background-surface); border-radius: 24px; color: inherit; text-decoration: none; font-weight: 400; box-shadow: var(--ring-soft), var(--lift);
  transition: box-shadow var(--dur-lift) var(--ease), transform var(--dur-lift) var(--ease); }
.attachment:active { transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.attachment__icon { position: relative; flex: none; display: grid; place-items: center; width: 5.6rem; height: 5.6rem; border-radius: 50%; background: var(--background-brand-subtle); color: var(--brand-primary); font-size: 2.6rem; }
.attachment__ext { position: absolute; left: 50%; bottom: -.4rem; transform: translateX(-50%); padding: .1rem .5rem; border-radius: 4px; background: var(--text-default); color: #fff; font-size: 1rem; font-weight: 600; letter-spacing: .04em; line-height: 1.4; }
.attachment__info { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.attachment__name { font-size: 1.7rem; font-weight: 600; line-height: 1.3; color: var(--text-default); }
.attachment__size { font-size: 1.4rem; color: var(--text-secondary); }
.attachment__download { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--background-tint); font-size: 2.2rem; color: var(--icon-default); }
@media (hover: hover) and (pointer: fine) {
  .attachment:hover { transform: translateY(-1px); box-shadow: var(--ring-soft), var(--lift-hover); }
}

/* buttons */
.buttons__row { display: flex; align-items: center; gap: 4.8rem; padding: 2.4rem 0; }
.buttons__row + .buttons__row { padding-top: 0; }
.buttons__description { flex: 1; font-size: 1.7rem; line-height: 1.6; color: var(--text-strong); }
.buttons__btn { flex: none; }

/* continue gate */
.gate__btn { height: var(--control-l); font-size: 1.7rem; }
.gate__btn .btn__chip { width: 48px; height: 48px; }
.gate__hint { display: flex; align-items: center; gap: 1.6rem; background: var(--background-surface-subtle); border-radius: 9999px; padding: 1.2rem 2.4rem 1.2rem 1.2rem; font-size: 1.5rem; color: var(--text-secondary); }
.gate__hint > span:last-child { flex: 1; }
.gate__lock { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--background-surface); color: var(--icon-secondary); font-size: 2rem; box-shadow: var(--ring-soft); }
.block--gate.is-open .gate { display: none; }
.block--gate.is-open { padding: 0 !important; }

/* labeled graphic */
.lg { position: relative; --color-lg-accent: var(--brand-primary); }
.lg__canvas { position: relative; width: 100%; }
.lg__img { display: block; width: 100%; height: auto; border-radius: 16px; }
.lg__marker { position: absolute; width: 4.4rem; height: 4.4rem; margin: -2.2rem 0 0 -2.2rem; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; opacity: 0; transform: scale(.6);
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease); transition-delay: calc(var(--i) * 80ms); z-index: 3; }
.is-ready .lg__marker { opacity: 1; transform: none; }
.lg__pin { position: absolute; inset: .6rem; display: grid; place-items: center; border-radius: 50%; background: var(--color-lg-accent); color: #fff; font-size: 1.5rem; font-weight: 600; line-height: 1;
  box-shadow: 0 0 0 4px var(--overlay-white-50), 0 4px 12px rgba(0, 30, 50, .35); transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
/* A marker not yet opened keeps a soft halo; opened ones drop it, so what's left to see stands out. */
.lg__marker.is-active .lg__pin { background: var(--background-surface); color: var(--text-default); box-shadow: 0 0 0 4px var(--color-lg-accent), 0 4px 12px rgba(0, 30, 50, .35); }
.lg__marker.is-visited:not(.is-active) .lg__pin, .is-complete .lg__marker:not(.is-active) .lg__pin { background: var(--text-default); box-shadow: 0 0 0 2px var(--overlay-white-50), 0 4px 12px rgba(0, 30, 50, .3); }
.lg__marker:active .lg__pin { transform: scale(.94); }
@media (prefers-reduced-motion: reduce) { .lg__marker { transition: none; opacity: 1; transform: none; } }
.lg__card { position: absolute; z-index: 5; width: 40rem; max-width: calc(100% - 3.5rem); background: var(--background-surface); border-radius: 20px; box-shadow: var(--shadow-pop); padding: 2.8rem; opacity: 0;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.lg__card.is-open { opacity: 1; }
/* We share one card between markers, so it snaps back before reopening and that snap must not animate. */
.lg__card.is-resetting, .lg__card.is-resetting * { transition: none !important; }
.lg__card::before { content: ""; position: absolute; top: calc(50% - .7rem); border: .7rem solid transparent; }
.lg__card--right { transform: translate(3.5rem, -50%) translateX(-.8rem); }
.lg__card--right.is-open { transform: translate(3.5rem, -50%); }
.lg__card--right::before { left: -1.4rem; border-right-color: var(--background-surface); }
.lg__card--left { transform: translate(calc(-100% - 3.5rem), -50%) translateX(.8rem); }
.lg__card--left.is-open { transform: translate(calc(-100% - 3.5rem), -50%); }
.lg__card--left::before { right: -1.4rem; border-left-color: var(--background-surface); }
.lg__card--below, .lg__card--below.is-open { position: relative; width: 100%; max-width: none; margin-top: 1.6rem; transform: none; box-shadow: var(--ring-soft), var(--shadow-card); }
.lg__card--below::before { display: none; }
.lg__card-head { position: relative; }
.lg__title { font-size: 2rem; font-weight: 600; line-height: 1.25; letter-spacing: -.3px; margin: 0 9.6rem 1.2rem 0; }
.lg__nav { position: absolute; top: -.8rem; right: -1.2rem; display: flex; gap: .2rem; }
.lg__nav-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; font-size: 2.2rem; color: var(--icon-default); transition: background-color var(--dur-fast) var(--ease); }
.lg__nav-btn:active { background: var(--overlay-black-8); }
.lg__description { font-size: 1.6rem; line-height: 1.6; color: var(--text-strong); max-height: 40rem; overflow-y: auto; opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.lg__card.is-open .lg__description { opacity: 1; transition-delay: var(--dur-fast); }
.lg__description p + p { margin-top: 1.2rem; }
@media (hover: hover) and (pointer: fine) {
  .lg__marker:hover:not(.is-active) .lg__pin { box-shadow: 0 0 0 4px var(--background-surface), 0 6px 16px rgba(0, 30, 50, .4); }
  .lg__nav-btn:hover { background: var(--background-tint); }
}

/* process */
/* The parked cards sit well past the edges of the page, so clip them at the block. */
.process { background: var(--background-surface-subtle); padding: 4.8rem 0; overflow-x: clip; }
.process__stage { position: relative; padding: 0 4rem; }
.process__viewport { position: relative; transition: height var(--dur-slow) var(--ease-move); }
.process__track { position: absolute; inset: 0; }
.process__card { position: absolute; top: 0; left: 50%; width: 89rem; max-width: 100%; padding: 2.4rem 0 4rem; opacity: 0;
  transition: transform var(--dur-slow) var(--ease-move), opacity var(--dur-slow) var(--ease-move); }
.process__card.is-active, .process__card.is-beside { opacity: 1; }
.process__card.is-beside { opacity: .5; }
.process__card-inner { background: var(--background-surface); border-radius: var(--radius-card); box-shadow: var(--ring-soft), var(--shadow-card); min-height: 38rem; padding: 6.4rem 7rem 7.2rem; }
.process__card--intro .process__card-inner, .process__card--summary .process__card-inner { text-align: center; padding: 7.2rem 7rem; }
.process__chip { position: absolute; top: 2.4rem; left: 50%; transform: translate(-50%, -50%); z-index: 2; background: var(--background-brand); color: #fff; font-size: 1.4rem; font-weight: 600; line-height: 1.2; padding: .9rem 1.8rem; border-radius: 9999px; box-shadow: var(--lift); max-width: 90%; white-space: nowrap; }
.process__title { font-size: 2.6rem; font-weight: 600; line-height: 1.15; letter-spacing: -.6px; margin-bottom: 2rem; }
.process__media { margin: 0 0 2.4rem; }
.process__media img { display: block; max-height: 60rem; width: auto; max-width: 100%; margin: 0 auto; border-radius: 12px; }
.process__description { line-height: 1.6; }
.process__description p + p { margin-top: 1.5rem; }
.process__description em { color: var(--text-secondary); }
.process__start { margin-top: 3.2rem; }
.process__arrow { position: absolute; top: 16rem; display: grid; place-items: center; width: 5.6rem; height: 5.6rem; padding: 0; border-radius: 50%; border: 0; background: var(--button-fill-background); color: var(--button-fill-text); cursor: pointer; font-size: 2.6rem; z-index: 3;
  transition: opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-lift) var(--ease); }
.process__arrow:active { transform: scale(.94); background: var(--button-fill-background-pressed); }
.process__arrow--prev { left: max(2rem, 50% - 57.5rem); } .process__arrow--next { right: max(2rem, 50% - 57.5rem); }
.process__arrow:disabled { opacity: 0; pointer-events: none; }
.process__counter { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin: 3.2rem 0 0; padding: 0; }
.process__dot { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; padding: 0; border-radius: 50%; border: 0; background: none; color: var(--text-tertiary); font-family: var(--font-ui); font-size: 1.4rem; font-weight: 600; cursor: pointer; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.process__dot.is-active { background: var(--background-selected); color: var(--text-default); }
.process__dot.is-done { color: var(--text-default); }
.process__dot--end { font-size: 1.6rem; }
@media (hover: hover) and (pointer: fine) {
  .process__arrow:hover { background: var(--button-fill-background-hover); box-shadow: var(--lift-fill-hover); }
  .process__dot:hover:not(.is-active) { background: var(--background-hover); color: var(--text-default); }
}

/* flashcards */
.flashcards { display: flex; flex-wrap: nowrap; justify-content: center; gap: 3.2rem; }
.flashcard { position: relative; flex: 1 1 0; min-width: 0; max-width: 28rem; aspect-ratio: 1; padding: 0; border: 0; border-radius: 24px; background: none; cursor: pointer; perspective: 100rem; text-align: center; }
.flashcard__side { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--background-surface); border-radius: 24px; box-shadow: var(--ring-soft), var(--shadow-card); backface-visibility: hidden; transition: transform var(--dur-page) var(--ease-move); overflow: hidden; }
.flashcard__side--front { transform: rotateY(0); }
.flashcard__side--back { transform: rotateY(180deg); background: var(--background-brand-subtle); box-shadow: none; }
.flashcard.is-flipped .flashcard__side--front { transform: rotateY(-180deg); }
.flashcard.is-flipped .flashcard__side--back { transform: rotateY(0); }
.flashcard__title { display: block; padding: 2.4rem 2rem 0; font-size: 2rem; font-weight: 600; line-height: 1.25; letter-spacing: -.3px; color: var(--text-default); }
.flashcard__img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: 1.6rem 2.5rem 2.5rem; }
.flashcard__side--fullimage .flashcard__img { padding: 0; height: 100%; object-fit: contain; }
.flashcard__text { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 2.4rem; font-size: 1.9rem; font-weight: 500; line-height: 1.4; color: var(--text-default); }
.flashcard__flip { position: absolute; right: 1.2rem; bottom: 1.2rem; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--background-tint); color: var(--icon-default); font-size: 2rem; transition: transform var(--dur-base) var(--ease); }
.flashcard:active .flashcard__side { scale: var(--press-scale); }
@media (hover: hover) and (pointer: fine) { .flashcard:hover .flashcard__flip { transform: rotate(-30deg); } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 21, 29, .88); display: flex; align-items: center; justify-content: center; padding: 4rem; cursor: zoom-out; opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.lightbox.is-open { opacity: 1; }
.lightbox__img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow-sheet); transform: scale(.98); transition: transform var(--dur-slow) var(--ease); }
.lightbox.is-open .lightbox__img { transform: none; }

/* ---------- sign-in ---------- */
.sign-in__card { display: flex; flex-direction: column; }
.sign-in__heading { font-size: 2.6rem; font-weight: 600; line-height: 1.15; letter-spacing: -.6px; margin-bottom: .8rem; }
.sign-in__intro { color: var(--text-secondary); font-size: 1.6rem; line-height: 1.5; margin: 0 0 2.8rem; }
.sign-in__alert { display: flex; gap: .8rem; align-items: flex-start; color: var(--text-error); font-size: 1.5rem; line-height: 1.4; margin: -1.2rem 0 2.4rem; animation: errIn var(--dur-base) var(--ease); }
.sign-in__alert::before { content: ""; flex: none; width: 2rem; height: 2rem; background: currentColor; mask: var(--icon-error) center / contain no-repeat; }
@keyframes errIn { from { opacity: 0; transform: translateY(-6px); } }
.sign-in__label { display: block; font-size: 1.4rem; font-weight: 600; line-height: 1.3; color: var(--text-strong); margin-bottom: .8rem; }
.sign-in__help { color: var(--text-secondary); font-size: 1.4rem; line-height: 1.45; text-align: center; margin: 2.4rem 0 0; }
.sign-in__stay { display: block; color: var(--text-link); font-size: 1.5rem; text-align: center; margin-top: 1.6rem; }
:root { --icon-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm0-160q17 0 28.5-11.5T520-480v-160q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640v160q0 17 11.5 28.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140Z'/%3E%3C/svg%3E"); }

/* htpoc's web field: 60 px, the label inside, moving up once the field has focus or a value; a 2 px border-action edge on focus, no halo. */
.field { position: relative; margin-bottom: 2.4rem; }
.field__input { display: block; width: 100%; height: 60px; padding: 2.2rem 1.6rem .6rem; border: 1px solid var(--border-default); border-radius: var(--radius-field); background: var(--background-surface); box-shadow: var(--field-rest);
  font: inherit; font-size: 1.7rem; color: var(--text-strong); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.field__input::placeholder { color: transparent; }
.field__label { position: absolute; left: 1.7rem; right: 1.6rem; top: 30px; transform: translateY(-50%); transform-origin: 0 50%; font-size: 1.7rem; line-height: 1.2; color: var(--text-tertiary); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.field__input:focus + .field__label, .field__input:not(:placeholder-shown) + .field__label, .field__input[readonly] + .field__label { transform: translateY(calc(-50% - 13.2px)) scale(.765); color: var(--text-secondary); }
.field__input:focus { outline: none; border-color: var(--border-action); box-shadow: inset 0 0 0 1px var(--border-action); }
.field--error .field__input, .field--error .field__input:focus { border-color: var(--border-error); box-shadow: inset 0 0 0 1px var(--border-error); }
.field--error .field__label { color: var(--text-error) !important; }
.field__input[readonly] { color: var(--text-secondary); border-color: var(--border-subtle); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .field__input:hover:not(:focus):not([readonly]) { border-color: var(--icon-secondary); } }

/* Four PIN boxes, as htpoc's code boxes. A password field draws its dot at the font size. */
.sign-in__pin { display: grid; grid-template-columns: repeat(4, minmax(0, 6.4rem)); gap: .8rem; margin-bottom: 3.2rem; }
.sign-in__digit { width: 100%; height: 60px; padding: 0; text-align: center; font: inherit; font-size: 2.6rem; font-weight: 500; color: var(--text-default);
  border: 1px solid var(--border-default); border-radius: var(--radius-field); background: var(--background-surface); box-shadow: var(--field-rest); caret-color: var(--border-action);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.sign-in__digit.is-filled { background: var(--background-surface-subtle); }
.sign-in__digit:focus { outline: none; border-color: var(--border-action); box-shadow: inset 0 0 0 1px var(--border-action); }
.sign-in__card[data-pin-error-value="invalid"] .sign-in__digit:not(.is-filled), .sign-in__card[data-pin-error-value="locked"] .sign-in__digit:not(.is-filled) { border-color: var(--border-error); }
.sign-in__pin.is-shaking { animation: pin-shake .36s var(--ease-move) both; }
@keyframes pin-shake {
  20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) { .sign-in__pin.is-shaking { animation: none; } }
/* "Signing in…": the arrow in the chip becomes a spinner while the form is on its way. */
.sign-in__submit { margin-top: .4rem; }
.sign-in__spinner { display: none; width: 2rem; height: 2rem; border: 2.5px solid color-mix(in srgb, currentColor 28%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
.sign-in__submit.is-busy { cursor: progress; }
.sign-in__submit.is-busy .sign-in__spinner { display: block; }
.sign-in__submit.is-busy .btn__chip .icon { visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

/* who's signed in, on the cover and at the foot of the sidebar */
.account { display: flex; align-items: center; gap: 1.2rem; font-size: 1.4rem; color: var(--text-secondary); }
.account__form { display: inline; margin: 0; }
.account__sign-out { position: relative; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--text-link);
  background: linear-gradient(var(--border-default), var(--border-default)) no-repeat 0 100% / 0 1.5px; transition: background-size var(--dur-slow) var(--ease), opacity var(--dur-fast) var(--ease); }
.account__sign-out:active { opacity: .64; }
.account--cover .account__form { display: flex; }
.account--sidebar { padding: 1.6rem 2.4rem 2.4rem; justify-content: space-between; }
@media (hover: hover) and (pointer: fine) {
  .account__sign-out:hover, :where(.text__body, .image-aside__text, .process__description, .note__body, .lg__description, .quiz__feedback, .quiz__hint, .sim__task-text, .buttons__description, .steps__detail, .cover__description, .sign-in__help, .legend__text) a:hover { background-size: 100% 1.5px; }
  .sign-in__stay:hover { opacity: .8; }
}

/* ---------- quiz ---------- */
/* Right and wrong, one set for the whole quiz: answers, pips and the dial draw from these. Always with a word or a tick or cross. */
.quiz {
  --quiz-right: var(--text-success); --quiz-right-tint: var(--background-success-subtle);
  --quiz-wrong: var(--text-error); --quiz-wrong-tint: #fbe5ef;
  --quiz-icon-why: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-80q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM360-200q-17 0-28.5-11.5T320-240q0-17 11.5-28.5T360-280h240q17 0 28.5 11.5T640-240q0 17-11.5 28.5T600-200H360Zm-30-120q-69-41-109.5-110T180-580q0-125 87.5-212.5T480-880q125 0 212.5 87.5T780-580q0 81-40.5 150T630-320H330Zm24-80h252q45-32 69.5-79T720-580q0-100-70-170t-170-70q-100 0-170 70t-70 170q0 54 24.5 101t69.5 79Z'/%3E%3C/svg%3E");
  --quiz-icon-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m378-332 363-363q9.27-9 21.64-9 12.36 0 21.36 9.05 9 9.06 9 21.5 0 12.45-9 21.45L399-267q-9 9-21 9t-21-9L175-449q-9-9.07-8.5-21.53.5-12.47 9.55-21.47 9.06-9 21.5-9 12.45 0 21.45 9l159 160Z'/%3E%3C/svg%3E");
  --quiz-icon-wrong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-438 270-228q-9 9-21 9t-21-9q-9-9-9-21t9-21l210-210-210-210q-9-9-9-21t9-21q9-9 21-9t21 9l210 210 210-210q9-9 21-9t21 9q9 9 9 21t-9 21L522-480l210 210q9 9 9 21t-9 21q-9 9-21 9t-21-9L480-438Z'/%3E%3C/svg%3E");
}
.quiz { background: var(--background-surface); border-radius: var(--radius-card); box-shadow: var(--ring-soft), var(--shadow-card); padding: 4.8rem 4.8rem 4rem; }
.quiz__questions { list-style: none; margin: 0; padding: 0; counter-reset: question; }
.quiz__question { counter-increment: question; padding: 0 0 4rem; margin: 0 0 4rem; border-bottom: 1px solid var(--border-subtle); }
.quiz__question:last-child { margin-bottom: 3.2rem; }
.quiz__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.quiz__prompt { display: flex; width: 100%; gap: 1.4rem; font-size: 2rem; font-weight: 600; line-height: 1.35; letter-spacing: -.3px; color: var(--text-default); margin-bottom: 2rem; padding: 0; }
.quiz__prompt::before { content: counter(question); flex: none; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-top: -.2rem; border-radius: 50%; background: var(--background-brand-subtle); color: var(--text-action); font-size: 1.4rem; letter-spacing: 0; }
.quiz__hint { color: var(--text-secondary); font-size: 1.5rem; margin: -.8rem 0 1.6rem 4.6rem; }
.quiz__hint p { margin: 0; }
.quiz__image { display: block; max-width: 100%; max-height: 40rem; margin: 0 0 1.6rem; border-radius: 16px; }
.quiz__feedback p { margin: 0; }
.quiz__feedback p + p { margin-top: 1rem; }
/* Options as htpoc draws them: surface rows with ring-soft and lift; selected is a fill. The hidden input covers the whole row. */
.quiz__choice { position: relative; display: flex; align-items: flex-start; gap: 1.4rem; padding: 1.5rem 1.8rem; margin-bottom: 1rem; border-radius: 16px; background: var(--background-surface); box-shadow: var(--ring-soft), var(--lift);
  cursor: pointer; font-size: 1.6rem; line-height: 1.5; color: var(--text-default);
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.quiz__input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; appearance: none; border-radius: inherit; cursor: pointer; }
.quiz__mark { position: relative; flex: none; width: 2.2rem; height: 2.2rem; margin-top: .1rem; border: 2px solid var(--border-default); border-radius: 50%; background: var(--background-surface); transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.quiz__input[type="checkbox"] + .quiz__mark { border-radius: 6px; }
.quiz__input:checked + .quiz__mark { border-color: var(--text-default); background: var(--text-default); box-shadow: inset 0 0 0 3.5px var(--background-selected); }
.quiz__input[type="checkbox"]:checked + .quiz__mark { box-shadow: none; }
.quiz__input[type="checkbox"]:checked + .quiz__mark::after { content: ""; position: absolute; inset: 1px; background: #fff; mask: var(--quiz-icon-right) center / contain no-repeat; }
.quiz__choice:has(.quiz__input:checked) { background: var(--background-selected); box-shadow: var(--lift-selected); }
.quiz__choice:has(.quiz__input:focus-visible) { outline: 2px solid var(--border-action); outline-offset: 2px; }
.quiz__choice:active:has(.quiz__input:not(:disabled)) { transform: scale(var(--press-scale)); }
.quiz__input:disabled, .quiz__choice:has(.quiz__input:disabled) { cursor: default; }
.quiz__choice:has(.quiz__input:disabled:not(:checked)) { color: var(--text-secondary); box-shadow: var(--ring-soft); }
.quiz__feedback { position: relative; font-size: 1.5rem; line-height: 1.55; margin: 1.6rem 0 0; padding: 1.4rem 1.8rem 1.4rem 5.2rem; border-radius: 16px; background: var(--background-surface-subtle); color: var(--text-default); }
.quiz__feedback::before { content: ""; position: absolute; left: 1.6rem; top: 1.5rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; }
/* The verdict sits on the answer picked; the explanation is the right answer either way, so it stays neutral
   (a cross beside it read as the explanation being wrong). The right answer isn't shown: Try again would be a giveaway. */
.quiz__question:is(.is-correct, .is-incorrect) .quiz__feedback::before { background: var(--icon-secondary); mask: var(--quiz-icon-why) center / contain no-repeat; }
.quiz__question.is-correct .quiz__choice:has(.quiz__input:checked) { background: var(--quiz-right-tint); box-shadow: inset 0 0 0 1.5px var(--quiz-right); color: var(--text-default); }
.quiz__question.is-incorrect .quiz__choice:has(.quiz__input:checked) { background: var(--quiz-wrong-tint); box-shadow: inset 0 0 0 1.5px var(--quiz-wrong); color: var(--text-default); }
.quiz__question.is-correct .quiz__input:checked + .quiz__mark { border-color: var(--quiz-right); background: var(--quiz-right); box-shadow: inset 0 0 0 3.5px var(--quiz-right-tint); }
.quiz__question.is-incorrect .quiz__input:checked + .quiz__mark { border-color: var(--quiz-wrong); background: var(--quiz-wrong); box-shadow: inset 0 0 0 3.5px var(--quiz-wrong-tint); }
.quiz__question:is(.is-correct, .is-incorrect) .quiz__input[type="checkbox"]:checked + .quiz__mark { box-shadow: none; }
/* Skipped when they submitted: a soft wash behind the question and a word on the prompt. It is a layer behind, so nothing moves. */
.quiz__question { position: relative; isolation: isolate; }
.quiz__question::before { content: ""; position: absolute; z-index: -1; inset: -2rem -2.4rem 2rem; border-radius: 20px; background: var(--quiz-wrong-tint); opacity: 0; transition: opacity var(--dur-base) var(--ease); pointer-events: none; }
.quiz__question.is-unanswered::before { opacity: 1; }
.quiz__question.is-unanswered .quiz__prompt::before { background: var(--background-surface); color: var(--text-error); }
.quiz__missing { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: .6rem; margin-left: auto; padding-top: .3rem; color: var(--text-error); font-size: 1.4rem; font-weight: 600; letter-spacing: 0; line-height: 1.4; white-space: nowrap; }
.quiz__missing::before { content: ""; width: 1.8rem; height: 1.8rem; background: currentColor; mask: var(--icon-error) center / contain no-repeat; }
.quiz__question.is-correct .quiz__prompt::after,
.quiz__question.is-incorrect .quiz__prompt::after { content: ""; flex: none; width: 2.6rem; height: 2.6rem; margin: 0 0 0 auto; mask: var(--quiz-icon-right) center / contain no-repeat; background: var(--quiz-right); }
.quiz__question.is-incorrect .quiz__prompt::after { mask-image: var(--quiz-icon-wrong); background: var(--quiz-wrong); }
.quiz__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem 2.4rem; }
.quiz__status { flex: 1 1 24rem; margin: 0; font-size: 1.6rem; line-height: 1.5; font-weight: 500; color: var(--text-strong); }
.quiz.is-passed .quiz__status { color: var(--text-default); font-weight: 600; }
.quiz[aria-busy="true"] .quiz__submit { opacity: .6; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .quiz__choice:hover:not(:has(.quiz__input:checked)):not(:has(.quiz__input:disabled)) { transform: translateY(-1px); box-shadow: var(--ring-soft), var(--lift-hover); }
  .quiz__choice:active:has(.quiz__input:not(:disabled)) { transform: scale(var(--press-scale)); }
}

/* The result reveal. One pip per question turns right or wrong in turn, then the dial sweeps and counts up to the
   score towards a labelled notch at the pass mark. A pass bursts; then the message appears. The script sets --n
   (questions), --pct (score %) and --pass (pass mark %) on the footer; every delay follows from those. */
@property --quiz-count { syntax: "<integer>"; inherits: false; initial-value: 0; }
.quiz__footer {
  --quiz-lead: .35s;  /* lets the page finish scrolling to the footer */
  --quiz-step: min(110ms, calc(1200ms / var(--n, 1)));
  --quiz-dial: calc(var(--quiz-lead) + var(--n, 0) * var(--quiz-step) + .15s);
  --quiz-verdict: calc(var(--quiz-dial) + 1.2s);
}
.quiz__result { flex: 1 0 100%; display: flex; align-items: center; gap: 2.8rem; padding: 0 0 .8rem 4.4rem; }
.quiz__dial { position: relative; flex: none; width: 12rem; height: 12rem; animation: quiz-dial-in var(--dur-page) var(--ease) calc(var(--quiz-dial) - .2s) backwards; }
.quiz__ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.quiz__ring circle { fill: none; stroke-width: 8; }
.quiz__ring-track { stroke: var(--overlay-black-8); }
.quiz__ring-arc { stroke: var(--quiz-right); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--pct, 0)); animation: quiz-sweep 1.2s var(--ease) var(--quiz-dial) backwards; }
.quiz__result.is-fail .quiz__ring-arc { stroke: var(--brand-primary); }
/* A zero score has no arc to draw; a round cap would still leave a dot. */
.quiz__result[style*="--pct: 0;"] .quiz__ring-arc { visibility: hidden; }
.quiz__notch { position: absolute; inset: 0; transform: rotate(calc(var(--pass, 80) * 3.6deg)); pointer-events: none; }
.quiz__notch::before { content: ""; position: absolute; left: calc(50% - .15rem); top: -.5rem; width: .3rem; height: 1.8rem; border-radius: .2rem; background: var(--text-strong); }
/* Sits just past the notch, whatever the pass mark. */
.quiz__pass { --angle: calc(var(--pass, 80) * 3.6deg); position: absolute; left: calc(50% + 6.9rem * sin(var(--angle))); top: calc(50% - 6.9rem * cos(var(--angle))); transform: translate(calc(-50% + 50% * sin(var(--angle))), calc(-50% - 50% * cos(var(--angle)))); font-size: 1.2rem; font-weight: 600; line-height: 1.2; text-align: center; color: var(--text-secondary); white-space: nowrap; }
.quiz__count { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.quiz__count b { --quiz-count: var(--score, 0); counter-reset: quiz-count var(--quiz-count); font-size: 3.8rem; font-weight: 600; letter-spacing: -.03em; color: var(--text-default); animation: quiz-count 1.2s var(--ease) var(--quiz-dial) backwards; }
.quiz__count b::before { content: counter(quiz-count); }
.quiz__count small { margin-top: .4rem; color: var(--text-secondary); font-size: 1.3rem; font-weight: 500; }
.quiz__burst { position: absolute; inset: 0; pointer-events: none; }
.quiz__burst i { position: absolute; left: calc(50% - .4rem); top: calc(50% - .4rem); width: .8rem; height: .8rem; border-radius: 50%; opacity: 0; }
.quiz__burst i:nth-child(3n) { background: var(--quiz-right); }
.quiz__burst i:nth-child(3n + 1) { background: var(--brand-primary); }
.quiz__burst i:nth-child(3n + 2) { background: var(--brand-tertiary); }
.quiz__result.is-pass .quiz__burst i { animation: quiz-burst var(--dur-page) var(--ease) var(--quiz-verdict); }
.quiz__pips { display: flex; flex-wrap: wrap; gap: 2.4rem .8rem; list-style: none; margin: 0; padding: 0 0 1.6rem; counter-reset: quiz-pip; }
.quiz__pip { counter-increment: quiz-pip; position: relative; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; color: #fff; animation: quiz-pip var(--dur-base) var(--ease) calc(var(--quiz-lead) + var(--i) * var(--quiz-step)) backwards; }
.quiz__pip.is-correct { background: var(--quiz-right-tint); color: var(--quiz-right); }
.quiz__pip.is-incorrect { background: var(--quiz-wrong-tint); color: var(--quiz-wrong); }
.quiz__pip::before { content: ""; width: 1.8rem; height: 1.8rem; mask: var(--quiz-icon-right) center / contain no-repeat; background: currentColor; }
.quiz__pip.is-incorrect::before { mask-image: var(--quiz-icon-wrong); }
.quiz__pip::after { content: counter(quiz-pip); position: absolute; top: calc(100% + .4rem); left: 0; right: 0; text-align: center; color: var(--text-secondary); font-size: 1.1rem; font-weight: 600; }
.quiz.is-graded .quiz__status, .quiz.is-graded .quiz__retry { animation: quiz-rise var(--dur-page) var(--ease) calc(var(--quiz-verdict) + .15s) backwards; }
@keyframes quiz-pip { from { transform: scale(.4); opacity: 0; } }
@keyframes quiz-dial-in { from { opacity: 0; transform: scale(.92); } }
@keyframes quiz-sweep { from { stroke-dashoffset: 100; } }
@keyframes quiz-count { from { --quiz-count: 0; } }
@keyframes quiz-burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(-4rem) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-8rem) scale(.3); } }
@keyframes quiz-rise { from { opacity: 0; transform: translateY(var(--enter-distance)); } }
@media (prefers-reduced-motion: reduce) {
  .quiz__result *, .quiz.is-graded .quiz__status, .quiz.is-graded .quiz__retry { animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); background: var(--background-page); border-radius: 0 28px 28px 0; }
  .lesson__content { margin: 0; min-height: 100vh; border-radius: 0; box-shadow: none; }
  .lesson__menu-btn, .lesson--nav-closed .lesson__menu-btn { top: 1.2rem; left: 1.2rem; }
  .lesson--nav-mobile-open .sidebar { transform: none; box-shadow: var(--shadow-sheet); }
  /* the menu button stays on top as the close toggle, so the header starts below it */
  .sidebar__header { padding-top: 7.2rem; min-height: 18.4rem; }
  .sidebar__search-btn { top: 1.2rem; }
  .sidebar__search { top: 6.4rem; }
  .lesson--nav-mobile-open .sidebar__scrim { display: block; position: fixed; inset: 0; background: var(--background-scrim-strong); z-index: 15; animation: scrimIn var(--dur-slow) var(--ease); }
  .block__inner, .lesson-header__inner, .image-full__inner { padding-left: 3rem; padding-right: 3rem; }
  .process__stage { padding: 0 2rem; }
  .gallery__arrow--prev { left: -2.4rem; } .gallery__arrow--next { right: -2.4rem; }
  .process__arrow { width: 4.8rem; height: 4.8rem; font-size: 2.4rem; }
  .process__arrow--prev { left: .8rem; } .process__arrow--next { right: .8rem; }
  .process__card { width: 100%; }
}
@keyframes scrimIn { from { opacity: 0; } }
@media (max-width: 700px) {
  .block__inner, .lesson-header__inner, .image-full__inner { padding-left: 2rem; padding-right: 2rem; }
  .block__inner > *, .lesson-header__inner > * { margin-left: 0; max-width: none; }
  .lesson-header { padding-top: 7.2rem; }
  .lesson-header__inner { padding-bottom: 4.8rem; }
  .lesson-header__title { font-size: 3rem; letter-spacing: -.8px; }
  .lesson-header__description { font-size: 1.7rem; }
  .text__heading { font-size: 2.4rem; letter-spacing: -.5px; }
  .text__subheading { font-size: 2rem; }
  .text__body, .image-aside__text, .process__description { font-size: 1.7rem; line-height: 1.6; }
  .image-aside, .image-aside--reverse .image-aside { flex-direction: column; gap: 2rem; margin-left: 0; margin-right: 0; width: 100%; }
  .image-aside__text, .image-aside--reverse .image-aside__text { padding-left: 0; padding-right: 0; }
  .image-aside__figure { flex-basis: auto; width: 100%; }
  .process { padding: 4rem 0; }
  .process__stage { padding: 0 1rem; }
  .gallery__arrow--prev { left: -1rem; } .gallery__arrow--next { right: -1rem; }
  .process__card { padding: 2.4rem 0 2rem; width: 100%; }
  .process__card-inner, .process__card--intro .process__card-inner, .process__card--summary .process__card-inner { padding: 4.8rem 2.4rem 3.2rem; }
  .process__arrow { top: auto; bottom: -5.6rem; width: 4.4rem; height: 4.4rem; }
  .buttons__row { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .flashcards { flex-wrap: wrap; gap: 2rem; }
  .flashcard { width: 100%; max-width: 32rem; flex-basis: 100%; }
  .image-full__text { font-size: 2.2rem; margin: 6rem 0; }
  .quiz { padding: 3.2rem 2rem 2.8rem; }
  .quiz__prompt { font-size: 1.8rem; }
  .quiz__hint { margin-left: 0; }
  .quiz__result { padding-left: 2.4rem; gap: 2rem; }
  .sim__task { flex-direction: column; gap: 1rem; padding: 1.6rem 1.8rem; }
  .lesson-footer__title { font-size: 2.2rem; }
  .cover__body { padding-top: 4rem; padding-left: 1.2rem; padding-right: 1.2rem; }
  .cover__start { flex: 1; }
}

/* ---------- diagrams (block diagram/<name>, app/views/diagrams) ---------- */
/* They lay out by their own width, not the window's: the sidebar changes how much room a lesson has. */
.diagram { container-type: inline-size; }
.diagram__heading { margin-bottom: 2.4rem; }
/* One line under a diagram's heading saying how to read it, the same for every diagram. */
.diagram__lede { margin: -1.2rem 0 3.6rem; font-size: 1.8rem; line-height: 1.4; color: var(--text-secondary); }
/* The step-by-step rail needs more room below its line than the big picture does. */
.diagram__lede:has(+ .system) { margin-bottom: 2.4rem; }
.diagram .icon { width: 2.4rem; height: 2.4rem; }

/* "How it fits together": the location's three pieces in a row, then HealthTab and what happens after it side by side; one column on a narrow lesson. */
.system { --sys-card-shadow: var(--ring-soft), var(--lift);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.system__zone { display: flex; flex-direction: column; padding: 2rem; border-radius: 2.4rem; background: var(--background-page); }
.system__zone--cloud { background: var(--background-brand-subtle); }
.system__label { margin: 0 0 1.4rem; font-size: 1.2rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.system__zone--cloud .system__label { color: var(--text-default); }
.system__chain { display: flex; flex-direction: column; align-items: stretch; }
.system__stack { display: flex; flex-direction: column; gap: 1.2rem; flex: 1; }
.system__card { display: flex; gap: 1.6rem; align-items: flex-start; padding: 1.8rem; background: var(--background-surface); border-radius: 2rem; box-shadow: var(--sys-card-shadow); font-size: 1.5rem; line-height: 1.45; color: var(--text-secondary); }
.system__card strong { display: block; margin-bottom: .4rem; font-size: 1.7rem; line-height: 1.25; color: var(--text-default); }
.system__stack .system__card { flex: 1; }
.system__icon { flex: none; display: flex; width: 4.8rem; height: 4.8rem; align-items: center; justify-content: center; border-radius: 50%; background: var(--background-brand-subtle); color: var(--brand-primary); }
.system__icon > svg { width: 55%; height: 55%; }
.system__icon--solid { width: 5.2rem; height: 5.2rem; background: var(--brand-primary); color: #fff; }
.system__icon--small { width: 3rem; height: 3rem; }
.system__link { align-self: flex-start; width: 0; height: 2.4rem; margin-left: 4.2rem; border-left: .2rem dashed var(--border-default); }
.system__arrow { display: flex; justify-content: center; color: var(--brand-primary); }
.system__arrow > svg { width: 3.2rem; height: 3.2rem; transform: rotate(90deg); }
.system__card--platform { flex-direction: column; gap: 1.6rem; flex: 1; box-shadow: var(--ring-soft), var(--shadow-card); }
.system__platform-head { display: flex; align-items: center; gap: 1.6rem; }
.system__platform-head strong { margin: 0; font-size: 1.9rem; }
.system__points { list-style: none; margin: 0; padding: 1.6rem 0 0; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 1.2rem; }
.system__points li { display: flex; gap: 1.2rem; align-items: flex-start; }

@container (min-width: 640px) {
  .system { grid-template-columns: minmax(0, 1fr) 5.6rem minmax(0, 1fr); grid-template-areas: "here here here" "down . ." "cloud right after"; gap: 0; }
  .system__zone--here { grid-area: here; }
  .system__arrow--down { grid-area: down; padding: 1.2rem 0; }
  .system__zone--cloud { grid-area: cloud; }
  .system__arrow--right { grid-area: right; align-self: center; }
  .system__arrow--right > svg { transform: none; }
  .system__zone--after { grid-area: after; }
  .system__chain { flex-direction: row; }
  .system__chain .system__card { flex: 1 1 0; min-width: 0; flex-direction: column; }
  .system__link { align-self: center; width: 2.4rem; height: 0; margin: 0 .8rem; border-left: 0; border-top: .2rem dashed var(--border-default); }
}

/* Follow the result (system_flow_controller): each zone's cards rise in when the zone is on screen, then a
   result travels through once. A dot runs along each link as its line draws in brand colour, and the card it
   reaches answers with one soft ring; the arrows slide in along their direction. --<zone>-flow is when that
   zone's travel starts, set by the controller so a zone waits for the one before it. Without .is-armed (no
   script, reduced motion) everything shows its final state: drawn links, arrows in place, no dot, no ring. */
.system { --hop: var(--dur-page); --stagger: 90ms; --rise: 1.2rem; --top-flow: 0ms; --bottom-flow: 0ms; --after-flow: 0ms; }
.system__chain > .system__card { position: relative; z-index: 1; }
.system__link { position: relative; --fill-x: 1; --fill-y: 0; --run-x: 0; --run-y: 2.4rem; }
.system__link::before { content: ""; position: absolute; left: -.2rem; top: 0; width: .2rem; height: 100%; background: var(--brand-primary); transform-origin: top; }
.system__link::after { content: ""; position: absolute; left: -.5rem; top: -.4rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--brand-primary);
  box-shadow: 0 0 0 .4rem var(--background-brand-subtle); opacity: 0; }
.system__icon:not(.system__icon--small) { position: relative; }
.system__icon:not(.system__icon--small)::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: .2rem solid var(--brand-primary); opacity: 0; pointer-events: none; }
.system__arrow { --from-x: 0; --from-y: -1.2rem; }

.system.is-armed :is(.system__card, .system__arrow), .system.is-armed .system__link { opacity: 0; }
.system.is-armed .system__link::before { transform: scale(var(--fill-x), var(--fill-y)); }

/* Rise: top row staggered, then HealthTab, then the two after the session. */
.system.is-in-top .system__chain > .system__card { animation: sys-rise var(--dur-page) var(--ease) calc(var(--d) / 2 * var(--stagger)) both; }
.system.is-in-top .system__link { animation: sys-fade var(--dur-page) var(--ease) calc(var(--d) / 2 * var(--stagger)) both; }
.system.is-in-bottom .system__card--platform { animation: sys-rise var(--dur-page) var(--ease) both; }
.system.is-in-after .system__stack .system__card { animation: sys-rise var(--dur-page) var(--ease) calc(var(--i) * var(--stagger)) both; }

/* Travel: analyser → router → kiosk, one hop each. */
.system.is-in-top .system__link::before { animation: sys-draw var(--hop) var(--ease-move) calc(var(--top-flow) + (var(--d) - 1) / 2 * var(--hop)) both; }
.system.is-in-top .system__link::after { animation: sys-run var(--hop) var(--ease-move) calc(var(--top-flow) + (var(--d) - 1) / 2 * var(--hop)) both; }
.system.is-in-top .system__chain > .system__card .system__icon::after { animation: sys-ring var(--dur-page) var(--ease) calc(var(--top-flow) + var(--d) / 2 * var(--hop)) both; }
/* … down to HealthTab … */
.system.is-in-bottom .system__arrow--down { animation: sys-arrow var(--hop) var(--ease) var(--bottom-flow) both; }
.system.is-in-bottom .system__card--platform .system__icon::after { animation: sys-ring var(--dur-page) var(--ease) calc(var(--bottom-flow) + var(--hop)) both; }
/* … and on to the patient and their providers. */
.system.is-in-after .system__arrow--right { animation: sys-arrow var(--hop) var(--ease) var(--after-flow) both; }
.system.is-in-after .system__stack .system__icon::after { animation: sys-ring var(--dur-page) var(--ease) calc(var(--after-flow) + var(--hop) + var(--i) * var(--stagger)) both; }

@keyframes sys-rise { from { opacity: 0; transform: translateY(var(--rise)); } to { opacity: 1; transform: none; } }
@keyframes sys-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sys-draw { from { transform: scale(var(--fill-x), var(--fill-y)); } to { transform: none; } }
@keyframes sys-run { 0% { opacity: 0; transform: none; } 20%, 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--run-x), var(--run-y)); } }
@keyframes sys-ring { from { opacity: .5; transform: scale(1); } to { opacity: 0; transform: scale(1.45); } }
@keyframes sys-arrow { from { opacity: 0; transform: translate(var(--from-x), var(--from-y)); } to { opacity: 1; transform: none; } }

@container (min-width: 640px) {
  .system__link { --fill-x: 0; --fill-y: 1; --run-x: 4rem; --run-y: 0; }
  /* the dot leaves from under one card's edge and slips under the next, across the link's margins */
  .system__link::before { left: 0; top: -.2rem; width: 100%; height: .2rem; transform-origin: left; }
  .system__link::after { left: -1.2rem; top: -.5rem; }
  .system__arrow--right { --from-x: -1.2rem; --from-y: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .system *, .system *::before, .system *::after { animation: none !important; }
  .system .system__link::after { opacity: 0; }
}

/* "How a session works": steps as tabs on a rail, one panel open. */
.steps { --step: 7.2rem; position: relative; }

.steps__rail { position: relative; display: grid; grid-template-columns: repeat(var(--count, 6), minmax(0, 1fr)); gap: .8rem; margin-bottom: 2.4rem; }
.steps__line { position: absolute; top: calc(var(--step) / 2); left: calc(100% / 12); right: calc(100% / 12); height: .3rem; margin-top: -.15rem; border-radius: .2rem; background: var(--overlay-black-8);
  transform-origin: left; transform: scaleX(0); transition: transform var(--dur-page) var(--ease-move) .1s; }
.steps.is-in .steps__line { transform: none; }
.steps__line-fill { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--brand-primary); transform-origin: left; transform: scaleX(0); transition: transform var(--dur-page) var(--ease-move); }
.steps__step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 0 .2rem .4rem; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-align: center; opacity: 0; transform: translateY(var(--enter-distance)); }
.steps.is-in .steps__step { animation: step-in var(--dur-page) var(--ease) forwards; animation-delay: calc(.25s + var(--i, 0) * 70ms); }
@keyframes step-in { to { opacity: 1; transform: none; } }
.steps__circle { position: relative; display: flex; width: var(--step); height: var(--step); align-items: center; justify-content: center; border-radius: 50%; background: var(--background-surface); color: var(--brand-primary);
  box-shadow: var(--ring-soft), var(--shadow-card); transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), transform var(--dur-lift) var(--ease), box-shadow var(--dur-lift) var(--ease); }
.steps__circle > svg { width: 46%; height: 46%; }
.steps__step:focus-visible { outline: none; }
.steps__step:focus-visible .steps__circle { outline: 2px solid var(--border-action); outline-offset: 2px; }
.steps__step.is-current .steps__circle { background: var(--background-selected); color: var(--text-default); box-shadow: var(--lift-selected); }
.steps__step:active .steps__circle { transform: scale(.96); }
.steps__tick { position: absolute; right: -.2rem; top: -.2rem; display: flex; width: 2.2rem; height: 2.2rem; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--text-success); color: #fff; border: .2rem solid var(--background-surface); transform: scale(0); transition: transform var(--dur-base) var(--ease); }
.steps__tick .icon { width: 1.4rem; height: 1.4rem; }
.steps__step.is-visited .steps__tick { transform: scale(1); }
.steps__num { font-size: 1.2rem; font-weight: 600; color: var(--text-tertiary); }
.steps__title { font-size: 1.4rem; font-weight: 600; line-height: 1.25; color: var(--text-default); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .steps__step:hover:not(.is-current) .steps__circle { transform: translateY(-1px); box-shadow: var(--ring-soft), var(--lift-hover); }
}

.steps__panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2.4rem; align-items: start; padding: 2.8rem 3.2rem; border-radius: var(--radius-card); background: var(--background-surface);
  box-shadow: var(--ring-soft), var(--shadow-card); }
.steps__panel[hidden] { display: none; }
.steps__panel.from-right { animation: panel-in-right var(--dur-slow) var(--ease); }
.steps__panel.from-left { animation: panel-in-left var(--dur-slow) var(--ease); }
@keyframes panel-in-right { from { opacity: 0; transform: translateX(1.6rem); } }
@keyframes panel-in-left { from { opacity: 0; transform: translateX(-1.6rem); } }
.steps__art { display: flex; width: 9.6rem; height: 9.6rem; align-items: center; justify-content: center; border-radius: 50%; background: var(--background-brand-subtle); color: var(--brand-primary); }
.steps__art > svg { width: 50%; height: 50%; }
.steps__panel.from-right .steps__art, .steps__panel.from-left .steps__art { animation: art-in var(--dur-slow) var(--ease) .05s both; }
@keyframes art-in { from { opacity: 0; transform: scale(.92); } }
.steps__count { margin: 0 0 .6rem; font-size: 1.2rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.steps__heading { margin: 0 0 .8rem; font-size: 2.4rem; line-height: 1.15; letter-spacing: -.5px; }
.steps__summary { margin: 0 0 1rem; font-size: 1.7rem; line-height: 1.45; color: var(--text-strong); }
.steps__detail p { margin: 0 0 1rem; font-size: 1.5rem; line-height: 1.55; color: var(--text-secondary); }
.steps__more { margin: 0 0 1.6rem; font-size: 1.4rem; color: var(--text-secondary); }
.steps__nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.steps__back { padding-left: 1.4rem; }
.steps__back .icon { width: 2rem; height: 2rem; }
.steps__done { display: flex; align-items: center; gap: .8rem; margin: 1.6rem 0 0; padding: 1.2rem 1.6rem; border-radius: 16px; background: var(--background-success-subtle); color: var(--text-normal); font-size: 1.5rem; font-weight: 600;
  animation: panel-in-right var(--dur-slow) var(--ease); }
.steps__done[hidden] { display: none; }
.steps__done .icon { flex: none; width: 2.2rem; height: 2.2rem; color: var(--text-success); }

/* Every step seen: one soft wave along the rail. */
.steps.is-complete .steps__circle { animation: step-ripple var(--dur-page) var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes step-ripple { 40% { transform: scale(1.06); } }

/* Narrow: titles stay on one line, so below six ~120px columns the rail scrolls sideways; the panel stacks. */
@container (max-width: 760px) {
  .steps { --step: 5.6rem; }
  .steps__rail { display: flex; overflow-x: auto; gap: 1.2rem; padding: .8rem .4rem 1.2rem; margin: 0 -.4rem 1.6rem; scroll-snap-type: x mandatory; }
  .steps__step { flex: 0 0 13rem; scroll-snap-align: center; }
  /* equal 13rem steps, 1.2rem apart: the line runs from the first circle's centre to the last's */
  .steps__line { left: calc(.4rem + 6.5rem); right: auto; width: calc((var(--count, 6) - 1) * 14.2rem); top: calc(var(--step) / 2 + .8rem); }
  .steps__panel { grid-template-columns: minmax(0, 1fr); padding: 2.4rem 2rem; gap: 1.2rem; }
  .steps__art { width: 6.4rem; height: 6.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .steps__step, .steps.is-in .steps__step { opacity: 1; transform: none; animation: none; }
  .steps__line { transform: none; transition: none; }
  .steps__panel, .steps__art, .steps__done, .steps.is-complete .steps__circle { animation: none !important; }
}
