/* =====================================================================
   SEOULOGY ACADEMY — GREEN SEA PEEL
   Design system: deep marine editorial. Korean clinical / premium.
   ===================================================================== */

/* ---------------------------------------------------------------- RESET */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(h1,h2,h3,h4,h5,p,ul,ol,figure,blockquote) { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* --------------------------------------------------------------- TOKENS */
:root {
  /* Marine greens — the Green Sea Peel world */
  --abyss:      #071411;
  --deep:       #0c211c;
  --forest:     #12332a;
  --forest-2:   #1a4638;
  --moss:       #2b6b53;
  --sea:        #3f9c78;
  --spume:      #74d3ab;
  --glow:       #a8f0cd;

  /* Warm neutrals — editorial paper */
  --paper:      #f6f4ee;
  --paper-2:    #ebe7dc;
  --sand:       #d9d2c2;
  --ink:        #101a17;
  --ink-2:      #33423d;

  /* Metals */
  --gold:       #c9a961;
  --gold-lo:    #8f7539;
  --gold-hi:    #f0dda7;

  /* Signal colours */
  --danger:     #e05252;
  --danger-lo:  #7d2020;
  --warn:       #e0a03c;
  --warn-lo:    #7a5312;
  --ok:         #46b98a;
  --ok-lo:      #1c5a41;
  --info:       #5aa9d6;
  --info-lo:    #1d4c66;
  --plum:       #a874c4;
  --plum-lo:    #4d2c63;

  /* Surfaces (dark UI is the default shell) */
  --veil:       7, 20, 17;
  --bg:         var(--abyss);
  --surface:    #0f2620;
  --surface-2:  #143029;
  --surface-3:  #1b3b32;
  --line:       rgba(168, 240, 205, 0.14);
  --line-2:     rgba(168, 240, 205, 0.26);
  --text:       #e8f2ed;
  --text-dim:   #a9c1b8;
  --text-faint: #7c948c;

  --r-s: 8px; --r-m: 14px; --r-l: 22px; --r-xl: 32px;
  --shadow-s: 0 2px 10px rgba(0,0,0,.28);
  --shadow-m: 0 10px 34px rgba(0,0,0,.38);
  --shadow-l: 0 26px 70px rgba(0,0,0,.5);

  --ease: cubic-bezier(.2,.7,.3,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --wrap: 1180px;
  --nav-h: 64px;

  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-script: "Great Vibes", cursive;
}

/* ----------------------------------------------------------------- BASE */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  /* fixed deep-sea gradient field */
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(63,156,120,.20), transparent 60%),
    radial-gradient(900px 600px at 92% 6%, rgba(26,70,56,.55), transparent 62%),
    radial-gradient(1000px 800px at 50% 108%, rgba(12,33,28,.9), transparent 60%),
    linear-gradient(175deg, #071411 0%, #0a1c18 45%, #071411 100%);
}
body::after {
  /* subtle grain */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--spume); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--sea); color: #04120e; }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
  border-radius: 4px;
}

.boot {
  min-height: 100vh; display: grid; place-items: center;
  color: var(--text-dim); font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
}

/* ------------------------------------------------------------ UTILITIES */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.wrap-n { max-width: 860px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: 18px; }
.center { text-align: center; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}
.eyebrow.sea { color: var(--spume); }

h1, .h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 5.2vw, 54px); line-height: 1.08; letter-spacing: -.02em; }
h2, .h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3.4vw, 36px); line-height: 1.16; letter-spacing: -.015em; }
h3, .h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2.2vw, 25px); line-height: 1.25; }
h4, .h4 { font-size: 15px; font-weight: 700; letter-spacing: .04em; }

/* ------------------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 650; letter-spacing: .02em;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), background .22s, border-color .22s, color .22s;
  text-decoration: none !important; background: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--sea), var(--moss));
  color: #041210; box-shadow: 0 8px 26px rgba(63,156,120,.32);
  border-color: rgba(168,240,205,.35);
}
.btn-primary:hover { box-shadow: 0 14px 40px rgba(63,156,120,.46); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: #2a2007; box-shadow: 0 8px 26px rgba(201,169,97,.3);
}
.btn-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { background: rgba(255,255,255,.07); border-color: var(--spume); }
.btn-sm { padding: 9px 18px; font-size: 13px; }
.btn-lg { padding: 16px 34px; font-size: 15px; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------- SHELL */
.nav {
  position: sticky; top: 0; z-index: 60; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(7,20,17,.78); backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 18px; width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; flex-wrap: nowrap; min-width: 0; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; min-width: 0; }
.brand:hover { text-decoration: none; }
/* The Seoulogy mark, knocked out of a burgundy tile. It is masked rather
   than drawn so it takes a colour, and it stays the same on every theme:
   the brand should not change when the course does. */
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(140deg, #7d2a3a, #561824);
  display: grid; place-items: center;
  border: 1px solid rgba(240, 221, 167, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.brand-mark::after {
  content: ""; width: 21px; height: 17px; background: #e4d3a2;
  -webkit-mask: url("../assets/img/seoulogy-mark.png") center / contain no-repeat;
  mask: url("../assets/img/seoulogy-mark.png") center / contain no-repeat;
}
.brand-mark svg { display: none; }
.brand-lg .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
.brand-lg .brand-mark::after { width: 28px; height: 23px; }
/* the boot screen and the footer get the mark too */
.boot::before, .foot-mark {
  content: ""; display: block; width: 44px; height: 36px; margin: 0 auto 18px;
  background: #c9a961;
  -webkit-mask: url("../assets/img/seoulogy-mark.png") center / contain no-repeat;
  mask: url("../assets/img/seoulogy-mark.png") center / contain no-repeat;
}
.foot-mark { width: 26px; height: 21px; margin: 0 0 10px; opacity: .75; }
.brand-txt { line-height: 1.1; }
.brand-txt b { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); display: block; letter-spacing: .01em; }
.brand-txt span { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 550;
  color: var(--text-dim); transition: background .2s, color .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.06); text-decoration: none; }
.nav-links a.on { color: #04120e; background: var(--spume); }

.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); border-radius: 10px; width: 40px; height: 40px; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 17px; height: 1.5px; background: var(--text); position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 17px; height: 1.5px; background: var(--text); }
.nav-toggle span::before { top: -5px; } .nav-toggle span::after { top: 5px; }

.nav-user { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold), var(--gold-lo)); color: #2a2007;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0;
}

main { min-height: calc(100vh - var(--nav-h)); padding-bottom: 90px; }

.foot {
  border-top: 1px solid var(--line); margin-top: 70px; padding: 32px 0;
  font-size: 12.5px; color: var(--text-faint);
}
.foot-in { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }

/* ------------------------------------------------------------ SURFACES */
.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 26px; box-shadow: var(--shadow-s);
}
.card-flat { background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.panel {
  background: linear-gradient(165deg, rgba(26,70,56,.5), rgba(12,33,28,.72));
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow-m);
}

/* ---------------------------------------------------------------- AUTH */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
/* grid children default to min-width:auto, which lets long copy push the track
   wider than a phone screen — pin them to 0 so they actually shrink */
.auth-screen > * { min-width: 0; }
.auth-art {
  position: relative; overflow: hidden; padding: 56px; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--forest-2), var(--abyss));
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; opacity: .3;
  background-size: cover; background-position: center;
  background-image: var(--auth-img, none);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.2));
}
.auth-art > * { position: relative; }
.auth-art h1 { max-width: 12ch; margin-block: 22px 16px; }
.auth-facts { display: flex; gap: 26px; flex-wrap: wrap; }
.auth-facts div b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--gold-hi); }
.auth-facts div span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); }
.auth-form { display: grid; place-items: center; padding: 40px 22px; min-width: 0; }
.auth-box { width: 100%; max-width: 400px; min-width: 0; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: var(--r-m);
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--spume); background: rgba(255,255,255,.07); outline: none; }
.field textarea { min-height: 110px; resize: vertical; }
.alert { padding: 12px 16px; border-radius: var(--r-m); font-size: 13.5px; margin-bottom: 14px; }
.alert-err { background: rgba(224,82,82,.14); border: 1px solid rgba(224,82,82,.4); color: #ffc9c9; }
.alert-ok { background: rgba(70,185,138,.14); border: 1px solid rgba(70,185,138,.4); color: #b6f0d6; }
.swap { margin-top: 18px; font-size: 13.5px; color: var(--text-dim); text-align: center; }
.forgot-row { text-align: right; margin: -6px 0 16px; }
.forgot-row a, .reset-back a { font-size: 13px; color: var(--spume, #a8f0cd); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.forgot-row a:hover, .reset-back a:hover { border-bottom-color: currentColor; }
.reset-wrap { margin-top: 16px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: rgba(255,255,255,.03); overflow: hidden; animation: resetIn .25s ease; }
.reset-inner { padding: 18px 18px 16px; }
.reset-back { margin-top: 14px; text-align: center; }
@keyframes resetIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ----------------------------------------------------------- DASHBOARD */
.dash-hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: clamp(34px, 6vw, 68px) 0 clamp(30px, 5vw, 54px);
}
.dash-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: .42;
  background-image: var(--hero-img); background-size: cover; background-position: center 38%;
  mask-image: radial-gradient(120% 100% at 70% 30%, rgba(0,0,0,.95), transparent 72%);
}
.dash-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, rgba(var(--veil), .94) 22%, rgba(var(--veil), .5) 62%, rgba(var(--veil), .2));
}
.dash-hero .wrap { position: relative; z-index: 1; }
.dash-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: clamp(24px, 4vw, 52px); align-items: center; }
.dash-hero h1 { margin-bottom: 14px; }
.dash-sub { color: var(--text-dim); font-size: clamp(15px, 1.6vw, 17px); max-width: 54ch; }
.dash-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.dash-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--text-dim); background: rgba(255,255,255,.04);
}
.pill.gold { color: var(--gold-hi); border-color: rgba(201,169,97,.45); background: rgba(201,169,97,.1); }
.pill.sea  { color: var(--glow); border-color: rgba(116,211,171,.45); background: rgba(63,156,120,.14); }

/* progress ring */
.ring-card { display: grid; gap: 18px; justify-items: center; text-align: center; }
.ring { position: relative; width: 178px; height: 178px; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 9; }
.ring .fill  { fill: none; stroke-width: 9; stroke-linecap: round;
  /* the stroke comes from each ring's own <linearGradient> id, set on the
     element, so several rings can share a page (the dashboard cards) */
  transition: stroke-dashoffset 1.1s var(--ease-out); }
.ring-mid { position: absolute; inset: 0; display: grid; place-content: center; gap: 2px; }
.ring-mid b { font-family: var(--font-display); font-size: 42px; line-height: 1; color: var(--text); }
.ring-mid span { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-faint); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; width: 100%; }
.stat {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 13px 12px; text-align: center;
}
.stat b { display: block; font-family: var(--font-display); font-size: 23px; color: var(--glow); line-height: 1.15; }
.stat span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }

/* continue card */
.continue {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  background: linear-gradient(120deg, rgba(63,156,120,.2), rgba(20,48,41,.75));
  border: 1px solid rgba(116,211,171,.34); border-radius: var(--r-l);
  padding: 20px 24px; margin-top: 30px; box-shadow: var(--shadow-m);
}
.continue-n {
  width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 21px;
  background: rgba(7,20,17,.55); border: 1px solid var(--line-2); color: var(--glow);
}
.continue small { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--glow); display: block; margin-bottom: 3px; }
.continue b { font-family: var(--font-display); font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; display: block; line-height: 1.24; }
.continue p { font-size: 13.5px; color: var(--text-dim); margin-top: 3px; }

/* section head */
.sec { padding-top: clamp(40px, 6vw, 70px); }
.sec-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.sec-head p { color: var(--text-dim); font-size: 14.5px; max-width: 60ch; margin-top: 6px; }

/* performance tiles */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.perf {
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  position: relative; overflow: hidden;
}
.perf::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent, var(--sea)); }
.perf .lbl { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); }
.perf .val { font-family: var(--font-display); font-size: 34px; line-height: 1.1; margin: 6px 0 2px; color: var(--text); }
.perf .sub { font-size: 12.5px; color: var(--text-dim); }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 13px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent, var(--sea)); transition: width .9s var(--ease-out); }

/* --------------------------------------------------------- COURSE MAP */
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; font-size: 12px; color: var(--text-dim); }
.map-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.journey { position: relative; display: grid; gap: 14px; }
.journey::before {
  content: ""; position: absolute; left: 27px; top: 32px; bottom: 32px; width: 2px;
  background: linear-gradient(180deg, var(--sea), var(--gold) 55%, var(--plum));
  opacity: .3; border-radius: 2px;
}
@media (max-width: 700px) { .journey::before { left: 19px; } }

.stage {
  position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start;
}
.stage-dot {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2); z-index: 1;
  font-family: var(--font-display); font-size: 18px; color: var(--text-dim);
  transition: all .35s var(--ease);
}
.stage.done .stage-dot { background: linear-gradient(140deg, var(--sea), var(--moss)); border-color: var(--spume); color: #04120e; box-shadow: 0 0 0 5px rgba(63,156,120,.16); }
.stage.now .stage-dot  { background: linear-gradient(140deg, var(--gold-hi), var(--gold)); border-color: var(--gold-hi); color: #2a2007; box-shadow: 0 0 0 5px rgba(201,169,97,.18); animation: pulseGold 2.6s var(--ease) infinite; }
@keyframes pulseGold { 0%,100%{box-shadow:0 0 0 5px rgba(201,169,97,.18)} 50%{box-shadow:0 0 0 12px rgba(201,169,97,.03)} }

.stage-body {
  border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), rgba(15,38,32,.6));
  transition: border-color .3s, transform .3s var(--ease);
}
.stage.now .stage-body { border-color: rgba(201,169,97,.4); }
.stage-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 17px 22px; cursor: pointer; width: 100%; text-align: left; background: none; border: 0;
}
.stage-head:hover { background: rgba(255,255,255,.03); }
.stage-head h3 { font-size: clamp(16px, 2vw, 20px); }
.stage-head .desc { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }
.stage-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.mini-bar { width: 74px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--sea); transition: width .8s var(--ease-out); }
.chev { transition: transform .3s var(--ease); font-size: 11px; color: var(--text-faint); }
.stage[open] .chev, .stage.open .chev { transform: rotate(180deg); }

.lesson-list { border-top: 1px solid var(--line); }
.lesson-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 22px; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid rgba(168,240,205,.06);
  transition: background .2s; color: var(--text);
}
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover:not(:disabled) { background: rgba(116,211,171,.07); }
.lesson-row:disabled { opacity: .42; cursor: not-allowed; }
.lesson-row .tick {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line-2); font-size: 11px; color: var(--text-faint); flex-shrink: 0;
}
.lesson-row.done .tick { background: var(--sea); border-color: var(--spume); color: #04120e; }
.lesson-row.now .tick { border-color: var(--gold); color: var(--gold-hi); }
.lesson-row .ttl { font-size: 14.5px; font-weight: 550; line-height: 1.35; }
.lesson-row .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.lesson-row .tags { display: flex; gap: 5px; flex-shrink: 0; }
.tag {
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-faint);
}
.tag.game { color: var(--gold-hi); border-color: rgba(201,169,97,.4); background: rgba(201,169,97,.1); }
.tag.sim  { color: #d9b6ef; border-color: rgba(168,116,196,.45); background: rgba(168,116,196,.12); }
.tag.safe { color: #ffc0c0; border-color: rgba(224,82,82,.4); background: rgba(224,82,82,.1); }

/* --------------------------------------------------------- LESSON VIEW */
.lesson-hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  padding: clamp(30px, 5vw, 56px) 0 clamp(26px, 4vw, 44px);
}
.lesson-hero::before {
  content: ""; position: absolute; inset: 0; opacity: .3;
  background-image: var(--hero-img); background-size: cover; background-position: center 40%;
  mask-image: linear-gradient(105deg, transparent 8%, rgba(0,0,0,.9));
}
.lesson-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(95deg, rgba(7,20,17,.95) 30%, rgba(7,20,17,.55)); }
.lesson-hero .wrap { position: relative; z-index: 1; }
.crumbs { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.crumbs a { color: var(--gold); }
.lesson-hero h1 { max-width: 20ch; }
.lesson-hero .sub { color: var(--text-dim); font-size: clamp(15px, 1.7vw, 17.5px); max-width: 62ch; margin-top: 12px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.lesson-body { padding-top: clamp(30px, 4vw, 46px); }
.lesson-body > .wrap { max-width: 900px; }
.blocks > * + * { margin-top: 26px; }
.blocks p { color: #dcebe4; font-size: 16.5px; line-height: 1.72; }
.blocks p b, .blocks p strong { color: #fff; font-weight: 650; }
.blocks h2 { margin-top: 46px; }
.blocks h3 { margin-top: 34px; }
.blocks .lead { font-size: clamp(17px, 2vw, 20px); line-height: 1.6; color: #eaf5ef; font-weight: 400; }

.blocks ul.bul { display: grid; gap: 11px; }
.blocks ul.bul li { position: relative; padding-left: 26px; color: #d8e8e1; font-size: 15.5px; line-height: 1.6; }
.blocks ul.bul li::before {
  content: ""; position: absolute; left: 6px; top: .62em; width: 7px; height: 7px;
  border-radius: 2px; background: var(--sea); transform: rotate(45deg);
}
.blocks ol.num { display: grid; gap: 13px; counter-reset: n; }
.blocks ol.num li { position: relative; padding-left: 40px; counter-increment: n; color: #d8e8e1; font-size: 15.5px; }
.blocks ol.num li::before {
  content: counter(n); position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(63,156,120,.18); border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 700; color: var(--glow);
}

/* -------------------------------------------------------- NOTE BLOCKS */
/* Requirement: knowledge vs clinical judgement must look different. */
.note {
  border-radius: var(--r-l); padding: 20px 22px 20px 24px; position: relative;
  border: 1px solid var(--nb, var(--line-2)); background: var(--nbg, rgba(255,255,255,.04));
  overflow: hidden;
}
.note::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--nc, var(--sea)); }
.note-hd {
  display: flex; align-items: center; gap: 9px; margin-bottom: 9px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--nc, var(--sea));
}
.note p, .note li { font-size: 15px; color: #dfeee7; }
.note > p + p { margin-top: 10px; }
.note ul.bul { margin-top: 8px; }
.note ul.bul li { font-size: 14.5px; }
.note ul.bul li::before { background: var(--nc, var(--sea)); }

.note.essential { --nc: var(--spume); --nb: rgba(116,211,171,.3);  --nbg: rgba(63,156,120,.09); }
.note.clinical  { --nc: #7fc6ea; --nb: rgba(90,169,214,.32); --nbg: rgba(90,169,214,.09); }
.note.safety    { --nc: #ff8f8f; --nb: rgba(224,82,82,.42);  --nbg: rgba(224,82,82,.11); }
.note.trainer   { --nc: var(--gold-hi); --nb: rgba(201,169,97,.36); --nbg: rgba(201,169,97,.1); }
.note.tip       { --nc: #9fe6c4; --nb: rgba(159,230,196,.26); --nbg: rgba(159,230,196,.07); }
.note.protocol  { --nc: #cbb9f0; --nb: rgba(168,116,196,.36); --nbg: rgba(168,116,196,.11); }
.note.reaction  { --nc: #f0c47a; --nb: rgba(224,160,60,.36);  --nbg: rgba(224,160,60,.1); }
.note.stop      { --nc: #ff6b6b; --nb: rgba(224,82,82,.6);    --nbg: rgba(224,82,82,.16); }
.note.client    { --nc: #f2d9c0; --nb: rgba(242,217,192,.3);  --nbg: rgba(242,217,192,.07); }
.note.business  { --nc: #b6d98f; --nb: rgba(182,217,143,.3);  --nbg: rgba(182,217,143,.08); }

.note.stop { box-shadow: 0 0 0 1px rgba(224,82,82,.18), 0 12px 34px rgba(224,82,82,.12); }
.note.safety .note-hd, .note.stop .note-hd { letter-spacing: .22em; }

/* quote from trainer */
.quote {
  border-left: 3px solid var(--gold); padding: 4px 0 4px 22px;
  font-family: var(--font-display); font-size: clamp(18px, 2.4vw, 23px); line-height: 1.45;
  color: #f2ead6; font-style: italic;
}
.quote cite { display: block; margin-top: 10px; font-family: var(--font-body); font-style: normal;
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }

/* ------------------------------------------------------------- FIGURES */
figure.fig { margin: 0; }
figure.fig img { width: 100%; border-radius: var(--r-l); border: 1px solid var(--line); }
figure.fig figcaption, .cap { margin-top: 10px; font-size: 12.5px; color: var(--text-faint); text-align: center; }

.svgfig {
  background: linear-gradient(165deg, rgba(26,70,56,.4), rgba(9,26,22,.75));
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px;
}
.svgfig svg { width: 100%; height: auto; overflow: visible; }
.svgfig .ttl { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }

/* ---------------------------------------------------------- DATA GRIDS */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.gcard {
  border: 1px solid var(--line); border-top: 2px solid var(--sea); border-radius: var(--r-m); padding: 18px 19px;
  background: rgba(255,255,255,.035); transition: transform .3s var(--ease), border-color .3s;
}
.gcard:hover { transform: translateY(-3px); border-color: var(--line-2); border-top-color: var(--spume); }
.gcard h4 { color: var(--glow); margin-bottom: 7px; font-size: 14.5px; letter-spacing: .01em; }
.gcard p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); background: rgba(255,255,255,.03); }
table.dt { width: 100%; border-collapse: collapse; min-width: 520px; }
table.dt th, table.dt td { padding: 13px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid rgba(168,240,205,.08); vertical-align: top; }
table.dt th { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); background: rgba(0,0,0,.22); font-weight: 700; white-space: nowrap; }
table.dt tr:last-child td { border-bottom: 0; }
table.dt td:first-child { font-weight: 650; color: var(--glow); }
table.dt tbody tr:hover { background: rgba(116,211,171,.05); }

/* steps */
.steps { display: grid; gap: 12px; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px;
  background: rgba(255,255,255,.035);
}
.step .n {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(63,156,120,.3), rgba(26,70,56,.5));
  border: 1px solid var(--line-2); font-family: var(--font-display); font-size: 17px; color: var(--glow);
}
.step > div > b { display: block; font-size: 14.5px; color: #fff; margin-bottom: 3px; }
.step p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }
.step p b { display: inline; color: #fff; font-weight: 650; }

/* comparison columns */
.compare { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.ccol { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: rgba(255,255,255,.035); }
.ccol > header { padding: 14px 18px; background: var(--ch, rgba(63,156,120,.2)); border-bottom: 1px solid var(--line); }
.ccol > header b { display: block; font-family: var(--font-display); font-size: 17px; }
.ccol > header span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.ccol dl { padding: 6px 18px 16px; margin: 0; }
.ccol dt { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 13px; }
.ccol dd { margin: 4px 0 0; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }

/* product card */
.product {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px;
  background: linear-gradient(120deg, rgba(26,70,56,.42), rgba(15,38,32,.6));
}
.product img { border-radius: var(--r-m); aspect-ratio: 1; object-fit: cover; width: 100%; border: 1px solid var(--line); }
.product h4 { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: #fff; letter-spacing: 0; margin-bottom: 6px; }
.product p { font-size: 13.5px; color: var(--text-dim); }
.product .inci { margin-top: 9px; font-size: 11.5px; color: var(--text-faint); font-style: italic; line-height: 1.45; }

/* flip cards */
.flips { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; }
.flip { perspective: 1100px; background: none; border: 0; padding: 0; min-height: 168px; height: auto; }
.flip-in { position: relative; width: 100%; height: auto; min-height: 168px; transition: transform .62s var(--ease-out); transform-style: preserve-3d; }
/* an invisible copy of both faces in one grid cell, so the card is always as
   tall as its longer side and no text can spill out of the rounded box */
.flip-size { visibility: hidden; display: grid; padding: 20px 20px 38px; gap: 9px; text-align: center; pointer-events: none; }
.flip-size > * { grid-area: 1 / 1; margin: 0; }
.flip-size .fs-f { font-size: 14.5px; line-height: 1.35; font-weight: 700; }
.flip-size .fs-b { font-size: 13.5px; line-height: 1.5; }
.flip[aria-pressed="true"] .flip-in { transform: rotateY(180deg); }
.flip-f, .flip-b {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-m);
  display: grid; align-content: center; gap: 9px; padding: 20px; text-align: center;
  border: 1px solid var(--line-2);
}
.flip-f { background: linear-gradient(150deg, var(--surface-3), var(--surface)); }
.flip-b { background: linear-gradient(150deg, var(--moss), var(--forest)); transform: rotateY(180deg); border-color: var(--spume); }
.flip-f .ic { font-size: 25px; }
.flip-f b { font-size: 14.5px; color: var(--text); line-height: 1.35; }
.flip-b p { font-size: 13.5px; color: #ecfaf3; line-height: 1.5; }
.flip-f::after { content: "tap to reveal"; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }

/* accordion / Q&A */
.qa { border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: rgba(255,255,255,.03); }
.qa + .qa { margin-top: 9px; }
.qa-q {
  width: 100%; text-align: left; background: none; border: 0; padding: 15px 18px;
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  font-size: 14.5px; font-weight: 600; color: var(--text);
}
.qa-q:hover { background: rgba(116,211,171,.06); }
.qa-q .mk { color: var(--gold); font-size: 13px; transition: transform .3s var(--ease); flex-shrink: 0; }
.qa.open .qa-q .mk { transform: rotate(45deg); }
.qa-a { max-height: 0; overflow: hidden; transition: max-height .42s var(--ease); }
.qa.open .qa-a { max-height: 620px; }
.qa-a > div { padding: 0 18px 17px; font-size: 14.5px; color: var(--text-dim); line-height: 1.62; border-top: 1px solid var(--line); padding-top: 14px; }

/* --------------------------------------------------- INLINE KNOWLEDGE */
.check {
  border: 1px solid rgba(201,169,97,.3); border-radius: var(--r-l);
  background: linear-gradient(160deg, rgba(201,169,97,.09), rgba(15,38,32,.6));
  padding: 22px;
}
.check .kh { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.check .q { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 15px; line-height: 1.45; }
.opts { display: grid; gap: 9px; }
.opt {
  display: flex; gap: 13px; align-items: flex-start; text-align: left; width: 100%;
  padding: 13px 16px; border-radius: var(--r-m); border: 1px solid var(--line-2);
  background: rgba(255,255,255,.04); color: var(--text); font-size: 14.5px; line-height: 1.45;
  transition: all .22s var(--ease);
}
.opt:hover:not(:disabled) { border-color: var(--spume); background: rgba(116,211,171,.09); transform: translateX(3px); }
.opt:disabled { cursor: default; }
.opt .mk {
  width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 700; color: var(--text-faint);
}
.opt.right { border-color: var(--ok); background: rgba(70,185,138,.15); }
.opt.right .mk { background: var(--ok); border-color: var(--ok); color: #04120e; }
.opt.wrong { border-color: var(--danger); background: rgba(224,82,82,.13); }
.opt.wrong .mk { background: var(--danger); border-color: var(--danger); color: #fff; }
.opt.muted { opacity: .5; }

.fb { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-m); font-size: 14px; line-height: 1.6; animation: fbIn .4s var(--ease-out); }
.fb.good { background: rgba(70,185,138,.13); border: 1px solid rgba(70,185,138,.4); color: #c6f2de; }
.fb.bad  { background: rgba(224,82,82,.12); border: 1px solid rgba(224,82,82,.4); color: #ffd2d2; }
.fb.info { background: rgba(90,169,214,.12); border: 1px solid rgba(90,169,214,.4); color: #cbe8f8; }
.fb b { color: #fff; }
@keyframes fbIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* written reflection */
.writ { border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 22px; background: rgba(255,255,255,.035); }
.writ .kh { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--spume); margin-bottom: 10px; }
.writ .q { font-size: 15.5px; font-weight: 600; margin-bottom: 13px; color: #fff; }
.model { margin-top: 14px; padding: 15px 17px; border-radius: var(--r-m); background: rgba(63,156,120,.12); border: 1px solid rgba(116,211,171,.3); font-size: 14px; color: #d8f0e5; line-height: 1.62; }
.model b { color: var(--glow); display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 7px; }

/* spaced recall */
.recall {
  border: 1px dashed rgba(168,116,196,.5); border-radius: var(--r-l); padding: 20px;
  background: linear-gradient(160deg, rgba(168,116,196,.1), rgba(15,38,32,.55));
}
.recall .kh { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #cbb9f0; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.recall .from { font-size: 11.5px; color: var(--text-faint); margin-bottom: 13px; }
.recall .q { font-weight: 600; color: var(--text); margin-bottom: 13px; }

/* --------------------------------------------------------- GAME SHELL */
.gamecard {
  border-radius: var(--r-xl); overflow: hidden; position: relative;
  border: 1px solid rgba(201,169,97,.3);
  background: linear-gradient(150deg, rgba(26,70,56,.62), rgba(9,26,22,.9));
  box-shadow: var(--shadow-m);
}
.gamecard > header { padding: 24px 26px; border-bottom: 1px solid var(--line); }
.gamecard .gk { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 9px; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.gamecard h3 { font-size: clamp(19px, 2.4vw, 24px); margin-bottom: 7px; }
.gamecard .gb { font-size: 14px; color: var(--text-dim); max-width: 62ch; }
.gamebody { padding: 24px 26px 26px; }
.gamefoot { padding: 16px 26px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.gscore { font-size: 12.5px; color: var(--text-dim); }
.gscore b { color: var(--glow); font-size: 16px; font-family: var(--font-display); }

.gprog { display: flex; gap: 5px; margin-bottom: 20px; flex-wrap: wrap; }
.gprog i { width: 26px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .3s; }
.gprog i.on { background: var(--gold); }
.gprog i.ok { background: var(--ok); }
.gprog i.no { background: var(--danger); }

/* drag/tap sequencing */
.seq { display: grid; gap: 10px; }
.seq-item {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  padding: 13px 16px; border-radius: var(--r-m); border: 1px solid var(--line-2);
  background: rgba(255,255,255,.05); font-size: 14.5px; cursor: grab; user-select: none;
  transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s;
  touch-action: none;
}
.seq-item:hover { border-color: var(--spume); }
.seq-item.drag { opacity: .45; }
.seq-item.over { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,169,97,.24); }
.seq-item .pos {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(63,156,120,.2); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 700; color: var(--glow);
}
.seq-item .mv { display: flex; gap: 4px; }
.seq-item .mv button {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.05); color: var(--text-dim); font-size: 12px; display: grid; place-items: center;
}
.seq-item .mv button:hover { background: var(--sea); color: #04120e; border-color: var(--spume); }
.seq-item.ok { border-color: var(--ok); background: rgba(70,185,138,.13); }
.seq-item.no { border-color: var(--danger); background: rgba(224,82,82,.11); }

/* bucket sorting */
.sortpool { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; min-height: 54px;
  padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--r-m); background: rgba(0,0,0,.16); }
.chip {
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.06); font-size: 13.5px; cursor: pointer; user-select: none;
  transition: all .2s var(--ease); text-align: left;
}
.chip:hover:not(:disabled) { border-color: var(--spume); background: rgba(116,211,171,.13); transform: translateY(-2px); }
.chip.sel { border-color: var(--gold); background: rgba(201,169,97,.2); box-shadow: 0 0 0 2px rgba(201,169,97,.2); }
.chip.ok { border-color: var(--ok); background: rgba(70,185,138,.16); }
.chip.no { border-color: var(--danger); background: rgba(224,82,82,.15); }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 13px; }
.bucket {
  border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 15px; min-height: 130px;
  background: rgba(255,255,255,.035); transition: border-color .2s, background .2s;
}
.bucket.armed { border-color: var(--gold); background: rgba(201,169,97,.09); }
.bucket > h5 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--bc, var(--spume)); margin-bottom: 11px; font-weight: 800; }
.bucket .items { display: flex; flex-wrap: wrap; gap: 8px; }

/* case cards */
.casefile {
  border: 1px solid var(--line-2); border-radius: var(--r-l); overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(0,0,0,.2));
}
.casefile > header { padding: 16px 20px; background: rgba(0,0,0,.28); border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.casefile .who { flex: 1; }
.casefile .who b { display: block; font-size: 15.5px; color: #fff; }
.casefile .who span { font-size: 12px; color: var(--text-faint); }
.casefile .ph {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(140deg, var(--surface-3), var(--forest)); border: 1px solid var(--line-2);
  font-family: var(--font-display); font-size: 17px; color: var(--glow);
}
.casefile .body { padding: 18px 20px; }
.dl { display: grid; gap: 10px; }
.dl .row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; font-size: 14px; align-items: start; }
.dl .row dt { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding-top: 3px; }
.dl .row dd { margin: 0; color: var(--text-dim); }
@media (max-width: 560px) { .dl .row { grid-template-columns: 1fr; gap: 2px; } }

/* detective / find-the-fault */
.hunt { display: grid; gap: 9px; }
.hunt-line {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 12px 15px; border-radius: var(--r-m); border: 1px solid transparent;
  background: rgba(255,255,255,.035); font-size: 14px; color: var(--text-dim); line-height: 1.55;
  transition: all .2s;
}
.hunt-line:hover:not(:disabled) { background: rgba(255,255,255,.07); border-color: var(--line-2); }
.hunt-line .fl { width: 20px; flex-shrink: 0; text-align: center; color: var(--text-faint); font-size: 12px; }
.hunt-line.flagged { border-color: var(--gold); background: rgba(201,169,97,.12); }
.hunt-line.hit { border-color: var(--ok); background: rgba(70,185,138,.14); color: #d5f5e7; }
.hunt-line.miss { border-color: var(--danger); background: rgba(224,82,82,.12); }
.hunt-line.falsepos { border-color: var(--warn); background: rgba(224,160,60,.12); }

/* slider game */
.gauge { position: relative; padding: 30px 0 10px; }
.gauge-track { height: 22px; border-radius: 999px; position: relative; overflow: hidden; border: 1px solid var(--line-2); }
.gauge-zones { position: absolute; inset: 0; display: flex; }
.gauge-zones i { height: 100%; }
.gauge-mark { position: absolute; top: -8px; width: 3px; height: 38px; background: #fff; border-radius: 2px; box-shadow: 0 0 12px rgba(255,255,255,.7); transition: left .1s linear; }
.gauge input[type=range] { width: 100%; margin-top: 18px; accent-color: var(--spume); }
.gauge-lbl { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-top: 8px; }
.gauge-read { text-align: center; margin-top: 14px; }
.gauge-read b { font-family: var(--font-display); font-size: 40px; color: var(--glow); display: block; line-height: 1; }
.gauge-read span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }

/* face / body maps */
.mapfig { display: grid; gap: 18px; grid-template-columns: minmax(220px, 340px) 1fr; align-items: start; }
@media (max-width: 780px) { .mapfig { grid-template-columns: 1fr; } }
.mapfig .art { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.zone { cursor: pointer; transition: opacity .22s, filter .22s; }
.zone:hover { filter: brightness(1.35); }
.zone.sel { filter: brightness(1.5) drop-shadow(0 0 8px rgba(201,169,97,.8)); }
.zone:focus-visible { outline: 2px solid var(--glow); }
.zoneinfo { min-height: 180px; }
.zoneinfo .verdict { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 12px; }
.verdict.yes  { background: rgba(70,185,138,.2); color: #a8f0cd; border: 1px solid rgba(70,185,138,.5); }
.verdict.mod  { background: rgba(224,160,60,.18); color: #f5d9a4; border: 1px solid rgba(224,160,60,.5); }
.verdict.no   { background: rgba(224,82,82,.18); color: #ffb8b8; border: 1px solid rgba(224,82,82,.55); }

/* interactive timeline */
.tl { display: grid; gap: 20px; }
.tl-rail { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.tl-node {
  flex: 1 0 auto; min-width: 108px; padding: 13px 14px; border-radius: var(--r-m);
  border: 1px solid var(--line-2); background: rgba(255,255,255,.04); text-align: left;
  transition: all .28s var(--ease); position: relative;
}
.tl-node:hover { border-color: var(--spume); transform: translateY(-2px); }
.tl-node.on { background: linear-gradient(140deg, var(--sea), var(--moss)); border-color: var(--glow); color: #04120e; box-shadow: 0 8px 24px rgba(63,156,120,.3); }
.tl-node b { display: block; font-size: 13px; line-height: 1.25; }
.tl-node span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.tl-panel { border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; background: linear-gradient(160deg, var(--surface-2), rgba(9,26,22,.6)); animation: fadeUp .4s var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tl-panel h4 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: 0; color: #fff; margin-bottom: 4px; }
.tl-panel .when { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.tl-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 6px; }
.tl-col h5 { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--tc, var(--spume)); margin-bottom: 8px; font-weight: 800; }
.tl-col ul { display: grid; gap: 7px; }
.tl-col li { font-size: 13.5px; color: var(--text-dim); padding-left: 15px; position: relative; line-height: 1.5; }
.tl-col li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--tc, var(--spume)); }

/* --------------------------------------------------------- SIMULATOR */
.simroom {
  border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line-2);
  background: linear-gradient(165deg, rgba(20,48,41,.9), rgba(7,20,17,.96));
  box-shadow: var(--shadow-l);
}
.sim-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.24); }
.sim-top .stg { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.sim-top h4 { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0; margin-top: 3px; }
.sim-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.sim-steps i { width: 20px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.12); }
.sim-steps i.done { background: var(--sea); }
.sim-steps i.now { background: var(--gold); }
.sim-body { padding: 26px 24px; }
.sim-scene {
  border-radius: var(--r-l); padding: 22px; margin-bottom: 22px;
  background: radial-gradient(120% 140% at 50% 0%, rgba(63,156,120,.16), rgba(0,0,0,.3));
  border: 1px solid var(--line);
}
.sim-scene p { font-size: 15.5px; color: #dfeee7; line-height: 1.65; }
.sim-scene p + p { margin-top: 10px; }
.sim-choices { display: grid; gap: 10px; }
.sim-log { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.sim-log h5 { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.sim-log li { font-size: 13px; color: var(--text-dim); padding: 6px 0 6px 22px; position: relative; border-bottom: 1px solid rgba(168,240,205,.06); }
.sim-log li::before { content: "◆"; position: absolute; left: 4px; color: var(--sea); font-size: 8px; top: 10px; }
.sim-log li.bad::before { content: "✕"; color: var(--danger); font-size: 10px; }
.sim-log li.warn::before { content: "!"; color: var(--warn); font-weight: 700; }

/* scorecard */
.scorecard { display: grid; gap: 18px; }
.score-hero { text-align: center; padding: 26px 20px; border-radius: var(--r-l); background: linear-gradient(160deg, rgba(63,156,120,.2), rgba(9,26,22,.7)); border: 1px solid var(--line-2); }
.score-hero .big { font-family: var(--font-display); font-size: clamp(48px, 9vw, 74px); line-height: 1; color: var(--glow); }
.score-hero .lbl { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-faint); margin-top: 6px; }
.score-hero.pass { border-color: rgba(70,185,138,.55); }
.score-hero.fail { border-color: rgba(224,82,82,.5); background: linear-gradient(160deg, rgba(224,82,82,.14), rgba(9,26,22,.7)); }
.score-hero.fail .big { color: #ff9d9d; }
.breakdown { display: grid; gap: 11px; }
.brk { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.brk .nm { font-size: 13.5px; color: var(--text-dim); }
.brk .sc { font-size: 13px; font-weight: 700; color: var(--glow); }
.brk .bar { grid-column: 1 / -1; margin-top: 0; }

/* -------------------------------------------------------- ASSESSMENT */
.exam-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.exam-prog { flex: 1; min-width: 180px; }
.exam-prog .bar { margin-top: 8px; }
.qcard { border: 1px solid var(--line-2); border-radius: var(--r-l); padding: clamp(20px, 3vw, 30px); background: linear-gradient(160deg, var(--surface-2), rgba(9,26,22,.65)); }
.qcard .qn { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.qcard .qt { font-size: clamp(16px, 2.2vw, 19px); font-weight: 600; color: #fff; line-height: 1.5; margin-bottom: 18px; }
.qkind { display: inline-block; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-faint); margin-left: 9px; vertical-align: 2px; }

.remediate { border: 1px solid rgba(224,160,60,.4); background: rgba(224,160,60,.09); border-radius: var(--r-l); padding: 20px; }
.remediate h4 { color: var(--warn); margin-bottom: 10px; }
.remediate a { display: inline-block; margin: 4px 6px 4px 0; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--text); }
.remediate a:hover { background: rgba(255,255,255,.08); text-decoration: none; }

/* ------------------------------------------------------- CERTIFICATE */
.cert-stage { display: grid; place-items: center; padding: 30px 0; }
#certificate {
  width: 1000px; max-width: 100%; aspect-ratio: 1.414; background: #fdfcf8; color: #16241f;
  padding: 54px; position: relative; box-shadow: var(--shadow-l); border-radius: 4px;
  display: grid; grid-template-rows: auto 1fr auto; text-align: center;
}
#certificate::before { content: ""; position: absolute; inset: 20px; border: 1.5px solid #c9a961; }
#certificate::after { content: ""; position: absolute; inset: 27px; border: .5px solid #d9d2c2; }
.cert-in { position: relative; z-index: 1; display: contents; }
.cert-top .logo { font-family: var(--font-display); font-size: 26px; color: #12332a; letter-spacing: .04em; }
.cert-top .sub { font-size: 9.5px; letter-spacing: .32em; text-transform: uppercase; color: #8f7539; margin-top: 5px; }
.cert-mid { display: grid; align-content: center; gap: 9px; }
.cert-mid .pre { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: #6d7f78; }
.cert-mid .name { font-family: var(--font-script); font-size: clamp(38px, 6vw, 58px); color: #12332a; line-height: 1.1; }
.cert-mid .rule { width: 260px; height: 1px; background: #c9a961; margin: 4px auto; }
.cert-mid .course { font-family: var(--font-display); font-size: clamp(19px, 2.6vw, 26px); color: #16241f; }
.cert-mid .desc { font-size: 12px; color: #55655f; max-width: 60ch; margin: 4px auto 0; line-height: 1.6; }
.cert-bot { display: flex; justify-content: space-between; align-items: end; gap: 20px; font-size: 10px; color: #55655f; }
.cert-bot .sig { text-align: center; }
.cert-bot .sig .line { width: 150px; border-top: 1px solid #16241f; margin-bottom: 5px; }
.cert-bot .sig .nm { font-family: var(--font-script); font-size: 24px; color: #12332a; line-height: 1; margin-bottom: 3px; }
.cert-seal { width: 74px; height: 74px; border-radius: 50%; border: 2px solid #c9a961; display: grid; place-items: center; text-align: center; font-size: 7.5px; letter-spacing: .12em; text-transform: uppercase; color: #8f7539; line-height: 1.4; }

/* Green Sea Peel certificate — matches the official Seoulogy design */
#certificate.cert-gsp {
  background: #ffffff; color: #3d3d3d; padding: 70px 80px 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  font-family: "Inter", sans-serif;
}
#certificate.cert-gsp::before { content: ""; position: absolute; inset: 22px; border: 2.5px solid transparent; border-image: linear-gradient(135deg, #d9b95c, #f3e3ae 40%, #c69c45 75%, #e8d491) 1; }
#certificate.cert-gsp::after { content: ""; position: absolute; inset: 29px; border: 1px solid #e3cf96; }
.ckt-title { font-family: var(--font-serif, "Cormorant Garamond", serif); font-size: clamp(38px, 5.6vw, 58px); font-weight: 600; letter-spacing: .3em; text-indent: .3em; color: #6e2639; margin-top: 26px; }
.ckt-sub { font-size: clamp(9px, 1.2vw, 12.5px); letter-spacing: .22em; color: #6e2639; margin-top: 14px; }
.ckt-pre { font-size: clamp(8.5px, 1.1vw, 11.5px); letter-spacing: .3em; color: #4a4a4a; margin-top: 30px; }
.ckt-name { font-family: var(--font-script, "Great Vibes", cursive); font-size: clamp(40px, 6vw, 62px); color: #6e2639; line-height: 1.15; margin-top: 14px; }
.ckt-rule { width: min(560px, 78%); height: 1px; background: #d9d9d9; margin: 6px auto 0; }
.ckt-course { font-family: var(--font-serif, "Cormorant Garamond", serif); font-size: clamp(22px, 3vw, 32px); font-weight: 700; color: #6e2639; margin-top: 30px; }
.ckt-desc { font-family: var(--font-serif, "Cormorant Garamond", serif); font-style: italic; font-size: clamp(11.5px, 1.5vw, 15px); font-weight: 600; color: #2f2f2f; max-width: 62ch; line-height: 1.55; margin-top: 30px; }
.ckt-official { font-size: clamp(9px, 1.2vw, 12.5px); letter-spacing: .24em; color: #6e2639; font-weight: 600; margin-top: 26px; }
.ckt-bottom { margin-top: auto; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.ckt-date { font-size: clamp(10px, 1.3vw, 13.5px); color: #2f2f2f; padding-bottom: 16px; }
.ckt-marks { display: flex; align-items: flex-start; gap: 14px; }
.ckt-marks .cpd { width: clamp(52px, 7vw, 72px); height: auto; }
.ckt-seoul { display: flex; flex-direction: column; align-items: center; }
.ckt-seoul .seal { width: clamp(56px, 7.6vw, 78px); height: auto; }
.ckt-seoul .sign { width: clamp(46px, 6.4vw, 66px); height: auto; margin-top: -8px; }
.ckt-id { position: absolute; left: 0; right: 0; bottom: 34px; font-size: 8.5px; letter-spacing: .14em; color: #b5b5b5; text-align: center; }
.ckt-derm { align-self: center; text-align: center; font-family: "Inter", sans-serif; font-weight: 700; font-size: clamp(11px, 1.5vw, 15px); letter-spacing: .3em; text-indent: .3em; color: #1a1a1a; }
.ckt-derm span { display: block; font-size: clamp(6.5px, .9vw, 8.5px); letter-spacing: .34em; color: #8a8a8a; margin-top: 3px; }

/* small figure variant (e.g. CPD accreditation logo) */
.fig-small img { max-width: 200px; margin: 0 auto; display: block; }
.fig-small { text-align: center; }

/* ------------------------------------------------------------- ADMIN */
.admin-tbl { width: 100%; border-collapse: collapse; min-width: 680px; }
.admin-tbl th, .admin-tbl td { padding: 12px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.admin-tbl th { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 13px; margin-bottom: 26px; }

/* -------------------------------------------------------- MODAL/TOAST */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(4,12,10,.82);
  backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px;
  animation: fadeIn .25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal { max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto; animation: popIn .35s var(--ease-out); }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(14px) } to { opacity: 1; transform: none } }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200;
  padding: 13px 24px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--sea), var(--moss)); color: #04120e;
  box-shadow: var(--shadow-m); animation: toastIn .4s var(--ease-out);
}
.toast.warn { background: linear-gradient(135deg, var(--warn), #b87f22); color: #241703; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 22px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* completion celebration */
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.celebrate i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0; } }

/* ----------------------------------------------------------- ANIMATION */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }

@keyframes drift { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes glowPulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }
@keyframes sink { 0% { transform: translateY(-24px); opacity: 0 } 55% { opacity: 1 } 100% { transform: translateY(0); opacity: 1 } }
@keyframes rise { 0% { transform: translateY(0) } 100% { transform: translateY(-30px); opacity: 0 } }

.anim-draw path, .anim-draw line, .anim-draw polyline {
  stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400);
  animation: dash 1.8s var(--ease-out) forwards;
}
.float { animation: drift 5.5s ease-in-out infinite; }

/* ------------------------------------------- ANIMATED SCIENCE GAMES */
.sq-scene { border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; background: linear-gradient(165deg, rgba(26,70,56,.4), rgba(9,26,22,.75)); position: relative; overflow: hidden; }
.sq-scene svg { width: 100%; height: auto; display: block; }
.sq-title { font-family: var(--font-display); font-size: 19px; color: var(--glow); margin-bottom: 8px; }
.sq-reveal { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-m); background: rgba(116,211,171,.1); border: 1px solid rgba(116,211,171,.3); font-size: 14px; color: #d8f0e5; animation: fadeUp .5s var(--ease-out); }
.ts-scene { border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; background: rgba(0,0,0,.2); }
.ts-scene svg { width: 100%; height: auto; display: block; }
.ts-status { margin-top: 12px; padding: 11px 14px; border-radius: var(--r-m); background: rgba(201,169,97,.1); border: 1px solid rgba(201,169,97,.3); font-size: 14px; color: #f3e9cf; }
.ts-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ts-chip { cursor: default; font-size: 12.5px; opacity: .8; }
.ts-hot { cursor: pointer; transition: filter .2s, opacity .2s; }
.ts-hot:hover { filter: brightness(1.25); }
.ts-hot.lit { filter: drop-shadow(0 0 8px rgba(168,240,205,.9)) brightness(1.3); animation: litPulse .8s var(--ease-out); }
.ts-hot.shake { animation: shake .4s var(--ease); }
@keyframes litPulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* scene animations (SVG groups) */
.a-sink { animation: aSink 2.6s var(--ease-out) forwards; }
@keyframes aSink { 0% { transform: translateY(-60px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
.a-rise { animation: aRise 3s ease-in-out forwards; }
@keyframes aRise { 0% { transform: translateY(0); } 80% { transform: translateY(-110px); opacity: 1; } 100% { transform: translateY(-130px); opacity: 0; } }
.a-loop-rise { animation: aRise 4s ease-in-out infinite; }
.a-pulse { animation: glowPulse 1.6s ease-in-out infinite; }
.a-grow { transform-origin: center; animation: aGrow 2s var(--ease-out) forwards; }
@keyframes aGrow { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.a-flow { stroke-dasharray: 6 6; animation: aFlow 1.2s linear infinite; }
@keyframes aFlow { to { stroke-dashoffset: -24; } }
.a-drift { animation: drift 3s ease-in-out infinite; }
.a-fade-in { animation: fadeIn 1.2s ease-out forwards; }
.a-blink { animation: glowPulse .9s ease-in-out 3; }
.a-shed { animation: aShed 3s ease-in forwards; }
@keyframes aShed { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(-70px) rotate(25deg); opacity: 0; } }
.a-delay-1 { animation-delay: .4s; } .a-delay-2 { animation-delay: .9s; } .a-delay-3 { animation-delay: 1.4s; } .a-delay-4 { animation-delay: 1.9s; }
.sq-scene.answered .a-after { animation-play-state: running; }
.a-after { animation-play-state: paused; }

/* -------------------------------------------------------- RESPONSIVE */
@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-art { min-height: 250px; padding: 32px 24px; }
  .auth-art h1 { font-size: 30px; }
}
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 2px;
    /* solid, never see-through: backdrop-filter is not reliable everywhere */
    background: #071411; backdrop-filter: blur(20px);
    box-shadow: 0 18px 40px rgba(0,0,0,.55);
    border-bottom: 1px solid var(--line); padding: 12px; margin: 0;
    /* clear the sticky bar's own height too — a short panel (few links) is not
       fully hidden by a percentage alone, which left the user row peeking above it */
    transform: translateY(calc(-100% - var(--nav-h) - 12px));
    transition: transform .34s var(--ease), opacity .2s var(--ease), visibility .34s;
    opacity: 0; visibility: hidden; z-index: 59;
    max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { width: 100%; padding: 13px 16px; border-radius: var(--r-m); }
  .nav-user { margin-left: 0; border-left: 0; padding-left: 0; }
  .nav-user .whoami { display: none; }
}
@media (max-width: 700px) {
  .wrap { padding-inline: 16px; }
  .stage { grid-template-columns: 40px 1fr; gap: 12px; }
  .stage-dot { width: 40px; height: 40px; border-radius: 13px; font-size: 14px; }
  .stage-head { padding: 14px 16px; }
  .lesson-row { padding: 11px 16px; grid-template-columns: 28px 1fr; gap: 11px; }
  .lesson-row .tags { grid-column: 1 / -1; padding-left: 39px; }
  .continue { grid-template-columns: 1fr; gap: 14px; text-align: left; }
  .continue .btn { width: 100%; }
  .product { grid-template-columns: 1fr; }
  .product img { max-width: 190px; }
  .card, .panel { padding: 20px; }
  .gamecard > header, .gamebody, .gamefoot { padding-inline: 18px; }
  .sim-body { padding: 20px 18px; }
  .dl .row { grid-template-columns: 1fr; }
  #certificate { padding: 26px; }
  #certificate::before { inset: 12px; } #certificate::after { inset: 17px; }
  .cert-bot { flex-direction: column; align-items: center; gap: 14px; }
  .tl-node { min-width: 94px; }
  .ring { width: 148px; height: 148px; }
  .ring-mid b { font-size: 34px; }
}
@media (max-width: 460px) {
  .btn { padding: 12px 20px; font-size: 13.5px; }
  .flips { grid-template-columns: 1fr 1fr; }
  .flip, .flip-in { min-height: 152px; height: auto; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ===================================================== MOBILE / PHONE ===
   Full phone support: no sideways scrolling, safe-area (notch) padding,
   a nav bar that never wraps, and data tables that stack into cards. */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg, table, pre { max-width: 100%; }

@media (max-width: 820px) {
  /* respect the iPhone notch / rounded corners on every edge */
  .nav-in { padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right)); gap: 10px; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left));
          padding-right: max(16px, env(safe-area-inset-right)); }
  .nav-links { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  main { padding-bottom: max(70px, env(safe-area-inset-bottom)); }

  /* the brand must shrink, never wrap the bar onto a second line */
  .brand { flex: 1 1 auto; overflow: hidden; }
  .brand-txt { min-width: 0; overflow: hidden; }
  .brand-txt b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-txt span { font-size: 8.5px; letter-spacing: .14em; white-space: nowrap;
                    overflow: hidden; text-overflow: ellipsis; display: block; }
  .nav-toggle { flex: 0 0 auto; margin-left: 0; }
  /* inside the open menu the user row sits full width and stays reachable */
  .nav-user { width: 100%; justify-content: flex-start; gap: 12px;
              margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
  .nav-user .btn { margin-left: auto; }
}

@media (max-width: 700px) {
  /* --- data tables become stacked cards (no more cut-off columns) --- */
  .admin-tbl { min-width: 0; width: 100%; display: block; }
  .admin-tbl thead { display: none; }
  .admin-tbl tbody, .admin-tbl tr, .admin-tbl td { display: block; width: 100%; }
  .admin-tbl tr {
    border: 1px solid var(--line-2); border-radius: var(--r-m);
    background: rgba(255,255,255,.03); margin: 12px; padding: 6px 4px;
    width: auto;
  }
  .admin-tbl td { border-bottom: 0; padding: 9px 14px; font-size: 13.5px; }
  .admin-tbl td + td { border-top: 1px solid var(--line); }
  /* show the column name beside each value */
  .admin-tbl td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 5px;
  }
  .admin-tbl td[colspan] { margin: 0; border: 0; }
  .admin-tbl td[colspan]::before { content: none; }
  /* generic tables keep scrolling, but advertise it */
  .tablewrap { -webkit-overflow-scrolling: touch; }

  /* stat tiles read better two-up than squashed four-up */
  .stat-strip { grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sec-head .btn { width: 100%; }
  /* forms and controls go full width so they are easy to tap */
  .field input, .field select, .field textarea { font-size: 16px; } /* stops iOS zoom-on-focus */
  .btn-row { flex-direction: column; align-items: stretch; }
}

@media (max-width: 700px) {
  /* --- sign-in / sign-up on a phone --- */
  .auth-screen { min-height: 100dvh; }
  .auth-art { padding: 28px max(18px, env(safe-area-inset-left)) 24px; min-height: 0; }
  .auth-art h1 { font-size: 25px; max-width: none; margin-block: 14px 12px; }
  .auth-art .eyebrow { margin-top: 24px !important; }
  .auth-art p { font-size: 14px; max-width: none !important; }
  .auth-facts { gap: 14px 20px; margin-top: 20px; }
  .auth-facts div b { font-size: 21px; }
  .auth-facts div span { font-size: 9.5px; letter-spacing: .12em; }
  .auth-form { padding: 30px max(18px, env(safe-area-inset-left))
                       max(34px, env(safe-area-inset-bottom)); }
  .reset-inner { padding: 16px 15px 14px; }

  /* the rebuilt Salicule games stay inside the screen */
  .s2-stage, .s2-slider, .s2-rub { max-width: 100%; }
  .s2-buckets { grid-template-columns: 1fr; }
  .s2-hud, .s2-found { gap: 8px; }
  .s2-opt { padding: 13px 13px; font-size: 13.5px; }
}

/* touch targets */
@media (pointer: coarse) {
  .opt, .chip, .lesson-row, .hunt-line, .tl-node { min-height: 44px; }
  .seq-item .mv button { width: 38px; height: 38px; }
}

/* --------------------------------------------------- REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .anim-draw path, .anim-draw line, .anim-draw polyline { stroke-dashoffset: 0; }
}

/* ------------------------------------------------------------- PRINT */
@media print {
  .nav, .foot, .btn, .gamefoot { display: none !important; }
  body { background: #fff; color: #000; }
  #certificate { box-shadow: none; }
}

/* ===================== admin in-place editing ===================== */
.edit-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid rgba(201,169,97,.55);
  background: #0c1f1a; color: #f0dda7; font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
  cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,.45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.edit-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.edit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: #071411; border-top: 1px solid rgba(201,169,97,.4);
  box-shadow: 0 -10px 30px rgba(0,0,0,.5);
}
.edit-bar .edit-note { font-size: 13px; color: var(--text-dim, #b8cfc6); }
.edit-bar .edit-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.edit-bar .danger { border-color: rgba(255,120,120,.6); color: #ff9d9d; }
body.editing { padding-bottom: 74px; }
body.editing .editable { outline: 1.5px dashed rgba(201,169,97,.4); outline-offset: 6px; border-radius: 4px; cursor: text; }
body.editing .editable:hover { outline-color: rgba(201,169,97,.8); }
body.editing .editable:focus, body.editing .editable:focus-within { outline: 2px solid #c9a961; outline-offset: 6px; }
body.editing .edit-locked { position: relative; opacity: .55; pointer-events: none; }
body.editing .reveal { opacity: 1 !important; transform: none !important; }
@media print { .edit-fab, .edit-bar { display: none !important; } }

/* ------------------------------------------------- LOCAL VIDEO PLAYER */
.vidfig { margin: 26px 0; }
.vidfig video {
  display: block; width: 100%; aspect-ratio: var(--vratio, 16 / 9);
  background: #000; border-radius: var(--r-l);
  border: 1px solid var(--line-2); box-shadow: 0 14px 38px rgba(0,0,0,.42);
}
/* portrait clips are phone-shaped: cap the width so they don't dominate */
.vidfig-portrait video { max-width: 420px; margin-inline: auto; }
/* the course-intro player is the first thing on the dashboard: give it presence */
#intro-video .vidfig { margin-top: 4px; }
#intro-video .vidfig-portrait video { max-width: 460px; box-shadow: 0 20px 52px rgba(0,0,0,.5); }
.vidfig figcaption {
  margin-top: 11px; font-size: 13px; color: var(--text-dim);
  text-align: center; line-height: 1.5;
}
@media (max-width: 700px) { .vidfig-portrait video { max-width: 100%; } }

/* ===================================================================
   SHOP — store links and product cards (shop.js)
   Theme-driven: inherits whichever course palette is active.
   =================================================================== */
.plink {
  color: var(--gold-hi); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  padding-bottom: 1px; transition: color .15s, border-color .15s, background .15s;
  border-radius: 3px;
}
.plink:hover, .plink:focus-visible {
  color: var(--gold); border-bottom-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.plink-i { font-size: .78em; margin-left: 3px; opacity: .8; vertical-align: super; }

/* ---- single card ---- */
.pcard {
  display: flex; gap: 14px; align-items: center;
  padding: 12px; margin: 16px 0; text-decoration: none; color: inherit;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); border-radius: 14px;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.pcard:hover, .pcard:focus-visible {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
.pcard-im {
  display: block; flex: 0 0 96px; width: 96px; height: 96px;
  border-radius: 10px; overflow: hidden;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.pcard-im img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pcard-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.pcard-v {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700;
}
.pcard-n { font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--text); }
.pcard-d { font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.pcard-f {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 5px;
}
.pcard-f b { font-size: 15px; color: var(--gold-hi); font-family: var(--serif, inherit); }
.pcard-go {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--spume, var(--ok));
}

/* ---- shelf of cards ---- */
.pshelf {
  margin: 22px 0; padding: 16px; border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--gold) 5%, transparent);
}
.pshelf-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.pshelf-t {
  font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-hi);
}
.pshelf-s { font-size: 11.5px; color: var(--text-faint); }
.pshelf-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.pshelf-g .pcard { margin: 0; }

@media (max-width: 640px) {
  .pshelf-g { grid-template-columns: 1fr; }
  .pcard { gap: 11px; }
  .pcard-im { flex-basis: 72px; width: 72px; height: 72px; }
  .pcard-n { font-size: 14px; }
}

/* ------------------------------------------------ embedded simulators
   Shared frame for the hosted 3D games (S5 Clinic Simulator, Dermathod
   Pen Studio). Each course theme sets --sim-accent. */
.simembed { margin: 22px 0; --sim-accent: var(--gold); }
.simembed-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 12px;
  background: color-mix(in srgb, var(--sim-accent) 14%, transparent);
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 14px 14px 0 0;
}
.simembed-tag {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sim-accent);
}
.simembed-full {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 13px;
}
.simembed-full:hover { background: color-mix(in srgb, var(--sim-accent) 24%, transparent); border-color: var(--sim-accent); }
.simembed-frame {
  position: relative; width: 100%; height: 760px;
  border: 1px solid var(--line-2); border-radius: 0 0 14px 14px; overflow: hidden;
  background: #0c1218;
}
.simembed-if { width: 100%; height: 100%; border: 0; display: block; background: #0c1218; }
.simembed figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.simembed figcaption a { color: var(--sim-accent); }
@media (max-width: 720px) { .simembed-frame { height: 620px; } }

/* =====================================================================
   ACADEMY DASHBOARD — GOLD & BURGUNDY
   The course selector is the academy's own screen rather than any one
   course's, so it carries the Seoulogy house colours: deep burgundy
   ground, gold as the action colour, warm cream type.
   ===================================================================== */
:root[data-theme="home"] {
  --wine-abyss: #180409;
  --wine-deep:  #260810;
  --wine:       #3d0f1d;
  --wine-2:     #55162a;
  --wine-3:     #6e1f39;
  --wine-lift:  #8c2a49;
  --wine-glow:  #c56b83;

  --veil: 24, 4, 9;
  --bg:        var(--wine-abyss);
  --surface:   #260810;
  --surface-2: #340d18;
  --surface-3: #451422;
  --line:      rgba(240, 221, 167, .15);
  --line-2:    rgba(240, 221, 167, .30);
  --text:      #f8efe6;
  --text-dim:  #d8b9b2;
  --text-faint:#a9857f;

  /* the marine accents remap to gold and wine on this screen */
  --abyss:   var(--wine-abyss);
  --deep:    var(--wine-deep);
  --forest:  var(--wine);
  --forest-2:var(--wine-2);
  --moss:    var(--gold-lo);
  --sea:     var(--gold);
  --spume:   var(--gold-hi);
  --glow:    var(--gold-hi);

  --ring-a: #f6e6b8;
  --ring-b: #cf5b7c;
}

/* gold is the action colour here, not sea green */
:root[data-theme="home"] .btn-primary {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: #2a2007; border-color: rgba(240,221,167,.42);
  box-shadow: 0 8px 26px rgba(201,169,97,.30);
}
:root[data-theme="home"] .btn-primary:hover { box-shadow: 0 14px 40px rgba(201,169,97,.44); }
:root[data-theme="home"] .btn-ghost:hover { border-color: var(--gold-hi); }

:root[data-theme="home"] .nav { background: rgba(24,4,9,.80); }
:root[data-theme="home"] .pill.sea {
  color: var(--wine-glow); border-color: rgba(197,107,131,.45); background: rgba(140,42,73,.20);
}
:root[data-theme="home"] .ring .track { stroke: rgba(240,221,167,.10); }

/* the course cards sit as warm burgundy plates with a gold hairline */
:root[data-theme="home"] .course-card {
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border-color: var(--line);
}
:root[data-theme="home"] .course-card:hover { border-color: rgba(240,221,167,.42); }
:root[data-theme="home"] .course-card .cc-art::after {
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(38,8,16,.72) 62%, var(--surface));
}

/* the ambient wash behind every screen turns wine on the dashboard */
:root[data-theme="home"] body::before {
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(140,42,73,.26), transparent 60%),
    radial-gradient(900px 600px at 92% 6%, rgba(85,22,42,.52), transparent 62%),
    radial-gradient(1000px 800px at 50% 108%, rgba(38,8,16,.92), transparent 60%),
    linear-gradient(175deg, #180409 0%, #24070e 45%, #180409 100%);
}
/* warm the hero photograph into the house palette instead of fighting it */
:root[data-theme="home"] .dash-hero::before {
  opacity: .34;
  filter: saturate(.3) sepia(.5) hue-rotate(-24deg) contrast(1.04);
}
:root[data-theme="home"] .dash-hero { border-bottom-color: rgba(240,221,167,.22); }

/* ===================================================== INLINE GLOSSARY
   A marked term reads as body text with a dotted underline, never as a
   link. The popup is themed from tokens so it works on the dark course
   themes and on Part I's light one. */
.gloss {
  font: inherit; color: inherit; background: none; padding: 0; margin: 0;
  border: 0; border-bottom: 1px dotted var(--gold);
  cursor: help; text-align: inherit; line-height: inherit;
  -webkit-appearance: none; appearance: none;
}
.gloss:hover, .gloss:focus-visible {
  border-bottom-style: solid; border-bottom-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  border-radius: 3px; outline: none;
}
.gloss:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent); }

.gloss-pop {
  position: absolute; z-index: 90; max-width: min(340px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-m);
  font-size: 13px; line-height: 1.5; color: var(--text);
  animation: glossIn .13s ease-out;
}
.gloss-pop b {
  display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.gloss-pop p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.55; }
.gloss-pop::after {
  content: ""; position: absolute; left: 50%; margin-left: -7px; bottom: -7px;
  width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--surface-2); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.gloss-pop.below::after { bottom: auto; top: -7px; border: 0;
  border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); }
@keyframes glossIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gloss-pop { animation: none; } }
