:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #5d6f86;
  --line: #e4ebf4;
  --line-strong: #d5dfeb;
  --blue: #1f5eff;
  --blue-dark: #163fb8;
  --blue-soft: #eaf0ff;
  --indigo: #1d2a4d;
  --green: #0f7a45;
  --green-soft: #e7f6ee;
  --amber: #9a5b00;
  --amber-soft: #fff4e2;
  --red: #b42318;
  --red-soft: #fdecea;
  --slate: #607089;
  --shadow: 0 1px 2px rgba(20, 32, 51, 0.04), 0 10px 30px rgba(20, 32, 51, 0.05);
  --radius: 16px;
  --sidebar: 248px;
  --topbar: 68px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.shell.is-collapsed { --sidebar: 84px; }
.shell.is-collapsed .brand-text,
.shell.is-collapsed .nav-label,
.shell.is-collapsed .nav-group-label,
.shell.is-collapsed .side-note { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh; background: #fff;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: white;
  display: grid; place-items: center; font-weight: 800;
}
.brand-text strong { display: block; font-size: 15px; }
.brand-text span { color: var(--muted); font-size: 12px; }
.nav-scroll { overflow: auto; flex: 1; }
.nav-group { margin: 0 0 16px; }
.nav-group-label {
  margin: 0 8px 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate);
}
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600;
}
.nav-link:hover { background: #f6f8fc; text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--blue-soft); color: var(--blue-dark); }
.side-foot { padding: 8px; }
.side-note { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.collapse-btn, .icon-btn, .menu-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; cursor: pointer;
}
.collapse-btn { width: 100%; }

.shell-main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: rgba(244, 247, 251, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.search { position: relative; flex: 1; max-width: 560px; }
.search input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 12px; min-height: 42px; padding: 8px 12px;
}
.search input:focus, .field input:not([type="checkbox"]):not([type="radio"]):focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12); outline: none;
}
.search-pop, .note-pop, .profile-pop {
  position: absolute; top: calc(100% + 8px); left: 0; width: min(420px, 80vw); background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 30;
}
.search-pop:empty { display: none; }
.search-hit, .note-item { display: block; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.search-hit:hover, .note-item:hover { background: var(--blue-soft); text-decoration: none; }
.search-hit small, .note-item small { display: block; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.notes, .profile { position: relative; }
.note-btn { position: relative; }
.note-count {
  position: absolute; top: -4px; right: -4px; background: var(--red); color: white; border-radius: 99px;
  font-size: 11px; min-width: 16px; height: 16px; display: grid; place-items: center;
}
.profile summary, .notes summary { list-style: none; cursor: pointer; }
.profile summary::-webkit-details-marker, .notes summary::-webkit-details-marker { display: none; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--indigo); color: white;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.who small { display: block; color: var(--muted); }
.profile-pop { right: 0; left: auto; width: 240px; }
.profile-pop a, .profile-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu-btn { display: none; }
.scrim { display: none; }

.page { padding: 8px 28px 48px; max-width: 1280px; }
.page:has(#wizard) { max-width: none; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 20px; }
.page-head h1, .auth-copy h1 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
.lede { margin: 6px 0 0; color: var(--muted); max-width: 680px; }
.page-actions, .action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn, .text-btn {
  border-radius: 12px; min-height: 40px; padding: 0 14px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn-secondary { background: white; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--blue-dark); }
.btn-danger { background: var(--red); color: white; }
.btn-small, .text-btn { min-height: 32px; padding: 0 8px; font-size: 13px; background: transparent; color: var(--blue-dark); }
.text-btn:hover { background: var(--blue-soft); text-decoration: none; }

.card, .kpi, .structure, .callout {
  background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 18px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.formula-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.formula-row p { margin: 0 0 6px; }
.formula-row .row-actions { flex: none; }
.card-head h2, .card h2, .structure h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.eyebrow { margin: 0 0 4px; color: var(--blue-dark); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.kpi-grid, .split, .chart-grid, .course-grid, .media-grid, .people-grid { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.kpi { padding: 16px 18px; }
.kpi span, .kpi small { color: var(--muted); display: block; }
.kpi strong { display: block; font-size: 30px; letter-spacing: -0.04em; margin: 4px 0; }
.kpi em { font-style: normal; color: var(--slate); font-size: 13px; }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.pipeline li { padding: 12px; background: #f8fafc; border-right: 1px solid var(--line); }
.pipeline li:first-child { border-radius: 12px 0 0 12px; }
.pipeline li:last-child { border-right: 0; border-radius: 0 12px 12px 0; background: var(--blue-soft); }
.pipeline strong { display: block; font-size: 22px; }

.bank-note { margin: 0 0 16px; color: var(--muted); }
.master-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.master-form { max-width: 720px; }
.check-list { display: grid; gap: 6px; max-height: 320px; overflow: auto; padding-right: 4px; }
.check-list label {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0; padding: 8px 10px; border-radius: 10px;
}
.check-list label:hover { background: var(--bg); }
.check-list input {
  width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; padding: 0;
  flex: none; accent-color: var(--blue);
}
.check-list span { min-width: 0; line-height: 1.4; }
.table-wrap { overflow-x: auto; padding: 6px 8px 8px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 12px; font-weight: 700; }
.row-actions { display: flex; gap: 12px; }
.row-actions a { font-weight: 700; }
.path-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; align-items: end; }
.path-form .field { margin: 0; }
.structure { padding: 18px 20px; margin-bottom: 16px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: center; }
.section-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.section-pills li { background: var(--bg); border-radius: 12px; padding: 10px; }
.section-pills strong { color: var(--blue-dark); }
.section-pills span, .section-pills em { display: block; color: var(--muted); font-size: 12px; font-style: normal; }

.progress-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 12px; align-items: center; margin: 10px 0; }
.track { height: 10px; background: #e8eef7; border-radius: 99px; overflow: hidden; }
.fill { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.fill.alt { background: #7aa2ff; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }
.split-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.chart-grid { grid-template-columns: 1.1fr 0.9fr; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 36px; gap: 8px; align-items: center; }
.bar-track { height: 8px; background: #e8eef7; border-radius: 99px; }
.bar-fill { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.donut-wrap { display: flex; gap: 16px; align-items: center; }
.donut {
  width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
}
.donut span { width: 78px; height: 78px; border-radius: 50%; background: white; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.mini-list { display: grid; gap: 8px; }
.mini-link, .qcard {
  display: block; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; background: #fff;
}
.mini-link:hover, .qcard:hover { border-color: #c9d7ee; text-decoration: none; }
.qcard-top, .qrow-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--slate); }

.badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 99px;
  font-size: 12px; font-weight: 700; background: #eef2f7; color: var(--slate); white-space: nowrap;
}
.badge-published, .badge-approved { background: var(--green-soft); color: var(--green); }
.badge-in_review, .badge-awaiting_teacher, .badge-changes_requested, .badge-medium { background: var(--amber-soft); color: var(--amber); }
.badge-draft, .badge-not_submitted, .badge-archived, .badge-quiet { background: #eef2f7; color: var(--slate); }
.badge-rejected, .badge-hard { background: var(--red-soft); color: var(--red); }
.badge-easy { background: var(--green-soft); color: var(--green); }
.badge-challenging { background: #efeaff; color: #5b3cc4; }
.badge-approved.review, .badge-approved { }

.bank-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.filters { position: sticky; top: 84px; display: grid; gap: 10px; padding: 14px; }
.field { display: grid; gap: 4px; }
.field-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 650; }
.check-line input { width: 16px; height: 16px; }
.qtable { display: grid; gap: 10px; }
.qtable-head, .qrow {
  display: grid; grid-template-columns: minmax(0, 1.7fr) 170px 150px auto; gap: 12px; align-items: center;
}
.qtable-head { color: var(--muted); font-size: 12px; font-weight: 700; padding: 0 8px; }
.qrow { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.qrow h3 { margin: 2px 0; font-size: 16px; }
.qrow h3 a { color: inherit; }
.qrow-meta, .qrow time { color: var(--muted); font-size: 13px; margin: 0; }
.qrow-badges, .qrow-status, .qrow-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.more { position: relative; }
.more summary { cursor: pointer; list-style: none; color: var(--blue-dark); font-weight: 700; font-size: 13px; }
.more summary::-webkit-details-marker { display: none; }
.more-menu {
  position: absolute; right: 0; top: 100%; z-index: 5; background: white; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 160px; padding: 6px; display: grid;
}
.more-menu a, .more-menu button { background: none; border: 0; text-align: left; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.more-menu a:hover, .more-menu button:hover { background: var(--bg); }
.results-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.pager { display: flex; gap: 6px; align-items: center; margin-top: 14px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: white; color: inherit; text-decoration: none; }
.pager a[aria-current="page"] { background: var(--blue); color: white; border-color: var(--blue); }
#qb-results.htmx-request, #review-app.htmx-request { opacity: 0.55; }
.empty { padding: 28px; text-align: center; }
.empty h3 { margin-bottom: 4px; }

.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.stepper a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 999px; background: white; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 700; }
.stepper .is-current a { background: var(--blue); color: white; border-color: var(--blue); }
.stepper .is-done a { color: var(--blue-dark); }
#wizard, #wizard form { width: 100%; }
.wizard-grid, .editor-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr); gap: 16px; align-items: start; width: 100%; }
.wizard-grid > .card, .editor-layout > .card, .live-col { min-width: 0; }
.symbol-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.symbol-bar button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.wizard-grid textarea, .editor-layout textarea {
  width: 100%; display: block; border: 1px solid var(--line-strong); background: #fff; border-radius: 12px;
  min-height: 280px; padding: 12px 14px; line-height: 1.55; resize: vertical;
}
.wizard-grid textarea:focus, .editor-layout textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12); outline: none;
}
.scheme-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) 88px; gap: 8px; margin-bottom: 8px; }
.scheme-row input {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 12px; min-height: 42px; padding: 8px 12px;
}
.scheme-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12); outline: none; }
.action-bar {
  position: sticky; bottom: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: white; border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow);
}
.live-col { position: sticky; top: 84px; }
.preview-card, .viewer { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.preview-card { min-height: 280px; }
.preview-card h2 { margin: 0 0 12px; font-size: 20px; }
.preview-empty { margin: 4px 0 16px; }
.math-p { margin: 0 0 12px; font-size: 16px; }
.answer-callout { background: var(--blue-soft); border-radius: 12px; padding: 12px; }
.section-lock { margin: 0; color: var(--muted); }
.field-error, .banner-warn { background: var(--amber-soft); color: #7a4b00; border-radius: 12px; padding: 10px 12px; }
.banner-warn { margin-bottom: 12px; }
.check-grid { display: grid; gap: 8px; margin: 12px 0; }
.check-grid label { display: flex; gap: 8px; align-items: flex-start; }

.viewer-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.viewer-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.viewer.is-phone .viewer-question { max-width: 390px; }
.device-toggle { display: flex; gap: 6px; }
.device-toggle button.is-active { background: var(--ink); color: white; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button { border: 0; background: var(--bg); border-radius: 999px; padding: 6px 10px; cursor: pointer; font-weight: 700; }
.tabs button.is-active { background: var(--blue-soft); color: var(--blue-dark); }
.diagram { margin: 12px 0; background: var(--bg); border-radius: 12px; padding: 8px; }
.diagram img { max-height: 220px; margin: 0 auto; }
.picture-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.picture-box h3 { margin-bottom: 4px; }
.picture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.picture-card { margin: 0; background: var(--bg); border-radius: 12px; padding: 8px; display: grid; gap: 8px; }
.picture-card img { width: 100%; height: 110px; object-fit: contain; }
.upload-drop {
  display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer;
  border: 1.5px dashed #b7c6e2; border-radius: 14px; padding: 16px; background: #f8fafc;
}
.upload-drop input { margin-top: 6px; }
.sample-pictures { margin-top: 12px; }
.sample-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.sample-row button { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 8px; cursor: pointer; display: grid; gap: 6px; text-align: center; }
.sample-row img { width: 100%; height: 72px; object-fit: contain; }
.parts-editor { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.parts-editor h3 { margin: 0; }
.parts-editor > .muted { margin: 0; }
.part-edit {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0;
  display: grid; gap: 12px; background: #f8fafc;
}
.part-edit-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.part-label-field { width: 120px; }
.part-marks-field { width: 140px; }
.part-edit textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.options-editor { margin-bottom: 8px; }
.option-columns, .option-edit {
  display: grid;
  grid-template-columns: 72px 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.option-columns {
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.option-edit {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8fafc;
}
.option-edit .correct-pick { display: flex; align-items: center; justify-content: center; margin: 0; }
.option-edit .correct-pick input { width: 18px; height: 18px; accent-color: var(--green); }
.option-edit .option-key, .option-edit .option-answer {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  min-height: 42px;
  padding: 8px 12px;
}
.option-edit .option-key { text-align: center; font-weight: 700; }
.option-edit .option-key:focus, .option-edit .option-answer:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
  outline: none;
}
.option-edit:has(input[name="correct_option"]:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}
#wizard { padding-bottom: 28px; }
@media (max-width: 720px) {
  .option-columns { display: none; }
  .option-edit { grid-template-columns: auto minmax(0, 72px) auto; }
  .option-edit .option-answer { grid-column: 1 / -1; }
}
.part-cards { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.part-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: white; }
.part-card header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.part-card .eyebrow { margin-bottom: 4px; }
.part-card.is-correct { border-color: var(--green); background: var(--green-soft); }
.scheme-table { width: 100%; border-collapse: collapse; }
.scheme-table th, .scheme-table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.video-frame { background: var(--indigo); color: white; border-radius: 16px; min-height: 180px; display: grid; place-items: center; text-align: center; padding: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { padding-left: 14px; border-left: 2px solid var(--line); }

.review-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.queue { display: grid; gap: 8px; }
.queue a.is-current { border-color: var(--blue); background: var(--blue-soft); }

.month-block { margin-top: 18px; }
.test-row, .paper-row, .syllabus-table { width: 100%; border-collapse: collapse; background: white; border-radius: 16px; overflow: hidden; }
.test-row th, .test-row td, .paper-row th, .paper-row td, .syllabus-table th, .syllabus-table td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.unit-block { margin-bottom: 12px; }
.unit-block summary { cursor: pointer; font-weight: 800; padding: 14px 16px; }
.coverage-low { color: var(--amber); font-weight: 800; }

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 0.9fr;
}
.auth-panel { background: var(--indigo); color: white; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-panel h1 { font-size: 46px; letter-spacing: -0.05em; line-height: 1.05; }
.auth-form { display: grid; align-content: center; padding: 48px; }
.auth-card { max-width: 420px; }
.demo-chip { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 12px; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 70; }
.toast { background: var(--ink); color: white; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 220px; }
.toast a { color: white; }
.toast-warning { background: #8a4b00; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.46); display: grid; place-items: center; z-index: 60; padding: 20px; }
.modal { background: white; border-radius: 20px; width: min(1040px, 100%); max-height: min(88vh, 900px); overflow: auto; padding: 8px 8px 18px; }
.modal-sm { width: min(460px, 100%); }
.modal-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 0; }
.modal-bar h2 { margin: 0; font-size: 18px; }
.request-bar { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--blue); transform: scaleX(0); transform-origin: 0 0; z-index: 80; }
body.is-loading .request-bar { transform: scaleX(1); transition: transform 0.4s ease; }

@media (max-width: 1100px) {
  .kpi-grid, .chart-grid, .split-2, .structure, .bank-layout, .wizard-grid, .editor-layout, .viewer-grid, .review-layout, .auth, .path-form, .master-grid, .sample-row { grid-template-columns: 1fr; }
  .filters, .live-col { position: static; }
  .qtable-head { display: none; }
  .qrow { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; transform: translateX(-105%); width: min(86vw, 300px); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, 0.4); z-index: 35; }
  .page, .topbar, .auth-panel, .auth-form { padding-left: 16px; padding-right: 16px; }
  .page-head, .progress-row, .pipeline { display: grid; grid-template-columns: 1fr; }
  .who span { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .section-pills { grid-template-columns: 1fr 1fr; }
}
