/* StepMark app. Layout: one phone-width column (max 440px), sticky app bar, scrolling screen, fixed bottom tab bar.
   Identity: board-exam ink navy + "tick" green for marks earned + marigold for countdown/streaks. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --ink: #0f2a44;
  --ink-2: #3c5068;
  --muted: #6b7c90;
  --line: #dde4ec;
  --brand: #0f2a44;
  --tick: #128a5c;
  --tick-soft: #ddf3ea;
  --marigold: #e89b0c;
  --marigold-soft: #fdf0d6;
  --cross: #c4342b;
  --cross-soft: #fbe5e3;
  --sci: #2f6fd6;
  --sci-soft: #e2ecfb;
  --math: #7a4fd0;
  --math-soft: #ece4fb;
  --shadow: 0 1px 2px rgba(15, 42, 68, .06), 0 4px 14px rgba(15, 42, 68, .06);
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1622; --surface: #13212f; --surface-2: #1a2b3c; --ink: #e8eef5; --ink-2: #b8c6d6; --muted: #8ea0b4;
    --line: #243649; --brand: #0b1622; --tick: #3fcf94; --tick-soft: #143a2c; --marigold: #f5b93a; --marigold-soft: #3a2c10;
    --cross: #ff8177; --cross-soft: #3d1c1a; --sci: #7aa7f5; --sci-soft: #1a2c4a; --math: #b597f5; --math-soft: #2a2145;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--tick); outline-offset: 2px; border-radius: 8px; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* device frame: a phone column on desktop, full screen on phones */
.device { max-width: 440px; margin: 0 auto; min-height: 100%; background: var(--bg); position: relative;
  display: flex; flex-direction: column; }
@media (min-width: 600px) {
  body { background: var(--surface-2); padding: 24px 0; }
  .device { min-height: calc(100vh - 48px); border-radius: 28px; overflow: hidden; box-shadow: 0 10px 40px rgba(15,42,68,.18); }
}

/* app bar */
.appbar { position: sticky; top: 0; z-index: 5; background: var(--brand); color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 10px; min-height: 56px; }
.appbar .title { font-family: var(--font-display); font-weight: 700; font-size: 17px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .back { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: #fff; }
.appbar .back:hover { background: rgba(255,255,255,.12); }
.brandmark { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 18px; flex: 1; }
.brandmark .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--tick); display: grid; place-items: center; }
.chip-sample { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; }

/* screen */
.screen { flex: 1; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 16px; outline: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.link { color: var(--tick); font-weight: 600; font-size: 14px; }

/* cards */
.card { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.card.tap { display: block; width: 100%; text-align: left; transition: transform .12s ease; }
.card.tap:active { transform: scale(.99); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.grow { flex: 1; min-width: 0; }

/* countdown hero */
.countdown { background: var(--brand); color: #fff; border-radius: 20px; padding: 16px; display: grid; gap: 12px; }
.countdown .days { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--marigold); }
.countdown .sub { color: #c7d4e2; font-size: 13px; }
.exams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exam-pill { background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 10px; }
.exam-pill b { display: block; font-size: 14px; }
.exam-pill span { font-size: 12px; color: #c7d4e2; }

/* plan list */
.task { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); width: 100%; text-align: left; }
.task .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none; }
.task.done { opacity: .55; }
.task.done .t-title { text-decoration: line-through; }
.check { width: 24px; height: 24px; border-radius: 99px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 13px; color: #fff; }
.task.done .check { background: var(--tick); border-color: var(--tick); }

.ico.math { background: var(--math-soft); color: var(--math); }
.ico.sci { background: var(--sci-soft); color: var(--sci); }
.ico.tick { background: var(--tick-soft); color: var(--tick); }
.ico.mari { background: var(--marigold-soft); color: var(--marigold); }
.ico.cross { background: var(--cross-soft); color: var(--cross); }

/* tags & pills */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.tag.tick { background: var(--tick-soft); color: var(--tick); }
.tag.mari { background: var(--marigold-soft); color: #9a6300; }
@media (prefers-color-scheme: dark) { .tag.mari { color: var(--marigold); } }
.tag.cross { background: var(--cross-soft); color: var(--cross); }
.tag.plain { background: var(--surface-2); color: var(--ink-2); }
.tag.math { background: var(--math-soft); color: var(--math); }
.tag.sci { background: var(--sci-soft); color: var(--sci); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* segmented control */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg button { padding: 8px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* chapter rows */
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c, var(--tick)) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--tick); }
.unit-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }

/* lesson cards */
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.lesson { scroll-snap-align: start; flex: none; width: 150px; text-align: left; }
.thumb { aspect-ratio: 9 / 14; border-radius: 14px; background: linear-gradient(160deg, var(--brand), #1f4b75); color: #fff; position: relative; overflow: hidden;
  padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; max-width: 100%; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; opacity: .9; }
.thumb b { font-family: var(--font-display); font-size: 14px; line-height: 1.2; position: relative; }
.thumb .dur { position: absolute; top: 8px; right: 8px; font-size: 11px; background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 6px; }
.thumb .seen { position: absolute; top: 8px; left: 8px; font-size: 11px; background: var(--tick); padding: 2px 6px; border-radius: 6px; }

/* topics */
.topic-no { flex: none; min-width: 44px; height: 32px; padding: 0 8px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2);
  font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.chev { color: var(--muted); font-size: 22px; align-self: center; }
.keypoints { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.keypoints li { position: relative; padding-left: 28px; }
.keypoints li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 99px;
  background: var(--tick-soft); color: var(--tick); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.formulas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.formula { background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card.tap.video-row { display: flex; align-items: center; gap: 12px; }
.mini-thumb { width: 64px; height: 96px; flex: none; border-radius: 12px; background: linear-gradient(160deg, var(--brand), #1f4b75); color: #fff;
  display: grid; place-items: center; font-size: 22px; }
.topic-nav { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.topic-nav .btn { padding: 11px 8px; font-size: 14px; }
.scope { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: var(--surface);
  border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.scope a { font-size: 16px; padding: 2px 6px; }

/* practice sources */
.src-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.src-tabs::-webkit-scrollbar { display: none; }
.src-tabs .filter { display: inline-flex; align-items: center; gap: 6px; }
.src-tabs .filter .muted-on { font-size: 12px; opacity: .65; }
.src-list { display: grid; gap: 8px; }
.src-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.src-row .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none; }
.src-row b { display: block; }
.src-row .tiny { display: block; }
.src-row.empty-src { opacity: .55; }
.tag.sci, .tag.tick, .tag.mari { white-space: nowrap; }

/* question */
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; }
.qtext { font-size: 17px; line-height: 1.5; font-weight: 500; }
.figure { background: var(--surface-2); border-radius: 12px; padding: 10px; display: grid; place-items: center; }
.figure svg { width: 100%; max-width: 280px; height: auto; }
.figure svg text { fill: var(--ink); font-family: var(--font-body); font-size: 13px; }
.figure svg .stroke { stroke: var(--ink); fill: none; stroke-width: 2; }
.answer-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: center; font-weight: 600; font-size: 13px; }
.mode .e { display: block; font-size: 20px; margin-bottom: 2px; }
.mode[aria-pressed="true"] { border-color: var(--tick); background: var(--tick-soft); color: var(--tick); }
textarea { width: 100%; min-height: 140px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 12px; font: inherit; resize: vertical; }
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 22px 12px; text-align: center; background: var(--surface); }
.dropzone.has { border-style: solid; border-color: var(--tick); background: var(--tick-soft); }
.mic { width: 72px; height: 72px; border-radius: 50%; background: var(--cross); color: #fff; font-size: 28px; display: grid; place-items: center; margin: 6px auto; }
.mic.on { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(196,52,43,.5); } 70% { box-shadow: 0 0 0 16px rgba(196,52,43,0); } 100% { box-shadow: 0 0 0 0 rgba(196,52,43,0); } }
.hint { background: var(--marigold-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.hint b { color: #9a6300; }
@media (prefers-color-scheme: dark) { .hint b { color: var(--marigold); } }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { padding: 13px 14px; border-radius: 14px; font-weight: 700; text-align: center; display: block; width: 100%; }
.btn.primary { background: var(--tick); color: #fff; }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.dark { background: var(--ink); color: var(--surface); }

/* result */
.score { display: flex; align-items: center; gap: 16px; }
.score .big { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: none; }
.step .mk { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; }
.mk.full { background: var(--tick); } .mk.half { background: var(--marigold); } .mk.zero { background: var(--cross); }
.step .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.compare { display: grid; grid-template-columns: 1fr; gap: 10px; }
.box { border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.box.mine { background: var(--surface-2); }
.box.official { background: var(--tick-soft); }
.box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; color: var(--muted); font-family: var(--font-body); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 12px; border-radius: 16px; font-size: 15px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--surface); border-bottom-right-radius: 4px; }
.msg.tutor { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.msg .cite { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.composer { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; background: var(--bg); padding-top: 6px; }
.composer input { flex: 1; min-width: 0; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 12px 16px; font: inherit; }
.composer button { width: 46px; height: 46px; border-radius: 99px; background: var(--tick); color: #fff; font-size: 18px; flex: none; }
.suggest { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button { flex: none; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }

/* me */
.predict { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.predict .card b { font-family: var(--font-display); font-size: 28px; }
.wa { background: #e7f8ef; border-radius: 14px; padding: 12px; color: #0d3b26; font-size: 14px; }
@media (prefers-color-scheme: dark) { .wa { background: #12342a; color: #d5f2e4; } }
.wa .bubble { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-line; }
@media (prefers-color-scheme: dark) { .wa .bubble { background: #1b4a3a; } }

/* tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; z-index: 6;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
@media (min-width: 600px) { .tabbar { bottom: 24px; border-radius: 0 0 28px 28px; } }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 12px; }
.tabbar a .ti { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] .ti { filter: none; opacity: 1; }
.tabbar a[aria-current="page"]::after { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--tick); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--surface);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 9; max-width: 90%; }
.empty { text-align: center; padding: 24px 8px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* test yourself */
.tbig { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; flex: none; font-weight: 800; }
.card.tap.test-card { display: flex; align-items: center; gap: 12px; }
.tc-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.resume { border: 2px solid var(--marigold); }
.timer { background: rgba(255,255,255,.14); padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.timer.low { background: var(--cross); }
.navq { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.navq::-webkit-scrollbar { display: none; }
.nq { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.nq.done { background: var(--tick-soft); color: var(--tick); border-color: var(--tick-soft); }
.nq.cur { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: left; }
.chip[aria-pressed="true"] { background: var(--tick-soft); color: var(--tick); border-color: var(--tick); }
.chip:disabled { opacity: .45; cursor: default; }
.btn:disabled { opacity: .45; cursor: default; }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(8, 20, 33, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: var(--surface); width: 100%; max-width: 440px; border-radius: 22px 22px 0 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 12px; }
.table-wrap { overflow-x: auto; }
table.bp { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bp th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; }
table.bp td { padding: 8px 4px; border-top: 1px solid var(--line); }
table.bp .r { text-align: right; white-space: nowrap; }
table.bp tr.tot td { font-weight: 800; }
details.card summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.card summary::-webkit-details-marker { display: none; }
details.card .sum-text { flex-basis: 100%; font-weight: 500; font-size: 14px; }
.tabbar a { white-space: nowrap; }

/* practice PYQs */
.tag.dark { background: var(--ink); color: var(--surface); }
.ico.year { font-family: var(--font-display); font-size: 17px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; background: var(--surface); padding: 10px 12px; border-radius: 12px; box-shadow: var(--shadow); }
.switch-row input { width: 20px; height: 20px; accent-color: var(--tick); }
.year-head { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.pyq-card .qbody { display: grid; gap: 4px; font-size: 15.5px; line-height: 1.5; }
.pyq-card .or, .ans-steps .or { font-weight: 800; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .08em; margin: 2px 0; }
.opts { display: grid; gap: 6px; }
.opt { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.opt.correct { background: var(--tick-soft); color: var(--tick); box-shadow: inset 0 0 0 2px var(--tick); font-weight: 600; }
.opt.correct::after { content: "  ✓"; }
.pyq-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small-btn { width: auto; padding: 8px 12px; font-size: 13.5px; border-radius: 10px; }
.small-btn.on { background: var(--tick); color: #fff; border-color: var(--tick); }
.ans-box { background: var(--tick-soft); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.ans-final { font-weight: 700; color: var(--tick); }
.ans-steps { display: grid; gap: 3px; font-size: 14.5px; }
.paper-img { display: grid; gap: 8px; }
.paper-img img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.qcrop { width: 100%; height: auto; display: block; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 6px; }
@media (prefers-color-scheme: dark) { .qcrop { border-color: #2a3b4e; } }
.qcrop-wrap { overflow-x: auto; border-radius: 10px; }
.qcrop { cursor: zoom-in; }
.qcrop-wrap.zoomed .qcrop { width: 175%; max-width: none; cursor: zoom-out; }

/* answering PYQs */
.score-card { display: grid; gap: 6px; }
.score-line { font-family: var(--font-display); font-size: 20px; }
.tiny-opt { font-size: 13px; padding: 6px 10px; }
.pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-btn { min-width: 44px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink); }
.pick-btn:hover { border-color: var(--tick); }
.pick-btn.ok { background: var(--tick); border-color: var(--tick); color: #fff; }
.pick-btn.bad { background: var(--cross); border-color: var(--cross); color: #fff; }
.pick-btn.mid { border-color: var(--marigold); }
.answer-open { width: 100%; }
.answer-panel { display: grid; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 10px; }
.seg3 { grid-template-columns: 1fr 1fr 1fr; }
.answer-panel textarea { min-height: 120px; }
.btn.rec { background: var(--cross); color: #fff; border-color: var(--cross); }
.verdict { display: grid; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.verdict-line { font-weight: 700; font-size: 16px; }
.verdict-line.good { color: var(--tick); } .verdict-line.mid { color: #9a6300; } .verdict-line.bad { color: var(--cross); }
@media (prefers-color-scheme: dark) { .verdict-line.mid { color: var(--marigold); } }
.self-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.self-row .pick-btn { height: 36px; font-size: 13px; }

/* ================= student-friendly redesign: Home + Learn ================= */
:root {
  --g-hero: linear-gradient(140deg, #0a298a 0%, #0670e8 55%, #38bdf8 120%);
  --g-math: linear-gradient(135deg, #3b9bff 0%, #1d4fd8 100%);
  --g-sci: linear-gradient(135deg, #10b9a6 0%, #0ea5e9 100%);
  --g-sst: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --g-eng: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  --g-dpp: linear-gradient(120deg, #ff8a3d 0%, #f43f5e 60%, #d946ef 120%);
  --violet: #0585fe;
}
.g-math { background: var(--g-math); } .g-sci { background: var(--g-sci); }
.g-sst { background: var(--g-sst); } .g-eng { background: var(--g-eng); }
.appbar[hidden] { display: none !important; }

/* hero */
.hero { background: var(--g-hero); color: #fff; border-radius: 26px; padding: 18px 18px 16px; margin: -4px 0 0; box-shadow: 0 10px 30px rgba(10, 41, 138, .28); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.brandmark.light { color: #fff; font-size: 16px; }
.brandmark.light .logo { background: rgba(255,255,255,.22); }
.hello { opacity: .85; font-size: 14px; }
.hero h1 { color: #fff; font-size: 28px; margin-top: 2px; }
.hero-sub { opacity: .85; font-size: 13px; margin-top: 2px; }
.avatar { width: 52px; height: 52px; border-radius: 18px; background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.45); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; color: #fff; flex: none; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.hstat { background: rgba(255,255,255,.14); border-radius: 14px; padding: 8px 10px; display: grid; gap: 1px; }
.hstat b { font-family: var(--font-display); font-size: 18px; }
.hstat span { font-size: 11px; opacity: .85; }

/* subject tiles */
.subj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subj-tile { border-radius: 20px; padding: 14px; color: #fff; display: grid; gap: 4px; min-height: 150px; align-content: start; box-shadow: 0 6px 18px rgba(15,42,68,.12); position: relative; overflow: hidden; transition: transform .12s ease; }
.subj-tile:active { transform: scale(.98); }
.subj-tile::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.12); }
.subj-tile.soon { filter: saturate(.55); opacity: .75; }
.st-icon { font-size: 28px; }
.subj-tile b { font-family: var(--font-display); font-size: 17px; }
.st-next { font-size: 12px; opacity: .9; line-height: 1.3; }
.st-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 6px; display: block; }
.st-bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.st-pct { font-size: 11px; opacity: .9; }

/* daily practice */
.dpp-card { display: grid; gap: 12px; background: var(--g-dpp); color: #fff; border-radius: 22px; padding: 16px; box-shadow: 0 10px 26px rgba(244, 63, 94, .28); }
.dpp-top { display: flex; justify-content: space-between; gap: 10px; }
.dpp-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; opacity: .9; }
.dpp-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-top: 2px; }
.dpp-sub { font-size: 12.5px; opacity: .9; margin-top: 2px; }
.dpp-emoji { font-size: 34px; }
.dpp-dots { display: flex; gap: 8px; }
.dpp-dots .dot { flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.3); }
.dpp-dots .dot.ok { background: #fff; } .dpp-dots .dot.bad { background: rgba(255,255,255,.6); outline: 2px solid rgba(0,0,0,.15); }
.dpp-btn { justify-self: start; background: #fff; color: #e11d48; font-weight: 800; padding: 9px 16px; border-radius: 12px; font-size: 14px; }

/* continue learning */
.continue-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.cc-thumb { width: 74px; height: 74px; border-radius: 16px; color: #fff; display: grid; place-items: center; font-size: 24px; flex: none; }
.cc-kicker { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.continue-card b { display: block; font-family: var(--font-display); font-size: 15.5px; margin-top: 2px; }
.continue-card .bar { display: block; }

/* quick actions */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { border-radius: 18px; padding: 12px; display: grid; gap: 2px; background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--violet); }
.quick span { font-size: 22px; }
.quick b { font-family: var(--font-display); font-size: 15px; }
.quick small { color: var(--muted); font-size: 12px; }
.q-ai { border-left-color: #3b9bff; } .q-test { border-left-color: #f43f5e; } .q-mis { border-left-color: #f59e0b; } .q-par { border-left-color: #10b9a6; }

/* learn: subject cards */
.subj-card { display: flex; align-items: center; gap: 14px; color: #fff; border-radius: 22px; padding: 16px; box-shadow: 0 8px 22px rgba(15,42,68,.14); position: relative; overflow: hidden; }
.subj-card.soon { filter: saturate(.5); opacity: .72; }
.subj-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.1); }
.sc-icon { font-size: 34px; width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.subj-card b { font-family: var(--font-display); font-size: 19px; display: block; }
.sc-meta, .sc-next { display: block; font-size: 12.5px; opacity: .9; }
.sc-next { margin-top: 6px; }
.sc-arrow { font-size: 26px; opacity: .8; z-index: 1; }

/* bands (subject / chapter / topic headers) */
.band { color: #fff; border-radius: 22px; padding: 16px; display: grid; gap: 6px; box-shadow: 0 8px 22px rgba(15,42,68,.14); }
.band h1 { color: #fff; font-size: 24px; }
.band-row { display: flex; align-items: center; gap: 12px; }
.band-icon { font-size: 30px; width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.band-kicker { font-size: 11px; font-weight: 800; letter-spacing: .1em; opacity: .85; color: #fff; }
.band-sub { font-size: 13px; opacity: .9; }
.band-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.band-chips span { background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.ring.light { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.25) 0); width: 58px; height: 58px; }
.ring.light span { background: transparent; color: #fff; width: 46px; height: 46px; font-size: 13px; box-shadow: inset 0 0 0 100px rgba(0,0,0,.12); }

/* chapter list */
.chap-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.chap-no { width: 46px; height: 46px; border-radius: 14px; color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; flex: none; }
.chap-card b, .tl-card b { display: block; font-size: 15.5px; font-family: var(--font-display); }
.chap-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.pill { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.pill.ready { background: #e3f1ff; color: #0670e8; }
@media (prefers-color-scheme: dark) { .pill.ready { background: #0b2a5e; color: #9fd8ff; } }
.chap-card .bar, .tl-card .bar { display: block; }

/* topic timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 20px; bottom: 20px; width: 2px; background: var(--line); }
.tl-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); position: relative; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; margin-left: -2px; box-shadow: 0 0 0 4px var(--bg); }
.tl-dot.done { background: var(--tick); }
.tl-kicker { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.soon-card { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 24px 16px; }

/* topic page */
.jump { display: flex; gap: 8px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 56px); z-index: 4; background: var(--bg); padding: 6px 0; overflow-x: auto; scrollbar-width: none; }
.jump a { flex: none; padding: 8px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
.sec-title { font-size: 19px; }
.explain { display: grid; gap: 8px; }
.ex-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); }
.tip-card { display: flex; gap: 10px; background: linear-gradient(135deg, #fff7e6, #ffeccc); border-radius: 16px; padding: 12px 14px; color: #6b4300; }
.tip-card span { font-size: 22px; }
@media (prefers-color-scheme: dark) { .tip-card { background: #3a2c10; color: #f6d79b; } }
.vid-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); }
.vid-thumb { width: 112px; height: 70px; border-radius: 12px; position: relative; flex: none; color: #fff; display: grid; place-items: center; overflow: hidden; }
.vt-play { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95); color: #0a298a; display: grid; place-items: center; font-size: 13px; padding-left: 2px; }
.vt-play.big { width: 64px; height: 64px; font-size: 24px; }
.vt-dur { position: absolute; right: 6px; bottom: 5px; font-size: 10.5px; background: rgba(0,0,0,.45); padding: 1px 5px; border-radius: 6px; }
.vt-seen { position: absolute; left: 6px; top: 5px; font-size: 10px; background: var(--tick); padding: 1px 5px; border-radius: 6px; }
.vid-kind { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--violet); }
.vid-kind.light { color: #fff; opacity: .9; }
.vid-row b { display: block; font-size: 14.5px; }
.player { aspect-ratio: 9 / 14; max-height: 62vh; width: 100%; border-radius: 22px; color: #fff; display: grid; place-items: center; position: relative; overflow: hidden; }
.player-cap { position: absolute; left: 14px; right: 14px; bottom: 14px; }
.player-cap b { font-family: var(--font-display); font-size: 18px; display: block; }
.fab { position: fixed; z-index: 7; right: max(16px, calc(50% - 204px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(135deg, #3b9bff, #38bdf8); color: #fff; font-weight: 800; padding: 13px 18px; border-radius: 99px; box-shadow: 0 10px 24px rgba(5, 112, 232, .4); }

/* daily practice screen */
.dpp-progress { display: flex; gap: 6px; }
.seg-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); }
.seg-bar.cur { background: #fdba74; } .seg-bar.ok { background: var(--tick); } .seg-bar.bad { background: var(--cross); }
.big-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.big-pick { height: 58px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink); border: 2px solid transparent; }
.big-pick:hover:not(:disabled) { border-color: var(--violet); }
.big-pick.ok { background: var(--tick); color: #fff; } .big-pick.bad { background: var(--cross); color: #fff; } .big-pick.dim { opacity: .45; }
.feedback { border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; font-size: 14px; }
.feedback.good { background: var(--tick-soft); color: var(--tick); } .feedback.bad { background: var(--cross-soft); color: var(--cross); }
.feedback div { color: var(--ink); }
.summary-hero { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 8px 0; }
.score-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(#f43f5e calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; }
.score-ring span { width: 96px; height: 96px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 28px; }
.review-row { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.rv { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.rv.ok { background: var(--tick); } .rv.bad { background: var(--cross); }
.subj-tile.soon { min-height: 0; padding: 10px 12px; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.subj-tile.soon .st-icon { font-size: 20px; grid-row: span 2; }
.subj-tile.soon b { font-size: 14px; }
.subj-tile.soon::after { display: none; }
.appbar { background: linear-gradient(115deg, #0a298a 0%, #0670e8 100%); }

/* PYQ year -> sets list */
.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.card.tap.set-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; text-decoration: none; color: inherit; }
.set-code { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.set-card .tag { font-size: 11px; }
.note-card { background: var(--marigold-soft); border-color: transparent; line-height: 1.45; }

/* ---- typeset step-by-step solutions (KaTeX) ---- */
.sol { display: grid; gap: 10px; margin: 4px 0 8px; }
.sol .katex { font-size: 1.08em; }
.sol-part { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; }
.sol-part-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.sol-part-h b { font-family: var(--font-display); font-size: 14px; }
.sol-pm { font-size: 12px; font-weight: 600; color: var(--muted); }
.sol-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: grid; }
.sol-step { counter-increment: st; display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--line); }
.sol-step:first-child { border-top: 0; }
.sol-step::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--ink, inherit);
  font: 600 11px/22px var(--font-body, Inter, sans-serif); text-align: center; margin-top: 2px; }
.sol-body { min-width: 0; }
.sol-t { font-family: KaTeX_Main, "Times New Roman", serif; font-size: 16px; line-height: 1.75; overflow-x: auto; overflow-y: hidden; }
.sol-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sol-m { min-width: 30px; text-align: center; font-size: 12px; font-weight: 700; padding: 3px 6px; border-radius: 999px;
  background: var(--tick-soft); color: var(--tick); margin-top: 4px; }
.sol-final { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--marigold-soft); }
.sol-final-k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--marigold); }
.sol-final-v { font-size: 16px; overflow-x: auto; }
.sol-final-v .katex .boxed { border-color: var(--marigold); border-radius: 4px; }
.sol-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .08em; }
.sol-or::before, .sol-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.sol-table-wrap { overflow-x: auto; margin: 6px 0 2px; }
.sol-table { border-collapse: collapse; font-family: KaTeX_Main, "Times New Roman", serif; font-size: 15px; min-width: 100%; }
.sol-table th, .sol-table td { border: 1px solid var(--line); padding: 4px 10px; text-align: center; white-space: nowrap; }
.sol-table thead th { background: var(--marigold-soft); font-weight: 700; }
.sol-table tfoot td { font-weight: 700; }
.sol-foot { margin-top: -2px; }
.sol-t .katex { white-space: nowrap; }
.sol-t { font-size: 15.5px; line-height: 1.7; }
.sol-line + .sol-line { margin-top: 2px; }
.ans-box:has(.sol) { background: transparent; padding: 0; border: 0; }
.sol-step { grid-template-columns: 22px minmax(0, 1fr) auto; }
.sol-table th, .sol-table td { padding: 3px 8px; }

/* ---- detailed (NCERT-style) solutions: Given / To prove / reasons / diagrams ---- */
.sol-gtp { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 0; }
.sol-gtp .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tick); }
.sol-proof-h { margin-top: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sol-step.has-why { grid-template-columns: 22px minmax(0, 1fr) minmax(70px, 34%); }
.sol-why { font-size: 12px; font-style: italic; color: var(--tick); text-align: right; line-height: 1.35; padding-top: 6px; }
.sol-why::before { content: "["; } .sol-why::after { content: "]"; }
.sol-why .katex { font-size: 1em; }
.sol-fig { margin: 8px 0 4px; text-align: center; }
.sol-fig svg { width: 100%; max-width: 340px; height: auto; display: inline-block; }
.sol-fig figcaption { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sol-fig .ln { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.sol-fig .ln.dash { stroke-dasharray: 5 4; stroke: var(--muted); }
.sol-fig .ln.hi { stroke: var(--marigold); stroke-width: 2.6; }
.sol-fig .pt { fill: var(--ink); }
.sol-fig .pl { font: italic 600 13px KaTeX_Main, "Times New Roman", serif; fill: var(--ink); }
.sol-fig .ml { font: 12px KaTeX_Main, "Times New Roman", serif; fill: var(--tick); }

/* ---- drop-down sections (chapter topics, NCERT exercises, topic explanation/videos) ---- */
details.dd { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
details.dd > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
details.dd > summary::-webkit-details-marker { display: none; }
details.dd > summary b { display: block; font-family: var(--font-display); font-size: 16px; }
details.dd > summary::after { content: "⌄"; font-size: 20px; line-height: 1; color: var(--muted); transition: transform .2s; margin-top: -6px; }
details.dd[open] > summary::after { transform: rotate(180deg); margin-top: 6px; }
.dd-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 19px; flex: none; }
.dd-list { border-top: 1px solid var(--line); }
.dd-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.dd-row:first-child { border-top: 0; }
.dd-row b { display: block; }
.dd-row:active { background: var(--surface-2); }
.dd-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 13px; flex: none; }
.dd-n.wide { width: auto; min-width: 40px; padding: 0 8px; border-radius: 10px; color: var(--tick); background: var(--tick-soft); }
.dd-body { border-top: 1px solid var(--line); padding: 14px 16px 16px; }
.dd-body .explain { padding: 0; border: 0; background: none; }
.ex-pick { display: grid; gap: 4px; }
.ex-pick select { font: 700 18px var(--font-display); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 40px 12px 14px;
  appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.dd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.dd-card .dd-list { border-top: 0; }
.dd-row.soon b { color: var(--ink-2); }
.dd-row .tag { flex: none; }

/* ---- question cards: button in the top row, roomier question image ---- */
.pyq-card { padding: 12px; gap: 10px; }
.pyq-card .qmeta { align-items: center; }
.q-top-btn { margin-left: auto; padding: 7px 14px; }
.qcrop { border: 0; padding: 2px 0; border-radius: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qcrop { padding: 8px; } }
:root[data-theme="dark"] .qcrop { padding: 8px; }

/* ---- full-screen question viewer ---- */
body.noscroll { overflow: hidden; }
.qviewer { position: fixed; inset: 0; z-index: 1000; background: #0b1622; display: flex; flex-direction: column; color: #fff; }
.qv-bar { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.qv-title { flex: 1; font: 700 15px var(--font-display); }
.qv-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.qv-close { background: rgba(255,255,255,.2); }
.qv-scroll { flex: 1; overflow: auto; display: flex; align-items: center; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; padding: 8px; }
.qviewer.zoomed .qv-scroll { align-items: flex-start; }
.qv-img { width: 100%; max-width: none; height: auto; display: block; margin: auto; background: #fff; border-radius: 8px; padding: 10px; box-sizing: border-box; }
.qv-hint { text-align: center; font-size: 12px; color: rgba(255,255,255,.65); padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.qcrop-wrap { position: relative; }
.qcrop-hint { position: absolute; right: 6px; bottom: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; pointer-events: none; }

/* ---- study mode (full screen) ---- */
.qcrop-hint { display: none; }
.qcrop-full { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.92);
  color: var(--ink); font-size: 16px; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.qv-count { font-size: 13px; color: rgba(255,255,255,.7); margin-right: 4px; }
.qv-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; }
.qviewer .qv-scroll { flex: none; overflow-x: auto; overflow-y: hidden; display: block; padding: 0; }
.qviewer .qv-img { margin: 0; }
.qv-sol { background: var(--surface); color: var(--ink); border-radius: 14px; overflow: hidden; }
.qv-sol > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; font: 700 16px var(--font-display); }
.qv-sol > summary::-webkit-details-marker { display: none; }
.qv-sol > summary::after { content: "Show ⌄"; font: 600 13px var(--font-body); color: var(--tick); }
.qv-sol[open] > summary::after { content: "Hide ⌃"; }
.qv-sol-body { padding: 0 12px 12px; }
.qv-sol-body .sol-part { border-color: var(--line); }
.qv-hint { padding: 0 6px; }
.qv-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); background: #0b1622; border-top: 1px solid rgba(255,255,255,.1); }
.qv-navbtn { height: 46px; border-radius: 14px; border: 0; font: 700 15px var(--font-body); background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.qv-navbtn.primary { background: var(--tick); }
.qv-navbtn:disabled { opacity: .35; }
.full-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 12px var(--font-body); padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.full-btn:active { background: var(--surface-2); }
.q-top-btn.mini { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; min-height: 0; }
.btn.q-top-btn.mini { width: auto; padding: 5px 11px; font-size: 12.5px; line-height: 1.3; border-radius: 999px; min-width: 70px; }
.pyq-card .qmeta { gap: 6px; }
/* slim study-mode bar: small prev/next + answers switch */
.qv-hint { display: none; }
.qv-nav { grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
.qv-navbtn { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.qv-auto { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: rgba(255,255,255,.85); cursor: pointer; user-select: none; }
.qv-auto input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qv-switch { width: 34px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.25); position: relative; flex: none; transition: background .2s; }
.qv-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.qv-auto input:checked + .qv-switch { background: var(--tick); }
.qv-auto input:checked + .qv-switch::after { transform: translateX(14px); }
.qv-auto input:focus-visible + .qv-switch { outline: 2px solid #fff; outline-offset: 2px; }
.qv-bar { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
.qv-btn { width: 34px; height: 34px; font-size: 18px; }
/* study mode: let the question + solution keep their full height and scroll (don't squeeze the solution) */
.qv-body { min-height: 0; overscroll-behavior: contain; }
.qv-body > * { flex-shrink: 0; }

/* chapter: important notes + chapter PYQs */
.notes .note-topic { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.notes .note-topic:last-child { border-bottom: 0; padding-bottom: 0; }
.notes h3 { margin: 0; font: 700 15px var(--font-display); color: var(--ink); }
.pyq-src { font-size: 12px; color: var(--ink-2); margin-bottom: -2px; }
.pyq-src b { font-weight: 700; }

/* real chapter content: theorems, NCERT examples, summary */
.thm-list { display: grid; gap: 8px; }
.thm { border-left: 3px solid var(--tick); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: 8px 10px; }
.thm b { font-size: 13.5px; }
.thm p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.thm-proof summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--tick); margin-top: 6px; }
.thm-proof p { color: var(--ink-2); }
.ex-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; }
.sum-list { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 14px; line-height: 1.45; }
.ex-link { width: 100%; justify-content: center; }

/* Mnemos launch */
.logo-img { width: 28px; height: 28px; border-radius: 8px; display: block; flex: none; }
.brandmark.light .logo-img { box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
.inp { font: 500 16px var(--font-body); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); min-width: 0; }
.subj-card.soon { opacity: .55; filter: grayscale(.4); }

.tabbar { grid-template-columns: repeat(4, 1fr) !important; }

/* ================= laptop layout (≥ 960px): side menu, wide content, question + solution side by side ================= */
@media (min-width: 960px) {
  body:not(.site) { padding: 0; background: var(--bg); }
  .device { max-width: none; min-height: 100vh; border-radius: 0; box-shadow: none; overflow: visible; margin: 0; padding-left: 248px; }
  /* bottom tabs become a left side menu */
  .tabbar { top: 0; bottom: 0 !important; left: 0; transform: none; width: 248px; max-width: none; border-radius: 0 !important;
    border-top: 0; border-right: 1px solid var(--line); display: flex !important; flex-direction: column; gap: 4px;
    padding: 88px 14px 20px; }
  .tabbar::before { content: ""; position: absolute; top: 22px; left: 22px; right: 18px; height: 42px;
    background: url("img/logo.png?v=2") left center / auto 42px no-repeat; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar::before { background-image: url("img/logo-white.png?v=2"); } }
  .tabbar a { display: flex; align-items: center; gap: 12px; justify-items: start; padding: 11px 14px; font-size: 15px; border-radius: 12px; }
  .tabbar a .ti { font-size: 19px; }
  .tabbar a:hover { background: var(--surface-2); color: var(--ink); }
  .tabbar a[aria-current="page"] { background: var(--surface-2); }
  .tabbar a[aria-current="page"]::after { display: none; }
  .tabbar::after { content: "CBSE Class 10 · Maths"; position: absolute; bottom: 22px; left: 28px; font-size: 12px; color: var(--muted); }
  /* content column */
  .appbar { padding-left: max(32px, calc((100% - 860px) / 2)); padding-right: max(32px, calc((100% - 860px) / 2)); min-height: 60px; }
  .screen { width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 32px 48px; box-sizing: border-box; }
  .toast { bottom: 32px; left: calc(50% + 124px); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 26px 28px 22px; }
  .hero h1 { font-size: 34px; }
  .set-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .predict { grid-template-columns: repeat(2, minmax(0, 260px)); }
  /* full-screen study mode: question on the left, solution on the right */
  .qv-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; padding: 4px 24px 20px; }
  .qviewer .qv-scroll { position: sticky; top: 0; }
  .qv-sol { max-height: none; }
  .qv-bar, .qv-nav { padding-left: 24px; padding-right: 24px; }
  .qv-nav { max-width: 720px; margin: 0 auto; width: 100%; box-sizing: border-box; }
}

/* narrow phones (≤ 400px): keep long equations inside the card */
@media (max-width: 400px) {
  .sol-t { font-size: 14.5px; }
  .sol-step { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; }
  .sol-step.has-why { grid-template-columns: 20px minmax(0, 1fr); }
  .sol-step.has-why .sol-why { grid-column: 2; text-align: left; padding-top: 0; }
  .sol-m { min-width: 24px; padding: 2px 5px; }
  .sol-part { padding: 10px 8px 8px; }
  .ans-box .sol { margin-left: -4px; margin-right: -4px; }
}

/* logo wordmark (white version) in the app bar and home hero */
.brandmark .logo-word { display: block; height: 31px; width: auto; }

/* ▶ Video link next to the question number, and the video player */
.vid-btn { border: 0; background: #e3f1ff; color: #0a298a; font: 700 12px var(--font-body); padding: 4px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.vid-btn:active { background: #cfe6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vid-btn { background: #12305e; color: #9fd8ff; } }
.qv-vid { border: 0; background: #0585fe; color: #fff; font: 700 13px var(--font-body); padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.vplayer { position: fixed; inset: 0; z-index: 1100; background: #000; display: flex; flex-direction: column; color: #fff; }
.vp-bar { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.vp-title { flex: 1; font: 700 15px var(--font-display); }
.vp-video { flex: 1; min-height: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

/* full mode: zoom lens in the top bar */
.qv-lens { display: grid; place-items: center; background: #0585fe; }

/* typed PYQ questions (pyq-typed.js): read like the NCERT cards, scan one tap away */
.qtyped, .qv-typed { font-size: 16px; line-height: 1.6; color: var(--ink); }
.qtyped p, .qv-typed p { margin: 0 0 8px; }
.qtyped .or, .qv-typed .or { font-weight: 800; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .08em; margin: 4px 0 8px; }
.t-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 4px 0 6px; }
.t-opt b { color: var(--muted); font-weight: 700; margin-right: 2px; }
.t-fig { display: block; max-width: min(100%, 340px); max-height: 300px; width: auto; height: auto; margin: 6px auto 10px; background: #fff; border-radius: 8px; padding: 4px; }
.t-tabwrap { overflow-x: auto; margin: 4px 0 10px; }
.t-tab { border-collapse: collapse; margin: 0 auto; font-size: 15px; }
.t-tab th, .t-tab td { border: 1px solid var(--line); padding: 5px 14px; text-align: center; }
.t-tab th { font-style: italic; font-weight: 600; }
.t-sub { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin: 0 0 6px; }
.t-n { color: var(--muted); font-weight: 700; white-space: nowrap; }
.t-m { color: var(--muted); font-size: 12px; font-style: italic; padding-top: 3px; }
.qtyped { cursor: zoom-in; }
.t-svg { margin: 6px auto 10px; }
.t-svg svg { max-width: 360px; }
.qv-typed.big .t-svg svg { max-width: 520px; }
.qtyped .katex, .qv-typed .katex { font-size: 1.05em; }
details.printed { margin-top: 4px; }
details.printed > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); list-style: none; }
details.printed > summary::-webkit-details-marker { display: none; }
details.printed > summary::before { content: "▸ "; }
details.printed[open] > summary::before { content: "▾ "; }
details.printed img { margin-top: 6px; }
.qv-typed { background: var(--surface); border-radius: 12px; padding: 14px 14px 10px; }
.qv-typed.big { font-size: 20px; }
.qv-typed.big .t-tab { font-size: 18px; }

/* official CBSE marking-scheme content in solutions */
.ms-tag { display: inline-block; font: 700 10px var(--font-body); letter-spacing: .04em; text-transform: uppercase; background: #fdbf27; color: #3a2a00; padding: 2px 7px; border-radius: 999px; margin-right: 6px; vertical-align: 2px; }
.sol-m.ms, .ms-chip { background: #fdbf27; color: #3a2a00; }
.ms-chip { display: inline-block; font-weight: 700; padding: 0 6px; border-radius: 999px; margin-right: 2px; }
.sol-step.ms-step { background: linear-gradient(90deg, rgba(253,191,39,.16), rgba(253,191,39,0) 70%); border-left: 3px solid #fdbf27; border-radius: 6px; padding-left: 6px; }
