/* =====================================================================
   SemPrep — design system (normal + body.diwali)
   ===================================================================== */
:root {
  --bg: #F3F2F8;
  --card: #FFFFFF;
  --line: #E4E2EE;
  --ink: #17142B;
  --text: #17142B;
  --text2: #46425C;
  --muted: #66627A;
  --panel: #17142B;
  --panel2: #221E3A;
  --panel-line: #2F2A4C;
  --panel-text: #FFFFFF;
  --panel-muted: #B9B5CF;
  --hl: #FFE45C;
  --hl-ink: #17142B;
  --track: #E4E2EE;
  --s-ml: #0E8F81; --s-flat: #D63B72; --s-ai: #6A4CE6; --s-cnp: #D9741A; --s-edvc: #2F72D6;
  --good: #16794A; --good-bg: #E3F4EA;
  --bad: #B42318; --bad-bg: #FDE8E6;
  --focus: #6A4CE6;
  --shadow: 0 1px 2px rgba(23,20,43,.06), 0 8px 24px rgba(23,20,43,.06);
  --r-xl: 26px; --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --font-h: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-b: 'Figtree', system-ui, sans-serif;
}
body.diwali {
  --bg: #120A1C;
  --card: #21152F;
  --line: #352448;
  --text: #FFF3E3;
  --text2: #E9D8C4;
  --muted: #BFA98F;
  --panel: #0C0614;
  --panel2: #1A0F27;
  --panel-line: #2E1E40;
  --panel-text: #FFF3E3;
  --panel-muted: #BFA98F;
  --hl: #FFC22E;
  --hl-ink: #1A0F27;
  --track: #3A2850;
  --s-ml: #2FC7B4; --s-flat: #FF5C93; --s-ai: #A08DFF; --s-cnp: #FF9A3D; --s-edvc: #5AA2FF;
  --good: #5BD68F; --good-bg: rgba(91,214,143,.14);
  --bad: #FF8A7A; --bad-bg: rgba(255,138,122,.14);
  --focus: #FFC22E;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  background:
    radial-gradient(900px 600px at 100% 0%, rgba(255,178,26,.20), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(232,64,122,.16), transparent 60%),
    #120A1C;
  background-attachment: fixed;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font-b); min-height: 100vh; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--font-h); margin: 0; line-height: 1.08; letter-spacing: -.02em; }
h1 { font-weight: 800; font-size: clamp(2.1rem, 5.2vw, 3.7rem); letter-spacing: -.035em; }
h2 { font-weight: 800; font-size: clamp(1.55rem, 3.4vw, 2.3rem); letter-spacing: -.03em; }
h3 { font-weight: 700; font-size: 1.2rem; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.ic { flex: none; display: block; }
.code-ml { color: var(--s-ml); } .code-flat { color: var(--s-flat); } .code-ai { color: var(--s-ai); } .code-cnp { color: var(--s-cnp); } .code-edvc { color: var(--s-edvc); }

/* ---------- boot / loading ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--hl); animation: spin .8s linear infinite; }
.loading { padding: 48px 0; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--r-md); border: 1.5px solid transparent; font-weight: 700; font-size: .98rem; text-decoration: none; background: var(--hl); color: var(--hl-ink); transition: transform .12s, filter .12s, background .12s; white-space: nowrap; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.dark { background: var(--ink); color: #fff; }
body.diwali .btn.dark { background: #FFF3E3; color: #1A0F27; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn.on-dark { background: transparent; color: var(--panel-text); border-color: var(--panel-line); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: .9rem; border-radius: var(--r-sm); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.block { width: 100%; }
.on-gold .btn, .on-gold .btn:not(.ghost) { background: #17142B; color: #FFF3E3; }
.on-gold .btn.ghost { background: transparent; color: #17142B; border-color: rgba(23,20,43,.3); }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font-weight: 600; min-height: 0; }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; }

/* ---------- chips, tags, pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text2); }
.chip.dark { background: rgba(255,255,255,.1); color: var(--panel-text); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.neutral { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.card.dark { background: var(--panel); border-color: var(--panel); color: var(--panel-text); }
body.diwali .card.dark { border-color: var(--panel-line); }
.card.gold { background: var(--hl); border-color: var(--hl); color: #17142B; }
.card h3 + p { margin-top: 6px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 18px; }
.stack-sm > * + * { margin-top: 10px; }
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--hl); border-radius: 999px; }
.card.dark .bar { background: rgba(255,255,255,.14); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r-md); }

/* ---------- forms ---------- */
.field { display: block; }
.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: .82rem; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; font-size: .92rem; }
.form-ok { background: var(--good-bg); color: var(--good); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; font-size: .92rem; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--hl); }

/* ---------- switch (Diwali mode) ---------- */
.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; min-height: 44px; font-weight: 700; font-size: .9rem; color: inherit; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: rgba(127,120,150,.45); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] .track { background: #FFC22E; }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-h); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; }
.logo svg { width: 40px; height: 40px; }
.octo { display: block; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 88px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #17142B; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .2s ease-out; pointer-events: auto; }
body.diwali .toast { background: #FFF3E3; color: #1A0F27; }
.toast.bad { background: #B42318; color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 861px) { .toasts { bottom: 24px; } }

/* =====================================================================
   Landing page
   ===================================================================== */
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 68px; }
.topbar nav { display: flex; gap: 4px; margin-left: 18px; }
.topbar nav a { text-decoration: none; font-weight: 600; color: var(--text2); padding: 10px 12px; border-radius: 10px; }
.topbar nav a:hover { color: var(--text); }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hero { padding: 56px 0 40px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: var(--text2); margin-top: 18px; max-width: 34em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero .note { margin-top: 14px; color: var(--muted); font-size: .92rem; }
.map-card { position: relative; }
.map-card .mascot { position: absolute; width: 104px; height: 104px; right: -18px; top: -62px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.18)); }
.map-card .example { display: inline-block; margin-top: 4px; color: var(--muted); font-size: .88rem; }
.band { background: var(--panel); color: var(--panel-text); padding: 30px 0; }
body.diwali .band { border-block: 1px solid var(--panel-line); }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.band .label { font-family: var(--font-h); font-weight: 800; font-size: 1.25rem; margin-right: 12px; }
.band .subj { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--panel-muted); }
.band .subj b { color: var(--panel-text); }
.section { padding: 72px 0 0; }
.section > .wrap > h2 { margin-bottom: 26px; }
.steps { counter-reset: s; }
.step .num { width: 46px; height: 46px; border-radius: 14px; background: var(--hl); color: var(--hl-ink); display: grid; place-items: center; font-family: var(--font-h); font-weight: 800; font-size: 1.3rem; margin-bottom: 16px; }
.step p { color: var(--text2); margin-top: 8px; }
.inside { grid-template-columns: repeat(4, minmax(0,1fr)); }
.map-card h3 { padding-right: 70px; }
.inside .wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; }
.inside .card p { color: var(--text2); margin-top: 8px; }
.inside .card.dark p { color: var(--panel-muted); }
.sample-q { background: var(--panel2); border: 1px solid var(--panel-line); border-radius: var(--r-md); padding: 18px; }
.sample-q .q { font-weight: 700; margin: 10px 0 12px; }
.sample-q .opt { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--panel-line); margin-top: 8px; font-size: .95rem; display: flex; gap: 10px; }
.sample-q .opt.right { border-color: #5BD68F; background: rgba(91,214,143,.13); }
.sample-q .why { margin-top: 12px; font-size: .9rem; color: var(--panel-muted); }
.final { margin-top: 72px; background: var(--hl); color: #17142B; padding: 48px 0; }
.final .wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.final .octo { width: 110px; height: 110px; }
.final h2 { flex: 1; min-width: 240px; }
.foot { padding: 28px 0 40px; color: var(--muted); font-size: .92rem; text-align: center; }

/* =====================================================================
   Syllabus map
   ===================================================================== */
.map { display: grid; gap: 4px; margin-top: 20px; }
.map-row { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 10px; min-height: 64px; }
.map-row .code { font-family: var(--font-h); font-weight: 800; font-size: .98rem; background: none; border: 0; padding: 0; text-align: left; min-height: 44px; }
.track { position: relative; height: 44px; margin: 0 14px; }
.track .line, .track .fill { position: absolute; top: 50%; height: 4px; transform: translateY(-50%); border-radius: 4px; left: 0; }
.track .line { right: 0; background: var(--track); }
.track .fill { background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 50%, transparent); }
.stop { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--card); border: 3px solid var(--c); padding: 0; display: block; }
.card.dark .stop, .auth-side .stop { background: var(--panel); }
.stop.part { background: linear-gradient(to top, var(--c) 50%, var(--card) 50%); }
.card.dark .stop.part, .auth-side .stop.part { background: linear-gradient(to top, var(--c) 50%, var(--panel) 50%); }
.stop.done { background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent), 0 0 16px color-mix(in srgb, var(--c) 60%, transparent); }
.stop.next::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--hl); }
.stop .pct { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.stop:hover { transform: scale(1.08); }
button.stop { cursor: pointer; }
/* Diwali diyas */
.flame { display: none; }
body.diwali .stop.done .flame, body.diwali .stop.part .flame { display: block; position: absolute; left: 50%; bottom: 100%; width: 10px; height: 15px; margin-left: -5px; margin-bottom: 1px; background: radial-gradient(ellipse at 50% 75%, #FFF3B0 0 25%, #FFC22E 45%, #FF8A1F 80%); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; box-shadow: 0 0 10px 3px rgba(255,178,26,.55); transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite; }
body.diwali .stop.part .flame { width: 7px; height: 10px; margin-left: -3.5px; }
.map-row:nth-child(2n) .flame { animation-delay: -.4s; }
.stop:nth-child(3n) .flame { animation-delay: -.9s; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); opacity: 1; } 30% { transform: scale(1.08, .94) rotate(3deg); } 60% { transform: scale(.94, 1.06) rotate(-3deg); opacity: .9; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: .84rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--text2); display: inline-block; }
.legend i.part { background: linear-gradient(to top, var(--text2) 50%, transparent 50%); }
.legend i.done { background: var(--text2); }
.legend i.next { border-color: var(--hl); }

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--panel); color: var(--panel-text); padding: 36px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; gap: 22px; position: relative; overflow: hidden; }
.auth-side .big-octo { width: 150px; height: 150px; }
.auth-side h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); max-width: 14em; }
.auth-side .mapwrap { background: var(--panel2); border: 1px solid var(--panel-line); border-radius: var(--r-lg); padding: 18px; }
.auth-side .mapwrap .map-row .code { color: var(--c); }
.auth-side p { color: var(--panel-muted); }
.auth-main { padding: 36px clamp(20px, 5vw, 64px); display: flex; flex-direction: column; }
.auth-main .back { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 600; color: var(--text2); min-height: 44px; }
.auth-form { width: 100%; max-width: 420px; margin: auto; padding: 24px 0; }
.auth-form h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.auth-form .sub { color: var(--text2); margin: 10px 0 24px; }
.auth-form form > * + * { margin-top: 16px; }
.auth-form .alt { margin-top: 20px; color: var(--text2); text-align: center; }
.inbox { text-align: center; }
.inbox .octo { width: 120px; height: 120px; margin: 0 auto 10px; }

/* =====================================================================
   App shell
   ===================================================================== */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--panel); color: var(--panel-text); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
body.diwali .side { border-right: 1px solid var(--panel-line); }
.side .logo { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: var(--panel-muted); font-weight: 600; min-height: 44px; }
.nav a:hover { color: var(--panel-text); background: rgba(255,255,255,.05); }
.nav a.on { background: rgba(255,255,255,.09); color: var(--panel-text); }
.nav a.on .ic { color: var(--hl); }
.side h4 { font-family: var(--font-b); font-size: .84rem; font-weight: 700; color: var(--panel-muted); padding: 0 12px; margin-bottom: 6px; letter-spacing: 0; }
.side-subj { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; }
.side-subj:hover { background: rgba(255,255,255,.05); }
.side-subj .top { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 700; }
.side-subj .top span { color: var(--panel-muted); font-weight: 600; font-size: .8rem; }
.segs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 6px; }
.segs i { height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); }
.segs i.on { background: var(--c); }
.segs i.half { background: linear-gradient(to right, var(--c) 50%, rgba(255,255,255,.12) 50%); }
.side .user { margin-top: auto; border-top: 1px solid var(--panel-line); padding: 16px 8px 0; display: grid; gap: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--hl); color: var(--hl-ink); display: grid; place-items: center; font-family: var(--font-h); font-weight: 800; font-size: 1.1rem; flex: none; }
.side .user .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.side .user .who div { min-width: 0; }
.side .user .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .user .who small { color: var(--panel-muted); }
.side .logout { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--panel-muted); font-weight: 600; min-height: 44px; padding: 0; }
.mtop, .tabbar { display: none; }
.main { min-width: 0; position: relative; }
.content { padding: 30px clamp(16px, 3vw, 40px) 60px; max-width: 1180px; }
.toran { display: none; }
body.diwali .toran { display: block; height: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='34' viewBox='0 0 64 34'%3E%3Cpath d='M0 3 Q32 16 64 3' fill='none' stroke='%23C9A227' stroke-width='1.6'/%3E%3Cpath d='M22 11 l-4 7 l6 -3z' fill='%232F9E57'/%3E%3Cpath d='M42 11 l4 7 l-6 -3z' fill='%232F9E57'/%3E%3Ccircle cx='32' cy='14' r='6.5' fill='%23FF8A1F'/%3E%3Ccircle cx='32' cy='14' r='3' fill='%23FFB21A'/%3E%3Ccircle cx='32' cy='24' r='5' fill='%23E8407A'/%3E%3Ccircle cx='32' cy='24' r='2.2' fill='%23FF7FA8'/%3E%3Ccircle cx='32' cy='31' r='2.5' fill='%23FFC22E'/%3E%3Ccircle cx='8' cy='6' r='4' fill='%23FFC22E'/%3E%3Ccircle cx='56' cy='6' r='4' fill='%23FFC22E'/%3E%3C/svg%3E"); background-repeat: repeat-x; background-position: center top; pointer-events: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 22px; }
.page-head p { color: var(--text2); margin-top: 6px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; color: var(--text2); }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
body.diwali .tab.on { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.tabs.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }

/* ---------- home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 0; padding: 0; overflow: hidden; }
.home-hero .mapside { padding: 26px; }
.home-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.nextup { background: var(--panel); color: var(--panel-text); padding: 26px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; }
.nextup h3 { font-size: 1.35rem; position: relative; }
.nextup .stat { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--panel-line); color: var(--panel-muted); position: relative; }
.nextup .stat b { color: var(--panel-text); font-family: var(--font-h); font-size: 1.15rem; }
.nextup > * { position: relative; }
.rangoli { display: none; }
body.diwali .rangoli { display: block; position: absolute !important; width: 220px; height: 220px; right: -70px; bottom: -70px; opacity: .22; pointer-events: none; }
/* semester exam countdown (top of every page) */
.exam-bar { --acc: var(--hl); position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 24px clamp(16px, 3vw, 40px) -6px; max-width: calc(1180px - 2 * clamp(16px, 3vw, 40px)); padding: 16px 20px;
  border-radius: var(--r-lg); background: var(--panel); color: var(--panel-text); border: 1px solid var(--panel-line); box-shadow: var(--shadow); }
.exam-bar::before { content: ''; position: absolute; inset: -60% auto auto -10%; width: 55%; height: 220%; background: radial-gradient(closest-side, color-mix(in srgb, var(--acc) 30%, transparent), transparent); pointer-events: none; }
.exam-bar::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, var(--s-ml), var(--s-ai), var(--s-flat), var(--s-cnp), var(--s-edvc)); }
.exam-bar > * { position: relative; }
.exam-bar.soon { --acc: #FF6B4A; }
.exam-bar.during { --acc: #3DDC84; }
.exam-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--acc); color: #17142B; flex: none; }
.exam-bar.soon .exam-ico { animation: pulse 2s ease-in-out infinite; }
.exam-txt { display: grid; gap: 2px; min-width: 0; flex: 1 1 180px; }
.exam-txt b { font-family: var(--font-h); font-size: 1.15rem; letter-spacing: -.01em; }
.exam-txt span { color: var(--panel-muted); font-size: .9rem; }
.cd { display: flex; gap: 8px; }
.cd-tile { min-width: 66px; padding: 8px 6px 6px; border-radius: 12px; text-align: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.cd-tile b { display: block; font-family: var(--font-h); font-size: 1.75rem; font-weight: 800; line-height: 1.05; color: var(--acc); font-variant-numeric: tabular-nums; }
.cd-tile span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--panel-muted); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 55%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
/* about page */
.about { display: grid; gap: 56px; max-width: 1080px; }
.about-public { padding: 48px 16px 24px; }
.about-hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-top: 14px; max-width: 18em; }
.about-hero .lead { font-size: 1.12rem; color: var(--text2); margin-top: 16px; max-width: 42em; }
.about-hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.about-block > h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 18px; }
.about-text { display: grid; gap: 12px; max-width: 46em; color: var(--text2); font-size: 1.05rem; }
.about-grid .card h3 { margin-top: 2px; }
.about-grid .card p { color: var(--text2); margin-top: 6px; }
.about-grid .card.dark p { color: var(--panel-muted); }
.about-grid .card.gold p { color: #46425C; }
.about-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--hl); color: var(--hl-ink); margin-bottom: 12px; }
.about-steps { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; counter-reset: st; max-width: 46em; }
.about-steps li { counter-increment: st; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; color: var(--text2); font-size: 1.04rem; }
.about-steps li::before { content: counter(st); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); color: var(--hl); font-family: var(--font-h); font-weight: 800; }
.about-steps li b { color: var(--text); }
.about-maker { display: flex; gap: 26px; align-items: center; padding: 30px; }
.about-maker .octo { width: 120px; height: 120px; flex: none; }
.about-maker h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 8px; color: var(--hl); }
.about-maker p { color: var(--panel-muted); max-width: 44em; margin-top: 8px; font-size: 1.04rem; }
.foot a { color: inherit; font-weight: 700; }
@media (max-width: 620px) { .about-maker { flex-direction: column; align-items: flex-start; padding: 22px; } .about-maker .octo { width: 84px; height: 84px; } }
/* announcements box (home) */
.ann-box { position: relative; overflow: hidden; padding: 0; }
.ann-box::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--s-ml), var(--s-ai), var(--s-flat), var(--s-cnp)); }
.ann-box-head { display: flex; align-items: center; gap: 14px; padding: 22px 22px 14px; flex-wrap: wrap; }
.ann-box-head p { margin-top: 2px; }
.ann-box-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--hl); color: var(--hl-ink); flex: none; }
.ann-newpill { padding: 4px 11px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .78rem; font-weight: 800; animation: pop .35s ease-out; }
.ann-list { display: grid; gap: 10px; padding: 0 22px 18px; }
.ann-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); position: relative; }
.ann-item.important { background: color-mix(in srgb, var(--hl) 22%, var(--card)); border-color: color-mix(in srgb, var(--hl) 70%, var(--line)); }
.ann-item.new { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus) inset; }
.ann-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--text2); flex: none; }
.ann-item.important .ann-ico { background: var(--hl); border-color: var(--hl); color: var(--hl-ink); }
.ann-body { min-width: 0; flex: 1; }
.ann-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-title h4 { font-family: var(--font-h); font-size: 1.05rem; letter-spacing: -.01em; }
.ann-tag { font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--hl); color: var(--hl-ink); }
.ann-dot { display: none; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.ann-item.new .ann-dot { display: inline-block; }
.ann-body p { white-space: pre-line; margin-top: 4px; color: var(--text2); overflow-wrap: anywhere; }
.ann-body time { display: block; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.ann-empty { margin: 0 22px 22px; padding: 18px; border-radius: var(--r-md); border: 1.5px dashed var(--line); color: var(--muted); text-align: center; }
.ann-more { margin: -6px 22px 18px; }
.ann-preview { border: 0; box-shadow: none; }
.ann-preview .ann-list { padding: 0; }
/* notification bell + panel */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bell { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--panel-muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.bell:hover, .bell[aria-expanded="true"] { background: var(--panel2); color: var(--panel-text); }
.bell-badge { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--panel); line-height: 1; }
.bell-badge[hidden] { display: none; }
.bell:has(.bell-badge:not([hidden])) .ic { animation: ring 1.6s ease-in-out 2; transform-origin: 50% 10%; }
.notif-pop { position: fixed; z-index: 60; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 18px 50px rgba(0,0,0,.25); animation: pop .18s ease-out; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; padding: 12px; display: grid; gap: 10px; }
.notif-empty { padding: 18px 6px; text-align: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } 50% { transform: rotate(0); } }
.greet { display: flex; gap: 18px; align-items: center; }
.greet .octo { width: 84px; height: 84px; flex: none; }

/* ---------- subject page ---------- */
.unit-tabs { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin-top: 18px; }
.unit-tab { text-align: left; padding: 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: transparent; min-height: 74px; display: flex; flex-direction: column; gap: 4px; }
.unit-tab b { font-size: .95rem; }
.unit-tab span { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.unit-tab .bar { height: 5px; margin-top: auto; }
.unit-tab .bar i { background: var(--c); }
.unit-tab.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.pdf-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.card.dark .pdf-row { border-color: var(--panel-line); }
.pdf-row:first-of-type { border-top: 0; }
.pdf-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #D63B72) 14%, transparent); color: var(--c, #D63B72); flex: none; }
.pdf-row .info { flex: 1; min-width: 0; }
.pdf-row .info b { display: block; overflow-wrap: anywhere; }
.pdf-row .info small { color: var(--muted); }
.card.dark .pdf-row .info small { color: var(--panel-muted); }
.pdf-row .bar { height: 5px; margin-top: 7px; max-width: 220px; }
.special { position: relative; }
body.diwali .special { border: 1.5px solid #C9A227; }
.quiz-band { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { --p: 0; --c: var(--hl); width: 78px; height: 78px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0); display: grid; place-items: center; flex: none; }
.ring b { width: 60px; height: 60px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-family: var(--font-h); font-size: 1.1rem; }
.quiz-band .info { flex: 1; min-width: 220px; }
.quiz-band .info p { color: var(--text2); margin-top: 4px; }

/* ---------- reader ---------- */
.reader { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 22px; align-items: start; }
.desk { background: #2A2638; border-radius: var(--r-lg); padding: clamp(10px, 2vw, 26px); display: grid; gap: 18px; justify-items: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.diwali .desk { background: #0C0614; border: 1px solid var(--panel-line); }
.page-wrap { position: relative; width: 100%; max-width: 860px; background: #fff; box-shadow: 0 6px 22px rgba(0,0,0,.35); min-height: 200px; }
.page-wrap canvas { display: block; width: 100%; height: auto; }
.page-wrap .wm { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.page-wrap .wm div { position: absolute; inset: -50%; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; transform: rotate(-30deg); opacity: .12; color: #17142B; font-weight: 700; font-size: clamp(11px, 1.6vw, 16px); gap: 46px 60px; white-space: nowrap; }
.page-wrap .pg { position: absolute; bottom: 6px; right: 10px; font-size: .75rem; color: #888; }
.reader-side { position: sticky; top: 20px; }
/* previous / next page pill */
.page-wrap { scroll-margin-top: 16px; }
.pager { position: fixed; z-index: 75; bottom: 22px; left: calc(50% + 130px); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px;
  border-radius: 999px; background: rgba(22,20,31,.92); backdrop-filter: blur(8px); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); }
.pager-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--hl); color: var(--hl-ink); font-weight: 700; cursor: pointer; }
.pager-btn:disabled { opacity: .35; cursor: default; }
.pager-btn:not(:disabled):hover { filter: brightness(1.05); }
.pager-num { min-width: 74px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
body.read-mode .pager { left: 50%; bottom: 26px; }
body.read-mode .content { padding-bottom: 110px; }
.content:has(.reader) { padding-bottom: 110px; }
/* read mode: nothing but the pages */
body.read-mode { background: #16141F; }
body.read-mode .side, body.read-mode .mtop, body.read-mode .tabbar, body.read-mode .exam-bar, body.read-mode .toran,
body.read-mode .content > .back, body.read-mode .page-head, body.read-mode .reader-side { display: none !important; }
body.read-mode .shell { display: block; }
body.read-mode .content { max-width: none; padding: 72px 12px 48px; }
body.read-mode .reader { display: block; }
body.read-mode .desk { background: transparent; border: 0; padding: 0; gap: 22px; }
body.read-mode .page-wrap { max-width: 900px; scroll-margin-top: 70px; }
.rm-bar { position: fixed; inset: 0 0 auto 0; z-index: 80; height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 20px;
  background: rgba(22,20,31,.94); backdrop-filter: blur(8px); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.rm-title { flex: 1; min-width: 0; font-family: var(--font-h); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-page, .rm-pct { color: #B9B5CF; font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rm-exit { flex: none; }
.rm-track { position: absolute; inset: auto 0 0 0; height: 3px; background: rgba(255,255,255,.08); }
.rm-fill { display: block; height: 100%; width: 0; background: var(--hl); transition: width .3s; }
@media (max-width: 600px) { .rm-pct { display: none; } .rm-bar { gap: 10px; padding-left: 14px; } .rm-exit { padding: 0 12px; } }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; margin-top: 12px; }
.page-grid i { aspect-ratio: 1; border-radius: 3px; background: var(--track); }
.page-grid i.on { background: var(--hl); }
.big-pct { font-family: var(--font-h); font-weight: 800; font-size: 2.6rem; letter-spacing: -.03em; line-height: 1; }
@media print { body * { display: none !important; } body::after { content: 'Printing is disabled on SemPrep.'; display: block !important; } }

/* ---------- quiz ---------- */
.quiz { max-width: 780px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-h); font-weight: 800; font-size: 1.35rem; padding: 6px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); border-color: var(--bad); }
.qbars { display: flex; gap: 4px; margin: 18px 0; flex-wrap: wrap; }
.qbars button { flex: 1 0 18px; max-width: 40px; height: 10px; border-radius: 4px; border: 0; padding: 0; background: var(--track); position: relative; }
.qbars button::before { content: ''; position: absolute; inset: -17px -2px; }
.qbars button.ans { background: var(--text2); }
.qbars button.cur { background: var(--hl); outline: 2px solid var(--hl); outline-offset: 1px; }
.qtext { font-family: var(--font-h); font-weight: 700; font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.25; margin: 14px 0 22px; letter-spacing: -.015em; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; min-height: 60px; padding: 12px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--card); font-size: 1.02rem; font-weight: 500; }
.opt:hover { border-color: var(--text2); }
.opt .k { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--text) 8%, transparent); flex: none; }
.opt.sel { border-color: var(--ink); background: color-mix(in srgb, var(--hl) 30%, var(--card)); }
body.diwali .opt.sel { border-color: var(--hl); background: color-mix(in srgb, var(--hl) 16%, var(--card)); }
.opt.sel .k { background: var(--hl); color: var(--hl-ink); }
.quiz-nav { display: flex; gap: 10px; margin-top: 22px; }
.quiz-nav .spacer { flex: 1; }
.kbd-hint { margin-top: 14px; font-size: .84rem; color: var(--muted); }

/* ---------- result ---------- */
.res-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.res-score { font-family: var(--font-h); font-weight: 800; font-size: clamp(3.4rem, 9vw, 5.4rem); letter-spacing: -.04em; line-height: .9; }
.res-score small { font-size: .45em; color: var(--panel-muted); }
.res-head .octo { width: 96px; height: 96px; }
.res-head .txt { flex: 1; min-width: 220px; }
.res-head .txt p { color: var(--panel-muted); margin-top: 6px; }
.topic-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 70px; gap: 12px; align-items: center; padding: 8px 0; }
.topic-row .bar { height: 10px; }
.topic-row.weak .bar i { background: var(--bad); }
.topic-row .weak-tag { color: var(--bad); font-weight: 700; font-size: .8rem; }
.answer { padding: 18px 0; border-top: 1px solid var(--line); }
.answer .mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.answer .mark.ok { background: var(--good-bg); color: var(--good); }
.answer .mark.no { background: var(--bad-bg); color: var(--bad); }
.answer .q { font-weight: 700; margin: 8px 0; }
.answer .yours.wrong { text-decoration: line-through; color: var(--bad); }
.answer .right { color: var(--good); font-weight: 600; }
.qimg { margin: 0 0 20px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.qimg img { display: block; max-width: 100%; max-height: 420px; height: auto; margin: 0 auto; object-fit: contain; }
.answer .qimg { margin: 6px 0 10px; max-width: 560px; }
.answer .qimg img { max-height: 280px; }
.fmt-help { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; background: var(--bg); }
.fmt-help summary, details.card > summary { cursor: pointer; font-weight: 700; }
.fmt-help pre { margin: 10px 0; padding: 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); font-size: .84rem; white-space: pre-wrap; overflow-x: auto; }
.pdf-preview { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pp-sum { align-items: center; gap: 8px; }
.pp-sum .pill { display: inline-flex; align-items: center; gap: 4px; }
.pp-list { max-height: 70vh; overflow-y: auto; margin-top: 8px; }
.answer .why { color: var(--text2); font-size: .94rem; margin-top: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); font-weight: 700; }
tr.me td { background: color-mix(in srgb, var(--hl) 25%, transparent); }
.kpi b { display: block; font-family: var(--font-h); font-weight: 800; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: .9rem; }

/* ---------- leaderboard ---------- */
.lb-row { display: grid; grid-template-columns: 46px minmax(0,1fr) minmax(80px, 220px) 64px; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); }
.lb-row + .lb-row { margin-top: 4px; }
.lb-row.me { background: color-mix(in srgb, var(--hl) 28%, transparent); }
.lb-row .rank { font-family: var(--font-h); font-weight: 800; font-size: 1.1rem; text-align: center; }
.lb-row.top .rank { font-size: 1.6rem; color: var(--hl); }
body:not(.diwali) .lb-row.top .rank { color: var(--ink); }
.lb-row .name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .name small { color: var(--muted); }
.lb-row .pts { font-family: var(--font-h); font-weight: 800; font-size: 1.15rem; text-align: right; }
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--track); }
.split i { display: block; height: 100%; }

/* ---------- mid ---------- */
.mid-card { min-height: 220px; display: flex; flex-direction: column; gap: 14px; }
.mid-card .pdf-row { border: 0; padding: 0; }
.mid-card .mid-list { display: grid; gap: 14px; }
.mid-card .mid-list .pdf-row + .pdf-row { padding-top: 14px; border-top: 1px solid var(--line); }
.mid-card.dark .mid-list .pdf-row + .pdf-row { border-top-color: var(--panel-line); }
.mid-card.gold .mid-list .pdf-row + .pdf-row { border-top-color: rgba(23,20,43,.18); }
.mid-blurb { margin-top: 4px; color: var(--muted); }
.mid-card.dark .mid-blurb { color: var(--panel-muted); }
.mid-card.gold .mid-blurb, .mid-card.gold .pdf-row small { color: #46425C; }
.mid-card.two-marks, .mid-card.accent { border-top: 5px solid var(--c); }
.mid-grid { max-width: 820px; }
.mid-empty { margin-top: auto; }
.mid-card.dark .mid-empty { border-color: var(--panel-line); color: var(--panel-muted); }
.mid-card.gold .mid-empty { border-color: rgba(23,20,43,.3); color: #46425C; }
.mid-grid { align-items: stretch; }
@media (max-width: 1060px) { .mid-grid { grid-template-columns: 1fr; } }
/* admin: several files per Mid cell */
.mid-table td { vertical-align: top; }
.mid-table td:nth-child(2) { min-width: 260px; width: 100%; }
.mid-files { display: grid; gap: 10px; }
.mid-file { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.mid-file-info { display: grid; }

/* ---------- feedback ---------- */
.rate { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.rate button, .choice button { min-height: 72px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--card); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; }
.rate button b { font-family: var(--font-h); font-size: 1.5rem; }
.rate button span { font-size: .76rem; color: var(--muted); }
.rate button.on, .choice button.on { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.rate button.on span { color: var(--hl-ink); }
.choice { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.choice button { min-height: 52px; }

/* ---------- admin ---------- */
.admin-tabs { margin-bottom: 20px; }
.hbar { display: grid; grid-template-columns: 90px 1fr 40px; gap: 10px; align-items: center; padding: 5px 0; font-size: .92rem; }
.hbar .bar { height: 10px; }
.bank-grid td { min-width: 110px; }
.inline-edit { display: flex; gap: 6px; }
.inline-edit .input { min-height: 44px; padding: 6px 10px; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-ann { margin-top: 12px; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1060px) {
  .home-hero { grid-template-columns: 1fr; }
  .reader { grid-template-columns: 1fr; }
  .reader-side { position: static; order: -1; }
  .g4, .inside { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mtop { display: flex; align-items: center; gap: 8px; background: var(--panel); color: var(--panel-text); padding: 8px 16px; position: sticky; top: 0; z-index: 30; min-height: 60px; }
  .mtop .logo { font-size: 1.15rem; }
  .mtop .logo svg { width: 34px; height: 34px; }
  .mtop .switch { font-size: 0; gap: 0; }
  .notif-pop { left: 16px; right: 16px; top: 68px; width: auto; }
  .mtop .bell-badge { border-color: var(--panel); }
  .exam-bar { margin: 14px 16px -10px; padding: 14px; gap: 12px; }
  .exam-bar .cd { width: 100%; }
  .cd-tile { flex: 1; min-width: 0; }
  .cd-tile b { font-size: 1.45rem; }
  .pager { left: 50%; bottom: 84px; }
  .pager-btn span { display: none; }
  .pager-btn { padding: 0 14px; }
  .mtop .logout { background: none; border: 0; color: var(--panel-muted); width: 44px; height: 44px; display: grid; place-items: center; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--panel-line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; text-decoration: none; color: var(--panel-muted); font-size: .72rem; font-weight: 700; }
  .tabbar a.on, .tabbar button.on { color: var(--hl); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; border: 0; background: none; color: var(--panel-muted); font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
  .more-sheet { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; animation: fade .15s ease-out; }
  .more-panel { width: 100%; max-height: 80vh; overflow-y: auto; background: var(--panel); color: var(--panel-text); border-radius: 22px 22px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
  .more-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 10px; }
  .more-head .linkbtn { color: var(--panel-muted); }
  .more-list { display: grid; gap: 4px; }
  .more-list a { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 12px; border-radius: 12px; color: var(--panel-text); text-decoration: none; font-weight: 600; }
  .more-list a.on { background: var(--panel2); color: var(--hl); }
  .content { padding: 20px 16px 96px; }
  .hero { grid-template-columns: 1fr; padding-top: 36px; gap: 70px; }
  .topbar nav { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { order: 2; }
  .g2, .g3, .inside { grid-template-columns: 1fr; }
  .inside .wide { grid-column: auto; grid-template-columns: 1fr; }
  .unit-tabs { grid-template-columns: repeat(5, minmax(96px, 1fr)); overflow-x: auto; }
  .map-card .mascot { right: 4px; width: 88px; height: 88px; top: -56px; }
}
@media (max-width: 520px) {
  .topbar .actions .btn.ghost.login { display: none; }
  .topbar .actions .switch .lbl { display: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card { padding: 18px; border-radius: 20px; }
  .home-hero .mapside, .nextup { padding: 20px; }
  .map-row { grid-template-columns: 46px 1fr; gap: 4px; }
  .track { margin: 0 12px; }
  .stop { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .lb-row { grid-template-columns: 34px minmax(0,1fr) 54px; gap: 10px; padding: 10px; }
  .lb-row .split { grid-column: 2 / 4; grid-row: 2; }
  .rate button span { font-size: .66rem; }
  .choice { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: 1fr 70px; }
  .topic-row .bar { grid-column: 1 / 3; grid-row: 2; }
  .quiz-nav .btn { padding: 0 14px; }
  .kbd-hint { display: none; }
  .final .wrap { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
