/* CampusMate — Open-Canvas Editorial Stylesheet */
:root {
  --bg: #f8f7f3;
  --bg-wash: #f1efe9;
  --surface: #ffffff;
  --surface-hover: #f3f1eb;
  --hairline: #e6e3da;
  --hairline-strong: #d0cbbd;
  --ink: #161614;
  --ink-muted: #57554e;
  --ink-soft: #858279;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.085);
  --ok: #15803d;
  --ok-bg: rgba(21, 128, 61, 0.09);
  --bad: #dc2626;
  --bad-bg: rgba(220, 38, 38, 0.09);
  --warn: #b45309;
  --warn-bg: rgba(180, 83, 9, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sheet: 0 1px 2px rgba(15, 15, 12, 0.04), 0 12px 32px rgba(15, 15, 12, 0.045);
  --shadow-modal: 0 20px 52px rgba(15, 15, 12, 0.16);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --c-emerald: #059669;
  --c-blue: #2563eb;
  --c-violet: #7c3aed;
  --c-amber: #d97706;
  --c-teal: #0d9488;
  --c-rose: #e11d48;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --bg-wash: #161920;
  --surface: #181b22;
  --surface-hover: #20242e;
  --hairline: #252a35;
  --hairline-strong: #373e4d;
  --ink: #f2f1ec;
  --ink-muted: #a6aab3;
  --ink-soft: #737885;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.13);
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.12);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --shadow-sheet: 0 2px 10px rgba(0, 0, 0, 0.32), 0 14px 36px rgba(0, 0, 0, 0.25);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.ic { width: 15px; height: 15px; flex-shrink: 0; }

[data-accent="emerald"] { --sub-c: var(--c-emerald); }
[data-accent="blue"] { --sub-c: var(--c-blue); }
[data-accent="violet"] { --sub-c: var(--c-violet); }
[data-accent="amber"] { --sub-c: var(--c-amber); }
[data-accent="teal"] { --sub-c: var(--c-teal); }
[data-accent="rose"] { --sub-c: var(--c-rose); }

/* ==================== SHELL & LIGHTWEIGHT SIDEBAR ==================== */
.app-shell {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-wash);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  gap: 16px;
  z-index: 30;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 16px; font-weight: 740; letter-spacing: -0.025em; }
.brand-text em { font-style: normal; color: var(--accent); }
.brand-text small { font-size: 9.5px; font-weight: 650; letter-spacing: 0.09em; color: var(--ink-soft); margin-top: 3px; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  padding: 14px 10px 6px;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font-size: 13.75px;
  font-weight: 500;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-link:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 640;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-svg { width: 16.5px; height: 16.5px; flex-shrink: 0; opacity: 0.8; }
.nav-link.active .nav-svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6.5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink-muted);
}
.nav-link.active .nav-badge { background: var(--accent); color: #fff; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--hairline);
}
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-family: var(--font-mono);
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-bg);
  flex-shrink: 0;
}
.user-row { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 31px; height: 31px; border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta strong { display: block; font-size: 13px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main Column */
.main-wrap { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 36px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { margin: 0; font-size: 18px; font-weight: 720; letter-spacing: -0.02em; }
.page-sub { margin: 0; font-size: 12.25px; color: var(--ink-soft); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.content {
  padding: 28px 36px 72px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.view { display: none; animation: fadeIn 0.16s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ==================== BUTTONS & PRIMITIVES ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6.5px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 580;
  transition: all 0.14s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--ink-soft); }
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover:not(:disabled) { opacity: 0.88; background: var(--ink); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.btn-ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 6.5px 11.5px; font-size: 12.25px; }
.btn-xs { padding: 4.5px 8.5px; font-size: 11.75px; border-radius: 6px; }
.btn-lg { padding: 10.5px 20px; font-size: 14px; }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-muted);
  display: grid; place-items: center; font-size: 14px;
  transition: all 0.14s ease; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.icon-btn-ghost { border-color: transparent; background: transparent; }
.icon-btn-ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: transparent; }

.code-tag {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 680;
  color: var(--sub-c, var(--ink-muted));
  background: color-mix(in srgb, var(--sub-c, var(--ink)) 9%, transparent);
  padding: 2px 7px; border-radius: 5px;
  display: inline-block;
}

.section-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  margin: 30px 0 12px;
}
.section-label h2 {
  margin: 0; font-size: 12px; font-weight: 720;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.section-label span { font-size: 12px; color: var(--ink-soft); }

.empty-note {
  padding: 18px 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* Underline Tabs (replaces boxed pill bars) */
.line-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
  scrollbar-width: none;
}
.line-tabs::-webkit-scrollbar { display: none; }
.line-tab {
  position: relative;
  border: 0;
  background: transparent;
  padding: 9px 13px 10px;
  color: var(--ink-muted);
  font-size: 13.25px;
  font-weight: 550;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  transition: color 0.14s ease;
}
.line-tab:hover { color: var(--ink); }
.line-tab small { font-family: var(--font-mono); font-size: 10.75px; color: var(--ink-soft); }
.line-tab.active { color: var(--ink); font-weight: 680; }
.line-tab.active::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.seg-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2.5px;
  border-radius: 8px;
  background: var(--bg-wash);
}
.seg-tab {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.25px;
  font-weight: 580;
  transition: all 0.14s ease;
}
.seg-tab:hover { color: var(--ink); }
.seg-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ==================== 1. OVERVIEW (OPEN CANVAS) ==================== */
.ov-next {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--hairline);
}
.ov-next-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sub-c, var(--accent));
  margin-bottom: 6px;
}
.ov-next-tag.live { color: var(--ok); }
.ov-next-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 740;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.ov-next-meta {
  font-size: 13.5px;
  color: var(--ink-muted);
}
.ov-next-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ov-countdown {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--sub-c, var(--accent));
  background: color-mix(in srgb, var(--sub-c, var(--accent)) 10%, transparent);
  padding: 6px 12px; border-radius: 99px;
}
.ov-countdown.live { background: var(--ok-bg); color: var(--ok); }

/* Quiet inline metric strip (zero boxes) */
.ov-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.ov-metric { display: flex; align-items: baseline; gap: 8px; }
.ov-metric strong { font-size: 17px; font-weight: 740; letter-spacing: -0.02em; }
.ov-metric span { font-size: 12.75px; color: var(--ink-soft); }

/* 2-column open Today + Deadlines grid */
.ov-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  margin-top: 24px;
}
.ov-col-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
}
.ov-col-head h2 {
  margin: 0; font-size: 12px; font-weight: 720;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.ov-col-head span { font-size: 12px; color: var(--ink-soft); }

.ov-list { display: flex; flex-direction: column; }
.ov-slot-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9.5px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 65%, transparent);
  border-radius: 6px;
}
.ov-slot-row:last-child { border-bottom: 0; }
.ov-slot-row.highlight {
  background: color-mix(in srgb, var(--sub-c, var(--accent)) 7%, transparent);
}
.ov-slot-row time {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); width: 44px; flex-shrink: 0;
}
.ov-slot-bar {
  width: 3px; height: 22px; border-radius: 2px; background: var(--sub-c, var(--accent)); flex-shrink: 0;
}
.ov-slot-info { flex: 1; min-width: 0; }
.ov-slot-info strong { display: block; font-size: 13.75px; font-weight: 600; line-height: 1.25; }
.ov-slot-info small { font-size: 11.75px; color: var(--ink-soft); }
.ov-slot-flag {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  color: var(--ok); text-transform: uppercase;
}
.ov-slot-flag.next { color: var(--accent); }

.ov-deadline-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; border: 0; background: transparent; text-align: left;
  padding: 9.5px 8px; border-radius: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 65%, transparent);
  transition: background 0.12s ease;
}
.ov-deadline-row:last-child { border-bottom: 0; }
.ov-deadline-row:hover { background: var(--surface-hover); }
.ov-deadline-row strong { display: block; font-size: 13.5px; font-weight: 560; line-height: 1.3; }
.ov-deadline-row small { font-size: 11.5px; color: var(--ink-soft); }
.due-pill {
  font-family: var(--font-mono); font-size: 11px; font-weight: 680;
  padding: 2.5px 7.5px; border-radius: 5px; flex-shrink: 0;
  background: var(--bg-wash); color: var(--ink-muted);
}
.due-pill.overdue { background: var(--bad-bg); color: var(--bad); }
.due-pill.soon { background: var(--warn-bg); color: var(--warn); }

/* Linear hairline Subjects index */
.subj-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 32px;
}
.subj-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; border: 0; background: transparent; text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 75%, transparent);
  border-radius: 6px;
  transition: background 0.12s ease;
}
.subj-row:hover { background: var(--surface-hover); }
.subj-glyph {
  width: 28px; height: 28px; border-radius: 7px;
  background: color-mix(in srgb, var(--sub-c, var(--accent)) 11%, transparent);
  color: var(--sub-c, var(--accent));
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.subj-main { flex: 1; min-width: 0; }
.subj-main strong { display: block; font-size: 13.75px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subj-main small { font-size: 11.5px; color: var(--ink-soft); font-family: var(--font-mono); }
.subj-arrow { color: var(--ink-soft); font-size: 13px; transition: transform 0.14s ease, color 0.14s ease; }
.subj-row:hover .subj-arrow { transform: translateX(3px); color: var(--ink); }

/* ==================== 2. PRACTICE QUIZ (UNBOXED SETUP + FOCAL ARENA) ==================== */
.quiz-setup { display: flex; flex-direction: column; gap: 26px; }
.setup-band { display: flex; flex-direction: column; gap: 11px; }
.setup-heading {
  display: flex; align-items: center; gap: 8px;
  margin: 0; font-size: 12px; font-weight: 720;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.setup-heading span { color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 600; }

.subj-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
}
.pick-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 8.5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: all 0.13s ease;
}
.pick-btn:hover { background: var(--surface-hover); }
.pick-btn.selected {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--sub-c, var(--accent)) 45%, var(--hairline));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.pick-btn-txt { min-width: 0; }
.pick-btn-txt strong { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn-txt small { display: block; font-size: 11px; color: var(--ink-soft); font-family: var(--font-mono); }

.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5.5px 11.5px;
  border-radius: 7px;
  border: 0;
  background: var(--bg-wash);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 520;
  transition: all 0.13s ease;
}
.chip:hover { background: var(--surface-hover); color: var(--ink); }
.chip.selected { background: var(--ink); color: var(--bg); font-weight: 600; }

.launch-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.launch-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.launch-group { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-muted); }
.launch-group select {
  padding: 6px 9px; border-radius: 7px;
  border: 1px solid var(--hairline-strong); background: var(--surface);
  font-size: 12.75px; font-weight: 600;
}

/* Quiz Analytics (unboxed hairline table) */
.analytics-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--hairline);
}
.data-table th {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-soft);
}
.data-table tr:last-child td { border-bottom: 0; }
.recent-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8.5px 4px; border-bottom: 1px solid var(--hairline); font-size: 12.75px;
}
.recent-row:last-child { border-bottom: 0; }

/* Quiz Arena — One Clean Centered Sheet + Segmented Step Bar */
.arena {
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.arena-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.arena-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-muted); }
.arena-stats { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12.5px; }

.step-bar {
  display: flex;
  gap: 4px;
  width: 100%;
  height: 5px;
}
.step-seg {
  flex: 1;
  border-radius: 99px;
  background: var(--hairline);
  transition: background 0.2s ease;
}
.step-seg.current { background: var(--accent); }
.step-seg.ok { background: var(--ok); }
.step-seg.bad { background: var(--bad); }
.step-seg.answered { background: color-mix(in srgb, var(--accent) 55%, var(--hairline)); }
.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--hairline);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.q-sheet {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: var(--shadow-sheet);
}
.q-counter {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 650;
  color: var(--ink-soft); margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
  letter-spacing: 0.04em;
}
.q-text {
  margin: 0 0 18px;
  font-size: 17.75px;
  font-weight: 610;
  line-height: 1.5;
  letter-spacing: -0.012em;
}
.q-code {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.58;
  overflow-x: auto;
}
.q-figure {
  margin: 0 0 20px;
  padding: 16px 18px 11px;
  border-radius: 12px;
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--hairline);
  text-align: center;
}
.q-figure svg { width: 100%; max-width: 470px; height: auto; display: block; margin: 0 auto; color: var(--ink); }
.q-figure figcaption { margin-top: 8px; font-size: 11.5px; color: var(--ink-soft); font-weight: 520; }
.fig-accent-stroke { stroke: var(--accent); }
.fig-accent-fill { fill: var(--accent); }

.options-list { display: flex; flex-direction: column; gap: 9px; }
.opt-btn {
  display: flex; align-items: center; gap: 13px;
  width: 100%; padding: 13.5px 15px;
  border-radius: 11px;
  border: 1px solid var(--hairline);
  background: var(--bg);
  text-align: left;
  font-size: 14.25px;
  transition: all 0.13s ease;
}
.opt-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateX(2px);
}
.opt-key {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0; color: var(--ink-muted);
}
.opt-btn.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt-btn.selected .opt-key { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt-btn.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt-btn.correct .opt-key { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt-btn.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt-btn.wrong .opt-key { background: var(--bad); color: #fff; border-color: var(--bad); }

.feedback-box {
  margin-top: 18px;
  padding: 15px 17px;
  border-radius: 10px;
  border-left: 3px solid var(--hairline-strong);
  background: var(--bg);
  animation: fadeIn 0.15s ease;
}
.feedback-box.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.feedback-box.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.feedback-title { font-weight: 700; font-size: 13.75px; margin-bottom: 5px; }
.feedback-box.ok .feedback-title { color: var(--ok); }
.feedback-box.bad .feedback-title { color: var(--bad); }
.feedback-exp { margin: 0; font-size: 13.5px; color: var(--ink); white-space: pre-line; line-height: 1.62; }
.feedback-key {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}

.arena-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kbd-hint { font-size: 12px; color: var(--ink-soft); }

/* Quiz Results */
.result-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.result-hero {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 8px 0 22px; border-bottom: 1px solid var(--hairline);
}
.score-ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); width: 104px; height: 104px; }
.score-ring-val {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 780; font-size: 22px; letter-spacing: -0.03em;
}
.score-ring-val small { font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.result-copy h2 { margin: 0 0 5px; font-size: 20px; }
.result-copy p { margin: 0 0 13px; color: var(--ink-muted); font-size: 13.75px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.review-row {
  padding: 15px 0 15px 14px;
  border-bottom: 1px solid var(--hairline);
  border-left: 3px solid var(--hairline);
}
.review-row.ok { border-left-color: var(--ok); }
.review-row.bad { border-left-color: var(--bad); }
.review-q { font-weight: 600; font-size: 14.5px; margin: 3px 0 6px; }
.review-ans { font-size: 13px; color: var(--ink-muted); margin-bottom: 5px; }
.review-exp { font-size: 12.5px; color: var(--ink-soft); white-space: pre-line; line-height: 1.56; }

/* ==================== 3. SYLLABUS (OPEN HAIRLINE EXPLORER — NO YEAR BOXES) ==================== */
.syl-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.syl-top h2 { margin: 0; font-size: 20px; font-weight: 730; letter-spacing: -0.025em; }
.syl-top p { margin: 3px 0 0; font-size: 12.75px; color: var(--ink-soft); }
.syl-top-stats {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-muted);
}
.syl-top-stats strong { color: var(--ink); font-size: 14px; }

.syl-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 0 12px;
}
.syl-search {
  flex: 1; min-width: 240px;
  padding: 8.5px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong); background: var(--surface);
  font-size: 13.25px;
}
.syl-search:focus { outline: 2px solid color-mix(in srgb, var(--accent) 26%, transparent); border-color: var(--accent); }

.sem-caption {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--ink-soft);
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--hairline);
}
.sem-caption strong { color: var(--ink); font-size: 13.25px; }

.syl-list { display: flex; flex-direction: column; }
.syl-row {
  border-bottom: 1px solid var(--hairline);
}
.syl-row summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.syl-row summary::-webkit-details-marker { display: none; }
.syl-row summary:hover { background: var(--surface-hover); }
.syl-row-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.syl-chev {
  font-size: 11px; color: var(--ink-soft); width: 12px;
  transition: transform 0.15s ease; flex-shrink: 0;
}
.syl-row[open] .syl-chev { transform: rotate(90deg); color: var(--ink); }
.syl-row-title { min-width: 0; }
.syl-row-title strong { display: block; font-size: 14.5px; font-weight: 620; letter-spacing: -0.01em; }
.syl-row-meta {
  font-family: var(--font-mono); font-size: 11.25px; color: var(--ink-soft); margin-top: 2px;
}
.syl-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.syl-prog {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 650; color: var(--ok);
}

.syl-detail {
  padding: 4px 10px 20px 30px;
  margin-left: 11px;
  border-left: 2px solid color-mix(in srgb, var(--sub-c, var(--accent)) 35%, var(--hairline));
  display: flex; flex-direction: column; gap: 16px;
}
.syl-unit {
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 65%, transparent);
}
.syl-unit:last-child { border-bottom: 0; }
.syl-unit-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.syl-check-label {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13.5px; font-weight: 610;
}
.syl-check-label input { width: 15.5px; height: 15.5px; accent-color: var(--ok); flex-shrink: 0; cursor: pointer; }
.syl-unit.studied .syl-check-label span:last-child { color: var(--ink-muted); }
.syl-unit-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--sub-c, var(--accent));
}
.syl-unit-desc {
  margin: 5px 0 0 25px;
  font-size: 13px; color: var(--ink-muted); line-height: 1.58;
}
.syl-unit-topics { margin: 8px 0 0 25px; }

.exp-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7.5px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent);
  font-size: 13px; line-height: 1.5; cursor: pointer;
}
.exp-row:last-child { border-bottom: 0; }
.exp-row.studied { color: var(--ink-soft); }
.exp-row input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--ok); flex-shrink: 0; }
.exp-num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); min-width: 24px; }

.syl-meta-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px; padding-top: 10px; border-top: 1px solid var(--hairline);
}
.syl-meta-col h4 {
  margin: 0 0 7px; font-size: 11px; font-weight: 720;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.syl-meta-col ol, .syl-meta-col ul {
  margin: 0; padding-left: 17px; display: flex; flex-direction: column; gap: 4px;
  font-size: 12.5px; color: var(--ink-muted); line-height: 1.5;
}

.elec-list {
  display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 32px;
}
.elec-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--hairline);
}
.elec-row strong { display: block; font-size: 13.5px; font-weight: 600; }
.elec-row small { font-family: var(--font-mono); font-size: 11.25px; color: var(--ink-soft); }

/* ==================== 4. TIMETABLE (ALL-AT-ONCE VISUAL MATRIX TABLE) ==================== */
.tt-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--hairline);
  margin-bottom: 18px;
}
.tt-editor {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 13px 15px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--hairline);
  margin-bottom: 18px; animation: fadeIn 0.14s ease;
}
.tt-editor select, .tt-editor input {
  padding: 7px 10px; border-radius: 7px;
  border: 1px solid var(--hairline-strong); background: var(--bg); font-size: 12.75px;
}

.tt-matrix-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sheet);
}
.tt-matrix {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.tt-matrix thead th {
  padding: 13px 10px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  text-align: left;
  background: var(--bg-wash);
  border-bottom: 1px solid var(--hairline);
}
.tt-matrix thead th:first-child {
  width: 88px;
  padding-left: 14px;
  position: sticky;
  left: 0;
  z-index: 2;
}
.tt-matrix thead th.col-today {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-wash));
  box-shadow: inset 0 2.5px 0 var(--accent);
}
.tt-today-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  margin-left: 5px;
  vertical-align: middle;
}

.tt-matrix tbody td {
  padding: 7px;
  vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 80%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--hairline) 55%, transparent);
}
.tt-matrix tbody tr:last-child td { border-bottom: 0; }
.tt-matrix tbody td:last-child { border-right: 0; }

.tt-matrix tbody td.tt-time-cell {
  padding: 12px 10px 12px 14px;
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--hairline);
}
.tt-time-start {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.25px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.tt-time-end {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.tt-matrix tbody td.col-today {
  background: color-mix(in srgb, var(--accent) 3.2%, transparent);
}
.tt-empty {
  height: 54px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--ink-soft) 40%, transparent);
  font-family: var(--font-mono);
  font-size: 13px;
  user-select: none;
}

.tt-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tt-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 8px 9px 8px 11px;
  border-radius: 9px;
  border: 0;
  background: color-mix(in srgb, var(--sub-c, var(--accent)) 9%, var(--bg));
  box-shadow: inset 3px 0 0 var(--sub-c, var(--accent));
  text-align: left;
  transition: background 0.14s ease, transform 0.12s ease;
}
.tt-chip.clickable { cursor: pointer; }
.tt-chip.clickable:hover {
  background: color-mix(in srgb, var(--sub-c, var(--accent)) 15%, var(--bg));
  transform: translateY(-1px);
}
.tt-chip.next-hit {
  background: color-mix(in srgb, var(--sub-c, var(--accent)) 16%, var(--surface));
  box-shadow: inset 3px 0 0 var(--sub-c, var(--accent)), 0 0 0 1.5px color-mix(in srgb, var(--sub-c, var(--accent)) 55%, transparent);
}
.tt-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.tt-chip-code {
  font-family: var(--font-mono);
  font-size: 11.75px;
  font-weight: 740;
  color: var(--sub-c, var(--accent));
  letter-spacing: -0.01em;
}
.tt-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-chip-sub {
  font-size: 10.75px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-chip-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 750;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}
.tt-chip-badge.live { background: var(--ok); }
.tt-del {
  border: 0; background: transparent; color: var(--ink-soft);
  width: 20px; height: 20px; border-radius: 5px; font-size: 10.5px;
  display: grid; place-items: center; transition: all 0.12s;
  flex-shrink: 0;
}
.tt-del:hover { background: var(--bad); color: #fff; }

.tt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 11.75px;
  color: var(--ink-soft);
}
.tt-legend-dots { display: flex; flex-wrap: wrap; gap: 14px; }
.tt-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.tt-legend-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--sub-c, var(--accent)); }

/* ==================== 5. PLANNER (OPEN CHECKLIST + MEDIA) ==================== */
.planner-form {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  margin-bottom: 20px;
}
.composer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.composer-row input[type="text"],
.composer-row select,
.composer-row input[type="date"] {
  padding: 8px 11px; border-radius: 7px;
  border: 1px solid var(--hairline); background: var(--bg); font-size: 13.25px;
}
.composer-row input[type="text"] { flex: 1; min-width: 210px; }
.composer-row input:focus, .composer-row select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 26%, transparent); border-color: var(--accent);
}
.composer-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--hairline);
}

.filter-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.task-list { display: flex; flex-direction: column; }
.task-item {
  padding: 13px 6px;
  border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 10px;
}
.task-item.done { opacity: 0.62; }
.task-item.done .task-title { text-decoration: line-through; color: var(--ink-soft); }
.task-main { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.task-check { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.task-title { flex: 1; min-width: 180px; font-size: 14.25px; font-weight: 540; }
.prio-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--bad); flex-shrink: 0;
}
.task-actions { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }

/* ==================== 6. NOTES (OPEN WRITING SHEET + MEDIA) ==================== */
.notes-layout {
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 28px;
  align-items: start;
}
.notes-rail {
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 20px;
  border-right: 1px solid var(--hairline);
  min-height: 68vh;
}
.notes-rail-controls { display: flex; gap: 6px; }
.notes-rail-controls input {
  flex: 1; min-width: 0; padding: 7.5px 10px; border-radius: 7px;
  border: 1px solid var(--hairline); background: var(--surface); font-size: 12.75px;
}
.notes-rail-controls select {
  padding: 7.5px 7px; border-radius: 7px;
  border: 1px solid var(--hairline); background: var(--surface); font-size: 12px; font-weight: 600;
}
.notes-list { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; }
.note-row {
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 10px; border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.note-row:hover { background: var(--surface-hover); }
.note-row.active { background: var(--accent-soft); }
.note-row strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row.active strong { color: var(--accent); }
.note-row-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.25px; color: var(--ink-soft); margin-top: 2px;
}
.media-counts { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.75px; }
.media-counts span { display: inline-flex; align-items: center; gap: 3px; }

.note-sheet {
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.note-sheet-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.note-sheet-head select {
  padding: 6px 9px; border-radius: 7px;
  border: 1px solid var(--hairline); background: var(--surface);
  font-family: var(--font-mono); font-size: 12px; font-weight: 650;
}
.note-title-input {
  flex: 1; min-width: 180px;
  border: 0; background: transparent; padding: 4px 2px;
  font-size: 21px; font-weight: 720; letter-spacing: -0.02em;
}
.note-title-input:focus { outline: none; }

.note-textarea {
  width: 100%; min-height: 290px; padding: 4px 2px;
  border: 0; background: transparent;
  resize: vertical; line-height: 1.7; font-size: 14.5px;
}
.note-textarea:focus { outline: none; }

.md-preview {
  min-height: 290px; padding: 4px 2px;
  font-size: 14.5px; line-height: 1.7;
}
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 14px 0 6px; line-height: 1.3; letter-spacing: -0.015em; }
.md-preview h1:first-child, .md-preview h2:first-child, .md-preview h3:first-child { margin-top: 0; }
.md-preview p { margin: 0 0 10px; }
.md-preview ul, .md-preview ol { margin: 0 0 10px; padding-left: 22px; }
.md-preview code {
  font-family: var(--font-mono); font-size: 12.75px;
  padding: 1.5px 5px; border-radius: 5px; background: var(--bg-wash);
}
.md-preview pre {
  padding: 13px 15px; border-radius: 9px; background: var(--surface);
  border: 1px solid var(--hairline); overflow-x: auto;
}
.md-preview pre code { padding: 0; background: transparent; }

.note-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 12px; border-top: 1px solid var(--hairline);
}
.media-btn-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ==================== MEDIA ATTACHMENTS & RECORDER ==================== */
.media-deck {
  display: flex; flex-direction: column; gap: 12px;
  padding-top: 10px;
}
.media-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 6px;
}
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 9px;
}
.photo-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 7px;
}
.photo-thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 9px;
  overflow: hidden; background: var(--bg-wash); cursor: pointer;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.photo-thumb:hover img { transform: scale(1.04); }
.photo-del {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(15, 15, 18, 0.72); color: #fff;
  font-size: 11px; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.14s ease, background 0.14s ease;
}
.photo-thumb:hover .photo-del, .photo-del:focus { opacity: 1; }
.photo-del:hover { background: var(--bad); }

.media-missing {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 8px; width: 100%; height: 100%;
  font-size: 11px; color: var(--ink-soft); background: var(--bg-wash);
  border: 1px dashed var(--hairline-strong); border-radius: 8px;
}

.audio-list { display: flex; flex-direction: column; gap: 8px; }
.audio-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-wash);
}
.audio-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.audio-title {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  font-size: 12.75px; font-weight: 580;
}
.audio-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }
.audio-row audio { width: 100%; height: 34px; }

.recorder-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px;
  background: var(--bad-bg);
  animation: fadeIn 0.14s ease;
}
.recorder-left { display: flex; align-items: center; gap: 10px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: pulseRec 1.1s infinite ease-in-out; }
@keyframes pulseRec { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
.rec-timer { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--bad); }
.rec-bars { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.rec-bars i { display: block; width: 3px; height: 6px; border-radius: 2px; background: var(--bad); transition: height 0.08s linear; }
.recorder-actions { display: flex; align-items: center; gap: 6px; }

/* ==================== MODALS & TOASTS ==================== */
.modal { border: 0; padding: 0; background: transparent; max-width: 420px; width: 92%; }
.modal::backdrop { background: rgba(0, 0, 0, 0.48); backdrop-filter: blur(4px); }
.modal-card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 16px;
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-modal);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.25px; color: var(--ink-muted); font-weight: 560; }
.field input { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--hairline-strong); background: var(--bg); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.modal-backup {
  margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 8px;
}
.modal-backup-head { font-size: 11px; font-weight: 720; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft); }
.modal-backup-btns { display: flex; gap: 8px; }
.modal-backup small { font-size: 11.25px; color: var(--ink-soft); line-height: 1.45; }

.modal-lightbox { max-width: 920px; width: 94%; }
.lightbox-card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow-modal);
}
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
  font-size: 13.5px; font-weight: 600;
}
.lightbox-actions { display: flex; align-items: center; gap: 8px; }
.lightbox-stage { background: var(--bg); display: grid; place-items: center; padding: 16px; max-height: 76vh; overflow: auto; }
.lightbox-stage img { max-height: 70vh; width: auto; border-radius: 8px; }

.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 9.5px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 540;
  box-shadow: var(--shadow-modal);
  animation: fadeIn 0.15s ease;
}
.toast.err { background: var(--bad); color: #fff; }

/* ==================== RESPONSIVE ==================== */
.mobile-only { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 960px) {
  .ov-split, .analytics-grid, .subj-table, .elec-list { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-only { display: grid; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 256px;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 25; }
  .topbar { padding: 12px 18px; }
  .content { padding: 20px 18px 56px; }
  .notes-layout { grid-template-columns: 1fr; }
  .notes-rail { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--hairline); padding-bottom: 16px; min-height: auto; }
  .q-sheet { padding: 20px; }
  .q-text { font-size: 16.25px; }
  .kbd-hint { display: none; }
  .photo-del { opacity: 1; }
  .syl-detail { padding-left: 16px; margin-left: 4px; }
  .syl-unit-desc, .syl-unit-topics { margin-left: 0; }
}
