/* NAF Psychiatry Prep — one calm screen: today's tasks. Everything else slides in on demand. */
:root {
  --bg: #061325;
  --surface: #0c1d33;
  --surface-2: #132842;
  --line: rgba(150, 195, 255, 0.13);
  --text: #eef5fc;
  --muted: #93a8c2;
  --faint: #5f7694;
  --accent: #6cb8ff;
  --accent-ink: #04182e;
  --good: #3fd087;
  --warn: #f0c46b;
  --bad: #ff8f86;
  --ui: "Outfit", "Segoe UI", system-ui, sans-serif;
  --read: "Newsreader", Georgia, serif;
  --r: 18px;
  --gutter-l: max(18px, env(safe-area-inset-left, 0px));
  --gutter-r: max(18px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 60% at 50% -10%, #123a66 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
img { max-width: 100%; display: block; }

.screen {
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 40px) var(--gutter-l);
  max-width: 640px;
  margin: 0 auto;
  animation: in .28s cubic-bezier(.2,.8,.2,1);
}
.screen.back { animation-name: in-back; }
@keyframes in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* ---------- Today ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; color: var(--muted); font-size: 14px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--surface); }

.hello { margin: 26px 0 6px; }
.hello .date { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.hello h1 { margin: 2px 0 0; font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.daynav { display: inline-flex; gap: 2px; margin-left: auto; }
.daynav button { width: 32px; height: 32px; border-radius: 50%; color: var(--faint); display: grid; place-items: center; }
.daynav button:active { background: var(--surface); }

.progress { display: flex; align-items: center; gap: 12px; margin: 18px 0 22px; color: var(--muted); font-size: 14px; }
.progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }

.tasks { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.task {
  width: 100%; text-align: left; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  transition: transform .12s ease, background .2s;
}
.task:active { transform: scale(.985); background: var(--surface-2); }
.task .kind { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.task .name { font-weight: 600; font-size: 17px; line-height: 1.25; }
.task .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.task .state { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.task.done { background: transparent; }
.task.done .name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.task.done .kind { background: rgba(63, 208, 135, .12); color: var(--good); }
/* Linear day: the next unfinished task. The tag sits on the border, so it adds no height. */
.task.now { position: relative; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.task.now::after { content: "Now"; position: absolute; top: -8px; right: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5; }
/* Beyond the day's time budget: still there, just optional. */
.task.extra { opacity: .6; }
/* Readiness tiles: on pace (green), slipping (amber), behind (red). */
.stats.ready { grid-template-columns: repeat(4, 1fr); }
.stats.ready .ok b { color: var(--good); }
.stats.ready .warn b { color: var(--warn); }
.stats.ready .bad b { color: var(--bad); }
.next-bar { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; text-align: left; font-size: 14px; color: var(--text); background: color-mix(in srgb, var(--good) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); }
.next-bar svg { flex: none; color: var(--good); }
.next-bar span { color: var(--muted); white-space: nowrap; }
.next-bar b { margin-left: auto; color: var(--good); text-align: right; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 4px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.stats b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.swap { width: 100%; text-align: left; color: var(--muted); font-size: 14px; padding: 16px 4px 0; }
.links { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.links .label { margin: 4px 0 0; }
.lnk { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 15px; line-height: 1.35; color: var(--text); }
.lnk span { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.lnk:active { background: var(--surface-2); }
/* In-text textbook link under a lecture section or point. */
.booklink { display: inline-flex; align-items: baseline; gap: 4px; max-width: 100%; margin: 2px 0 8px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--muted); font-size: 12.5px; text-align: left; line-height: 1.35; }
.booklink span { color: var(--accent); font-weight: 600; white-space: nowrap; }
.point .booklink { margin: 8px 0 0; }
.linkish.small { font-size: 13px; padding: 8px 0 0; text-align: left; }
.btn[disabled] { opacity: .4; }
.allclear { text-align: center; padding: 40px 10px 10px; color: var(--muted); }
.allclear b { display: block; color: var(--text); font-size: 20px; margin-bottom: 4px; }
.catchup { margin-top: 22px; width: 100%; color: var(--warn); font-size: 14px; text-align: left; padding: 12px 4px; }

/* One-screen Today: the dashboard shows ONE thing large, the next activity.
   The catch-up banner and today's plan stay small, the readiness tiles sit
   small at the bottom. Opening today's plan lets the screen scroll. */
.screen.today {
  display: flex; flex-direction: column;
  position: fixed; inset: 0; margin: 0 auto; min-height: 0; overflow: hidden;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
}
.screen.today:has(details.plan[open]) { overflow-y: auto; }
.screen.today > * { flex: none; }
.screen.today .hello { margin: 12px 0 0; }
.screen.today .hello h1 { font-size: 22px; font-weight: 600; color: var(--muted); }
.screen.today .catchup { margin: 10px 0 0; padding: 8px 12px; font-size: 13px; }
.screen.today .catchup b { display: inline; margin: 0 6px 0 0; font-size: 14px; }

.next-card { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 18px 0 0; padding: 22px 20px 18px; text-align: left; border-radius: 22px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); }
.next-card.optional { background: var(--surface); border-color: var(--line); }
.next-card.quiet { align-items: center; text-align: center; background: var(--surface); border-color: var(--line); }
.next-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.next-card.optional .next-label { color: var(--muted); }
.next-name { font-size: 30px; font-weight: 700; line-height: 1.15; }
.next-sub { font-size: 16px; line-height: 1.4; color: var(--muted); }
.next-go { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; padding: 15px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 18px; font-weight: 600; }
.next-card.optional .next-go { background: var(--surface-2); color: var(--text); }

.plan { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.plan summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.plan summary::-webkit-details-marker { display: none; }
.plan summary::after { content: "\25BE"; color: var(--muted); }
.plan[open] summary::after { content: "\25B4"; }
.plan-sum { flex: 1; text-align: right; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.plan-list { list-style: none; margin: 0; padding: 0 6px 6px; display: flex; flex-direction: column; gap: 2px; }
.plan-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 8px; border-radius: 10px; text-align: left; font-size: 14px; color: var(--text); }
.plan-row.now { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.plan-row.done { color: var(--muted); }
.plan-row.done .plan-name { text-decoration: line-through; }
.plan-row.extra { opacity: .6; }
.plan-n { display: flex; justify-content: center; font-size: 12px; color: var(--muted); }
.plan-n svg { width: 16px; height: 16px; color: var(--good); }
.plan-min { font-size: 12px; color: var(--muted); }
.plan .swap { padding: 4px 14px 12px; font-size: 13px; }

/* Readiness: small, at the very bottom. */
.screen.today .stats { margin: auto 0 0; padding-top: 14px; gap: 6px; }
.screen.today .stats div { padding: 5px 8px; border-radius: 10px; }
.screen.today .stats b { font-size: 14px; }
.screen.today .stats span { font-size: 10.5px; margin-top: 0; }
@media (max-height: 760px) {
  .screen.today { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .screen.today .hello { margin-top: 6px; }
  .screen.today .hello h1 { font-size: 19px; }
  .next-card { margin-top: 12px; padding: 16px 16px 14px; gap: 8px; }
  .next-name { font-size: 26px; }
  .next-sub { font-size: 15px; }
  .next-go { padding: 12px; }
  .plan { margin-top: 10px; }
}

/* ---------- Task screens ---------- */
.bar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 15px; padding: 8px 8px 8px 0; }
.bar-top .count { margin-left: auto; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 4px; margin: 0 0 16px; }
.dots i { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-2); }
.dots i.on { background: var(--accent); }
.dots i.good { background: var(--good); }
.dots i.again { background: var(--bad); }

h2.title { font-size: 26px; line-height: 1.15; margin: 0 0 6px; font-weight: 600; text-wrap: balance; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.slide { width: 100%; aspect-ratio: 1100 / 620; border-radius: 12px; background-color: #fff; background-repeat: no-repeat; margin-bottom: 8px; }
.slides { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin: 6px 0 10px; }
.v-ok { background: rgba(63,208,135,.14); color: var(--good); }
.v-add { background: rgba(240,196,107,.14); color: var(--warn); }
.v-fix { background: rgba(255,143,134,.14); color: var(--bad); }
.v-blank { background: rgba(108,184,255,.16); color: var(--accent); }

.read { font-family: var(--read); font-size: 17px; line-height: 1.6; max-width: 66ch; }
.read p { margin: .6em 0; }
.read ul { margin: .3em 0 .7em; padding-left: 1.2em; }
.read li { margin: .2em 0; }
.read strong { font-weight: 600; color: #fff; }
.label { font-family: var(--ui); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 18px 0 6px; }

.actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 0 calc(env(safe-area-inset-bottom, 0px) + 8px); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 18px; }
.btn { flex: 1; height: 52px; border-radius: 14px; font-weight: 600; font-size: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.good { color: var(--good); }
.btn.again { color: var(--bad); }
.btn:active { transform: scale(.98); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 6px 0 16px; }
.seg button { height: 40px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.toc { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.toc button { text-align: left; padding: 7px 0; color: var(--accent); font-size: 15px; }
.lsec { scroll-margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 18px; }
.lsec h3 { font-size: 20px; line-height: 1.25; margin: 10px 0 4px; font-weight: 600; text-wrap: balance; }
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; scroll-margin-top: 20px; }
.point.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,184,255,.18); }
.point .read { font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags span { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted); }
.empty b { color: var(--text); }
.file { font-family: var(--ui); font-size: 14px; color: var(--accent); word-break: break-word; }

.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opt { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 16px; }
.opt .k { color: var(--faint); font-weight: 600; }
.opt.right { border-color: var(--good); background: rgba(63,208,135,.10); }
.opt.wrong { border-color: var(--bad); background: rgba(255,143,134,.10); }
.opt[disabled] { cursor: default; }
.tfrow { grid-template-columns: 26px 1fr auto; align-items: center; }
.tfbs { display: flex; gap: 6px; }
.tfb { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--faint); }
.tfb.on { border-color: var(--accent, var(--good)); color: inherit; background: rgba(90,160,255,.14); }
.tfb[disabled] { cursor: default; }
.tfa { font-size: 13px; margin-left: 6px; color: var(--faint); }
.linkish { color: var(--accent); font-weight: 600; font-size: 15px; padding: 10px 0; }

.station { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.station .n { font-weight: 600; }
.station .s { color: var(--muted); font-size: 14px; }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; color: transparent; }
.tick.on { border-color: var(--good); background: var(--good); color: var(--accent-ink); }

/* ---------- Sheet (hidden menu) ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(5,3,10,.6); display: flex; align-items: flex-end; z-index: 10; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 640px; margin: 0 auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 18px) var(--gutter-l); max-height: 82vh; overflow: auto; animation: up .26s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--faint); margin: 4px auto 14px; }
.sheet h3 { margin: 6px 0 10px; font-size: 18px; }
.row { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); text-align: left; }
.row .r { color: var(--faint); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row.today .l { color: var(--accent); }

/* MCQ section label + shuffle */
.mcqbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mcqbar .meta { margin: 0; }
.shuf { flex: none; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; min-height: 32px; cursor: pointer; }
/* Clocks */
.clockbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; color: var(--text); }
.clock::before { content: "⏱ "; font-weight: 400; }
.clock.dim { color: var(--muted); font-weight: 500; font-size: 13px; }
.clock.dim::before, .clock.done::before { content: ""; }
.clock.done { color: var(--muted); font-weight: 500; }
.clock.big { font-size: 26px; }
.clock.warn { color: var(--warn); }
.clock.over { color: var(--bad); }

/* Catch-up banner (top of Today) */
.catchup { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin: 0 0 14px; padding: 14px 16px; border-radius: 14px; text-align: left; font-size: 14px; color: var(--text); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.catchup b { display: block; color: var(--warn); font-size: 15px; margin-bottom: 2px; }
.catchup svg { flex: none; color: var(--warn); }

/* OSCE station player */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 6px 0 10px; }
.card.crit { border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--text); }
.card.crit b { display: block; color: var(--bad); margin-bottom: 4px; }
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.fold > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 20px; }
.fold[open] > summary::after { content: "–"; }
.fold-body { padding: 0 16px 16px; }
.pn { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--surface-2); color: var(--accent); }
.say { font-family: var(--read); font-size: 17px; line-height: 1.55; }
.chk { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; }
.chk b { display: block; color: var(--good); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.45; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); min-width: 120px; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface); }
.tbl tr:last-child td { border-bottom: 0; }
.shuf.mute { padding: 4px 10px; font-size: 15px; }
.clockbar .clock.dim { margin-left: auto; }

/* OSCE memory ladder */
.ladder { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.ladder span { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--faint); }
.ladder span.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.ladder span.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.place { flex: none; font-size: 16px; line-height: 1; }
.place.big { font-size: 30px; }
.prow { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.prow b { display: block; }
.prow small { color: var(--muted); font-size: 13px; }
.cue { display: flex; gap: 14px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 4px 0 12px; }
.cue small { display: block; color: var(--accent); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.cue b { font-size: 20px; line-height: 1.25; }

/* ---------- Library ---------- */
.book-page { background: #fff; border-radius: 6px; overflow-x: auto; min-height: 200px; }
.book-page .empty { background: var(--surface); border-radius: 6px; }
.book-page canvas { display: block; }

/* ---------- Memory palace ---------- */
.pal-spot { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 4px 0 10px; }
.pal-spot b { font-size: 18px; line-height: 1.3; }
.pal-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.pal-item b { display: block; font-size: 19px; line-height: 1.3; }
.pal-item .chk { margin-top: 8px; }
.pal-scene { display: flex; gap: 12px; align-items: flex-start; }
.pal-scene .read { font-size: 16px; }
.pal-spots { margin: 0 0 8px; padding-left: 1.8em; }
.pal-spots li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.pal-spots .place { margin-right: 8px; }
.pal-q { font-size: 22px; margin: 18px 0 12px; }
.pal-q b { color: var(--accent); font-size: 34px; }
.card.mn b { display: block; font-size: 20px; letter-spacing: .04em; color: var(--accent); margin-bottom: 4px; word-break: break-word; }
.phase-read { border-left: 2px solid var(--line); padding: 4px 0 14px 14px; margin: 10px 0 6px; }
.ph { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 6px 0; }
.mrow { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.mrow b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.mrow.on { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.mrow.crit b { color: var(--bad); }
.palace-strip { text-align: center; font-size: 26px; letter-spacing: 4px; margin: 18px 0; }
/* MCQ finish score */
.score { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 16px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.score-big b { display: block; font-size: 52px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-big b small { font-size: 24px; color: var(--muted); font-weight: 500; }
.score-big span { display: block; margin-top: 6px; color: var(--muted); }
.score-ring { flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.score-ring span { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 700; font-size: 18px; }
.score-cells { grid-template-columns: repeat(5, 1fr); }
.score-cells b { font-size: 18px; }
.score-cells .ok b { color: var(--good); }
.score-cells .bad b { color: var(--bad); }
.score-cells .warn b { color: var(--warn); }
.lastscore { color: var(--accent); font-weight: 600; }
/* Learn it, teach it */
.tb-text { width: 100%; box-sizing: border-box; margin: 8px 0 6px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 16px/1.5 var(--read); resize: vertical; }
.tb-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tb-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.chips .chip { font-size: 13px; padding: 5px 10px; margin: 0; border-radius: 999px; border: 1px solid var(--line); background: transparent; }
.chips .chip.hit { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.chips .chip.miss { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
strong.miss { background: color-mix(in srgb, var(--bad) 28%, transparent); color: var(--text); border-radius: 4px; padding: 0 3px; }
.chips .chip { text-transform: none; letter-spacing: 0; font-weight: 500; }

.screen.still { animation: none; }

/* Share a test */
.field { width: 100%; box-sizing: border-box; padding: 13px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 16px var(--ui); margin: 4px 0 10px; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.flabel { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 14px 0 2px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { display: grid; gap: 6px; margin: 4px 0 6px; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.check small { color: var(--muted); margin-left: 4px; }
.test-row .tr-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); flex: none; }
.pill.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.tr-link { font-size: 13px; color: var(--accent); word-break: break-all; margin-bottom: 10px; }
.tr-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.switch { margin-left: auto; width: 52px; height: 30px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--faint); transition: transform .2s, background .2s; }
.switch.on { background: color-mix(in srgb, var(--good) 35%, var(--surface-2)); }
.switch.on i { transform: translateX(22px); background: var(--good); }
.res-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.res-row:first-child { border-top: 0; }
.res-row b { color: var(--accent); letter-spacing: .08em; grid-row: span 2; align-self: center; }
.res-row small { color: var(--faint); }
/* Simple English tab */
.seg.three { grid-template-columns: 1fr 1fr 1fr; }
.seg.three button { font-size: 13.5px; padding: 0 4px; }
.lsec.simple .read { font-size: 17px; }

/* Pocket clerking guide — tick rows with inline bold and an exam-wording line */
.ckrow { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 6px; color: var(--text); font-size: 15px; line-height: 1.45; }
.ckrow.on { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.ckrow .tick { width: 26px; height: 26px; }
.ckrow p { margin: 0; }
.ckrow .sayline { display: block; margin-top: 6px; color: var(--muted); font-style: italic; font-size: 14px; }
.ckhead { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; }
.ckhead h3 { margin: 0; }
.ckhead span { color: var(--faint); font-size: 13px; }

/* Topic tabs: four across */
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { font-size: 13px; padding: 0 2px; }

/* Study time and master reset — compact so the sheet fits one screen */
.row.tight { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
.mr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mr-btn { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.mr-btn b { font-size: 15px; color: var(--text); }
.mr-btn span { font-size: 12.5px; color: var(--faint); }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 10px 0 4px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.bad i { border-color: var(--bad); }
.pin-msg { text-align: center; color: var(--bad); min-height: 20px; margin: 0 0 6px; font-size: 14px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-k { height: 58px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 24px; font-weight: 600; color: var(--text); }
.pin-k.small { font-size: 15px; color: var(--muted); }
.pin-k:active { background: var(--surface-2); }

/* Layered speed run */
.ly-card { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 14px; padding: 12px 14px; margin: 4px 0 10px; color: var(--text); }
.ly-card b { display: block; font-size: 15px; }
.ly-card small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.lyl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 12px; }
.lyl button { font-size: 12px; padding: 7px 4px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); line-height: 1.25; }
.lyl button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.lyl button.done:not(.on) { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.lyl button[disabled] { opacity: .55; }
.lsec.ly h3 { margin-bottom: 6px; }
.ly-s { margin: 0; padding-left: 18px; font-family: var(--read); font-size: 17px; line-height: 1.55; }
.ly-s li { margin: 4px 0; }
.ly-s li.new { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 6px; padding: 2px 6px; margin-left: -6px; }

/* Feynman activator */
.fy-row { display: flex; justify-content: center; gap: 22px; margin-top: 8px; }

/* accountability */
.ac-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; margin-top: 6px; }
.ac-row .field { padding: 10px 11px; }
.ac-msg { margin: 8px 0 0; padding: 9px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.ac-steps { padding-left: 1.2em; margin: 8px 0; line-height: 1.5; font-size: 15px; }
.ac-steps li { margin: .35em 0; }
/* glossary */
.ly-card.gl { margin-top: 8px; }
.gl-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.gl-item b { display: block; font-size: 16px; margin-bottom: 2px; }
.gl-item span { display: block; color: var(--muted); font-size: 15px; line-height: 1.5; }
.gl-item span p { margin: 0; }
.gl-term { font-size: 26px; font-weight: 700; margin: 6px 0 10px; line-height: 1.2; }
/* Search everything */
.top-btns { display: flex; gap: 2px; }
.search-box { position: sticky; top: 0; z-index: 3; width: 100%; margin: 4px 0 8px; font-size: 17px; box-shadow: 0 8px 14px -6px var(--bg); }
.chips.sfilter .chip { cursor: pointer; color: var(--muted); }
.chips.sfilter .chip.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sres { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin: 6px 0; }
.sres > summary { list-style: none; cursor: pointer; }
.sres > summary::-webkit-details-marker { display: none; }
.sres[open] > summary { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sres-h { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.sres-t { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 3px; }
.sres mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; }
.sres-opts { margin: 6px 0 10px; padding-left: 22px; font-size: 15px; line-height: 1.45; }
.sres-opts li { margin: 3px 0; color: var(--muted); }
.sres-opts li.right { color: var(--good); font-weight: 600; }
.screen mark { background: color-mix(in srgb, var(--accent) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Group session handouts */
.gs-pill { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.gs-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: gs-blink 1.6s ease-in-out infinite; }
@keyframes gs-blink { 50% { opacity: .35; } }
.hitem .hhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.hitem textarea.hans { width: 100%; min-height: 3em; resize: vertical; font: 15px/1.45 var(--ui); }
.hthumb .slide { max-width: 260px; }
.hcheck { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 14px; color: var(--muted); }
#hTitle { width: 100%; font-weight: 600; margin-bottom: 6px; }

/* NAF Psychiatry Prep: Air Force blue, with the Nigerian green-white-green as a thin stripe. */
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; background: linear-gradient(90deg, #2fbf71 0 33.3%, #ffffff 33.3% 66.6%, #2fbf71 66.6%); opacity: .9; }
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-top: 1px; }
.brand-note { font-size: 12px; line-height: 1.45; color: var(--faint); margin: 14px 2px 4px; }
