/* ═══════════════════════════════════════════════════════════════════════════
   UPSC AI — design system
   Dark by default (deep navy + violet/cyan glow), light theme via [data-theme=light]
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #070b1a; --bg-2: #0b1128;
  --surface: rgba(19, 26, 54, .78); --surface-solid: #131a36; --surface-2: rgba(31, 40, 82, .55);
  --surface-hover: rgba(48, 58, 112, .5);
  --border: rgba(148, 163, 255, .13); --border-strong: rgba(148, 163, 255, .28);
  --text: #e7eaf6; --text-2: #b2b9da; --muted: #7e88b0;
  --primary: #8b5cf6; --primary-2: #6366f1; --accent: #22d3ee; --pink: #f472b6;
  --success: #34d399; --warn: #fbbf24; --danger: #f87171; --info: #60a5fa;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 48%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(34, 211, 238, .10));
  --radius: 16px; --radius-sm: 11px; --radius-xs: 8px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .75);
  --shadow-glow: 0 10px 40px -10px rgba(139, 92, 246, .45);
  --ring: 0 0 0 3px rgba(139, 92, 246, .38);
  --sidebar-w: 264px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5fb; --bg-2: #eceffa;
  --surface: rgba(255, 255, 255, .86); --surface-solid: #ffffff; --surface-2: rgba(237, 240, 252, .9);
  --surface-hover: rgba(226, 231, 252, .95);
  --border: rgba(76, 87, 160, .14); --border-strong: rgba(76, 87, 160, .28);
  --text: #141936; --text-2: #3e4670; --muted: #6b7399;
  --primary: #7c3aed; --primary-2: #4f46e5; --accent: #0891b2;
  --success: #059669; --warn: #b45309; --danger: #dc2626; --info: #2563eb;
  --shadow: 0 16px 36px -24px rgba(30, 41, 99, .35);
  --shadow-glow: 0 10px 30px -12px rgba(124, 58, 237, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Inter, self-hosted (no request to Google before the first paint); one variable file per subset covers 400–800 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); min-height: 100vh; }
/* The glow sits on its own fixed layer: scrolling moves the page over it without repainting (background-attachment: fixed
   repainted the whole screen on every scroll on phones) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(99, 102, 241, .20), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, rgba(34, 211, 238, .10), transparent 60%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 600px at 90% -10%, rgba(99, 102, 241, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(139, 92, 246, .10), transparent 60%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); }
h2 { font-size: clamp(1.2rem, 1rem + .9vw, 1.5rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
code, kbd { font-family: var(--mono); font-size: .88em; }
kbd { padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px;
      background: var(--surface-2); color: var(--text-2); }
::selection { background: rgba(139, 92, 246, .35); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
[hidden] { display: none !important; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
[data-sidebar="mini"] { --sidebar-w: 78px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; z-index: 40;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px;
  background: linear-gradient(180deg, rgba(13, 18, 42, .92), rgba(10, 14, 34, .88));
  border-right: 1px solid var(--border); backdrop-filter: blur(14px); scrollbar-width: thin;
}
[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .82); }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; display: block; flex: 0 0 auto; box-shadow: var(--shadow-glow); }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .01em; white-space: nowrap; }
.brand-name small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.nav-section { margin-top: 8px; }
.nav-section-title { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 8px 12px 4px; white-space: nowrap; }

/* ── Sidebar Section Dropdowns (Accordion) ── */
details.nav-dropdown { margin-top: 4px; }
details.nav-dropdown > summary.nav-section-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 7px 12px; white-space: nowrap; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; user-select: none;
  border-radius: 10px; transition: color .15s, background .15s;
}
details.nav-dropdown > summary.nav-section-title::-webkit-details-marker { display: none; }
details.nav-dropdown > summary.nav-section-title:hover { color: var(--text); background: var(--surface-hover); }
details.nav-dropdown > summary.nav-section-title .nav-chevron {
  font-size: 9px; color: var(--muted); display: inline-block; transition: transform .2s ease;
  line-height: 1; margin-left: auto;
}
details.nav-dropdown[open] > summary.nav-section-title .nav-chevron {
  transform: rotate(90deg); color: var(--text-2);
}
details.nav-dropdown .nav-section-items { display: grid; gap: 2px; padding: 2px 0 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--text-2);
  font-weight: 550; font-size: 14px; position: relative; white-space: nowrap; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-link .ico { width: 24px; text-align: center; font-size: 17px; flex: 0 0 auto; }
.nav-link.active { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--grad); }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--text); }
.user-chip:hover { background: var(--surface-hover); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--grad); color: #fff; flex: 0 0 auto; font-size: 14px; }
.user-chip .who { min-width: 0; line-height: 1.25; }
.user-chip .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }
[data-sidebar="mini"] .brand-name, [data-sidebar="mini"] .nav-section-title, [data-sidebar="mini"] .nav-link .label,
[data-sidebar="mini"] .user-chip .who, [data-sidebar="mini"] .sidebar .hide-mini { display: none; }
[data-sidebar="mini"] .nav-link { justify-content: center; padding: 10px 0; }
[data-sidebar="mini"] .nav-section { margin-top: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(14px, 3vw, 32px); backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7, 11, 26, .86), rgba(7, 11, 26, .55)); border-bottom: 1px solid var(--border); }
[data-theme="light"] .topbar { background: rgba(244, 245, 251, .85); }
.page-head { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.page-ico { font-size: 24px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); flex: 0 0 auto; }
.page-title { font-weight: 800; font-size: clamp(1.05rem, .95rem + .6vw, 1.35rem); line-height: 1.2; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 16px; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.search-btn { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; }
.search-btn:hover { color: var(--text-2); border-color: var(--border-strong); }
.menu-btn { display: none; }
.content { padding: clamp(14px, 2.6vw, 30px) clamp(14px, 3vw, 32px) 60px; width: 100%; max-width: 1240px; margin: 0 auto;
  animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.loading-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 100;
  box-shadow: 0 0 12px rgba(139, 92, 246, .8); transition: width .3s ease, opacity .4s ease; opacity: 0; }
.loading-bar.on { opacity: 1; width: 75%; transition: width 6s cubic-bezier(.1, .7, .2, 1); }
.loading-bar.done { opacity: 0; width: 100%; transition: width .2s, opacity .5s .2s; }
.scrim { display: none; }

/* ── Cards & layout helpers ────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card + .card, .card + .stack, .stack + .card { margin-top: 16px; }
/* Phones and tablets: blurring what is behind every card costs more than it shows — solid surfaces scroll smoothly */
@media (max-width: 900px), (pointer: coarse) {
  .card { backdrop-filter: none; background: var(--surface-solid); }
  .sidebar, .topbar { backdrop-filter: none; }
  .topbar, [data-theme] .topbar { background: var(--bg); }
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card.glow { position: relative; }
.card.glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; }
.hero { background: radial-gradient(500px 220px at 90% 0%, rgba(34, 211, 238, .16), transparent 70%),
  radial-gradient(600px 260px at 0% 100%, rgba(139, 92, 246, .22), transparent 70%), var(--surface); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Stats ─────────────────────────────────────────────────────────────── */
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.stat .value small { font-size: .55em; color: var(--muted); font-weight: 600; }
.stat .delta { font-size: 12px; font-weight: 700; margin-top: 2px; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }
.tier-pill { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s ease, box-shadow .2s, background .15s, border-color .15s, opacity .15s; }
.btn:hover { text-decoration: none; border-color: var(--primary); background: var(--surface-hover); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.htmx-request { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); border-color: transparent; }
.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .45); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); border-color: transparent; color: var(--text); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn .spin { display: none; }
.btn.htmx-request .spin { display: inline-block; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: rgba(8, 12, 30, .55); color: var(--text); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
[data-theme="light"] .input, [data-theme="light"] .select, [data-theme="light"] .textarea { background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--surface-solid); color: var(--text); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: var(--muted); cursor: pointer; padding: 6px; font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.strength { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.strength > i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .25s, background .25s; }

/* segmented control (radio group) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2);
  border: 1px solid var(--border); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px; font-size: 13.5px;
  font-weight: 650; color: var(--text-2); transition: background .15s, color .15s; white-space: nowrap; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--grad); color: #fff; box-shadow: var(--shadow-glow); }
.seg input:focus-visible + span { box-shadow: var(--ring); }

/* MCQ / Mains format picker: show the matching count selector */
.fmt-picker:has(input[name=fmt][value=mcq]:checked) .only-mains,
.fmt-picker:has(input[name=fmt][value=mains]:checked) .only-mcq { display: none; }

/* chip multi-select (checkbox group) */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-strong);
  font-size: 13px; color: var(--text-2); transition: all .15s; }
.chips input:checked + span { background: var(--grad-soft); border-color: var(--primary); color: var(--text); }
.chips input:focus-visible + span { box-shadow: var(--ring); }

/* file drop zone */
.drop { position: relative; display: grid; place-items: center; gap: 6px; text-align: center; padding: 22px 16px;
  border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s; }
.drop:hover, .drop.drag { border-color: var(--primary); background: var(--grad-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .big { font-size: 28px; }
.drop .files { font-size: 12.5px; color: var(--text-2); }

/* ── Alerts, badges, toasts ────────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  border: 1px solid; margin: 8px 0; animation: rise .25s ease both; }
.alert > span { flex: 0 0 auto; }
.alert > div { min-width: 0; overflow-wrap: anywhere; }
.alert-info { background: rgba(96, 165, 250, .10); border-color: rgba(96, 165, 250, .35); }
.alert-success { background: rgba(52, 211, 153, .10); border-color: rgba(52, 211, 153, .38); }
.alert-warn { background: rgba(251, 191, 36, .10); border-color: rgba(251, 191, 36, .40); }
.alert-error { background: rgba(248, 113, 113, .10); border-color: rgba(248, 113, 113, .45); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px;
  font-weight: 700; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }
.badge.solid { border-color: transparent; color: #fff; }
.badge.ok { color: var(--success); border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .08); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .08); }
.badge.bad { color: var(--danger); border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); }
.badge.violet { color: #c4b5fd; border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .12); }
[data-theme="light"] .badge.violet { color: var(--primary); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: toast-in .25s ease both; }
.toast.out { animation: toast-out .3s ease both; }
.toast.success { border-color: rgba(52, 211, 153, .5); } .toast.error { border-color: rgba(248, 113, 113, .55); }
.toast.warn { border-color: rgba(251, 191, 36, .55); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 650;
  font-size: 14px; cursor: pointer; white-space: nowrap; border-radius: 10px 10px 0 0; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"], .tab.active { color: var(--text); }
.tab[aria-selected="true"]::after, .tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 3px; border-radius: 3px; background: var(--grad); }
.tab .count { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); margin-left: 4px; color: var(--text-2); }
.tab-panel[hidden] { display: none; }

/* ── Disclosure (dropdowns) ────────────────────────────────────────────── */
details.dd { border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); margin: 10px 0; overflow: hidden; }
details.dd > summary { list-style: none; cursor: pointer; padding: 11px 14px; font-weight: 650; display: flex; gap: 10px;
  align-items: center; user-select: none; }
details.dd > summary::-webkit-details-marker { display: none; }
details.dd > summary::after { content: "▸"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.dd[open] > summary::after { transform: rotate(90deg); }
details.dd > summary:hover { background: var(--surface-hover); }
details.dd > .dd-body { padding: 4px 16px 14px; border-top: 1px solid var(--border); }
details.dd.gold { border-color: rgba(251, 191, 36, .45); }
details.dd.gold > summary { color: var(--warn); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); margin: 10px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; position: sticky; top: 0; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(139, 92, 246, .05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix td, .matrix th { text-align: center; padding: 7px 8px; }
.matrix td:first-child, .matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface-solid); z-index: 1; }

/* ── Markdown (AI output) ──────────────────────────────────────────────── */
.md { overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .45em; }
.md h3 { font-size: 1.05rem; color: var(--text); }
.md :first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 1.3em; margin: .3em 0 .9em; }
.md li { margin: .25em 0; }
.md blockquote { margin: .8em 0; padding: .4em 1em; border-left: 3px solid var(--primary); background: var(--surface-2);
  border-radius: 0 10px 10px 0; color: var(--text-2); }
.md table { font-size: 13px; }
.md pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; }
.md strong { color: var(--text); }

/* ── Empty states & loaders ────────────────────────────────────────────── */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 6px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
.spin.dark { border-color: var(--border-strong); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.job { padding: 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--grad-soft); }
.job .title { font-weight: 700; display: flex; gap: 10px; align-items: center; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; border-radius: 8px; background: var(--grad); transition: width .5s ease; position: relative; }
.progress.indeterminate > i { width: 35% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; height: 14px; margin: 8px 0; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Quiz ──────────────────────────────────────────────────────────────── */
.quiz-bar { position: sticky; top: 66px; z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); margin-bottom: 14px; flex-wrap: wrap; }
.quiz-bar .progress { flex: 1; min-width: 120px; margin: 0; }
.q { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--surface); margin: 14px 0; scroll-margin-top: 140px; }
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; font-weight: 650; margin-bottom: 8px; }
.q-num { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 12.5px; }
.q-text { white-space: pre-wrap; font-size: 15.5px; line-height: 1.6; margin: 0 0 12px; }
.opts { display: grid; gap: 8px; }
.opt { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--primary); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .key { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800;
  font-size: 13px; border: 1px solid var(--border-strong); color: var(--text-2); }
.opt .txt { padding-top: 3px; min-width: 0; overflow-wrap: anywhere; }
.opt:has(input:checked) { border-color: var(--primary); background: var(--grad-soft); }
.opt:has(input:checked) .key { background: var(--grad); color: #fff; border-color: transparent; }
.opt:has(input:focus-visible) { box-shadow: var(--ring); }
.opt.correct { border-color: rgba(52, 211, 153, .7); background: rgba(52, 211, 153, .12); cursor: default; }
.opt.correct .key { background: var(--success); color: #062016; border-color: transparent; }
.opt.wrong { border-color: rgba(248, 113, 113, .75); background: rgba(248, 113, 113, .12); cursor: default; }
.opt.wrong .key { background: var(--danger); color: #2a0606; border-color: transparent; }
.opt.plain { cursor: default; opacity: .8; }
.opt .mark { margin-left: auto; font-size: 16px; flex: 0 0 auto; }
.verdict { margin-top: 10px; font-size: 13px; font-weight: 700; }
.verdict.ok { color: var(--success); } .verdict.bad { color: var(--danger); } .verdict.skip { color: var(--muted); }
.score-hero { text-align: center; padding: 26px 18px; }
.score-ring { --p: 0; --c: var(--success); width: 132px; height: 132px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.score-ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--surface-solid); display: grid; place-items: center;
  font-size: 26px; font-weight: 800; }

/* ── Mains result ──────────────────────────────────────────────────────── */
.marks-card { text-align: center; padding: 22px; border-radius: 18px; border: 2px solid var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, var(--primary)) 9%, var(--surface)); }
.marks-card .big { font-size: 46px; font-weight: 800; color: var(--c, var(--primary)); line-height: 1.1; }
.marks-card .big small { font-size: 22px; color: var(--muted); }
.crit { padding: 10px 0; border-bottom: 1px solid var(--border); }
.crit:last-child { border-bottom: 0; }
.crit .bar { height: 6px; border-radius: 4px; background: var(--surface-2); margin: 6px 0 4px; overflow: hidden; }
.crit .bar > i { display: block; height: 100%; border-radius: 4px; }
.cov { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.cov:last-child { border-bottom: 0; }
.chat { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.msg { padding: 10px 14px; border-radius: 14px; max-width: 92%; }
.msg.user { justify-self: end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { justify-self: start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.qcard { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: var(--surface); }

/* ── News ──────────────────────────────────────────────────────────────── */
.news-item { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin: 10px 0; overflow: hidden; }
.news-item > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.news-item > summary::-webkit-details-marker { display: none; }
.news-item > summary:hover { background: var(--surface-hover); }
.news-item[open] > summary { border-bottom: 1px solid var(--border); }
.news-title { font-weight: 650; line-height: 1.4; }
.news-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.src-badge { color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; letter-spacing: .03em; text-transform: uppercase; }
.news-body { padding: 14px 16px 16px; }
.news-end { gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.news-item { scroll-margin-top: 76px; }
/* Narrow phones: long syllabus/topic tags, keywords and unbroken words wrap instead of running past the card's edge
   (.news-item clips its overflow) */
.brief, .news-item > summary { overflow-wrap: anywhere; }
.brief .badge, .brief .fmt-badge, .news-meta .badge { white-space: normal; max-width: 100%; }
.kw b { flex: 0 1 auto; max-width: 45%; }
.kw span { flex: 1 1 0; min-width: 0; }
.score-dot { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800;
  font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.kw { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }
.kw b { flex: 0 0 auto; background: rgba(139, 92, 246, .22); color: #ddd6fe; padding: 2px 10px; border-radius: 99px; font-size: 12px; }
[data-theme="light"] .kw b { color: var(--primary); }
.spotlight { border: 1px solid rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .07); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }

/* ── Heatmap, streak grid, charts ──────────────────────────────────────── */
.hm { overflow-x: auto; padding-bottom: 4px; }
.hm-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; width: max-content; }
.hm-months { display: grid; grid-auto-flow: column; gap: 3px; font-size: 10.5px; color: var(--muted); margin: 0 0 4px 30px; width: max-content; }
.hm-months span { width: 12px; overflow: visible; white-space: nowrap; }
.hm-wrap { display: flex; gap: 6px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; font-size: 9.5px; color: var(--muted); width: 24px; }
.hm-cell { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.hm-cell.out { visibility: hidden; }
.hm-cell:hover { transform: scale(1.3); }
.l1 { background: #6b1414; border-color: #851e1e; } .l2 { background: #a81d1d; border-color: #c52828; }
.l3 { background: #e11d48; border-color: #f43f5e; } .l4 { background: #ff0033; border-color: #ff4d6d; box-shadow: 0 0 6px #ff003399; }
.mains .l1 { background: #3b0764; border-color: #581c87; } .mains .l2 { background: #7e22ce; border-color: #9333ea; }
.mains .l3 { background: #a855f7; border-color: #c084fc; } .mains .l4 { background: #f0abfc; border-color: #e879f9; box-shadow: 0 0 6px #e879f999; }
.streak-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 3px; width: max-content; }
.sg { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); }
.sg.good { background: #16a34a; } .sg.mid { background: #ca8a04; } .sg.low { background: #dc2626; } .sg.future { opacity: .3; }
.marks-chart, .mini-chart { width: 100%; height: auto; display: block; }
.marks-chart { aspect-ratio: 760 / 300; } .mini-chart { aspect-ratio: 600 / 180; }
.marks-chart .grid, .mini-chart .grid { stroke: var(--border); stroke-width: 1; }
.marks-chart .axis, .mini-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.marks-chart .bench { stroke: #f43f5e; stroke-width: 1.6; stroke-dasharray: 7 4 2 4; }
.marks-chart .bench-label { fill: #f43f5e; font-size: 11px; font-weight: 700; font-family: var(--font); }
.traj { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.traj-prelims { stroke: #eab308; } .traj-mains { stroke: #06b6d4; }
circle.pt { stroke-width: 2; fill: var(--surface-solid); cursor: pointer; }
circle.pt.traj-prelims { stroke: #eab308; } circle.pt.traj-mains { stroke: #06b6d4; }
circle.pt:hover { r: 7; }
.latest-ring { fill: rgba(239, 68, 68, .2); stroke: #ef4444; stroke-width: 2.5; pointer-events: none; }
/* Admin → Analytics (analytics.combo_svg): columns = accent, line = primary; scrolls sideways on phones */
.an-scroll { overflow-x: auto; }
.an-chart { width: 100%; min-width: 480px; height: auto; display: block; aspect-ratio: 600 / 220; }
.an-chart .grid { stroke: var(--border); stroke-width: 1; }
.an-chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.an-chart .an-col { fill: var(--accent); }
.an-chart .an-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.an-chart .an-dot { fill: var(--primary); stroke: var(--surface-solid); stroke-width: 2; }
.an-chart .hit { fill: var(--text); fill-opacity: 0; cursor: default; }
.an-chart .hit:hover { fill-opacity: .06; }
.an-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 2px 0 8px; font-size: 12.5px; color: var(--text-2); }
.an-key { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--accent); vertical-align: -1px; }
.an-key.line { width: 14px; height: 2px; border-radius: 1px; background: var(--primary); vertical-align: 3px; }
.an-bar { height: 5px; min-width: 60px; margin-top: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.an-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.legend { display: flex; gap: 4px; align-items: center; font-size: 11px; color: var(--muted); }

/* ── Command palette ───────────────────────────────────────────────────── */
dialog.cmdk { border: 1px solid var(--border-strong); border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px));
  background: var(--surface-solid); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); margin-top: 12vh; }
dialog.cmdk::backdrop { background: rgba(3, 6, 18, .6); backdrop-filter: blur(4px); }
.cmdk input { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text);
  font: inherit; font-size: 16px; padding: 16px 18px; outline: none; }
.cmdk ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.cmdk li a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.cmdk li a:hover, .cmdk li.sel a { background: var(--grad-soft); text-decoration: none; }
.cmdk li small { color: var(--muted); margin-left: auto; font-size: 12px; }

/* ── Auth pages ────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column;
  justify-content: space-between; border-right: 1px solid var(--border);
  background: radial-gradient(600px 400px at 20% 20%, rgba(139, 92, 246, .35), transparent 60%),
    radial-gradient(500px 400px at 80% 80%, rgba(34, 211, 238, .22), transparent 60%), var(--bg-2); }
.auth-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.auth-art h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 3rem); line-height: 1.12; margin-top: 30px; position: relative; z-index: 1; }
.auth-art .feats { display: grid; gap: 12px; position: relative; z-index: 1; margin-top: 26px; }
.auth-art .feat { display: flex; gap: 12px; align-items: center; color: var(--text-2); }
.auth-art .feat i { font-style: normal; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--border); }
.auth-main { display: grid; place-items: center; padding: 28px 18px; }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { font-size: 1.6rem; margin-bottom: 4px; }
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp input { width: 100%; max-width: 52px; height: 58px; text-align: center; font-size: 24px; font-weight: 800; border-radius: 13px;
  border: 1px solid var(--border-strong); background: rgba(8, 12, 30, .55); color: var(--text); font-family: var(--mono); }
[data-theme="light"] .otp input { background: #fff; }
.otp input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.trust-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 18px; justify-content: center; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-105%);
    transition: transform .25s ease; box-shadow: var(--shadow); }
  [data-sidebar="mini"] { --sidebar-w: 264px; }
  [data-sidebar="mini"] .brand-name, [data-sidebar="mini"] .nav-section-title, [data-sidebar="mini"] .nav-link .label,
  [data-sidebar="mini"] .user-chip .who, [data-sidebar="mini"] .sidebar .hide-mini { display: revert; }
  [data-sidebar="mini"] .nav-link { justify-content: flex-start; padding: 9px 12px; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(3, 6, 18, .55); z-index: 35; backdrop-filter: blur(2px); }
  .menu-btn { display: grid; }
  .collapse-btn, .search-btn .label { display: none; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .quiz-bar { top: 62px; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .card { padding: 15px; border-radius: 14px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 11px 12px; } .stat .value { font-size: 1.3rem; }
  .page-ico { display: none; }
  .page-sub { display: none; }
  .topbar { gap: 8px; padding: 10px 12px; }
  .search-btn { padding: 0 10px; }
  .search-btn kbd { display: none; }
  .content { padding: 14px 12px 50px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .seg span { padding: 7px 10px; font-size: 13px; }
  .otp input { height: 52px; font-size: 21px; }
  .q { padding: 13px; }
  th, td { padding: 8px 9px; }
  .hide-sm { display: none !important; }
}
@media (pointer: coarse) {
  .input, .select, .textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .toasts, .no-print { display: none !important; }
  .shell { display: block; } body { background: #fff; color: #000; }
}
@media (min-width: 901px) { .hide-lg { display: none !important; } }
.range-picker .only-custom { display: none; }
.range-picker:has(input[name=preset][value=custom]:checked) .only-custom { display: grid; }
form:has(input[name=mode][value=combined]:checked) .only-separate,
form:has(input[name=mode][value=separate]:checked) .only-combined { display: none; }
.grid > .card + .card, .grid-2 > .card + .card, .grid-3 > .card + .card, .grid-4 > .card + .card { margin-top: 0; }
.badge.wrap { white-space: normal; }
.btn { max-width: 100%; }
@media (max-width: 600px) { .btn { white-space: normal; text-align: center; line-height: 1.3; } }

.fmt-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px;
  font-weight: 700; color: var(--warn); border: 1px solid rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .08); white-space: nowrap; }
.q-fmt { color: var(--muted); font-weight: 650; font-size: .92em; white-space: nowrap; }
.wc-ok { color: var(--success) !important; } .wc-warn { color: var(--warn) !important; } .wc-bad { color: var(--danger) !important; }
#news-form:has(input[name=quota_enabled]:not(:checked)) .limits-box { opacity: .45; }
.ca-volume-form:has(input[name=mode][value=auto]:checked) .vol-manual,
.ca-volume-form:has(input[name=mode][value=manual]:checked) .vol-auto-note { display: none; }

/* ── Visual UPSC brief (Current Affairs) ───────────────────────────────── */
.brief { display: grid; gap: 12px; }
.brief-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tldr { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 15.5px; font-weight: 600;
  line-height: 1.5; background: var(--grad-soft); border: 1px solid var(--border-strong); }
.tldr-k { flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 8px; background: var(--grad); color: #fff; margin-top: 2px; }
.brief-sec { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.brief-sec h4 { margin: 0 0 8px; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.brief-sec.ed { border-color: rgba(139, 92, 246, .45); }
.brief-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kp { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.kp li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.kp li.must { background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4); font-weight: 600; }
.kp .star { color: var(--warn); flex: 0 0 auto; }
.kp-t { margin-left: auto; flex: 0 0 auto; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 1px 6px; }
.for-against { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fa-h { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.fa-h.ok { color: var(--success); } .fa-h.bad { color: var(--danger); }
.fa-i { font-size: 13.5px; padding: 7px 10px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 8px 8px 0; margin-bottom: 6px; line-height: 1.5; }
.quote { margin: 10px 0 0; padding: 8px 14px; border-left: 3px solid var(--primary); font-style: italic; color: var(--text-2); }
.osm { position: relative; height: 210px; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: #aad3df; }
.osm img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
[data-theme="dark"] .osm img { filter: brightness(.82) contrast(1.05) saturate(.85); }
.osm .pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); font-size: 30px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.osm-attr { position: absolute; right: 4px; bottom: 3px; font-size: 9.5px; background: rgba(255, 255, 255, .8); color: #333; padding: 0 4px; border-radius: 4px; }
.num-chart { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.num-chart .nc-label { fill: var(--text-2); font-size: 12px; font-family: var(--font); }
.num-chart .nc-value { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font); }
.num-chart .nc-bar { fill: var(--primary); }
.num-chart .nc-bar:hover { fill: var(--primary-2); }
.num-chart .nc-axis { stroke: var(--border-strong); stroke-width: 1; }
.num-tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.num-tile { padding: 9px 11px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.num-tile .nv { font-size: 1.15rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.num-tile .nl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border-strong); display: grid; gap: 10px; }
.timeline li { position: relative; display: flex; gap: 10px; font-size: 13.5px; flex-wrap: wrap; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--grad); }
.tl-when { font-weight: 800; color: var(--accent); min-width: 54px; }
.fw { display: grid; gap: 8px; }
.fw-i { padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; }
.sdgs { display: grid; gap: 8px; }
.sdg { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.sdg-n { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; flex: 0 0 auto; }
.memo { padding: 14px 16px; border-radius: 14px; border: 1px dashed rgba(34, 211, 238, .6); background: rgba(34, 211, 238, .07); }
.memo-k { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.memo-m { font-size: 1.6rem; font-weight: 800; letter-spacing: .08em; margin: 4px 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
details.flash { border: 1px solid var(--border); border-radius: 10px; margin: 6px 0; background: var(--surface); }
details.flash > summary { cursor: pointer; padding: 9px 12px; font-size: 13.5px; font-weight: 600; list-style: none; }
details.flash > summary::-webkit-details-marker { display: none; }
details.flash > summary::before { content: "❓ "; }
details.flash[open] > summary::before { content: "💡 "; }
details.flash > div { padding: 0 12px 10px; font-size: 13.5px; color: var(--success); }
.brief-sec.mq { border-color: rgba(251, 191, 36, .45); }
.news-tldr { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.45; }
.news-item.is-read { opacity: .78; }
.news-item.is-read .news-title { font-weight: 550; }
.inline-form { display: inline; }
.count { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); margin-left: 4px; color: var(--text-2); }
.btn-primary .count { background: rgba(255, 255, 255, .25); color: #fff; }
.test-banner { margin: -4px 0 14px; padding: 9px 14px; border-radius: 12px; font-size: 13.5px; border: 1px dashed rgba(251, 191, 36, .6);
  background: rgba(251, 191, 36, .08); }

@media (max-width: 1024px) {
  .brief-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .for-against { grid-template-columns: minmax(0, 1fr); }
  .tldr { font-size: 14.5px; padding: 12px; }
  .memo-m { font-size: 1.3rem; }
  .osm { height: 180px; }
  .search-form, .search-form .input { width: 100%; min-width: 0 !important; }
  .kp-t { display: none; }
}
.quick-actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
@media (max-width: 600px) { .num-chart { display: none; } }

/* ── Mind maps (branch hues: validated 8-slot categorical palette, light / dark steps) ── */
.mm-c0 { --c: #2a78d6; } .mm-c1 { --c: #eb6834; } .mm-c2 { --c: #1baf7a; } .mm-c3 { --c: #eda100; }
.mm-c4 { --c: #e87ba4; } .mm-c5 { --c: #008300; } .mm-c6 { --c: #4a3aa7; } .mm-c7 { --c: #e34948; }
[data-theme="dark"] .mm-c0 { --c: #3987e5; } [data-theme="dark"] .mm-c1 { --c: #d95926; } [data-theme="dark"] .mm-c2 { --c: #199e70; }
[data-theme="dark"] .mm-c3 { --c: #c98500; } [data-theme="dark"] .mm-c4 { --c: #d55181; } [data-theme="dark"] .mm-c5 { --c: #008300; }
[data-theme="dark"] .mm-c6 { --c: #9085e9; } [data-theme="dark"] .mm-c7 { --c: #e66767; }
.mm-scroll { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-solid); padding: 6px; }
.mm-svg { width: 100%; height: auto; display: block; }
.mm-svg text { font-family: var(--font); }
.mm-svg .mm-t { fill: var(--text); } .mm-svg .mm-lt { fill: var(--text-2); } .mm-svg .mm-ct { fill: #fff; }
.mm-svg .mm-cbox { fill: var(--primary-2); }
.mm-svg .mm-bbox { fill: var(--surface-solid); stroke: var(--c); stroke-width: 2; }
.mm-svg .mm-lbox { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.mm-svg .mm-lbar { fill: var(--c); }
.mm-svg .mm-line { fill: none; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; opacity: .85; }
.mm-svg g:hover .mm-line { stroke-width: 3; opacity: 1; }
.mm-outline { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.mm-ob { border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.mm-ob-h { font-weight: 800; margin-bottom: 4px; }
.mm-ob ul { margin: 0; padding-left: 1.1em; font-size: 13.5px; }
.mm-search { display: flex; gap: 10px; flex-wrap: wrap; }
.mm-search .input { flex: 1; min-width: 0; }
.input-lg { min-height: 50px; font-size: 16px; border-radius: 14px; }
.mm-suggest { margin-top: 8px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface-solid); overflow: hidden;
  box-shadow: var(--shadow); }
.mm-sg { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); font-size: 14px; }
.mm-sg:last-child { border-bottom: 0; }
.mm-sg:hover { background: var(--grad-soft); text-decoration: none; }
.mm-sg-make { color: var(--accent); }
.mm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.mm-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); transition: border-color .15s, transform .15s; }
.mm-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.mm-card-h { display: block; font-weight: 750; color: var(--text); }
.mm-card-h:hover { text-decoration: none; color: var(--primary); }
.mm-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mm-chips a { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text-2); }
.mm-chips a:hover { border-color: var(--primary); color: var(--text); text-decoration: none; }
/* Mind map "Test yourself" (app.js): leaves go blank until tapped */
.mm-svg .mm-q { display: none; fill: var(--c); }
.mm-svg .mm-lt { transition: opacity .15s; }
.mm-recall .mm-leaf, .mm-recall .mm-bnode { cursor: pointer; }
.mm-recall .mm-leaf:not(.shown) .mm-lt { opacity: 0; }
.mm-recall .mm-leaf:not(.shown) .mm-q { display: inline; }
.mm-recall .mm-leaf:not(.shown) .mm-lbox { stroke: var(--c); stroke-dasharray: 4 3; }
/* Memory tricks (partials/trick.html); "Test yourself" blanks what each cue stands for */
.tk-list { display: grid; gap: 10px; }
.tk-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tk { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.tk-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.tk-badge { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--grad-soft); color: var(--text-2); }
.tk-word { font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; color: var(--primary); margin: 2px 0 6px; overflow-wrap: anywhere; }
.tk-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tk-item { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.tk-cue { min-width: 2.2em; font-weight: 800; color: var(--accent); }
.tk-x { margin-top: 6px; color: var(--text-2); }
.mm-recall .tk-item, .mm-recall .tk-word { cursor: pointer; }
.mm-recall .tk-item:not(.shown) .tk-t { color: transparent; background: var(--border); border-radius: 6px; user-select: none; }
.trap { border-left: 3px solid var(--border-strong); padding: 4px 10px; margin: 6px 0; font-size: 13.5px; }
.trap-w { color: var(--text-2); }
.trap-r { font-weight: 600; }
/* Maths / reasoning answers: the shortcut and the long method (partials/q_methods.html) */
.qm { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin-top: 8px; background: var(--surface-2); font-size: 14px; }
.qm ol { margin: 4px 0 0; padding-left: 1.3em; line-height: 1.6; }
.qm-fast { border-color: var(--accent); }
.show-sm { display: none; }
@media (max-width: 760px) {
  .mm-svg { min-width: 900px; }
  .show-sm { display: block; }
}

/* ── Mistake Book: keep / remove after a fix ─────────────────────────────── */
.mk-decide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.mk-decide form { margin: 0; }
.mk-fixed { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.mk-row { padding: 12px 0; border-top: 1px solid var(--border); }
.mk-row:first-of-type { border-top: 0; }
.mk-row .q-text { margin: 6px 0; }

/* ── multi-day fetch task card ───────────────────────────────────────────── */
.task-card { margin-top: 12px; border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.task-card.is-running .progress > i { background-size: 200% 100%; animation: task-shimmer 1.6s linear infinite; }
@keyframes task-shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
.text-danger { color: var(--danger); font-weight: 600; }
.range-form .seg { flex-wrap: wrap; }
.test-form .only-random { display: none; }
.test-form:has(input[name=preset][value=random]:checked) .only-random { display: grid; }

/* ── Big PDF Splitter ────────────────────────────────────────────────────── */
.book-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.book-row:last-child { border-bottom: 0; }
.book-row:hover { background: var(--surface-2); }
.part-card { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
tr.is-current td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
td.nowrap { white-space: nowrap; }

/* ── Plan & billing ────────────────────────────────────────────────────── */
.plan-badge { width: 58px; height: 58px; flex: none; display: grid; place-items: center; font-size: 28px; border-radius: 16px;
  background: var(--grad-soft); border: 1px solid var(--border-strong); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.plan-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:has(input:checked) { border-color: var(--primary); background: var(--grad-soft); box-shadow: var(--shadow-glow); }
.plan-card:has(input:focus-visible) { box-shadow: var(--ring); }
.plan-card:has(input:checked)::after { content: "✓"; position: absolute; top: 12px; right: 14px; width: 22px; height: 22px;
  display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-size: 13px; font-weight: 800; }
.plan-name { font-weight: 700; padding-right: 28px; }
.plan-price { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-note { font-size: 12.5px; color: var(--text-2); }
.plan-tag { align-self: flex-start; max-width: calc(100% - 30px); margin-bottom: 2px; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted); border: 1px solid var(--border-strong); }
.plan-tag.star { background: var(--grad); border-color: transparent; color: #fff; }
.plan-was { font-size: .62em; font-weight: 600; color: var(--muted); text-decoration-thickness: 2px; }
.plan-offer { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--warn); }

/* ── Public pages (payment link, payment result, privacy, account deletion) ── */
.public { width: min(680px, 100%); margin: 0 auto; padding: 22px 16px 34px; }
.public.landing-page { width: min(1080px, 100%); }
.public-top { margin-bottom: 16px; }
.public-card { padding: 26px; }
.public-card h1 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.public-card h3 { margin-top: 1.3em; }
.public-card ul, .public-card ol { padding-left: 1.2em; margin: 0 0 .8em; }
.public-card li { margin-bottom: .35em; }
.landing-hero { padding: clamp(28px, 6vw, 64px); text-align: center; }
.landing-hero h1 { max-width: 820px; margin: 0 auto .6em; font-size: clamp(2rem, 1.35rem + 3vw, 3.6rem); line-height: 1.08; }
.landing-hero > p { max-width: 720px; margin: 0 auto 1.5em; font-size: clamp(1rem, .9rem + .5vw, 1.2rem); }
.landing-actions { justify-content: center; }
.landing-section { margin-top: 18px; }
.landing-section > h2 { margin-top: 0; }
.landing-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.landing-feature { padding: 20px; }
.landing-feature h3 { margin: .4em 0; }
.landing-feature p { margin-bottom: 0; }
.landing-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.landing-step { padding: 18px; }
.landing-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 4px; color: var(--muted); font-size: 13px; }
.landing-footer a { color: inherit; }
.facts { display: grid; gap: 8px; margin: 16px 0 18px; }
.facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px; border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--border); }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 700px) { .landing-features, .landing-steps { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .public-card { padding: 20px 16px; } .facts > div { flex-direction: column; gap: 2px; } .facts dd { text-align: left; } }

/* ── Public top navigation (front page, About) ─────────────────────────────── */
.topnav { position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 8px 10px 8px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(11, 17, 40, .84); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); }
[data-theme="light"] .topnav { background: rgba(255, 255, 255, .88); }
.topnav-links { display: flex; gap: 2px; margin-right: auto; }
.topnav-links a { padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.topnav-links a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.topnav-links a[aria-current="page"] { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--border-strong); }
.topnav-links a.topnav-insta { color: var(--pink); }
.topnav-actions { gap: 8px; flex-wrap: nowrap; }
.landing-page section[id] { scroll-margin-top: 90px; }
@media (max-width: 760px) {
  .topnav { top: 6px; gap: 8px 10px; padding: 8px 10px; }
  .topnav .brand { margin-right: auto; }
  .topnav .brand-name small { display: none; }
  /* second row: the page links (scroll sideways if needed) with the theme toggle beside them */
  .topnav-links { order: 3; flex: 1 1 calc(100% - 60px); min-width: 0; margin-right: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav-theme { order: 4; width: 34px; height: 34px; }
  .topnav-links a { padding: 6px 10px; font-size: 13.5px; }
}

/* ── Landing page: screenshots, prices, FAQ ────────────────────────────── */
.landing-shot-wide { margin: 0 0 14px; padding: 10px; }
.landing-shot-wide img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.landing-shot-wide figcaption { margin: 8px 4px 0; }
.landing-shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 12px; overflow-x: auto;
  padding: 6px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.landing-shots figure { margin: 0; scroll-snap-align: start; }
.landing-shots img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); }
.landing-shots figcaption { margin-top: 6px; font-size: 12.5px; color: var(--text-2); text-align: center; }
.landing-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.landing-price { display: flex; flex-direction: column; gap: 4px; }
.landing-price h3 { margin: 4px 0 0; font-size: 1rem; }
.landing-price.best { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.landing-faq details { margin-top: 10px; }
.landing-faq summary { cursor: pointer; }
.landing-faq details p { margin: 10px 0 0; }
@media (max-width: 760px) { .landing-shots { grid-auto-columns: 44%; } }

/* ── Screenshot zoom (img[data-zoom], app.js): the picture grows out of its place over a fading backdrop ── */
img[data-zoom] { cursor: zoom-in; transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease; }
img[data-zoom]:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
img[data-zoom]:focus-visible { outline: none; box-shadow: var(--ring); }
img[data-zoom].zoom-lifted { opacity: 0; transition: none; }
html.zoom-lock { overflow: hidden; }
.zoom { position: fixed; inset: 0; z-index: 300; cursor: zoom-out; touch-action: pinch-zoom; }
.zoom-bg { position: absolute; inset: 0; background: rgba(4, 6, 16, .84); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .4s ease; }
.zoom-img { position: fixed; max-width: none; transform-origin: 0 0; border-radius: 14px; background: #0b1128;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .35s ease, border-radius .4s cubic-bezier(.2, .8, .2, 1); }
.zoom-cap { position: fixed; left: 70px; right: 70px; bottom: 18px; margin: 0; text-align: center; color: #e4e7fb;
  font-size: 14px; line-height: 1.4; }
.zoom-btn { position: fixed; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; }
.zoom-btn:hover { background: rgba(255, 255, 255, .22); }
.zoom-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(139, 92, 246, .7); }
.zoom-close { top: 14px; right: 14px; font-size: 18px; }
.zoom-prev, .zoom-next { top: 50%; margin-top: -22px; font-size: 30px; }
.zoom-prev { left: 18px; } .zoom-next { right: 18px; }
.zoom-cap, .zoom-btn { opacity: 0; transition: opacity .3s ease .1s, background .15s; }
.zoom.open .zoom-bg, .zoom.open .zoom-cap, .zoom.open .zoom-btn { opacity: 1; }
@media (max-width: 699px) {
  .zoom-prev, .zoom-next { top: auto; bottom: 14px; margin-top: 0; }
  .zoom-cap { left: 66px; right: 66px; bottom: 16px; font-size: 13px; }
}

/* ── Free plan ───────────────────────────────────────────────────────────── */
.nowrap { white-space: nowrap; }
.tryout-banner { border-color: rgba(139, 92, 246, .6); }
.tryout-meters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tryout-meter .progress { margin-top: 10px; height: 6px; }
.tryout-meter.spent { opacity: .6; }
.tryout-tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.tryout-tools > .card + .card { margin-top: 0; }
.tryout-tool { display: flex; flex-direction: column; gap: 6px; color: inherit; transition: border-color .15s, transform .15s; }
.tryout-tool:hover { border-color: var(--primary); transform: translateY(-1px); }
.tryout-tool .big { font-size: 28px; }
.tryout-tool .btn { align-self: flex-start; margin-top: auto; }
.signup-tryout { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px;
  border: 1px dashed rgba(139, 92, 246, .6); background: var(--grad-soft); }
.signup-tryout ul { margin: 6px 0 0; padding-left: 1.1em; }

/* ── About ────────────────────────────────────────────────────────────────── */
.about-founder { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: center; padding: clamp(20px, 4vw, 32px); }
.about-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.about-photo img { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; object-position: center 20%;
  border: 3px solid var(--primary); box-shadow: var(--shadow-glow); }
.about-bio { line-height: 1.75; margin: 12px 0; color: var(--text-2); }
.about-links { gap: 10px; }
.about-insta { border-color: rgba(244, 114, 182, .55); color: var(--pink); }
.about-notice { align-items: flex-start; }
.about-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.about-grid > .card + .card { margin-top: 0; }
.about-h { margin: 0 0 10px; font-size: 1.05rem; }
.about-teal { color: var(--accent); } .about-saffron { color: var(--warn); } .about-green { color: var(--success); }
.about-list { margin: 0; padding-left: 1.2em; line-height: 1.65; }
.about-list li { margin-bottom: 6px; }
.about-call { background: var(--grad-soft); }
@media (max-width: 640px) { .about-founder { grid-template-columns: 1fr; text-align: left; } .about-photo { align-items: flex-start; } }

/* ── Syllabus pages, explorer & level tracker ───────────────────────────── */
.syl-official { border-left: 3px solid var(--primary); padding: 8px 12px; margin: 6px 0 10px; background: var(--surface-2);
  border-radius: 0 10px 10px 0; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.syl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.syl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 13px; line-height: 1.35;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); }
.syl-chip:hover { text-decoration: none; color: var(--text); border-color: var(--primary); }
.syl-chip.on { border-color: rgba(52, 211, 153, .55); color: var(--text); }
.syl-mini { font-size: 10.5px; font-weight: 750; color: var(--success); letter-spacing: .02em; white-space: nowrap; }
.syl-sec { padding: 14px 0 6px; border-top: 1px solid var(--border); }
.syl-sec:first-of-type { border-top: 0; padding-top: 2px; }
.syl-sec-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 4px; }
.syl-sec-h h4 { margin: 0; font-size: 15px; }
.syl-item { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 9px 2px; border-top: 1px solid var(--border); }
.syl-item:first-child { border-top: 0; }
.syl-item.is-due { background: linear-gradient(90deg, rgba(251, 191, 36, .07), transparent 70%); }
.syl-main { flex: 1 1 260px; min-width: 0; }
.syl-name { color: var(--text); font-weight: 600; font-size: 14px; }
.syl-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lvb { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12.5px;
  font-weight: 650; white-space: nowrap; }
.lvb:hover { border-color: var(--primary); color: var(--text); }
.lvb:focus-visible { outline: none; box-shadow: var(--ring); }
.lvb b { font-weight: 800; }
.lvb .plus { opacity: .55; font-weight: 800; }
.lvb.next { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--text); }
.lvb.k-r.on { background: rgba(96, 165, 250, .16); border-color: rgba(96, 165, 250, .6); color: var(--text); }
.lvb.k-p.on { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .6); color: var(--text); }
.lvb.k-q.on { background: rgba(244, 114, 182, .14); border-color: rgba(244, 114, 182, .6); color: var(--text); }
.lvb.k-y.on { background: rgba(34, 211, 238, .13); border-color: rgba(34, 211, 238, .6); color: var(--text); }
.lvb.k-v.on { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .6); color: var(--text); }
.lvb.undo { padding: 0 9px; color: var(--muted); }
.lvb.htmx-request { opacity: .55; pointer-events: none; }
.syl-bars { display: grid; gap: 4px; min-width: 210px; flex: 0 1 300px; }
.syl-bar-row { display: grid; grid-template-columns: 62px 1fr 52px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.syl-bar-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.syl-track { height: 7px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.syl-track > i { display: block; height: 100%; border-radius: 7px; transition: width .4s ease; }
.syl-track.k-r > i { background: var(--info); } .syl-track.k-p > i { background: var(--warn); }
.syl-track.k-v > i { background: var(--success); } .syl-track.k-q > i { background: var(--pink); }
.syl-track.k-y > i { background: var(--accent); } .syl-track.k-m > i { background: var(--grad); }
/* Narrow rows (phones, the plan's half columns): one line of compact stacked buttons — Read / Prac / Q&A / PYQ / Rev */
.syl-item { container-type: inline-size; }
@container (max-width: 560px) {
  .syl-acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; gap: 5px; }
  .lvb { flex-direction: column; justify-content: center; gap: 1px; min-height: 42px; padding: 2px 3px; font-size: 12px;
    line-height: 1.15; }
  .lvb .ico, .lvb .lbl, .lvb .plus { display: none; }
  .lvb::before { content: attr(data-s); }
  .lvb.undo::before { content: none; }
  .lvb b { font-size: 11px; }
}
.syl-guide { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-top: 6px; }
.syl-guide h5 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.syl-whole { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 2px 12px; margin: 10px 0 4px; }
.syl-done-btn { margin-top: 8px; }
.syl-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 4px; }
.syl-filter .input { flex: 1 1 220px; min-width: 0; max-width: 360px; min-height: 36px; }
.syl-filter [data-sf][aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.syl-hm .hm-grid { grid-template-rows: repeat(7, 12px); }
.syl-hm .l1 { background: rgba(52, 211, 153, .3); border-color: rgba(52, 211, 153, .35); }
.syl-hm .l2 { background: rgba(52, 211, 153, .55); border-color: rgba(52, 211, 153, .6); }
.syl-hm .l3 { background: rgba(16, 185, 129, .8); border-color: #10b981; }
.syl-hm .l4 { background: #34d399; border-color: #6ee7b7; box-shadow: 0 0 6px rgba(52, 211, 153, .6); }
.syl-hm .hm-cell.future { visibility: hidden; }
.syl-subs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.syl-sub { border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); padding: 12px 14px; min-width: 0; }
.syl-sub h5 { margin: 0 0 6px; font-size: 14px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.syl-sub ul, .syl-x ul { margin: 0; padding-left: 1.15em; line-height: 1.55; font-size: 13.5px; color: var(--text-2); }
.syl-x h4 { margin: 22px 0 10px; font-size: 15.5px; }
.syl-q { border: 1px solid var(--border); border-radius: 13px; padding: 12px 14px; margin: 10px 0; background: var(--surface-2); }
.syl-q .q-stem { white-space: pre-line; font-weight: 600; font-size: 14px; line-height: 1.55; }
.syl-q ol { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.syl-q details { margin-top: 8px; font-size: 13.5px; }
.syl-q summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.syl-phase { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 12px 0; background: var(--surface-2); }
.syl-phase h4 { margin: 0 0 4px; }
/* Month calendar pickers (Answer of the day, Current affairs): white = nothing, red = to do, yellow = read, green = done */
.mcal { max-width: 380px; }
.mcal.boxed { padding: 12px 12px 10px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); }
.mcal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mcal-label { flex: 1; min-width: 0; font-size: 14.5px; letter-spacing: -.01em; }
.mcal-arrow, .mcal-today { height: 30px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.mcal-arrow { width: 30px; font-size: 18px; line-height: 1; }
.mcal-today { padding: 0 10px; font-size: 12px; font-weight: 700; }
.mcal-arrow:not(:disabled):hover, .mcal-today:hover { border-color: var(--primary); text-decoration: none; }
.mcal-arrow:disabled { opacity: .3; cursor: default; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mcal-wd { text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-bottom: 2px; }
.mcal-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px;
  padding: 3px 0; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s; }
a.mcal-day:not(.sel):hover, button.mcal-day:not(.sel):hover { transform: translateY(-1px); text-decoration: none; box-shadow: var(--shadow); }
a.mcal-day:hover { text-decoration: none; }
.mcal-day:focus-visible, .mcal-arrow:focus-visible, .mcal-today:focus-visible { outline: none; box-shadow: var(--ring); }
.mcal-n { font-size: 13.5px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mcal-day small { font-size: 9.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; opacity: .78; }
.mcal-day.none { background: #fff; border-color: rgba(76, 87, 160, .3); color: #141936; }
.mcal-day.red { background: rgba(248, 113, 113, .25); border-color: var(--danger); }
.mcal-day.yellow { background: rgba(251, 191, 36, .32); border-color: var(--warn); }
.mcal-day.green { background: rgba(52, 211, 153, .26); border-color: var(--success); }
.mcal-day.off { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); opacity: .5; cursor: default; }
.mcal-day.sel { z-index: 1; box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--primary); }
.mcal-day.today::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.mcal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); }
.mcal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mcal-legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.mcal-legend .mcal-day { width: 13px; height: 13px; min-height: 0; padding: 0; border-radius: 4px; cursor: default; }
.mcal-caret { font-size: 11px; opacity: .7; }
/* The CA day picker is a modal <dialog>: the browser's top layer, solid and above every card, whatever their blur or
   entry animation (a dropdown inside a card was painted over by the cards after it) */
dialog.mcal-dialog { border: 1px solid var(--border-strong); border-radius: 16px; padding: 14px; width: min(390px, calc(100vw - 24px));
  background: var(--surface-solid); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
dialog.mcal-dialog[open] { animation: mcal-in .14s ease-out; }
dialog.mcal-dialog::backdrop { background: rgba(3, 6, 18, .55); backdrop-filter: blur(3px); }
.mcal-dialog .mcal { max-width: none; }
@keyframes mcal-in { from { opacity: 0; transform: translateY(-6px); } }
/* Manual entry: the topic checklist (scrolls when a section is long) and the journal of entries */
.mt-picks { margin-top: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
.mt-picks small { font-size: 10.5px; font-weight: 700; opacity: .7; margin-left: 2px; }
.mt-entry { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--border); }
.card-head + .mt-entry { border-top: 0; padding-top: 0; }
@media (max-width: 640px) {
  .mcal { max-width: none; }
  .mcal-day { min-height: 42px; }
}
@media (max-width: 640px) {
  .syl-bars { flex-basis: 100%; }
  .lvb { min-height: 34px; }
}
/* Study notes: flowcharts, tables, timeline, key terms, flashcards */
.flows { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin: 6px 0 10px; }
.flow { display: grid; justify-items: stretch; align-content: start; }
.flow-title { font-weight: 700; font-size: 13.5px; margin: 10px 0 6px; }
.flow-step { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 10px; padding: 8px 12px;
  font-size: 13.5px; line-height: 1.45; text-align: center; }
.flow-step:first-of-type { border-color: var(--primary); }
.flow-arrow { text-align: center; color: var(--primary); font-weight: 800; line-height: 1; padding: 3px 0; }
.vis-table { margin: 6px 0 10px; }
.tline { list-style: none; margin: 6px 0 10px; padding: 0 0 0 14px; border-left: 2px solid var(--border-strong); }
.tline li { position: relative; padding: 3px 0 9px 12px; font-size: 13.5px; line-height: 1.5; }
.tline li::before { content: ""; position: absolute; left: -21px; top: 8px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); }
.tline b { color: var(--accent); margin-right: 8px; }
.terms { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.term { border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; background: var(--surface-2); font-size: 13px;
  line-height: 1.5; color: var(--text-2); }
.term b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; }
a.term:hover { border-color: var(--primary); }
.fcards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.fcard { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); padding: 10px 12px; }
.fcard summary { cursor: pointer; font-weight: 650; font-size: 13.5px; line-height: 1.45; }
.fcard[open] { border-color: var(--success); }
.fcard p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.syl-nl, .off-nl { text-decoration: none; font-size: 13px; opacity: .75; }
.syl-nl:hover, .off-nl:hover { opacity: 1; text-decoration: none; }
.off-item { display: flex; align-items: flex-start; gap: 2px; }
.off-item .off-btn { flex: 1; }
.off-nl { padding: 8px 6px 0 0; }

/* Official syllabus: reference text and the tracker's strike-through checklist */
.off-ref { margin: 8px 0 0; padding-left: 1.2em; line-height: 1.6; font-size: 13.5px; color: var(--text-2); }
.off-ref li { margin-bottom: 5px; }
.off-block { padding: 14px 0 6px; border-top: 1px solid var(--border); }
.off-block:first-child { border-top: 0; padding-top: 4px; }
.off-list { list-style: none; margin: 8px 0 6px; padding: 0; display: grid; gap: 2px; }
.off-btn { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 9px; padding: 7px 8px; font: inherit; font-size: 13.5px; line-height: 1.55;
  color: var(--text); }
.off-btn:hover { background: var(--surface-hover); }
.off-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.off-tick { flex: 0 0 18px; height: 18px; margin-top: 2px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.off-item.done .off-tick { background: var(--success); border-color: var(--success); }
.off-item.done .off-text { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.off-item.htmx-request .off-btn, .off-btn.htmx-request { opacity: .55; }
