/* NeoFellow OSCE — colourful clinical theme
   Navy base, a warm "sun" accent, and one colour per exam domain. */
:root {
  --navy: #14213D;
  --navy-2: #1F3157;
  --paper: #F4F6FB;
  --surface: #FFFFFF;
  --ink: #14213D;
  --ink-2: #3E4C66;
  --muted: #6A768C;
  --line: #DFE4EE;
  --line-soft: #EBEFF6;
  --primary: #3949C6;
  --primary-2: #2C3AA6;
  --primary-wash: #ECEEFC;
  --sun: #FFB547;
  --mint: #3DDC97;
  --green: #1E9A63;
  --green-wash: #E1F5EB;
  --amber: #B7770A;
  --amber-wash: #FDF1DA;
  --amber-line: #F0D49B;
  --red: #C42B43;
  --red-wash: #FCE6EA;
  --c: #0E7C86;
  --t: #DFF2F3;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --lift: 0 1px 2px rgba(20, 33, 61, .05), 0 8px 24px rgba(20, 33, 61, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .9em; }
code { font-size: .86em; background: var(--line-soft); padding: .1em .4em; border-radius: 5px; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8F9BFF; outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.mark { width: 36px; height: 36px; flex: none; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { color: var(--ink-2); text-decoration: none; padding: 8px 14px; border-radius: 99px; font-size: .94rem; font-weight: 600; }
.mainnav a:hover { background: var(--paper); color: var(--ink); }
.mainnav a.is-on { color: #fff; background: var(--navy); }

.flash { max-width: 1180px; margin: 18px auto 0; padding: 12px 18px; border-radius: var(--r-sm); width: calc(100% - 48px); font-size: .95rem; font-weight: 500; }
.flash-ok { background: var(--green-wash); color: #155F3F; border: 1px solid #B6E2CB; }
.flash-warn { background: var(--amber-wash); color: #7A4E05; border: 1px solid var(--amber-line); }

.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }
.page.narrow { max-width: 700px; }
.section-title { font-size: 1.15rem; margin: 0 0 14px; }

.sitefoot { background: var(--navy); color: #AEB9D0; font-size: .86rem; padding: 22px 24px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.sitefoot a { color: var(--mint); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .94rem/1.2 var(--sans); padding: 11px 20px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { border-color: #B4BFD3; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--navy); }
.btn-sun:hover { background: #FFC56E; border-color: #FFC56E; color: var(--navy); }
.btn-light { background: rgba(255, 255, 255, .92); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-small { padding: 7px 13px; font-size: .84rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.danger { color: var(--red) !important; }

.stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
input:not([type=checkbox]):not([type=file]), select, textarea {
  font: 400 1rem/1.45 var(--sans); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(57, 73, 198, .14); }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.check-box { align-self: end; padding-bottom: 12px; }
.form-error { background: var(--red-wash); color: #8A1E31; border-radius: 10px; padding: 11px 14px; font-size: .92rem; font-weight: 500; }
.form-notice { background: var(--amber-wash); color: #7A4E05; border-radius: 10px; padding: 11px 14px; font-size: .92rem; font-weight: 500; }
.form-narrow { max-width: 440px; }
.form-wide { max-width: 780px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; }

/* ---------- sign-in ---------- */
body.auth { background: var(--paper); }
.auth-split { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 100vh; }
.auth-art {
  background: var(--navy); color: #fff; padding: 48px 56px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.auth-art::before {
  content: ''; position: absolute; width: 520px; height: 520px; right: -180px; top: -200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(75, 91, 214, .55), rgba(75, 91, 214, 0) 70%);
}
.auth-art::after {
  content: ''; position: absolute; width: 420px; height: 420px; left: -160px; bottom: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 220, 151, .28), rgba(61, 220, 151, 0) 70%);
}
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.08rem; }
.auth-art .mark rect { fill: #fff; }
.auth-art h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; margin: 40px 0 12px; max-width: 14em; }
.auth-tag { font-size: 1.12rem; color: #C3CCE0; max-width: 32em; }
.auth-figure { margin: 18px 0 22px; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.auth-figure img { width: 100%; max-width: 560px; max-height: 420px; }
.auth-figure.is-photo img { object-fit: cover; border-radius: var(--r-lg); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); aspect-ratio: 4 / 3; }
.domain-pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.domain-pills li {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 8px; border-radius: 99px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); font-size: .84rem; font-weight: 600; color: #E7ECF6;
}
.pill-icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--c); color: #fff; stroke-width: 3; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; gap: 34px; }
.auth-card { background: var(--surface); border-radius: var(--r-lg); padding: 36px; box-shadow: var(--lift); border: 1px solid var(--line-soft); max-width: 460px; width: 100%; }
.auth-card h1, .auth-card h2 { font-size: 1.65rem; font-weight: 800; margin-bottom: 4px; }
.auth-card form { margin: 22px 0 18px; }
.auth-solo { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; background: var(--navy); }
.auth-solo .auth-brand { margin-bottom: 22px; color: var(--ink); }
.circuit { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; counter-reset: c; }
.circuit li { counter-increment: c; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: start; }
.circuit li::before {
  content: counter(c); grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: var(--c); color: #fff; font-weight: 800; font-size: .9rem;
}
.circuit b { font-size: .95rem; }
.circuit span { font-size: .84rem; color: var(--muted); line-height: 1.4; }

/* ---------- library: welcome banner ---------- */
.welcome { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.welcome::before {
  content: ''; position: absolute; width: 600px; height: 600px; left: 34%; top: -330px; border-radius: 50%;
  background: radial-gradient(circle, rgba(75, 91, 214, .5), rgba(75, 91, 214, 0) 70%);
}
.welcome-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 44px 24px 48px; display: grid; grid-template-columns: 1.3fr auto 1fr; gap: 40px; align-items: center; }
.welcome-text h1 { color: #fff; margin-bottom: 10px; }
.welcome-text p { color: #C3CCE0; font-size: 1.05rem; max-width: 34em; margin-bottom: 22px; }
.welcome-text .btn { white-space: normal; text-align: left; }
.welcome-done { color: var(--mint) !important; font-weight: 600; }
.welcome-art { width: 100%; max-width: 360px; justify-self: end; }
.ring { position: relative; width: 150px; text-align: center; }
.ring svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--mint); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s ease-out; }
.ring-label { position: absolute; top: 0; left: 0; width: 150px; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 2rem; font-weight: 800; line-height: 1; }
.ring-label small { font-size: 1rem; color: #AEB9D0; font-weight: 600; }
.ring-label span { font-size: .78rem; color: #AEB9D0; margin-top: 4px; }
.ring-note { margin: 10px 0 0; font-size: .84rem; color: var(--sun); font-weight: 600; }

.notice { display: flex; gap: 14px; align-items: flex-start; background: var(--amber-wash); border: 1px solid var(--amber-line); padding: 14px 18px; border-radius: var(--r); margin-bottom: 30px; }
.notice svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }

/* ---------- library: domain tiles ---------- */
.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 34px; }
.domain-tile {
  font-family: var(--sans); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  background: var(--t); border: 2px solid transparent; border-radius: var(--r); padding: 16px; color: var(--ink);
  transition: border-color .15s, transform .15s, opacity .15s;
}
.domain-tile:hover:not(:disabled) { border-color: var(--c); }
.domain-tile.is-on { border-color: var(--c); background: #fff; box-shadow: 0 0 0 4px var(--t); }
.domain-tile.is-dim { opacity: .5; }
.domain-tile:disabled { cursor: default; opacity: .62; }
.dt-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--c); color: #fff; display: grid; place-items: center; margin-bottom: 4px; }
.dt-icon .dicon { width: 30px; height: 30px; }
.dt-icon .dicon [fill-opacity] { fill-opacity: .28; }
.dt-name { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.dt-count { font-size: .8rem; color: var(--ink-2); }
.dt-bar { height: 5px; border-radius: 99px; background: rgba(20, 33, 61, .08); overflow: hidden; margin-top: 4px; }
.dt-bar span { display: block; height: 100%; background: var(--c); border-radius: 99px; }

/* ---------- library: filters ---------- */
.filters { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; max-width: 440px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.search input { padding-left: 42px !important; border-radius: 99px !important; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: 600 .87rem var(--sans); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 8px 15px; cursor: pointer; }
.chip:hover { border-color: #B4BFD3; }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-clear { border-color: var(--primary); color: var(--primary); }

/* ---------- library: station cards ---------- */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.scard a {
  display: flex; flex-direction: column; height: 100%; background: var(--surface); border-radius: var(--r); overflow: hidden;
  text-decoration: none; color: var(--ink); border: 1px solid var(--line); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.scard a:hover { transform: translateY(-3px); box-shadow: var(--lift); border-color: transparent; color: var(--ink); }
.scard a:hover h3 { color: var(--c); }
.scard-top { position: relative; height: 140px; background: var(--c); overflow: hidden; }
.scard-top::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 45%),
              radial-gradient(circle at 10% 110%, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0) 50%);
}
.scard-art { position: absolute; right: 18px; bottom: -14px; width: 130px; height: 130px; color: #fff; opacity: .9; stroke-width: 1.8; }
.scard-top.has-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scard-top.has-cover::before { background: linear-gradient(180deg, rgba(20, 33, 61, .5), rgba(20, 33, 61, 0) 55%); z-index: 1; }
.scard-domain {
  position: absolute; left: 14px; top: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .94); color: var(--c); font-size: .76rem; font-weight: 700; padding: 5px 11px 5px 7px; border-radius: 99px; max-width: calc(100% - 130px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini { width: 16px; height: 16px; flex: none; stroke-width: 3; }
.scard-top .state { position: absolute; right: 12px; top: 12px; z-index: 2; }
.scard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.scard-body h3 { font-size: 1.08rem; line-height: 1.3; margin-bottom: 6px; transition: color .15s; }
.scard-body p { color: var(--muted); font-size: .9rem; line-height: 1.5; margin-bottom: 14px; }
.scard-meta { margin-top: auto; display: flex; gap: 16px; font-size: .84rem; color: var(--ink-2); font-weight: 600; }
.scard-meta span { display: inline-flex; align-items: center; gap: 6px; }
.scard-meta svg { width: 17px; height: 17px; fill: none; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.state { font-size: .76rem; font-weight: 700; padding: 5px 11px; border-radius: 99px; white-space: nowrap; }
.state-new { background: rgba(255, 255, 255, .94); color: var(--ink-2); }
.state-done { background: var(--green-wash); color: var(--green); }
.state-review { background: var(--amber-wash); color: var(--amber); }
.state-draft { background: var(--line-soft); color: var(--muted); }
.tag { font-style: normal; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 5px; vertical-align: 2px; }
.tag-draft { background: var(--amber-wash); color: var(--amber); }
.empty, .empty-filter { text-align: center; padding: 48px 20px; background: var(--surface); border: 2px dashed var(--line); border-radius: var(--r); color: var(--ink-2); }
.empty img { display: block; margin: 0 auto 10px; }

/* ---------- station: coloured header ---------- */
.st-hero { background: var(--c); color: #fff; position: relative; overflow: hidden; }
.st-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 45%),
              radial-gradient(circle at 0% 120%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 55%);
}
.st-hero-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 30px 24px 34px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.st-hero .crumbs, .st-hero .crumbs a { color: rgba(255, 255, 255, .85); }
.st-hero h1 { color: #fff; font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 3.8vw, 2.7rem); line-height: 1.12; max-width: 22em; margin-bottom: 14px; }
.st-facts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.st-hero .st-facts > span:not(.state) { background: rgba(255, 255, 255, .17); padding: 5px 12px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.st-admin { margin: 14px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.st-hero-art { width: 150px; height: 150px; border-radius: 34px; background: rgba(255, 255, 255, .15); display: grid; place-items: center; overflow: hidden; }
.st-hero-icon { width: 104px; height: 104px; color: #fff; stroke-width: 2; }
.st-hero-art.has-cover { width: 240px; height: 160px; border-radius: var(--r); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.st-hero-art.has-cover img { width: 100%; height: 100%; object-fit: cover; }
.crumbs { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

/* ---------- station: exam clock ---------- */
.clock { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(20, 33, 61, .18); }
.clock-inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: grid; grid-template-columns: 170px auto 1fr auto; gap: 20px; align-items: center; }
.clock-phase { font-size: .85rem; color: #AEB9D0; font-weight: 600; }
.clock-time { font: 800 2rem/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .02em; min-width: 5ch; }
.clock-bar { height: 8px; background: rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; }
.clock-bar span { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 99px; transition: width .4s linear; }
.clock[data-phase=reading] .clock-bar span { background: #8F9BFF; }
.clock.is-low .clock-bar span { background: var(--sun); }
.clock.is-low .clock-time { color: var(--sun); }
.clock.is-last .clock-bar span { background: #FF6B6B; }
.clock.is-last .clock-time { color: #FF9C9C; }
.clock[data-phase=over] { background: #7C1D2E; }
.clock[data-phase=over] .clock-phase { color: #FFD3D9; }
.clock-btns { display: flex; gap: 8px; }
.btn-clock { background: var(--sun); color: var(--navy); border-color: var(--sun); }
.btn-clock:hover { background: #FFC56E; border-color: #FFC56E; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { color: #fff; border-color: #fff; }

/* ---------- station body ---------- */
.station { max-width: 860px; background-repeat: repeat; }
.mode { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px; margin: 0 0 26px; flex-wrap: wrap; }
.mode button { font: 700 .87rem var(--sans); border: 0; background: transparent; color: var(--ink-2); padding: 8px 16px; border-radius: 99px; cursor: pointer; }
.mode button.is-on { background: var(--c); color: #fff; }

.task { background: var(--surface); border-radius: var(--r); padding: 18px 22px; margin-bottom: 22px; border: 1px solid var(--line); border-top: 5px solid var(--navy); }
.task h2 { font-size: 1rem; margin-bottom: 8px; }
.task p:last-child { margin-bottom: 0; }

.stages { display: flex; flex-direction: column; gap: 18px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 26px; scroll-margin-top: 90px; }
.stage.just-in { animation: arrive .8s ease-out; }
@keyframes arrive { from { box-shadow: 0 0 0 5px var(--t); transform: translateY(6px); } to { box-shadow: 0 0 0 0 transparent; transform: none; } }
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stage-head h3 { margin: 0; }
.stage-case { border-left: 5px solid var(--c); }
.stage-case .stage-head h3 { font-size: .9rem; color: var(--c); font-weight: 700; }
.stage-update { background: var(--amber-wash); border-color: var(--amber-line); border-left: 5px solid var(--sun); }
.stage-update .stage-head h3 { color: var(--amber); font-size: .92rem; font-weight: 800; }
.stage-update .stage-head::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 5px rgba(255, 181, 71, .3); flex: none; }
.qnum { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--c); color: #fff; font-weight: 800; flex: none; }
.stage-question { box-shadow: var(--lift); border-color: transparent; }
.vignette { font-family: var(--serif); font-size: 1.13rem; line-height: 1.72; color: #1A2440; }
.prompt { font-size: 1.08rem; font-weight: 600; }
.stage-body > :last-child { margin-bottom: 0; }
.stage-body ul, .stage-body ol, .answer ul, .answer ol, .debrief ul, .task ul, .notice ul { padding-left: 1.3em; margin: 0 0 .9em; }
.stage-body li, .answer li, .debrief li { margin-bottom: .3em; }
.stage-body h4, .answer h4 { font-size: 1rem; margin: 1em 0 .4em; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
.stage-body table, .answer table { border-collapse: separate; border-spacing: 0; font-family: var(--sans); font-size: .94rem; min-width: 60%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stage-body th, .stage-body td, .answer th, .answer td { border-bottom: 1px solid var(--line-soft); padding: 8px 14px; text-align: left; font-variant-numeric: tabular-nums; }
.stage-body tr:last-child td, .answer tr:last-child td { border-bottom: 0; }
.stage-body th, .answer th { background: var(--t); color: var(--ink); font-weight: 700; }
.stage-update .stage-body th { background: #FBE3B5; }
.stage-img { margin: 16px 0 0; }
.stage-img img { display: block; border-radius: 10px; background: #000; max-height: 520px; margin: 0 auto; }
.stage-img figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; text-align: center; }

.answer-zone { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.notes { font-size: .95rem !important; background: #FAFBFE !important; border-style: dashed !important; }
.btn-reveal { border-color: var(--c); color: var(--c); }
.btn-reveal:hover { color: var(--c); background: var(--t); border-color: var(--c); }
.btn-reveal[aria-expanded=true] { background: var(--c); color: #fff; }
.answer { width: 100%; background: var(--t); padding: 18px 20px; border-radius: 12px; }
.answer-label { color: var(--c); font-size: .88rem; margin: 0 0 8px !important; font-weight: 800; }
.answer > :last-child { margin-bottom: 0; }

.advance { display: flex; align-items: center; gap: 16px; margin: 28px 0; flex-wrap: wrap; }
.advance .btn-primary { background: var(--c); border-color: var(--c); }
.advance .btn-primary:hover { filter: brightness(.92); }
.advance-hint { color: var(--muted); font-size: .9rem; }

.finish { margin-top: 28px; background: var(--surface); border-radius: var(--r); padding: 26px; box-shadow: var(--lift); text-align: left; }
.finish h2 { display: flex; align-items: center; gap: 10px; }
.finish h2::before { content: ''; width: 28px; height: 28px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.debrief { background: var(--t); padding: 16px 20px; border-radius: 12px; margin-bottom: 20px; }
.debrief h3 { font-size: 1rem; color: var(--c); }
.debrief ul:last-child { margin-bottom: 0; }
.rate { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-rate.is-on[data-rating=confident] { background: var(--green); border-color: var(--green); color: #fff; }
.btn-rate.is-on[data-rating=review] { background: var(--sun); border-color: var(--sun); color: var(--navy); }
.rate-saved { margin: 12px 0 0; font-size: .9rem; color: var(--ink-2); }

.downloads { margin-top: 30px; }
.downloads h2 { font-size: 1.05rem; }
.downloads ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.downloads a { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.downloads a:hover { border-color: var(--c); color: var(--ink); }
.ext { font-size: .7rem; font-weight: 800; padding: 6px 8px; border-radius: 8px; background: var(--line-soft); color: var(--ink-2); min-width: 46px; text-align: center; }
.ext-pdf { background: #E5484D; color: #fff; }
.ext-pptx, .ext-ppt { background: #E8772E; color: #fff; }
.ext-docx, .ext-doc { background: #2F6FDB; color: #fff; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.pager a { text-decoration: none; color: var(--ink); font-weight: 700; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pager a:hover { border-color: var(--c); }
.pager small { color: var(--muted); font-weight: 500; }
.pager-next { text-align: right; grid-column: 2; }

/* discourage printing station content for candidates */
@media print { body.protect main, body.protect .clock, body.protect .st-hero { display: none !important; } body.protect::after { content: 'Printing is turned off for course stations.'; } }

/* ---------- account ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 36px; }
.facts div { background: var(--surface); padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); }
.facts div:nth-child(1) { border-top: 4px solid #E4572E; }
.facts div:nth-child(2) { border-top: 4px solid #4B5BD6; }
.facts div:nth-child(3) { border-top: 4px solid #C98A0B; }
.facts div:nth-child(4) { border-top: 4px solid #1E9A63; }
.facts dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.facts dd { margin: 3px 0 0; font-weight: 700; word-break: break-word; }

/* ---------- admin ---------- */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-head h1 { margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 700; }
.tabs a span { font-size: .78rem; color: var(--muted); font-weight: 600; margin-left: 4px; background: var(--line-soft); padding: 2px 7px; border-radius: 99px; }
.tabs a.is-on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs a.is-on span { background: var(--primary-wash); color: var(--primary); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 320px; border-radius: 99px; }
.inline-upload, .inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline-form label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.inline-form input[type=date] { width: auto; padding: 6px 9px; font-size: .88rem; }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: .93rem; }
.admin-table th { text-align: left; font-weight: 700; font-size: .8rem; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #F8F9FD; }
.admin-table th:first-child { border-top-left-radius: var(--r); }
.admin-table th:last-child { border-top-right-radius: var(--r); }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td a { color: var(--ink); text-decoration: none; }
.admin-table td a:hover { color: var(--primary); }
.dpill { display: inline-flex; align-items: center; gap: 6px; background: var(--t); color: var(--c); font-weight: 700; font-size: .8rem; padding: 4px 10px 4px 7px; border-radius: 99px; }
.col-num { width: 80px; text-align: center !important; }
.col-actions { white-space: nowrap; text-align: right !important; }
.col-actions > * { display: inline-block; vertical-align: middle; margin: 0 0 0 4px; }
.col-actions form { margin: 0; }
.order-input { width: 64px !important; text-align: center; padding: 6px !important; }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--lift); min-width: 180px; z-index: 5; padding: 5px; text-align: left; }
.more-menu a, .more-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; font: 500 .9rem var(--sans); background: none; border: 0; color: var(--ink); cursor: pointer; border-radius: 8px; text-decoration: none; }
.more-menu a:hover, .more-menu button:hover { background: var(--paper); }
.more-menu form { margin: 0; }
.mini-bar { height: 6px; width: 110px; margin-bottom: 4px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }

.panel, .panel-plain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-bottom: 20px; }
.panel summary { cursor: pointer; list-style: none; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary h2 { display: inline; font-size: 1.1rem; }
.panel summary::after { content: ' +'; color: var(--primary); font-weight: 800; }
.panel[open] summary::after { content: ' −'; }
.panel[open] summary { margin-bottom: 16px; }
.panel-plain h2 { font-size: 1.1rem; margin-bottom: 14px; }
.w-date { max-width: 240px; }
.w-cover { max-width: 460px; margin-bottom: 14px; }
.creds { background: var(--green-wash); border: 1px solid #B6E2CB; border-radius: var(--r); padding: 22px 24px; margin-bottom: 20px; }
.creds textarea { font-size: .92rem; margin-bottom: 12px; }
.hero-setting { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.hero-setting img { width: 200px; height: 140px; object-fit: contain; background: var(--navy); border-radius: 10px; }

/* station editor */
.editor { max-width: 920px; }
.stage-editor { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.se { border: 1px solid var(--line); border-left: 5px solid #8D9AB5; border-radius: 12px; padding: 14px; background: #FBFCFE; display: flex; flex-direction: column; gap: 10px; }
.se[data-type=question] { border-left-color: var(--primary); }
.se[data-type=update] { border-left-color: var(--sun); background: #FFFBF2; }
.se-head { display: grid; grid-template-columns: 210px 1fr auto; gap: 10px; align-items: center; }
.se-tools { display: flex; gap: 4px; }
.icon-btn { width: 36px; height: 36px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; font-size: .95rem; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink-2); }
.se-l { font-weight: 600; }
.se-img { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 10px; border: 1px solid var(--line); }
.files-table { margin-bottom: 14px; }
.upload input { padding: 12px; border: 2px dashed var(--line); border-radius: 12px; background: var(--paper); }
.save-bar { position: sticky; bottom: 0; background: var(--paper); padding: 14px 0; display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); z-index: 4; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .welcome-inner { grid-template-columns: 1fr auto; }
  .welcome-art { display: none; }
}
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px 28px; }
  .auth-art h1 { margin-top: 26px; }
  .auth-figure { min-height: 0; margin: 8px 0 18px; }
  .auth-figure img { max-height: 190px; }
  .auth-art h1 { font-size: 1.8rem; }
  .domain-pills { display: none; }
  .auth-panel { padding: 28px 16px 40px; align-items: center; }
  .clock-inner { grid-template-columns: auto 1fr; gap: 10px 16px; }
  .clock-phase { grid-column: 1 / -1; order: -1; }
  .clock-bar { grid-column: 1 / -1; order: 5; }
  .clock-btns { justify-self: end; }
  .clock-time { font-size: 1.6rem; }
  .st-hero-inner { grid-template-columns: 1fr; }
  .st-hero-art { display: none; }
  .grid-2, .grid-3, .se-img, .hero-setting { grid-template-columns: 1fr; }
  .se-head { grid-template-columns: 1fr auto; }
  .se-title { grid-column: 1 / -1; order: 3; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .admin-table td { border: 0; padding: 6px 14px; text-align: left !important; }
  .col-num { width: auto; }
  .col-actions > :first-child { margin-left: 0; }
  .more-menu { right: auto; left: 0; }
}
@media (max-width: 560px) {
  .topbar-inner { height: auto; padding: 10px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .mainnav a { padding: 6px 12px; }
  .page { padding: 26px 16px 48px; }
  .welcome-inner { grid-template-columns: 1fr; padding: 30px 16px 34px; gap: 22px; }
  .ring { display: flex; align-items: center; gap: 14px; width: auto; text-align: left; }
  .ring svg, .ring-label { width: 96px; height: 96px; }
  .ring-label b { font-size: 1.5rem; }
  .ring-label span { display: none; }
  .ring-note { margin: 0; }
  .domain-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .domain-tile { padding: 13px; }
  .dt-icon { width: 40px; height: 40px; }
  .card-grid { grid-template-columns: 1fr; }
  .stage { padding: 18px 16px; }
  .vignette { font-size: 1.05rem; }
  .auth-card { padding: 26px 20px; }
  .circuit { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .st-hero-inner, .clock-inner { padding-left: 16px; padding-right: 16px; }
  .flash { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
