/* =====================================================================
   EMERGERA COMPONENTS  v2.3  (2026-09-28)  Dark by default
   Import after tokens.css:  @import url("tokens.css?v=b52c9b2760"); @import url("components.css?v=889e5e1cd6");
   Optional behaviour (nav menu, dialogs, tabs, toasts): components.js
   Live demo of every component and state: ui-kit.html

   Contents
     0. Component tokens (dark + light)      9. Tabs, segmented control
     1. Base, reset, utilities               10. Accordion, dropdown, tooltip
     2. Type presets                          11. Dialog (modal) and sheet
     3. Aurora background                     12. Toast, alert, banner
     4. Glass surfaces, cards                 13. Badge, avatar, kbd, code
     5. Buttons (textured glass)              14. Table, list, pricing card
     6. Links, chips                          15. Progress, spinner, skeleton,
     7. Navigation (desktop + mobile menu)        empty state, stepper, countdown
     8. Forms: field, input, textarea,        16. Breadcrumbs, pagination, footer
        select, checkbox, radio, switch       17. Motion
                                              18. Edge cases: touch, hover:none,
                                                  reduced motion/transparency,
                                                  contrast, forced colors, no
                                                  backdrop-filter, sizes, print

   Rules every component follows
   - Touch targets are at least 44 x 44 px on touch screens.
   - Heights are min-heights and sizes are in rem, so 200% zoom and long
     translations reflow instead of clipping.
   - Logical properties (inline/block) so right-to-left works unchanged.
   - One focus ring (--em-focus-ring) that shows on every background.
   - Every animation stops under prefers-reduced-motion.
   ===================================================================== */

/* ---- 0. Theme --------------------------------------------------------
   Dark is the default. Every theme-dependent value is a token in tokens.css
   (generated by tools/themes.py), so .em-light / data-theme="light" works on a
   whole page or any single section, and nests correctly. */

/* ---- 1. Base, reset, utilities ---------------------------------------- */
.em-page { background: var(--em-bg); color: var(--em-text); font-family: var(--em-font-body);
  font-size: var(--em-fs-md); line-height: var(--em-lh-body); letter-spacing: var(--em-track-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-optical-sizing: auto; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overflow-wrap: break-word; min-height: 100vh; min-height: 100dvh; margin: 0; }
html:has(.em-page) { scroll-padding-top: calc(var(--em-nav-h) + var(--em-safe-top) + 16px); }
.em-page *, .em-page *::before, .em-page *::after { box-sizing: border-box; }
.em-page img, .em-page video { max-width: 100%; height: auto; }
.em-page :where(h1,h2,h3,h4,p,ul,ol,figure,blockquote) { margin: 0; }
.em-page :where(p,li,dd,blockquote,figcaption) { overflow-wrap: break-word; hyphens: auto; }
.em-page :where(h1,h2,h3) { text-wrap: balance; }
.em-page ::selection { background: rgba(255,90,31,.35); }
.em-page :where(a, button, [tabindex], summary, input, select, textarea):focus-visible { outline: 0; box-shadow: var(--em-focus-ring); }
.em-page [hidden] { display: none !important; }

.em-container { width: min(var(--em-container), 100% - 2 * var(--em-gutter) - var(--em-safe-left) - var(--em-safe-right)); margin-inline: auto; }
.em-container--narrow { width: min(760px, 100% - 2 * var(--em-gutter)); }
.em-section { padding-block: var(--em-section-y); position: relative; }
.em-section--alt { background: var(--em-bg-alt); }   /* alternate band, like cloudflare.com's grey sections */
.em-hero { position: relative; min-height: 88vh; min-height: 88svh; display: grid; align-content: center; }
.em-stack { display: flex; flex-direction: column; gap: var(--gap, var(--em-space-4)); }
.em-stack > * { min-width: 0; }
.em-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--em-space-3)); }
.em-grid { display: grid; gap: var(--gap, var(--em-space-5)); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 280px)), 1fr)); }
.em-cq { container-type: inline-size; }

.em-visually-hidden, .em-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.em-skip-link { position: fixed; inset-inline-start: 16px; top: -100px; z-index: var(--em-z-tooltip);
  padding: 12px 18px; border-radius: 12px; background: var(--em-fog); color: var(--em-graphite); font-weight: 600; text-decoration: none; }
.em-skip-link:focus { top: calc(12px + var(--em-safe-top)); }
.em-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.em-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 2); line-clamp: var(--lines, 2); overflow: hidden; }
.em-break { overflow-wrap: anywhere; word-break: break-word; }   /* URLs, emails, long names */
.em-nums { font-variant-numeric: tabular-nums; }

/* ---- 2. Type presets --------------------------------------------------- */
.em-hero-title { font-family: var(--em-font-display); font-weight: 650; font-size: var(--em-fs-5xl);
  line-height: 1.0; letter-spacing: -0.045em; text-wrap: balance; }
.em-title { font-family: var(--em-font-display); font-weight: 650; font-size: var(--em-fs-3xl);
  line-height: 1.05; letter-spacing: var(--em-track-display); text-wrap: balance; }
.em-headline { font-family: var(--em-font-display); font-weight: 600; font-size: var(--em-fs-xl);
  line-height: 1.15; letter-spacing: var(--em-track-title); }
.em-lead { font-size: var(--em-fs-lg); line-height: 1.45; color: var(--em-text-muted); letter-spacing: -0.014em; text-wrap: pretty; max-width: 62ch; }
.em-label { font-family: var(--em-font-body); font-weight: 600; font-size: var(--em-fs-sm); color: var(--em-accent-text); letter-spacing: -0.005em; }
.em-caption { font-size: var(--em-fs-xs); color: var(--em-text-muted); letter-spacing: 0; }
.em-mono { font-family: var(--em-font-mono); font-size: .9em; letter-spacing: var(--em-track-mono); }
.em-prose { max-width: 68ch; }
.em-prose > * + * { margin-block-start: 1em; }

/* ---- 3. Aurora: continuous, slowly moving gradient background ---------
   Markup: <div class="em-aurora" aria-hidden="true"><i></i><i></i><i></i><i></i></div>
   Place it first inside a position:relative section (or the body for a
   full-page background). Set --aurora-y to move the horizon (default 72%). */
.em-aurora { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% var(--aurora-y, 72%), var(--em-aurora-core) 0%, var(--em-aurora-base) 60%); isolation: isolate; }
.em-aurora--fixed { position: fixed; }
/* Guard: the aurora always stays inside its own section, even if the author forgot position:relative */
:where(:has(> .em-aurora:not(.em-aurora--fixed))) { position: relative; overflow: hidden; }
.em-aurora i { position: absolute; display: block; border-radius: 50%; filter: blur(70px); opacity: var(--em-aurora-opacity); mix-blend-mode: var(--em-aurora-blend);
  will-change: transform; animation: em-drift var(--em-dur-aurora) var(--em-ease-in-out) infinite alternate; }
.em-aurora i:nth-child(1) { width: 62vmax; height: 34vmax; left: 19%; top: calc(var(--aurora-y, 72%) - 18vmax);
  background: radial-gradient(closest-side, rgba(255,90,31,.95), rgba(255,90,31,0)); }
.em-aurora i:nth-child(2) { width: 46vmax; height: 26vmax; left: 40%; top: calc(var(--aurora-y, 72%) - 20vmax);
  background: radial-gradient(closest-side, rgba(255,164,27,.75), rgba(255,164,27,0)); animation-duration: calc(var(--em-dur-aurora) * .8); animation-delay: -6s; }
.em-aurora i:nth-child(3) { width: 50vmax; height: 30vmax; left: -12%; top: calc(var(--aurora-y, 72%) - 26vmax);
  background: radial-gradient(closest-side, rgba(108,77,255,.55), rgba(108,77,255,0)); animation-duration: calc(var(--em-dur-aurora) * 1.2); animation-delay: -12s; }
.em-aurora i:nth-child(4) { width: 52vmax; height: 30vmax; right: -14%; top: calc(var(--aurora-y, 72%) - 30vmax);
  background: radial-gradient(closest-side, rgba(255,61,110,.45), rgba(255,61,110,0)); animation-duration: calc(var(--em-dur-aurora) * 1.1); animation-delay: -3s; }
/* Film grain: makes gradients read as light, not as CSS */
.em-aurora::after { content: ""; position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay; background-image: var(--em-noise); }
/* Horizon line: a thin line of light where the glow is brightest */
.em-aurora::before { content: ""; position: absolute; left: 0; right: 0; top: var(--aurora-y, 72%); height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(255,194,74,.0) 8%, rgba(255,194,74,.75) 35%, #FFE3B0 50%, rgba(255,194,74,.75) 65%, rgba(255,194,74,0) 92%, transparent);
  box-shadow: 0 0 24px 2px rgba(255,138,31,.45); }
.em-aurora--no-horizon::before { display: none; }
/* Light theme: a soft dawn wash. Dark theme: the night aurora. */
@keyframes em-drift {
  0%   { transform: translate3d(-6%, 2%, 0) scale(1); }
  50%  { transform: translate3d(4%, -3%, 0) scale(1.08); }
  100% { transform: translate3d(8%, 1%, 0) scale(.96); }
}
/* Phones: fewer, smaller blobs keep scrolling smooth and batteries cool */
@media (max-width: 600px) { .em-aurora i { filter: blur(48px); } .em-aurora i:nth-child(4) { display: none; } }
.em-above { position: relative; z-index: 1; }

/* ---- 4. Glass surfaces, cards ----------------------------------------- */
.em-glass, .em-card { position: relative; isolation: isolate;
  background: var(--em-glass-base), var(--em-glass-tint);
  -webkit-backdrop-filter: var(--em-glass-blur); backdrop-filter: var(--em-glass-blur);
  box-shadow: var(--em-specular), var(--em-shadow-2); }
/* Lit edge: brighter at the top, fading down, like light catching a glass rim */
.em-glass::before, .em-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--em-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* Frosted texture: fine grain inside the glass */
.em-glass::after, .em-card::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: var(--em-noise); opacity: calc(var(--em-noise-opacity) * .6); mix-blend-mode: overlay; }
.em-card { border-radius: var(--em-radius-lg); padding: clamp(20px, 3vw, 32px); min-width: 0;
  transition: transform var(--em-dur-2) var(--em-ease-out), box-shadow var(--em-dur-2) var(--em-ease-out), background var(--em-dur-2); }
.em-card--hover:hover, a.em-card:hover { transform: translateY(-3px);
  background: var(--em-glass-base-hi), var(--em-glass-tint); box-shadow: var(--em-specular), var(--em-shadow-3); }
a.em-card { display: block; color: inherit; text-decoration: none; }
.em-card--solid { background: var(--em-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.em-card--ember { background: linear-gradient(160deg, rgba(255,122,61,.22), rgba(255,90,31,.06) 45%, rgba(255,255,255,.04)), var(--em-glass-tint); }
.em-card--selected { box-shadow: var(--em-specular), 0 0 0 2px var(--em-ember), var(--em-shadow-2); }
.em-card--disabled { opacity: var(--em-disabled-opacity); pointer-events: none; filter: saturate(.4); }
.em-card__media { margin: calc(-1 * clamp(20px, 3vw, 32px)); margin-block-end: 20px; border-radius: inherit;
  border-end-start-radius: 0; border-end-end-radius: 0; overflow: hidden; aspect-ratio: 16 / 9; background: var(--em-fill-1); }
.em-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- 5. Buttons: textured glass, physical, springy --------------------
   Layers, back to front: frosted fill + backdrop blur, film grain and a
   pool of light at the bottom rim (::after), lit rim and inner glow
   (box-shadow), curved specular gloss (::before).
   Variants: --primary (ember glass), --glass (clear frosted), --light (white
   pill), --ghost, --danger. Sizes: --sm, --lg, --icon, --block, --wrap.
   States: :hover, :active, :focus-visible, :disabled / [aria-disabled="true"],
   [aria-busy="true"] (loading; put <span class="em-spinner"></span> inside),
   [aria-pressed="true"] (toggle). */
.em-btn { --h: var(--em-control-h); --pad: calc(var(--h) * .46);
  box-sizing: border-box; position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--h); min-width: var(--h); padding: .5em var(--pad); border: 0; border-radius: var(--em-radius-pill); cursor: pointer;
  text-decoration: none; text-align: center; white-space: nowrap; max-width: 100%; vertical-align: middle; user-select: none;
  font-family: var(--em-font-body); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.012em; line-height: 1.15;
  color: #fff; overflow: hidden; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform var(--em-dur-2) var(--em-ease-spring), box-shadow var(--em-dur-2) var(--em-ease-out), filter var(--em-dur-2), background var(--em-dur-2); }
.em-btn > * { min-width: 0; }
.em-btn__label { overflow: hidden; text-overflow: ellipsis; }
.em-btn--wrap { white-space: normal; }
.em-btn--sm { --h: 36px; font-size: .9375rem; }
.em-btn--lg { --h: 56px; font-size: 1.1875rem; }
.em-btn--block { display: flex; width: 100%; }
.em-btn--icon { padding: 0; width: var(--h); }
.em-btn svg { width: 1.15em; height: 1.15em; flex: none; }
.em-btn:hover { transform: translateY(-1px); }
.em-btn:active { transform: translateY(0) scale(.97); transition-duration: var(--em-dur-1); }
.em-page .em-btn:focus-visible, .em-btn:focus-visible { outline: 0; box-shadow: var(--em-focus-ring), var(--em-btn-shadow, 0 0 transparent); }
/* specular gloss: the curved highlight across the top half */
.em-btn::before { content: ""; position: absolute; z-index: -1; inset-inline: 6%; top: 1px; height: 52%; border-radius: var(--em-radius-pill);
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0)); opacity: .5; transition: opacity var(--em-dur-2); pointer-events: none; }
/* texture: film grain plus a soft pool of light at the bottom rim */
.em-btn::after { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(70% 60% at 50% 118%, rgba(255,255,255,.35), transparent 70%), var(--em-noise);
  opacity: var(--em-noise-opacity); mix-blend-mode: overlay; }
.em-btn:hover::before { opacity: .75; }

/* Primary: ember glass, lit from within */
.em-btn--primary { --em-btn-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -3px 8px rgba(130,30,0,.35), inset 0 0 0 1px rgba(255,190,150,.18), 0 0 0 1px rgba(210,70,10,.55), var(--em-glow-ember);
  background: radial-gradient(120% 140% at 50% 0%, #FF9A5C 0%, #FF6A2A 42%, #F2510F 70%, #D9430A 100%);
  text-shadow: 0 1px 1px rgba(120,30,0,.35); box-shadow: var(--em-btn-shadow); }
.em-btn--primary::after { opacity: calc(var(--em-noise-opacity) * 2); }
.em-btn--primary:hover { --em-btn-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -3px 8px rgba(130,30,0,.3), inset 0 0 0 1px rgba(255,190,150,.22), 0 0 0 1px rgba(210,70,10,.6), 0 12px 36px rgba(255,90,31,.5), 0 2px 8px rgba(255,90,31,.35); }

/* Glass: clear frosted bubble */
.em-btn--glass { --em-btn-shadow: var(--em-btn-glass-shadow);
  color: var(--em-text); background: var(--em-btn-glass-bg);
  -webkit-backdrop-filter: var(--em-glass-blur); backdrop-filter: var(--em-glass-blur); box-shadow: var(--em-btn-shadow); }
.em-btn--glass::before { opacity: .35; }
.em-btn--glass::after { opacity: var(--em-btn-glass-grain); mix-blend-mode: var(--em-btn-glass-grain-blend); }
.em-btn--glass:hover { background: var(--em-btn-glass-bg-hover); }

/* Contrast pill (class name --light kept): black on light pages, white on dark, like Apple's store buttons */
.em-btn--light { --em-btn-shadow: var(--em-btn-contrast-shadow); color: var(--em-btn-contrast-fg); background: var(--em-btn-contrast-bg); box-shadow: var(--em-btn-shadow); text-shadow: none; }
.em-btn--light::before { opacity: var(--em-btn-contrast-gloss); }
.em-btn--light::after { mix-blend-mode: multiply; opacity: .06; }

/* Ghost: tertiary actions */
.em-btn--ghost { color: var(--em-text); background: transparent; box-shadow: none; }
.em-btn--ghost::before, .em-btn--ghost::after { display: none; }
.em-btn--ghost:hover { background: var(--em-fill-2); transform: none; }

/* Danger: destructive actions only */
.em-btn--danger { --em-btn-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -3px 8px rgba(90,0,0,.3), 0 0 0 1px rgba(170,30,30,.5), 0 8px 24px rgba(220,50,50,.3);
  background: radial-gradient(120% 140% at 50% 0%, #FF8A8A, #E5484D 55%, #C22F35); box-shadow: var(--em-btn-shadow); }

/* Toggle */
.em-btn[aria-pressed="true"] { background: var(--em-fill-3); --em-btn-shadow: inset 0 2px 6px rgba(0,0,0,.25), inset 0 0 0 1px var(--em-rim); box-shadow: var(--em-btn-shadow); }

/* Disabled: dimmed, flat, no motion. aria-disabled keeps it focusable for screen readers. */
.em-btn:disabled, .em-btn[aria-disabled="true"] { opacity: var(--em-disabled-opacity); cursor: not-allowed; transform: none !important; filter: saturate(.3); }
.em-btn:disabled::before, .em-btn[aria-disabled="true"]::before { opacity: .2; }
/* Loading: label keeps its width (no layout jump), spinner sits on top */
.em-btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.em-btn[aria-busy="true"] > :not(.em-spinner) { opacity: 0; }
.em-btn[aria-busy="true"] > .em-spinner { position: absolute; inset: 0; margin: auto; }
.em-btn-group { display: flex; flex-wrap: wrap; gap: 12px; }
@container (max-width: 420px) { .em-btn-group { display: grid; grid-template-columns: 1fr; } .em-btn-group .em-btn { width: 100%; } }

/* ---- 6. Links, chips --------------------------------------------------- */
.em-link { color: var(--em-link); text-decoration: none; font-weight: 500; border-radius: 4px; }
.em-link::after { content: "\203A"; display: inline-block; margin-inline-start: .25em; transition: transform var(--em-dur-2) var(--em-ease-out); }
.em-link:hover { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.em-link:hover::after { transform: translateX(3px); }
.em-link:dir(rtl)::after { transform: scaleX(-1); }
.em-link:dir(rtl):hover::after { transform: scaleX(-1) translateX(3px); }
.em-link--plain::after { content: none; }
.em-link[aria-disabled="true"] { color: var(--em-text-muted); pointer-events: none; }

.em-chip { display: inline-flex; align-items: center; gap: .45em; min-height: 32px; padding: .3em 14px; border-radius: var(--em-radius-pill);
  font-size: .875rem; font-weight: 500; letter-spacing: -0.005em; color: var(--em-text); max-width: 100%;
  background: var(--em-fill-1); -webkit-backdrop-filter: var(--em-glass-blur); backdrop-filter: var(--em-glass-blur);
  box-shadow: var(--em-specular), inset 0 0 0 1px var(--em-rim); }
.em-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--em-mint); box-shadow: 0 0 10px var(--em-mint); flex: none; }
.em-chip--ember { background: var(--em-chip-ember-bg); color: var(--em-chip-ember-fg); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,90,31,.35); }
button.em-chip, a.em-chip { cursor: pointer; text-decoration: none; border: 0; font-family: inherit; }
button.em-chip:hover, a.em-chip:hover { background: var(--em-fill-2); }
.em-chip[aria-pressed="true"] { background: var(--em-chip-on-bg); color: var(--em-chip-on-fg); box-shadow: none; }

/* ---- 7. Navigation ----------------------------------------------------
   <header class="em-nav"><div class="em-container em-nav__inner">
     <a class="em-nav__brand" href="/"><img src="logo/emergera-lockup-dark-bg.svg" alt="Emergera"></a>
     <nav class="em-nav__links" aria-label="Main">…<a aria-current="page">…</a></nav>
     <div class="em-nav__actions"><a class="em-btn em-btn--primary em-btn--sm">Enroll</a>
       <button class="em-nav__toggle" aria-expanded="false" aria-controls="menu" aria-label="Menu"><span></span></button></div>
   </div><nav class="em-nav__panel" id="menu" aria-label="Main" hidden>…links…</nav></header>
   Below 900px the links move into the panel (components.js toggles it). */
.em-nav { position: sticky; top: 0; z-index: var(--em-z-sticky); padding-top: var(--em-safe-top);
  background: var(--em-nav-bg); -webkit-backdrop-filter: var(--em-glass-blur); backdrop-filter: var(--em-glass-blur);
  box-shadow: inset 0 -1px 0 var(--em-nav-line); }
.em-nav__inner { min-height: var(--em-nav-h); display: flex; align-items: center; gap: 16px; }
.em-nav__brand { display: inline-flex; align-items: center; flex: none; min-height: var(--em-tap); border-radius: 8px; }
.em-nav__brand img { height: 32px; width: auto; display: block; }
.em-nav__links { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; min-width: 0; }
.em-nav__links a, .em-nav__panel a { color: var(--em-text-muted); text-decoration: none; font-size: .875rem; font-weight: 500;
  padding: 8px 12px; border-radius: 10px; min-height: 36px; display: inline-flex; align-items: center; white-space: nowrap; transition: color var(--em-dur-2), background var(--em-dur-2); }
.em-nav__links a:hover { color: var(--em-text); background: var(--em-fill-1); }
.em-nav__links a[aria-current="page"], .em-nav__panel a[aria-current="page"] { color: var(--em-text); }
.em-nav__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.em-nav__links + .em-nav__actions { margin-inline-start: 8px; }
.em-nav__toggle { display: none; width: var(--em-tap); height: var(--em-tap); border: 0; border-radius: 12px; background: transparent; color: var(--em-text); cursor: pointer; place-items: center; padding: 0; }
.em-nav__toggle:hover { background: var(--em-fill-1); }
.em-nav__toggle span, .em-nav__toggle span::before, .em-nav__toggle span::after { display: block; width: 18px; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform var(--em-dur-2) var(--em-ease-out), background var(--em-dur-1); }
.em-nav__toggle span { position: relative; }
.em-nav__toggle span::before, .em-nav__toggle span::after { content: ""; position: absolute; left: 0; }
.em-nav__toggle span::before { top: -6px; } .em-nav__toggle span::after { top: 6px; }
.em-nav__toggle[aria-expanded="true"] span { background: transparent; }
.em-nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.em-nav__toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
.em-nav__panel { display: grid; padding: 4px var(--em-gutter) calc(20px + var(--em-safe-bottom));
  max-height: calc(100dvh - var(--em-nav-h) - var(--em-safe-top)); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: inset 0 1px 0 var(--em-rim); animation: em-drop var(--em-dur-2) var(--em-ease-out); }
.em-nav__panel a { font-size: 1.1875rem; color: var(--em-text); min-height: 52px; padding-inline: 4px; border-radius: 0; box-shadow: inset 0 -1px 0 var(--em-rim); }
@keyframes em-drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 899px) {
  .em-nav__links { display: none; }
  .em-nav__toggle { display: inline-grid; }
  .em-nav__actions, .em-nav__links + .em-nav__actions { margin-inline-start: auto; }
}
@media (min-width: 900px) { .em-nav__panel { display: none !important; } }
@media (max-width: 374px) { .em-nav__brand img { height: 26px; } .em-nav__actions .em-btn { --pad: 12px; } }

/* ---- 8. Forms ---------------------------------------------------------
   <div class="em-field">
     <label class="em-field__label" for="e">Email <span class="em-field__req">Required</span></label>
     <input class="em-input" id="e" type="email" autocomplete="email" aria-describedby="e-help e-err">
     <p class="em-field__help" id="e-help">We only use this for your cohort.</p>
     <p class="em-field__error" id="e-err">Enter an email like name@example.com</p>
   </div>
   Invalid: add aria-invalid="true" to the control and the error line shows. */
.em-form { display: grid; gap: 20px; }
.em-form__row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.em-field { display: grid; gap: 8px; min-width: 0; }
.em-field__label { font-size: .9375rem; font-weight: 600; color: var(--em-text); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.em-field__req, .em-field__opt { font-size: .8125rem; font-weight: 400; color: var(--em-text-muted); }
.em-field__help { font-size: .875rem; color: var(--em-text-muted); line-height: 1.4; }
.em-field__error { display: none; font-size: .875rem; font-weight: 500; color: var(--em-danger); line-height: 1.4; align-items: flex-start; gap: 8px; }
.em-field__error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-top: 1px;
  border-radius: 50%; background: var(--em-danger); color: var(--em-bg); font-size: 11px; font-weight: 800; }
.em-field:has([aria-invalid="true"]) .em-field__error, .em-field--error .em-field__error { display: flex; }
.em-field__success { font-size: .875rem; color: var(--em-success); }
.em-field__counter { justify-self: end; font-size: .8125rem; color: var(--em-text-muted); font-variant-numeric: tabular-nums; }
.em-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; min-width: 0; }
.em-fieldset legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: .9375rem; }

.em-input, .em-textarea, .em-select { box-sizing: border-box; width: 100%; min-height: var(--em-control-h); padding: 12px 16px; margin: 0;
  border-radius: 14px; border: 0; color: var(--em-text); font-family: inherit; font-size: max(16px, 1rem); line-height: 1.3; /* 16px+ stops iOS zoom-on-focus */
  background-color: var(--em-field-bg); box-shadow: inset 0 0 0 1px var(--em-field-border), var(--em-field-inset);
  transition: box-shadow var(--em-dur-2) var(--em-ease-out), background-color var(--em-dur-2); appearance: none; -webkit-appearance: none; }
.em-input::placeholder, .em-textarea::placeholder { color: var(--em-text-muted); opacity: .85; }
.em-input:hover, .em-textarea:hover, .em-select:hover { box-shadow: inset 0 0 0 1px var(--em-text-muted), var(--em-field-inset); }
.em-page .em-input:focus, .em-page .em-textarea:focus, .em-page .em-select:focus,
.em-input:focus, .em-textarea:focus, .em-select:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--em-ember), 0 0 0 4px rgba(255,90,31,.22); }
.em-input[aria-invalid="true"], .em-textarea[aria-invalid="true"], .em-select[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--em-danger), 0 0 0 4px var(--em-danger-bg); }
.em-input--success { box-shadow: inset 0 0 0 1.5px var(--em-success), var(--em-field-inset); }
.em-input:disabled, .em-textarea:disabled, .em-select:disabled { opacity: var(--em-disabled-opacity); cursor: not-allowed; }
.em-input[readonly] { background-color: transparent; box-shadow: inset 0 0 0 1px var(--em-rim); }
.em-input:-webkit-autofill { -webkit-text-fill-color: var(--em-text); box-shadow: inset 0 0 0 1px var(--em-field-border), inset 0 0 0 100px var(--em-autofill); caret-color: var(--em-text); }
.em-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.em-input[type="number"] { font-variant-numeric: tabular-nums; }
.em-textarea { min-height: 120px; resize: vertical; line-height: 1.5; max-height: 50vh; }
.em-select { padding-inline-end: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23A1A3B3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; }
.em-select:dir(rtl) { background-position: left 18px center; }
.em-select option { background: var(--em-option-bg); color: var(--em-option-fg); }
/* Input with an icon or a button inside */
.em-input-group { position: relative; display: flex; align-items: center; min-width: 0; }
.em-input-group > .em-input { padding-inline-start: 44px; }
.em-input-group__icon { position: absolute; inset-inline-start: 14px; width: 18px; height: 18px; color: var(--em-text-muted); pointer-events: none; }
/* Inline signup (email + button): stacks when its container is narrow */
.em-inline-form { display: flex; gap: 10px; }
.em-inline-form > .em-input { flex: 1; min-width: 0; }
@container (max-width: 480px) { .em-inline-form { flex-direction: column; } .em-inline-form .em-btn { width: 100%; } }

/* Checkbox and radio: native inputs, restyled (keyboard and screen readers keep working) */
.em-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: var(--em-tap); padding-block: 10px; line-height: 1.4; }
.em-check input { appearance: none; -webkit-appearance: none; flex: none; margin: 0; width: 22px; height: 22px; cursor: pointer;
  border-radius: 7px; background: var(--em-field-bg); box-shadow: inset 0 0 0 1.5px var(--em-field-border), var(--em-field-inset);
  display: inline-grid; place-content: center; transition: background var(--em-dur-1), box-shadow var(--em-dur-1); }
.em-check input[type="radio"] { border-radius: 50%; }
.em-check input::before { content: ""; width: 12px; height: 12px; transform: scale(0); transition: transform var(--em-dur-2) var(--em-ease-spring); background: #fff; }
.em-check input[type="checkbox"]::before { clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.em-check input[type="radio"]::before { width: 9px; height: 9px; border-radius: 50%; }
.em-check input:checked, .em-check input:indeterminate { background: radial-gradient(120% 140% at 50% 0%, #FF9A5C, #F2510F); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 0 1px rgba(210,70,10,.55), 0 2px 8px rgba(255,90,31,.35); }
.em-check input:checked::before { transform: scale(1); }
.em-check input:indeterminate::before { clip-path: none; height: 2px; width: 10px; transform: scale(1); }
.em-page .em-check input:focus-visible, .em-check input:focus-visible { box-shadow: var(--em-focus-ring); }
.em-check input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--em-danger); }
.em-check:has(input:disabled) { opacity: var(--em-disabled-opacity); cursor: not-allowed; }
.em-check small { display: block; color: var(--em-text-muted); font-size: .875rem; }
/* Option card: a whole card that selects (plan or session pickers) */
.em-option { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; cursor: pointer; min-width: 0;
  background: var(--em-fill-1); box-shadow: inset 0 0 0 1px var(--em-rim); transition: box-shadow var(--em-dur-2), background var(--em-dur-2); }
.em-option:hover { background: var(--em-fill-2); }
.em-option input { flex: none; margin-top: 2px; accent-color: var(--em-ember); width: 20px; height: 20px; }
.em-option:has(input:checked) { background: rgba(255,90,31,.08); box-shadow: inset 0 0 0 1.5px var(--em-ember); }
.em-option:has(input:focus-visible) { box-shadow: inset 0 0 0 1.5px var(--em-ember), var(--em-focus-ring); }
.em-option:has(input:disabled) { opacity: var(--em-disabled-opacity); cursor: not-allowed; }

/* Switch: <label class="em-switch"><input type="checkbox" role="switch"> Label</label> */
.em-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: var(--em-tap); }
.em-switch input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; width: 51px; height: 31px; border-radius: 999px; cursor: pointer;
  background: var(--em-track); box-shadow: inset 0 0 0 1px var(--em-rim), inset 0 2px 4px rgba(0,0,0,.2); transition: background var(--em-dur-2) var(--em-ease-out); }
.em-switch input::before { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: linear-gradient(180deg, #fff, #ECECF0); box-shadow: 0 3px 8px rgba(0,0,0,.25), 0 1px 1px rgba(0,0,0,.16), inset 0 -1px 1px rgba(0,0,0,.06);
  transition: transform var(--em-dur-2) var(--em-ease-spring); }
.em-switch input:checked { background: radial-gradient(120% 140% at 50% 0%, #FF9A5C, #F2510F); }
.em-switch input:checked::before { transform: translateX(20px); }
.em-switch input:checked:dir(rtl)::before { transform: translateX(-20px); }
.em-page .em-switch input:focus-visible, .em-switch input:focus-visible { box-shadow: var(--em-focus-ring); }
.em-switch:has(input:disabled) { opacity: var(--em-disabled-opacity); cursor: not-allowed; }
.em-range { width: 100%; accent-color: var(--em-ember); min-height: var(--em-tap); }

/* ---- 9. Tabs, segmented control --------------------------------------
   Tabs: <div class="em-tabs" role="tablist"><button role="tab" aria-selected="true" aria-controls="p1">…</button>…</div>
   They scroll sideways (with faded edges) when they don't fit. */
.em-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  box-shadow: inset 0 -1px 0 var(--em-rim); }
.em-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 767px) { .em-tabs { -webkit-mask: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 40px), transparent); padding-inline-end: 32px; } }
.em-tabs [role="tab"] { flex: none; scroll-snap-align: start; position: relative; min-height: var(--em-tap); padding: 0 14px; border: 0; background: none; cursor: pointer;
  color: var(--em-text-muted); font: inherit; font-size: .9375rem; font-weight: 500; white-space: nowrap; border-radius: 10px 10px 0 0; }
.em-tabs [role="tab"]:hover { color: var(--em-text); }
.em-tabs [role="tab"][aria-selected="true"] { color: var(--em-text); }
.em-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--em-sunrise); box-shadow: 0 0 10px rgba(255,90,31,.6); }
.em-tabs [role="tab"]:disabled { opacity: var(--em-disabled-opacity); cursor: not-allowed; }
.em-tabpanel { padding-block: 24px; }

/* Segmented control (iOS style): radios inside, one frosted thumb */
.em-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border: 0; margin: 0; border-radius: 12px; max-width: 100%;
  background: var(--em-fill-1); box-shadow: inset 0 0 0 1px var(--em-rim), inset 0 1px 3px rgba(0,0,0,.08); }
.em-segmented label { position: relative; display: grid; place-items: center; min-height: 36px; padding: 0 16px; border-radius: 9px; cursor: pointer; min-width: 0;
  font-size: .875rem; font-weight: 500; color: var(--em-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--em-dur-2), background var(--em-dur-2), box-shadow var(--em-dur-2); }
.em-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.em-segmented label:has(input:checked) { color: var(--em-text); background: var(--em-seg-on-bg); box-shadow: var(--em-seg-on-shadow); }
.em-segmented label:has(input:focus-visible) { box-shadow: var(--em-focus-ring); }
.em-segmented--block { display: grid; width: 100%; }

/* ---- 10. Accordion, dropdown, tooltip -------------------------------- */
/* Accordion / FAQ: <details class="em-accordion"><summary>Question</summary><div>Answer</div></details> */
.em-accordion { box-shadow: inset 0 -1px 0 var(--em-rim); }
.em-accordion > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding-block: 16px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.015em; border-radius: 8px; }
.em-accordion > summary::-webkit-details-marker { display: none; }
.em-accordion > summary::after { content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; color: var(--em-text-muted);
  background-color: var(--em-fill-1); box-shadow: inset 0 0 0 1px var(--em-rim);
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 11px 1.5px, 1.5px 11px; background-position: center; background-repeat: no-repeat;
  transition: transform var(--em-dur-2) var(--em-ease-out), background-size var(--em-dur-2); }
.em-accordion[open] > summary::after { transform: rotate(180deg); background-size: 11px 1.5px, 1.5px 0; }
.em-accordion > summary:hover::after { background-color: var(--em-fill-2); }
.em-accordion > :not(summary) { padding-block-end: 20px; color: var(--em-text-muted); max-width: 68ch; }
.em-accordion[open] > :not(summary) { animation: em-fade-down var(--em-dur-2) var(--em-ease-out); }
@keyframes em-fade-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Dropdown menu: <details class="em-menu"><summary class="em-btn em-btn--glass">…</summary><div class="em-menu__list">…</div></details> */
.em-menu { position: relative; display: inline-block; }
.em-menu > summary { list-style: none; }
.em-menu > summary::-webkit-details-marker { display: none; }
.em-menu__list, .em-popover { position: absolute; z-index: var(--em-z-dropdown); inset-inline-start: 0; top: calc(100% + 8px); min-width: 220px; max-width: min(320px, 90vw);
  padding: 6px; border-radius: 16px; background: var(--em-popover-bg); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px var(--em-rim), var(--em-shadow-3); animation: em-pop var(--em-dur-2) var(--em-ease-out); transform-origin: top; }
.em-menu--end .em-menu__list { inset-inline: auto 0; }
.em-menu__list a, .em-menu__list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--em-text); font: inherit; font-size: .9375rem; text-align: start; text-decoration: none; cursor: pointer; }
.em-menu__list a:hover, .em-menu__list button:hover { background: var(--em-fill-2); }
.em-menu__list hr { border: 0; height: 1px; background: var(--em-rim); margin: 6px 8px; }
@keyframes em-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* Tooltip: <span class="em-tip" tabindex="0" data-tip="Text">…</span>
   Supplementary only: never the only place a fact appears (touch screens hide it). */
.em-tip { position: relative; }
.em-tip::after { content: attr(data-tip); position: absolute; z-index: var(--em-z-tooltip); bottom: calc(100% + 8px); left: 50%; translate: -50% 4px;
  width: max-content; max-width: min(260px, 80vw); padding: 7px 10px; border-radius: 10px; pointer-events: none;
  font-size: .8125rem; font-weight: 500; line-height: 1.35; color: var(--em-tip-fg); background: var(--em-tip-bg); box-shadow: var(--em-shadow-2);
  opacity: 0; transition: opacity var(--em-dur-1), translate var(--em-dur-2) var(--em-ease-out); white-space: normal; text-align: center; }
.em-tip:hover::after, .em-tip:focus-visible::after { opacity: 1; translate: -50% 0; }
.em-tip--below::after { bottom: auto; top: calc(100% + 8px); }

/* ---- 11. Dialog (modal) and sheet ------------------------------------
   <dialog class="em-dialog" aria-labelledby="t"><div class="em-dialog__body">
     <h2 id="t">…</h2>…<div class="em-dialog__actions">…</div></div></dialog>
   Open with dialog.showModal(). Esc closes; components.js adds click-outside
   and locks page scroll. Add .em-sheet to slide up from the bottom on phones. */
.em-dialog { width: min(560px, 100% - 32px); max-height: 85vh; max-height: 85dvh; padding: 0; border: 0; border-radius: 28px; color: var(--em-text); overflow: hidden;
  background: var(--em-dialog-bg);
  -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px);
  box-shadow: var(--em-dialog-shadow); }
.em-dialog[open] { display: flex; flex-direction: column; animation: em-dialog-in var(--em-dur-3) var(--em-ease-out); }
.em-dialog::backdrop { background: var(--em-overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.em-dialog__body { padding: clamp(24px, 5vw, 36px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; }
.em-dialog__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding-top: 8px; }
.em-dialog__close { position: absolute; top: 12px; inset-inline-end: 12px; }
@keyframes em-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .em-dialog.em-sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; max-height: 92dvh; }
  .em-dialog.em-sheet[open] { animation: em-sheet-in var(--em-dur-3) var(--em-ease-out); }
  .em-dialog.em-sheet .em-dialog__body { padding-bottom: calc(24px + var(--em-safe-bottom)); }
  .em-dialog.em-sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--em-fill-3); margin: 8px auto 0; flex: none; }
  .em-dialog__actions { flex-direction: column-reverse; } .em-dialog__actions .em-btn { width: 100%; }
}
@keyframes em-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
html.em-scroll-lock { overflow: hidden; }

/* ---- 12. Toast, alert, banner ---------------------------------------- */
/* Toast region: <div class="em-toasts" role="status" aria-live="polite"></div>; components.js: emToast("Saved", "success") */
.em-toasts { position: fixed; z-index: var(--em-z-toast); inset-inline: 0; bottom: calc(16px + var(--em-safe-bottom)); display: grid; justify-items: center; gap: 8px; padding-inline: 16px; pointer-events: none; }
.em-toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(480px, 100%); min-height: 48px; padding: 10px 16px;
  border-radius: 16px; font-size: .9375rem; color: var(--em-fog); background: rgba(28,31,48,.92); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px rgba(255,255,255,.08), var(--em-shadow-3); animation: em-toast-in var(--em-dur-3) var(--em-ease-spring); }
.em-toast--success::before, .em-toast--error::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--em-mint); box-shadow: 0 0 10px var(--em-mint); }
.em-toast--error::before { background: #FF6B6B; box-shadow: 0 0 10px #FF6B6B; }
.em-toast.is-leaving { animation: em-toast-out var(--em-dur-2) ease forwards; }
@keyframes em-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes em-toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { .em-toasts { justify-items: end; inset-inline: auto calc(24px + var(--em-safe-right)); bottom: calc(24px + var(--em-safe-bottom)); } }

/* Alert: inline message. Variants --success, --warning, --danger (default info) */
.em-alert { --c: var(--em-info); --bg: var(--em-info-bg); display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start;
  padding: 14px 16px; border-radius: 16px; background: var(--bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 32%, transparent); font-size: .9375rem; line-height: 1.45; }
.em-alert::before { content: ""; width: 8px; height: 8px; margin-top: .5em; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); grid-row: 1 / span 2; }
.em-alert > :not(.em-alert__close) { grid-column: 2; min-width: 0; }
.em-alert strong { color: var(--em-text); font-weight: 600; }
.em-alert__close { grid-column: 3; grid-row: 1; margin: -10px -8px -10px 0; }
.em-alert--success { --c: var(--em-success); --bg: var(--em-success-bg); }
.em-alert--warning { --c: var(--em-warning); --bg: var(--em-warning-bg); }
.em-alert--danger  { --c: var(--em-danger);  --bg: var(--em-danger-bg); }
/* Banner: full-width announcement bar above the nav */
.em-banner { display: flex; justify-content: center; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 10px var(--em-gutter);
  padding-top: calc(10px + var(--em-safe-top)); font-size: .875rem; text-align: center; color: var(--em-banner-fg);
  background: var(--em-banner-bg); box-shadow: inset 0 -1px 0 var(--em-banner-line); }
.em-banner a { color: var(--em-banner-link); font-weight: 600; }

/* ---- 13. Badge, avatar, kbd, code ------------------------------------- */
.em-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: 0; line-height: 1.2; white-space: nowrap;
  color: var(--em-text); background: var(--em-fill-2); box-shadow: inset 0 0 0 1px var(--em-rim); font-variant-numeric: tabular-nums; vertical-align: middle; }
.em-badge--ember { color: #fff; background: radial-gradient(120% 140% at 50% 0%, #FF9A5C, #F2510F); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.em-badge--success { color: var(--em-success); background: var(--em-success-bg); box-shadow: none; }
.em-badge--warning { color: var(--em-warning); background: var(--em-warning-bg); box-shadow: none; }
.em-badge--danger { color: var(--em-danger); background: var(--em-danger-bg); box-shadow: none; }
.em-badge--dot { min-height: 0; width: 10px; height: 10px; padding: 0; background: var(--em-ember); box-shadow: 0 0 0 2px var(--em-bg); }

.em-avatar { --s: 40px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, #FF9A5C, #C2410C); color: #fff; font-weight: 600; font-size: calc(var(--s) * .38); letter-spacing: 0; text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--em-rim), inset 0 1px 0 rgba(255,255,255,.3); }
.em-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.em-avatar--sm { --s: 28px; } .em-avatar--lg { --s: 64px; } .em-avatar--xl { --s: 120px; }
.em-avatar-group { display: inline-flex; }
.em-avatar-group .em-avatar { box-shadow: 0 0 0 2px var(--em-bg); }
.em-avatar-group .em-avatar + .em-avatar { margin-inline-start: calc(var(--s) * -.28); }

.em-kbd { display: inline-block; min-width: 1.6em; padding: .1em .45em; border-radius: 6px; font-family: var(--em-font-body); font-size: .8125em; font-weight: 500; text-align: center;
  background: var(--em-fill-2); box-shadow: inset 0 -1px 0 var(--em-rim), 0 0 0 1px var(--em-rim); }
.em-code { font-family: var(--em-font-mono); font-size: .875em; padding: .1em .35em; border-radius: 6px; background: var(--em-fill-2); }
.em-pre { font-family: var(--em-font-mono); font-size: .875rem; line-height: 1.6; padding: 16px 20px; border-radius: 16px; overflow-x: auto; tab-size: 2; margin: 0;
  background: var(--em-pre-bg); box-shadow: inset 0 0 0 1px var(--em-rim); }

/* ---- 14. Table, list, pricing card ------------------------------------ */
/* <div class="em-table-wrap" tabindex="0" role="region" aria-label="Schedule"><table class="em-table">… */
.em-table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--em-rim); max-width: 100%; }
.em-table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.em-table th, .em-table td { padding: 12px 16px; text-align: start; box-shadow: inset 0 -1px 0 var(--em-rim); vertical-align: top; }
.em-table th { font-size: .8125rem; font-weight: 600; color: var(--em-text-muted); white-space: nowrap; }
.em-table tr:last-child td { box-shadow: none; }
.em-table tbody tr:hover { background: var(--em-fill-1); }
.em-table .num { text-align: end; }
/* Stacked table on narrow containers: put data-label="Column" on each td */
@container (max-width: 560px) {
  .em-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .em-table--stack tr { display: grid; padding: 12px 16px; box-shadow: inset 0 -1px 0 var(--em-rim); }
  .em-table--stack td { display: grid; grid-template-columns: minmax(90px, 35%) 1fr; gap: 12px; padding: 4px 0; box-shadow: none; }
  .em-table--stack td::before { content: attr(data-label); color: var(--em-text-muted); font-size: .8125rem; font-weight: 600; }
  .em-table--stack .num { text-align: start; }
}

.em-list { list-style: none; padding: 0; margin: 0; display: grid; }
.em-list > li { display: flex; align-items: center; gap: 14px; min-height: 56px; padding-block: 10px; box-shadow: inset 0 -1px 0 var(--em-rim); min-width: 0; }
.em-list__main { flex: 1; min-width: 0; }
.em-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.em-checklist li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.em-checklist li::before { content: ""; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background-color: rgba(48,213,160,.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2330D5A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5'/%3E%3C/svg%3E"); }

/* Pricing card: one clear price, what's included, one button */
.em-pricing { display: grid; gap: 20px; align-content: start; }
.em-pricing__name { font-weight: 600; font-size: 1.0625rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.em-pricing__price { font-family: var(--em-font-display); font-weight: 650; font-size: clamp(3rem, 2.4rem + 2vw, 4.5rem); letter-spacing: -0.045em; line-height: .95; font-variant-numeric: tabular-nums; }
.em-pricing__price sup { font-size: .45em; vertical-align: .85em; letter-spacing: 0; margin-inline-end: .04em; }
.em-pricing__per { font-size: .9375rem; color: var(--em-text-muted); }
.em-pricing--featured { box-shadow: var(--em-specular), 0 0 0 1.5px rgba(255,120,40,.7), 0 0 60px rgba(255,90,31,.25), var(--em-shadow-2); }
.em-pricing--closed .em-pricing__price { color: var(--em-text-muted); }

.em-price { font-family: var(--em-font-display); font-weight: 650; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.em-price sup { font-size: .5em; vertical-align: .75em; margin-inline-end: .04em; letter-spacing: 0; }
.em-divider { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--em-rim), transparent); }

/* ---- 15. Progress, spinner, skeleton, empty state, stepper, countdown -- */
.em-progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--em-track); }
.em-progress::-webkit-progress-bar { background: var(--em-track); border-radius: 999px; }
.em-progress::-webkit-progress-value { background: var(--em-sunrise); border-radius: 999px; transition: width var(--em-dur-3) var(--em-ease-out); }
.em-progress::-moz-progress-bar { background: var(--em-sunrise); border-radius: 999px; }
.em-progress:indeterminate { background: linear-gradient(90deg, transparent, rgba(255,138,31,.85), transparent) 0 0 / 40% 100% no-repeat, var(--em-track); animation: em-indet 1.4s var(--em-ease-in-out) infinite; }
.em-progress:indeterminate::-webkit-progress-bar { background: transparent; }
@keyframes em-indet { from { background-position: -60% 0, 0 0; } to { background-position: 160% 0, 0 0; } }

.em-spinner { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 50%; flex: none;
  background: conic-gradient(from 0deg, transparent 0 25%, currentColor);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 0);
  animation: em-spin .8s linear infinite; }
@keyframes em-spin { to { transform: rotate(1turn); } }

.em-skeleton { display: block; border-radius: 10px; min-height: 1em; color: transparent !important; user-select: none; pointer-events: none;
  background: linear-gradient(90deg, var(--em-skeleton) 0%, var(--em-skeleton-hi) 50%, var(--em-skeleton) 100%) 0 0 / 200% 100%; animation: em-shimmer 1.6s linear infinite; }
.em-skeleton--text { height: .9em; margin-block: .35em; border-radius: 6px; }
.em-skeleton--circle { border-radius: 50%; aspect-ratio: 1; width: var(--s, 40px); }
@keyframes em-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.em-empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: clamp(32px, 8vw, 64px) 24px; border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--em-rim); background: radial-gradient(60% 80% at 50% 0%, rgba(255,90,31,.08), transparent 70%); }
.em-empty__art { width: 72px; height: auto; opacity: .9; }
.em-empty__title { font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.015em; }
.em-empty p { color: var(--em-text-muted); max-width: 42ch; }

/* Stepper: <ol class="em-stepper"><li data-state="done">…</li><li aria-current="step">…</li><li>…</li></ol> */
.em-stepper { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; }
.em-stepper li { flex: 1; min-width: 0; display: grid; gap: 8px; font-size: .8125rem; color: var(--em-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-stepper li::before { content: ""; height: 4px; border-radius: 2px; background: var(--em-track); }
.em-stepper li[data-state="done"]::before { background: var(--em-ember); }
.em-stepper li[aria-current="step"] { color: var(--em-text); font-weight: 600; }
.em-stepper li[aria-current="step"]::before { background: linear-gradient(90deg, var(--em-ember) 50%, var(--em-track) 50%); box-shadow: 0 0 10px rgba(255,90,31,.45); }
@container (max-width: 480px) { .em-stepper li:not([aria-current="step"]) { color: transparent; } .em-stepper li[aria-current="step"] { overflow: visible; } }

/* Countdown: <div class="em-countdown" role="timer" aria-label="…"><div><b>10</b><span>days</span></div>…</div> */
.em-countdown { display: flex; gap: clamp(6px, 2vw, 16px); font-variant-numeric: tabular-nums; }
.em-countdown > div { display: grid; justify-items: center; gap: 4px; flex: 1 1 0; min-width: 0; max-width: 110px; padding: 14px 6px; border-radius: 18px;
  background: var(--em-tile-bg); box-shadow: var(--em-specular), inset 0 0 0 1px var(--em-rim), var(--em-shadow-1); }
.em-countdown b { font-family: var(--em-font-display); font-weight: 650; font-size: clamp(1.625rem, 1rem + 3vw, 3rem); letter-spacing: -0.04em; line-height: 1; }
.em-countdown span { font-size: .75rem; color: var(--em-text-muted); }

/* ---- 16. Breadcrumbs, pagination, footer ------------------------------ */
.em-breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .875rem; color: var(--em-text-muted); }
.em-breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.em-breadcrumbs li + li::before { content: "\203A"; opacity: .6; }
.em-breadcrumbs li + li:dir(rtl)::before { content: "\2039"; }
.em-breadcrumbs a { color: inherit; text-decoration: none; }
.em-breadcrumbs a:hover { color: var(--em-text); text-decoration: underline; }
.em-breadcrumbs [aria-current="page"] { color: var(--em-text); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.em-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.em-pagination a, .em-pagination span { display: inline-grid; place-items: center; min-width: var(--em-tap); height: var(--em-tap); padding: 0 10px; border-radius: 12px;
  color: var(--em-text-muted); text-decoration: none; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.em-pagination a:hover { background: var(--em-fill-1); color: var(--em-text); }
.em-pagination [aria-current="page"] { color: var(--em-text); background: var(--em-fill-2); box-shadow: inset 0 0 0 1px var(--em-rim); font-weight: 600; }
.em-pagination [aria-disabled="true"] { opacity: var(--em-disabled-opacity); pointer-events: none; }
@media (max-width: 480px) { .em-pagination .em-pagination__far { display: none; } }

.em-footer { padding-block: 56px calc(32px + var(--em-safe-bottom)); font-size: .8125rem; color: var(--em-text-muted); box-shadow: inset 0 1px 0 var(--em-rim); }
.em-footer__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.em-footer h3 { font-size: .8125rem; font-weight: 600; color: var(--em-text); margin-bottom: 8px; }
.em-footer ul { list-style: none; padding: 0; margin: 0; display: grid; }
.em-footer a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.em-footer a:hover { color: var(--em-text); text-decoration: underline; }
.em-footer__legal { margin-top: 40px; padding-top: 20px; box-shadow: inset 0 1px 0 var(--em-rim); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---- 17. Motion ------------------------------------------------------- */
.em-reveal { animation: em-rise var(--em-dur-3) var(--em-ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes em-rise { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@supports (animation-timeline: view()) {
  .em-reveal--scroll { animation: em-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}

/* ---- 18. Edge cases --------------------------------------------------- */
/* Touch screens: every control reaches 44px, and hover effects don't stick after a tap */
@media (pointer: coarse) {
  .em-btn--sm { --h: var(--em-tap); }
  .em-segmented label { min-height: 40px; }
  .em-nav__links a { min-height: var(--em-tap); }
  .em-chip:is(button, a) { min-height: 40px; }
  .em-menu__list a, .em-menu__list button { min-height: var(--em-tap); }
}
@media (hover: none) {
  .em-btn:hover, .em-card--hover:hover, a.em-card:hover { transform: none; }
  .em-btn:hover::before { opacity: .5; }
  .em-tip::after { display: none; }
}

/* Reduced motion: no drift, reveals or springs; states still change */
@media (prefers-reduced-motion: reduce) {
  .em-aurora i, .em-reveal, .em-reveal--scroll, .em-skeleton, .em-progress:indeterminate { animation: none !important; }
  .em-page *, .em-page *::before, .em-page *::after, .em-dialog, .em-toast { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .em-page .em-spinner, .em-spinner { animation: em-spin 1.6s linear infinite !important; }   /* loading must still read as loading */
}

/* Reduced transparency (macOS / iOS setting) and browsers without backdrop-filter: solid surfaces */
@media (prefers-reduced-transparency: reduce) {
  .em-glass, .em-card, .em-nav, .em-btn--glass, .em-chip, .em-menu__list, .em-popover, .em-dialog, .em-toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .em-glass, .em-card, .em-dialog, .em-menu__list, .em-popover { background: var(--em-solid-surface) !important; }
  .em-nav { background: var(--em-bg); }
  .em-btn--glass { background: var(--em-solid-btn-glass); }
  .em-aurora i { opacity: calc(var(--em-aurora-opacity) * .6); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .em-glass, .em-card, .em-dialog, .em-menu__list, .em-popover { background: var(--em-solid-surface); }
  .em-nav { background: var(--em-bg); }
  .em-btn--glass { background: var(--em-solid-btn-glass); }
}

/* More contrast requested: stronger edges and text, no texture */
@media (prefers-contrast: more) {
  :root, .em-dark, [data-theme="dark"] { --em-rim: rgba(255,255,255,.4); --em-field-border: rgba(255,255,255,.6); --em-text-muted: #D0D1DA; }
  .em-light, [data-theme="light"] { --em-rim: rgba(0,0,0,.4); --em-field-border: rgba(0,0,0,.6); --em-text-muted: #3A3A42; }
  .em-btn::after, .em-glass::after, .em-card::after { display: none; }
  .em-btn--glass, .em-chip { box-shadow: inset 0 0 0 1.5px currentColor; }
}

/* Windows High Contrast / forced colors: system colours, real borders, visible focus */
@media (forced-colors: active) {
  .em-btn, .em-chip, .em-input, .em-textarea, .em-select, .em-card, .em-glass, .em-dialog, .em-menu__list, .em-toast, .em-alert, .em-segmented, .em-option { border: 1px solid CanvasText; }
  .em-btn--primary { background: ButtonText; color: ButtonFace; }
  .em-btn::before, .em-btn::after, .em-glass::before, .em-glass::after, .em-card::before, .em-card::after, .em-aurora { display: none; }
  .em-check input, .em-switch input { border: 1px solid CanvasText; }
  .em-check input:checked, .em-switch input:checked { background: Highlight; }
  .em-switch input::before { background: CanvasText; }
  .em-page :focus-visible, :focus-visible { outline: 2px solid Highlight !important; outline-offset: 2px; }
  .em-tabs [role="tab"][aria-selected="true"]::after, .em-stepper li::before, .em-progress::-webkit-progress-value { background: Highlight; }
  .em-sunrise-text, .em-sheen-text { color: CanvasText; background: none; -webkit-text-fill-color: CanvasText; }
}

/* Very small screens (320px) */
@media (max-width: 359px) {
  .em-btn { --pad: 16px; }
  .em-btn--lg { --h: 52px; font-size: 1.0625rem; }
  .em-card { padding: 18px; }
}
/* Landscape phones: short viewport, keep heroes and dialogs usable */
@media (max-height: 480px) and (orientation: landscape) {
  .em-hero { min-height: auto; padding-block: 48px; }
  .em-dialog { max-height: 94dvh; }
}

/* Print: paper-friendly, no aurora or glass, link targets shown */
@media print {
  .em-aurora, .em-nav, .em-toasts, .em-banner, .em-nav__toggle, .em-skip-link { display: none !important; }
  .em-page { background: #fff !important; color: #000 !important; }
  .em-glass, .em-card { background: #fff !important; box-shadow: none !important; border: 1px solid #ccc; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; break-inside: avoid; }
  .em-btn { box-shadow: none !important; border: 1px solid #000; color: #000 !important; background: #fff !important; text-shadow: none; }
  .em-btn::before, .em-btn::after, .em-glass::before, .em-glass::after, .em-card::before, .em-card::after { display: none; }
  .em-sunrise-text, .em-sheen-text { color: #C2410C !important; background: none !important; -webkit-text-fill-color: currentColor; }
  a[href^="http"]:not(.em-btn)::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
