/* Retenra platform design system, written fresh for the ground zero
   rebuild. Palette from the project directive: midnight navy depths,
   primary teal as the interactive voice, electric teal for live
   highlights, achievement gold reserved for achievements alone. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy-950: #0B1426;
  --navy-900: #111E33;
  --navy-800: #192940;
  --navy-700: #22354F;
  --teal: #0D9488;
  --teal-bright: #2DD4BF;
  --ice: #F8FAFC;
  --slate: #94A3B8;
  --gold: #F5C451;
  --green: #22C55E;
  --amber: #F59E0B;
  --coral: #F87171;

  --bg: var(--navy-950);
  --bg-raise: var(--navy-900);
  --bg-panel: #131F36;
  --bg-inset: #0D1830;
  --line: #24344F;
  --line-soft: #1C2A44;
  --ink: var(--ice);
  --ink-2: #C3CEDD;
  --ink-3: var(--slate);
  --accent: var(--teal);
  --accent-ink: #06251F;
  --accent-soft: rgba(13, 148, 136, 0.16);
  --bright-soft: rgba(45, 212, 191, 0.12);
  --bad: var(--coral);
  --bad-soft: rgba(248, 113, 113, 0.13);
  --good: var(--green);
  --good-soft: rgba(34, 197, 94, 0.13);
  --warn: var(--amber);
  --warn-soft: rgba(245, 158, 11, 0.14);
  --paper: #F4F7FA;
  --paper-ink: #16233A;
  --shadow: 0 18px 50px rgba(2, 6, 17, 0.5);
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #EDF1F7;
  --bg-raise: #FFFFFF;
  --bg-panel: #FFFFFF;
  --bg-inset: #E4EAF3;
  --line: #C9D4E4;
  --line-soft: #DCE4EF;
  --ink: #0E1B30;
  --ink-2: #33455F;
  --ink-3: #5D718C;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --bright-soft: rgba(13, 148, 136, 0.1);
  --bad-soft: rgba(220, 60, 60, 0.1);
  --good-soft: rgba(21, 150, 70, 0.11);
  --warn-soft: rgba(217, 140, 10, 0.13);
  --shadow: 0 18px 44px rgba(14, 27, 48, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--teal); color: #fff; }
a { color: var(--teal-bright); text-decoration: none; }
html[data-theme="light"] a { color: var(--teal); }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.16; letter-spacing: -0.015em; margin: 0; }
.display { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; letter-spacing: -0.03em; }
.h-page { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 780; }
.h-sec { font-size: 1.28rem; font-weight: 720; }
.eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--teal-bright);
}
html[data-theme="light"] .eyebrow { color: var(--teal); }
.lede { font-size: 1.13rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: 0.86rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 50px; padding: 0.7rem 1.5rem; border-radius: 999px;
  border: 1px solid transparent; font-size: 1rem; font-weight: 650;
  cursor: pointer; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: #0FAE9F; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-bright); }
html[data-theme="light"] .btn-ghost:hover { color: var(--teal); }
.btn-quiet { background: var(--bg-inset); color: var(--ink-2); border-color: var(--line-soft); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 40px; padding: 0.45rem 1rem; font-size: 0.9rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 620; margin-bottom: 0.4rem; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.3rem; }
input[type="email"], input[type="text"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%; min-height: 50px; padding: 0.7rem 0.9rem;
  background: var(--bg-inset); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: 1rem;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.notice {
  border: 1px solid var(--line); border-left: 4px solid var(--teal);
  background: var(--bg-raise); border-radius: var(--r-md);
  padding: 1rem 1.2rem; margin: 1rem 0;
}
.notice.warn { border-left-color: var(--amber); }
.notice.bad { border-left-color: var(--coral); }
.feedback { display: none; }
.feedback.show { display: block; }
.feedback.ok { border-left-color: var(--green); }

/* ---------- public shell ---------- */
.pub-wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.4rem; }
.pub-head {
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.pub-head-in { display: flex; align-items: center; gap: 2rem; min-height: 68px; }
.pub-nav { display: flex; gap: 1.6rem; margin-left: auto; align-items: center; }
.pub-nav a { color: var(--ink-2); font-weight: 560; font-size: 0.97rem; }
.pub-nav a:hover { color: var(--ink); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); font-weight: 800; font-size: 1.22rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--teal), #0B6E64);
  display: grid; place-items: center;
}
.brand-mark svg { width: 21px; height: 21px; }
.pub-foot { border-top: 1px solid var(--line-soft); margin-top: 5rem; padding: 2.6rem 0 3rem; color: var(--ink-3); }
.pub-foot-grid { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; }
.pub-foot a { color: var(--ink-2); }
.foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 268px 1fr; min-height: 100dvh; }
.sidebar {
  background: var(--navy-900); color: #D7E1EF;
  border-right: 1px solid #1E2C47;
  padding: 1.1rem 0.9rem 1.4rem; position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 0.4rem; overflow-y: auto;
}
html[data-theme="light"] .sidebar { background: var(--navy-900); }
.sidebar .brand { color: #fff; padding: 0.3rem 0.5rem 0.9rem; }
.side-group { margin-top: 1.05rem; }
.side-group-t {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: #7186A3; padding: 0 0.6rem; margin-bottom: 0.35rem;
}
.side-link {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.52rem 0.6rem;
  border-radius: 10px; color: #C3CEDD; font-weight: 560; font-size: 0.95rem;
}
.side-link svg { width: 19px; height: 19px; flex: none; opacity: 0.85; }
.side-link:hover { background: #182A47; color: #fff; text-decoration: none; }
.side-link[aria-current="page"] { background: var(--teal); color: #fff; }
.side-link[aria-current="page"] svg { opacity: 1; }
.side-foot { margin-top: auto; padding-top: 1rem; display: grid; gap: 0.4rem; }
.side-mini {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem;
  background: none; border: 1px solid #26395C; border-radius: 10px; color: #C3CEDD;
  font-size: 0.88rem; font-weight: 560; cursor: pointer; text-align: left; width: 100%;
}
.side-mini:hover { border-color: var(--teal); color: #fff; }
.app[data-collapsed="1"] { grid-template-columns: 78px 1fr; }
.app[data-collapsed="1"] .sidebar { padding-inline: 0.6rem; }
.app[data-collapsed="1"] .side-link span, .app[data-collapsed="1"] .side-group-t,
.app[data-collapsed="1"] .brand span, .app[data-collapsed="1"] .side-mini span { display: none; }
.app[data-collapsed="1"] .side-link { justify-content: center; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.8rem;
  border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px);
}
.topbar .crumb { color: var(--ink-3); font-size: 0.92rem; }
.topbar .crumb strong { color: var(--ink); font-weight: 650; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; }
.pill-stat {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.8rem;
  border: 1px solid var(--line); border-radius: 999px; font-size: 0.88rem; font-weight: 620;
  background: var(--bg-raise);
}
.pill-stat .flame { color: var(--amber); }
.cmdk-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.8rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-inset);
  color: var(--ink-3); font-size: 0.9rem; cursor: pointer; min-width: 190px;
}
.cmdk-btn kbd {
  margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 0.05rem 0.35rem;
}
.page { padding: 2rem 1.8rem 4.5rem; width: 100%; max-width: 1220px; margin: 0 auto; }
.page-narrow { max-width: 860px; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .page { padding: 1.4rem 1.1rem 6.5rem; }
  .topbar { padding: 0.8rem 1.1rem; }
  .cmdk-btn { min-width: 0; }
  .cmdk-btn .cmdk-label, .cmdk-btn kbd { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed;
    left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--navy-900); border-top: 1px solid #22354F;
    padding: 0.45rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    display: grid; justify-items: center; gap: 0.15rem; color: #93A5BF;
    font-size: 0.68rem; font-weight: 620; padding: 0.3rem 0;
  }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a[aria-current="page"] { color: var(--teal-bright); }
  .bottom-nav a:hover { text-decoration: none; }
}

/* ---------- command palette ---------- */
.pal-veil {
  position: fixed; inset: 0; z-index: 90; background: rgba(3, 7, 16, 0.62);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem;
}
.pal-veil.open { display: flex; }
.pal {
  width: min(620px, 100%); background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.pal input {
  width: 100%; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.1rem; padding: 1.1rem 1.3rem; min-height: 0;
}
.pal input:focus { box-shadow: none; border: 0; }
.pal-list { max-height: 46vh; overflow-y: auto; border-top: 1px solid var(--line-soft); padding: 0.4rem; }
.pal-item {
  display: flex; gap: 0.8rem; align-items: baseline; width: 100%; text-align: left;
  padding: 0.65rem 0.8rem; border: 0; border-radius: 10px; background: none;
  color: var(--ink); font-size: 0.98rem; cursor: pointer;
}
.pal-item .kind { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-left: auto; flex: none; }
.pal-item.sel { background: var(--accent-soft); }

/* ---------- generic panels ---------- */
.panel {
  background: var(--bg-panel); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 1.5rem;
}
.panel-flat { background: none; border: 0; padding: 0; }
.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 1.6rem 0; }
.tag {
  display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal-bright); background: var(--bright-soft);
  border-radius: 999px; padding: 0.22rem 0.65rem;
}
html[data-theme="light"] .tag { color: var(--teal); }
.empty {
  border: 1.5px dashed var(--line); border-radius: var(--r-lg);
  padding: 2rem 1.6rem; text-align: center; color: var(--ink-3);
}
.empty strong { color: var(--ink); display: block; font-size: 1.05rem; margin-bottom: 0.3rem; }

/* progress bars and meters */
.meter { height: 9px; border-radius: 99px; background: var(--bg-inset); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); transition: width 0.5s ease; }
.meter.gold > i { background: var(--gold); }

/* ---------- command center ---------- */
.cc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.6rem; align-items: start; }
@media (max-width: 980px) { .cc-grid { grid-template-columns: 1fr; } }
.cc-ready { text-align: left; }
.dial-wrap { display: flex; gap: 1.4rem; align-items: center; }
.dial { position: relative; width: 148px; height: 148px; flex: none; }
.dial svg { transform: rotate(-90deg); }
.dial-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial-c .big { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.dial-c .of { font-size: 0.78rem; color: var(--ink-3); }
.rec-card {
  margin-top: 1.6rem; border-radius: var(--r-lg); padding: 1.6rem;
  background: linear-gradient(150deg, var(--navy-800), var(--navy-900));
  border: 1px solid #2A3D5F; color: #EAF1FA;
}
.rec-card .eyebrow { color: var(--teal-bright); }
.rec-card p { color: #B9C7DB; }
.domain-bars { display: grid; gap: 0.95rem; margin-top: 0.6rem; }
.domain-bar { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; align-items: baseline; }
.domain-bar .nm { font-weight: 600; font-size: 0.95rem; }
.domain-bar .vl { color: var(--ink-3); font-size: 0.88rem; }
.domain-bar .meter { grid-column: 1 / -1; }
.mission-row {
  display: flex; gap: 0.9rem; align-items: center; padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.mission-row:last-child { border-bottom: 0; }
.mission-check {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid var(--line); color: transparent; font-size: 0.8rem;
}
.mission-row.done .mission-check { background: var(--teal); border-color: var(--teal); color: #fff; }
.mission-row .xp { margin-left: auto; color: var(--ink-3); font-size: 0.85rem; font-weight: 650; flex: none; }
.achv-strip { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.achv-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); color: var(--ink);
  background: color-mix(in srgb, var(--gold) 9%, transparent); border-radius: 999px; font-size: 0.88rem; font-weight: 600;
}
.achv-chip svg { width: 15px; height: 15px; color: var(--gold); }
.rank-line { display: flex; align-items: center; gap: 1rem; }
.rank-badge {
  width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: var(--bg-inset); border: 1px solid var(--line);
}
.rank-badge svg { width: 30px; height: 30px; }

/* ---------- question runner ---------- */
.runner-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.runner-head .pos { font-weight: 700; }
.runner-head .dom { color: var(--ink-3); font-size: 0.92rem; }
.session-bar { height: 6px; border-radius: 99px; background: var(--bg-inset); overflow: hidden; margin: 0.7rem 0 1.6rem; }
.session-bar > i { display: block; height: 100%; background: var(--teal); transition: width 0.3s ease; }
.stem { font-size: 1.22rem; font-weight: 620; line-height: 1.5; margin: 0.4rem 0 1.3rem; max-width: 68ch; }
.opts { display: grid; gap: 0.7rem; }
.opts-reset { display: grid; gap: 0.7rem; }
.option {
  display: flex; gap: 0.85rem; align-items: flex-start; text-align: left; width: 100%;
  padding: 0.95rem 1.1rem; min-height: 52px; border-radius: var(--r-md);
  background: var(--bg-raise); border: 1.5px solid var(--line); color: var(--ink);
  font-size: 1rem; line-height: 1.45; cursor: pointer; transition: border-color 0.13s ease, background 0.13s ease;
}
.option::before {
  content: counter(letter, upper-alpha); counter-increment: letter;
  flex: none; width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center;
  background: var(--bg-inset); color: var(--ink-3); font-size: 0.82rem; font-weight: 750; margin-top: 0.05rem;
}
.opts, .opts-reset { counter-reset: letter; }
.option:hover { border-color: var(--teal); }
.option.selected { border-color: var(--teal); background: var(--accent-soft); }
.option.selected::before { background: var(--teal); color: #fff; }
.option.correct { border-color: var(--green); background: var(--good-soft); }
.option.correct::before { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--coral); background: var(--bad-soft); }
.option.wrong::before { background: var(--coral); color: #fff; }
.option.matched { border-color: var(--teal); opacity: 0.75; }
.option[disabled] { cursor: default; }
.conf-row { display: flex; align-items: center; gap: 0.55rem; margin-top: 1.3rem; flex-wrap: wrap; }
.conf-row .cap { font-size: 0.85rem; color: var(--ink-3); margin-right: 0.2rem; }
.conf-btn {
  min-height: 44px; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg-raise); color: var(--ink-2); font-weight: 620; font-size: 0.92rem;
}
.conf-btn[aria-pressed="true"] { border-color: var(--teal-bright); color: var(--ink); background: var(--bright-soft); }
.runner-actions { display: flex; gap: 0.8rem; margin-top: 1.4rem; flex-wrap: wrap; align-items: center; }
.tool-row { display: flex; gap: 0.5rem; margin-top: 1.1rem; flex-wrap: wrap; }
.tool-btn {
  min-height: 40px; padding: 0.4rem 0.85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-soft); background: none; color: var(--ink-3); font-size: 0.86rem; font-weight: 600;
}
.tool-btn:hover { color: var(--ink); border-color: var(--teal); }
.tool-btn.on { color: var(--teal-bright); border-color: var(--teal); }
.rationale {
  margin-top: 1.4rem; border-radius: var(--r-md); padding: 1.15rem 1.3rem;
  background: var(--bright-soft); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
}
.rationale .why-t { font-weight: 750; margin-bottom: 0.25rem; }
.summary-figs { display: flex; gap: 2.2rem; flex-wrap: wrap; margin: 1rem 0; }
.summary-figs .fig .v { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.summary-figs .fig .k { color: var(--ink-3); font-size: 0.85rem; }

/* ---------- hub tiles (destinations, not feature stacks) ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.hub-tile {
  display: block; background: var(--bg-panel); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 1.3rem 1.35rem; color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.hub-tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--teal); }
.hub-tile .t { font-weight: 720; font-size: 1.06rem; display: flex; align-items: center; gap: 0.6rem; }
.hub-tile .t svg { width: 20px; height: 20px; color: var(--teal-bright); }
.hub-tile .d { color: var(--ink-3); font-size: 0.92rem; margin-top: 0.35rem; }
.hub-tile .fig { margin-top: 0.9rem; font-weight: 750; color: var(--teal-bright); font-size: 0.95rem; }
html[data-theme="light"] .hub-tile .fig, html[data-theme="light"] .hub-tile .t svg { color: var(--teal); }

/* ---------- simulations: the audio stage ---------- */
.sim-stage {
  background: radial-gradient(120% 130% at 50% 0%, var(--navy-800) 0%, var(--navy-950) 62%);
  border: 1px solid #2A3D5F; border-radius: 24px; color: #EAF1FA;
  padding: 1.8rem clamp(1.2rem, 4vw, 2.6rem) 2.1rem;
}
.sim-stage .eyebrow { color: var(--teal-bright); }
.audio-console { display: flex; align-items: center; gap: 1.2rem; margin: 1.2rem 0 0.4rem; }
.play-btn {
  width: 68px; height: 68px; border-radius: 50%; flex: none; border: 0; cursor: pointer;
  background: var(--teal); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.4);
}
.play-btn svg { width: 27px; height: 27px; }
.play-btn:hover { background: #0FAE9F; }
.wave { display: flex; align-items: center; gap: 3px; height: 44px; flex: 1; overflow: hidden; }
.wave i { width: 4px; border-radius: 2px; background: #33507C; height: 22%; flex: none; transition: height 0.2s ease, background 0.2s ease; }
.wave.playing i { background: var(--teal-bright); animation: wavepulse 1.1s ease-in-out infinite alternate; }
.wave i:nth-child(3n) { animation-delay: 0.15s; } .wave i:nth-child(4n) { animation-delay: 0.3s; }
.wave i:nth-child(5n) { animation-delay: 0.45s; } .wave i:nth-child(7n) { animation-delay: 0.6s; }
@keyframes wavepulse { from { transform: scaleY(0.55); } to { transform: scaleY(1.25); } }
.audio-meta { color: #93A5BF; font-size: 0.88rem; }
.stage-toggles { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; }
.stage-toggle {
  min-height: 40px; padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid #33507C; background: rgba(11, 20, 38, 0.5); color: #C3CEDD; font-size: 0.87rem; font-weight: 600;
}
.stage-toggle[aria-pressed="true"] { border-color: var(--teal-bright); color: #fff; background: rgba(13, 148, 136, 0.25); }
.readings {
  margin-top: 1.4rem; border: 1px solid #2A3D5F; border-radius: var(--r-md);
  background: rgba(7, 13, 26, 0.66); padding: 1rem 1.2rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.9rem 1.4rem;
}
.reading .k { font-size: 0.72rem; letter-spacing: 0.11em; text-transform: uppercase; color: #7186A3; font-weight: 700; }
.reading .v { font-family: var(--mono); font-size: 1.06rem; color: #EAF1FA; margin-top: 0.15rem; }
.reading .v.bad { color: var(--coral); }
.caption-box {
  margin-top: 1.2rem; border-left: 3px solid var(--teal); background: rgba(13, 148, 136, 0.1);
  padding: 0.95rem 1.15rem; border-radius: 0 var(--r-md) var(--r-md) 0; color: #DCE7F5; line-height: 1.6;
}
.sim-opts { margin-top: 1.5rem; }
.sim-opts .option { background: rgba(17, 30, 51, 0.85); border-color: #2A3D5F; color: #EAF1FA; }
.sim-opts .option::before { background: #0B1426; color: #93A5BF; }
.sim-opts .option:hover { border-color: var(--teal-bright); }
.sim-opts .option.selected { border-color: var(--teal-bright); background: rgba(13, 148, 136, 0.22); }
.sim-opts .option.selected::before { background: var(--teal); color: #fff; }
.sim-list { display: grid; gap: 0.8rem; }
.sim-row {
  display: flex; gap: 1rem; align-items: center; width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-panel); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 1rem 1.2rem; color: var(--ink); font: inherit;
}
.sim-row:hover { border-color: var(--teal); }
.sim-row .n { font-family: var(--mono); color: var(--ink-3); font-size: 0.85rem; flex: none; }
.sim-row .t { font-weight: 650; }
.sim-row .best { margin-left: auto; flex: none; font-size: 0.86rem; font-weight: 700; }
.band-strong { color: var(--green); } .band-pass { color: var(--teal-bright); } .band-fail { color: var(--coral); }
html[data-theme="light"] .band-pass { color: var(--teal); }

/* SIM 01 touch interactions */
.ix-panel {
  margin-top: 1.4rem; border: 1px solid #2A3D5F; border-radius: var(--r-md);
  background: rgba(7, 13, 26, 0.66); padding: 1.2rem;
}
.ix-title { font-weight: 720; color: #EAF1FA; margin-bottom: 0.3rem; }
.ix-sub { color: #93A5BF; font-size: 0.92rem; margin-bottom: 1rem; }
.ix-chest {
  position: relative; width: min(300px, 78vw); margin: 0 auto; border-radius: var(--r-md);
  background: var(--paper); padding: 0.6rem;
}
.ix-chest svg { display: block; width: 100%; height: auto; }
.ix-tapzone {
  position: absolute; border-radius: 50%; border: 2px dashed rgba(13, 148, 136, 0.55);
  background: rgba(13, 148, 136, 0.08); cursor: pointer; padding: 0;
}
.ix-tapzone.armed { border-color: var(--teal-bright); background: rgba(45, 212, 191, 0.2); animation: ixpulse 0.5s ease-in-out infinite alternate; }
@keyframes ixpulse { from { transform: scale(1); } to { transform: scale(1.07); } }
.ix-pad {
  position: absolute; width: 17%; aspect-ratio: 1; border-radius: 22%; pointer-events: none;
  background: #E8EDF2; border: 2px solid var(--navy-800); display: none;
}
.ix-pad.on { display: block; }
.ix-pad.offtarget { border-color: var(--amber); }
.ix-meter { height: 10px; border-radius: 99px; background: #1C2A44; overflow: hidden; margin: 0.8rem 0; }
.ix-meter > i { display: block; height: 100%; width: 0; background: var(--teal-bright); }
.ix-rate { font-family: var(--mono); font-size: 1.5rem; color: #EAF1FA; text-align: center; }
.ix-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }
.ix-btn {
  min-height: 48px; padding: 0.6rem 1.2rem; border-radius: 999px; cursor: pointer; font-weight: 650;
  border: 1px solid #33507C; background: #14263F; color: #EAF1FA; font-size: 0.95rem;
}
.ix-btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.ix-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ix-hold { position: relative; overflow: hidden; }
.ix-hold > i { position: absolute; inset: 0; width: 0; background: rgba(45, 212, 191, 0.35); }
.ix-hold > span { position: relative; }
.ix-finding { margin-top: 1rem; color: #DCE7F5; border-left: 3px solid var(--teal-bright); padding: 0.6rem 0.9rem; background: rgba(13, 148, 136, 0.12); border-radius: 0 8px 8px 0; }

/* ---------- flashcards ---------- */
.card-stage { perspective: 1400px; max-width: 640px; margin: 0 auto; }
.fcard {
  position: relative; width: 100%; min-height: 340px; cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.25, 1);
  border: 0; background: none; padding: 0; text-align: left; font: inherit; color: var(--ink);
}
.fcard.flipped { transform: rotateY(180deg); }
.fcard-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 24px; padding: 2rem; display: flex; flex-direction: column;
  background: linear-gradient(155deg, var(--bg-panel), var(--bg-inset));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fcard-face.back { transform: rotateY(180deg); background: linear-gradient(155deg, var(--navy-800), var(--navy-900)); color: #EAF1FA; border-color: #2A3D5F; }
.fcard-face .deck { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.fcard-face.back .deck { color: #93A5BF; }
.fcard-face .body { margin: auto 0; font-size: clamp(1.25rem, 3.4vw, 1.7rem); font-weight: 650; line-height: 1.4; }
.fcard-face .flip-hint { color: var(--ink-3); font-size: 0.85rem; }
.card-actions { display: flex; gap: 0.9rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.card-actions .btn { min-width: 170px; }
.btn-still { background: var(--bg-raise); border: 1.5px solid var(--coral); color: var(--ink); }
.btn-know { background: var(--teal); color: #fff; border: 1.5px solid var(--teal); }
.deck-bar { max-width: 640px; margin: 1.4rem auto 0; }

/* ---------- exam room ---------- */
.exam-shell { max-width: 780px; margin: 0 auto; }
.exam-timer { font-family: var(--mono); font-size: 1.3rem; color: var(--ink-2); }
.exam-brief { display: grid; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.exam-brief .row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.95rem 1.3rem; background: var(--bg-panel); border-bottom: 1px solid var(--line-soft); }
.exam-brief .row:last-child { border-bottom: 0; }
.exam-brief .k { color: var(--ink-3); } .exam-brief .v { font-weight: 650; text-align: right; }

/* ---------- hands on / skills laboratory ---------- */
.paper-stage {
  background: var(--paper); color: var(--paper-ink); border-radius: 24px;
  padding: clamp(1.1rem, 3.5vw, 2rem); box-shadow: var(--shadow);
}
.paper-stage .stem { color: var(--paper-ink); }
.paper-stage .option { background: #fff; border-color: #C9D4E4; color: var(--paper-ink); }
.paper-stage .option::before { background: #E4EAF3; color: #5D718C; }
.paper-stage .option.selected { border-color: var(--teal); background: rgba(13, 148, 136, 0.1); }
.paper-stage .option.correct { border-color: var(--green); background: rgba(34, 197, 94, 0.12); }
.paper-stage .option.wrong { border-color: #DC3C3C; background: rgba(220, 60, 60, 0.1); }
.paper-stage .rationale { background: rgba(13, 148, 136, 0.1); border-color: rgba(13, 148, 136, 0.4); color: var(--paper-ink); }
.fig-frame { max-width: 430px; margin: 0.6rem auto 1.2rem; }
.fig-frame svg { display: block; width: 100%; height: auto; }
.fig-frame .zone { cursor: pointer; }
.fig-frame .zone .ring { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 5 5; }
.fig-frame .zone.right .ring { stroke: var(--green); stroke-dasharray: none; stroke-width: 3; }
.fig-frame .zone.wrong .ring { stroke: #DC3C3C; stroke-dasharray: none; stroke-width: 3; }
.fig-cap { text-align: center; color: #5D718C; font-size: 0.88rem; margin-top: 0.4rem; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 2rem; position: relative; }
@media (max-width: 640px) { .match-grid { grid-template-columns: 1fr; } }
.dose-row { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.dose-row input { max-width: 170px; background: #fff; color: var(--paper-ink); border-color: #C9D4E4; }
.dose-row select { max-width: 150px; background: #fff; color: var(--paper-ink); border-color: #C9D4E4; width: auto; }
.ho-progress { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 1rem 0; }
.ho-tick { width: 13px; height: 13px; border-radius: 4px; background: var(--bg-inset); border: 1px solid var(--line); }
.ho-tick.done { background: var(--teal); border-color: var(--teal); }
.ho-tick.miss { background: var(--coral); border-color: var(--coral); }

/* ---------- learning path journey ---------- */
.journey { position: relative; margin-top: 1rem; }
.journey::before {
  content: ""; position: absolute; left: 27px; top: 12px; bottom: 12px; width: 3px;
  background: linear-gradient(var(--teal), var(--navy-700)); border-radius: 3px; opacity: 0.55;
}
.jnode { position: relative; display: flex; gap: 1.2rem; padding: 1.05rem 0 1.05rem 0; align-items: flex-start; }
.jnode .dot {
  width: 56px; height: 56px; border-radius: 50%; flex: none; z-index: 1; display: grid; place-items: center;
  background: var(--bg-panel); border: 2.5px solid var(--line); color: var(--ink-3);
}
.jnode .dot svg { width: 24px; height: 24px; }
.jnode[data-state="Strong"] .dot, .jnode[data-state="Solid"] .dot { border-color: var(--teal); color: var(--teal-bright); }
.jnode[data-state="Developing"] .dot { border-color: var(--amber); color: var(--amber); }
.jnode.milestone .dot { border-radius: 16px; }
.jnode .jbody { flex: 1; min-width: 0; padding-top: 0.3rem; }
.jnode .jt { font-weight: 720; font-size: 1.08rem; display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.jnode .jstate { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.jnode .jd { color: var(--ink-3); margin-top: 0.15rem; max-width: 62ch; }

/* ---------- analytics ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.4rem; }
.chart-box { background: var(--bg-panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1.4rem; }
.chart-box h3 { font-size: 1.02rem; font-weight: 720; margin-bottom: 0.9rem; }
.chart-box svg { display: block; width: 100%; height: auto; }
.heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 3.5px; background: var(--bg-inset); }
.heat i.l1 { background: rgba(13, 148, 136, 0.4); } .heat i.l2 { background: rgba(13, 148, 136, 0.7); }
.heat i.l3 { background: var(--teal-bright); }
.cal-table { width: 100%; border-collapse: collapse; }
.cal-table td, .cal-table th { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--line-soft); text-align: left; }
.cal-table th { color: var(--ink-3); font-size: 0.8rem; letter-spacing: 0.07em; text-transform: uppercase; }

/* ---------- achievements ---------- */
.ach-tier { margin-top: 2.2rem; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: 1rem; }
.ach-card {
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1.15rem 1.2rem;
  background: var(--bg-panel); opacity: 0.82;
}
.ach-card.unlocked { opacity: 1; border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 6%, var(--bg-panel)); }
.ach-card .a-t { font-weight: 700; display: flex; gap: 0.55rem; align-items: center; }
.ach-card .a-t svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.ach-card.unlocked .a-t svg { color: var(--gold); }
.ach-card .a-d { color: var(--ink-3); font-size: 0.9rem; margin-top: 0.3rem; }
.ach-card .a-p { margin-top: 0.7rem; font-size: 0.84rem; color: var(--ink-3); }
.ladder { display: grid; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.ladder .rung { display: flex; gap: 1rem; align-items: center; padding: 0.85rem 1.2rem; background: var(--bg-panel); border-bottom: 1px solid var(--line-soft); }
.ladder .rung:last-child { border-bottom: 0; }
.ladder .rung.now { background: var(--accent-soft); }
.ladder .rung .xp { margin-left: auto; color: var(--ink-3); font-size: 0.9rem; }

/* ---------- library ---------- */
.lib-search { max-width: 560px; }
.lib-list { display: grid; gap: 0; border-top: 1px solid var(--line-soft); margin-top: 1.4rem; }
.lib-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.1rem; align-items: baseline;
  padding: 1.05rem 0.4rem; border-bottom: 1px solid var(--line-soft); color: var(--ink); width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; font: inherit;
}
.lib-row:hover { text-decoration: none; background: var(--bg-raise); }
.lib-row .rn { font-family: var(--mono); color: var(--ink-3); font-size: 0.85rem; }
.lib-row .rt { font-weight: 650; font-size: 1.05rem; }
.lib-row .rd { color: var(--ink-3); font-size: 0.9rem; }
.article { max-width: 720px; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.article .sec-t { font-size: 0.74rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-bright); margin: 2rem 0 0.5rem; }
html[data-theme="light"] .article .sec-t { color: var(--teal); }
.article p { color: var(--ink-2); font-size: 1.05rem; line-height: 1.7; }

/* ---------- marketing ---------- */
.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 3.2rem; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -180px; top: -120px; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.16), transparent 65%); pointer-events: none;
}
.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-stats { display: flex; gap: 2.6rem; flex-wrap: wrap; margin-top: 3rem; }
.hero-stats .v { font-size: 1.7rem; font-weight: 800; }
.hero-stats .k { color: var(--ink-3); font-size: 0.88rem; }
.showcase {
  border: 1px solid var(--line); border-radius: 26px; background: var(--navy-900);
  color: #EAF1FA; padding: clamp(1.4rem, 4vw, 2.6rem); box-shadow: var(--shadow);
}
.showcase .mini-dial { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.loop-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.2rem; margin-top: 1.6rem; }
.loop-step { border-top: 3px solid var(--teal); padding-top: 1rem; }
.loop-step .n { font-family: var(--mono); color: var(--teal-bright); font-size: 0.85rem; }
.loop-step h3 { margin: 0.4rem 0 0.35rem; font-size: 1.08rem; }
.loop-step p { color: var(--ink-3); margin: 0; }
.bp-band { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.bp-band .cell { padding: 1.1rem 1rem; background: var(--bg-panel); border-right: 1px solid var(--line-soft); }
.bp-band .cell:last-child { border-right: 0; }
.bp-band .w { font-size: 1.5rem; font-weight: 800; color: var(--teal-bright); }
html[data-theme="light"] .bp-band .w { color: var(--teal); }
.bp-band .d { font-size: 0.86rem; color: var(--ink-3); margin-top: 0.2rem; }
@media (max-width: 760px) { .bp-band { grid-template-columns: 1fr 1fr; } }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem; max-width: 780px; }
.price-card { border: 1px solid var(--line); border-radius: 24px; padding: 2rem; background: var(--bg-panel); }
.price-card.hot { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), var(--shadow); }
.price-card .amt { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; }
.price-card ul { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: grid; gap: 0.55rem; color: var(--ink-2); }
.price-card li::before { content: "✓"; color: var(--teal-bright); font-weight: 800; margin-right: 0.55rem; }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  background: none; border: 0; color: var(--ink); font: inherit; font-weight: 650; font-size: 1.05rem;
  padding: 1.15rem 0.2rem; cursor: pointer; text-align: left;
}
.faq-a { display: none; padding: 0 0.2rem 1.25rem; color: var(--ink-2); max-width: 68ch; }
.faq-item.open .faq-a { display: block; }

/* ---------- auth and checkout ---------- */
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1.2rem; }
.auth-card { width: min(460px, 100%); background: var(--bg-panel); border: 1px solid var(--line-soft); border-radius: 24px; padding: 2.2rem; box-shadow: var(--shadow); }
.plan-pick { display: grid; gap: 0.8rem; margin: 1.2rem 0; }
.plan-opt {
  display: flex; gap: 1rem; align-items: center; text-align: left; width: 100%; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise);
  padding: 1rem 1.15rem; color: var(--ink); font: inherit;
}
.plan-opt[aria-checked="true"] { border-color: var(--teal); background: var(--accent-soft); }
.plan-opt .p-amt { margin-left: auto; font-weight: 800; font-size: 1.15rem; }
.sum-rows { display: grid; gap: 0.55rem; margin: 1.2rem 0; }
.sum-rows .row { display: flex; justify-content: space-between; gap: 1rem; }
.sum-rows .row .k { color: var(--ink-3); }

/* overlay toast for unlocks */
.toast-veil { position: fixed; inset: 0; z-index: 95; display: none; place-items: center; background: rgba(3, 7, 16, 0.6); padding: 1rem; }
.toast-veil.open { display: grid; }
.toast-card {
  width: min(420px, 100%); text-align: center; background: var(--bg-raise);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 24px;
  padding: 2.2rem 1.8rem; box-shadow: var(--shadow);
}
.toast-card svg { width: 52px; height: 52px; color: var(--gold); }

.gold-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 0.45rem; }
.sim-n { font-weight: 800; color: var(--muted); }
.best-chip { font-size: 0.8rem; font-weight: 700; color: var(--teal-bright); border: 1px solid var(--line); padding: 0.25rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.lock-note { font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ---------- artwork: the anatomy library recolored per theme ---------- */
:root {
  --art-line: #334155; --art-body: #FFFFFF; --art-shade: #E2E8F0; --art-burn: #FECACA; --art-muted: #64748B;
}
:root[data-theme="dark"] {
  --art-line: #CBD5E1; --art-body: #1E293B; --art-shade: #334155; --art-burn: #7F1D1D; --art-muted: #94A3B8;
}
.ho-art svg [stroke="#0B253B"], .fig-frame svg [stroke="#0B253B"] { stroke: var(--art-line); }
.ho-art svg [fill="#0B253B"], .fig-frame svg [fill="#0B253B"] { fill: var(--art-line); }
.ho-art svg [fill="#fff"], .fig-frame svg [fill="#fff"] { fill: var(--art-body); }
.ho-art svg [fill="#E8EDF2"], .fig-frame svg [fill="#E8EDF2"] { fill: var(--art-shade); }
.ho-art svg [fill="#FAE9E9"], .fig-frame svg [fill="#FAE9E9"] { fill: var(--art-burn); }
.ho-art svg [stroke="#64748B"], .fig-frame svg [stroke="#64748B"] { stroke: var(--art-muted); }
.ho-art svg [fill="#64748B"], .fig-frame svg [fill="#64748B"] { fill: var(--art-muted); }
.ho-art svg text, .fig-frame svg text { fill: var(--art-muted); }
.ho-art svg text[font-weight="700"], .fig-frame svg text[font-weight="700"] { fill: var(--art-line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
