/* =============================================================
   The Desk — oil trading masterclass  (v2, desktop-first)
   Same visual language as nikolaossynodinos.com:
   monochrome ground, glistening gold, Fraunces + Inter.
   ============================================================= */

:root {
  --bg:        #08090a;
  --bg-2:      #0e0f11;
  --bg-3:      #131417;
  --line:      #2a2a2e;
  --line-soft: rgba(240,237,232,0.08);

  --ink:       #f0ede8;
  --ink-soft:  rgba(240,237,232,0.66);
  --ink-faint: rgba(240,237,232,0.45);
  --ink-ghost: rgba(240,237,232,0.25);

  --gold:      #c9a84c;
  --gold-hi:   #f4e6ab;
  --gold-lo:   #93761f;
  --gold-dim:  rgba(201,168,76,0.14);
  --gold-grad: linear-gradient(110deg,
                 var(--gold-lo) 0%, var(--gold) 26%,
                 var(--gold-hi) 50%, var(--gold) 74%, var(--gold-lo) 100%);

  --green: #3fbf8f;
  --red:   #e0604f;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Inter", system-ui, -apple-system, sans-serif;

  --side-w: 252px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 30px -18px rgba(0,0,0,0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(201,168,76,0.28); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; padding: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #232427; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3b3f; }

/* slow gold aurora */
body::before {
  content: "";
  position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(34% 40% at 22% 26%, rgba(201,168,76,0.09), transparent 60%),
    radial-gradient(44% 48% at 74% 82%, rgba(201,168,76,0.07), transparent 62%);
  background-repeat: no-repeat;
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to   { transform: translate3d(1.5%, 2%, 0) scale(1.06); }
}

#app { position: relative; z-index: 1; min-height: 100dvh; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.2; }

.gold {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.glisten {
  background: var(--gold-grad); background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: glisten 3.6s linear infinite;
}
@keyframes glisten { to { background-position: 240% 0; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  transition: all 0.35s var(--ease);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--gold); color: #0a0a0a; box-shadow: 0 0 24px rgba(201,168,76,0.35); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn--ghost { border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); background: transparent; box-shadow: none; }
.btn--small { padding: 0.42rem 1rem; font-size: 0.8rem; }

/* =============================================================
   LOGIN
   ============================================================= */
.login {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.4rem; text-align: center;
  padding: 2rem 1.2rem;
}
.login__icon { width: 60px; height: 60px; filter: drop-shadow(0 0 18px rgba(201,168,76,0.35)); }
.login__title { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0; }
.login__sub { color: var(--ink-faint); font-size: 0.88rem; margin: 0; max-width: 36ch; }
.login__form { display: flex; flex-direction: column; gap: 0.9rem; width: min(340px, 88vw); margin-top: 0.6rem; }
.login__form input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 0.9rem 1rem;
  font: inherit; text-align: center;
  letter-spacing: 0.14em;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.login__form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.12); }
.login__err { color: var(--red); font-size: 0.85rem; min-height: 1.3em; margin: 0; }

/* =============================================================
   SHELL — sidebar + content (desktop)
   ============================================================= */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0b0c0e 0%, #090a0c 100%);
  border-right: 1px solid var(--line-soft);
  padding: 1.6rem 1.2rem 1.2rem;
  z-index: 10;
}
.side__brand { display: flex; align-items: center; gap: 0.65rem; font-family: var(--display); font-size: 1.25rem; margin-bottom: 2rem; }
.side__brand img { width: 26px; height: 26px; }

.side__nav { display: flex; flex-direction: column; gap: 0.25rem; }
.side__link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.8rem; border-radius: 10px;
  color: var(--ink-faint); font-size: 0.92rem;
  transition: all 0.25s var(--ease);
  text-align: left; width: 100%;
}
.side__link:hover { color: var(--ink); background: rgba(255,255,255,0.03); }
.side__link.is-active { color: var(--gold); background: var(--gold-dim); }
.side__link svg { width: 17px; height: 17px; flex: none; }

.side__stats {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 1.2rem;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.side__ring { display: flex; align-items: center; gap: 0.85rem; }
.ring { position: relative; width: 54px; height: 54px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring__bg { fill: none; stroke: var(--line); stroke-width: 4; }
.ring__fg { fill: none; stroke: url(#ringGrad); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease); }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.15rem; }
.side__ring-meta { min-width: 0; }
.side__ring-meta strong { display: block; font-size: 0.85rem; font-weight: 600; }
.side__ring-meta span { font-size: 0.72rem; color: var(--ink-faint); }

.side__row { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); }
.side__row strong { color: var(--gold); font-weight: 600; }

.badge-sync {
  font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.14rem 0.6rem;
  color: var(--ink-faint);
}
.badge-sync.is-synced { border-color: rgba(63,191,143,0.4); color: var(--green); }

.side__foot { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; margin-top: 0.9rem; }
.side__user { font-size: 0.74rem; color: var(--ink-ghost); letter-spacing: 0.08em; }
.side__logout { font-size: 0.74rem; color: var(--ink-faint); border-bottom: 1px solid transparent; transition: all 0.25s; }
.side__logout:hover { color: var(--gold); border-bottom-color: var(--gold); }

.content { min-width: 0; padding: 2.6rem clamp(1.4rem, 4vw, 3.4rem) 6rem; }
.content__inner { max-width: 1060px; margin: 0 auto; }

/* mobile fallback: hide sidebar, show compact topbar */
.topbar-mobile { display: none; }
@media (max-width: 979px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar-mobile {
    display: flex; align-items: center; gap: 0.7rem;
    position: sticky; top: 0; z-index: 10;
    background: rgba(8,9,10,0.85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
    padding: 0.65rem 1rem; font-size: 0.8rem;
  }
  .topbar-mobile img { width: 20px; height: 20px; }
  .topbar-mobile .spacer { flex: 1; }
  .content { padding-top: 1.6rem; }
  .lesson-grid { grid-template-columns: 1fr !important; }
  .rail { position: static !important; order: -1; }
}

/* =============================================================
   DASHBOARD
   ============================================================= */
.dash__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.dash__hello { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0 0 0.3rem; }
.dash__phase { color: var(--ink-faint); font-size: 0.88rem; margin: 0; }

.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin-bottom: 1.6rem; }
@media (max-width: 979px) { .statgrid { grid-template-columns: repeat(2, 1fr); } }
.card {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { border-color: rgba(201,168,76,0.25); transform: translateY(-2px); }
.card__label { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.4rem; }
.card__value { font-family: var(--display); font-size: 1.9rem; margin: 0; line-height: 1.1; }
.card__hint { font-size: 0.74rem; color: var(--ink-faint); margin: 0.35rem 0 0; }
.xpbar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 0.7rem; overflow: hidden; }
.xpbar__fill { height: 100%; background: var(--gold-grad); border-radius: 2px; transition: width 0.8s var(--ease); }

/* continue hero */
.continue {
  display: flex; align-items: center; gap: 1.6rem;
  width: 100%; text-align: left;
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, rgba(201,168,76,0.13), rgba(201,168,76,0.03) 55%);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 20px;
  color: var(--ink);
  padding: 1.6rem 1.8rem;
  margin-bottom: 2.6rem;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.continue::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(244,230,171,0.06) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: sheen 4.5s linear infinite;
  pointer-events: none;
}
@keyframes sheen { to { background-position: -250% 0; } }
.continue:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 18px 44px -24px rgba(201,168,76,0.45); }
.continue__eyebrow { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.35rem; }
.continue__title { font-family: var(--display); font-size: 1.55rem; margin: 0; }
.continue__meta { font-size: 0.8rem; color: var(--ink-faint); margin: 0.35rem 0 0; }
.continue__go {
  margin-left: auto; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  color: var(--gold); font-size: 1.3rem;
  transition: all 0.3s var(--ease);
}
.continue:hover .continue__go { background: var(--gold); color: #0a0a0a; }

/* modules */
.module {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 1.3rem 1.4rem 0.9rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-card);
}
.module__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.module__title { font-size: 1.25rem; margin: 0; }
.module__sub { font-size: 0.76rem; color: var(--ink-faint); margin: 0.15rem 0 0; }
.module__ring { margin-left: auto; }

.lesson-row {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; text-align: left;
  border: 1px solid transparent;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  padding: 0.8rem 0.6rem;
  transition: all 0.25s var(--ease);
  border-radius: 10px;
}
.lesson-row:not(.is-locked):hover { background: rgba(201,168,76,0.05); border-color: rgba(201,168,76,0.25); padding-left: 0.9rem; }
.lesson-row.is-locked { opacity: 0.4; cursor: default; }
.lesson-row__dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--ink-faint); flex: none;
  transition: all 0.3s;
}
.lesson-row.is-complete .lesson-row__dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px rgba(201,168,76,0.5); }
.lesson-row.is-active .lesson-row__dot { border-color: var(--gold); box-shadow: 0 0 8px rgba(201,168,76,0.6); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 2px rgba(201,168,76,0.2); } }
.lesson-row__body { flex: 1; min-width: 0; }
.lesson-row__title { font-size: 0.98rem; margin: 0; font-weight: 500; }
.lesson-row__teaser { font-size: 0.78rem; color: var(--ink-faint); margin: 0.12rem 0 0; }
.lesson-row__right { display: flex; align-items: center; gap: 0.9rem; font-size: 0.74rem; color: var(--ink-faint); white-space: nowrap; }
.lesson-row__score { color: var(--gold); font-weight: 600; }
.lesson-row__notes { font-size: 0.72rem; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 0.18rem 0.7rem; transition: all 0.25s; }
.lesson-row__notes:hover { border-color: var(--gold); color: var(--gold); }

.dash__foot { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* =============================================================
   BUILD BANNER / OVERLAY — “the desk is being built”
   ============================================================= */
.buildbar {
  position: relative; overflow: hidden;
  border: 1px solid rgba(201,168,76,0.5);
  background: linear-gradient(120deg, rgba(201,168,76,0.12), rgba(201,168,76,0.02));
  border-radius: 20px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 2rem;
  display: flex; align-items: center; gap: 1.6rem;
}
.buildbar--failed { border-color: rgba(224,96,79,0.55); background: linear-gradient(120deg, rgba(224,96,79,0.1), transparent); }

.candleload { display: flex; align-items: flex-end; gap: 5px; height: 46px; flex: none; }
.candleload span {
  width: 7px; border-radius: 2px;
  background: var(--gold-grad);
  animation: candle 1.6s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(201,168,76,0.35);
}
.candleload span:nth-child(1) { height: 40%; animation-delay: 0s; }
.candleload span:nth-child(2) { height: 75%; animation-delay: 0.18s; }
.candleload span:nth-child(3) { height: 55%; animation-delay: 0.36s; }
.candleload span:nth-child(4) { height: 90%; animation-delay: 0.54s; }
.candleload span:nth-child(5) { height: 62%; animation-delay: 0.72s; }
@keyframes candle { 0%, 100% { transform: scaleY(0.55); opacity: 0.55; } 50% { transform: scaleY(1); opacity: 1; } }

.buildbar__body { flex: 1; min-width: 0; }
.buildbar__title { font-family: var(--display); font-size: 1.3rem; margin: 0 0 0.25rem; }
.buildbar__sub { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
.buildbar__phases { display: flex; gap: 1.1rem; margin-top: 0.8rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-ghost); flex-wrap: wrap; }
.buildbar__phase { display: flex; align-items: center; gap: 0.4rem; }
.buildbar__phase::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.buildbar__phase.is-done { color: var(--ink-soft); }
.buildbar__phase.is-done::before { background: var(--gold); }
.buildbar__phase.is-now { color: var(--gold); }
.buildbar__phase.is-now::before { background: var(--gold); animation: pulse 1.4s infinite; }
.buildbar__eta { flex: none; text-align: right; font-size: 0.78rem; color: var(--ink-faint); }
.buildbar__eta strong { display: block; font-family: var(--display); font-size: 1.4rem; color: var(--ink); font-weight: 400; }

/* =============================================================
   LESSON VIEW — reading column + right rail
   ============================================================= */
.lesson-grid { display: grid; grid-template-columns: minmax(0, 720px) 264px; gap: clamp(1.6rem, 3.5vw, 3.2rem); align-items: start; }

.lesson__eyebrow { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.4rem; }
.lesson__title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin: 0 0 1.6rem; }

.stage { animation: rise 0.5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.stage h2 { font-size: 1.5rem; margin: 0 0 1rem; }
.stage p { color: var(--ink-soft); font-size: 1.02rem; }
.stage strong { color: var(--ink); }
.stage table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.92rem; }
.stage th, .stage td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line-soft); text-align: left; }
.stage th { color: var(--ink-faint); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.stage th.gold { color: var(--gold); -webkit-text-fill-color: currentColor; background: none; }

.callout {
  border-left: 2px solid var(--gold);
  background: rgba(201,168,76,0.06);
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.term {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* highlights */
mark.hl {
  background: linear-gradient(180deg, transparent 42%, rgba(201,168,76,0.38) 42%, rgba(201,168,76,0.38) 92%, transparent 92%);
  color: inherit; padding: 0 1px; border-radius: 2px; cursor: pointer;
  transition: background 0.25s;
}
mark.hl:hover { background: rgba(224,96,79,0.3); }

.hl-pop {
  position: absolute; z-index: 40;
  background: var(--bg-3); border: 1px solid var(--gold);
  border-radius: 999px; padding: 0.35rem 0.95rem;
  font-size: 0.8rem; color: var(--gold);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.8);
  transform: translate(-50%, -130%);
  white-space: nowrap;
  animation: rise 0.2s var(--ease);
}
.hl-pop:hover { background: var(--gold); color: #0a0a0a; }

/* rail */
.rail { position: sticky; top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.rail__card {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow-card);
}
.rail__label { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.7rem; }
.rail__toc { display: flex; flex-direction: column; gap: 0.15rem; }
.rail__step {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.83rem; color: var(--ink-faint);
  padding: 0.32rem 0.4rem; border-radius: 8px;
  text-align: left; width: 100%;
}
.rail__step::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-ghost); flex: none; transition: all 0.3s; }
.rail__step.is-done { color: var(--ink-soft); }
.rail__step.is-done::before { background: var(--gold); border-color: var(--gold); }
.rail__step.is-now { color: var(--gold); background: var(--gold-dim); }
.rail__step.is-now::before { border-color: var(--gold); }
.rail__step.is-clickable { cursor: pointer; }
.rail__step.is-clickable:hover { color: var(--ink); }

.rail__marks { display: flex; flex-direction: column; gap: 0.5rem; max-height: 220px; overflow-y: auto; }
.rail__mark {
  font-size: 0.78rem; color: var(--ink-soft);
  border-left: 2px solid var(--gold);
  padding: 0.15rem 0 0.15rem 0.6rem;
  font-style: italic;
}
.rail__empty { font-size: 0.76rem; color: var(--ink-ghost); font-style: italic; }
.rail__actions { display: flex; flex-direction: column; gap: 0.5rem; }
.rail__actions .btn { justify-content: center; }

.stage__actions { margin-top: 1.8rem; display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }

/* prediction + quiz options */
.opt {
  display: flex; align-items: flex-start; gap: 0.8rem;
  width: 100%; text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  padding: 0.9rem 1.05rem;
  margin-bottom: 0.55rem;
  transition: all 0.25s var(--ease);
}
.opt:hover:not(:disabled) { border-color: var(--gold); transform: translateX(3px); }
.opt.is-picked { border-color: var(--gold); background: rgba(201,168,76,0.09); color: var(--ink); }
.opt.is-correct { border-color: var(--green); background: rgba(63,191,143,0.08); color: var(--ink); }
.opt.is-wrong { border-color: var(--red); background: rgba(224,96,79,0.08); }
.opt__key {
  flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 1px solid currentColor; display: grid; place-items: center;
  font-size: 0.72rem; margin-top: 0.1rem;
}
.explain { font-size: 0.86rem; color: var(--ink-faint); margin: -0.05rem 0 1.2rem; padding-left: 0.2rem; }
.explain.is-shown { animation: rise 0.4s var(--ease); }

.scorecard {
  text-align: center; padding: 2rem;
  background: var(--bg-2); border: 1px solid rgba(201,168,76,0.4); border-radius: 20px;
  margin: 1.6rem 0;
  position: relative; overflow: hidden;
}
.scorecard::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 90% at 50% 0%, rgba(201,168,76,0.12), transparent 70%);
  pointer-events: none;
}
.scorecard__big { font-family: var(--display); font-size: 3.2rem; margin: 0; }
.scorecard__xp { color: var(--gold); font-size: 0.95rem; margin: 0.3rem 0 0; }

/* =============================================================
   ARCHIVE
   ============================================================= */
.arch__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.arch__card {
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 16px;
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: all 0.3s var(--ease);
}
.arch__card:hover { border-color: rgba(201,168,76,0.35); transform: translateY(-2px); }
.arch__eyebrow { font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin: 0; }
.arch__title { font-family: var(--display); font-size: 1.2rem; margin: 0; }
.arch__meta { font-size: 0.76rem; color: var(--ink-faint); margin: 0; }
.arch__row { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.6rem; }

/* =============================================================
   NOTES DOCUMENT
   ============================================================= */
.notes { max-width: 820px; }
.notes__bar { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; }
.notes__doc {
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 20px;
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--shadow-card);
}
.notes__doc + .notes__doc { margin-top: 1.6rem; }
.notes__eyebrow { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.4rem; }
.notes__title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 0.4rem; }
.notes__meta { font-size: 0.8rem; color: var(--ink-faint); margin: 0 0 1.8rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.notes__meta strong { color: var(--gold); }
.notes h3 { font-size: 1.25rem; margin: 2rem 0 0.8rem; border-bottom: 1px solid var(--line-soft); padding-bottom: 0.45rem; }
.notes ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.notes li { color: var(--ink-soft); font-size: 0.96rem; margin-bottom: 0.45rem; }
.notes__sectitle { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 1.1rem 0 0.3rem; }
.notes__hl {
  border-left: 2px solid var(--gold);
  background: rgba(201,168,76,0.07);
  border-radius: 0 10px 10px 0;
  padding: 0.7rem 1rem; margin: 0.55rem 0;
  font-style: italic; color: var(--ink); font-size: 0.95rem;
}
.notes__q { border: 1px solid var(--line-soft); border-radius: 14px; padding: 1rem 1.15rem; margin-bottom: 0.8rem; page-break-inside: avoid; }
.notes__q.is-right { border-left: 3px solid var(--green); }
.notes__q.is-wrong { border-left: 3px solid var(--red); }
.notes__q p { margin: 0.25rem 0; font-size: 0.92rem; }
.notes__q .q { color: var(--ink); font-weight: 500; font-size: 0.98rem; }
.notes__q .you { color: var(--ink-soft); }
.notes__q .you.bad { color: var(--red); }
.notes__q .ans { color: var(--green); }
.notes__q .why { color: var(--ink-faint); font-size: 0.86rem; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%) translateY(20px);
  background: var(--bg-3); border: 1px solid var(--gold); border-radius: 999px;
  color: var(--ink); font-size: 0.86rem;
  padding: 0.6rem 1.3rem; opacity: 0; pointer-events: none;
  transition: all 0.4s var(--ease); z-index: 60; white-space: nowrap;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* countdown overlay for auto-refresh */
.refresh-veil {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,9,10,0.92); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  animation: rise 0.4s var(--ease);
  text-align: center; padding: 2rem;
}
.refresh-veil h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.refresh-veil p { color: var(--ink-soft); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .stage, .explain.is-shown, .refresh-veil { animation: none; }
  .continue::after, .candleload span, body::before { animation: none; }
}

/* =============================================================
   PRINT — the notes page becomes the PDF
   ============================================================= */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .side, .topbar-mobile, .notes__bar, .toast, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .notes { max-width: none; }
  .notes__doc { background: #fff; border: none; box-shadow: none; padding: 0 0 2rem; }
  .notes__doc + .notes__doc { border-top: 1px solid #ddd; padding-top: 2rem; page-break-before: always; }
  .notes__title, .notes h3 { color: #111; }
  .notes h3 { border-bottom-color: #ddd; }
  .notes__eyebrow, .notes__meta strong { color: #8a6d1f; }
  .notes__meta, .notes li, .notes__q .why { color: #444; }
  .notes li { color: #222; }
  .notes__hl { background: #faf3dd; border-left-color: #c9a84c; color: #222; }
  .notes__q { border-color: #ddd; }
  .notes__q .q { color: #111; }
  .notes__q .you { color: #333; }
  .notes__q .you.bad { color: #b3382a; }
  .notes__q .ans { color: #217a5b; }
  .gold, .glisten {
    background: none; -webkit-text-fill-color: #8a6d1f; color: #8a6d1f;
  }
}
