/* ---------------------------------------------------------------- shell */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 26px; height: 64px; padding: 0 24px; background: rgba(243, 246, 251, .92); backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--line); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 7px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.topbar nav a:hover { color: var(--ink); background: var(--brand-soft); }
.topbar nav a.on { color: var(--brand); background: var(--brand-soft); }
.me { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border: 1.5px solid var(--line-2); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--paper); font-size: 14px; }
.me-chip:hover { border-color: var(--brand); color: var(--ink); }
.me-plan { font-weight: 600; }
.me-credits { background: var(--brand-soft); color: var(--brand); padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 550; }
main:focus { outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 36px 24px 80px; }
.page-title { font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -0.03em; }
.sub { font-size: 21px; margin: 40px 0 14px; }
.lede { color: var(--ink-2); font-size: 17.5px; margin-top: 12px; max-width: 64ch; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.crumb { display: inline-block; font-size: 14px; font-weight: 550; text-decoration: none; margin-bottom: 14px; }
.crumb::before { content: "‹ "; }
.panel { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 22px; }
.panel.quiet { background: transparent; border-style: dashed; }
.panel h3 { font-size: 18px; margin-bottom: 8px; }
.loading { padding: 80px 24px; text-align: center; color: var(--ink-3); }
.empty, .paywall { max-width: 560px; margin: 60px auto; padding: 0 24px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty h2, .paywall h2 { font-size: 30px; }
.paywall p { color: var(--ink-2); }
.paywall .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 10px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: 86vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }

/* ---------------------------------------------------------------- home */
.continue { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cont { display: grid; gap: 8px; padding: 16px 18px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.cont:hover { border-color: var(--brand); color: var(--ink); }
.cont-title { font-weight: 600; }
.cont-meta { font-size: 13px; color: var(--ink-3); }
.bar { height: 5px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.course { display: grid; align-content: start; gap: 8px; padding: 24px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.course:hover { border-color: var(--brand); color: var(--ink); }
.course .code, .course-head .code { font-family: var(--mono); font-size: 14px; color: var(--accent-ink); }
.course h3 { font-size: 23px; }
.course p { color: var(--ink-2); font-size: 15px; }
.course .meta { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
.course.request { background: transparent; border-style: dashed; }

/* ---------------------------------------------------------------- course */
.course-head { margin-bottom: 8px; }
.course-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.course-cols aside { display: grid; gap: 16px; margin-top: 40px; }
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lesson-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.lesson-row:hover { border-color: var(--brand); color: var(--ink); }
.lesson-row .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); font-family: var(--display); font-weight: 600; }
.lesson-row.locked .n { background: var(--line-2); color: var(--ink-2); }
.lt { display: grid; gap: 2px; }
.lt b { font-weight: 600; font-size: 16.5px; }
.lt span { color: var(--ink-2); font-size: 14.5px; }
.lm { display: grid; justify-items: end; gap: 4px; font-size: 13.5px; color: var(--ink-3); }
.lm .done { color: var(--accent-ink); font-weight: 600; }
.mocks { display: grid; gap: 10px; }
.mock-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 16px 18px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.mock-row:hover { border-color: var(--brand); color: var(--ink); }
.mock-row span:not(.tag) { grid-column: 1; font-size: 14px; color: var(--ink-3); }
.mock-row .tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.prof-cta { background: var(--stage); border-color: var(--stage); color: #e9eef7; }
.prof-cta p { color: #b9b5d0; margin-bottom: 14px; font-size: 15px; }
.topics { list-style: none; margin: 0; padding: 0; }
.topics li { padding: 14px 0 14px 14px; border-top: 1.5px solid var(--line); border-left: 4px solid var(--line-2); margin-left: -4px; }
.topics li.pri-high { border-left-color: var(--pink); }
.topics li.pri-medium { border-left-color: var(--accent); }
.topics .tp { display: grid; gap: 1px; }
.topics .prio { font-size: 12.5px; color: var(--ink-3); }
.topics p { font-size: 14.5px; color: var(--ink-2); margin-top: 6px; }
.topics details { margin-top: 6px; font-size: 14px; }
.topics summary { cursor: pointer; color: var(--brand); font-weight: 550; }
.topics details ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }

/* ---------------------------------------------------------------- lesson */
.lesson-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; max-width: 1560px; margin: 0 auto; padding: 22px 24px 60px; align-items: start; }
.player { background: var(--stage); border-radius: var(--r-m); overflow: hidden; }
.player:fullscreen, .player:-webkit-full-screen { display: flex; flex-direction: column; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
.player:fullscreen .stage, .player:-webkit-full-screen .stage { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
.player:fullscreen .stage canvas, .player:-webkit-full-screen .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.player:fullscreen .transport, .player:fullscreen .stage-note, .player:fullscreen .player-notice,
.player:-webkit-full-screen .transport, .player:-webkit-full-screen .stage-note, .player:-webkit-full-screen .player-notice { flex: none; }
.stage { position: relative; aspect-ratio: 16 / 9; }
.stage canvas { width: 100%; height: 100%; cursor: pointer; }
.bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 86px; height: 86px; border-radius: 50%; border: 0; background: var(--pink); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 40px rgba(229, 72, 127, .45); }
.bigplay svg { width: 38px; height: 38px; margin-left: 4px; }
.stage-note { padding: 0 16px 10px; background: var(--stage-2); color: #8f9bb5; font-size: 13px; }
.transport { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--stage-2); color: #dfe6f3; }
.tbtn { border: 0; background: transparent; color: inherit; height: 36px; min-width: 36px; padding: 0 8px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; display: grid; place-items: center; }
.tbtn:hover { background: rgba(255, 255, 255, .08); }
.tbtn svg { width: 22px; height: 22px; }
.tbtn.cc[aria-pressed="false"] { opacity: .45; }
.scrub { position: relative; flex: 1; height: 30px; cursor: pointer; touch-action: none; }
.scrub .rail, .scrub .fill { position: absolute; top: 13px; height: 5px; border-radius: 5px; }
.scrub .rail { left: 0; right: 0; background: rgba(200, 215, 240, .2); }
.scrub .fill { left: 0; width: 0; background: var(--pink); }
.scrub .ticks i { position: absolute; top: 10px; width: 3px; height: 11px; background: var(--stage-2); margin-left: -1px; }
.scrub .knob { position: absolute; top: 8px; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%; background: #fff; }
.time { font-family: var(--mono); font-size: 13px; min-width: 104px; text-align: right; color: #aab5c8; }
.rate { width: auto; padding: 5px 6px; background: transparent; color: inherit; border: 1px solid rgba(200, 215, 240, .25); border-radius: 8px; font-size: 13px; }
.rate option { color: var(--ink); }
.lesson-info { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 20px; }
.lesson-info h1 { font-size: clamp(24px, 2.6vw, 32px); }
.lesson-info .muted { margin-top: 4px; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lesson-actions .btn { white-space: normal; text-align: left; }
.nudge { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-m); background: var(--brand-soft); color: var(--ink); font-size: 15px; }
.lesson-side { position: sticky; top: 86px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); height: calc(100vh - 110px); min-height: 480px; display: flex; flex-direction: column; overflow: hidden; margin-top: 38px; }
.tabs { display: flex; border-bottom: 1.5px solid var(--line); padding: 0 8px; }
.tabs button { flex: 1; border: 0; background: none; padding: 13px 6px 11px; font-weight: 600; font-size: 14.5px; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabpanel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabpanel[hidden] { display: none; }
.transcript { flex: 1; overflow-y: auto; padding: 16px 18px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.transcript p { margin: 0 0 12px; }
.transcript p.h { font-family: var(--display); font-weight: 650; color: var(--ink); font-size: 16.5px; margin-top: 18px; }
.transcript .s { cursor: pointer; border-radius: 4px; padding: 1px 0; }
.transcript .s:hover { background: var(--brand-soft); }
.transcript .s.on { background: var(--brand-soft); color: var(--ink); box-shadow: 0 0 0 2px var(--brand-soft); }
.follow { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-top: 1.5px solid var(--line); font-size: 14px; color: var(--ink-2); }
.chapters { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.chapters button { width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left; border: 0; background: none; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.chapters button:hover { background: var(--brand-soft); }

/* ---------------------------------------------------------------- chat */
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.prof-page .chat { height: min(70vh, 760px); background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); margin-top: 22px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 100%; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.msg p + p, .msg p + ul, .msg ul + p, .msg .mathblock { margin-top: 8px; }
.msg ul, .msg ol { padding-left: 20px; margin: 6px 0 0; }
.msg h4 { font-size: 16px; margin-top: 10px; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; padding: 9px 14px; border-radius: 16px 16px 4px 16px; max-width: 88%; }
.msg.assistant { color: var(--ink); }
.msg.error { color: var(--bad); }
.msg mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.thinking { color: var(--ink-3); }
.chat-warn { color: var(--bad); font-size: 13px; }
.chat-empty { display: grid; gap: 8px; color: var(--ink-2); font-size: 15px; }
.chat-empty p { margin-bottom: 6px; }
.starter { text-align: left; border: 1.5px solid var(--line); background: var(--porcelain); border-radius: 12px; padding: 10px 13px; cursor: pointer; font-size: 14.5px; color: var(--ink); }
.starter:hover { border-color: var(--brand); }
.chat-form { border-top: 1.5px solid var(--line); padding: 12px; }
.chat-form textarea { resize: none; font-size: 15px; }
.chat-row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.chat-credits { margin-right: auto; font-size: 13px; color: var(--ink-3); }
.chat-row .deep[aria-pressed="true"], .chat-row .deep[aria-pressed="true"]:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.chat-gate { padding: 22px; display: grid; gap: 12px; justify-items: start; }
.chat-gate p { color: var(--ink-2); font-size: 15px; }

/* ---------------------------------------------------------------- mock */
.mock-page { max-width: 860px; }
.mock-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.timer { font-family: var(--mono); font-size: 15px; padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); }
.timer.over { color: var(--bad); border-color: var(--bad); }
.mock-intro { margin: 18px 0 8px; color: var(--ink-2); }
.questions { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.q { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 22px; }
.q.right { border-color: var(--good); }
.q.wrong { border-color: var(--bad); }
.q-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.q-n { font-family: var(--display); font-weight: 650; font-size: 17px; }
.md p + p, .md p + .mathblock, .md .mathblock + p { margin-top: 10px; }
.md .mathblock { overflow-x: auto; overflow-y: hidden; }
.md-inline p { display: inline; }
.q-answer { margin-top: 16px; display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.num { display: grid; gap: 6px; max-width: 280px; font-size: 14px; font-weight: 550; color: var(--ink-2); }
.q-result { margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed var(--line-2); display: grid; gap: 10px; }
.q-result .ok { color: var(--good); font-weight: 600; }
.q-result .no { color: var(--bad); font-weight: 600; }
.q-result summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.q-result details .md { margin-top: 10px; }
.ai-feedback:not(:empty) { margin-top: 10px; padding: 14px; background: var(--brand-soft); border-radius: 10px; }
.score { margin-top: 20px; padding: 16px 20px; border-radius: var(--r-m); background: var(--stage); color: #e9eef7; }
.score b { font-family: var(--display); font-size: 22px; color: var(--accent); margin-right: 6px; }
.mock-submit { display: flex; gap: 8px; margin-top: 24px; }

/* ---------------------------------------------------------------- account */
.acct-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.acct-top h2 { font-size: 30px; margin: 4px 0; }
.meter { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; margin: 10px 0 8px; }
.meter i { display: block; height: 100%; background: var(--brand); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.plan.current { border-color: var(--brand); }
.plan.wanted { box-shadow: 0 0 0 3px var(--accent); }
.plan h3 { font-size: 20px; }
.plan .price { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -0.03em; }
.plan .price small { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.plan p { color: var(--ink-2); font-size: 14.5px; }
.plan .feat { flex: 1; }
.acct-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.acct-row .panel p { margin-bottom: 12px; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: 13px; }
.devnote { margin-top: 18px; padding: 12px 16px; border-radius: 10px; background: #fff4e8; color: #8a4a12; font-size: 14px; }
.acct-foot { display: flex; gap: 8px; margin-top: 24px; }

/* ---------------------------------------------------------------- auth */
.auth-page { max-width: 460px; }
.auth h1 { font-size: 30px; margin-bottom: 6px; }
.auth form { margin-top: 22px; }
.auth .switch { margin-top: 18px; font-size: 15px; color: var(--ink-2); }

/* ---------------------------------------------------------------- admin */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.admin-grid table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-grid th, .admin-grid td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.admin-grid th { color: var(--ink-3); font-weight: 550; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .lesson-page { grid-template-columns: minmax(0, 1fr); }
  .lesson-side { position: static; height: 560px; margin-top: 0; }
}
@media (max-width: 860px) {
  .course-cols, .acct-top, .plans, .acct-row, .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .course-cols aside { margin-top: 0; }
  .topbar { gap: 12px; padding: 0 14px; }
  .topbar nav a[data-nav="account"] { display: none; }
  .me-plan { display: none; }
}
@media (max-width: 560px) {
  .page { padding: 24px 16px 60px; }
  .lesson-page { padding: 12px 10px 40px; }
  .transport { gap: 2px; padding: 8px; }
  .back, .rate, .time { display: none; }
  .lesson-row { grid-template-columns: 36px minmax(0, 1fr); }
  .lesson-row .n { width: 34px; height: 34px; }
  .lm { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; }
  .me .btn.quiet { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar .wordmark { font-size: 19px; gap: 8px; }
  .topbar .wordmark img { width: 28px; height: 28px; }
  .topbar .site-tag { display: none; }
  .topbar nav a { padding: 6px 10px; font-size: 14px; }
  .topbar .btn.small { padding: 7px 12px; }
}

/* ---------------------------------------------------------------- catalog navigation */
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 30px 0 0; padding: 5px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; width: fit-content; }
.seg a { padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.seg a:hover { color: var(--ink); background: var(--porcelain); }
.seg a.on { background: var(--ink); color: #fff; }
.soon-dot { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); margin-left: 4px; vertical-align: 2px; }
.seg a.on .soon-dot { background: rgba(255,255,255,.18); color: #fff; }
.years { display: flex; gap: 22px; margin-top: 26px; border-bottom: 1.5px solid var(--line); }
.years a { padding: 8px 2px 12px; text-decoration: none; color: var(--ink-3); font-weight: 600; font-family: var(--display); font-size: 18px; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.years a.on { color: var(--ink); border-bottom-color: var(--pink); }
.quarter .sub { margin-top: 32px; }
.course.soon { background: transparent; border-style: dashed; }
.course.soon h3 { color: var(--ink-2); }
.course.soon .tag { justify-self: start; }
.cont-course { font-size: 13px; color: var(--accent-ink); font-weight: 600; }
.soon-block { margin-top: 28px; padding: 36px; border-radius: var(--r-l); background: var(--paper); border: 1.5px dashed var(--line-2); display: grid; gap: 12px; justify-items: center; text-align: center; }
.soon-block.left { justify-items: start; text-align: left; }
.soon-block h2 { font-size: 26px; }
.soon-block p { color: var(--ink-2); max-width: 52ch; }
.notify { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; max-width: 460px; }
.notify input { flex: 1 1 200px; }
h3.kind { font-size: 15px; color: var(--ink-2); margin: 18px 0 8px; font-family: var(--sans); font-weight: 600; }
.plans.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--ink-2); }
.feat li { padding-left: 22px; position: relative; }
.feat li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.app-foot { max-width: 1120px; margin: 0 auto; padding: 24px 24px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); border-top: 1.5px solid var(--line); }
.app-foot a { color: var(--ink-3); }
@media (max-width: 860px) { .plans.two { grid-template-columns: minmax(0, 1fr); } }
.foot-links { display: flex; gap: 16px; }
.mock-row.soon { border-style: dashed; background: transparent; }
.reveal { margin-top: 16px; border-top: 1.5px dashed var(--line-2); padding-top: 12px; }
.reveal summary { cursor: pointer; font-weight: 600; color: var(--brand); width: fit-content; }
.reveal[open] summary { margin-bottom: 10px; }
.reveal .final { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 10px; }
.reveal .final > span:first-child { font-weight: 700; color: var(--accent-ink); margin-right: 6px; }
.lesson-row .n { font-size: 14px; }
.price s { font-size: .55em; color: var(--ink-3); font-weight: 500; margin-right: 4px; }
.trial-panel { border-color: var(--accent); background: var(--accent-soft); }
.trial-panel .btn { margin-top: 12px; }
.trial-note { margin-top: 10px; max-width: 820px; }
.ref-progress { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.ref-progress i { width: 26px; height: 8px; border-radius: 8px; background: var(--line); }
.ref-progress i.on { background: var(--pink); }
.ref-progress span { margin-left: 6px; }
.devnote p { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.acct-top .panel .btn { margin-top: 12px; }

.feat { align-content: start; }

/* ---------- personal study layer: streak strip, exam plan, self-marking, devices ---------- */
.study-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(120px, 1.2fr); gap: 12px; align-items: stretch; margin: 18px 0 8px; }
.ss-item { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ss-item b { font-family: var(--display); font-size: 22px; font-weight: 650; color: var(--ink); }
.ss-item span { color: var(--ink-3); font-size: 13.5px; }
.ss-item.warn b { color: var(--brand); }
.ss-bars { display: flex; align-items: flex-end; gap: 6px; padding: 12px 14px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); min-height: 74px; }
.ss-bars i { flex: 1; background: var(--line-2); border-radius: 4px 4px 2px 2px; min-height: 4px; }
.ss-bars i.on { background: var(--accent-ink); }
@media (max-width: 760px) { .study-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ss-bars { grid-column: 1 / -1; } }

.plan-panel .meter { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 8px; }
.plan-panel .meter i { display: block; height: 100%; background: var(--accent-ink); border-radius: 999px; }
.plan-h { font-weight: 600; margin: 12px 0 6px; font-size: 14.5px; }
.plan-list { margin: 0 0 6px 18px; padding: 0; display: grid; gap: 4px; font-size: 14.5px; }
.review-note { font-size: 14px; background: var(--brand-soft); border-radius: var(--r-s); padding: 8px 12px; margin: 10px 0; }
.exam-date { margin-top: 12px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.exam-date .row { display: flex; gap: 8px; }
.exam-date input { flex: 1; min-width: 0; padding: 7px 10px; border: 1.5px solid var(--line-2); border-radius: var(--r-s); font: inherit; }

.mark-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 14px 0 6px; font-size: 14.5px; }
.mark-bar .btn { margin-left: auto; }
.selfmark { display: flex; gap: 8px; margin-top: 12px; }
.selfmark .btn.on[data-st="got"] { background: var(--accent-soft); border-color: var(--accent-ink); color: var(--accent-ink); }
.selfmark .btn.on[data-st="review"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.progress-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.progress-cards .panel { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.progress-cards b { font-family: var(--display); font-size: 24px; }
.progress-cards span { color: var(--ink-3); font-size: 13.5px; }
@media (max-width: 760px) { .progress-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.devices ul { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 10px; }
.devices li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.devices li .muted { flex-basis: 100%; }
.small { font-size: 13.5px; }

/* player: owner watermark and "playing elsewhere" notice */
.stage .wm { position: absolute; transform: translate(-50%, -50%); color: rgba(255, 255, 255, .13); font-size: clamp(10px, 1.1vw, 14px); font-weight: 600;
  letter-spacing: .02em; pointer-events: none; user-select: none; white-space: nowrap; transition: left 2s ease, top 2s ease; }
.player-notice { padding: 10px 16px; background: #2a2450; color: #f4f2fb; font-size: 14px; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); margin: 4px 0 14px; line-height: 1.45; }
.consent input { margin-top: 3px; flex: none; }
.terms-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; width: min(720px, calc(100vw - 32px)); display: flex; gap: 16px; align-items: center;
  background: var(--paper); border: 1.5px solid var(--line-2); border-radius: var(--r-m); padding: 14px 18px; box-shadow: 0 12px 40px rgba(27, 26, 46, .16); font-size: 14px; }
.terms-banner p { margin: 0; color: var(--ink-2); }
@media (max-width: 600px) { .terms-banner { flex-direction: column; align-items: stretch; } }

.timing { margin: 14px 0 6px; }
.timing ol { margin: 6px 0 0 18px; padding: 0; display: grid; gap: 4px; font-size: 14.5px; }
.q-section { list-style: none; margin: 18px 0 -4px; }
.q-section h2 { margin-bottom: 2px; }
details.hint { margin-top: 10px; font-size: 14.5px; }
details.hint summary { cursor: pointer; color: var(--accent-ink); font-weight: 550; }

.md-table{overflow-x:auto;margin:.6em 0}
.md-table table{border-collapse:collapse;font-size:.95em}
.md-table th,.md-table td{padding:.3em .8em;border-bottom:1px solid rgba(255,255,255,.12);text-align:center}
.md-table th{font-weight:600}

/* ---------------------------------------------------------------- study tools: formula sheet + review list */
.tools { display: grid; gap: 4px; }
.tool-row { display: grid; gap: 2px; padding: 12px 0; border-top: 1.5px solid var(--line); text-decoration: none; color: var(--ink); }
.tool-row:first-of-type { border-top: 0; padding-top: 2px; }
.tool-row b { font-weight: 600; }
.tool-row span { font-size: 14px; color: var(--ink-3); }
.tool-row:hover b { color: var(--brand); }
.tool-row .due { color: var(--pink); }
.fs-bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; }
.switch-row { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.fs-lecture { margin: 0 0 22px; }
.fs-lecture h3 { font-size: 17px; margin-bottom: 8px; }
.fs-lecture h3 .n { color: var(--ink-3); font-weight: 550; margin-right: 6px; }
.fs-lecture.locked { opacity: .75; }
.fs-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.fs-list li a { display: grid; gap: 6px; height: 100%; padding: 12px 16px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); overflow-x: auto; }
.fs-list li.key a { border-left: 4px solid var(--accent); }
.fs-list li a:hover { border-color: var(--brand); }
.fs-tex { font-size: 15px; }
.fs-tex mjx-container[display="true"] { margin: 2px 0 !important; text-align: left !important; }
.fs-label { font-size: 13px; color: var(--ink-3); }
.review-page details.later { margin-top: 28px; }
.review-page details.later > summary { cursor: pointer; font-weight: 600; color: var(--brand); }
@media print {
  .topbar, .crumb, .fs-bar, .toast, #termsBanner { display: none !important; }
  .formula-page { padding: 0; max-width: none; }
  .fs-list { grid-template-columns: 1fr 1fr; }
  .fs-list li a { border-color: #ccc; break-inside: avoid; }
  .fs-lecture { break-inside: avoid-page; }
}
.auth .forgot { display: inline-block; margin-top: 6px; }
.pw-form { display: grid; gap: 12px; max-width: 460px; }
details.danger { margin-top: 28px; }
details.danger > summary { cursor: pointer; color: var(--ink-3); font-size: 14px; }
details.danger[open] > summary { margin-bottom: 10px; }
.danger-btn { border-color: var(--bad); color: var(--bad); }
.danger-btn:hover { background: var(--bad); color: #fff; }
.flashcard { max-width: 760px; display: grid; gap: 12px; justify-items: start; margin-top: 18px; padding: 28px; }
.fc-front { font-size: 24px; font-weight: 600; }
.fc-back { width: 100%; overflow-x: auto; padding: 12px 0; border-top: 1.5px dashed var(--line-2); }
.fs-bar .row { display: flex; gap: 8px; }
.switch-row { white-space: nowrap; }
.site-tag { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font: 600 12px/1.4 var(--sans); letter-spacing: .02em; }

.quarter .q-later { margin: -6px 0 14px; font-size: 14px; }

/* ---------------------------------------------------------------- flashcards */
.cards-page .fc-get { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cards-page .fc-get > div:first-child { flex: 1 1 420px; }
.cards-page .fc-get p { margin: 0 0 6px; }
.fc-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; margin-top: 18px; align-items: start; }
.fc-nav { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; padding: 12px; }
.fc-nav h3 { font-size: 12px; margin: 10px 6px 4px; color: var(--muted, #6B6A7E); }
.fc-sub { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 14px; color: inherit; cursor: pointer; }
.fc-sub:hover { background: rgba(19, 163, 155, .08); }
.fc-sub.on { background: rgba(229, 72, 127, .1); font-weight: 600; }
.fc-sub.locked > span:first-child { opacity: .6; }
.fc-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fc-bar h2 { margin: 0; }
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cards-page .fc-deck .fc-card { position: relative; border: 1px solid #E6E3DC; border-radius: 12px; padding: 12px 14px 30px; cursor: pointer; min-height: 120px; box-shadow: 0 1px 2px rgba(27, 26, 46, .05); }
.fc-deck .fc-card:focus-visible { outline: 2px solid #13A39B; outline-offset: 2px; }
.cards-page .fc-deck .fc-card.flipped { border-color: #13A39B; }
.fc-deck .fc-card .st-q { font-size: 17px; }
.cards-page .fc-deck .fc-card { font-size: 16px; }
.fc-hint { position: absolute; bottom: 8px; right: 12px; font-size: 12px; color: #9A98AB; }
@media (max-width: 800px) { .fc-layout { grid-template-columns: 1fr; } .fc-nav { position: static; max-height: none; } .fc-grid { grid-template-columns: 1fr; } }
.cards-page .fc-kicker { color: #E5487F; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.cards-page .fc-grid { align-items: start; }

/* ---------------------------------------------------------------- pass guarantee */
.g-panel { border: 1.5px solid var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--paper) 60%); }
.g-panel h3 { margin: 2px 0 10px; }
.g-panel p { font-size: 14px; color: var(--ink-2); }
.g-panel .meter i, .g-page .meter i { background: var(--accent); }
.g-panel .btn { margin-top: 10px; }
.g-kicker { display: block; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.g-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 14px; }
.g-row b { font-variant-numeric: tabular-nums; }
.g-page .page-title { max-width: 22ch; }
.g-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin: 22px 0; align-items: start; }
@media (max-width: 820px) { .g-cols { grid-template-columns: 1fr; } }
.g-checks { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 14px; }
.g-checks li { display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; }
.g-checks li small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.g-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;  }
.g-checks li.ok .g-tick { background: var(--accent); border-color: var(--accent); }
.g-claim h2 { margin-top: 0; }
.g-claim fieldset { border: 0; padding: 0; }
.g-claim .radio { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 15px; }
.g-terms summary { cursor: pointer; font-weight: 600; }
.g-terms ol { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.g-credit { margin-top: 16px; border: 1.5px solid var(--accent); }
.g-admin { margin-bottom: 12px; }
.g-admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.g-claim [hidden] { display: none !important; }
.g-claim input[type=date] { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-s); font: inherit; background: var(--paper); color: var(--ink); }

/* chapter list + scrub hover label */
.chap-wrap { position: relative; }
.chap-menu { position: absolute; bottom: calc(100% + 10px); right: 0; width: min(360px, 80vw); max-height: 52vh; overflow: auto; background: var(--stage-2); border: 1px solid rgba(200, 215, 240, .18); border-radius: 10px; padding: 6px; z-index: 20; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.chap-menu button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: #dfe6f3; padding: 8px 10px; border-radius: 7px; font: inherit; cursor: pointer; }
.chap-menu button:hover, .chap-menu button:focus-visible { background: rgba(200, 215, 240, .1); }
.chap-menu button.on { background: rgba(229, 72, 127, .18); }
.chap-menu .ct { font-family: "IBM Plex Mono", monospace; font-size: .85em; opacity: .7; min-width: 3.4em; padding-top: 1px; }
.scrub-tip { position: absolute; bottom: 30px; transform: translateX(-50%); white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; background: var(--stage-2); color: #dfe6f3; border: 1px solid rgba(200, 215, 240, .18); border-radius: 6px; padding: 3px 8px; font-size: .82rem; pointer-events: none; }

/* ---------------------------------------------------------------- My courses dashboard (1 Dec 2026) */
.topbar nav a[hidden] { display: none; }
.dash .page-title { margin-bottom: 18px; }
.resume { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px 22px; margin: 8px 0 6px;
  background: var(--stage); color: #fff; border-radius: var(--r-l); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.resume:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 30px rgba(22, 20, 43, .18); }
.resume-play { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); position: relative; }
.resume-play::after { content: ""; position: absolute; left: 21px; top: 16px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; }
.resume-txt { display: grid; gap: 3px; min-width: 0; }
.resume-txt b { font-size: 20px; font-family: var(--display); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-txt .muted { color: rgba(255, 255, 255, .7); font-size: 14px; }
.resume-k { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: #ff9cbf; font-weight: 600; }
.my-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.my-course { display: grid; align-content: start; gap: 12px; padding: 20px 22px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-m); }
.my-course:hover { border-color: var(--line-2); }
.mc-head { text-decoration: none; color: var(--ink); display: grid; gap: 4px; }
.mc-head:hover h3 { color: var(--brand); }
.mc-head .code { font-family: var(--mono); font-size: 13.5px; color: var(--accent-ink); }
.mc-head h3 { font-size: 21px; }
.mc-prog { display: grid; gap: 6px; }
.mc-next { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-s); background: var(--brand-soft); color: var(--ink); text-decoration: none; }
a.mc-next:hover { background: var(--brand); color: #fff; }
a.mc-next:hover .muted { color: rgba(255, 255, 255, .8); }
.mc-next b { font-weight: 600; }
.mc-next.done { background: var(--accent-soft); margin: 0; font-size: 14.5px; }
.mc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; }
.mc-links a { color: var(--ink-2); text-decoration: none; }
.mc-links a:hover { color: var(--brand); }
.my-course.add { border-style: dashed; background: transparent; text-decoration: none; color: var(--ink); align-content: center; justify-items: start; min-height: 150px; }
.my-course.add:hover { border-color: var(--brand); color: var(--brand); }
.course-wrap { position: relative; display: grid; }
.course-wrap.has-pin .course { padding-bottom: 60px; }
.course-wrap .pin { position: absolute; left: 24px; bottom: 18px; }
.pin { font: 600 13.5px/1 var(--sans); padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--paper); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.pin:hover { border-color: var(--brand); color: var(--brand); }
.pin.on { background: var(--accent-soft); border-color: var(--accent-ink); color: var(--accent-ink); }
.head-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .resume { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 14px; }
  .resume > .btn { display: none; }
  .resume-play { width: 44px; height: 44px; }
  .resume-play::after { left: 17px; top: 13px; border-width: 9px 0 9px 14px; }
  .resume-txt b { font-size: 17px; white-space: normal; }
}
.topbar nav a, .me-credits, .me-chip { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar .wordmark { font-size: 0; gap: 0; }
  .topbar nav a { padding: 6px 9px; }
  .me-chip { padding: 4px; }
}
/* search, remove, exam countdown (1 Dec 2026) */
.search { width: 100%; max-width: 640px; margin: 22px 0 6px; padding: 13px 16px 13px 44px; font: 16px var(--sans); color: var(--ink);
  border: 1.5px solid var(--line-2); border-radius: 999px; outline: none;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236f6c87' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px 50%; }
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sub-row .sub { margin-bottom: 14px; }
.small-search { max-width: 300px; margin: 26px 0 0; padding-top: 9px; padding-bottom: 9px; font-size: 14.5px; }
#searchResults .muted.small { margin: 14px 0 10px; }
.search-hit { display: grid; gap: 6px; align-content: start; }
.hit-where { padding-left: 6px; }
.empty.left { text-align: left; justify-items: start; margin: 30px 0; padding: 0; }
.mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.exam-tag { flex: none; font: 600 12.5px/1 var(--sans); padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.exam-tag.soon { background: var(--brand-soft); color: var(--brand); }
.mc-remove { margin-left: auto; border: 0; background: none; padding: 0; font: 13.5px var(--sans); color: var(--ink-3); cursor: pointer; }
.mc-remove:hover { color: var(--bad); text-decoration: underline; }
.my-course { transition: opacity .18s ease, transform .18s ease; }
.my-course.leaving { opacity: 0; transform: scale(.97); }
.toast-act { pointer-events: auto; margin-left: 14px; border: 0; background: none; color: #ff9cbf; font: 600 14.5px var(--sans); cursor: pointer; padding: 0; }
.toast-act:hover { text-decoration: underline; }
.course-go { margin-top: 18px; max-width: 100%; white-space: normal; text-align: left; }
@media (max-width: 560px) { .small-search { max-width: none; margin-top: 0; } .mc-remove { margin-left: 0; } }
