/* ===== PHYSL 210 app — pages, nav, quiz, flashcards ===== */

html, body { margin: 0; height: 100%; background: var(--bg); }

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* main is the scroll container so the nav stays put and `.fit` pages can size
   themselves to the remaining viewport height */
.app > main { flex: 1; min-height: 0; overflow-y: auto; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40; flex: none;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 30px;
  background: color-mix(in oklch, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 9px; flex: none; cursor: pointer; }
.nav-brand .wm { font-family: 'Quicksand'; font-size: 20px; font-weight: 700; letter-spacing: -.5px; white-space: nowrap; }
.nav-tabs { display: flex; gap: 3px; margin: 0 auto; background: var(--bg); padding: 5px; border-radius: 999px; border: 1.5px solid var(--line); }
.nav-tab {
  border: none; cursor: pointer; padding: 9px 16px; border-radius: 999px;
  font-family: 'Quicksand'; font-size: 14px; font-weight: 600;
  background: transparent; color: var(--ink-soft); white-space: nowrap;
  transition: all .16s ease;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active { background: var(--coral); color: #fff; box-shadow: 0 6px 14px oklch(0.72 0.124 36 / .3); }
.nav-right { display: flex; align-items: center; gap: 12px; flex: none; }
.nav-dark { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-soft); flex: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease; }
.nav-dark:hover { border-color: oklch(0.86 0.05 42); color: var(--ink); }
.nav-dark:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

/* ---------- page scaffold ---------- */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 38px 30px 80px; }
.page-head { margin-bottom: 28px; }
.page-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .5px; color: var(--coral-deep); text-transform: uppercase; }
.page-title { font-family: 'Quicksand'; font-size: 40px; font-weight: 700; letter-spacing: -1.2px; margin: 6px 0 0; line-height: 1; }
.page-sub { font-size: 16px; color: var(--muted); margin-top: 10px; max-width: 620px; line-height: 1.5; }

/* ---------- viewport-fit pages (Lessons / Practice / Flashcards grids) ----------
   These pages size to the viewport so all 12 module cards are visible without
   scrolling. The header is fixed-height; the grid flexes to fill what's left and
   lays the cards out in 4 columns × 3 rows. overflow-y stays available as a
   graceful fallback on unusually short screens. */
.page.fit {
  height: 100%;
  display: flex; flex-direction: column;
  overflow-y: auto;
  padding-top: 30px; padding-bottom: 26px;
}
.page.fit .page-head { flex: none; margin-bottom: 18px; }
.page.fit > .mod-grid {
  flex: 1; min-height: 0;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(170px, 1fr);
  gap: 16px;
}
/* slightly compact cards so all 12 (incl. 2-line titles + source buttons) fit */
.page.fit .mod-card { padding: 16px 18px 14px; }
.page.fit .mod-emblem { width: 38px; height: 38px; font-size: 15px; border-radius: 11px; }
.page.fit .mod-name { font-size: 16px; margin: 10px 0 2px; line-height: 1.13; }
.page.fit .mod-meta { font-size: 12.5px; }
.page.fit .mini-bar { margin-top: 10px; height: 6px; }

.crumb {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface); border: 1.5px solid var(--line);
  padding: 8px 15px 8px 12px; border-radius: 999px; margin-bottom: 22px;
  transition: all .15s ease;
}
.crumb:hover { border-color: oklch(0.86 0.05 42); color: var(--ink); transform: translateX(-2px); }

/* ---------- grids ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mod-grid.two { grid-template-columns: repeat(2, 1fr); }
.mod-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 22px 20px; cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.mod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: oklch(0.87 0.04 42); }
.mod-emblem { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-family: 'Quicksand'; font-weight: 700; font-size: 18px; }
.mod-name { font-family: 'Quicksand'; font-size: 19px; font-weight: 600; margin: 16px 0 3px; line-height: 1.15; }
.mod-meta { font-size: 13px; color: var(--muted); }
.mini-bar { height: 7px; border-radius: 99px; overflow: hidden; margin-top: 16px; }
.mini-bar > i { display: block; height: 100%; border-radius: 99px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .3px; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}

/* ---------- list rows ---------- */
.row {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; transition: all .15s ease;
}
.row:hover { border-color: oklch(0.87 0.04 42); box-shadow: var(--shadow-sm); }
.row-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: 'Quicksand'; font-weight: 700; font-size: 14px; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font-family: 'Quicksand'; font-weight: 600; border-radius: 999px; border: 1.5px solid transparent; transition: all .15s ease; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-md { padding: 10px 20px; font-size: 14.5px; }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px oklch(0.72 0.124 36 / .28); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: oklch(0.85 0.05 42); }

/* ---------- quiz ---------- */
.quiz-wrap { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.quiz-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.quiz-progress > i { display: block; height: 100%; background: var(--coral); border-radius: 99px; transition: width .3s ease; }
.qcard { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: 36px 38px; box-shadow: var(--shadow-md); }
.qstem { font-family: 'Quicksand'; font-size: 23px; font-weight: 600; line-height: 1.35; margin: 4px 0 26px; text-wrap: pretty; }
.opt {
  display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  padding: 16px 18px; margin-bottom: 12px; border-radius: var(--r-md);
  background: var(--bg); border: 1.5px solid var(--line); cursor: pointer;
  font-size: 16px; color: var(--ink); transition: all .14s ease; font-family: inherit;
}
.opt:hover:not(:disabled) { border-color: var(--coral); background: var(--coral-tint); }
.opt:disabled { cursor: default; }
.opt-key { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-family: 'Quicksand'; font-weight: 700; font-size: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-soft); transition: all .14s ease; }
.opt.sel { border-color: var(--coral); background: var(--coral-tint); }
.opt.sel .opt-key { background: var(--coral); color: #fff; border-color: var(--coral); }
.opt.correct { border-color: var(--p-mint-i); background: oklch(0.95 0.04 165); }
.opt.correct .opt-key { background: var(--p-mint-i); color: #fff; border-color: var(--p-mint-i); }
.opt.wrong { border-color: oklch(0.62 0.16 25); background: oklch(0.95 0.04 28); }
.opt.wrong .opt-key { background: oklch(0.62 0.16 25); color: #fff; border-color: oklch(0.62 0.16 25); }
.explain { margin-top: 6px; padding: 18px 20px; border-radius: var(--r-md); background: var(--coral-tint); border: 1.5px solid var(--coral-tint-2); font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.explain b { color: var(--ink); }

/* ---------- flashcard ---------- */
.fc-stage { perspective: 1600px; max-width: 620px; margin: 0 auto; }
.fc { position: relative; width: 100%; height: 380px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,.2,.2,1); cursor: pointer; }
.fc.flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-xl);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 44px; text-align: center; }
.fc-front { background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-md); }
.fc-back { background: linear-gradient(150deg, var(--coral-tint) 0%, var(--coral-tint-2) 100%); transform: rotateY(180deg); border: 1.5px solid var(--coral-tint-2); }
.fc-term { font-family: 'Quicksand'; font-size: 32px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; text-wrap: balance; }
.fc-def { font-size: 18px; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }
.fc-hint { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }

/* ---------- flashcard mastery levels + recall rating ----------
   Per-level accent in --lc (explicit oklch, like the .opt correct/wrong states),
   surfaced through color-mix alpha tints so both light and dark surfaces stay
   legible without per-mode overrides. */
.lvl-0 { --lc: oklch(0.62 0.02 60);  }   /* New — neutral */
.lvl-1 { --lc: oklch(0.64 0.16 25);  }   /* Learning — red */
.lvl-2 { --lc: oklch(0.72 0.13 65);  }   /* Familiar — amber */
.lvl-3 { --lc: oklch(0.62 0.11 235); }   /* Proficient — blue */
.lvl-4 { --lc: oklch(0.60 0.12 160); }   /* Mastered — green */

.lvl-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--lc);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--lc) 16%, transparent); }
.lvl-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px;
  font-family: 'Quicksand'; font-weight: 700; font-size: 12.5px; color: var(--lc);
  background: color-mix(in oklch, var(--lc) 14%, var(--surface));
  border: 1.5px solid color-mix(in oklch, var(--lc) 32%, transparent); }

.fc-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 24px; min-height: 30px; }
.fc-status-lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.cram-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px; border-radius: 999px;
  font-family: 'Quicksand'; font-weight: 700; font-size: 13px; color: oklch(0.62 0.11 235);
  background: color-mix(in oklch, oklch(0.62 0.11 235) 13%, var(--surface));
  border: 1.5px solid color-mix(in oklch, oklch(0.62 0.11 235) 32%, transparent); }

/* the four recall-rating buttons */
.fc-rate { display: flex; gap: 10px; max-width: 620px; margin: 14px auto 0; }
.fc-rate-btn { flex: 1; padding: 13px 8px; border-radius: var(--r-md); cursor: pointer;
  font-family: 'Quicksand'; font-weight: 700; font-size: 15px; color: var(--rc);
  background: color-mix(in oklch, var(--rc) 12%, var(--surface));
  border: 1.5px solid color-mix(in oklch, var(--rc) 30%, transparent);
  transition: transform .14s ease, background .14s ease, color .14s ease, border-color .14s ease; }
.fc-rate-btn:hover { transform: translateY(-2px); color: #fff; background: var(--rc); border-color: var(--rc); }
.fc-rate-btn.again { --rc: oklch(0.64 0.16 25);  }
.fc-rate-btn.hard  { --rc: oklch(0.72 0.13 65);  }
.fc-rate-btn.good  { --rc: oklch(0.60 0.12 160); }
.fc-rate-btn.easy  { --rc: oklch(0.62 0.11 235); }

.fc-foot { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 620px;
  margin: 18px auto 0; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.fc-session { font-variant-numeric: tabular-nums; }
.fc-session b { font-family: 'Quicksand'; }
.fc-shuffle { cursor: pointer; font-weight: 700; }

/* ---------- deck detail (card list + stats + study options) ---------- */
.dd-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.dd-title { font-family: 'Quicksand'; font-size: 30px; font-weight: 700; letter-spacing: -.8px; margin: 4px 0 2px; line-height: 1.05; }
.dd-sub { font-size: 13.5px; color: var(--muted); font-weight: 600; }

.dd-top { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: stretch; margin-bottom: 28px; }
.dd-stats { display: flex; align-items: center; gap: 24px; }
.dd-ring { display: flex; align-items: center; gap: 15px; flex: none; }
.dd-ring-num { font-family: 'Quicksand'; font-weight: 700; font-size: 30px; letter-spacing: -1px; line-height: 1; }
.dd-ring-num span { font-size: 16px; color: var(--muted); }
.dd-ring-lbl { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.dd-levels { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.dd-lvl-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.dd-lvl-name { flex: 1; }
.dd-lvl-ct { font-family: 'Quicksand'; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.dd-actions { display: flex; flex-direction: column; gap: 12px; }
.dd-cta { text-align: left; cursor: pointer; border-radius: var(--r-lg); padding: 17px 20px; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); background: var(--surface);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.dd-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dd-cta:disabled { opacity: .5; cursor: not-allowed; }
.dd-cta-title { font-family: 'Quicksand'; font-weight: 700; font-size: 18px; }
.dd-cta-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.dd-cta-learn { background: linear-gradient(150deg, var(--coral-tint) 0%, var(--coral-tint-2) 100%); border-color: var(--coral-tint-2); }
.dd-cta-learn .dd-cta-title { color: var(--coral-deep); }
.dd-cta-cram:hover:not(:disabled) { border-color: oklch(0.86 0.05 42); }

.dd-list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-family: 'Quicksand'; font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.dd-list-head span { font-size: 12.5px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.dd-list { display: flex; flex-direction: column; gap: 8px; }
.dd-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer;
  overflow: hidden; transition: border-color .14s ease, box-shadow .14s ease; }
.dd-card:hover, .dd-card.open { border-color: oklch(0.87 0.04 42); box-shadow: var(--shadow-sm); }
.dd-card-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.dd-card-term { flex: 1; font-family: 'Quicksand'; font-weight: 600; font-size: 15.5px; min-width: 0; line-height: 1.25; }
.dd-card-cite { font-size: 13px; opacity: .7; flex: none; }
.dd-card-chev { font-family: 'Quicksand'; font-weight: 700; font-size: 20px; color: var(--muted); flex: none; width: 16px; text-align: center; line-height: 1; }
.dd-card-def { padding: 0 18px 16px 41px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.dd-card-meta { margin-top: 9px; font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }

@media (max-width: 760px) {
  .dd-top { grid-template-columns: 1fr; }
  .dd-stats { flex-wrap: wrap; }
  .fc-rate { flex-wrap: wrap; }
  .fc-rate-btn { min-width: calc(50% - 5px); }
}

/* ---------- misc ---------- */
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: 28px 30px; }
.obj-li { display: flex; gap: 12px; padding: 11px 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.obj-li:last-child { border-bottom: none; }
.dot-check { width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px; display: grid; place-items: center; background: var(--coral-tint); }
.media-ph {
  border-radius: var(--r-lg); aspect-ratio: 16/9; display: grid; place-items: center; gap: 8px;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(135deg, oklch(0.93 0.012 64) 0 14px, oklch(0.96 0.008 66) 14px 28px);
  border: 1.5px solid var(--line); color: var(--muted); font-family: ui-monospace, monospace; font-size: 13px;
}
.stat-num { font-family: 'Quicksand'; font-weight: 700; letter-spacing: -1px; }
.seg { display: inline-flex; background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: none; background: transparent; cursor: pointer; padding: 8px 16px; border-radius: 999px; font-family: 'Quicksand'; font-weight: 600; font-size: 14px; color: var(--ink-soft); transition: all .14s ease; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeUp .4s cubic-bezier(.2,.7,.3,1) both; }

/* ---------- notebook (personal notes) ---------- */
.notes-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.folder-list { display: flex; flex-direction: column; gap: 4px; }
.folder-item { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 13px; cursor: pointer;
  font-family: 'Quicksand'; font-weight: 600; font-size: 15px; color: var(--ink-soft); transition: all .14s ease; border: 1.5px solid transparent; }
.folder-item:hover { background: var(--surface); }
.folder-item.on { background: var(--coral-tint); color: var(--coral-deep); border-color: var(--coral-tint-2); }
.folder-item .ct { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 700; }
.folder-item.on .ct { color: var(--coral-deep); }
.new-folder { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 13px; cursor: pointer;
  font-family: 'Quicksand'; font-weight: 600; font-size: 14.5px; color: var(--muted); border: 1.5px dashed var(--line); background: transparent; width: 100%; transition: all .14s ease; }
.new-folder:hover { border-color: var(--coral); color: var(--coral-deep); }

.dropzone { border: 2px dashed oklch(0.86 0.045 50); border-radius: var(--r-lg); background: var(--surface); transition: all .18s ease; }
.dropzone.drag { border-color: var(--coral); background: var(--coral-tint); transform: scale(1.005); }

.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 16px; }
.note-card { border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--surface); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; position: relative; }
.note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: oklch(0.87 0.04 42); }
.note-thumb { height: 142px; background-size: cover; background-position: center top; background-color: var(--bg);
  display: grid; place-items: center; }
.note-foot { padding: 12px 14px; }
.note-del { position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer;
  background: oklch(0.3 0.02 50 / .55); color: #fff; font-size: 15px; display: grid; place-items: center; opacity: 0; transition: opacity .14s ease; }
.note-card:hover .note-del { opacity: 1; }
.io-input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 13px 16px; font-family: inherit;
  font-size: 16px; color: var(--ink); background: var(--bg); outline: none; transition: border-color .14s ease; }
.io-input:focus { border-color: var(--coral); }
textarea.io-input { resize: vertical; line-height: 1.6; }

/* ---------- schedule / timeline ---------- */
.sched-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 38px; }
.tl { position: relative; }
.tl-row { display: grid; grid-template-columns: 96px 26px 1fr; gap: 16px; align-items: stretch; }
.tl-date { text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 17px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-row:first-child .tl-rail::before { top: 17px; }
.tl-row:last-child .tl-rail::before { bottom: calc(100% - 26px); }
.tl-dot { position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%; margin-top: 16px; border: 4px solid var(--bg); box-sizing: content-box; }
.tl-card { padding-bottom: 12px; }
.tl-study { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1.5px solid var(--line);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tl-study:hover { border-color: oklch(0.72 0.124 36 / .5); box-shadow: var(--shadow-sm); transform: translateX(3px); }
.tl-exam { padding: 16px 20px; border: 1.5px solid var(--coral); border-radius: var(--r-md);
  background: var(--coral-tint); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tl-exam:hover { box-shadow: var(--shadow-md); transform: translateX(3px); }
.tl-minor { padding: 8px 16px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.tl-done { opacity: .5; }
.tl-focus .tl-study { border-color: var(--coral); background: var(--coral-tint); box-shadow: var(--shadow-md); }

/* ---------- PDF drawer ---------- */
.pdf-drawer { box-sizing: border-box; }

/* Lecture sidebar button (slides panel) */
.pdf-lec-btn {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 3px;
  font-family: 'Quicksand'; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  background: transparent; color: var(--ink-soft);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.pdf-lec-btn:hover { background: var(--surface); color: var(--ink); }

/* Notes: two-column layout (TOC sidebar + content) */
.notes-col-layout { display: flex; flex: 1; min-height: 0; min-width: 0; overflow: hidden; }

.notes-toc-col {
  width: 236px; flex-shrink: 0; overflow-y: auto;
  border-right: 1.5px solid var(--line);
  padding: 20px 10px 20px 14px;
}
.notes-toc-btn {
  display: block; width: 100%; text-align: left;
  background: none; border: 1.5px solid transparent; border-radius: 10px;
  padding: 7px 11px; margin-bottom: 2px;
  font-family: 'Quicksand'; font-size: 12px; font-weight: 600;
  cursor: pointer; line-height: 1.4; color: var(--ink-soft);
  transition: background .13s, color .13s, border-color .13s;
}
.notes-toc-btn:hover { background: var(--surface); color: var(--ink); }

.notes-content-col { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px 36px 60px; min-width: 0; overflow-wrap: break-word; word-wrap: break-word; }

/* Section card */
.notes-sec {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: 18px;
  padding: 20px 26px 18px;
  border-top: 1.5px solid var(--line);
  border-right: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
}
.notes-sec h3 {
  font-family: 'Quicksand'; font-size: 15.5px; font-weight: 700;
  margin: 0 0 13px; padding-bottom: 9px; border-bottom: 1px solid var(--line-soft);
}
.notes-sec h4 {
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin: 14px 0 5px; font-family: 'Nunito Sans', sans-serif;
}
.notes-sec p  { font-size: 14px; color: var(--ink-soft); margin: 0 0 7px; line-height: 1.75; }
.notes-sec ul { margin: 3px 0 10px; padding: 0; list-style: none; }
.notes-sec li {
  font-size: 14px; color: var(--ink-soft); line-height: 1.75;
  margin-bottom: 3px; padding-left: 18px; position: relative;
}
.notes-sec li::before {
  content: ''; position: absolute; left: 4px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--bullet-color, var(--coral));
}

@media (max-width: 1100px) {
  .notes-toc-col { width: 180px; padding: 16px 8px 16px 10px; }
  .notes-toc-btn { font-size: 11px; padding: 6px 9px; }
  .notes-content-col { padding: 20px 24px 40px; }
}

@media (max-width: 920px) {
  .mod-grid, .mod-grid.two { grid-template-columns: repeat(2, 1fr); }
  .page.fit > .mod-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-tabs { display: none; }
  .notes-layout { grid-template-columns: 1fr; }
  .sched-grid { grid-template-columns: 1fr; }
}

/* textbook-question / flashcard source citation */
.qcite {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 11px; margin: -18px 0 22px; letter-spacing: .01em;
}

/* ---------- reusable modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; padding: 20px;
  display: grid; place-items: center;
  background: oklch(0.3 0.02 50 / .5); backdrop-filter: blur(6px);
  animation: modalFade .2s ease both;
}
.modal-card {
  width: 100%; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift); padding: 28px 30px;
  animation: modalPop .24s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.btn-danger { background: oklch(0.62 0.16 25); color: #fff; box-shadow: 0 8px 20px oklch(0.62 0.16 25 / .28); }
.btn-danger:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- "Explain like I'm new" — inline trigger + immersive reading sheet ---------- */
/* trigger: just the word "More", bold + underlined, in the question's accent color */
.more-link { display: inline; margin-left: 5px; padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: inherit; font-weight: 800; color: currentColor;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px;
  transition: text-decoration-thickness .12s ease, opacity .12s ease; }
.more-link:hover { text-decoration-thickness: 3px; }
.more-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 3px; }

/* the sheet — large, immersive reader. .more-card overrides .modal-card padding/size */
.more-card { padding: 0; overflow: hidden; display: flex; flex-direction: column;
  width: min(1040px, 94vw); height: min(90vh, calc(100dvh - 48px)); }
.more-sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.more-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; border-bottom: 1.5px solid var(--line);
  background: color-mix(in oklch, var(--coral-tint) 55%, var(--surface)); }
.more-bar-label { font-family: 'Quicksand'; font-weight: 700; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
.more-x { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; transition: color .14s ease, border-color .14s ease, transform .14s ease; }
.more-x:hover { color: var(--coral-deep); border-color: var(--coral); transform: rotate(90deg); }
.more-x:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.more-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.more-inner { max-width: 760px; margin: 0 auto; padding: 32px 30px 64px; }
.more-q-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.more-q-stem { font-family: 'Quicksand'; font-weight: 700; font-size: 21px; line-height: 1.36; color: var(--ink);
  margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1.5px solid var(--line-soft); text-wrap: pretty; }

.more-section { margin-bottom: 24px; }
.more-h { font-family: 'Quicksand'; font-weight: 700; font-size: 17.5px; line-height: 1.3; margin: 0 0 9px; color: var(--coral-deep); }
.more-h::before { content: ''; display: inline-block; width: 16px; height: 3px; border-radius: 2px;
  background: var(--coral); vertical-align: middle; margin-right: 10px; transform: translateY(-2px); opacity: .8; }
.more-body { font-size: 16px; line-height: 1.72; color: var(--ink-soft); }
.more-p { margin: 0 0 11px; text-wrap: pretty; }
.more-p:last-child { margin-bottom: 0; }
.more-body b, .more-p b { color: var(--ink); font-weight: 700; }
.more-ul { margin: 7px 0 13px; padding-left: 2px; list-style: none; }
.more-ul li { position: relative; padding-left: 21px; margin-bottom: 7px; line-height: 1.65; }
.more-ul li::before { content: ''; position: absolute; left: 5px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }

.more-sources { margin-top: 30px; padding: 20px 22px; border-radius: var(--r-md);
  background: color-mix(in oklch, var(--coral-tint) 50%, var(--surface));
  border: 1.5px solid color-mix(in oklch, var(--coral-tint-2) 65%, transparent); }
.more-sources-t { font-family: 'Quicksand'; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--coral-deep); margin-bottom: 13px; }
.more-sources ul { margin: 0; padding: 0; list-style: none; }
.more-src { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 11px; }
.more-src:last-child { margin-bottom: 0; }
.more-src-ic { flex: none; font-size: 14px; }
.more-src a { color: var(--coral-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.more-src b { color: var(--ink); font-weight: 700; }
.more-q { color: var(--muted); font-style: italic; }

@media (max-width: 640px) { .more-card { width: 96vw; height: calc(100dvh - 24px); } .more-inner { padding: 24px 18px 48px; } }

/* ---------- mastery corner badge (practice / flashcards pickers) ---------- */
.mod-corner { position: absolute; top: 12px; right: 12px; z-index: 1; }
.mini-ring { position: relative; display: grid; place-items: center; }
.mini-ring-lbl {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: 'Quicksand'; font-weight: 700; font-size: 11px;
}

/* ---------- progress dashboard ---------- */
.prog-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.prog-stat { padding: 22px 22px 20px; }
.prog-stat-lbl { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 8px; line-height: 1.25; }

.prog-sec-title { font-family: 'Quicksand'; font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.prog-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.prog-legend { display: flex; gap: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.prog-legend span { display: inline-flex; align-items: center; gap: 6px; }
.prog-legend i, .prog-tip-row i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

.prog-mod { padding: 18px 20px 16px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 8px; }
.prog-mod-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.prog-mod-name { font-family: 'Quicksand'; font-weight: 600; font-size: 16.5px; line-height: 1.15; }
.prog-track { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: none; border: none; padding: 8px; border-radius: 12px; transition: background .14s ease; }
.prog-track:hover { background: var(--bg); }
.prog-track-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.prog-track-top b { font-family: 'Quicksand'; font-size: 15px; }
.prog-track-sub { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }

.prog-lower { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 22px; align-items: start; }
.prog-chart { margin-top: 2px; }
.prog-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; z-index: 2;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-md); padding: 9px 12px;
}
.prog-tip-date { font-family: 'Quicksand'; font-weight: 700; font-size: 12.5px; margin-bottom: 5px; }
.prog-tip-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
.prog-src-row { margin-bottom: 16px; }
.prog-src-row:last-child { margin-bottom: 0; }
.prog-reset { color: var(--muted); }

@media (max-width: 1100px) { .prog-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .prog-stats { grid-template-columns: repeat(2, 1fr); }
  .prog-lower { grid-template-columns: 1fr; }
  .home-sec-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 560px) { .home-sec-grid { grid-template-columns: repeat(2, 1fr) !important; } }

/* ============================================================================
   PER-PAGE LAYOUTS — each study page gets its own purpose-fit layout while
   sharing the same tokens, type, spacing rhythm and motion. Token-only:
   no new hard-coded colors, so dark mode + accent switching keep working.
   ============================================================================ */

/* small module emblem chip, shared by Home up-next + Exam coverage */
.cov-chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-family: 'Quicksand'; font-weight: 700; font-size: 12.5px; flex: none; }

/* ---------- Home — dashboard ---------- */
.home-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: stretch; }
.home-hero { background: linear-gradient(135deg, var(--coral-tint) 0%, var(--coral-tint-2) 100%);
  border-radius: var(--r-xl); padding: 34px 38px; display: flex; flex-direction: column; }
.home-upnext { display: flex; flex-direction: column; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.home-upnext:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: oklch(0.86 0.05 42); }
.upnext-cover { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

.home-snap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.snap-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 5px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.snap-card.snap-link { cursor: pointer; }
.snap-card.snap-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: oklch(0.86 0.05 42); }
.snap-top { display: flex; align-items: center; gap: 8px; }
.snap-num { font-family: 'Quicksand'; font-weight: 700; letter-spacing: -1px; font-size: 30px; line-height: 1; }
.snap-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.snap-sub { font-family: 'Quicksand'; font-size: 14.5px; font-weight: 600; line-height: 1.1; }

.home-continue { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.cont-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-lg); cursor: pointer; text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; font: inherit; color: inherit; }
.cont-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: oklch(0.86 0.05 42); }
.cont-title { font-family: 'Quicksand'; font-weight: 600; font-size: 15.5px; line-height: 1.15; }
.cont-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Lessons — curriculum path ---------- */
.lpath-term { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 16px; }
.lpath-term h2 { font-family: 'Quicksand'; font-size: 23px; font-weight: 700; letter-spacing: -.5px; margin: 0; }
.lpath-term .lpath-sub { font-size: 14px; color: var(--muted); font-weight: 600; }
.lpath-term .lpath-done { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--coral-deep); }
.lpath-row { display: grid; grid-template-columns: 22px 1fr; gap: 18px; }
.lpath-rail { position: relative; display: flex; justify-content: center; }
.lpath-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.lpath-row:first-child .lpath-rail::before { top: 36px; }
.lpath-row:last-child .lpath-rail::before { bottom: calc(100% - 36px); }
.lpath-dot { position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%;
  margin-top: 30px; border: 4px solid var(--bg); box-sizing: content-box; }
.lcard { display: flex; align-items: center; gap: 18px; padding: 18px 22px 18px 24px; margin-bottom: 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); cursor: pointer;
  position: relative; overflow: hidden; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.lcard:hover { transform: translateX(3px); box-shadow: var(--shadow-md); border-color: oklch(0.87 0.04 42); }
.lcard-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.lcard-main { flex: 1; min-width: 0; }
.lcard-name { font-family: 'Quicksand'; font-size: 18px; font-weight: 600; line-height: 1.15; }
.lcard-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.lcard-prog { display: flex; align-items: center; gap: 11px; margin-top: 11px; max-width: 360px; }
.lcard-prog .mini-bar { flex: 1; margin: 0; height: 7px; }
.lcard-prog b { font-family: 'Quicksand'; font-size: 13px; min-width: 36px; text-align: right; }
.lcard-srcs { display: flex; gap: 8px; margin-top: 13px; }
.lcard-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.lcard-chev { color: var(--muted); font-size: 20px; line-height: 1; }

/* ---------- Practice — question bank ---------- */
.bank-top { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: stretch; }
.bank-summary { display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.bank-counts { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.bank-count-num { font-family: 'Quicksand'; font-weight: 700; letter-spacing: -1.2px; font-size: 40px; line-height: 1; }
.bank-count-split { font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.5; }
.bank-mixed { display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: linear-gradient(150deg, var(--coral-tint) 0%, var(--coral-tint-2) 100%); border-color: var(--coral-tint-2); }
.bank-head, .bank-row { display: grid; grid-template-columns: 1.7fr 0.85fr 1fr 0.95fr; gap: 14px; align-items: center; }
.bank-head { padding: 0 22px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); }
.bank-row { padding: 14px 22px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); margin-bottom: 10px; cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.bank-row:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); border-color: oklch(0.87 0.04 42); }
.bank-row.is-empty { opacity: .5; cursor: default; }
.bank-row.is-empty:hover { transform: none; box-shadow: none; border-color: var(--line); }
.bank-mod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bank-mod-name { font-family: 'Quicksand'; font-weight: 600; font-size: 15.5px; line-height: 1.15; min-width: 0; }
.bank-cell-num { font-family: 'Quicksand'; font-weight: 700; font-size: 16px; }
.bank-cell-lbl { font-size: 11px; color: var(--muted); font-weight: 600; }
.bank-acc { display: flex; flex-direction: column; gap: 6px; }
.bank-mastery { display: flex; align-items: center; gap: 10px; }
.bank-mastery .mini-ring { flex: none; }

/* ---------- Flashcards — deck stacks ---------- */
.deck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 28px; }
.deck { position: relative; cursor: pointer; }
.deck::before, .deck::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-lg);
  border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.3,.7,.3,1); }
.deck::before { transform: translate(11px, 15px) rotate(3.4deg); z-index: 0; opacity: .7; }
.deck::after { transform: translate(6px, 8px) rotate(-2.1deg); z-index: 1; opacity: .9; }
.deck-face { position: relative; z-index: 2; padding: 0 22px 22px; min-height: 176px;
  display: flex; flex-direction: column; overflow: hidden; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  transition: transform .18s ease, box-shadow .18s ease; }
/* fan the stack out + lift the top card on hover */
.deck:hover .deck-face { transform: translateY(-5px) rotate(-.6deg); box-shadow: var(--shadow-lift); }
.deck:hover::before { transform: translate(15px, 20px) rotate(4.6deg); }
.deck:hover::after { transform: translate(8px, 11px) rotate(-2.9deg); }
.deck-band { height: 9px; margin: 0 -22px 16px; }
.deck-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.deck-name { font-family: 'Quicksand'; font-size: 18px; font-weight: 600; line-height: 1.15; margin-top: 14px; }
.deck-count { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: auto; padding-top: 12px; }

/* ---------- Exam — exam papers ---------- */
.exam-hero { position: relative; padding: 30px 34px 24px; border-radius: var(--r-xl);
  border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md);
  overflow: hidden; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.exam-hero:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.exam-accent { position: absolute; left: 0; right: 0; top: 0; height: 6px; }
.exam-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.exam-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.exam-days { text-align: right; flex: none; }
.exam-days-num { font-family: 'Quicksand'; font-weight: 700; font-size: 30px; letter-spacing: -1px; line-height: 1; }
.exam-days-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.exam-title { font-family: 'Quicksand'; font-size: 30px; font-weight: 700; letter-spacing: -.8px; margin: 14px 0 2px; }
.exam-cov { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.exam-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 6px; padding-top: 18px; border-top: 1.5px solid var(--line-soft);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.exam-foot-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exam-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.exam-paper { display: flex; align-items: center; gap: 18px; padding: 18px 22px 18px 24px; position: relative;
  overflow: hidden; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.exam-paper:hover { transform: translateX(3px); box-shadow: var(--shadow-md); border-color: oklch(0.87 0.04 42); }
.exam-paper-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.exam-paper-main { flex: 1; min-width: 0; }
.exam-paper-title { font-family: 'Quicksand'; font-size: 18px; font-weight: 600; line-height: 1.15; }
.exam-paper-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.exam-paper-days { text-align: right; flex: none; }

/* ---------- Progress — wide two-column dashboard ---------- */
.page.wide { max-width: 1320px; }
.prog-wide { display: grid; grid-template-columns: 336px 1fr; gap: 22px; align-items: start; }
.prog-rail { position: sticky; top: 18px; padding: 18px 16px; }
.prog-rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 12px 10px; }
.prog-rail-row { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 11px 12px; border-radius: 14px;
  font: inherit; color: inherit; transition: background .14s ease; }
.prog-rail-row:hover { background: var(--bg); }
.prog-rail-top { display: flex; align-items: center; gap: 10px; }
.prog-rail-name { flex: 1; font-family: 'Quicksand'; font-weight: 600; font-size: 13.5px; line-height: 1.1; min-width: 0; }
.prog-rail-pct { font-family: 'Quicksand'; font-weight: 700; font-size: 13px; }
.prog-main { display: flex; flex-direction: column; gap: 18px; }
.prog-main .prog-stats { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
  .prog-main .prog-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .prog-wide { grid-template-columns: 1fr; }
  .prog-rail { position: static; }
}
@media (max-width: 900px) {
  .home-top { grid-template-columns: 1fr; }
  .home-snap { grid-template-columns: repeat(2, 1fr); }
  .home-continue { grid-template-columns: 1fr; }
  .deck-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .bank-top { grid-template-columns: 1fr; }
  .bank-head, .bank-row { grid-template-columns: 1.5fr 0.8fr 0.8fr; }
  .bank-col-acc { display: none; }
  .lpath-row { grid-template-columns: 16px 1fr; gap: 12px; }
  .lcard { flex-wrap: wrap; }
}
@media (max-width: 560px) { .deck-grid { grid-template-columns: 1fr; } }

/* ---------- login gate + account controls ---------- */
.login-wrap { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; padding: 24px; background: var(--bg); overflow: hidden; }
.login-glow { position: absolute; top: -8%; left: 50%; transform: translateX(-50%); width: min(680px, 92vw); height: 520px;
  background: radial-gradient(ellipse at center, color-mix(in oklch, var(--coral) 24%, transparent) 0%, transparent 68%);
  filter: blur(38px); pointer-events: none; z-index: 0; }
.login-loading { color: var(--muted); font-family: 'Quicksand'; font-weight: 600; z-index: 1; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 392px; display: flex; flex-direction: column;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lift);
  padding: 34px 32px 30px; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand .wm { font-family: 'Quicksand'; font-size: 21px; font-weight: 700; letter-spacing: -.5px; color: var(--ink); }
.login-title { font-family: 'Quicksand'; font-size: 28px; font-weight: 700; letter-spacing: -.7px; line-height: 1.05; margin: 18px 0 0; color: var(--ink); }
.login-sub { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 8px 0 22px; }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.login-label { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.login-input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 15px; font-family: inherit; font-size: 15.5px;
  color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-sm); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease; }
.login-input::placeholder { color: var(--muted); opacity: .6; }
.login-input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px color-mix(in oklch, var(--coral) 22%, transparent); }
.login-err { font-size: 13.5px; font-weight: 600; color: oklch(0.55 0.16 25);
  background: color-mix(in oklch, oklch(0.62 0.16 25) 12%, var(--surface));
  border: 1.5px solid color-mix(in oklch, oklch(0.62 0.16 25) 32%, transparent);
  border-radius: var(--r-sm); padding: 9px 13px; margin-bottom: 14px; }
.login-btn { width: 100%; height: 48px; font-size: 15.5px; margin-top: 4px; }
.login-foot { position: relative; z-index: 1; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }
.nav-acct { cursor: pointer; font-family: 'Quicksand'; font-weight: 700; font-size: 12.5px; white-space: nowrap;
  color: var(--ink-soft); background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 12px; transition: border-color .15s ease, color .15s ease; }
.nav-acct:hover { border-color: var(--coral); color: var(--coral-deep); }

/* ---------- reduced motion: render final values instantly ---------- */
@media (prefers-reduced-motion: reduce) {
  .fade, .modal-backdrop, .modal-card, .mod-card { animation: none !important; }
  .mini-bar > i, .quiz-progress > i, .prog-track, .sec-card, .mod-card, .row, .btn,
  .opt, .opt-key, .crumb, .tl-study, .tl-exam,
  .home-upnext, .snap-card, .cont-card, .lcard, .bank-row, .deck-face, .deck::before, .deck::after, .exam-hero, .exam-paper, .prog-rail-row, .nav-dark,
  .fc-rate-btn, .dd-cta, .dd-card, .video-rec { transition: none !important; }
}

/* ---- Lecture video embed (Unlisted YouTube) ---------------------------- */
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;            /* 16:9 */
  border-radius: var(--r-lg, 16px);
  overflow: hidden;
  background: #000;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-md, 0 10px 30px rgba(0, 0, 0, .14));
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-recs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.video-rec {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.video-rec:hover { color: var(--ink); border-color: var(--ink); }
.video-rec.is-on { color: var(--surface); }

/* ---------- topic resources (curated videos + articles, shown in the drawer) ---------- */
.res-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.res-inner { max-width: 880px; margin: 0 auto; padding: 24px 28px 64px; }
.res-topic-head { font-family: 'Quicksand'; font-weight: 700; font-size: 23px; letter-spacing: -.5px; line-height: 1.1; }
.res-topic-sub { font-size: 13.5px; color: var(--muted); margin: 6px 0 4px; line-height: 1.5; }
.res-sec-h { font-family: 'Quicksand'; font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase;
  margin: 22px 0 13px; display: flex; align-items: center; }

.res-vid-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.res-vid { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .14s ease, box-shadow .14s ease; }
.res-vid:hover { border-color: oklch(0.87 0.04 42); box-shadow: var(--shadow-sm); }
.res-vid-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border: none; padding: 0; cursor: pointer;
  background-color: var(--bg); background-size: cover; background-position: center; display: block; }
.res-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%;
  background: oklch(0.28 0.02 50 / .62); color: #fff; display: grid; place-items: center; font-size: 19px; padding-left: 3px;
  transition: transform .15s ease, background .15s ease; }
.res-vid-thumb:hover .res-play { transform: scale(1.09); background: var(--coral); }
.res-vid-meta { padding: 12px 15px 14px; display: flex; flex-direction: column; gap: 3px; }
.res-vid-title { font-family: 'Quicksand'; font-weight: 600; font-size: 14.5px; line-height: 1.28; }
.res-vid-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.res-blurb { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 4px; }
.res-yt-link { font-size: 12px; font-weight: 700; color: var(--coral-deep); text-decoration: none; margin-top: 7px; align-self: flex-start; }
.res-yt-link:hover { text-decoration: underline; }

.res-art-list { display: flex; flex-direction: column; gap: 10px; }
.res-art { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 18px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink);
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.res-art:hover { border-color: oklch(0.87 0.04 42); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.res-art-main { min-width: 0; }
.res-art-title { font-family: 'Quicksand'; font-weight: 600; font-size: 15px; line-height: 1.3; }
.res-art-side { display: flex; align-items: center; gap: 8px; flex: none; }
.res-art-src { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.res-art-arrow { color: var(--muted); font-size: 15px; }

@media (max-width: 760px) {
  .res-inner { padding: 18px 16px 48px; }
  .res-vid-grid { grid-template-columns: 1fr; gap: 14px; }
  .res-art { flex-direction: column; gap: 9px; }
  .res-art-side { align-self: flex-start; }
}

/* ============================================================================
   MOBILE — phone-first navigation + responsive layout layer.
   All structural overrides are scoped to max-width queries, and the nav account
   group uses display:contents on desktop, so the desktop layout is unchanged.
   ============================================================================ */

/* account controls flow directly into .nav-right on desktop (no visual change) */
.nav-acct-group { display: contents; }

/* hamburger — hidden on desktop, styled like the dark toggle */
.nav-burger { display: none; width: 42px; height: 42px; border-radius: 12px; place-items: center; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-soft); flex: none;
  transition: border-color .15s ease, color .15s ease; }
.nav-burger:hover { border-color: oklch(0.86 0.05 42); color: var(--ink); }
.nav-burger:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

/* drop-down menu sheet (rendered only when open; only reachable via the mobile hamburger) */
.nav-menu-backdrop { position: fixed; inset: 0; z-index: 38; background: oklch(0.3 0.02 50 / .32); }
.nav-menu { position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 2px; padding: 10px;
  background: var(--surface); border-bottom: 1.5px solid var(--line);
  box-shadow: var(--shadow-md); max-height: calc(100dvh - 64px); overflow-y: auto;
  animation: navMenuDrop .18s cubic-bezier(.2,.8,.3,1) both; }
@keyframes navMenuDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.nav-menu-item { display: flex; align-items: center; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid transparent; border-radius: 12px; padding: 13px 16px;
  font-family: 'Quicksand'; font-size: 15.5px; font-weight: 600; color: var(--ink-soft);
  background: transparent; transition: background .14s ease, color .14s ease; }
.nav-menu-item:hover { background: var(--bg); color: var(--ink); }
.nav-menu-item.active { background: var(--coral-tint); color: var(--coral-deep); border-color: var(--coral-tint-2); }
.nav-menu-acct { font-size: 14px; color: var(--muted); }
.nav-menu-div { height: 1.5px; background: var(--line); margin: 6px 8px; }

/* the inline grids/widths these classes replace live in JSX; defaults match the old inline values */
.lesson-detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 22px; align-items: start; }
.pdf-lec-rail { width: 156px; }

/* pre-exam stat boxes (Questions / Time limit / Weight) — class-driven so the big
   number can shrink on phones instead of forcing the 3-col grid wider than the screen */
.pe-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.pe-stat { background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; min-width: 0; }
.pe-stat-num { font-size: 30px; }
.pe-stat-lbl { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* the slide-over drawer width was previously inline; now class-driven so it can go full-width on phones */
.pdf-drawer { width: 80vw; max-width: min(1200px, 100vw); }

/* ---- ≤920px: tabs are already hidden here; swap in the hamburger ---- */
@media (max-width: 920px) {
  .nav { padding: 12px 16px; gap: 12px; }
  .nav-burger { display: grid; }
  .nav-acct-group { display: none; }
  .nav-right { margin-left: auto; }
}

/* ---- ≤760px: stack the two-column reading/detail layouts ---- */
@media (max-width: 760px) {
  /* lesson detail: video + topics stack vertically */
  .lesson-detail-grid { grid-template-columns: 1fr; gap: 18px; }

  /* study-notes reader: TOC becomes a short scrollable strip above full-width content */
  .notes-col-layout { flex-direction: column; overflow: visible; }
  .notes-toc-col { width: 100%; flex-shrink: 1; max-height: 168px;
    border-right: none; border-bottom: 1.5px solid var(--line); padding: 14px 12px; }
  .notes-content-col { padding: 20px 16px 48px; }

  /* slides/notes drawer goes (nearly) full-screen */
  .pdf-drawer { width: 100vw; max-width: 100vw; }
  .pdf-lec-rail { width: 120px; }

  /* schedule timeline: tighter date column, no forced one-line titles (set in JSX) */
  .tl-row { grid-template-columns: 56px 18px 1fr; gap: 10px; }
  .tl-date { font-size: 11.5px; padding-top: 16px; }
  .sched-grid { gap: 14px; }
}

/* ---- ≤640px: tighten page padding + type for small phones ---- */
@media (max-width: 640px) {
  .page { padding: 24px 16px 64px; }
  .page.fit { padding-left: 16px; padding-right: 16px; }
  .page-title { font-size: 30px; }
  .page-sub { font-size: 15px; }
  .page-head { margin-bottom: 20px; }
  .crumb { margin-bottom: 16px; }

  .panel { padding: 22px 18px; }

  /* quiz / exam card */
  .qcard { padding: 24px 20px; }
  .qstem { font-size: 20px; }
  .opt { padding: 14px 15px; font-size: 15px; }

  /* flashcard: shrink the term so long ones fit the fixed-height face */
  .fc { height: 340px; }
  .fc-face { padding: 30px 26px; }
  .fc-term { font-size: 26px; }
  .fc-def { font-size: 16.5px; }

  /* headings that were sized for desktop heroes */
  .exam-title, .dd-title { font-size: 25px; }
  .exam-hero { padding: 24px 22px 20px; }
  .exam-paper { padding: 16px 16px 16px 18px; gap: 14px; }
  .bank-count-num { font-size: 34px; }

  /* pre-exam stats: smaller number so 3 boxes fit a narrow phone without clipping */
  .pe-stat { padding: 14px 12px; }
  .pe-stat-num { font-size: 22px; }
  .pe-stat-lbl { font-size: 11.5px; }

  /* schedule timeline: tightest columns + let cards shrink so nothing spills */
  .tl-row { grid-template-columns: 50px 16px 1fr; gap: 8px; }
  .tl-card, .tl-study, .tl-exam { min-width: 0; }
  .tl-study, .tl-exam { padding-left: 15px; padding-right: 15px; }

  /* keep the modal sheet from hugging the screen edges */
  .modal-backdrop { padding: 14px; }
  .modal-card { padding: 24px 22px; }
}

/* avoid iOS auto-zoom on focus (any input under 16px triggers it) */
@media (max-width: 760px) {
  .login-input, .io-input { font-size: 16px; }
}
