/* GENERATED by npm run build. Edit src/styles/ files, not this file. */
/* ── src/styles/fonts.css ── */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("assets/fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin-wght-normal.woff2")
    format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin-wght-normal.woff2")
    format("woff2");
}

/* ── src/styles/features.css ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

:root {
  --bg: #0f1117;
  --bg2: #161b25;
  --bg3: #1e2535;
  --bg4: #252d40;
  --border: #2a3348;
  --border2: #3a4a6a;
  --text: #e8edf5;
  --text2: #8a9bbf;
  --text3: #5a6a8a;
  --accent: #3d7fff;
  --accent2: #2563eb;
  --accent-text: #ffffff;
  --accent-glow: rgba(61, 127, 255, 0.15);
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #a78bfa;
  --r: 10px;
  --r2: 14px;
}

html,
body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden
}

a {
  color: inherit;
  text-decoration: none
}

button {
  font-family: 'DM Sans', sans-serif;
  cursor: pointer
}

input {
  font-family: 'DM Sans', sans-serif
}

/* ── LOGIN SCREEN ── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
}

.login-footer a {
  font-size: 12px;
  color: var(--text3);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.login-footer a:hover {
  color: var(--text2);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.login-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.login-input::placeholder {
  color: var(--text3);
}

.login-input:focus {
  border-color: var(--accent);
}

.login-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--r, 8px);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}

.login-btn:hover {
  background: var(--accent2);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-error {
  color: var(--red);
  font-size: 12.5px;
  text-align: center;
  min-height: 18px;
  font-weight: 500;
}

/* ── LAYOUT ── */
.app {
  display: flex;
  height: 100dvh;
  overflow: hidden
}

/* ── SIDEBAR ── */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
  width: 4px
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px
}

.logo-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px
}

.nav-section {
  padding: 12px 10px 4px
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 400;
  transition: all 0.15s;
  cursor: pointer;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--text)
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0
}

/* ── MAIN ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0
}

.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1
}

.avatar {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notif-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px
}

.content::-webkit-scrollbar {
  width: 4px
}

.content::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px
}

/* PAGE SECTIONS */
.page {
  display: none;
  flex-direction: column;
  gap: 18px
}

.page.active {
  display: flex
}

/* ── CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px 18px;
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px
}

.stat-val {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  margin-bottom: 4px
}

.stat-sub {
  font-size: 12px;
  color: var(--text3)
}

.stat-sub .up {
  color: var(--green)
}

.stat-sub .dn {
  color: var(--red)
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px 20px
}

.full-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px 20px
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px
}

.card-action {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500
}

/* EXAM ITEMS */
.exam-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border)
}

.exam-item:last-child {
  border-bottom: none;
  padding-bottom: 0
}

.exam-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0
}

.exam-info {
  flex: 1;
  min-width: 0
}

.exam-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.exam-date {
  font-size: 11px;
  color: var(--text3)
}

.exam-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap
}

.badge-upcoming {
  background: rgba(61, 127, 255, 0.15);
  color: var(--accent)
}

.badge-live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red)
}

.badge-done {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green)
}

/* SUBJECT BARS */
.subject-bar {
  margin-bottom: 10px
}

.subject-bar:last-child {
  margin-bottom: 0
}

.sb-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px
}

.sb-name {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500
}

.sb-val {
  font-size: 12px;
  color: var(--text3);
  font-family: 'Space Mono', monospace
}

.sb-track {
  height: 5px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden
}

.sb-fill {
  height: 100%;
  border-radius: 4px
}

/* CLASS ITEMS */
.class-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border)
}

.class-item:last-child {
  border-bottom: none;
  padding-bottom: 0
}

.class-time {
  font-size: 11px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  min-width: 48px
}

.class-info {
  flex: 1;
  min-width: 0
}

.class-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1px
}

.class-teacher {
  font-size: 11px;
  color: var(--text3)
}

.class-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
  border-radius: var(--r, 6px);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
}

.class-btn.gray {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border)
}

/* NOTICE */
.notice-item {
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--r);
  margin-bottom: 8px;
  border-left: 3px solid var(--accent);
}

.notice-item:last-child {
  margin-bottom: 0
}

.notice-item.amber {
  border-left-color: var(--amber)
}

.notice-item.red {
  border-left-color: var(--red)
}

.notice-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px
}

.notice-time {
  font-size: 11px;
  color: var(--text3)
}

/* TIMETABLE */
.tt-grid {
  display: grid;
  grid-template-columns: 60px repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
  font-size: 12px
}

.tt-cell {
  background: var(--bg2);
  padding: 8px 10px
}

.tt-header {
  background: var(--bg3);
  font-weight: 600;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px
}

.tt-time {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text3)
}

.tt-class {
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500
}

.tt-phy {
  background: rgba(61, 127, 255, 0.15);
  color: var(--accent)
}

.tt-chem {
  background: rgba(167, 139, 250, 0.15);
  color: var(--purple)
}

.tt-math {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green)
}

.tt-empty {
  color: var(--text3);
  font-size: 11px
}

.tt-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.tt-select:focus {
  border-color: var(--accent);
}

.manual-tool-row {
  display: flex;
  gap: 12px;
  margin-bottom: -6px;
  align-items: center;
  flex-wrap: wrap
}

.manual-tool-form {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 220px
}

.manual-tool-input {
  width: 150px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.manual-tool-input::placeholder {
  color: var(--text3)
}

.manual-tool-input:focus {
  border-color: var(--accent)
}

.manual-tool-form .start-btn {
  margin-top: 0;
  white-space: nowrap
}

/* EXAM HALL */
.exam-hall-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  margin-bottom: 10px;
}

.exam-hall-item:last-child {
  margin-bottom: 0
}

.exam-hall-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exam-hall-info {
  flex: 1;
  min-width: 0
}

.exam-hall-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px
}

.exam-hall-meta {
  font-size: 12px;
  color: var(--text3)
}

.exam-hall-right {
  text-align: right;
  flex-shrink: 0
}

.exam-hall-score {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Mono', monospace
}

.exam-hall-rank {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px
}

.exam-hall-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.exam-hall-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.exam-syllabus-btn {
  padding: 5px 10px;
  font-size: 11.5px;
  gap: 5px;
  margin-top: 0;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* SYLLABUS MODAL */
.syllabus-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 16px;
}

.syllabus-modal-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.syllabus-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.syllabus-modal-header-info {
  min-width: 0;
  flex: 1;
}

.syllabus-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.syllabus-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.syllabus-modal-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
  line-height: 1.4;
}

.syllabus-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.syllabus-modal-copy-btn {
  margin: 0;
  padding: 6px 11px;
  font-size: 11.5px;
  min-height: 32px;
}

.syllabus-modal-close-btn {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  transition: background 0.15s ease, color 0.15s ease;
}

.syllabus-modal-close-btn:hover {
  background: var(--bg4);
  color: var(--text);
}

.syllabus-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.syllabus-modal-subject-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.syllabus-modal-subject-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.syllabus-modal-topic {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid var(--border2);
}

.start-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
  border-radius: var(--r, 8px);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
  transition: opacity 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.start-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.start-btn.gray {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}

.start-btn.gray:hover:not(:disabled) {
  background: var(--bg4);
  color: var(--text);
  border-color: var(--border2);
}

.start-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* COURSE DETAIL MODAL */
.course-detail-modal-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.course-detail-prose {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto
}

.course-detail-prose a {
  color: var(--accent);
  word-break: break-word
}

.course-detail-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px
}

.course-detail-prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0
}

.course-detail-prose td,
.course-detail-prose th {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: top;
  background: var(--bg3)
}

/* ═══════════════════════════════════════════════
   RESULT ANALYSIS — v2 Monochromatic Design
═══════════════════════════════════════════════ */
.result-modal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.result-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 2;
}

.result-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.report-container-minimal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-header-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 16px;
}

.report-info-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.report-info-card.primary-card {
  border-left: 3px solid var(--accent);
}

.report-info-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.3;
}

.report-info-card p {
  font-size: 12px;
  color: var(--text2);
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.report-meta-item {
  display: flex;
  flex-direction: column;
}

.report-meta-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.report-meta-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Metrics Summary Cards ── */
.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.report-metric-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 96px;
  transition: border-color 0.15s, background 0.15s;
}

.report-metric-card:hover {
  border-color: var(--border2);
  background: var(--bg4);
}

.report-metric-card.accent-card {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.report-metric-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.report-metric-val {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.report-metric-card.accent-card .report-metric-val {
  color: var(--accent);
}

.report-metric-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Section Title ── */
.report-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  margin-bottom: 10px;
}

/* ── Subject Table ── */
.report-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow-x: auto;
  background: var(--bg3);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.report-table th,
.report-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.report-table th {
  background: var(--bg4);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.report-table tr:last-child td {
  border-bottom: none;
}

.report-table tr:hover td {
  background: var(--bg4);
}

.report-table td.mono {
  font-family: 'Space Mono', monospace;
}

.report-table td.font-semibold {
  font-weight: 600;
}

/* Score Breakdown inline format */
.report-breakdown-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 500;
}

.report-breakdown-row span.c {
  color: var(--green);
}

.report-breakdown-row span.w {
  color: var(--red);
}

.report-breakdown-row span.u {
  color: var(--text3);
}

/* ── Attempt Bar ── */
.report-attempt-bar-container {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px 18px;
}

.report-attempt-bar-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text2);
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.report-attempt-bar-text span strong {
  color: var(--text);
  font-weight: 600;
}

.report-attempt-bar-line {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  gap: 1px;
}

.report-attempt-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.report-attempt-bar-fill.correct {
  background: #22c55e;
}

.report-attempt-bar-fill.wrong {
  background: #ef4444;
}

.report-attempt-bar-fill.skipped {
  background: var(--text3);
}

/* ── Class Top Performers ── */
.report-leaderboard-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.report-leaderboard-entry {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background 0.12s;
}

.report-leaderboard-entry:last-child {
  border-bottom: none;
}

.report-leaderboard-entry:hover {
  background: var(--bg4);
}

.report-lead-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  flex-shrink: 0;
}

.report-leaderboard-entry:nth-child(1) .report-lead-rank {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.report-leaderboard-entry:nth-child(2) .report-lead-rank {
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.report-leaderboard-entry:nth-child(3) .report-lead-rank {
  background: rgba(205, 127, 50, 0.10);
  border-color: rgba(205, 127, 50, 0.25);
  color: #cd7f32;
}

.report-lead-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-lead-score {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}

/* ── Action Buttons ── */
.report-actions {
  display: flex;
  gap: 8px;
  margin-top: 0;
  flex-wrap: wrap;
  align-items: center;
}

.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.report-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.report-btn:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--bg4);
}

.report-btn:hover svg {
  opacity: 1;
}

.report-btn.primary {
  background: var(--accent);
  color: var(--accent-text, #000);
  border-color: transparent;
}

.report-btn.primary svg {
  opacity: 1;
}

.report-btn.primary:hover {
  background: var(--accent2);
  border-color: transparent;
}

.report-btn.secondary-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.report-btn.secondary-accent:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
  color: var(--text);
}

/* ── Tags / Chips ── */
.result-tags-minimal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.result-chip-minimal {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.result-link {
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg3);
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 600;
  text-decoration: none
}

.leaderboard-wrap {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  background: var(--bg3)
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 12px
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap
}

.leaderboard-table th {
  font-size: 10.5px;
  color: var(--text2);
  text-transform: uppercase;
  background: var(--bg4);
  font-weight: 700;
  letter-spacing: 0.4px
}

.leaderboard-table td {
  color: var(--text)
}

.leaderboard-table tr:last-child td {
  border-bottom: none
}

.leaderboard-rank {
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  font-weight: 700
}

.leaderboard-score {
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-weight: 700
}

.leaderboard-subjects {
  display: flex;
  gap: 5px;
  flex-wrap: wrap
}

.leaderboard-subject {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 11px
}

.leaderboard-card-list {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px
}

.leaderboard-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px
}

.leaderboard-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px
}

.leaderboard-rank-pill {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 127, 255, 0.14);
  border: 1px solid rgba(61, 127, 255, 0.28);
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  flex-shrink: 0
}

.leaderboard-card-score {
  text-align: right
}

.leaderboard-card-score .leaderboard-score {
  font-size: 18px;
  display: block
}

/* MESSAGES */
#page-messages.active {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 114px);
  gap: 16px;
  padding: 0;
}

.msg-sidebar {
  width: 320px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-content {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.msg-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.15s;
}

.msg-group-item:hover,
.msg-group-item.active {
  border-color: var(--accent);
}

.msg-group-item.unread {
  border-left: 3px solid var(--accent);
}

.msg-group-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg4);
  flex-shrink: 0;
}

.msg-group-icon-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.msg-bubble {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 2px;
  padding: 12px 16px;
  width: fit-content;
  max-width: 85%;
  align-self: flex-start;
}

.msg-bubble-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bubble-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
  text-align: right;
}

.msg-back {
  display: none;
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* COURSES */
.course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.course-image {
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg3);
}

.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.course-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-type {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}

.course-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere
}

.course-sub {
  font-size: 12px;
  color: var(--text3)
}

.course-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 12px;
  color: var(--text3);
}

.course-meta b {
  color: var(--text2);
  font-weight: 700;
}

.course-prog-bar {
  height: 4px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px
}

.course-prog-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent)
}

.course-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.course-pct {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500
}

.course-btn {
  background: var(--bg3);
  color: var(--accent);
  border: 1px solid rgba(61, 127, 255, 0.3);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 4px;
  height: 4px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px
}

/* MOBILE */
@media(max-width:768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s;
    width: 240px;
  }

  .sidebar.open {
    transform: translateX(0)
  }

  .main {
    width: 100%
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr)
  }

  .stat-card {
    padding: 14px
  }

  .stat-val {
    font-size: 19px
  }

  .two-col {
    grid-template-columns: 1fr
  }

  .three-col {
    grid-template-columns: 1fr
  }

  .hamburger {
    display: flex !important
  }

  .content {
    padding: 14px 14px 90px;
    height: calc(100dvh - 56px);
    overflow-y: auto
  }

  .topbar {
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 90
  }

  .topbar-title {
    font-size: 14px
  }

  .notif-btn {
    margin-left: 0
  }

  .avatar {
    width: 30px;
    height: 30px
  }

  .card,
  .full-card {
    padding: 14px
  }

  .exam-hall-item {
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  .exam-hall-right {
    text-align: right;
    margin-left: auto;
    flex-shrink: 0;
  }

  .exam-hall-score {
    font-size: 14px;
  }

  .login-card {
    max-width: 100%;
    margin: 0 14px;
    padding: 24px 18px
  }

  .result-modal-card {
    max-height: 94dvh;
    border-radius: 10px;
    margin: 10px
  }

  .result-hero {
    grid-template-columns: 1fr 1fr;
    gap: 8px
  }

  .result-hero-score {
    grid-column: 1 / -1
  }

  .result-hero-value {
    font-size: 28px
  }

  .result-grid,
  .result-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }

  .subject-result-head {
    align-items: center
  }

  .subject-highlight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }

  .subject-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .subject-result-score {
    font-size: 16px;
    padding: 4px 8px
  }

  .result-title {
    font-size: 14px
  }

  .leaderboard-wrap {
    display: none
  }

  .leaderboard-card-list {
    display: flex
  }

  #page-messages.active {
    flex-direction: column;
    height: calc(100dvh - 178px);
    gap: 10px;
  }

  .msg-sidebar {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
  }

  .msg-content {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
  }

  #page-messages.active .msg-content {
    display: none;
  }

  #page-messages.active.thread-open .msg-sidebar {
    display: none;
  }

  #page-messages.active.thread-open .msg-content {
    display: flex;
  }

  .msg-back {
    display: inline-flex;
    align-items: center
  }

  #page-courses {
    gap: 12px;
  }

  #courses-grid {
    gap: 12px;
  }

  .course-card {
    position: relative;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-areas:
      "image head"
      "image name"
      "image meta"
      "image progress"
      "image bottom";
    gap: 7px 12px;
    border-radius: 16px;
    padding: 12px;
    min-height: 134px;
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--course-tone, var(--accent)) 12%, transparent), transparent 45%),
      var(--bg2);
  }

  .course-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 99px 99px 0;
    background: var(--course-tone, var(--accent));
  }

  .course-card.no-image {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "name"
      "meta"
      "progress"
      "bottom";
    min-height: 0;
    padding-left: 14px;
  }

  .course-image {
    grid-area: image;
    width: 86px;
    height: 110px;
    aspect-ratio: auto;
    border-radius: 13px;
    align-self: stretch;
  }

  .course-head {
    grid-area: head;
    align-items: center;
    min-width: 0;
  }

  .course-badge {
    max-width: 100%;
    padding: 4px 8px;
    font-size: 9.5px;
    letter-spacing: 0.35px;
  }

  .course-type {
    display: none;
  }

  .course-name {
    grid-area: name;
    font-size: 14px;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .course-meta {
    grid-area: meta;
    grid-template-columns: 1fr;
    gap: 5px;
    font-size: 10.8px;
  }

  .course-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .course-meta b {
    display: inline-block;
    min-width: 34px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
  }

  .course-prog-bar {
    grid-area: progress;
    height: 3px;
    margin-top: 1px;
  }

  .course-bottom {
    grid-area: bottom;
    gap: 10px;
    align-self: end;
  }

  .course-pct {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .course-btn {
    min-height: 34px;
    min-width: 72px;
    padding: 8px 12px !important;
  }

  .mobile-dock {
    display: flex
  }
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 4px;
  border-radius: 6px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* MOBILE DOCK */
.mobile-dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: rgba(22, 27, 37, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 120;
  gap: 6px;
}

.dock-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
}

.dock-btn svg {
  width: 16px;
  height: 16px
}

.dock-btn.active {
  background: var(--accent-glow);
  color: var(--accent)
}

/* EMPTY STATE */
.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--text3);
  font-size: 14px
}

/* Neural network */
.neural-card {
  max-width: 820px;
}

.neural-subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.neural-chip {
  color: var(--accent);
  background: rgba(95, 141, 255, 0.12);
  border: 1px solid rgba(95, 141, 255, 0.28);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}

.neural-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.neural-message {
  min-width: 0;
}

.neural-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.neural-copy {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  max-width: 560px;
}

.neural-action {
  margin-top: 0;
  white-space: nowrap;
}

.neural-status {
  margin-top: 12px;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.5;
}

/* Motion polish */
.page {
  animation: pageFadeIn 0.2s ease;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.card,
.full-card,
.stat-card,
.course-card,
.exam-hall-item,
.notice-item,
.msg-group-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover,
.full-card:hover,
.stat-card:hover,
.course-card:hover,
.exam-hall-item:hover,
.notice-item:hover,
.msg-group-item:hover {
  transform: translateY(-1px);
}

/* Skeleton loader */
.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(120, 140, 180, 0.14);
  border: 1px solid rgba(123, 150, 218, 0.14);
  border-radius: 10px;
  min-height: 54px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: skeletonShimmer 1.2s infinite;
}

@keyframes skeletonShimmer {
  100% {
    transform: translateX(100%)
  }
}

/* Command palette */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.62);
  z-index: 7000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 12px 12px;
}

.command-palette {
  width: min(680px, 100%);
  max-height: 75vh;
  border: 1px solid rgba(123, 150, 218, 0.32);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(20, 30, 54, 0.97), rgba(10, 16, 30, 0.97));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.command-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(123, 150, 218, 0.22);
}

.command-input {
  flex: 1;
  border: 1px solid rgba(123, 150, 218, 0.28);
  background: rgba(22, 33, 58, 0.72);
  border-radius: 10px;
  height: 40px;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.command-shortcut {
  font-size: 11px;
  color: var(--text3);
  border: 1px solid rgba(123, 150, 218, 0.24);
  border-radius: 7px;
  padding: 4px 8px;
}

.command-list {
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.command-item {
  border: 1px solid rgba(123, 150, 218, 0.2);
  border-radius: 10px;
  background: rgba(22, 33, 58, 0.58);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.command-item:hover,
.command-item.active {
  border-color: rgba(123, 150, 218, 0.42);
  background: linear-gradient(90deg, rgba(95, 141, 255, 0.22), rgba(122, 109, 255, 0.12));
  color: var(--text);
}

.command-meta {
  font-size: 11px;
  color: var(--text3)
}

/* Virtualized list helpers */
.virtual-list {
  position: relative;
  overflow-y: auto;
}

.virtual-spacer {
  width: 100%;
}

.virtual-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* ---------------------------
   2026 UI OVERHAUL (v2 look)
---------------------------- */
:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #1a1a1a;
  --bg4: #222222;
  --border: #2a2a2a;
  --border2: #3a3a3a;
  --text: #ededed;
  --text2: #a1a1a1;
  --text3: #666666;
  --accent: #fff;
  --accent2: #d4d4d4;
  --accent-text: #000000;
  --accent-glow: rgba(255, 255, 255, 0.08);
  --r: 8px;
  --r2: 12px;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

#login-screen {
  background: var(--bg);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.login-title {
  font-size: 22px;
  letter-spacing: -0.2px
}

.login-input {
  background: var(--bg3)
}

.login-btn {
  background: var(--accent);
  color: #000;
  border: none;
}

.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
  gap: 16px;
  height: 100dvh;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--bg2);
  box-shadow: none;
}

.sidebar-logo {
  padding: 22px 20px 18px
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  box-shadow: none;
}

.logo-text {
  font-size: 15px
}

.logo-sub {
  font-size: 11.5px
}

.nav-section {
  padding: 14px 12px 6px
}

.nav-item {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: 13px;
}

.nav-item:hover {
  background: var(--bg3);
  border-color: transparent;
}

.nav-item.active {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text);
}

.main {
  border-radius: var(--r2);
  overflow: hidden
}

.topbar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  height: 56px;
  padding: 0 16px;
  margin-bottom: 10px;
  box-shadow: none;
}

.topbar-title {
  font-size: 18px;
  letter-spacing: -0.2px;
}

.notif-btn {
  background: var(--bg3);
  border-color: var(--border);
}

.avatar {
  background: var(--accent);
  color: #000;
  box-shadow: none;
}

.content {
  padding: 0 2px 8px;
  gap: 16px;
}

.dashboard-hero {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 22px;
  background: var(--bg2);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.dashboard-hero-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9fb4df;
  margin-bottom: 10px;
  font-weight: 600;
}

.dashboard-hero-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.6px;
  max-width: 680px;
}

.dashboard-hero-sub {
  margin-top: 10px;
  color: var(--text2);
  font-size: 14px;
  max-width: 700px;
}

.dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.dashboard-priority-card {
  border-color: var(--border);
}

.hero-btn {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  background: var(--accent);
  box-shadow: none;
}

.hero-btn.ghost {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  box-shadow: none;
}

.stat-card,
.card,
.full-card,
.msg-sidebar,
.msg-content,
.course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: none;
}

.stat-card {
  padding: 18px 18px
}

.stat-label {
  font-size: 10.5px;
  color: #9fb1d8
}

.stat-val {
  font-size: 24px;
  letter-spacing: -0.4px
}

.card-title {
  font-size: 14px
}

.card-action {
  font-weight: 600
}

.exam-item,
.class-item {
  border-bottom: 1px solid var(--border);
}

.exam-hall-item,
.notice-item,
.msg-group-item,
.tt-select,
.msg-bubble {
  border-color: var(--border);
  background: var(--bg3);
}

.start-btn {
  background: var(--accent);
  color: #000;
  border: none;
}

.start-btn.gray {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}

.exam-calendar-item {
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
}

.exam-calendar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.exam-calendar-chip {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(95, 141, 255, 0.12);
  border: 1px solid rgba(123, 150, 218, 0.26);
  border-radius: 999px;
  padding: 4px 8px;
}

.exam-calendar-chip.subtle {
  color: var(--text2);
  text-transform: none;
  font-weight: 500;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-calendar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.exam-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: #000;
  background: var(--accent);
  box-shadow: none;
}

.exam-view-btn svg {
  width: 14px;
  height: 14px
}

.mobile-dock {
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

@media(max-width:1024px) {
  .app {
    padding: 10px;
    gap: 10px
  }

  .sidebar {
    width: 246px;
    min-width: 246px
  }

  .dashboard-hero-title {
    font-size: 24px
  }
}

@media(max-width:768px) {
  .app {
    padding: 0
  }

  .main {
    border-radius: 0
  }

  .topbar {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 0 12px;
    height: 56px;
  }

  .content {
    padding: 14px 14px 90px
  }

  .dashboard-hero {
    padding: 16px;
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero-title {
    font-size: 21px
  }

  .dashboard-hero-sub {
    font-size: 13px
  }

  .sidebar {
    border-radius: 0 18px 18px 0;
    border-left: none;
  }
}

/* Topbar utilities */
.topbar-search-wrap {
  width: min(420px, 42vw);
}

.topbar-search {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg3);
  border-radius: var(--r);
  height: 34px;
  color: var(--text);
  font-size: 13px;
  padding: 0 12px;
  outline: none;
}

.topbar-search::placeholder {
  color: var(--text3)
}

.topbar-search:focus {
  border-color: var(--border2)
}

.topbar-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(88, 214, 141, 0.34);
  background: rgba(34, 197, 94, 0.14);
  color: #8df4b4;
  white-space: nowrap;
}

.sync-pill.cached {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #ffd694;
}

.sync-pill.offline {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.12);
  color: #ffb0b0;
}

.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-mode-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.theme-mode-btn {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg3));
  color: var(--text2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.theme-mode-btn.active {
  color: var(--text);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}

.theme-preset-btn {
  border: 1px solid rgba(123, 150, 218, 0.24);
  border-radius: 12px;
  padding: 12px;
  background: rgba(22, 33, 58, 0.62);
  color: var(--text);
  text-align: left;
}

.theme-preset-btn.active {
  border-color: rgba(123, 150, 218, 0.5);
  box-shadow: 0 0 0 2px rgba(95, 141, 255, 0.2) inset;
}

.theme-preset-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px
}

.theme-preset-preview {
  display: flex;
  gap: 6px;
}

.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Page sub-sections */
.subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 10px;
  overflow-x: auto;
}

.subnav::-webkit-scrollbar {
  height: 0
}

.subnav-chip {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.subnav-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

/* Dashboard section visibility */
#page-dashboard[data-subview="overview"] .two-col {
  display: none
}

#page-dashboard[data-subview="schedule"] .stats-row {
  display: none
}

/* Better responsive polish across tabs */
@media(max-width:1024px) {
  .stats-row {
    grid-template-columns: 1fr 1fr
  }

  .three-col {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:768px) {
  .topbar-search-wrap {
    flex: 1;
    min-width: 0
  }

  .sync-pill {
    display: none
  }

  .theme-preset-grid {
    grid-template-columns: 1fr
  }

  .theme-mode-row {
    flex-direction: column
  }

  .settings-actions {
    flex-direction: column
  }

  .neural-panel {
    align-items: stretch;
    flex-direction: column
  }

  .neural-action {
    width: 100%
  }

  .topbar-search {
    height: 34px;
    font-size: 12px;
  }

  .topbar-title {
    display: none
  }

  .subnav {
    position: sticky;
    top: 56px;
    z-index: 89;
    margin: 0 -14px;
    padding: 10px 14px;
    background: rgba(10, 16, 30, 0.94);
    border-bottom: 1px solid rgba(123, 150, 218, 0.18);
  }

  .subnav-chip {
    padding: 8px 12px
  }

  .card-header {
    gap: 8px;
    flex-wrap: wrap;
  }

  .card-title {
    font-size: 13px
  }

  .full-card,
  .card {
    border-radius: 14px
  }

  .exam-hall-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  .exam-hall-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
  }

  .exam-hall-icon svg {
    width: 18px;
    height: 18px;
  }

  .exam-hall-info {
    flex: 1;
    min-width: 0;
  }

  .exam-hall-header-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
  }

  .exam-hall-name {
    font-size: 13.5px;
    line-height: 1.35;
    word-break: break-word;
  }

  .exam-badge {
    font-size: 10.5px;
    padding: 2px 7px;
  }

  .exam-hall-meta {
    font-size: 11.5px;
    line-height: 1.45;
    word-break: break-word;
  }

  .exam-hall-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
  }

  .exam-hall-actions .start-btn,
  .exam-syllabus-btn {
    padding: 6px 12px;
    font-size: 11.5px;
    border-radius: 6px;
    min-height: 30px;
    margin-top: 0;
  }

  .exam-hall-right {
    margin: 0;
    text-align: right;
    flex-shrink: 0;
    display: block;
    width: auto;
  }

  .exam-hall-score {
    font-size: 14px;
  }

  .exam-hall-rank {
    font-size: 10.5px;
  }

  .syllabus-modal-backdrop {
    padding: 12px;
  }

  .syllabus-modal-card {
    max-height: 90vh;
    border-radius: 12px;
  }

  .syllabus-modal-header {
    padding: 12px 14px;
    gap: 10px;
  }

  .syllabus-modal-title {
    font-size: 14px;
  }

  .syllabus-modal-meta {
    font-size: 11px;
  }

  .syllabus-modal-body {
    padding: 12px 14px;
    gap: 10px;
  }

  .syllabus-modal-subject-card {
    padding: 11px 13px;
    border-radius: 8px;
  }

  .syllabus-modal-subject-header {
    font-size: 12.5px;
  }

  .syllabus-modal-topic {
    font-size: 12px;
    line-height: 1.45;
    padding-left: 8px;
  }

  .exam-calendar-item {
    flex-direction: column;
    gap: 8px;
  }

  .exam-calendar-right {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .exam-calendar-chip.subtle {
    max-width: 100%
  }

  .tt-select {
    width: 100%;
    max-width: none !important;
  }

  #page-timetable>div:first-child,
  #page-examhall>div:first-child,
  #page-era>div:first-child {
    display: grid !important;
    grid-template-columns: 1fr !important;
    margin-bottom: 8px !important;
  }

  #page-messages.active {
    height: calc(100dvh - 208px);
  }

  .command-palette-backdrop {
    padding: 6vh 10px 10px
  }

  .command-header {
    padding: 8px
  }

  .command-input {
    height: 36px;
    font-size: 13px
  }

  .command-item {
    padding: 9px 10px
  }
}

/* Unified theme-aware buttons */
.start-btn,
.hero-btn,
.exam-view-btn,
.class-btn,
.course-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
}

.start-btn.gray,
.class-btn.gray,
.hero-btn.ghost {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}

.course-btn {
  color: var(--accent-text);
}

/* Light mode */
body.light-mode {
  --bg: #fafafa;
  --bg2: #ffffff;
  --bg3: #f5f5f5;
  --bg4: #ebebeb;
  --border: #e5e5e5;
  --border2: #d4d4d4;
  --text: #0a0a0a;
  --text2: #525252;
  --text3: #a3a3a3;
  --accent: #000;
  --accent2: #333;
  --accent-text: #ffffff;
  --accent-glow: rgba(0, 0, 0, 0.08);
}

body.light-mode {
  background: var(--bg);
}

body.light-mode .login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.light-mode .login-input {
  background: var(--bg3);
}

body.light-mode .login-input::placeholder {
  color: var(--text3);
}

body.light-mode #login-screen {
  background: var(--bg);
}

body.light-mode .sidebar {
  background: var(--bg2);
}

body.light-mode .topbar {
  background: var(--bg2);
}

body.light-mode .dashboard-hero {
  background: var(--bg2);
}

body.light-mode .stat-card,
body.light-mode .card,
body.light-mode .full-card,
body.light-mode .msg-sidebar,
body.light-mode .msg-content,
body.light-mode .course-card,
body.light-mode .exam-hall-item,
body.light-mode .notice-item,
body.light-mode .msg-group-item,
body.light-mode .msg-bubble {
  background: #ffffff;
}

body.light-mode .hero-btn.ghost {
  background: var(--bg3);
  color: var(--text2);
}

body.light-mode .topbar-search,
body.light-mode .topbar-btn {
  background: var(--bg3);
}

body.light-mode .subnav {
  background: transparent;
}

body.light-mode .subnav-chip {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text2);
}

body.light-mode .subnav-chip.active {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-text);
}

body.light-mode .dock-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
}

body.light-mode .mobile-dock {
  background: var(--bg2);
}

body.light-mode .exam-calendar-chip {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text2);
}

body.light-mode .exam-calendar-chip.subtle {
  color: var(--text3);
}

/* Theme presets (dark mode palettes) */
body.theme-ocean {
  --accent: #4f9dff;
  --accent2: #20b6ff;
  --accent-text: #ffffff;
  --accent-glow: rgba(79, 157, 255, 0.12);
}

body.theme-purple {
  --accent: #9b7bff;
  --accent2: #c25dff;
  --accent-text: #ffffff;
  --accent-glow: rgba(155, 123, 255, 0.12);
}

body.theme-emerald {
  --accent: #22c55e;
  --accent2: #14b8a6;
  --accent-text: #ffffff;
  --accent-glow: rgba(34, 197, 94, 0.10);
}



/* Final unified action-button system */
body .start-btn,
body .class-btn,
body .course-btn,
body .hero-btn,
body .exam-view-btn,
body #page-dashboard .stat-card button,
body .theme-mode-btn,
body .login-btn,
body .chem-btn-primary,
body button.start-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border-radius: var(--r, 8px) !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  background: var(--accent) !important;
  color: var(--accent-text) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  cursor: pointer !important;
  transition: opacity 0.15s ease, background 0.15s ease !important;
}

body .start-btn.gray,
body .class-btn.gray,
body .hero-btn.ghost,
body button.start-btn.gray {
  background: var(--bg3) !important;
  color: var(--text2) !important;
  border: 1px solid var(--border) !important;
}

body .start-btn.gray:hover:not(:disabled),
body .class-btn.gray:hover:not(:disabled),
body .hero-btn.ghost:hover:not(:disabled),
body button.start-btn.gray:hover:not(:disabled) {
  background: var(--bg4) !important;
  color: var(--text) !important;
  border-color: var(--border2) !important;
}

body .start-btn:hover:not(:disabled),
body .class-btn:hover:not(:disabled),
body .hero-btn:hover:not(:disabled),
body .login-btn:hover:not(:disabled),
body .chem-btn-primary:hover:not(:disabled) {
  opacity: 0.9 !important;
}

body .start-btn:disabled,
body .start-btn.gray:disabled,
body .class-btn:disabled,
body .class-btn.gray:disabled,
body .course-btn:disabled,
body .hero-btn:disabled,
body .hero-btn.ghost:disabled,
body .exam-view-btn:disabled,
body #page-dashboard .stat-card button:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

body.light-mode .app,
body.light-mode .dashboard-hero,
body.light-mode .sidebar,
body.light-mode .topbar,
body.light-mode .stat-card,
body.light-mode .card,
body.light-mode .full-card {
  box-shadow: none;
}

@media(max-width:768px) {
  body #page-courses .card-header {
    margin-bottom: 4px;
  }

  body #courses-grid.three-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  body #page-courses .course-card {
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--course-tone, var(--accent)) 14%, transparent), transparent 48%),
      linear-gradient(165deg, rgba(18, 27, 49, 0.94), rgba(12, 18, 34, 0.94)) !important;
    border-color: color-mix(in srgb, var(--course-tone, var(--accent)) 32%, var(--border)) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18) !important;
    transform: none !important;
  }

  body.light-mode #page-courses .course-card {
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--course-tone, var(--accent)) 10%, transparent), transparent 48%),
      #ffffff !important;
    box-shadow: 0 8px 18px rgba(15, 25, 60, 0.08) !important;
  }

  body #page-courses .course-image {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  }

  body #page-courses .course-bottom {
    margin-top: 1px;
  }

  body #page-courses .course-btn {
    min-height: 34px !important;
    min-width: 72px !important;
    padding: 8px 12px !important;
    border-radius: 9px !important;
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  .page,
  .card,
  .full-card,
  .stat-card,
  .course-card,
  .exam-hall-item,
  .notice-item,
  .msg-group-item {
    animation: none !important;
    transition: none !important;
  }

  .skeleton::after {
    animation: none !important
  }
}

/* Chemistry practice */
.chem-practice-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px
}

.chem-practice-content {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.chem-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 4px
}

.chem-kicker {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em
}

.chem-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.4px
}

.chem-stat-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px
}

.chem-stat-pill {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px
}

.chem-stat-pill strong {
  color: var(--accent)
}

.chem-view {
  display: none
}

.chem-view.active {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.chem-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px
}

.chem-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px
}

.chem-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.chem-full-width {
  grid-column: span 2
}

.chem-btn {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease
}

.chem-btn:active {
  transform: scale(.98)
}

.chem-btn-primary {
  color: var(--accent-text);
  background: var(--accent);
  box-shadow: none
}

.chem-btn-secondary {
  color: var(--text);
  background: var(--bg3);
  border: 1px solid var(--border)
}

.chem-btn-ghost {
  color: var(--text2);
  background: transparent;
  border: 1px solid var(--border)
}

.chem-btn-secondary:hover,
.chem-btn-ghost:hover {
  background: var(--bg4);
  color: var(--text)
}

.chem-wide-btn {
  width: 100%;
  margin-top: 2px
}

.chem-progress-track {
  height: 4px;
  background: var(--bg4);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px
}

.chem-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .25s ease
}

.chem-canvas-wrap {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden
}

.chem-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  display: block
}

.chem-compound-name {
  margin-top: 14px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text)
}

.chem-compound-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text3)
}

.chem-compound-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px
}

.chem-meta-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block
}

.chem-dot-green {
  background: #22c55e
}

.chem-dot-red {
  background: #ef4444
}

.chem-dot-amber {
  background: #f59e0b
}

.chem-learn-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px
}

.chem-nav-counter {
  min-width: 64px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text3)
}

.chem-question-hint {
  margin-top: 12px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text3)
}

.chem-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.chem-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  text-align: left;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer
}

.chem-opt-btn:hover:not(:disabled) {
  background: var(--bg3);
  border-color: rgba(61, 127, 255, .45)
}

.chem-opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg4);
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  font-size: 11px
}

.chem-opt-btn.correct {
  background: rgba(34, 197, 94, .12);
  border-color: #22c55e;
  color: #22c55e
}

.chem-opt-btn.correct .chem-opt-letter {
  background: #22c55e;
  color: #06130b
}

.chem-opt-btn.wrong {
  background: rgba(239, 68, 68, .12);
  border-color: #ef4444;
  color: #ef4444
}

.chem-opt-btn.wrong .chem-opt-letter {
  background: #ef4444;
  color: white
}

.chem-opt-btn.reveal {
  border-color: #22c55e;
  color: #22c55e;
  opacity: .8
}

.chem-feedback-flash {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  z-index: 1200;
  pointer-events: none;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .24s ease
}

.chem-feedback-flash.show {
  transform: translateX(-50%) translateY(0)
}

.chem-feedback-flash.wrong {
  background: #ef4444
}

.chem-stats-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .56)
}

.chem-stats-sheet.open {
  display: flex
}

.chem-stats-panel {
  width: min(520px, 100%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 18px
}

.chem-stats-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px
}

.chem-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border)
}

.chem-stat-row:last-child {
  border-bottom: 0
}

.chem-stat-name {
  color: var(--text2);
  font-size: 13px
}

.chem-stat-val {
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  font-size: 11px
}

.chem-hidden {
  display: none
}

.chem-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px
}

.chem-board-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: -5px
}

.chem-board-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px
}

.chem-tab-btn {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text3);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer
}

.chem-tab-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.chem-board-list {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.chem-board-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px
}

.chem-board-rank {
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700
}

.chem-board-name {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.chem-board-score {
  font-family: 'Space Mono', monospace;
  color: var(--text3);
  font-size: 11px;
  text-align: right
}

@media (max-width:700px) {
  .chem-header {
    align-items: flex-start;
    flex-direction: column
  }

  .chem-stat-bar {
    justify-content: flex-start
  }

  .chem-board-head {
    flex-direction: column
  }

  .chem-menu-grid,
  .chem-options-grid {
    grid-template-columns: 1fr
  }

  .chem-full-width {
    grid-column: auto
  }

  .chem-canvas-wrap {
    min-height: 220px
  }
}

/* Rank Predictor Scoped Styles */
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 10px;
}

.rank-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  transition: background 0.3s;
  flex-shrink: 0;
}

.rank-dot.loading {
  background: #f0b429;
  animation: rank-blink 1s infinite;
}

.rank-dot.ready {
  background: #6fcf6f;
}

.rank-dot.error {
  background: #ef4444;
}

@keyframes rank-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

.rank-predictor-container {
  margin-top: 16px;
}

.rank-inputs-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rank-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text3);
}

.rank-field input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s;
  outline: none;
}

.rank-field input:focus {
  border-color: var(--accent);
}

.rank-field .hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.rank-hero {
  text-align: center;
  padding: 12px 0 24px;
}

.rank-hero .big {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.rank-hero .lbl {
  font-size: 13px;
  color: var(--text3);
  margin-top: 6px;
}

.rank-prog-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 24px;
}

.rank-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  width: 0%;
  transition: width 1s cubic-bezier(.4, 0, .2, 1);
}

.rank-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.rank-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
}

.rank-stat .sl {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 5px;
  font-weight: 500;
}

.rank-stat .sv {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.rank-stat .ss {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.rank-pipe {
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  margin-top: 10px;
}

.rank-pipe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

.rank-pipe-row:last-child {
  border-bottom: none;
}

body:not(.light-mode) .rank-pipe-row.highlight {
  background: rgba(255, 255, 255, 0.03);
}

body.light-mode .rank-pipe-row.highlight {
  background: rgba(0, 0, 0, 0.02);
}

.rank-pl {
  color: var(--text3);
}

.rank-pv {
  font-weight: 600;
  color: var(--text2);
}

.rank-pv.accent {
  color: var(--accent);
}

.rank-pipe-sep {
  padding: 5px 14px;
  font-size: 11px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.rank-alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 12px;
  display: none;
}

.rank-alert-warn {
  background: rgba(240, 180, 41, 0.1);
  color: #ffd694;
  border: 1px solid rgba(240, 180, 41, 0.35);
}

body.light-mode .rank-alert-warn {
  background: #fffcf0;
  color: #b7791f;
  border: 1px solid #fbd38d;
}

.rank-alert-good {
  background: rgba(34, 197, 94, 0.1);
  color: #8df4b4;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

body.light-mode .rank-alert-good {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.rank-alert-red {
  background: rgba(239, 68, 68, 0.1);
  color: #ffb0b0;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

body.light-mode .rank-alert-red {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

@media(max-width: 700px) {
  .rank-grid2 {
    grid-template-columns: 1fr;
  }
}

/* Chemistry Practice Structure & Text Input Styles */
.chem-opt-btn-structure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  aspect-ratio: 1.4;
  min-height: 160px;
  position: relative;
  transition: all 0.2s ease;
}

.chem-opt-btn-structure:hover:not(:disabled) {
  background: var(--bg3);
  border-color: rgba(61, 127, 255, 0.45);
}

.chem-opt-btn-structure.correct {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
}

.chem-opt-btn-structure.wrong {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.chem-opt-btn-structure.reveal {
  border-color: #22c55e;
  opacity: 0.8;
}

.chem-opt-btn-structure canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.chem-options-grid.chem-reverse-layout {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .chem-options-grid.chem-reverse-layout {
    grid-template-columns: 1fr;
  }
}

/* Switch Toggle Custom Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  border-radius: 24px;
  transition: 0.3s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: var(--text3);
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked+.switch-slider {
  background-color: var(--accent);
}

.switch input:checked+.switch-slider:before {
  transform: translateX(20px);
  background-color: #0a0a0a;
}

/* RDKit Canvas dark/light mode rendering filters */
.rdkit-canvas {
  background-color: #121b31;
  filter: invert(1) hue-rotate(180deg);
  transition: filter 0.15s ease, background-color 0.15s ease;
}

body.light-mode .rdkit-canvas {
  background-color: #ffffff;
  filter: none;
}

/* Practice Mode Selection styles */
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.mode-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  will-change: transform, box-shadow;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  position: relative;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent) !important;
  box-shadow: 0 12px 30px var(--accent-glow) !important;
}

.mode-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card-icon {
  font-size: 32px;
}

.mode-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.mode-card-desc {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.5;
}

.mode-card-btn {
  margin-top: 20px;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 768px) {
  .chem-view-select-mode .chem-panel {
    padding: 20px 14px !important;
  }

  .chem-view-select-mode h2 {
    font-size: 20px !important;
    margin-bottom: 16px !important;
  }

  .mode-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mode-card {
    min-height: auto;
    padding: 16px;
    flex-direction: column;
    justify-content: center;
  }

  .mode-card-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }

  .mode-card-icon {
    font-size: 28px;
    flex-shrink: 0;
  }

  .mode-card-title {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .mode-card-desc {
    font-size: 12px;
    line-height: 1.4;
  }

  .mode-card-btn {
    display: none !important;
  }
}

/* CHEMICAL EQUATION STYLING */
.reaction-equation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.eq-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.eq-block {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 26%;
  min-width: 90px;
  word-break: break-word;
  line-height: 1.25;
}

.eq-reagent {
  border-color: var(--accent);
  color: var(--text);
  background: linear-gradient(135deg, var(--bg3), color-mix(in srgb, var(--accent) 8%, transparent));
}

.eq-reactant {
  border-color: #f5a623;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg3), rgba(245, 166, 35, 0.08));
}

.eq-product {
  border-color: #22c986;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg3), rgba(34, 201, 134, 0.08));
}

.eq-operator {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text3);
  flex: 0 0 auto;
  padding: 0 2px;
}

.eq-arrow {
  font-family: 'Space Mono', monospace;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent);
  flex: 0 0 auto;
  padding: 0 2px;
}

.eq-hidden {
  border: 2px dashed var(--accent);
  background: rgba(124, 106, 247, 0.04);
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  animation: pulse-glow 2s infinite ease-in-out;
  min-height: 54px;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 5px rgba(124, 106, 247, 0.2);
    border-color: rgba(124, 106, 247, 0.4);
  }

  50% {
    box-shadow: 0 0 15px rgba(124, 106, 247, 0.5);
    border-color: rgba(124, 106, 247, 0.9);
  }

  100% {
    box-shadow: 0 0 5px rgba(124, 106, 247, 0.2);
    border-color: rgba(124, 106, 247, 0.4);
  }
}

/* --- SOLUTIONS VIEWER --- */
.sol-tabs {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.sol-tab-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  outline: none;
}

.sol-tab-btn:hover {
  border-color: var(--border2);
  color: var(--text);
  background: var(--bg4);
}

.sol-tab-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

.sol-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s, border-color 0.2s;
}

.sol-card:hover {
  transform: translateY(-2px);
  border-color: var(--border2);
}

.sol-card.correct-card {
  border-left: 4px solid var(--green);
}

.sol-card.incorrect-card {
  border-left: 4px solid var(--red);
}

.sol-card.skipped-card {
  border-left: 4px solid var(--text3);
}

.sol-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sol-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.sol-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sol-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.sol-badge.easy {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.sol-badge.medium {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
}

.sol-badge.hard {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.sol-badge.correct {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.sol-badge.incorrect {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.sol-badge.skipped {
  background: var(--bg4);
  color: var(--text3);
}

.sol-badge.time {
  background: var(--bg4);
  color: var(--text2);
  font-family: 'Space Mono', monospace;
}

.sol-badge.time.over {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.1);
}

.sol-badge.time.under {
  color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

.sol-card-body {
  margin-bottom: 12px;
}

.sol-answers {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
}

.sol-ans-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sol-ans-label {
  color: var(--text3);
  font-weight: 500;
}

.sol-ans-val {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg4);
  color: var(--text);
}

.sol-ans-val.correct {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.sol-ans-val.incorrect {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.sol-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.sol-toggle-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.sol-img-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
}

.sol-img-container.expanded {
  margin-top: 12px;
}

.sol-img-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  min-height: 80px;
}

.sol-img {
  max-width: 100%;
  height: auto;
  display: none;
  border-radius: 4px;
}

.sol-spinner {
  border: 3px solid rgba(95, 141, 255, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border-left-color: var(--accent);
  animation: spin-sol 0.8s linear infinite;
  display: none;
  margin: 16px 0;
}

.sol-error {
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  display: none;
  margin: 16px 0;
}

.sol-action-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 4px;
}

.sol-action-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.sol-action-btn:hover {
  background: var(--bg4);
  color: var(--text);
  border-color: var(--border2);
}

@keyframes spin-sol {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- ANSWER KEY PANEL --- */
.ak-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  animation: ak-fade 0.15s ease;
}

@keyframes ak-fade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.ak-subject-block {
  margin-bottom: 18px;
}

.ak-subject-block:last-child {
  margin-bottom: 0;
}

.ak-subject-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  margin-bottom: 10px;
}

.ak-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ak-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  gap: 2px;
}

.ak-qno {
  font-size: 9px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.04em;
}

.ak-ans {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ak-cell.ak-correct {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

.ak-cell.ak-correct .ak-ans {
  color: var(--green);
}

.ak-cell.ak-wrong {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

.ak-cell.ak-wrong .ak-ans {
  color: var(--red);
}

.ak-cell.ak-skipped {
  opacity: 0.5;
}

/* Mobile responsive rules for clean dark report-style Result Analysis page */
.report-table-desktop-wrapper {
  display: block;
}

.report-cards-mobile-wrapper {
  display: none;
}

.report-subject-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s;
}

.report-subject-card:hover {
  border-color: var(--border2);
}

.report-subject-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.report-subject-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.report-subject-score {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.report-subject-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.report-sub-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.report-sub-metric .lbl {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.report-sub-metric .val {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.report-subject-card-breakdown {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

@media(max-width: 768px) {
  .report-header-grid {
    grid-template-columns: 1fr !important;
  }

  .report-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .report-meta-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .report-table-desktop-wrapper {
    display: none !important;
  }

  .report-cards-mobile-wrapper {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
  }

  .result-modal-card {
    max-height: 96dvh;
    border-radius: var(--r2);
    margin: 8px;
  }

  #result-modal-body {
    padding: 14px !important;
  }

  .report-actions {
    gap: 6px;
  }

  .report-btn {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

@media(max-width: 400px) {
  .report-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .report-subject-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

/* EXAM CALENDAR DETAILS - Full Screen Page */
.calendar-detail-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 6000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  color: var(--text);
  animation: calendarFadeIn 0.2s ease-out;
}

@keyframes calendarFadeIn {
  from {
    opacity: 0;
    transform: scale(0.99);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.calendar-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.calendar-detail-body {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.calendar-detail-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.calendar-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.calendar-detail-meta-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.calendar-detail-meta-icon {
  background: var(--bg3);
  color: var(--accent);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.calendar-detail-meta-info {
  display: flex;
  flex-direction: column;
}

.calendar-detail-meta-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.calendar-detail-meta-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.calendar-detail-syllabus-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.calendar-detail-syllabus-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.calendar-detail-syllabus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.5;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: 8px;
  border-left: 3px solid var(--border2);
}

/* --- OLD RESULT PAGE THEMED STYLES --- */
.result-modal-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  max-width: 860px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}

.result-title {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.result-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.result-hero {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.result-hero-score {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--green) 12%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}

.result-hero-label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-hero-value {
  font-size: 34px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 8px;
  word-break: break-word;
}

.result-hero-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 6px;
}

.result-hero-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
}

.result-hero-stat .result-value {
  font-size: 18px;
  margin-top: 8px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.result-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-metric {
  padding: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}

.result-label {
  font-size: 10.5px;
  color: var(--text3);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.result-value {
  font-size: 13px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  margin-top: 3px;
  word-break: break-word;
}

.result-section-title {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}

.result-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.result-chip {
  font-size: 11px;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
}

.subject-result-card {
  padding: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 8px;
}

.subject-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.subject-result-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}

.subject-result-score {
  font-size: 22px;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

.subject-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.subject-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.mini-metric {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px;
  min-width: 0;
}

.mini-label {
  font-size: 10px;
  color: var(--text3);
}

.mini-value {
  font-size: 12px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  margin-top: 2px;
  word-break: break-word;
}

.mini-metric.major {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.mini-metric.major .mini-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
}

.result-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.result-link {
  font-size: 12px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 8px;
  padding: 7px 10px;
}

/* Portal Function Cards */
.function-nav-card {
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.function-nav-card:hover {
  border-color: var(--accent) !important;
  background: var(--bg4) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

.function-nav-card:active {
  transform: scale(0.98);
}

#settings-functions-btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 24%, var(--bg3));
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

@media (max-width: 768px) {
  .settings-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .settings-actions .theme-mode-btn {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    touch-action: manipulation;
  }

  #settings-functions-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
  }
}

@media (max-width: 480px) {
  .settings-actions {
    grid-template-columns: 1fr;
  }

  .exam-hall-item {
    gap: 10px;
    padding: 10px 12px;
  }

  .exam-hall-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 7px;
  }

  .exam-hall-icon svg {
    width: 16px;
    height: 16px;
  }

  .exam-hall-name {
    font-size: 13px;
  }

  .exam-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .exam-hall-meta {
    font-size: 11px;
  }

  .exam-hall-actions {
    gap: 6px;
    margin-top: 7px;
  }

  .exam-hall-actions .start-btn,
  .exam-syllabus-btn {
    padding: 5px 10px;
    font-size: 11px;
    min-height: 28px;
  }

  .syllabus-modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }

  .syllabus-modal-card {
    max-height: 92vh;
    border-radius: 16px 16px 10px 10px;
  }

  .syllabus-modal-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .syllabus-modal-title {
    font-size: 13.5px;
  }

  .syllabus-modal-header-actions {
    gap: 6px;
  }

  .syllabus-modal-copy-btn,
  .syllabus-modal-close-btn {
    padding: 5px 9px;
    font-size: 11px;
    min-height: 28px;
  }

  .syllabus-modal-body {
    padding: 10px 12px;
    gap: 8px;
  }

  .syllabus-modal-subject-card {
    padding: 10px 11px;
  }
}

/* ── PSEUDO-LEADERBOARD & CALIBRATION CONSOLE ── */
.pl-card-mode-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pl-mode-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.pl-mode-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text2);
}

.pl-card-mode-chips {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.pl-card-mode-chip {
  background: transparent;
  border: none;
  color: var(--text2);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pl-card-mode-chip:hover:not(.active) {
  color: var(--text);
  background: var(--bg4);
}

.pl-card-mode-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.pl-slider-container {
  width: 100%;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.pl-slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pl-slider-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
}

.pl-slider-badge {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(61, 127, 255, 0.14);
  border: 1px solid rgba(61, 127, 255, 0.25);
  padding: 2px 7px;
  border-radius: 5px;
}

.neural-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 5px;
  border-radius: 3px;
  background: var(--bg2);
}

/* Calibration Console */
.pl-calibration-console {
  margin-top: 8px;
  margin-bottom: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.pl-calibration-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.pl-calibration-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-calibration-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.pl-calib-icon {
  font-size: 13px;
}

.pl-calibration-actions {
  display: flex;
  gap: 6px;
}

.pl-calibration-guide {
  font-size: 11.5px;
  color: var(--text3);
  line-height: 1.4;
  margin-bottom: 10px;
}

.pl-anchor-columns {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}

.pl-anchor-scrollbox {
  max-height: 165px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  margin-top: 4px;
}

.pl-anchor-container {
  display: flex;
  flex-direction: column;
  min-width: 320px;
}

.pl-anchor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
  background: transparent;
  transition: background 0.12s ease;
}

.pl-anchor-row:last-child {
  border-bottom: none;
}

.pl-anchor-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.pl-anchor-row.topper-anchor {
  background: rgba(245, 158, 11, 0.08);
  border-left: 2px solid #f59e0b;
  border-radius: 4px 0 0 4px;
}

.pl-anchor-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11.5px;
  font-family: 'Space Mono', monospace;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.pl-anchor-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}

.pl-anchor-del-btn {
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

.pl-anchor-del-btn:hover:not(:disabled) {
  color: var(--red);
  background: rgba(239, 68, 68, 0.14);
}

.pl-anchor-del-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Badges */
.pl-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'Space Mono', monospace;
  display: inline-block;
  white-space: nowrap;
}

.pl-badge-topper {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pl-badge-anchor {
  background: rgba(61, 127, 255, 0.14);
  color: var(--accent);
  border: 1px solid rgba(61, 127, 255, 0.28);
}

.pl-badge-pred {
  background: var(--bg4);
  color: var(--text3);
  border: 1px solid var(--border);
}


/* Results Section & Telemetry */
.pl-meta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.pl-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pl-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.pl-meta-tag {
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pl-meta-model {
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}

.pl-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}

.pl-latency-label {
  color: var(--text3);
}

.pl-latency-val {
  color: var(--accent);
  font-weight: 700;
}

/* Subtabs for Neural page */
#page-neural[data-subview="leaderboard"] #card-ranknet-predictor {
  display: none !important;
}

#page-neural[data-subview="predictor"] #card-pseudo-leaderboard {
  display: none !important;
}

/* Responsive mobile adjustments for Pseudo-Leaderboard */
@media (max-width: 768px) {
  #card-pseudo-leaderboard .leaderboard-wrap {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    margin-top: 10px;
  }

  #card-pseudo-leaderboard .leaderboard-table {
    min-width: 100% !important;
    font-size: 11.5px;
  }

  #card-pseudo-leaderboard .leaderboard-table th,
  #card-pseudo-leaderboard .leaderboard-table td {
    padding: 7px 8px;
    white-space: nowrap;
  }

  .pl-anchor-row {
    padding: 6px 4px;
    gap: 6px;
  }

  .pl-anchor-input {
    font-size: 11px;
    padding: 4px 4px;
  }
}

@media (max-width: 480px) {
  .rank-grid2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ── src/styles/tokens.css ── */
/* A shared, quiet palette for the whole product. */
:root,
body {
  --bg: #111719;
  --bg2: #1a2326;
  --bg3: #242f33;
  --bg4: #303e43;
  --border: #344247;
  --border2: #52656c;
  --text: #edf3f3;
  --text2: #c2ced0;
  --text3: #9bafb4;
  --accent: #8bd5be;
  --accent2: #72c4ab;
  --accent-text: #102c24;
  --accent-glow: #8bd5be18;
  --green: #8bccad;
  --red: #f59a99;
  --amber: #e6c781;
  --purple: #8bd5be;
  --lavender: #223331;
  --peach: #2d2b36;
  --sage: #24332e;
  --butter: #2c3032;
  --r: 12px;
  --r2: 22px;
  --font-body: "DM Sans", sans-serif;
  --font-heading: "Space Grotesk", "DM Sans", sans-serif;
  --font-mono: "DM Sans", sans-serif;
  --font: var(--font-body);
  color-scheme: dark;
}
body.light-mode {
  --bg: #f6f3ef;
  --bg2: #fffefa;
  --bg3: #eeebe8;
  --bg4: #e5e0dc;
  --border: #e7e1dd;
  --border2: #c9c0ba;
  --text: #302a39;
  --text2: #665d6e;
  --text3: #82778a;
  --accent: #7956b2;
  --accent2: #664599;
  --accent-text: #fff;
  --accent-glow: #7956b212;
  --green: #397b61;
  --red: #b95059;
  --amber: #927127;
  --purple: #7956b2;
  --lavender: #ebe3f6;
  --peach: #f7e0d6;
  --sage: #e2ece2;
  --butter: #f5edce;
  color-scheme: light;
}
body.theme-ocean {
  --accent2: #a4d5ef;
  --accent-glow: #8dbbda18;
  --lavender: #243642;
  --accent: #8dbbda;
  --accent-text: #172636;
}
body.light-mode.theme-ocean {
  --accent2: #346781;
  --accent: #427c9c;
  --accent-text: #fff;
  --lavender: #e3eef6;
}
body.theme-purple {
  --accent2: #e5bbef;
  --accent-glow: #d3a4de18;
  --accent: #d3a4de;
  --accent-text: #331b3a;
  --lavender: #302a39;
}
body.light-mode.theme-purple {
  --accent2: #7f458b;
  --accent: #92589d;
  --accent-text: #fff;
  --lavender: #eedbf0;
}
body.theme-emerald {
  --accent2: #afe2c7;
  --accent-glow: #8ac5a618;
  --lavender: #243b30;
  --accent: #8ac5a6;
  --accent-text: #163023;
}
body.light-mode.theme-emerald {
  --accent2: #32664b;
  --accent: #417c5e;
  --accent-text: #fff;
  --lavender: #e2ece2;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
button,
input,
select,
textarea {
  font-family: var(--font-body);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
[hidden],
body button[hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── src/styles/workspace.css ── */
/* The study-space shell: horizontal navigation, drawer only when requested. */
html,
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}
button {
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  filter: brightness(0.98);
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 10001;
  background: var(--bg2);
  padding: 14px;
  border-radius: 12px;
}
.skip-link:focus {
  top: 12px;
}
.studio-ui .app {
  max-width: none;
  padding: 0;
  gap: 0;
  height: 100dvh;
  background: var(--bg);
}
.studio-ui .main {
  width: 100%;
  min-width: 0;
  border-radius: 0;
}
.studio-ui .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 151;
  width: 300px;
  min-width: 300px;
  transform: translateX(-100%);
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0 24px 24px 0;
  background: var(--bg2);
  transition: transform 0.2s;
  box-shadow: 10px 0 50px #302a3915;
}
.studio-ui .sidebar.open {
  transform: translateX(0);
}
.overlay {
  z-index: 150;
  background: #302a3950;
  backdrop-filter: blur(5px);
}
.sidebar-logo {
  padding: 25px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.logo-icon,
.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 13px 13px 5px 13px;
  font: 700 27px var(--font-heading);
  letter-spacing: -3px;
  padding-right: 3px;
}
.logo-text {
  font: 700 25px var(--font-heading);
  letter-spacing: -1.5px;
}
.logo-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}
.drawer-close {
  margin-left: auto;
  border: 0;
  background: var(--bg3);
  color: var(--text2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 24px;
}
.nav-section {
  padding: 20px 16px 0;
}
.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 0 12px 7px;
  color: var(--text3);
}
.nav-item {
  font: 13px var(--font-body);
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  padding: 10px 12px;
  gap: 12px;
  margin: 2px 0;
  color: var(--text2);
}
.nav-item.active {
  background: var(--lavender);
  color: var(--accent);
  border: 0;
  font-weight: 600;
}
.nav-item:hover {
  background: var(--bg3);
}
.nav-icon {
  width: 18px;
  height: 18px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: 0;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.site-brand b {
  font: 700 27px var(--font-heading);
  letter-spacing: -1.8px;
}
.studio-ui .topbar {
  height: 78px;
  min-height: 78px;
  flex-shrink: 0;
  padding: 0 max(28px, calc((100vw - 1260px) / 2));
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
  gap: 18px;
  box-shadow: none;
}
.studio-ui .topbar-title {
  display: none;
}
.studio-ui .hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: var(--text2);
  order: 2;
}
.topbar .site-brand {
  order: 0;
  margin-right: auto;
}
.topbar-search-wrap {
  flex: 0 1 300px;
  min-width: 0;
}
.topbar-search {
  height: 39px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--bg2) !important;
  font: 12px var(--font-body);
  color: var(--text);
}
.workspace-command {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: none;
  color: var(--text2);
  font-size: 11px;
  min-height: 36px;
}
.workspace-command kbd {
  font: 10px var(--font-body);
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.workspace-theme {
  background: none;
  border: 0;
  font-size: 24px;
  color: var(--text2);
  width: 28px;
}
.notif-btn {
  border: 0;
  background: none;
  width: 28px;
  height: 34px;
}
.avatar {
  width: 34px;
  height: 34px;
  background: var(--peach);
  color: var(--text);
  border: 0;
  box-shadow: none;
  font: 600 11px var(--font-body);
  border-radius: 50%;
}
.sync-pill {
  font-size: 9px;
  background: var(--sage);
  color: var(--green);
  border: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 20px;
  padding: 6px 9px;
}
.sync-pill::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 5px;
}
.section-nav {
  display: flex;
  gap: 4px;
  padding: 10px max(28px, calc((100vw - 1260px) / 2));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
  min-height: 62px;
  align-items: center;
}
.section-nav button {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 16px;
  border: 0;
  border-radius: 24px;
  background: none;
  font: 12px var(--font-body);
  color: var(--text2);
  white-space: nowrap;
}
.section-nav button > span {
  font-size: 18px;
}
.section-nav button.active {
  background: var(--text);
  color: var(--bg2);
  font-weight: 600;
}
.section-nav .nav-settings {
  margin-left: auto;
}
.studio-ui .subnav {
  padding: 12px max(28px, calc((100vw - 1260px) / 2)) 0;
  min-height: 44px;
  gap: 7px;
  margin: 0;
  border: 0;
  background: var(--bg);
  flex-shrink: 0;
}
body.studio-ui .subnav-chip {
  background: transparent;
  color: var(--text3);
  border: 0;
  border-radius: 18px;
  padding: 7px 13px;
  font: 11px var(--font-body);
}
body.studio-ui .subnav-chip.active {
  background: var(--lavender);
  color: var(--accent);
  font-weight: 600;
}
.studio-ui .content {
  padding: 29px max(28px, calc((100vw - 1260px) / 2)) 48px;
  overscroll-behavior: contain;
}
.page {
  gap: 26px;
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
  animation: none;
}
.module-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 4px;
}
.eyebrow {
  font: 600 9px var(--font-body);
  color: var(--text3);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.module-heading h1 {
  font: 500 clamp(31px, 3.3vw, 46px)/1.15 var(--font-heading);
  letter-spacing: -2px;
  margin: 9px 0 8px;
}
.module-heading p {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.7;
}
.workspace-date {
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: var(--bg2);
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}
.workspace-date::before {
  content: "◷";
  margin-right: 8px;
}
.card,
.full-card {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 22px;
  padding: 24px;
  box-shadow: none;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
  border: 0;
  padding: 0;
}
.card-title {
  font: 600 17px var(--font-heading);
  letter-spacing: -0.5px;
  color: var(--text);
}
.card-action {
  background: none;
  border: 0;
  color: var(--accent);
  font: 500 11px var(--font-body);
  padding: 6px 0;
  cursor: pointer;
}
.empty {
  padding: 32px 18px;
  text-align: center;
  font: 12px/1.8 var(--font-body);
  color: var(--text3);
}
.empty::before {
  content: "—";
  display: block;
  font: 30px var(--font-heading);
  color: var(--border2);
  margin-bottom: 5px;
}
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}
.today-card {
  background: var(--lavender) !important;
  border: 0;
  min-height: 235px;
  position: relative;
  overflow: hidden;
}
.today-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.day-sticker {
  font: 600 11px var(--font-body);
  background: var(--bg2);
  padding: 7px 12px;
  border-radius: 20px;
  transform: rotate(-3deg);
}
.orbit-flower {
  font-size: 46px;
  color: var(--accent);
  line-height: 1;
  transform: rotate(10deg);
}
.today-card .card-title {
  font-size: 24px;
  letter-spacing: -1px;
}
.today-card .class-item {
  background: var(--bg2);
  padding: 14px;
  border: 0;
  margin-top: 10px;
  border-radius: 13px;
}
.class-time {
  font: 12px var(--font-body);
  width: 75px;
  flex-shrink: 0;
  color: var(--accent);
}
.class-name {
  font-size: 13px;
}
.class-teacher {
  font-size: 10px;
}
.home-summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 23px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
}
.home-summary > h2 {
  font: 600 16px var(--font-heading);
  margin-bottom: 12px;
}
.home-summary .stat-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none !important;
  border-radius: 0;
  min-width: 0;
}
.home-summary .stat-card:last-child {
  border: 0;
  padding-bottom: 0;
}
.stat-label {
  font: 12px var(--font-body);
  color: var(--text2);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.stat-val {
  font: 500 24px var(--font-heading);
  color: var(--text);
  margin: 0;
  grid-column: 2;
  grid-row: 1/3;
}
.stat-sub {
  font: 10px/1.5 var(--font-body);
  color: var(--text3);
  grid-column: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.home-summary .stat-card:hover {
  background: var(--bg3) !important;
}
.trend-card {
  min-height: 280px;
}
.trend-card .eyebrow {
  font-size: 8px;
}
.trend-card .card-title {
  margin-top: 5px;
}
.upcoming-card {
  background: var(--butter) !important;
  border: 0;
}
.upcoming-card .exam-item {
  padding: 15px 0;
  border-color: var(--border);
}
.upcoming-card .exam-name {
  font-size: 12px;
}
.upcoming-card .exam-date {
  font-size: 10px;
}
.desk-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.desk-links button {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg2);
  color: var(--text);
  text-align: left;
}
.desk-links button:hover {
  transform: translateY(-3px);
}
.desk-link-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  font-size: 23px;
  background: var(--peach);
  border-radius: 14px;
  transform: rotate(-4deg);
}
.desk-links button:nth-child(2) .desk-link-icon {
  background: var(--sage);
}
.desk-links button:nth-child(3) .desk-link-icon {
  background: var(--lavender);
}
.desk-links b {
  font: 600 13px var(--font-body);
}
.desk-links small {
  display: block;
  font-size: 10px;
  color: var(--text3);
  margin-top: 5px;
}
.desk-links button > span:last-child {
  margin-left: auto;
  color: var(--accent);
}
body .start-btn,
body .class-btn,
body .course-btn,
body .hero-btn,
body .exam-view-btn,
body .chem-btn-primary {
  border-radius: 12px !important;
  font: 600 11px var(--font-body) !important;
  min-height: 36px;
  box-shadow: none !important;
}
body .theme-mode-btn {
  background: var(--bg3) !important;
  color: var(--text2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 11px !important;
  font: 500 11px var(--font-body) !important;
  min-height: 36px;
}
body .theme-mode-btn.active {
  background: var(--accent) !important;
  color: var(--accent-text) !important;
  border-color: var(--accent) !important;
}
input,
select,
textarea {
  accent-color: var(--accent);
  color: var(--text);
  border-radius: 11px;
}
.manual-tool-input,
.tt-select,
.rank-field input {
  min-height: 40px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  border-radius: 11px;
  font: 12px var(--font-body);
}
.manual-tool-row {
  padding: 14px 17px;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 16px;
}
.exam-badge {
  font: 10px var(--font-body);
  border-radius: 20px;
  padding: 5px 9px;
}
.mobile-dock {
  display: none;
}
.status-dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
}
#page-dashboard[data-subview="schedule"]
  :is(.home-summary, .trend-card, .desk-links) {
  display: none;
}
@media (max-width: 1080px) {
  .studio-ui .topbar {
    padding: 0 24px;
    gap: 12px;
  }
  .section-nav {
    padding-left: 24px;
    padding-right: 24px;
  }
  .section-nav button {
    padding: 10px 12px;
  }
  .studio-ui .content {
    padding: 26px 24px 36px;
  }
  .studio-ui .subnav {
    padding-left: 24px;
    padding-right: 24px;
  }
  .workspace-command > span,
  .sync-pill {
    display: none;
  }
  .home-layout {
    grid-template-columns: 1.3fr 1fr;
  }
  .desk-links button {
    padding: 15px;
    gap: 10px;
  }
  .desk-links small {
    font-size: 9px;
  }
}
@media (max-width: 768px) {
  .studio-ui .topbar {
    height: 67px;
    min-height: 67px;
    padding: 0 18px;
    gap: 12px;
  }
  .site-brand b {
    font-size: 24px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 24px;
    border-radius: 11px 11px 4px 11px;
  }
  .studio-ui .topbar .topbar-search-wrap,
  .workspace-command,
  .topbar .avatar {
    display: none;
  }
  .workspace-theme {
    margin-left: auto;
  }
  .section-nav {
    overflow-x: auto;
    padding: 8px 16px;
    min-height: 51px;
    gap: 3px;
    scrollbar-width: none;
  }
  .section-nav button {
    font-size: 11px;
    padding: 9px 13px;
  }
  .section-nav button > span {
    display: none;
  }
  .section-nav .nav-settings {
    margin-left: 0;
  }
  .studio-ui .subnav {
    padding: 9px 17px 0;
    min-height: 37px;
  }
  .studio-ui .content {
    padding: 23px 18px calc(86px + env(safe-area-inset-bottom));
  }
  .page {
    gap: 22px;
  }
  .module-heading h1 {
    font-size: 34px;
    letter-spacing: -1.5px;
  }
  .module-heading p {
    font-size: 11px;
  }
  .module-heading > .workspace-date {
    font-size: 9px;
    padding: 8px 10px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .home-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .today-card {
    min-height: 220px;
  }
  .home-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 19px 16px;
    gap: 10px;
  }
  .home-summary > h2 {
    grid-column: 1/-1;
    margin-bottom: 3px;
  }
  .home-summary .stat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 9px 9px 4px;
    border: 0;
    border-right: 1px solid var(--border);
    gap: 8px;
  }
  .home-summary .stat-card:last-child {
    padding: 9px 9px 4px;
  }
  .stat-label {
    font-size: 10px;
    width: 100%;
  }
  .stat-val {
    font-size: 23px;
    order: 1;
  }
  .stat-sub {
    font-size: 9px;
    order: 2;
    overflow-wrap: anywhere;
  }
  .trend-card {
    min-height: 270px;
  }
  .card,
  .full-card {
    padding: 21px;
    border-radius: 19px;
  }
  .desk-links {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .desk-links button {
    padding: 17px;
  }
  .desk-links small {
    font-size: 11px;
  }
  .studio-ui .mobile-dock {
    display: flex;
    bottom: 0;
    height: calc(63px + env(safe-area-inset-bottom));
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--bg2);
  }
  .dock-btn {
    font: 9px var(--font-body);
    color: var(--text3);
    border-radius: 12px;
    gap: 5px;
  }
  .dock-btn.active {
    background: var(--lavender);
    color: var(--accent);
  }
  .dock-btn svg {
    width: 18px;
    height: 18px;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .manual-tool-form,
  .manual-tool-row {
    flex-wrap: wrap;
  }
  .manual-tool-input {
    min-width: 0;
    max-width: 100%;
  }
  button.start-btn,
  button.class-btn,
  button.course-btn,
  .theme-mode-btn {
    min-height: 41px;
  }
}
/* Narrow phones need rows rather than three cramped metric columns. */
@media (max-width: 480px) {
  .home-summary {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px;
  }
  .home-summary > h2 {
    margin-bottom: 12px;
  }
  .home-summary .stat-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 16px;
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .home-summary .stat-card:last-child {
    padding: 14px 0 0;
    border-bottom: 0;
  }
  .home-summary .stat-val,
  .home-summary .stat-sub {
    order: initial;
  }
}
@media (max-width: 390px) {
  .workspace-date {
    display: none;
  }
  .module-heading h1 {
    font-size: 32px;
  }
  .section-nav button {
    padding: 9px 11px;
  }
}

/* ── src/styles/auth.css ── */
/* Calm entry screen. No promotional stats or simulated account data. */
body #login-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 0;
  background: #f6f3ef;
  color: #302a39;
  overflow-y: auto;
  color-scheme: light;
  --text: #302a39;
  --text2: #665d6e;
  --text3: #82778a;
  --accent: #7956b2;
  --accent-text: #fff;
  --bg2: #fffefa;
  --border: #e7e1dd;
}
.auth-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 5vw;
  min-height: 94px;
  flex-shrink: 0;
}
.auth-masthead > a:last-child {
  font-size: 11px;
  color: #776b83;
}
.auth-layout {
  width: min(1090px, 88vw);
  margin: 35px auto 60px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 9%;
  align-items: center;
}
.auth-intro h1 {
  font: 500 clamp(44px, 4.9vw, 66px) / 1.07 var(--font-heading);
  letter-spacing: -3px;
  margin: 21px 0 24px;
}
.auth-intro h1 em {
  font-style: normal;
  color: #9172b9;
}
.auth-intro > p {
  font-size: 12px;
  color: #82778a;
  line-height: 1.8;
}
.auth-intro > .eyebrow {
  color: #887891;
  font-size: 9px;
}
.auth-paper-stack {
  height: 265px;
  position: relative;
  max-width: 400px;
  margin-top: 30px;
}
.paper-sheet {
  position: absolute;
  border-radius: 15px;
  padding: 23px;
  box-shadow: 0 12px 30px #62487e12;
}
.paper-sheet > span {
  font-size: 7px;
  letter-spacing: 1px;
  color: #7c6a90;
}
.paper-back {
  background: #fffefa;
  width: 260px;
  height: 176px;
  left: 0;
  top: 20px;
  transform: rotate(-10deg);
  border: 1px solid #e6dfe9;
}
.paper-calendar {
  font-size: 13px;
  font-weight: 500;
  margin: 18px 0;
  color: #675972;
}
.paper-back i {
  display: block;
  height: 13px;
  margin: 9px 0;
  background: #ece4f5;
  border-radius: 7px;
  width: 65%;
}
.paper-back i:last-child {
  width: 40%;
  background: #f7e0d6;
}
.paper-front {
  background: #e9e0f3;
  width: 263px;
  height: 169px;
  left: 107px;
  top: 85px;
  transform: rotate(6deg);
}
.paper-front b {
  display: block;
  font: 500 25px/1.2 var(--font-heading);
  letter-spacing: -0.8px;
  margin: 16px 0;
  color: #59416f;
}
.paper-tabs {
  display: flex;
  gap: 6px;
}
.paper-tabs span {
  font-size: 8px;
  background: #ffffff80;
  padding: 5px 8px;
  border-radius: 20px;
  color: #72568d;
}
.paper-flower {
  position: absolute;
  font-size: 60px;
  color: #c78869;
  right: 0;
  top: 17px;
  transform: rotate(12deg);
}
.auth-form-area {
  min-width: 0;
  position: relative;
}
.auth-form-area::before {
  content: "";
  position: absolute;
  inset: 9px -9px 41px 9px;
  background: #ead7ca;
  border-radius: 27px;
  transform: rotate(2deg);
  z-index: 0;
}
body #login-screen .login-card {
  margin: 0;
  position: relative;
  z-index: 1;
  border: 1px solid #e7e1dd;
  background: #fffefa;
  border-radius: 25px;
  padding: 35px;
  max-width: none;
  box-shadow: 0 8px 35px #61456c06;
  gap: 23px;
}
.form-symbol {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eee5f6;
  color: #7956b2;
  display: grid;
  place-items: center;
  font-size: 25px;
  margin-bottom: 5px;
}
.login-intro .eyebrow {
  font-size: 8px;
  color: #918099;
}
.login-title {
  font: 500 32px var(--font-heading);
  letter-spacing: -1.5px;
  text-align: left;
  color: #302a39;
  margin: 9px 0;
}
.login-intro p {
  font-size: 12px;
  color: #82778a;
  margin-bottom: 7px;
}
.auth-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b5b78;
  margin-bottom: 9px;
}
body #login-screen .login-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #ded6e3;
  border-radius: 12px;
  background: #faf8fc;
  color: #302a39;
  font: 12px var(--font-body);
  padding: 13px 15px;
  box-shadow: none;
}
body #login-screen .login-input::placeholder {
  color: #a196a9;
}
body #login-screen .login-input:focus {
  border-color: #9474b9;
  outline: 3px solid #7956b215;
  outline-offset: 1px;
}
.password-wrap {
  position: relative;
}
#login-screen #login-pass {
  padding-right: 45px;
}
.password-toggle {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: #9a87a9;
  font-size: 18px;
  border-radius: 10px;
}
body #login-screen .login-btn {
  background: #7956b2 !important;
  color: #fff !important;
  border-radius: 13px !important;
  min-height: 49px;
  font: 600 12px var(--font-body) !important;
  justify-content: space-between !important;
  padding: 14px 18px !important;
}
.login-btn::after {
  content: "↗";
  font-size: 19px;
}
.auth-help {
  font-size: 10px;
  line-height: 1.9;
  color: #8b7f94;
  text-align: center;
  margin-top: -1px;
}
.auth-footnote {
  font-size: 10px;
  text-align: center;
  margin-top: 23px;
  color: #948898;
}
.login-error:empty {
  display: none;
}
.login-error:not(:empty) {
  padding: 12px;
  background: #f9e6e7;
  color: #ac4859;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
}
#login-screen > .login-footer {
  margin: 0 5vw;
  padding: 23px 0;
  border-top: 1px solid #e5dedf;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 10px;
  color: #958998;
}
#login-screen > .login-footer a {
  color: #82718e;
  font-size: 10px;
  text-decoration: none;
}
@media (max-width: 1000px) {
  .auth-layout {
    gap: 6%;
    width: 88vw;
  }
  .auth-intro h1 {
    font-size: 49px;
  }
  .paper-front {
    left: 65px;
    width: 230px;
  }
  .paper-back {
    width: 240px;
  }
  .paper-flower {
    right: -8px;
  }
  body #login-screen .login-card {
    padding: 27px;
  }
}
@media (max-width: 680px) {
  .auth-masthead {
    min-height: 74px;
    margin: 0 24px;
  }
  .auth-layout {
    display: flex;
    flex-direction: column;
    width: auto;
    margin: 24px 25px 36px;
    gap: 32px;
    align-items: stretch;
  }
  .auth-intro h1 {
    font-size: 40px;
    letter-spacing: -2px;
    margin: 14px 0;
  }
  .auth-intro h1 br {
    display: none;
  }
  .auth-intro h1 br::after {
    content: " ";
  }
  .auth-intro h1 em {
    display: block;
  }
  .auth-intro > p {
    font-size: 11px;
  }
  .auth-intro > .eyebrow {
    font-size: 8px;
  }
  .auth-paper-stack {
    display: none;
  }
  body #login-screen .login-card {
    padding: 25px;
    gap: 20px;
  }
  .form-symbol {
    width: 36px;
    height: 36px;
    font-size: 22px;
    margin: 0;
  }
  .login-title {
    font-size: 29px;
  }
  .auth-form-area::before {
    inset: 7px -6px 40px 6px;
  }
  body #login-screen .login-input {
    font-size: 16px;
  }
  body #login-screen .login-input::placeholder {
    font-size: 11px;
  }
  #login-screen > .login-footer {
    margin: 0 24px;
    font-size: 9px;
  }
  .auth-footnote {
    font-size: 9px;
  }
}

/* An immediate, network-independent appearance control on the entry screen. */
.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
.auth-header-actions > a {
  font-size: 11px;
  color: var(--text2);
  text-decoration: none;
}
.auth-theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
}
.auth-theme-toggle svg {
  width: 18px;
  height: 18px;
  grid-area: 1/1;
}
.auth-theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
body.light-mode .auth-sun,
body:not(.light-mode) .auth-moon {
  display: none;
}
/* Night edition: ink surfaces, a sea-glass desk and a softly lit sign-in card. */
body:not(.light-mode) #login-screen {
  --text: #edf3f3;
  --text2: #c2ced0;
  --text3: #9bafb4;
  --bg2: #1a2326;
  --border: #344247;
  --accent: #8bd5be;
  --accent-text: #102c24;
  background:
    radial-gradient(ellipse at 15% 48%, #203c352e, transparent 55%), #111719;
  color: var(--text);
  color-scheme: dark;
}
body:not(.light-mode) .auth-masthead {
  border-bottom: 1px solid #263337;
}
body:not(.light-mode) .auth-intro {
  position: relative;
  padding: 35px 0;
}
body:not(.light-mode) .auth-intro::before {
  content: "";
  position: absolute;
  inset: 0 -20px 0 -30px;
  pointer-events: none;
  background-image: radial-gradient(#658a8038 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(
    180deg,
    transparent,
    #0005 30%,
    #000 70%,
    transparent
  );
  z-index: -1;
}
body:not(.light-mode) .auth-layout {
  isolation: isolate;
}
body:not(.light-mode) .auth-intro h1 em {
  color: #8bd5be;
}
body:not(.light-mode) .auth-intro > .eyebrow {
  color: #9bc5b6;
}
body:not(.light-mode) .auth-intro > p {
  color: #9bafb4;
}
body:not(.light-mode) .paper-sheet {
  box-shadow: 0 18px 35px #0003;
}
body:not(.light-mode) .paper-back {
  background: #1b282d;
  border-color: #3c515a;
  transform: rotate(-8deg);
}
body:not(.light-mode) .paper-sheet > span {
  color: #a9c1bd;
}
body:not(.light-mode) .paper-calendar {
  color: #b5cbd4;
}
body:not(.light-mode) .paper-back i {
  background: #344a55;
}
body:not(.light-mode) .paper-back i:last-child {
  background: #4a4254;
}
body:not(.light-mode) .paper-front {
  background: linear-gradient(145deg, #29423b, #1b2e29);
  border: 1px solid #46685b;
  transform: rotate(5deg);
}
body:not(.light-mode) .paper-front b {
  color: #d6ede4;
}
body:not(.light-mode) .paper-tabs span {
  background: #10282080;
  color: #b1d4c4;
  border: 1px solid #496b5b;
}
body:not(.light-mode) .paper-flower {
  color: #adbdcf;
  right: 2px;
  top: 7px;
}
body:not(.light-mode) .auth-form-area::before {
  inset: 8px -8px 43px 8px;
  background: #263e36;
  border: 1px solid #3b5b4e;
  transform: rotate(1.5deg);
}
body:not(.light-mode) #login-screen .login-card {
  background: linear-gradient(155deg, #23322f 0%, #1a2326 42%);
  border-color: #3b4f4c;
  box-shadow:
    0 24px 80px #0004,
    inset 0 1px #b9e3cf0d;
}
body:not(.light-mode) .form-symbol {
  border: 1px solid #4b6a5f;
  background: #294139;
  color: #a4ddc7;
}
body:not(.light-mode) .login-intro .eyebrow {
  color: #9bc5b6;
}
body:not(.light-mode) .login-title {
  color: #edf3f3;
}
body:not(.light-mode) .login-intro p {
  color: #9bafb4;
}
body:not(.light-mode) .auth-field label {
  color: #c2ced0;
}
body:not(.light-mode) #login-screen .login-input {
  background: #131d20;
  color: #edf3f3;
  border-color: #3a4a50;
}
body:not(.light-mode) #login-screen .login-input::placeholder {
  color: #91a3a8;
}
body:not(.light-mode) #login-screen .login-input:focus {
  border-color: #8bd5be;
  outline-color: #8bd5be25;
}
body:not(.light-mode) #login-screen .login-input:autofill {
  box-shadow: 0 0 0 1000px #1c2d29 inset;
  -webkit-text-fill-color: #edf3f3;
  caret-color: #edf3f3;
}
body:not(.light-mode) .password-toggle {
  color: #9bafb4;
}
body:not(.light-mode) #login-screen .login-btn {
  background: #8bd5be !important;
  color: #102c24 !important;
  box-shadow: 0 3px 0 #4f8d77;
}
body:not(.light-mode) #login-screen .login-btn:hover {
  background: #a7e4cf !important;
}
body:not(.light-mode) .auth-help,
body:not(.light-mode) .auth-footnote {
  color: #9bafb4;
}
body:not(.light-mode) .login-error:not(:empty) {
  background: #38272b;
  color: #ffb8bd;
  border: 1px solid #684048;
}
body:not(.light-mode) #login-screen > .login-footer {
  border-color: #2c3a3e;
  color: #9bafb4;
}
body:not(.light-mode) #login-screen > .login-footer a {
  color: #b6c9c7;
}
@media (max-width: 680px) {
  .auth-header-actions {
    gap: 16px;
  }
  body:not(.light-mode) .auth-intro {
    padding: 0;
  }
  body:not(.light-mode) .auth-form-area::before {
    inset: 6px -5px 42px 5px;
  }
}

/* ── src/styles/modules.css ── */
/* Per-page layouts, all using the same product primitives. */
/* Courses are a small collection of notebooks, not a table of tools. */
body #courses-grid.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  border: 0;
  background: none;
}
.course-record {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--bg2);
  overflow: hidden;
  min-width: 0;
  padding: 0 22px 22px;
  position: relative;
}
.course-record-icon {
  height: 115px;
  width: calc(100% + 44px);
  margin: 0 -22px 22px;
  padding: 22px;
  background: var(--lavender);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent);
  font: 500 39px var(--font-heading);
  letter-spacing: -2px;
}
.course-record:nth-child(3n + 2) .course-record-icon {
  background: var(--peach);
  color: var(--red);
}
.course-record:nth-child(3n + 3) .course-record-icon {
  background: var(--sage);
  color: var(--green);
}
.course-record-icon::after {
  content: "▱";
  font-size: 70px;
  transform: rotate(-15deg);
  opacity: 0.65;
}
.course-record-icon img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 13px;
}
.course-record h3 {
  font: 600 18px/1.45 var(--font-heading);
  letter-spacing: -0.5px;
  margin: 0 0 9px;
}
.course-record small {
  font-size: 10px;
  color: var(--text3);
}
.course-record-meta {
  font-size: 11px;
  color: var(--text2);
  margin-top: 16px;
}
.course-record-meta > span {
  font-size: 10px;
  color: var(--text3);
  margin-right: 8px;
}
.course-record .type-meta {
  margin-top: 24px;
}
.course-record button {
  margin-top: 22px;
  align-self: flex-start;
  min-width: 90px;
}
/* Messages: content-led split view. */
#page-messages.active {
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100dvh - 237px);
  gap: 22px;
  padding: 0;
}
#page-messages > .module-heading {
  grid-column: 1/-1;
}
.msg-sidebar {
  width: auto;
  min-width: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.msg-content {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg2);
  min-width: 0;
}
.msg-group-item {
  border: 0;
  border-radius: 13px;
  background: transparent;
  padding: 14px 10px;
}
.msg-group-item.active {
  background: var(--lavender);
}
.msg-group-icon,
.msg-group-icon-fallback {
  border-radius: 13px;
  background: var(--peach);
  color: var(--text);
  width: 37px;
  height: 37px;
  min-width: 37px;
}
.msg-bubble {
  background: var(--lavender);
  border: 0;
  border-radius: 16px 16px 16px 4px;
}
.msg-bubble-meta {
  font-size: 10px;
}
/* Timetable & exam calendar. */
#page-timetable > .full-card {
  padding: 0;
  overflow: hidden;
}
#page-timetable .card-header {
  padding: 23px;
  margin: 0;
}
.tt-grid {
  background: var(--border);
  gap: 1px;
  border: 0;
  border-radius: 0;
}
.tt-cell {
  border: 0;
  background: var(--bg2);
  padding: 12px;
}
.tt-header {
  background: var(--lavender);
  font: 600 11px var(--font-body);
  min-height: 43px;
  text-transform: none;
  color: var(--text2);
}
.tt-time {
  background: var(--bg);
  font: 11px var(--font-body);
  color: var(--text3);
}
.tt-class {
  border-radius: 10px;
  padding: 11px;
  font-size: 12px;
  border: 0;
}
.exam-calendar-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 20px;
  margin-bottom: 13px;
}
.exam-calendar-chip {
  border: 0;
  border-radius: 18px;
  padding: 5px 9px;
  background: var(--bg3);
  color: var(--text2);
  font-size: 10px;
}
/* Test list: a two-column collection, kept compact where virtualized. */
#examhall-list,
#era-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.exam-hall-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 19px;
  margin: 0;
  min-width: 0;
  box-shadow: none;
}
.exam-hall-icon {
  background: var(--lavender) !important;
  color: var(--accent) !important;
  border-radius: 12px;
  min-width: 38px;
}
.exam-hall-name {
  font: 600 14px var(--font-body);
}
.exam-hall-meta {
  font: 10px/1.7 var(--font-body);
  color: var(--text3);
}
.exam-hall-actions {
  margin-top: 14px;
  gap: 7px;
}
.exam-hall-score {
  font: 500 23px var(--font-heading);
}
.exam-hall-rank {
  font-size: 10px;
}
#page-examhall > .full-card,
#page-era > .full-card {
  background: none;
  border: 0;
  padding: 0;
}
.exam-hall-header-row {
  flex-wrap: wrap;
  gap: 8px;
}
/* File shelf & noticeboard */
#study-list:not(.virtual-list) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px !important;
}
#study-list:not(.virtual-list) .exam-hall-item {
  flex-wrap: wrap;
  min-height: 165px;
  background: var(--bg2);
}
#study-list:not(.virtual-list) .exam-hall-icon {
  background: var(--butter) !important;
  color: var(--amber) !important;
  border-radius: 11px;
}
#study-list:not(.virtual-list) .exam-hall-right {
  margin-left: auto;
}
#page-study > .full-card {
  background: none;
  border: 0;
  padding: 0;
}
#study-list.virtual-list .exam-hall-item {
  height: 78px;
  border-radius: 12px;
}
.notice-item {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg2);
  padding: 18px !important;
}
.notice-item:nth-child(3n + 1) {
  border-left: 4px solid var(--accent);
}
.notice-item:nth-child(3n + 2) {
  border-left: 4px solid var(--amber);
}
.notice-item:nth-child(3n + 3) {
  border-left: 4px solid var(--green);
}
.notice-title {
  font: 600 13px var(--font-body);
}
.notice-time {
  font: 10px var(--font-body);
  margin-top: 7px;
}
/* Chemistry as a playful but functional subject collection. */
.chem-practice-shell {
  max-width: none;
}
.chem-panel {
  border: 1px solid var(--border);
  border-radius: 21px;
  padding: 25px;
  background: var(--bg2);
}
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.mode-card {
  border: 0 !important;
  border-radius: 19px !important;
  background: var(--lavender) !important;
  padding: 25px !important;
  box-shadow: none !important;
}
.mode-card:nth-child(2) {
  background: var(--peach) !important;
}
.mode-card:nth-child(3) {
  background: var(--sage) !important;
}
.mode-card:hover {
  transform: translateY(-3px) !important;
}
.mode-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 18px;
}
.mode-card-icon {
  width: 63px;
  height: 63px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--accent);
  font: 500 26px var(--font-heading);
  transform: rotate(-8deg);
}
.mode-card-title {
  font: 600 20px var(--font-heading);
  letter-spacing: -0.8px;
  margin: 0 0 10px;
}
.mode-card-desc {
  font: 12px/1.8 var(--font-body);
  color: var(--text2);
}
.mode-card-btn {
  margin-top: 22px;
  width: 100%;
}
.chem-header {
  padding: 15px 0;
}
.chem-title {
  font: 500 26px var(--font-heading);
}
.chem-tabs {
  border-radius: 20px;
  background: var(--bg3);
  padding: 5px;
}
.chem-tab {
  border-radius: 16px;
  font: 12px var(--font-body);
}
.chem-stat-bar {
  border-radius: 15px;
}
.chem-kicker,
.chem-section-label {
  font: 600 10px var(--font-body);
  letter-spacing: 0.4px;
}
.eq-block {
  border-radius: 13px;
  box-shadow: none;
}
/* Rank studio: inputs left, actual/empty output right. */
#page-neural .rank-predictor-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
}
.rank-inputs-section {
  min-width: 0;
}
.rank-field label {
  font: 500 11px var(--font-body);
}
.rank-field .hint {
  font-size: 9px;
}
.rank-field input {
  background: var(--bg);
  border-radius: 12px;
}
.inference-idle {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px dashed var(--border2);
  border-radius: 18px;
  background: var(--lavender);
}
.inference-caption {
  padding: 17px 20px;
  font: 500 11px var(--font-body);
  color: var(--accent);
}
.inference-idle-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  gap: 14px;
}
.inference-idle-body::before {
  content: "✳";
  font-size: 44px;
  color: var(--accent);
}
.inference-idle h3 {
  font: 500 20px var(--font-heading);
}
.inference-idle p {
  font: 12px/1.8 var(--font-body);
  color: var(--text2);
  max-width: 320px;
}
.rank-result-section {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.rank-hero {
  background: var(--lavender);
  border: 0;
  border-radius: 20px;
  padding: 26px;
}
.rank-hero .big {
  font: 500 43px var(--font-heading);
  color: var(--accent);
}
.rank-stat,
.rank-pipe {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 16px;
}
.rank-stat .sv {
  font: 500 22px var(--font-heading);
}
.rank-stat .sl,
.rank-pipe-row {
  font: 11px var(--font-body);
}
/* Settings — utility access is intentionally tucked away. */
#page-settings.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
#page-settings > .module-heading,
#page-settings > .settings-advanced,
#list-editor-card {
  grid-column: 1/-1;
}
#page-settings > .full-card {
  margin: 0 !important;
  min-width: 0;
}
.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.theme-preset-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
  padding: 17px;
  text-align: left;
}
.theme-preset-btn.active {
  background: var(--lavender);
  border-color: var(--accent);
  box-shadow: none;
}
.theme-preset-name {
  font: 600 12px var(--font-body);
  margin-bottom: 12px;
}
.theme-dot {
  border: 0;
  width: 19px;
  height: 19px;
}
.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 20px;
}
.settings-advanced {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 25px;
}
.advanced-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.advanced-intro h2 {
  font: 500 23px var(--font-heading);
  letter-spacing: -0.8px;
  margin: 7px 0;
}
.advanced-intro p {
  font: 12px/1.8 var(--font-body);
  color: var(--text3);
}
#settings-functions-card {
  border: 0;
  background: none;
  padding: 0;
  margin-top: 25px !important;
}
.tool-filterbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.tool-search {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text3);
}
.tool-search > span {
  display: none;
}
.tool-search input {
  width: 100%;
  border: 0;
  background: none;
  padding: 13px 0;
  color: var(--text);
  font: 12px var(--font-body);
}
#tool-filter-count {
  font-size: 10px;
  color: var(--text3);
}
#settings-functions-grid {
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 15px !important;
}
.function-nav-card {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 19px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}
.function-nav-card:hover {
  border-color: var(--accent) !important;
}
.function-nav-card > div:first-child > div {
  background: var(--lavender) !important;
  color: var(--accent) !important;
  border: 0 !important;
  border-radius: 12px !important;
}
.function-nav-card > div:last-child > div:first-child {
  font: 600 14px var(--font-body) !important;
}
.function-nav-card > div:last-child > div:last-child {
  font: 11px/1.7 var(--font-body) !important;
  color: var(--text3) !important;
}
.quick-runner {
  margin: 18px 0 0 !important;
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg) !important;
  padding: 19px !important;
}
/* Result recap and charts. Detailed data remains available below the visual summary. */
.result-recap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
}
.result-heading-block {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.result-title {
  font: 500 27px var(--font-heading);
  letter-spacing: -1px;
}
.result-sub {
  font-size: 11px;
  line-height: 1.8;
  color: var(--text3);
  margin-top: 7px;
}
.result-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.result-chip {
  border: 0;
  border-radius: 15px;
  background: var(--bg3);
  font-size: 9px;
  padding: 4px 8px;
}
.score-story {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  background: var(--lavender);
  border-radius: 20px;
}
.score-story > .eyebrow {
  color: var(--accent);
}
.score-story-value {
  font: 500 59px var(--font-heading);
  letter-spacing: -3px;
  color: var(--text);
  margin: 14px 0;
}
.score-story-value small {
  font: 400 22px var(--font-body);
  letter-spacing: -0.5px;
  color: var(--text3);
}
.score-comparison {
  display: flex;
  gap: 24px;
  color: var(--text2);
  font-size: 11px;
}
.score-comparison b {
  display: block;
  font: 500 21px var(--font-heading);
  margin-top: 6px;
}
.rank-summary {
  background: var(--bg);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.rank-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.rank-summary span {
  font-size: 11px;
  color: var(--text3);
}
.rank-summary strong {
  font: 500 25px var(--font-heading);
}
.outcomes-panel {
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 20px;
}
.outcomes-panel h3,
.subject-chart h3 {
  font: 600 16px var(--font-heading);
  margin: 0 0 18px;
}
.outcomes-body {
  display: flex;
  align-items: center;
  gap: 22px;
}
.outcome-donut {
  width: 145px;
  flex-shrink: 0;
}
.outcome-legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.outcome-legend > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text2);
}
.outcome-legend b {
  margin-left: auto;
  color: var(--text);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.result-subjects {
  grid-column: 1/-1;
}
.subject-chart {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 25px;
}
.subject-bar-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 15px;
  margin: 16px 0;
  font-size: 11px;
}
.subject-bar-track {
  height: 11px;
  background: var(--bg3);
  border-radius: 8px;
  overflow: hidden;
}
.subject-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 8px;
}
.subject-bar-row:nth-child(3n + 1) .subject-bar-fill {
  background: var(--green);
}
.subject-bar-row:nth-child(3n + 2) .subject-bar-fill {
  background: var(--red);
}
.result-extra {
  grid-column: 1/-1;
  background: var(--bg);
  border-radius: 16px;
  padding: 18px 21px;
}
.result-extra summary {
  cursor: pointer;
  font: 600 12px var(--font-body);
  color: var(--text2);
}
.result-extra .result-grid {
  margin-top: 20px;
}
.result-grid {
  gap: 10px;
}
.result-metric {
  background: var(--bg2);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 15px;
}
.result-label {
  font-size: 10px;
}
.result-value {
  font: 500 23px var(--font-heading);
}
.result-links {
  grid-column: 1/-1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.subject-result-card {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 15px;
  margin-top: 15px;
  padding: 20px;
}
.subject-result-name {
  font: 600 17px var(--font-heading);
}
.mini-metric {
  border: 0;
  border-radius: 10px;
  background: var(--bg3);
}
.mini-label {
  font-size: 9px;
}
.mini-value {
  font: 500 17px var(--font-heading);
}
.score-line-chart {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}
.score-chart-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 10px;
  color: var(--text3);
}
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--text3);
  text-align: center;
  gap: 12px;
  font-size: 12px;
}
.chart-empty > span {
  font-size: 38px;
  color: var(--accent);
  opacity: 0.5;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.leaderboard-wrap,
.report-table-wrapper {
  border-radius: 15px;
  border: 1px solid var(--border);
  overflow: auto;
}
.leaderboard-table th,
.report-table th {
  background: var(--lavender);
  color: var(--text2);
  font: 600 11px var(--font-body);
}
.leaderboard-table td {
  font-size: 12px;
}
.leaderboard-score,
.leaderboard-rank {
  font-family: var(--font-heading);
}
.leaderboard-card {
  border-radius: 16px;
}
.result-modal-card,
.modal-card,
.course-modal,
.command-palette,
.syllabus-modal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 25px 100px #302a3930;
  max-width: calc(100vw - 24px);
}
.console-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 85dvh;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.console-dialog-title {
  font: 600 16px var(--font-heading);
}
.console-dialog button,
.console-dialog select {
  border-radius: 10px !important;
  min-height: 36px;
}
.attendance-summary {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 11px;
  color: var(--text3);
  padding: 12px 0;
}
.attendance-record {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 12px;
}
.attendance-state {
  font-size: 10px;
}
.attendance-state.present {
  color: var(--green);
}
.attendance-state.absent {
  color: var(--red);
}
@media (max-width: 1050px) {
  body #courses-grid.three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mode-cards-grid {
    grid-template-columns: 1fr;
  }
  .mode-card-content {
    flex-direction: row;
    gap: 20px;
  }
  .mode-card-icon {
    flex-shrink: 0;
  }
  .result-recap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #settings-functions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 768px) {
  body #courses-grid.three-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .course-record-icon {
    height: 90px;
  }
  .course-record {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 12px;
  }
  .course-record-icon {
    grid-column: 1/-1;
  }
  .course-record > div:nth-child(2) {
    grid-column: 1/-1;
  }
  .course-record .type-meta {
    display: none;
  }
  .course-record button {
    grid-column: 2;
    grid-row: 3;
    margin-top: 17px;
  }
  .course-record-meta {
    grid-column: 1;
    grid-row: 3;
  }
  .course-record h3 {
    font-size: 18px;
  }
  #page-messages.active {
    grid-template-columns: 1fr;
    height: calc(100dvh - 280px);
  }
  #page-messages > .module-heading {
    grid-column: 1;
  }
  #page-messages .msg-sidebar {
    display: flex;
    width: 100%;
  }
  #page-messages .msg-content {
    display: none;
  }
  #page-messages.thread-open .msg-sidebar {
    display: none;
  }
  #page-messages.thread-open .msg-content {
    display: flex;
  }
  #examhall-list,
  #era-list {
    grid-template-columns: 1fr;
  }
  #study-list:not(.virtual-list) {
    grid-template-columns: 1fr !important;
  }
  #study-list:not(.virtual-list) .exam-hall-item {
    min-height: 95px;
  }
  #page-neural .rank-predictor-container {
    grid-template-columns: 1fr;
  }
  .inference-idle {
    min-height: 240px;
  }
  .rank-grid2 {
    grid-template-columns: 1fr;
  }
  #page-settings.active {
    grid-template-columns: 1fr;
  }
  .advanced-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  #settings-functions-grid {
    grid-template-columns: 1fr !important;
  }
  .settings-advanced {
    padding: 21px;
  }
  .tool-filterbar {
    gap: 9px;
  }
  #tool-filter-count {
    font-size: 9px;
    white-space: nowrap;
  }
  .quick-runner > div > div {
    min-width: 0 !important;
  }
  .studio-ui .mode-card {
    flex-direction: column;
    align-items: stretch;
    padding: 21px !important;
  }
  .mode-card-content {
    gap: 15px;
  }
  .mode-card-icon {
    width: 45px;
    height: 45px;
    font-size: 21px;
  }
  .mode-card-title {
    font-size: 18px;
  }
  .mode-card-desc {
    font-size: 11px;
  }
  .studio-ui .mode-card-btn {
    display: inline-flex !important;
    min-height: 41px;
  }
  .result-recap {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .rank-summary {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
  .rank-summary > div {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
  .result-heading-block {
    flex-direction: column;
  }
  .result-title {
    font-size: 24px;
  }
  .score-story {
    padding: 24px;
  }
  .score-story-value {
    font-size: 52px;
  }
  .subject-bar-row {
    grid-template-columns: 75px minmax(0, 1fr) 58px;
    gap: 9px;
    font-size: 10px;
  }
  .result-extra {
    padding: 16px;
  }
  .result-hero,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .subject-result-grid,
  .subject-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .outcome-donut {
    width: 130px;
  }
  .outcomes-body {
    gap: 14px;
  }
  .console-dialog select {
    font-size: 16px;
  }
  .console-dialog button {
    min-height: 42px;
  }
}

.chart-data {
  font-size: 10px;
  color: var(--text3);
  margin-top: 13px;
}
.chart-data summary {
  cursor: pointer;
}
.chart-data table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  text-align: left;
}
.chart-data td,
.chart-data th {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
/* The result's adjacent views use the same visual reading order. */
.solution-overview {
  display: flex;
  gap: 25px;
  align-items: center;
  padding: 21px 24px;
  margin: 22px 0;
  background: var(--lavender);
  border-radius: 17px;
  font-size: 11px;
  color: var(--text2);
  flex-wrap: wrap;
}
.solution-overview b {
  font: 500 27px var(--font-heading);
  color: var(--text);
  margin-right: 8px;
}
.solution-overview > span:last-child {
  margin-left: auto;
  font-size: 10px;
}
.sol-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.sol-tab-btn {
  font: 11px var(--font-body);
  padding: 9px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
}
.sol-tab-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.sol-cards-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.sol-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg2);
  overflow: hidden;
  box-shadow: none;
}
.sol-card.correct-card,
.sol-card.incorrect-card,
.sol-card.skipped-card {
  border: 1px solid var(--border);
}
.sol-card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 21px;
  gap: 16px;
  background: var(--bg);
}
.sol-card-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 600 15px var(--font-body);
}
.question-number {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 13px;
  background: var(--lavender);
  color: var(--accent);
  font: 500 23px var(--font-heading);
}
.sol-card-title small {
  font: 10px var(--font-body);
  display: block;
  margin-top: 6px;
  color: var(--text3);
}
.sol-card-badges {
  justify-content: flex-start;
  gap: 6px;
}
.sol-badge {
  font: 9px var(--font-body);
  border: 0;
  border-radius: 15px;
  padding: 5px 8px;
}
.sol-card-body {
  padding: 21px;
}
.sol-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 20px;
}
.sol-ans-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.sol-ans-label {
  font-size: 10px;
  color: var(--text3);
}
.sol-ans-val {
  font: 500 22px var(--font-heading);
  border: 0;
  padding: 0;
  background: none;
}
.sol-toggle-btn {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  font: 500 11px var(--font-body);
  color: var(--accent);
}
.sol-img-wrapper {
  border-radius: 12px;
}
.ak-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-top: 20px;
  padding: 21px;
}
.ak-cell {
  border-radius: 10px;
}
.leaderboard-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 25px 0;
}
.standing-highlight {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: 19px;
  background: var(--lavender);
  min-width: 0;
}
.standing-highlight:nth-child(2) {
  background: var(--peach);
}
.standing-highlight:nth-child(3) {
  background: var(--sage);
}
.standing-rank {
  font: 500 36px var(--font-heading);
  letter-spacing: -2px;
  color: var(--accent);
}
.standing-highlight small {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.standing-highlight strong {
  display: block;
  font: 500 24px var(--font-heading);
  margin-top: 8px;
}
.standing-highlight em {
  font: 10px var(--font-body);
  color: var(--text3);
  margin-left: 7px;
}
.leaderboard-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.leaderboard-subject {
  background: var(--bg3);
  border: 0;
  border-radius: 14px;
  font-size: 10px;
}
@media (max-width: 768px) {
  .sol-cards-list {
    grid-template-columns: 1fr;
  }
  .solution-overview {
    gap: 16px;
    padding: 18px;
  }
  .solution-overview > span:last-child {
    margin-left: 0;
  }
  .leaderboard-highlights {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .standing-highlight {
    padding: 17px;
    gap: 20px;
  }
  .standing-highlight > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex: 1;
  }
  .standing-highlight strong {
    margin: 0;
    white-space: nowrap;
    font-size: 22px;
  }
  .standing-rank {
    font-size: 30px;
  }
}
.day-schedule {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 18px;
  min-width: 0;
}
.day-schedule.is-today {
  border-color: var(--accent);
  background: var(--lavender);
}
.day-schedule > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}
.day-schedule > header > span {
  font: 600 14px var(--font-heading);
}
.day-schedule > header > small {
  font-size: 9px;
  color: var(--text3);
}
.timeline-event {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 15px;
  margin-top: 15px;
  font-size: 10px;
}
.timeline-event > div {
  border-left: 2px solid var(--accent);
  padding: 0 0 17px 12px;
}
.timeline-event time {
  font-size: 10px;
  color: var(--text3);
  padding-top: 2px;
}
.timeline-event strong {
  font: 600 12px var(--font-body);
}
.timeline-event small {
  display: block;
  font-size: 9px;
  line-height: 1.7;
  color: var(--text3);
  margin-top: 7px;
}
#timetable-grid {
  padding: 0 23px 23px;
}
.class-status {
  font-size: 9px;
  white-space: nowrap;
  color: var(--text3);
  padding: 6px 8px;
  background: var(--bg);
  border-radius: 16px;
}
.virtual-list .notice-item {
  height: 72px;
  margin: 0;
  box-sizing: border-box;
}
.virtual-list .exam-hall-item {
  height: 82px;
  margin: 0;
  box-sizing: border-box;
}
.virtual-list {
  display: block !important;
  height: 440px;
  max-height: 65dvh;
}
.studio-ui .virtual-list .notice-item {
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}
#page-result-detail > .full-card,
#page-leaderboard > .full-card,
#page-solutions > .full-card {
  background: none;
  border: 0;
  padding: 0;
}
.result-recap .rank-summary,
.result-recap .outcomes-panel,
.result-recap .subject-chart {
  background: var(--bg2);
}
.collection-count {
  font-size: 11px;
  color: var(--text3);
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg2);
}
.module-heading > .theme-mode-btn {
  flex-shrink: 0;
  min-width: 65px;
}

/* ── src/styles/priority-pages.css ── */
/* Everyday routes and their distinct reading layouts. */
.desk-links {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.desk-links button {
  padding: 18px;
  gap: 11px;
}
.desk-links small {
  line-height: 1.6;
}
.desk-secondary {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  flex-wrap: wrap;
  padding: 0 5px;
}
.desk-secondary button {
  border: 0;
  background: none;
  color: var(--text3);
  font: 11px var(--font-body);
  padding: 8px 0;
}
.desk-secondary button:hover {
  color: var(--accent);
}
.classes-frame {
  width: 100%;
  min-height: 300px;
  height: 600px;
  border: 0;
  display: block;
  color-scheme: normal;
}
.module-heading > div {
  min-width: 0;
}
.dock-symbol {
  font: 22px/1 var(--font-body);
}
/* Results is a direct lookup plus a chronological ledger, not another test grid. */
.studio-ui .results-launch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 25px;
  padding: 25px;
  background: var(--lavender);
  border: 0;
  border-radius: 20px;
  align-items: end;
}
.results-launch .manual-tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: 600px;
}
.results-launch label {
  grid-column: 1/-1;
  font: 500 22px var(--font-heading);
  letter-spacing: -0.6px;
  color: var(--text);
  margin-bottom: 4px;
}
.results-launch select {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  margin: 0;
  min-width: 0 !important;
}
.results-launch input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}
.results-launch button {
  margin: 0 !important;
  min-height: 44px;
}
#era-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.result-ledger-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 23px;
  padding: 23px 0;
  border-bottom: 1px solid var(--border);
}
.result-ledger-main h2 {
  font: 600 16px/1.6 var(--font-body);
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.result-ledger-main p {
  font: 10px/1.8 var(--font-body);
  color: var(--text3);
  margin: 0;
}
.result-ledger-main small {
  display: block;
  font-size: 10px;
  color: var(--text3);
  margin-top: 6px;
}
.result-ledger-actions {
  grid-column: 4;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}
.result-ledger-score {
  grid-column: 3;
  white-space: nowrap;
}
.result-ledger-score strong {
  font: 500 29px var(--font-heading);
  letter-spacing: -1px;
}
.result-ledger-score span {
  display: block;
  font-size: 11px;
  color: var(--text3);
  text-align: right;
  margin-top: 3px;
}
.result-ledger-actions button {
  margin: 0 !important;
}
.paper-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg2);
  padding: 12px 9px;
  min-width: 60px;
}
.paper-date span {
  font-size: 10px;
  color: var(--accent);
}
.paper-date strong {
  font: 500 28px/1.1 var(--font-heading);
  letter-spacing: -1px;
}
.paper-date small {
  font-size: 9px;
  color: var(--text3);
}
/* Exam Hall is a paper collection with a clear date, status and next action. */
.exam-overview {
  display: flex;
  gap: 35px;
  border-bottom: 1px solid var(--border);
  padding: 0 0 23px;
}
.exam-overview > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.exam-overview span {
  font: 11px var(--font-body);
  color: var(--text3);
}
.exam-overview strong {
  font: 500 28px var(--font-heading);
}
#examhall-list {
  gap: 23px;
}
.paper-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 21px;
  overflow: hidden;
  padding: 24px;
  min-width: 0;
}
.paper-card > header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.paper-card .paper-date {
  background: var(--lavender);
  border: 0;
}
.paper-card:nth-child(3n + 2) .paper-date {
  background: var(--peach);
}
.paper-card:nth-child(3n + 3) .paper-date {
  background: var(--sage);
}
.paper-card h2 {
  font: 500 21px/1.4 var(--font-heading);
  letter-spacing: -0.5px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}
.paper-status {
  font: 10px var(--font-body);
  color: var(--text3);
}
.paper-meta {
  font: 10px/1.8 var(--font-body);
  color: var(--text3);
  margin: 22px 0;
}
.paper-card .exam-hall-right {
  margin: 0 0 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  justify-content: flex-start;
  text-align: left;
}
.paper-card .exam-hall-score {
  font: 500 27px var(--font-heading);
}
.paper-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  border-top: 1px solid var(--border);
  padding-top: 17px;
  margin-top: auto;
}
.paper-card .exam-hall-actions {
  margin: 0;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.paper-card .card-action {
  font-size: 10px;
}
.paper-card .exam-hall-rank {
  font-size: 10px;
}
/* Timetable: select a day, then read a spacious agenda. */
.studio-ui #page-timetable > .full-card {
  background: none;
  border: 0;
  overflow: visible;
}
.studio-ui #page-timetable .full-card > .card-header {
  padding: 0 0 20px;
}
.studio-ui #timetable-grid {
  padding: 0;
}
.batch-id-entry {
  margin-left: auto;
  color: var(--text3);
  font-size: 11px;
}
.batch-id-entry summary {
  cursor: pointer;
  padding: 10px;
}
.batch-id-entry form {
  margin-top: 10px;
  gap: 9px;
}
.schedule-days {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 15px;
  scrollbar-width: thin;
  margin-bottom: 15px;
  max-width: 100%;
}
.schedule-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1;
  min-width: 78px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px;
  background: var(--bg2);
  color: var(--text);
}
.schedule-day.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.schedule-day > span {
  font-size: 11px;
}
.schedule-day strong {
  font: 500 27px var(--font-heading);
}
.schedule-day small {
  font-size: 9px;
  opacity: 0.8;
}
.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
.day-agenda {
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--bg2);
  padding: 27px;
}
.day-agenda > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.day-agenda h2 {
  font: 500 26px var(--font-heading);
  letter-spacing: -1px;
  margin: 9px 0 0;
}
.day-agenda > header > span {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}
.agenda-events {
  list-style: none;
  margin: 25px 0 0;
  padding: 0;
}
.agenda-events li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 22px;
  padding-bottom: 20px;
  position: relative;
}
.agenda-events li:last-child {
  padding: 0;
}
.agenda-events time {
  font: 12px var(--font-body);
  padding-top: 19px;
  color: var(--text2);
}
.agenda-event {
  background: var(--lavender);
  padding: 18px 20px;
  border-radius: 14px;
}
.agenda-events li:nth-child(3n + 2) .agenda-event {
  background: var(--peach);
}
.agenda-events li:nth-child(3n + 3) .agenda-event {
  background: var(--sage);
}
.agenda-event h3 {
  font: 600 15px var(--font-body);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.agenda-event p {
  font: 11px/1.7 var(--font-body);
  color: var(--text2);
  margin: 0;
}
.schedule-overview {
  padding: 27px;
  background: var(--butter);
  border-radius: 21px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.schedule-mark {
  font-size: 45px;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 23px;
}
.schedule-overview h2 {
  font: 500 23px var(--font-heading);
  letter-spacing: -0.8px;
}
.schedule-overview dl {
  width: 100%;
  margin: 22px 0;
}
.schedule-overview dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border2);
}
.schedule-overview dt {
  font-size: 11px;
  color: var(--text2);
}
.schedule-overview dd {
  font: 500 22px var(--font-heading);
}
.schedule-overview .card-action {
  margin-top: 12px;
}
/* Result detail prioritizes subject metrics; tags and technical banners are gone. */
.result-recap-focused .result-heading-block {
  margin-bottom: 0;
}
.result-recap-focused .result-links {
  margin: 0 0 4px;
  gap: 9px;
}
.result-recap-focused .score-story {
  padding: 25px;
}
.result-recap-focused .score-story-value {
  font-size: 52px;
  margin: 10px 0;
}
.result-recap-focused .rank-summary {
  padding: 25px;
}
.subject-overview {
  grid-column: 1/-1;
  margin: 8px 0;
}
.subject-overview > header {
  margin: 0 0 18px;
}
.subject-overview > header h2 {
  font: 500 24px var(--font-heading);
  letter-spacing: -0.8px;
}
.subject-overview > header p {
  font: 11px/1.8 var(--font-body);
  color: var(--text3);
  margin-top: 7px;
}
.subject-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.subject-cards .subject-result-card {
  margin: 0;
  border-radius: 20px;
  background: var(--bg2);
  padding: 23px;
  min-width: 0;
}
.subject-cards .subject-result-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  margin: 0;
}
.subject-cards .subject-result-name {
  font: 600 16px var(--font-body);
  margin: 0;
}
.subject-cards .subject-result-score {
  font: 500 34px var(--font-heading);
  color: var(--text);
  letter-spacing: -1.5px;
}
.subject-result-score small {
  font: 400 14px var(--font-body);
  letter-spacing: 0;
  color: var(--text3);
}
.subject-score-track {
  height: 5px;
  border-radius: 5px;
  background: var(--bg3);
  margin: 18px 0 23px;
  overflow: hidden;
}
.subject-score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.subject-cards .subject-result-card:nth-child(3n + 2) .subject-score-track i {
  background: var(--red);
}
.subject-cards .subject-result-card:nth-child(3n + 3) .subject-score-track i {
  background: var(--green);
}
.subject-key-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 15px;
  margin: 0;
}
.subject-key-metrics dt {
  font: 10px var(--font-body);
  color: var(--text3);
  margin-bottom: 8px;
}
.subject-key-metrics dd {
  font: 500 23px var(--font-heading);
  margin: 0;
  color: var(--text);
}
.subject-answer-counts {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  margin-top: 21px;
  padding-top: 18px;
  font-size: 9px;
  color: var(--text3);
}
.subject-answer-counts b {
  display: block;
  color: var(--text2);
  font: 600 13px var(--font-body);
  margin-bottom: 4px;
}
.subject-more {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 15px;
  color: var(--text3);
  font-size: 10px;
}
.subject-more summary {
  cursor: pointer;
}
.subject-more dl {
  margin-top: 13px;
  display: grid;
  gap: 12px;
}
.subject-more dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.subject-more dd {
  text-align: right;
  color: var(--text2);
}
/* Noticeboard and inbox get their own collection/reading rhythm. */
#notice-list:not(.virtual-list) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
#notice-list:not(.virtual-list) .notice-item {
  min-height: 155px;
  flex-direction: column;
  align-items: stretch !important;
  padding: 23px !important;
  gap: 22px;
  justify-content: space-between !important;
}
#notice-list:not(.virtual-list) .notice-title {
  white-space: normal !important;
  font: 500 18px/1.5 var(--font-heading);
  letter-spacing: -0.3px;
}
#notice-list:not(.virtual-list) .notice-item > button {
  align-self: flex-start;
}
#page-notices > .full-card {
  background: none;
  border: 0;
  padding: 0;
}
.msg-day-divider {
  font-size: 10px;
  color: var(--text3);
  text-align: center;
  padding: 20px 0 10px;
}
.msg-content > .card-header {
  background: var(--bg2) !important;
}
.msg-bubble {
  padding: 19px;
  border-radius: 17px 17px 17px 4px;
  max-width: 85%;
  line-height: 1.8;
}
.msg-bubble-text {
  font-size: 13px;
}
.msg-back {
  border: 0;
  border-radius: 11px;
  padding: 9px 12px;
  background: var(--lavender);
  color: var(--accent);
}
@media (max-width: 1080px) {
  .desk-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .subject-cards {
    gap: 12px;
  }
  .subject-cards .subject-result-card {
    padding: 18px;
  }
  .result-ledger-row {
    gap: 16px;
  }
  .schedule-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .exam-overview {
    gap: 24px;
  }
  .exam-overview > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }
}
@media (max-width: 768px) {
  .studio-ui .section-nav {
    display: none;
  }
  .studio-ui .topbar .hamburger {
    display: none !important;
  }
  .studio-ui .topbar {
    min-height: 62px;
    height: 62px;
  }
  .studio-ui .mobile-dock {
    display: flex;
  }
  .studio-ui .dock-btn {
    flex: 1;
    min-width: 0;
    font-size: 9px;
  }
  .studio-ui .mobile-dock .dock-symbol {
    font-size: 21px;
  }
  .studio-ui .content {
    padding-top: 23px;
  }
  .studio-ui .desk-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .studio-ui .desk-links button {
    padding: 17px;
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }
  .desk-links button > span:last-child {
    display: none;
  }
  .desk-links small {
    font-size: 10px;
  }
  .desk-secondary {
    justify-content: flex-start;
    gap: 19px;
  }
  .desk-secondary button {
    font-size: 10px;
  }
  .module-heading {
    flex-wrap: wrap;
  }
  .module-heading > button {
    margin: 0 !important;
  }
  .studio-ui .results-launch {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 20px;
  }
  .results-launch .manual-tool-form {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .results-launch label {
    font-size: 21px;
  }
  .results-launch button {
    font-size: 10px !important;
    padding: 10px 12px !important;
  }
  .results-launch select {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
  }
  .result-ledger-row {
    grid-template-columns: 51px minmax(0, 1fr);
    gap: 12px;
    padding: 22px 0;
  }
  .result-ledger-main h2 {
    font-size: 14px;
  }
  .result-ledger-main p,
  .result-ledger-main small {
    font-size: 9px;
  }
  .result-ledger-row .paper-date {
    min-width: 0;
    padding: 10px 6px;
    align-self: start;
    border-radius: 12px;
  }
  .paper-date strong {
    font-size: 25px;
  }
  .result-ledger-actions {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .result-ledger-actions button {
    font-size: 10px !important;
  }
  .result-ledger-score {
    grid-column: 2;
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .result-ledger-score strong {
    font-size: 22px;
  }
  .paper-card {
    padding: 21px;
  }
  .paper-card h2 {
    font-size: 20px;
  }
  .paper-card > header {
    gap: 17px;
  }
  .exam-overview {
    gap: 20px;
    justify-content: space-between;
  }
  .exam-overview span {
    font-size: 9px;
    line-height: 1.7;
  }
  .exam-overview strong {
    font-size: 24px;
  }
  .batch-id-entry {
    width: 100%;
    margin: 0;
  }
  .batch-id-entry form {
    flex-wrap: wrap;
  }
  .schedule-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .schedule-day {
    min-width: 74px;
    padding: 14px 9px;
  }
  .schedule-day strong {
    font-size: 25px;
  }
  .day-agenda {
    padding: 21px;
  }
  .day-agenda h2 {
    font-size: 22px;
  }
  .day-agenda > header > span {
    font-size: 9px;
  }
  .agenda-events li {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
  }
  .agenda-events time {
    font-size: 10px;
  }
  .agenda-event {
    padding: 16px;
  }
  .agenda-event h3 {
    font-size: 13px;
  }
  .agenda-event p {
    font-size: 10px;
  }
  .schedule-overview {
    padding: 23px;
  }
  .schedule-mark {
    display: none;
  }
  .schedule-overview dl {
    margin: 12px 0 20px;
  }
  .subject-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .subject-cards .subject-result-card {
    padding: 23px;
  }
  .subject-cards .subject-result-head {
    flex-direction: row;
    align-items: center;
    gap: 15px;
  }
  .subject-cards .subject-result-score {
    font-size: 31px;
  }
  .subject-key-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .subject-key-metrics dd {
    font-size: 24px;
  }
  .subject-answer-counts {
    font-size: 10px;
  }
  .result-recap-focused .score-story-value {
    font-size: 46px;
  }
  .result-recap-focused .rank-summary {
    padding: 21px;
  }
  .result-links button {
    font-size: 10px !important;
  }
  .subject-overview > header h2 {
    font-size: 23px;
  }
  #notice-list:not(.virtual-list) {
    grid-template-columns: 1fr;
  }
  #page-messages.active {
    height: calc(100dvh - 245px);
    min-height: 400px;
  }
  .msg-bubble {
    max-width: 100%;
    padding: 17px;
  }
  .msg-bubble-text {
    font-size: 12px;
  }
}
/* Weekday first: the date supports the day, not the other way around. */
.schedule-day {
  min-width: 94px;
  gap: 8px;
  padding: 20px 12px;
}
.schedule-day > .schedule-weekday {
  font: 600 28px/1.15 var(--font-heading);
  letter-spacing: -0.6px;
}
.schedule-day > .schedule-date {
  font: 500 13px/1.5 var(--font-body);
  opacity: 0.85;
}
.schedule-day small {
  font-size: 10px;
}
.schedule-day.active {
  box-shadow: inset 0 -4px 0 #00000018;
}
.studio-ui:not(.light-mode) .section-nav button.active,
.studio-ui:not(.light-mode) .dock-btn.active {
  background: var(--lavender);
  color: var(--accent);
}
.studio-ui:not(.light-mode) .topbar {
  background: var(--bg);
}
.studio-ui:not(.light-mode) .day-agenda,
.studio-ui:not(.light-mode) .paper-card,
.studio-ui:not(.light-mode) .subject-result-card {
  box-shadow: 0 6px 24px #00000012;
}
/* Small, deliberate launcher rows inside the closed-by-default Settings panel. */
.studio-ui #settings-functions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 24px;
  padding: 0 20px 20px;
}
.studio-ui #settings-functions-grid .function-nav-card {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 20px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  background: none !important;
  text-align: left;
  color: var(--text);
  box-shadow: none;
  transform: none;
}
.function-number {
  color: var(--accent);
  font: 500 12px var(--font-heading);
}
.function-copy {
  flex: 1;
  min-width: 0;
}
.function-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.function-copy small {
  display: block;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.6;
}
.studio-ui #settings-functions-grid .function-nav-card:hover {
  color: var(--accent);
}
@media (max-width: 768px) {
  .schedule-day {
    min-width: 86px;
    padding: 18px 12px;
  }
  .schedule-day > .schedule-weekday {
    font-size: 25px;
  }
  .studio-ui #settings-functions-grid {
    grid-template-columns: 1fr !important;
    padding: 0 16px 16px;
  }
}

/* ── src/styles/detail-pages.css ── */
/* Finished secondary views. Native sheets deliberately do not reuse legacy modal classes. */
body.studio-ui .topbar .hamburger {
  display: flex !important;
}
body.studio-ui .topbar .topbar-search-wrap {
  min-width: 0;
}
#page-dashboard .upcoming-card {
  grid-column: 1/-1;
}
#page-dashboard .upcoming-card #dashboard-upcoming-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}
.detail-dialog:not([open]) {
  display: none !important;
}
.detail-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(840px, calc(100vw - 32px));
  max-width: 840px;
  max-height: 88dvh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 25px 100px #0005;
  overflow: auto;
  font: 14px/1.7 var(--font-body);
  color-scheme: inherit;
}
.detail-dialog::backdrop {
  background: #0b131bb3;
  backdrop-filter: blur(7px);
}
.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px 22px;
  background: var(--lavender);
}
.detail-heading h2 {
  font: 500 clamp(23px, 3vw, 32px) / 1.3 var(--font-heading);
  letter-spacing: -0.8px;
  margin: 9px 0 0;
  overflow-wrap: anywhere;
}
.detail-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border2);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text);
  font: 24px var(--font-body);
}
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
}
.detail-actions:empty {
  display: none;
}
.detail-actions p {
  font-size: 12px;
  color: var(--text3);
  margin: 0;
  flex: 1;
}
.detail-content {
  padding: 28px 32px;
  min-width: 0;
}
.detail-content .theme-mode-btn {
  text-decoration: none;
  display: inline-flex;
}
.syllabus-overview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--text2);
}
.syllabus-overview strong {
  font: 500 30px var(--font-heading);
  color: var(--accent);
}
.syllabus-sections {
  display: grid;
  gap: 18px;
}
.syllabus-section {
  border: 1px solid var(--border);
  border-radius: 17px;
  overflow: hidden;
}
.syllabus-section header {
  display: flex;
  gap: 13px;
  align-items: center;
  background: var(--bg3);
  padding: 17px 20px;
}
.syllabus-section h3 {
  font: 600 17px var(--font-heading);
  margin: 0;
  flex: 1;
}
.syllabus-section small {
  font-size: 10px;
  color: var(--text3);
}
.syllabus-number {
  font: 500 11px var(--font-heading);
  color: var(--accent);
}
.syllabus-section ul {
  list-style: none;
  margin: 0;
  padding: 5px 20px;
}
.syllabus-section li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.syllabus-section li:last-child {
  border: 0;
}
.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.detail-facts > div {
  padding: 18px;
  background: var(--bg3);
  border-radius: 13px;
}
.detail-facts dt {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 6px;
}
.detail-facts dd {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
}
.detail-facts s {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}
.detail-section,
.detail-section-title {
  margin-top: 24px;
}
.detail-section h3,
.detail-section-title {
  font: 600 18px var(--font-heading);
  margin-bottom: 14px;
}
.detail-topic {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  font-size: 13px;
}
.detail-live {
  color: var(--green);
}
.course-detail-image {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 24px;
}
.detail-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex: 1;
}
.detail-filters label {
  flex: 1;
  font-size: 11px;
  color: var(--text3);
}
.detail-filters select {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  background: var(--bg);
}
#att-modal-body {
  display: grid;
  gap: 10px;
}
#att-modal-body .attendance-summary {
  background: var(--lavender);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 8px;
}
/* Model lab: two deliberate workflows, not the former stack of utility panels. */
.model-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 28px;
}
.model-tab {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 5px 10px;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 17px;
  padding: 21px;
  color: var(--text);
}
.model-tab > span {
  grid-row: span 2;
  font: 500 16px var(--font-heading);
  color: var(--text3);
  padding-top: 2px;
}
.model-tab strong {
  font: 600 17px var(--font-heading);
}
.model-tab small {
  font-size: 12px;
  color: var(--text3);
}
.model-tab.active {
  background: var(--lavender);
  border-color: var(--accent);
}
.model-tab.active > span {
  color: var(--accent);
}
#page-neural .model-workflow {
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
}
#page-neural .model-workflow-heading {
  padding: 0 0 20px;
  margin: 0;
  border: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
#page-neural .rank-predictor-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 25px;
  align-items: start;
  padding: 0;
}
.model-form {
  padding: 28px;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 22px;
}
.model-step > span {
  font: 500 10px var(--font-body);
  color: var(--accent);
  letter-spacing: 1px;
}
.model-step h2 {
  font: 500 25px var(--font-heading);
  letter-spacing: -0.7px;
  margin: 10px 0;
}
.model-step p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text3);
  margin: 0 0 26px;
}
.model-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
  margin-bottom: 24px;
}
.model-lab .rank-field {
  min-width: 0;
  margin: 0;
}
.model-lab .rank-field label {
  font-size: 12px;
  line-height: 1.6;
  display: block;
  margin-bottom: 7px;
}
.model-lab .rank-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text);
  font: 500 18px var(--font-heading);
}
.model-lab .rank-field .hint {
  display: block;
  margin-top: 6px;
  font-size: 10px;
}
.model-score-field {
  grid-column: 1/-1;
}
.model-lab .model-score-field input {
  height: 76px;
  font-size: 34px;
  color: var(--accent);
  background: var(--lavender);
  border-color: var(--border);
}
.model-lab .start-btn {
  border-radius: 11px !important;
  min-height: 38px;
  font: 500 12px var(--font-body) !important;
}
#rank-predict-btn,
#pl-generate-btn {
  width: 100%;
  min-height: 48px !important;
  background: var(--accent);
  color: var(--accent-text);
  margin: 10px 0 0 !important;
}
.model-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.model-status .rank-pill {
  border: 0;
  background: none;
  padding: 0;
  white-space: normal;
}
.model-output {
  min-width: 0;
}
.model-lab .inference-idle {
  min-height: 380px;
  border: 1px solid var(--border);
  background: var(--sage);
  border-radius: 22px;
}
.model-lab .inference-caption {
  padding: 24px 26px;
  font-size: 10px;
  letter-spacing: 1px;
}
.model-lab .inference-idle-body::before {
  content: "≈";
  font: 500 80px var(--font-heading);
  opacity: 0.5;
}
.model-lab .inference-idle-body {
  padding: 20px 35px 38px;
}
.model-lab .inference-idle h3 {
  font-size: 25px;
  max-width: 260px;
  line-height: 1.35;
}
.model-disclaimer {
  font-size: 11px;
  line-height: 1.8;
  color: var(--text3);
  padding: 0 8px;
  margin: 16px 0;
}
.model-options,
.model-diagnostics {
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-top: 22px;
  overflow: hidden;
  background: var(--bg2);
}
.model-options summary,
.model-diagnostics summary {
  padding: 15px 18px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.model-options > .pl-card-mode-wrap,
.model-diagnostics > .rank-pipe {
  margin: 0;
  padding: 18px;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
}
.model-anchors {
  margin-top: 22px !important;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.model-lab .rank-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.model-lab .rank-stat {
  padding: 20px;
  background: var(--bg2);
}
.model-lab .rank-hero {
  padding: 28px;
  border: 1px solid var(--border);
}
.model-lab .rank-hero .big {
  font-size: 56px;
}
.model-lab .rank-result-section {
  width: 100%;
}
.model-lab #pl-results-section {
  padding: 0 !important;
  border: 0 !important;
}
.model-lab .rank-pipe-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.8;
  padding: 7px 0;
}
.model-lab .rank-alert {
  border-radius: 12px;
  font: 12px/1.7 var(--font-body);
}
@media (max-width: 900px) {
  #page-neural .rank-predictor-container {
    grid-template-columns: minmax(0, 1fr);
  }
  .model-lab .inference-idle {
    min-height: 270px;
  }
}
@media (max-width: 768px) {
  #page-dashboard .upcoming-card #dashboard-upcoming-list {
    grid-template-columns: 1fr;
  }
  .model-tabs {
    gap: 10px;
  }
  .model-tab {
    padding: 16px;
    grid-template-columns: 1fr;
  }
  .model-tab > span {
    grid-row: auto;
    font-size: 11px;
  }
  .model-tab strong {
    font-size: 16px;
  }
  .model-tab small {
    font-size: 10px;
  }
  .model-form {
    padding: 22px 18px;
  }
  .model-step h2 {
    font-size: 23px;
  }
  .detail-dialog {
    width: calc(100vw - 20px);
    max-height: 92dvh;
    border-radius: 20px;
  }
  .detail-heading {
    padding: 24px 20px 20px;
    gap: 14px;
  }
  .detail-actions {
    padding: 16px 20px;
  }
  .detail-content {
    padding: 22px 20px;
  }
  .detail-facts {
    grid-template-columns: 1fr;
  }
  .detail-filters {
    flex-wrap: wrap;
  }
  .syllabus-section header {
    padding: 15px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .syllabus-section h3 {
    font-size: 16px;
  }
  .syllabus-section ul {
    padding: 3px 15px;
  }
}
.exam-syllabus-btn,
.exam-view-btn {
  background: var(--lavender) !important;
  color: var(--accent) !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  min-height: 38px;
  font: 500 12px var(--font-body) !important;
}
.exam-syllabus-btn:hover,
.exam-view-btn:hover {
  border-color: var(--accent) !important;
}
.model-lab #pl-anchor-wrap {
  max-height: 320px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-top: 16px;
}
.model-lab #pl-anchor-list {
  min-width: 0;
}
.model-lab .pl-anchor-row {
  padding: 15px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  margin: 0;
}
.model-lab .topper-anchor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  background: var(--lavender);
  color: var(--text);
}
.topper-anchor > span,
.topper-anchor > small {
  font: 11px var(--font-body);
  color: var(--text3);
}
.topper-anchor > strong {
  font: 500 12px var(--font-body);
}
.model-lab .editable-anchor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 26px;
  align-items: end;
  gap: 10px;
}
.editable-anchor label {
  font: 10px var(--font-body);
  color: var(--text3);
}
.model-lab .editable-anchor input {
  width: 100%;
  min-width: 0;
  height: 38px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  padding: 7px;
  font: 500 13px var(--font-body);
}
.model-lab .pl-anchor-del-btn {
  width: 26px;
  height: 38px;
  color: var(--text3);
  background: none;
  border: 0;
  font: 21px var(--font-body);
}
.anchor-cohort {
  grid-column: 1/-1;
  font: 10px var(--font-body);
  color: var(--text3);
}
.model-lab .pl-badge {
  font: 500 10px var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  border: 0;
  background: var(--bg3);
  color: var(--text2);
  border-radius: 6px;
  padding: 4px 7px;
  white-space: normal;
}
.model-lab .pl-badge-topper {
  color: var(--accent);
  background: var(--lavender);
}
.model-lab .pl-badge-anchor {
  color: var(--green);
  background: var(--sage);
}
.model-lab .pl-meta-banner {
  padding: 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 15px;
  font-size: 11px;
}
.model-lab .leaderboard-table {
  font: 12px var(--font-body);
  min-width: 380px;
}
.model-lab .leaderboard-table td {
  font: 12px/1.6 var(--font-body);
  padding: 15px 13px;
}
.model-lab .leaderboard-wrap {
  border-radius: 15px;
  background: var(--bg2);
}
.model-lab .leaderboard-wrap > div {
  padding: 14px;
  gap: 12px;
  font-size: 11px;
  flex-wrap: wrap;
}
.model-lab .pl-f-chip {
  font-size: 11px;
}
.studio-ui .model-lab .model-score-field input {
  font-size: 32px !important;
}
/* Calendar collection and its preparation brief are purpose-built, not legacy info rows. */
.calendar-collection > .card-header {
  padding: 0 0 20px;
  border: 0;
  background: none;
}
.calendar-paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.calendar-paper {
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--bg2);
  padding: 25px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.calendar-paper > header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.calendar-date-plate {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 17px 12px;
  background: var(--lavender);
  color: var(--accent);
  border-radius: 15px;
  min-width: 78px;
}
.calendar-date-plate > span {
  font: 600 12px var(--font-body);
}
.calendar-date-plate > strong {
  font: 500 33px/1.1 var(--font-heading);
}
.calendar-date-plate > small {
  font: 10px var(--font-body);
}
.calendar-paper-heading {
  min-width: 0;
}
.calendar-paper h2 {
  font: 500 22px/1.4 var(--font-heading);
  letter-spacing: -0.5px;
  margin: 9px 0;
  overflow-wrap: anywhere;
}
.calendar-paper-heading p {
  font-size: 11px;
  color: var(--text3);
  margin: 0;
}
.calendar-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 11px var(--font-body);
  color: var(--text2);
}
.calendar-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text3);
}
.calendar-status.upcoming::before {
  background: var(--accent);
}
.calendar-status.today::before {
  background: var(--amber);
}
.calendar-paper-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}
.calendar-paper-facts dt,
.exam-brief-facts dt {
  font-size: 10px;
  color: var(--text3);
  margin-bottom: 7px;
}
.calendar-paper-facts dd {
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
  overflow-wrap: anywhere;
}
.calendar-paper footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.calendar-paper footer > span {
  font-size: 10px;
  color: var(--text3);
}
.calendar-details-button {
  display: inline-flex;
  gap: 15px;
  align-items: center;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--bg3);
  color: var(--text);
  padding: 11px 15px;
  font: 500 12px var(--font-body);
}
.calendar-details-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.calendar-brief-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: 980px;
}
.calendar-brief-dialog .detail-heading {
  background: var(--bg2);
  padding-bottom: 24px;
}
.calendar-brief-dialog .detail-actions {
  background: var(--bg3);
}
.exam-brief-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 34px;
}
.exam-brief-sidebar {
  padding-right: 28px;
  border-right: 1px solid var(--border);
}
.exam-brief-sidebar .calendar-date-plate {
  width: 100%;
  padding: 23px 15px;
}
.exam-brief-sidebar .calendar-date-plate strong {
  font-size: 48px;
}
.exam-brief-facts {
  margin: 22px 0 0;
}
.exam-brief-facts > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.exam-brief-facts dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.exam-brief-syllabus {
  min-width: 0;
}
.exam-brief-syllabus > header h3 {
  font: 500 26px var(--font-heading);
  letter-spacing: -0.7px;
  margin: 8px 0 10px;
}
.exam-brief-syllabus > header p {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.6;
}
.brief-subject {
  margin-top: 23px;
}
.brief-subject h4 {
  display: flex;
  gap: 12px;
  align-items: center;
  font: 600 16px var(--font-heading);
  margin: 0;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
.brief-subject h4 span {
  font: 500 10px var(--font-body);
  color: var(--accent);
}
.brief-subject ul {
  padding-left: 19px;
  margin: 10px 0;
}
.brief-subject li {
  padding: 7px 0 7px 4px;
  line-height: 1.8;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.brief-subject li::marker {
  color: var(--text3);
}
.brief-empty {
  padding: 24px;
  background: var(--bg3);
  border-radius: 14px;
  color: var(--text3);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 22px;
}
/* Dark mode uses neutral depth, with small cool accents rather than large pastel panels. */
body:not(.light-mode) {
  --night-surface: #1c262a;
  --night-inset: #202c30;
  --night-line: #34454a;
  --night-blue: #a4bccf;
  --night-mauve: #c0b3d0;
  --night-mint: #9bc5b6;
}
.studio-ui:not(.light-mode) .today-card,
.studio-ui:not(.light-mode) .upcoming-card {
  background: var(--night-surface) !important;
  border: 1px solid var(--border);
}
.studio-ui:not(.light-mode) .upcoming-card > .card-header {
  border-bottom: 1px solid var(--border);
}
.studio-ui:not(.light-mode) .schedule-overview {
  background: var(--night-surface);
  border: 1px solid var(--border);
}
.studio-ui:not(.light-mode) .schedule-mark {
  color: var(--night-blue);
}
.studio-ui:not(.light-mode) .schedule-overview dl > div {
  border-color: var(--border);
}
.studio-ui:not(.light-mode) .agenda-event {
  background: var(--night-inset);
  border: 1px solid var(--night-line);
  border-left: 3px solid var(--night-blue);
}
.studio-ui:not(.light-mode) .agenda-events li:nth-child(3n + 2) .agenda-event {
  background: #252a32;
  border-left-color: var(--night-mauve);
}
.studio-ui:not(.light-mode) .agenda-events li:nth-child(3n + 3) .agenda-event {
  background: #202d2b;
  border-left-color: var(--night-mint);
}
.studio-ui:not(.light-mode) .schedule-day.active {
  background: var(--lavender);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 -3px var(--accent);
}
.studio-ui:not(.light-mode) .calendar-date-plate {
  background: var(--night-inset);
  color: var(--accent);
  border: 1px solid var(--night-line);
}
.studio-ui:not(.light-mode) .detail-heading {
  background: var(--night-inset);
}
.studio-ui:not(.light-mode) .calendar-brief-dialog .detail-heading {
  background: var(--bg2);
}
.studio-ui:not(.light-mode) .upcoming-card .exam-badge {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}
@media (max-width: 900px) {
  .calendar-paper-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .calendar-paper {
    padding: 20px;
  }
  .calendar-paper > header {
    gap: 15px;
  }
  .calendar-paper h2 {
    font-size: 20px;
  }
  .calendar-paper-facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .exam-brief-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .exam-brief-sidebar {
    padding: 0 0 22px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .exam-brief-sidebar .calendar-date-plate {
    padding: 20px 8px;
  }
  .exam-brief-sidebar .calendar-date-plate strong {
    font-size: 36px;
  }
  .exam-brief-facts {
    margin: 0;
  }
  .exam-brief-facts > div:first-child {
    padding-top: 0;
  }
  .exam-brief-facts dd {
    font-size: 12px;
  }
}

/* ── src/styles/mobile.css ── */
/* Phone-specific composition, loaded after feature styles. Desktop stays intact. */
.auth-pocket-mark {
  display: none;
}
.password-toggle svg {
  width: 21px;
  height: 21px;
  vertical-align: middle;
}
.password-eye-slash {
  display: none;
}
.password-toggle[aria-pressed="true"] .password-eye-slash {
  display: block;
}

@media (max-width: 680px) {
  body #login-screen {
    justify-content: flex-start;
    overscroll-behavior-y: contain;
    scroll-padding: 20px;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .auth-masthead {
    min-height: 70px;
    margin: 0 20px;
  }
  .auth-header-actions {
    gap: 12px;
  }
  .auth-theme-toggle {
    width: 44px;
    height: 44px;
  }
  .auth-header-actions > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 12px;
  }
  .auth-layout {
    width: calc(100% - 32px);
    max-width: 440px;
    margin: 22px auto 18px;
    gap: 22px;
    flex-shrink: 0;
  }
  .auth-intro {
    display: none;
  }
  body:not(.light-mode) .auth-intro {
    padding: 0 6px;
  }
  .auth-intro > .eyebrow {
    display: none;
  }
  .auth-desktop-title {
    display: none;
  }
  .auth-intro h1 {
    font-size: 32px;
    letter-spacing: -1.4px;
    line-height: 1.2;
    margin: 0 0 8px;
  }
  .auth-intro h1 em {
    display: inline;
  }
  .auth-intro > p {
    font-size: 12px;
    line-height: 1.6;
    max-width: 300px;
  }
  body:not(.light-mode) .auth-intro::before {
    inset: -8px 0;
  }
  /* Flat, full-width form rather than a rotated desktop card squeezed to fit. */
  .auth-form-area::before {
    display: none;
  }
  body #login-screen .login-card {
    padding: 24px 20px 20px;
    gap: 20px;
    border-radius: 22px;
    box-shadow: 0 8px 28px #302a3908;
  }
  #login-screen .form-symbol,
  .login-intro > .eyebrow {
    display: none;
  }
  .login-title {
    font-size: 27px;
    letter-spacing: -1px;
    margin: 0 0 6px;
  }
  .login-intro p {
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
  }
  .auth-field label {
    font-size: 12px;
    margin-bottom: 8px;
  }
  body #login-screen .login-input {
    min-height: 50px;
    padding: 13px 14px;
    font-size: 16px;
    scroll-margin: 20px;
  }
  body #login-screen .login-input::placeholder {
    font-size: 13px;
  }
  #login-screen #login-pass {
    padding-right: 52px;
  }
  .password-toggle {
    width: 44px;
    height: 44px;
    right: 3px;
    top: 3px;
  }
  body #login-screen .login-btn {
    min-height: 50px;
    font-size: 14px !important;
  }
  .auth-help {
    font-size: 11px;
    line-height: 1.7;
  }
  .auth-footnote {
    display: none;
  }
  #login-screen > .login-footer {
    margin: auto 22px 0;
    padding: 12px 0 14px;
    align-items: center;
    gap: 12px;
    font-size: 10px;
  }
  #login-screen > .login-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 11px;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  /* Touch targets and inset-aware chrome without a second navigation bar. */
  .studio-ui .topbar {
    height: calc(64px + env(safe-area-inset-top));
    min-height: calc(64px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    gap: 8px;
  }
  .studio-ui .workspace-theme,
  .studio-ui .topbar .hamburger,
  .studio-ui .topbar .notif-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
  }
  .studio-ui .workspace-theme {
    font-size: 23px;
  }
  .studio-ui .mobile-dock {
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }
  .studio-ui .mobile-dock .dock-btn {
    min-height: 48px;
    font-size: 10px;
    gap: 4px;
  }
  .studio-ui .content {
    padding: 22px 16px calc(92px + env(safe-area-inset-bottom));
    scroll-padding-bottom: 100px;
  }
  .studio-ui .subnav {
    padding: 4px 16px;
  }
  body.studio-ui .subnav-chip {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 8px 14px;
  }
  .studio-ui .sidebar .nav-item {
    min-height: 46px;
    font-size: 14px;
  }
  .studio-ui .drawer-close {
    width: 44px;
    height: 44px;
  }
  .studio-ui .sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .card-action,
  .calendar-details-button,
  .theme-mode-btn,
  .result-links button,
  .result-ledger-actions button,
  .desk-secondary button {
    min-height: 44px;
  }
  .card-action {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
  }
  .desk-secondary button {
    font-size: 12px;
  }
  .studio-ui .desk-links button {
    padding: 16px;
    gap: 10px;
  }
  .desk-links small {
    font-size: 12px;
    line-height: 1.5;
  }
  .home-layout {
    gap: 16px;
  }
  .today-card {
    padding: 20px;
  }
  .today-label {
    margin-bottom: 8px;
  }
  .orbit-flower {
    font-size: 34px;
  }
  .today-card .card-header {
    margin-bottom: 12px;
  }
  .today-card .card-title {
    font-size: 22px;
  }
  .today-card .class-item {
    padding: 12px;
    margin-top: 8px;
  }
  .home-summary .stat-label {
    font-size: 12px;
  }
  .home-summary .stat-sub {
    font-size: 11px;
  }
  .upcoming-card .exam-name {
    font-size: 13px;
  }
  .upcoming-card .exam-date {
    font-size: 11px;
  }
  .workspace-heading {
    margin-bottom: 22px;
  }
  .module-heading h1 {
    font-size: 30px;
    letter-spacing: -1px;
  }
  .module-heading p {
    font-size: 13px;
    line-height: 1.6;
  }
  .schedule-days {
    gap: 9px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 2px;
  }
  .schedule-day {
    scroll-snap-align: center;
    padding: 14px 10px;
    min-width: 82px;
  }
  .agenda-event h3 {
    font-size: 14px;
  }
  .agenda-event p,
  .agenda-events time {
    font-size: 12px;
  }
  .calendar-paper-grid {
    gap: 16px;
  }
  .calendar-paper {
    padding: 18px;
    border-radius: 20px;
  }
  .calendar-paper h2 {
    font-size: 20px;
  }
  .calendar-paper-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
  }
  .calendar-paper-facts dt {
    font-size: 11px;
  }
  .calendar-paper-facts dd {
    font-size: 13px;
    line-height: 1.6;
  }
  .calendar-paper footer {
    padding-top: 14px;
  }
  .calendar-paper footer > span {
    font-size: 11px;
  }
  .calendar-details-button {
    padding: 11px 13px;
    font-size: 13px;
    gap: 10px;
  }
  .result-ledger-main p,
  .result-ledger-main small {
    font-size: 11px;
    line-height: 1.6;
  }
  .result-ledger-actions button {
    font-size: 12px !important;
  }
  .msg-bubble-text {
    font-size: 14px;
    line-height: 1.75;
  }
}

@media (max-width: 600px) {
  /* Native dialogs become bottom sheets; the close control remains reachable. */
  .detail-dialog,
  .calendar-brief-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)));
    inset: auto 0 0;
    margin: 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    overscroll-behavior: contain;
    scroll-padding-top: 140px;
  }
  .detail-heading,
  .calendar-brief-dialog .detail-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 20px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    gap: 14px;
  }
  .detail-heading h2 {
    font-size: 23px;
    margin-top: 6px;
  }
  .detail-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .detail-actions {
    padding: 12px 20px;
    gap: 10px;
  }
  .detail-content {
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .detail-actions button {
    min-height: 44px;
    font-size: 12px;
  }
  .exam-brief-layout {
    gap: 20px;
  }
  .exam-brief-sidebar {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 16px;
  }
  .exam-brief-sidebar .calendar-date-plate {
    min-width: 0;
    padding: 16px 6px;
  }
  .exam-brief-facts > div {
    padding: 10px 0;
  }
  .exam-brief-syllabus > header h3 {
    font-size: 24px;
  }
  .brief-subject li {
    font-size: 14px;
  }
}
@media (max-width: 360px) {
  .auth-layout {
    width: calc(100% - 24px);
  }
  .auth-masthead {
    margin: 0 16px;
  }
  body #login-screen .login-card {
    padding: 22px 18px 18px;
  }
  .auth-intro h1 {
    font-size: 30px;
  }
}

/* A pocket-notebook login: decoration stays behind the direct, single-step form. */
@media (max-width: 680px) {
  body #login-screen {
    --auth-paper: #fffefa;
    --auth-edge: #deceed;
    --auth-line: #cbb9de;
    --auth-wash: #f0e8f8;
    --auth-grid: #7956b20d;
    background-color: #f6f3ef;
    background-image:
      radial-gradient(var(--auth-grid) 0.8px, transparent 0.8px),
      radial-gradient(ellipse at 0 18%, #e9ddf58c, transparent 65%);
    background-size:
      18px 18px,
      100% 100%;
  }
  body:not(.light-mode) #login-screen {
    --auth-paper: #192629;
    --auth-edge: #324f46;
    --auth-line: #49695e;
    --auth-wash: #253d35;
    --auth-grid: #8bd5be10;
    background-color: #111719;
    background-image:
      radial-gradient(var(--auth-grid) 0.8px, transparent 0.8px),
      radial-gradient(ellipse at 0 18%, #284e3938, transparent 65%);
    background-size:
      18px 18px,
      100% 100%;
  }
  body:not(.light-mode) .auth-masthead {
    border-bottom: 0;
  }
  .auth-intro h1 {
    line-height: 1.3;
  }
  body:not(.light-mode) .auth-intro::before {
    display: none;
  }
  body #login-screen .login-card,
  body:not(.light-mode) #login-screen .login-card {
    background: var(--auth-paper);
    border: 1px solid var(--auth-line);
    border-radius: 24px 24px 24px 8px;
    box-shadow: 4px 5px 0 var(--auth-edge);
    gap: 18px;
  }
  .login-card::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 7px;
    top: -4px;
    left: 24px;
    border: 1px solid var(--auth-line);
    border-radius: 3px;
    background: var(--auth-wash);
    box-shadow:
      36px 0 0 -1px var(--auth-wash),
      36px 0 0 var(--auth-line);
    pointer-events: none;
  }
  .login-intro {
    position: relative;
    padding: 0 48px 15px 0;
    border-bottom: 1px dashed var(--auth-line);
  }
  .auth-pocket-mark {
    display: block;
    position: absolute;
    right: 0;
    top: -3px;
    width: 44px;
    height: 44px;
    color: var(--accent);
    pointer-events: none;
  }
  .auth-mark-paper {
    fill: var(--auth-paper);
  }
  body #login-screen .login-input {
    border-color: var(--auth-line);
    background: #fcfaff;
  }
  body:not(.light-mode) #login-screen .login-input {
    border-color: #405951;
    background: #121e20;
  }
  body #login-screen .login-btn {
    min-height: 52px;
    border-radius: 14px !important;
    box-shadow: 0 3px 0 #5c4089;
  }
  body:not(.light-mode) #login-screen .login-btn {
    box-shadow: 0 3px 0 #507e6d;
  }
  #login-screen .login-btn::after {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #ffffff1c;
    color: inherit;
    font-size: 20px;
    pointer-events: none;
  }
  body:not(.light-mode) #login-screen .login-btn::after {
    background: #102c2414;
  }
  #login-screen .login-btn:active {
    box-shadow: none;
  }
  .auth-help {
    padding-top: 12px;
    border-top: 1px dashed var(--auth-line);
    margin-top: 0;
  }
  #login-screen > .login-footer {
    border-top: 0;
  }
}
/* Keep breathing room below Sign in on short phones; decoration never costs a step. */
@media (max-width: 680px) and (max-height: 650px) {
  .auth-masthead {
    min-height: 64px;
  }
  .auth-layout {
    margin-top: 16px;
    gap: 16px;
  }
  body #login-screen .login-card,
  body:not(.light-mode) #login-screen .login-card {
    gap: 16px;
  }
}
@media (max-width: 680px) {
  body #login-screen .login-btn {
    transform: none;
    transition: background-color 0.12s;
  }
}
