/* ═══════════════════════════════════════════════════════════════════════════
   ems-design.css — the EMS US Transition Hub design system. LOADED LAST.

   Tyler, 11-05: the app needs "that same polished, fresh look [as our MPMA
   Manufacturing-Pathways app] ... smooth transitions, everything". EMS US
   approved the CONTENT on 10/22 (questions, wording, steps, nav, flows), so
   this file changes the VISUAL layer only: type, spacing, surfaces, controls,
   hierarchy and motion. Brand stays: navy #2A3890, flag red #BE1E2D, the logo.

   How it works: every class the screens already use (Michelle's .card, .stat,
   .ghost, .tabbar, .gate-choice ...) is re-skinned here, so a screen improves
   without being rewritten. New screens use the same classes or the .ems-*
   recipes at the bottom. The rulebook is DESIGN.md at the repo root; motion is
   assets/js/ems-motion.js.

   The hierarchy rule (Pathways hierarchy.css, Tyler 10-12), app-wide:
   1. Canvas, then surfaces: a cool gray page; white surfaces lift off it with a
      soft shadow. No 1px outline just to show a surface is a surface.
   2. A coloured edge MEANS something: navy ring = selected; red = needs you /
      your next step / crisis; dashed = an empty slot. Nothing else gets one.
   3. Never a card inside a card: a surface inside a surface becomes a soft
      fill; rows inside a surface are soft rows, not boxes.
   4. One loud thing per column: the page title, then one raised "next step".
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens ──────────────────────────────────────────────────────────── */
:root {
  /* Navy, from the brand #2A3890 */
  --ems-navy-50: #eef0fa;
  --ems-navy-100: #dfe3f5;
  --ems-navy-200: #c3cae9;
  --ems-navy-300: #97a2d6;
  --ems-navy-400: #6371bd;
  --ems-navy-500: #2A3890;
  --ems-navy-600: #24317f;
  --ems-navy-700: #1e296c;
  --ems-navy-800: #162063;
  --ems-navy-900: #0e1547;
  /* Flag red, from the brand #BE1E2D: attention, your next step, crisis */
  --ems-red-50: #fdf1f2;
  --ems-red-100: #fbe0e3;
  --ems-red-200: #f4b9bf;
  --ems-red-400: #d94b58;
  --ems-red-500: #BE1E2D;
  --ems-red-600: #a01523;
  --ems-red-700: #7a1420;
  /* Brass and sky (Tyler 11-09: "a little too bland ... subtly mix in anything
     else"): two quiet accents beside the navy and red. Brass = honour, a win, a
     number worth noticing (the colour of insignia); sky = a calm, informational
     tint. Small doses only: labels, plates, a highlight - never a whole surface. */
  --ems-gold-50: #fbf5e6;
  --ems-gold-100: #f5e7c4;
  --ems-gold-300: #e2c078;
  --ems-gold-400: #d6aa4c;
  --ems-gold-500: #c39130;
  --ems-gold-700: #7f5d17;
  --ems-sky-50: #ebf3fc;
  --ems-sky-100: #d6e7f8;
  --ems-sky-500: #3a7cc0;
  --ems-sky-700: #235688;
  /* Cool neutrals, tinted toward the navy */
  --ems-ink: #131a2c;
  --ems-ink-2: #2c3548;
  --ems-mute: #4a5468;
  --ems-mute-2: #6b7488;
  --ems-faint: #9aa3b8;
  --ems-line: #e3e7f1;
  --ems-line-2: #d0d6e6;
  --ems-soft: #f2f4f9;
  --ems-soft-2: #e9edf6;
  --ems-canvas: #e6eaf3;
  --ems-surface: #ffffff;
  /* Status */
  --ems-good: #1f7a4d; --ems-good-50: #e8f5ee;
  --ems-warn: #a15c07; --ems-warn-50: #fff4e2;

  /* Type: Montserrat for headings and numbers, Poppins for UI (nav, buttons,
     labels, chips), Lato for reading. Oswald is kept ONLY for the EMS wordmark
     line beside the logo. */
  --ems-font-display: "Montserrat", "Poppins", "Segoe UI", system-ui, sans-serif;
  --ems-font-ui: "Poppins", "Montserrat", "Segoe UI", system-ui, sans-serif;
  --ems-font-body: "Lato", "Segoe UI", system-ui, sans-serif;
  --ems-font-wordmark: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --ems-fs-xs: 12px;
  --ems-fs-sm: 13.5px;
  --ems-fs-base: 15px;
  --ems-fs-md: 16.5px;
  --ems-fs-lg: 19px;
  --ems-fs-xl: 22px;
  --ems-fs-2xl: clamp(26px, 2.4vw, 32px);

  /* Space (4px grid), radii */
  --ems-s-1: 4px; --ems-s-2: 8px; --ems-s-3: 12px; --ems-s-4: 16px;
  --ems-s-5: 20px; --ems-s-6: 24px; --ems-s-8: 32px; --ems-s-10: 40px;
  --ems-r-sm: 8px; --ems-r-md: 12px; --ems-r-lg: 16px; --ems-r-xl: 20px; --ems-r-pill: 999px;

  /* Depth */
  --ems-lift: 0 0 0 1px rgba(22, 32, 99, .05), 0 1px 3px rgba(22, 32, 99, .10), 0 10px 24px -12px rgba(22, 32, 99, .28);
  --ems-lift-hover: 0 0 0 1px rgba(22, 32, 99, .06), 0 2px 4px rgba(22, 32, 99, .08), 0 18px 34px -18px rgba(22, 32, 99, .45);
  --ems-raise: 0 2px 4px rgba(22, 32, 99, .08), 0 22px 40px -22px rgba(22, 32, 99, .55);
  --ems-pop: 0 1px 2px rgba(14, 21, 71, .08), 0 30px 80px -24px rgba(14, 21, 71, .5), 0 0 0 1px rgba(14, 21, 71, .06);
  --ems-focus: 0 0 0 4px rgba(42, 56, 144, .22);

  /* Motion: smooth comes from the CURVE, never the length (Work Hub 9e7210b). */
  --ems-ease: cubic-bezier(.2, .8, .2, 1);
  --ems-ease-out: cubic-bezier(.22, 1, .36, 1);
  --ems-ease-pop: cubic-bezier(.18, .9, .2, 1);
  --ems-spring: cubic-bezier(.34, 1.36, .64, 1);
  --ems-dur-fast: 120ms;
  --ems-dur: 180ms;
  --ems-dur-view: 280ms;
  --ems-dur-pop: 260ms;

  /* The older token names every existing sheet reads, pointed at the system
     so legacy rules pick up the new look without being touched. (The tenant
     theme still sets --primary/--accent/--bg/--sidebar inline on <html>.) */
  --ems-display: var(--ems-font-display);
  --wt-font-stack: var(--ems-font-body);
  --wt-font-head: var(--ems-font-display);
  --wt-radius-sm: var(--ems-r-sm);
  --wt-radius-md: var(--ems-r-md);
  --wt-radius-lg: var(--ems-r-lg);
  --wt-radius-xl: var(--ems-r-xl);
  --wt-shadow-1: var(--ems-lift);
  --wt-shadow-2: var(--ems-lift-hover);
  --wt-shadow-3: var(--ems-pop);
  --wt-ease: var(--ems-ease);
  --wt-transition-fast: var(--ems-dur-fast) var(--ems-ease);
  --wt-transition-med: var(--ems-dur) var(--ems-ease);
  --wt-skeleton-base: var(--ems-soft-2);
  --wt-skeleton-sheen: #f8f9fd;
  --primary-tint: var(--ems-navy-50);
  --muted: var(--ems-mute);
  --border: var(--ems-line);
  --soft: var(--ems-soft);
  --ink-soft: var(--ems-mute);
}
@media (prefers-reduced-motion: reduce) {
  :root { --ems-dur-fast: 0s; --ems-dur: 0s; --ems-dur-view: 0s; --ems-dur-pop: 0s; }
}

/* ── 2. Base ────────────────────────────────────────────────────────────── */
html { background: var(--ems-canvas); }
body {
  font-family: var(--ems-font-body); font-size: var(--ems-fs-base); line-height: 1.5;
  color: var(--ems-ink); background: var(--ems-canvas);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
/* Controls inherit the app's type (a <button> otherwise falls back to Arial). */
button, input, select, textarea { font-family: inherit; }
button { font-family: var(--ems-font-ui); }
h1, h2, h3, h4 { font-family: var(--ems-font-display); letter-spacing: -.01em; text-wrap: balance; }
:is(#view, .modal, .gate-wrap) :is(h1, h2, h3, h4) { color: var(--ems-navy-800); }
:is(#view, .modal, .gate-wrap) :is(.dash-hero, .bubble.user, .msg.user) :is(h1, h2, h3, h4) { color: #fff; }
a { color: var(--ems-navy-500); text-underline-offset: 2px; }
a:hover { color: var(--ems-navy-700); }
::selection { background: var(--ems-navy-100); color: var(--ems-navy-900); }
:focus-visible { outline: 3px solid rgba(42, 56, 144, .45); outline-offset: 2px; }
b, strong { font-weight: 700; }
.muted { color: var(--ems-mute); }
.small { font-size: var(--ems-fs-sm); }
.lead { font-size: var(--ems-fs-md); line-height: 1.6; color: var(--ems-ink-2); }
.callout { background: var(--ems-navy-50); border-radius: var(--ems-r-md); padding: 14px 16px; margin: 12px 0; color: var(--ems-navy-800); line-height: 1.55; }
/* A long URL or address never pushes a phone page sideways. */
#view { overflow-wrap: break-word; }
#view :is(.muted, a, small, code) { overflow-wrap: anywhere; }
hr { border: 0; height: 1px; background: var(--ems-line); margin: 18px 0; }

/* ── 3. The shell ───────────────────────────────────────────────────────── */
/* Top bar: white, the EMS red hairline, one row. Its menus are topbar.css. */
.app-topbar { height: 64px; padding: 0 24px 0 20px; border-bottom: 2px solid var(--ems-red-500); box-shadow: 0 1px 0 rgba(22, 32, 99, .04), 0 6px 18px -14px rgba(22, 32, 99, .35); }
.app-topbar-logo { height: 40px; }
.app-topbar .app-topbar-powered { font-family: var(--ems-font-wordmark); font-weight: 600; font-size: 19px; letter-spacing: .01em; color: var(--ems-navy-500); }
#app { height: calc(100vh - 64px); }

/* Sidebar: the navy column. Icon plates, Poppins labels, one sliding pill for
   where you are (ems-motion.js places .ems-nav-pill; without JS the active
   row paints its own background). */
.sidebar {
  padding: 18px 12px 0;
  background: linear-gradient(180deg, var(--ems-navy-800) 0%, var(--ems-navy-900) 100%);
}
.brand { margin-bottom: 6px; }
.brand-head { padding: 6px 8px 16px; border-bottom: 1px solid rgba(255, 255, 255, .09); text-align: left; }
.brand-title { font-family: var(--ems-font-display) !important; font-weight: 800; font-size: 19px; letter-spacing: -.01em; text-transform: none; color: #fff; }
.brand-tag { font-family: var(--ems-font-ui); font-size: 12px; color: rgba(255, 255, 255, .62); opacity: 1; margin-top: 3px; }
#nav { position: relative; gap: 2px; }
.nav-group {
  font-family: var(--ems-font-ui); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: rgba(226, 192, 120, .78); padding: 16px 10px 6px;   /* brass, like insignia on navy */
}
#nav > .nav-group:first-child, #nav > .ems-nav-pill + .nav-group { padding-top: 8px; }
.sidebar nav a, #nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: var(--ems-r-md); opacity: 1;
  font-family: var(--ems-font-ui); font-size: 14px; font-weight: 500; line-height: 1.3; color: rgba(255, 255, 255, .84);
  transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease);
}
.sidebar nav a:hover, #nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
/* Where you are: a white pill with navy type and the EMS red edge (Tyler 11-08:
   there is no page title any more, so the sidebar has to say it on its own). */
.sidebar nav a.active, #nav a.active, #nav a.active:hover { background: #fff; color: var(--ems-navy-800); font-weight: 700; }
#nav.has-pill a.active, #nav.has-pill a.active:hover { background: transparent; }
#nav .nav-ic {
  width: 30px; height: 30px; border-radius: 9px; opacity: 1;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); color: #fff;
  transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
#nav .nav-ic .ic { width: 17px; height: 17px; }
#nav a.active .nav-ic { background: var(--ems-navy-500); color: #fff; box-shadow: none; }
#nav a:hover .nav-ic { background: rgba(255, 255, 255, .12); }
#nav a.active:hover .nav-ic { background: var(--ems-navy-500); }
/* A member's Dashboard: above the sections, on its own (app.js buildNav). The
   tools below help you get there; this is where you work. */
#nav a.nav-home { margin: 4px 0 6px; padding: 10px; font-size: 15px; font-weight: 650; color: #fff;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
#nav a.nav-home:hover { background: rgba(255, 255, 255, .12); }
#nav a.nav-home .nav-ic, #nav a.nav-home:hover .nav-ic, #nav a.nav-home.active .nav-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--ems-red-500); box-shadow: none; color: #fff; }
#nav a.nav-home .nav-lbl small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, .62); }
#nav a.nav-home.active .nav-lbl small { color: var(--ems-mute); }
#nav a.nav-home.active, #nav a.nav-home.active:hover { background: #fff; color: var(--ems-navy-800); }
#nav.has-pill a.nav-home.active, #nav.has-pill a.nav-home.active:hover { background: transparent; box-shadow: none; }
#nav > a.nav-home + .nav-group { padding-top: 14px; }
.nav-toggle { font-style: normal; margin-top: 10px; border-top: 1px solid rgba(255, 255, 255, .09); border-radius: 0 0 var(--ems-r-md) var(--ems-r-md); color: rgba(255, 255, 255, .7); }
#nav a.nav-toggle .nav-ic { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
/* The pill: one shape that slides to where you are. */
.ems-nav-pill {
  position: absolute; z-index: 0; left: 0; top: 0; width: 0; height: 0; pointer-events: none;
  border-radius: var(--ems-r-md); background: #fff; box-shadow: inset 4px 0 0 var(--ems-red-500), 0 6px 16px -8px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity var(--ems-dur) var(--ems-ease);
}
.ems-nav-pill.is-on { opacity: 1; }
.ems-nav-pill.is-gliding { transition: transform 300ms var(--ems-ease-out), width 300ms var(--ems-ease-out), height 300ms var(--ems-ease-out), opacity var(--ems-dur) var(--ems-ease); }
.sidebar-foot { margin: 16px -12px 0; padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, .09); background: rgba(0, 0, 0, .12); }
.powered-by { margin-top: 0; padding-top: 0; border-top: 0; font-family: var(--ems-font-ui); font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, .62); }
.disclaimer { font-size: 11.5px; opacity: 1; color: rgba(255, 255, 255, .5); line-height: 1.55; margin-top: 10px; }
.disclaimer b { color: rgba(255, 255, 255, .85); }

/* The page: canvas, a calm header, the work. */
.content { padding: 28px 36px 24px; background: var(--ems-canvas); }
.content > .topbar, .content > #view, .content > .app-footer { max-width: 1120px; margin-left: auto; margin-right: auto; }
.topbar { margin-bottom: 22px; }
/* No title + tagline above the page (Tyler 11-08: "wasted space"): the page
   starts with its work, the sidebar pill says where you are. The h1 stays in
   the document for screen readers. */
.content > .topbar { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar h1, .content > .topbar h1 {
  margin: 0 0 6px; font-family: var(--ems-font-display) !important; font-weight: 800; font-size: var(--ems-fs-2xl);
  line-height: 1.15; letter-spacing: -.015em; text-transform: none; color: var(--ems-navy-800);
}
.tagline { font-size: var(--ems-fs-base); line-height: 1.45; color: var(--ems-mute); max-width: 70ch; }
.app-footer {
  margin-top: 36px; padding: 14px 2px 6px; border-top: 1px solid rgba(22, 32, 99, .10);
  font-family: var(--ems-font-ui); font-size: 12px; color: var(--ems-mute-2); text-align: left;
}
.app-footer b { color: var(--ems-navy-500); font-weight: 600; }

/* ── 4. Surfaces ────────────────────────────────────────────────────────── */
.card {
  background: var(--ems-surface); border: 0; border-radius: var(--ems-r-lg);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--ems-lift);
}
.card h2, .card h3 {
  font-family: var(--ems-font-display) !important; text-transform: none; letter-spacing: -.01em;
  color: var(--ems-navy-800); text-wrap: balance;
}
.card h2 { font-size: 17.5px; font-weight: 700; line-height: 1.3; margin: 0 0 14px; }
.card h3 { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.card h2 .ic, .card h3 .ic { color: var(--ems-navy-500); }
.card > :last-child { margin-bottom: 0; }
/* Rule 3: never a card inside a card. The inner one becomes a soft fill. */
.card .card, .card .tile, .card .journey-card, .card .culture-card, .card .tl-body, .card .stat {
  background: var(--ems-soft); box-shadow: none; border: 0;
}
.card .card { padding: 14px 16px; border-radius: var(--ems-r-md); margin-bottom: 12px; }
.card.soft { background: var(--ems-soft); box-shadow: none; padding: 14px 16px; }
.card.error, .error { background: var(--ems-red-50); color: var(--ems-red-700); box-shadow: none; border-radius: var(--ems-r-md); }
.card.wt-empty { box-shadow: none; }
/* Rule 4: the ONE raised thing on a page, "your next step". Red = needs you. */
.plan-next, .ems-next {
  position: relative; overflow: hidden; border-left: 0 !important;
  box-shadow: var(--ems-raise);
}
.plan-next::before, .ems-next::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--ems-red-500), var(--ems-red-400)); }
/* The other "notice" cards (a check-in is ready, your mentor): quiet, a navy
   plate on the left instead of an outline. */
.plan-checkin, .plan-mentor, .mentor-hero {
  border-left: 0; background: linear-gradient(90deg, var(--ems-navy-50), #fff 46%);
}
.plan-checkin > .ic:first-child, .plan-mentor > .ic:first-child, .plan-mentor > svg:first-child, .plan-checkin > svg:first-child {
  flex: none; box-sizing: content-box; padding: 9px; border-radius: 11px; background: #fff; color: var(--ems-navy-500); box-shadow: var(--ems-lift);
}
/* The dark hero panels (mentor/admin dashboards): Pathways' "next step" panel. */
.dash-hero {
  border-radius: var(--ems-r-xl); padding: 24px 28px;
  background: radial-gradient(900px 300px at 110% -40%, rgba(255, 255, 255, .14), transparent 60%), linear-gradient(120deg, var(--ems-navy-900), var(--ems-navy-500));
  box-shadow: var(--ems-raise);
}
.dash-hero h2 { font-size: 20px; color: #fff; }
.dash-ring-num, .dash-ring-lbl { font-family: var(--ems-font-display); }
.hero {
  background: radial-gradient(800px 260px at 100% 0, rgba(42, 56, 144, .10), transparent 60%), #fff;
  border: 0; border-radius: var(--ems-r-xl); box-shadow: var(--ems-lift); padding: 28px 30px;
}
.hero h2 { font-size: 24px; font-weight: 800; }
.hero p { color: var(--ems-mute); }

/* Tiles that open something (tool pickers, journey cards). */
.tiles, .journey-grid { gap: 14px; }
.tile, .journey-card, .culture-card, .gate-card {
  border: 0; border-radius: var(--ems-r-lg); background: #fff; box-shadow: var(--ems-lift);
  transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
.tile:hover, .journey-card:hover { transform: translateY(-2px); box-shadow: var(--ems-lift-hover); }
.tile h3, .journey-card h4, .culture-head h3, .gate-card h3 { font-family: var(--ems-font-display); font-weight: 700; color: var(--ems-navy-800); text-transform: none; }
.tile p, .journey-card .jc-tag { color: var(--ems-mute); }
.journey-card .jc-statement { color: var(--ems-navy-500); font-family: var(--ems-font-ui); font-weight: 600; }

/* ── 5. Scorecards: number + one-line name, left aligned, lifted ─────────── */
.stat-row, .stat-grid { gap: 14px; }
.stat {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 84px; padding: 16px 18px; text-align: left;
  background: #fff; border: 0; border-radius: var(--ems-r-lg); box-shadow: var(--ems-lift);
}
.stat-n, .stat-num {
  font-family: var(--ems-font-display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: -.02em;
  color: var(--ems-navy-500); font-variant-numeric: tabular-nums;
}
.stat-l, .stat-label { margin: 0; font-family: var(--ems-font-ui); font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--ems-ink-2); }
/* A scorecard that is a button (the mentor dashboard's) lifts and presses. */
button.stat, .stat.dash-metric[role="button"], a.stat {
  cursor: pointer; font: inherit; color: inherit;
  transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
button.stat:hover, a.stat:hover { transform: translateY(-2px); box-shadow: var(--ems-lift-hover); }
button.stat:active { transform: translateY(0) scale(.99); }
.dash-metric { border: 0 !important; }
/* Red number = something waiting on you (the screens already pick it). */
.stat-n[style*="ems-red"], .stat-n[style*="BE1E2D"] { color: var(--ems-red-500); }
/* Inside a surface: soft tiles, no lift (rule 3). */
.card .stat { background: var(--ems-soft); box-shadow: none; min-height: 76px; }
.scores { gap: 10px; }
.score, .score-card { background: var(--ems-soft); border: 0; border-radius: var(--ems-r-md); }
.score b, .score-card summary b { font-family: var(--ems-font-display); font-weight: 800; color: var(--ems-navy-500); }
.score-card[open] { background: #fff; box-shadow: var(--ems-lift); }
.gauge-num, .plan-meter-n, .sv-avg, .dash-ring-num { font-family: var(--ems-font-display); font-weight: 800; letter-spacing: -.02em; color: var(--ems-navy-500); }
.dash-hero .dash-ring-num { color: #fff; }

/* ── 6. Rows inside a surface: soft fills, never boxed ───────────────────── */
.res-list { gap: 8px; }
.res-item {
  border: 0; border-radius: var(--ems-r-md); background: var(--ems-soft); padding: 12px 14px;
  transition: background-color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
.res-item:hover { background: #fff; transform: translateY(-1px); box-shadow: var(--ems-lift-hover); border: 0; }
.res-item-title { font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }
.res-item-desc { color: var(--ems-mute); }
.res-item:hover .res-item-ic { color: var(--ems-navy-500); }
.plan-steps { gap: 8px; }
.plan-step { border: 0; border-radius: var(--ems-r-md); background: var(--ems-soft); padding: 12px 14px; transition: background-color var(--ems-dur) var(--ems-ease); }
.plan-step.current { background: var(--ems-navy-50); box-shadow: inset 0 0 0 1.5px var(--ems-navy-500); }
.plan-step.done { opacity: 1; }
.plan-step.done > div, .plan-step.done b { color: var(--ems-mute); }
.plan-no { background: #fff; color: var(--ems-navy-500); font-family: var(--ems-font-ui); box-shadow: 0 0 0 1px var(--ems-line-2); }
.plan-step.done .plan-no { background: var(--ems-navy-500); color: #fff; box-shadow: none; }
.plan-step.current .plan-no { background: var(--ems-red-500); color: #fff; box-shadow: 0 0 0 4px rgba(190, 30, 45, .14); }
.list-note, .mentor-mile, .coach-option, .adm-req, .adm-code, .sv-sum { border-color: transparent; }
.list-note { background: var(--ems-soft); border: 0; border-radius: var(--ems-r-md); }
.mentor-mile { background: var(--ems-soft); border: 0; border-radius: var(--ems-r-md); }
.mentor-mile.is-done { background: var(--ems-good-50); }
.mentor-mile-t, .mentor-mile-no { font-family: var(--ems-font-ui); }
.adm-req, .adm-code, .sv-sum { border-top: 1px solid var(--ems-line); }
.adm-kv, .checkrow { border-bottom-color: var(--ems-line); }
.hrow { border-left: 3px solid var(--ems-line-2); }
.tl-body { border: 0; border-radius: var(--ems-r-md); box-shadow: var(--ems-lift); }
.tl-stage.is-active .tl-body { box-shadow: 0 0 0 2px var(--ems-red-500), var(--ems-lift); }
.tl-when, .tri-h, .star-comp { font-family: var(--ems-font-ui); font-weight: 600; text-transform: none; letter-spacing: 0; }
.tri-card { border: 0; border-radius: var(--ems-r-md); background: var(--ems-soft); }
.tri-card:last-child { background: var(--ems-red-50); }
.star-card { border-left: 0; }
.dash-steps { gap: 12px; }
.dash-step {
  border: 0 !important; border-radius: var(--ems-r-lg); background: #fff; box-shadow: var(--ems-lift);
  transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
.dash-step:hover { transform: translateY(-2px); box-shadow: var(--ems-lift-hover); }
.dash-step.is-active { box-shadow: 0 0 0 2px var(--ems-red-500), var(--ems-lift); }
.card .dash-step { background: var(--ems-soft); box-shadow: none; }
.card .dash-step.is-active { box-shadow: inset 0 0 0 2px var(--ems-red-500); background: #fff; }
.dash-step-label { font-family: var(--ems-font-ui); font-weight: 600; }
.pw-card { padding: 0; }
.pw-head { transition: background-color var(--ems-dur) var(--ems-ease); }
.pw-head:hover, .pw-card.is-open .pw-head { background: var(--ems-navy-50); }
.pw-card.is-open .pw-head { border-bottom: 0; }
.pw-ic, .coach-tab-ic, .gc-ic, .pf-ic { border-radius: 11px; }
.pw-entry { background: var(--ems-navy-50); border-radius: var(--ems-r-md); }
.pw-actions { border-top-color: var(--ems-line); }
.pw-rung-no { background: var(--ems-navy-500); font-family: var(--ems-font-ui); }
.culture-tag.civ { background: var(--ems-red-50); color: var(--ems-red-700); }
.dm-out, pre.resume { border: 0; background: var(--ems-soft); border-radius: var(--ems-r-md); }
.crisis-banner {
  border: 0; border-left: 4px solid var(--ems-red-500); border-radius: var(--ems-r-md);
  background: var(--ems-red-50); color: var(--ems-red-700); box-shadow: none;
}
.crisis-footer { border-top-color: var(--ems-line); }

/* Tables: the header is a quiet label row; rows are soft on hover. */
.tbl-wrap { border: 0; border-radius: var(--ems-r-md); background: #fff; box-shadow: 0 0 0 1px var(--ems-line); }
.wt-table thead th { font-family: var(--ems-font-ui); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; color: var(--ems-mute-2); background: var(--ems-soft); border-bottom: 0; }
.wt-table tbody td { border-bottom-color: var(--ems-line); }
.wt-table tbody tr { transition: background-color var(--ems-dur-fast) var(--ems-ease); }
.wt-table tbody tr:hover td { background: var(--ems-navy-50); }
.md td, .md th { border-color: var(--ems-line); }
.md h1, .md h2, .md h3 { font-family: var(--ems-font-display); color: var(--ems-navy-800); }

/* ── 7. Buttons: one filled action, everything else quiet ───────────────── */
button.primary, a.primary, .btn, .btn.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border: 0; border-radius: var(--ems-r-md);
  background: var(--ems-navy-500); color: #fff;
  font-family: var(--ems-font-ui); font-size: 14.5px; font-weight: 600; line-height: 1.2; letter-spacing: 0; text-transform: none;
  box-shadow: 0 1px 2px rgba(14, 21, 71, .18), 0 8px 18px -8px rgba(42, 56, 144, .55);
  cursor: pointer; filter: none;
  transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease);
}
button.primary:hover, a.primary:hover, .btn:hover, .btn.primary:hover {
  background: var(--ems-navy-700); color: #fff; filter: none; transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(14, 21, 71, .16), 0 14px 26px -12px rgba(42, 56, 144, .6);
}
button.primary:active, a.primary:active, .btn:active { transform: translateY(0) scale(.98); transition-duration: 60ms; }
button.primary:focus-visible, a.primary:focus-visible, .btn:focus-visible,
button.ghost:focus-visible, a.ghost:focus-visible { outline: none; box-shadow: var(--ems-focus); }
button.primary:disabled, .btn:disabled, button.primary[aria-disabled="true"] {
  background: var(--ems-navy-200); color: #fff; box-shadow: none; transform: none; cursor: not-allowed; opacity: 1;
}
/* Secondary: white, navy words, a hairline that warms on hover. */
button.ghost, a.ghost, .btn.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--ems-line-2); border-radius: var(--ems-r-md);
  background: #fff; color: var(--ems-navy-600); box-shadow: 0 1px 2px rgba(22, 32, 99, .05);
  font-family: var(--ems-font-ui); font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: border-color var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease);
}
button.ghost:hover, a.ghost:hover, .btn.ghost:hover { border-color: var(--ems-navy-300); background: var(--ems-navy-50); color: var(--ems-navy-700); transform: translateY(-1px); filter: none; }
button.ghost:active, a.ghost:active, .btn.ghost:active { transform: translateY(0) scale(.98); }
button.ghost:disabled { color: var(--ems-faint); background: #fff; border-color: var(--ems-line); transform: none; cursor: not-allowed; }
button.ghost.is-on, .btn.ghost.is-on { background: var(--ems-navy-500); border-color: var(--ems-navy-500); color: #fff; }
a.primary:visited { color: #fff; }
a.ghost:visited { color: var(--ems-navy-600); }
/* Danger: quiet until you mean it. Accent (red fill) is for a real alarm only. */
.btn.danger, button.danger, .ems-btn-danger { background: #fff; color: var(--ems-red-600); border: 1px solid var(--ems-red-200); box-shadow: none; }
.btn.danger:hover, button.danger:hover, .ems-btn-danger:hover { background: var(--ems-red-50); border-color: var(--ems-red-400); color: var(--ems-red-700); }
.btn.accent { background: var(--ems-red-500); }
.btn.accent:hover { background: var(--ems-red-600); }
/* Sizes */
button.small, a.small.ghost, a.small.primary, .btn.small { min-height: 34px; padding: 6px 12px !important; font-size: 13px !important; border-radius: 10px; }
.btn.xsmall { min-height: 30px; padding: 4px 10px; font-size: 12.5px; border-radius: 9px; }
button.big, a.big { min-height: 52px; font-size: 16px !important; padding: 14px 26px !important; border-radius: 14px !important; }
.btn-row { gap: 10px; }
/* A link that is a button-shaped word ("Change my goals"). */
.linkish { font-family: var(--ems-font-ui); font-weight: 600; font-size: 13.5px; color: var(--ems-navy-500); text-decoration: none; border-radius: 6px; transition: color var(--ems-dur) var(--ems-ease); }
.linkish:hover { color: var(--ems-navy-700); text-decoration: underline; }
.iconbtn { border-radius: 9px; border-color: var(--ems-line-2); font-family: var(--ems-font-ui); transition: background-color var(--ems-dur) var(--ems-ease), border-color var(--ems-dur) var(--ems-ease); }
.iconbtn:hover { background: var(--ems-navy-50); border-color: var(--ems-navy-200); }
.iconbtn.rec { background: var(--ems-red-50); border-color: var(--ems-red-200); color: var(--ems-red-700); }

/* ── 8. Fields ──────────────────────────────────────────────────────────── */
label.field { margin-bottom: 16px; font-family: var(--ems-font-ui); font-size: var(--ems-fs-sm); font-weight: 600; color: var(--ems-ink); }
label.field > span:first-child { margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
select, textarea {
  min-height: 44px; padding: 10px 14px; border: 1px solid var(--ems-line-2); border-radius: var(--ems-r-md);
  background-color: #fff; color: var(--ems-ink); font-family: var(--ems-font-body); font-size: var(--ems-fs-base); font-weight: 400; line-height: 1.4;
  box-shadow: 0 1px 2px rgba(22, 32, 99, .04);
  transition: border-color var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease);
}
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):hover, select:hover, textarea:hover { border-color: var(--ems-navy-200); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ems-navy-500); box-shadow: 0 0 0 4px rgba(42, 56, 144, .14);
}
input::placeholder, textarea::placeholder { color: var(--ems-faint); }
textarea { min-height: 120px; line-height: 1.55; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232A3890' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
select[multiple] { background-image: none; padding-right: 14px; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--ems-navy-500); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--ems-soft); color: var(--ems-mute-2); cursor: not-allowed; }
/* The top bar's search keeps its own pill (topbar.css); the field rule above
   must not box it. Id-scoped so it outranks the :not() chain. */
#topSearchInput, #topSearchInput:hover, #topSearchInput:focus { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-family: var(--ems-font-body); }
/* The sidebar's own selects (workspace switch) stay compact on the navy. */
.sidebar select { min-height: 36px; border: 0; box-shadow: none; }

/* ── 9. Choice cards (the wizard's big options, pickers, persona tabs) ─────
   Pathways pf-card: white, a 1.5px line, an icon plate; picked = navy ring,
   navy-50 fill, the plate fills navy. Picking never reflows the words. */
.gate-choices { gap: 10px; }
.gate-choice, .gate-check, .coach-option, .coach-tab, .demo-acct, .sv-opt, .sv-scale label {
  background: #fff; border: 1.5px solid var(--ems-line-2); border-radius: 14px; color: var(--ems-ink);
  font-family: var(--ems-font-ui); box-shadow: 0 1px 2px rgba(22, 32, 99, .04);
  transition: border-color var(--ems-dur-fast) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease);
}
.gate-choice { padding: 14px 16px; font-size: 15px; min-height: 72px; }
.gate-choice b, .gate-choice strong { font-weight: 600; color: var(--ems-navy-800); }
.gate-choice:hover, .gate-check:hover, .coach-option:hover, .coach-tab:hover, .demo-acct:hover, .sv-opt:hover, .sv-scale label:hover {
  border-color: var(--ems-navy-300); background: #fff; box-shadow: 0 2px 10px rgba(22, 32, 99, .08); transform: translateY(-1px);
}
.gate-choice.on, .gate-check.on, .coach-option.selected, .coach-tab.is-active, .sv-scale label:has(input:checked), .sv-opt:has(input:checked) {
  border-color: var(--ems-navy-500); background: var(--ems-navy-50); box-shadow: inset 0 0 0 1px var(--ems-navy-500);
}
.gc-ic, .coach-tab-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--ems-navy-50); color: var(--ems-navy-500); transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease), transform 220ms var(--ems-spring); }
.gate-choice:hover .gc-ic, .coach-tab:hover .coach-tab-ic { transform: scale(1.06); }
.gate-choice.on .gc-ic, .coach-tab.is-active .coach-tab-ic { background: var(--ems-navy-500); color: #fff; }
.gate-check { padding: 12px 14px; font-size: 14.5px; }
.gate-check input, .check-opt input, .mentor-mile-chk input { accent-color: var(--ems-navy-500); }
.coach-tab-txt b { font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }
.check-opt { font-family: var(--ems-font-body); }
.check-opt.is-on { color: var(--ems-navy-700); }
.kwopt { background: #fff; border: 1.5px solid var(--ems-line-2); font-family: var(--ems-font-ui); transition: border-color var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease); }
.kwopt:hover { border-color: var(--ems-navy-300); }
.kwopt:has(input:checked) { border-color: var(--ems-navy-500); background: var(--ems-navy-50); }
.value-chip { background: #fff; border: 1.5px solid var(--ems-line-2); color: var(--ems-ink-2); font-family: var(--ems-font-ui); transition: all var(--ems-dur) var(--ems-ease); }
.value-chip:hover { background: var(--ems-navy-50); border-color: var(--ems-navy-300); }
.value-chip.selected { background: var(--ems-navy-500); border-color: var(--ems-navy-500); color: #fff; }
.value-card {
  font-family: var(--ems-font-display); font-weight: 800; color: var(--ems-navy-800);
  background: radial-gradient(500px 200px at 50% 0, var(--ems-navy-50), #fff 70%); border: 0; box-shadow: var(--ems-raise);
}

/* ── 10. Pills, chips, badges ───────────────────────────────────────────── */
.pill, .chip, .chip-row .chip, span.chip, .badge, .res-item-tag, .dash-step-badge, .tl-now {
  display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: var(--ems-r-pill);
  font-family: var(--ems-font-ui); font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.3;
}
.pill { padding: 4px 11px; font-size: 12.5px; background: var(--ems-navy-50); color: var(--ems-navy-700); }
.pill.ok, .badge.ok { background: var(--ems-good-50); color: var(--ems-good); }
.pill.no { background: var(--ems-red-50); color: var(--ems-red-600); }
.badge.wait { background: var(--ems-warn-50); color: var(--ems-warn); }
.chip-row .chip, span.chip { padding: 5px 12px; font-size: 12.5px; background: var(--ems-navy-50); color: var(--ems-navy-700); box-shadow: inset 0 0 0 1px var(--ems-navy-100); }
button.chip { cursor: pointer; transition: background-color var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease); }
button.chip:hover { background: var(--ems-navy-100); }
.badge { padding: 3px 9px; font-size: 11.5px; background: var(--ems-soft-2); color: var(--ems-ink-2); }
.res-item-tag { padding: 2px 8px; font-size: 11px; background: #fff; color: var(--ems-navy-600); box-shadow: inset 0 0 0 1px var(--ems-navy-100); }
.chip-label { font-family: var(--ems-font-ui); font-weight: 600; letter-spacing: .07em; color: var(--ems-navy-500); }

/* ── 11. Tabs: a segmented control ──────────────────────────────────────── */
.tabbar {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 18px; width: fit-content; max-width: 100%;
  background: var(--ems-soft-2); border-radius: 14px; box-shadow: inset 0 1px 2px rgba(22, 32, 99, .06);
}
.tabbar button {
  border: 0; background: transparent; border-radius: 10px; padding: 8px 15px; min-height: 36px;
  font-family: var(--ems-font-ui); font-size: 13.5px; font-weight: 600; color: var(--ems-mute);
  transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
.tabbar button:hover { color: var(--ems-navy-700); background: rgba(255, 255, 255, .55); }
.tabbar button.active { background: #fff; color: var(--ems-navy-700); border-color: transparent; box-shadow: 0 1px 2px rgba(22, 32, 99, .10), 0 4px 10px rgba(22, 32, 99, .07); }
.tabbar button.active .ic-emoji { color: var(--ems-navy-500); }
.card .tabbar { background: var(--ems-soft); }

/* ── 12. Progress, bars, gauges ─────────────────────────────────────────── */
.progress, .gauge-bar, .gate-progress, .bar, .adm-funnel-bar { background: var(--ems-navy-100); border-radius: var(--ems-r-pill); }
.progress-bar, .progress > span, .gauge-fill, .gate-progress > div, .bar > span {
  background: linear-gradient(90deg, var(--ems-navy-500), var(--ems-navy-400)); border-radius: var(--ems-r-pill);
  transition: width 500ms var(--ems-ease);
}
.adm-funnel-bar > div { background: linear-gradient(90deg, var(--ems-navy-500), var(--ems-navy-400)); transition: width 500ms var(--ems-ease); }
.progress-label, .adm-funnel-l, .bar-label { font-family: var(--ems-font-ui); color: var(--ems-mute); }
.adm-funnel-n, .bar-num, .wheel-num { font-family: var(--ems-font-ui); color: var(--ems-navy-600); }

/* ── 13. Empty, loading, errors ─────────────────────────────────────────── */
.wt-empty, .empty {
  display: block; padding: 28px 22px; text-align: center; color: var(--ems-mute);
  background: rgba(255, 255, 255, .6); border: 1.5px dashed var(--ems-line-2); border-radius: var(--ems-r-lg);
  font-family: var(--ems-font-ui); font-size: var(--ems-fs-sm); line-height: 1.55;
}
.card .wt-empty, .card .empty { background: var(--ems-soft); }
.wt-empty b, .empty b { color: var(--ems-navy-800); }
.wt-skeleton {
  border-radius: var(--ems-r-md); min-height: 64px;
  background: linear-gradient(90deg, var(--ems-soft-2) 0%, #f7f8fc 40%, var(--ems-soft-2) 80%); background-size: 200% 100%;
  animation: ems-shimmer 1.2s linear infinite;
}
.wt-skeleton::after { display: none; }
@keyframes ems-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── 14. Pop-ups, sheets, toasts ────────────────────────────────────────── */
.modal-overlay {
  background: rgba(14, 21, 71, .42); -webkit-backdrop-filter: blur(4px) saturate(1.2); backdrop-filter: blur(4px) saturate(1.2);
  animation: ems-fade var(--ems-dur) ease-out both;
}
.modal {
  border-radius: var(--ems-r-xl); box-shadow: var(--ems-pop); overflow: hidden;
  animation: ems-pop-in var(--ems-dur-pop) var(--ems-ease-pop) both;
}
.modal-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--ems-line); border-radius: 0; }
.modal-head h2 { font-family: var(--ems-font-display); font-weight: 700; font-size: var(--ems-fs-lg); color: var(--ems-navy-800); }
.modal-x {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ems-mute);
  transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease);
}
.modal-x:hover { background: var(--ems-soft-2); color: var(--ems-navy-700); }
.modal-x:active { transform: scale(.9); }
.modal-overlay.is-leaving { animation: ems-fade-out 180ms ease-in both; }
.modal-overlay.is-leaving .modal { animation: ems-pop-out 180ms ease-in both; }
@keyframes ems-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ems-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes ems-pop-in { from { opacity: 0; transform: translateY(14px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes ems-pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.985); } }
/* The toast (window.toast): a dark pill that rises from the bottom. */
.toast {
  background: var(--ems-navy-900); color: #fff; border-radius: 14px; padding: 12px 18px;
  font-family: var(--ems-font-ui); font-size: 14px; font-weight: 500;
  box-shadow: 0 2px 6px rgba(14, 21, 71, .2), 0 18px 40px -16px rgba(14, 21, 71, .6);
  transition: opacity var(--ems-dur) var(--ems-ease), transform 320ms var(--ems-ease-pop);
}
/* The demo picker and the top bar's dialogs: same pop-up language. */
.demo-card { border-radius: var(--ems-r-xl); box-shadow: var(--ems-pop); }
.demo-card h2, .tb-dlg-top h2, .bell-head b, .bell-empty b { font-family: var(--ems-font-display); font-weight: 700; text-transform: none; letter-spacing: -.01em; }
.acct-head-txt b { font-family: var(--ems-font-display); font-weight: 700; }

/* ── 15. Chat ───────────────────────────────────────────────────────────── */
.bubble, .msg { border-radius: 16px; font-size: 14.5px; }
.bubble.user, .msg.user { background: var(--ems-navy-500); }
.bubble.coach, .msg.assistant { background: var(--ems-soft); border: 0; }

/* ── 16. The front door (welcome, intake, sign-in): the easy wizard ──────── */
body.gate { background: radial-gradient(1200px 600px at 50% -10%, #dfe4f4 0%, var(--ems-canvas) 60%); }
.gate-hero, .gate-panel {
  border: 0; border-radius: var(--ems-r-xl); box-shadow: var(--ems-pop); background: #fff;
}
.gate-hero { border-top: 0; position: relative; overflow: hidden; }
.gate-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--ems-navy-500), var(--ems-red-500)); }
.gate-hero h1, .gate-panel h2, .gate-how h2 { font-family: var(--ems-font-display); font-weight: 800; text-transform: none; letter-spacing: -.015em; color: var(--ems-navy-800); }
.gate-panel { padding: 26px 28px; }
.gate-panel h2 { font-size: 24px; }
.gate-progress { height: 6px; }
.gate-stepno { font-family: var(--ems-font-ui); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; color: var(--ems-mute); }
.gate-how { border-radius: var(--ems-r-lg); box-shadow: var(--ems-lift); }
.gate-err { font-family: var(--ems-font-ui); color: var(--ems-red-600); }
.gate-code { border-radius: var(--ems-r-md); font-family: var(--ems-font-ui); }
.gate-foot { font-family: var(--ems-font-ui); color: var(--ems-mute-2); }
/* A wizard step arrives sideways-in, the way Pathways' setup does. */
.gate-panel { animation: ems-step-in var(--ems-dur-view) var(--ems-ease-out) both; }
@keyframes ems-step-in { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 17. Motion classes (driven by ems-motion.js; see DESIGN.md) ───────── */
/* A result that arrives inside a page rises in. */
@keyframes ems-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ems-rise { animation: ems-rise 340ms var(--ems-ease-out) both; animation-delay: calc(var(--ems-i, 0) * 45ms); }
/* A list that swapped under a filter: rows glide in, never from blank. */
@keyframes ems-swap-in { from { opacity: .45; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ems-swap-in { animation: ems-swap-in 300ms var(--ems-ease-out) both; animation-delay: calc(var(--ems-i, 0) * 30ms); }
/* Press feedback anything can opt into. */
.ems-press { transition: transform var(--ems-dur-fast) var(--ems-ease); }
.ems-press:active { transform: scale(.97); }

/* ── 18. New-screen recipes (.ems-*) — use these for anything new ────────── */
.ems-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.ems-kicker { margin: 0 0 4px; font: 600 12px/1 var(--ems-font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ems-red-500); }
.ems-title { margin: 0; font: 800 var(--ems-fs-2xl)/1.15 var(--ems-font-display); letter-spacing: -.015em; color: var(--ems-navy-800); }
.ems-sub { margin: 6px 0 0; font-size: var(--ems-fs-base); color: var(--ems-mute); }
.ems-section-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font: 700 var(--ems-fs-lg)/1.25 var(--ems-font-display); color: var(--ems-navy-800); letter-spacing: -.01em; }
.ems-surface { background: #fff; border-radius: var(--ems-r-lg); box-shadow: var(--ems-lift); padding: 22px 24px; }
.ems-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 0 0 22px; }
.ems-scorecard {
  position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center;
  min-height: 76px; padding: 16px; text-align: left; background: #fff; border: 0; border-radius: var(--ems-r-lg); box-shadow: var(--ems-lift);
  font: inherit; color: inherit; cursor: pointer;
  transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
.ems-scorecard:hover { transform: translateY(-2px); box-shadow: var(--ems-lift-hover); }
.ems-scorecard.is-on { box-shadow: 0 0 0 2px var(--ems-navy-500), var(--ems-lift); }
.ems-scorecard.is-hot .ems-scorecard-n { color: var(--ems-red-500); }
.ems-scorecard.is-hot::after { content: ""; position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--ems-red-500); box-shadow: 0 0 0 4px rgba(190, 30, 45, .14); }
.ems-scorecard-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); }
.ems-scorecard-n { font: 800 26px/1 var(--ems-font-display); color: var(--ems-navy-500); font-variant-numeric: tabular-nums; }
.ems-scorecard-l { min-width: 0; font: 500 13.5px/1.25 var(--ems-font-ui); color: var(--ems-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ems-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--ems-r-md); background: var(--ems-soft); transition: background-color var(--ems-dur) var(--ems-ease); }
.ems-row:hover { background: var(--ems-soft-2); }
.ems-row.is-sel { background: var(--ems-navy-50); box-shadow: inset 0 0 0 1.5px var(--ems-navy-500); }
.ems-row.is-hot { background: var(--ems-red-50); }
.ems-rows { display: flex; flex-direction: column; gap: 8px; }
.ems-plate { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); }
.ems-choice {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; text-align: left; width: 100%;
  background: #fff; border: 1.5px solid var(--ems-line-2); border-radius: 14px; font: 500 15px/1.35 var(--ems-font-ui); color: var(--ems-ink); cursor: pointer;
  transition: border-color var(--ems-dur-fast) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease);
}
.ems-choice:hover { border-color: var(--ems-navy-300); box-shadow: 0 2px 10px rgba(22, 32, 99, .08); transform: translateY(-1px); }
.ems-choice[aria-checked="true"], .ems-choice[aria-pressed="true"], .ems-choice.is-on { border-color: var(--ems-navy-500); background: var(--ems-navy-50); box-shadow: inset 0 0 0 1px var(--ems-navy-500); }
.ems-choice[aria-checked="true"] .ems-plate, .ems-choice.is-on .ems-plate { background: var(--ems-navy-500); color: #fff; }
.ems-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ems-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font: 600 12px/1.3 var(--ems-font-ui); background: var(--ems-navy-50); color: var(--ems-navy-700); }
.ems-tag.is-hot { background: var(--ems-red-50); color: var(--ems-red-600); }
.ems-tag.is-good { background: var(--ems-good-50); color: var(--ems-good); }
.ems-tag.is-wait { background: var(--ems-warn-50); color: var(--ems-warn); }
.ems-empty { padding: 30px 22px; text-align: center; color: var(--ems-mute); background: rgba(255, 255, 255, .6); border: 1.5px dashed var(--ems-line-2); border-radius: var(--ems-r-lg); font: 400 14px/1.55 var(--ems-font-ui); }
.ems-empty .ems-plate { margin: 0 auto 10px; }
.ems-empty b { display: block; margin-bottom: 4px; font: 700 16px/1.3 var(--ems-font-display); color: var(--ems-navy-800); }
.ems-empty .btn-row, .ems-empty button { margin-top: 14px; }
.ems-btn-quiet { background: transparent; border: 0; padding: 6px 10px; border-radius: 9px; font: 600 13.5px/1.2 var(--ems-font-ui); color: var(--ems-navy-500); cursor: pointer; transition: background-color var(--ems-dur) var(--ems-ease); }
.ems-btn-quiet:hover { background: var(--ems-navy-50); }

/* ── 19. Phones ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .app-topbar { padding: 0 12px; }
  .content { padding: 20px 16px 16px; }
  .topbar { margin-bottom: 16px; }
  .topbar h1, .content > .topbar h1 { font-size: 26px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card .card { padding: 12px 14px; }
  .stat { min-height: 72px; padding: 14px; }
  .stat-n { font-size: 24px; }
  /* The sidebar on a phone is one swipeable row (ems.css); its pill follows. */
  .sidebar { padding: 0; }
  body:not(.gate) #app > .sidebar > .brand, body:not(.gate) #app > .sidebar > #nav, body:not(.gate) #app > .sidebar > .sidebar-foot { background: var(--ems-navy-800); }
  body:not(.gate) #app > .sidebar > .brand .brand-head { text-align: center; }
  body:not(.gate) #app > .sidebar > #nav { gap: 4px; padding: 6px 12px 12px; scrollbar-width: none; }
  body:not(.gate) #app > .sidebar > #nav::-webkit-scrollbar { display: none; }
  body:not(.gate) #app > .sidebar > #nav a { padding: 6px 12px 6px 6px; border-radius: 999px; }
  body:not(.gate) #app > .sidebar > #nav .nav-ic { width: 28px; height: 28px; border-radius: 50%; }
  body:not(.gate) #app > .sidebar > #nav .nav-group { padding: 0 2px 0 8px; }
  body:not(.gate) #app > .sidebar > #nav a.nav-home { margin: 0; padding: 6px 12px 6px 6px; font-size: 14px; }
  body:not(.gate) #app > .sidebar > #nav a.nav-home .nav-ic { width: 28px; height: 28px; border-radius: 50%; }
  body:not(.gate) #app > .sidebar > #nav a.nav-home .nav-lbl small { display: none; }
  .ems-nav-pill { border-radius: 999px; box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .45); }
  .sidebar-foot { margin: 0; }
  .tabbar { width: 100%; }
  .tabbar button { flex: 1 1 auto; }
  .gate-panel { padding: 20px 18px; }
  .gate-panel h2 { font-size: 21px; }
  .modal { border-radius: 18px; }
  .ems-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 20. Reduced motion: nothing moves that does not have to ────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  /* A spinner still says "working", slowly. */
  .spinner, #bootScreen li.is-on i { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
  .wt-skeleton { animation: none !important; }
}

/* Plate tones (Tyler 11-09: icons all one flat navy read as bland). Same plate,
   a different quiet tint per kind of thing. */
.ems-plate.is-red { background: var(--ems-red-50); color: var(--ems-red-500); }
.ems-plate.is-gold { background: var(--ems-gold-50); color: var(--ems-gold-700); }
.ems-plate.is-sky { background: var(--ems-sky-50); color: var(--ems-sky-700); }
