:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-light: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1677ff;
  --primary-light: #2563eb;
  --primary-soft: rgba(22, 119, 255, 0.1);
  --accent: #16a34a;
  --border: #e2e8f0;
  --error: #dc2626;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: block;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}

.account-chip-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.account-chip-status.free {
  background: rgba(22, 119, 255, 0.1);
  color: #1d4ed8;
}

.account-chip-status.vip {
  background: linear-gradient(135deg,#f59e0b,#f97316);
  color: #fff;
}

.account-chip-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.account-chip-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.1;
}

.account-chip-sub {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.primary {
  background: var(--primary);
  color: white;
}

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

.ghost.danger {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.5);
}

.manage-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--panel-light);
}

.school-manage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.manage-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.manage-select-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-light);
}

.manage-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.manage-select-panel select {
  width: 100%;
}

.course-manage-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.course-manage-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.course-manage-card.archived {
  opacity: 0.78;
}

.archived-courses {
  margin-top: 10px;
}

.archived-courses summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pill.mini {
  font-size: 10px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manage-row.sub {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

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

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

.manage-actions.stacked {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  margin-top: 12px;
}

.manage-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

@media (max-width: 960px) {
  .manage-selector-grid {
    grid-template-columns: 1fr;
  }
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 70px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 22px;
  background: #ffffff;
}

  

.nav {
  margin-top: 18px;
  display: grid;
  gap: 6px;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  display: block;
}

.nav-link.active,
.nav-link:hover {
  background: var(--panel-light);
  color: var(--text);
}

.sidebar-card {
  margin-top: 18px;
  background: var(--panel);
  padding: 14px;
  border-radius: 12px;
  display: grid;
  gap: 10px;
}

.card-title {
  font-weight: 700;
}

.tag {
  background: var(--panel-light);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.content {
  padding: 28px;
}

.section {
  margin-bottom: 30px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: stretch;
  background: linear-gradient(120deg, rgba(22, 119, 255, 0.11), rgba(22, 163, 74, 0.08));
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.hero-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-line1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.hero-line2 {
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.hero-continue-btn {
  font-size: 14px;
  padding: 10px 18px;
  border-color: var(--primary);
  color: var(--primary-light);
}

.hero-continue-btn:hover {
  background: var(--primary-soft);
}

.hero-continue-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.hero-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
}

.course-progress-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.course-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.course-progress-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.course-progress-pct {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.course-progress-bar {
  height: 5px;
  background: var(--panel-light);
  border-radius: 99px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #6ee7b7);
  transition: width 0.4s ease;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.metric {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  margin: 6px 0;
}

.metric-sub {
  font-size: 12px;
  color: var(--accent);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

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

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

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

.pill {
  background: var(--primary-soft);
  color: var(--primary-light);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

input,
select {
  background: var(--panel-light);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 10px;
  color: var(--text);
}

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

.card.selectable {
  transition: transform 0.2s ease, border 0.2s ease;
  cursor: pointer;
}

.card.selectable.selected {
  border-color: var(--primary);
  transform: translateY(-2px);
}

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

.mistake-list {
  display: grid;
  gap: 12px;
}

.mistake-item,
.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--panel-light);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.mistake-title,
.review-title {
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 8px;
}

.upload-box {
  border: 1px dashed var(--border);
  padding: 18px;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  text-align: center;
  color: var(--muted);
}

.login-card {
  max-width: 420px;
  margin: 40px auto 20px;
  background: var(--panel);
  border-radius: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.login-hint {
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

  

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.modal.open {
  display: flex;
}
.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: min(520px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-content.wide {
  width: min(760px, 96vw);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--text); }

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.account-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.account-plan-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 800;
}

.account-plan-badge.free {
  background: rgba(22, 119, 255, 0.1);
  color: #1d4ed8;
}

.account-plan-badge.vip {
  background: linear-gradient(135deg,#f59e0b,#f97316);
  color: #fff;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.account-summary-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-light);
  padding: 12px;
}

.account-summary-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.account-summary-value {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.account-permissions {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-light);
}

.account-permissions-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.permission-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(39, 49, 80, 0.7);
  font-size: 13px;
}

.permission-row:first-child {
  border-top: none;
  padding-top: 0;
}

.permission-value {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.account-practice-notice,
.session-limit-notice {
  margin-top: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.1);
  color: #1e40af;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.account-practice-notice.vip,
.session-limit-notice.vip {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
}

/* ── Tab switcher (auth modal) ───────────────────────────────────────────── */
.tab-switcher {
  display: flex;
  gap: 2px;
  background: var(--panel-light);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--primary);
  color: white;
}

/* ── Flashcard flip ──────────────────────────────────────────────────────── */
.question-card {
  perspective: 1000px;
  min-height: 200px;
  margin: 16px 0;
}
.card-inner {
  position: relative;
  width: 100%;
  min-height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}
.question-card.flipped .card-inner {
  transform: rotateY(180deg);
}
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.card-back {
  transform: rotateY(180deg);
}
.card-face h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.card-face p {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
}
.flip-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

/* ── MCQ options ─────────────────────────────────────────────────────────── */
.answer-options {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-light);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option-label:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option-label input[type="radio"] {
  display: none;
}
.option-label.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.option-label.selected .option-letter {
  background: var(--primary);
  color: white;
}

/* ── Short / Long answer input ───────────────────────────────────────────── */
.answer-input {
  width: 100%;
  margin: 16px 0 8px;
  padding: 12px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.answer-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Feedback box ────────────────────────────────────────────────────────── */
.feedback-box {
  padding: 14px 16px;
  border-radius: 12px;
  border-left: 4px solid;
  margin: 10px 0;
  display: none;
  white-space: pre-wrap;
}
.feedback-box.visible { display: block; }
.feedback-box.correct {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}
.feedback-box.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.feedback-box.partial {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
.feedback-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.feedback-box.correct .feedback-label  { color: var(--accent); }
.feedback-box.incorrect .feedback-label { color: #ef4444; }
.feedback-box.partial .feedback-label   { color: #f59e0b; }

/* ── Session progress bar + timer ────────────────────────────────────────── */
.session-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--panel-light);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.4s ease;
  width: 0%;
}
.countdown-timer {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  min-width: 50px;
  text-align: right;
}
.countdown-timer.urgent { color: #ef4444; }
.progress-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 60px;
  text-align: right;
}

/* ── Results summary ─────────────────────────────────────────────────────── */
.results-score {
  text-align: center;
  padding: 20px 0;
}
.score-big {
  font-size: 56px;
  font-weight: 800;
  color: var(--accent);
}
.score-label {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.result-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.result-card .rval {
  font-size: 22px;
  font-weight: 700;
}
.result-card .rlbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Stat bar (study report) ─────────────────────────────────────────────── */
.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-bar-label {
  width: 100px;
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}
.stat-bar {
  flex: 1;
  height: 8px;
  background: var(--panel-light);
  border-radius: 999px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.stat-bar-pct {
  font-size: 12px;
  color: var(--text);
  min-width: 36px;
  text-align: right;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

/* ── Material & job items ────────────────────────────────────────────────── */
.material-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel-light);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.material-name { font-weight: 600; font-size: 13px; }
.material-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.job-status {
  padding: 14px;
  border-radius: 12px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

/* ── Type count row (generation config) ──────────────────────────────────── */
.type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.type-row:last-child { border-bottom: none; }
.type-row span { flex: 1; font-size: 13px; color: var(--text); }
.type-count {
  width: 60px;
  padding: 5px 8px;
  text-align: center;
  font-size: 13px;
}

/* ── Review question card ────────────────────────────────────────────────── */
.review-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.review-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-light);
}
.review-difficulty {
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}
.review-question { font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.review-answer { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.review-rationale { font-size: 12px; color: var(--muted); font-style: italic; }
.editable-field {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  outline: none;
  transition: border-color 0.15s;
  background: transparent;
  color: inherit;
  font: inherit;
  width: 100%;
}
.editable-field:focus { border-color: var(--primary); background: var(--panel); }

/* ── Sidebar section list ────────────────────────────────────────────────── */
.course-group { margin-bottom: 14px; }
.course-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 4px 6px;
  margin-bottom: 4px;
}
.section-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.section-link:hover, .section-link.active {
  background: var(--panel-light);
  color: var(--text);
}
.section-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary-light);
}

/* ── Mistake filter bar ──────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-bar select {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── No-content placeholder ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 14px;
}

/* ── Session-modal-specific overrides ────────────────────────────────────── */
#session-modal .modal-content {
  width: min(640px, 96vw);
}
.question-prompt {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin: 8px 0 4px;
  white-space: pre-wrap;
}
.question-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.q-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-light);
}

/* ── Upload drag highlight ────────────────────────────────────────────────── */
.upload-box.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 70px;
    z-index: 5;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

/* ── Topbar search ─────────────────────────────────────────────────────── */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  position: relative;
}

.topbar-search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  width: 100%;
  outline: none;
}

.topbar-search input::placeholder {
  color: var(--muted);
}

.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ── Search dropdown ───────────────────────────────────────────────────── */
.search-dropdown {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.14);
  z-index: 100;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}

.search-dropdown.hidden { display: none; }

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover { background: var(--panel-light); }

.search-result-title {
  font-size: 13px;
  font-weight: 600;
}

.search-result-sub {
  font-size: 11px;
  color: var(--muted);
}

.search-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── University accordion in sidebar ──────────────────────────────────── */
.uni-item { margin-bottom: 4px; }

.uni-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--panel-light);
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s;
}

.uni-toggle:hover { background: rgba(99,102,241,0.15); }

.uni-toggle-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
}

.uni-item.open .uni-toggle-arrow { transform: rotate(90deg); }

.uni-sections {
  display: none;
  padding: 4px 0 4px 8px;
}

.uni-item.open .uni-sections { display: block; }

/* ── Add / Remove course buttons ──────────────────────────────────────── */
.uni-add-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.uni-add-btn:hover {
  background: var(--primary);
  color: white;
}

.uni-add-btn.added {
  border-color: #22c55e;
  color: #22c55e;
}

.uni-add-btn.added:hover {
  background: rgba(239,68,68,0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.my-course-remove {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}

.my-course-remove:hover { color: #ef4444; }

.search-result-item {
  display: flex;
  align-items: center;
}

/* ── Browse by University topbar button ───────────────────────────────── */
.uni-browse-wrap {
  position: relative;
}

.uni-browse-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}

.uni-browse-btn:hover {
  border-color: var(--primary);
  background: var(--panel-light);
}

.uni-browse-btn.open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.uni-browse-arrow {
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.2s;
}

.uni-browse-btn.open .uni-browse-arrow {
  transform: rotate(180deg);
}

.uni-browse-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.14);
  z-index: 200;
  padding: 8px;
}

.uni-browse-panel.hidden { display: none; }

/* ── My Courses card ──────────────────────────────────────────────────── */
.my-course-item {
  background: var(--panel-light);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.my-course-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.my-course-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.my-course-name {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-course-sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 4px;
  border-left: 2px solid var(--border);
}

/* ── Bulk action toolbar ──────────────────────────────────────────────── */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bulk-count {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}

.bulk-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Session close (X) button ─────────────────────────────────────────── */
.session-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  margin-left: 8px;
  flex-shrink: 0;
}
.session-close-btn:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}

/* ── Star button ──────────────────────────────────────────────────────── */
.star-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.15s;
  margin-right: auto;
}
.star-btn:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}
.star-btn.starred {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245,158,11,0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Course-centric navigation — new styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar: flat course list items ─────────────────────────────────── */
.course-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.course-list-item:hover {
  background: var(--panel-light);
}

.course-list-item.active {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  padding-left: 7px;
}

.course-list-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.course-list-uni {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.course-list-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ── Dashboard course cards grid ─────────────────────────────────────── */
.dash-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.dash-course-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.dash-course-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.15);
}

.dash-course-uni {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.dash-course-code {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.dash-course-name {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.dash-course-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 16px;
  color: var(--muted);
  transition: color 0.15s, transform 0.15s;
}

.dash-course-card:hover .dash-course-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* ── Course Home: header ─────────────────────────────────────────────── */
.course-home-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.course-back-btn {
  font-size: 13px;
  padding: 7px 14px;
  flex-shrink: 0;
}

.course-home-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.course-home-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Course Home: sub-tabs ───────────────────────────────────────────── */
.course-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--panel);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.course-tab {
  flex: 1;
  min-width: fit-content;
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.course-tab:hover {
  background: var(--panel-light);
  color: var(--text);
}

.course-tab.active {
  background: var(--primary);
  color: white;
}

/* ── Course tab content ──────────────────────────────────────────────── */
.course-tab-content {
  display: block;
}

.course-tab-content.hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Quercus-style sidebar accordion
   ═══════════════════════════════════════════════════════════════════════════ */

/* "My Courses" section header in sidebar */
.sidebar-courses-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 18px 4px 8px;
}

/* One course block (row + module list) */
.qc-course-block {
  margin-bottom: 2px;
}

/* Course header row */
.qc-course-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.qc-course-row:hover {
  background: var(--panel-light);
}

.qc-course-row.open {
  background: var(--panel-light);
  border-radius: 10px 10px 0 0;
}

.qc-course-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.qc-course-uni {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qc-course-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.qc-course-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.qc-chevron {
  font-size: 11px;
  color: var(--muted);
  width: 16px;
  text-align: center;
  transition: color 0.15s;
}

.qc-course-row:hover .qc-chevron { color: var(--text); }

.qc-remove-btn {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.qc-course-row:hover .qc-remove-btn {
  color: var(--muted);
}

.qc-remove-btn:hover {
  color: #ef4444 !important;
  background: rgba(239,68,68,0.1);
}

/* Module list (shown when course is open) */
.qc-module-list {
  background: var(--panel-light);
  border-radius: 0 0 10px 10px;
  padding: 4px 0 6px 0;
  margin-bottom: 4px;
}

.qc-module-list.hidden {
  display: none;
}

/* Individual module button (like Quercus nav items) */
.qc-module-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 14px 8px 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-left: 3px solid transparent;
}

.qc-module-btn:hover {
  background: var(--primary-soft);
  color: var(--text);
}

.qc-module-btn.active {
  background: var(--primary-soft);
  color: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 600;
}

.qc-module-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mistake Book — expandable cards
   ═══════════════════════════════════════════════════════════════════════════ */

.mb-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.mb-card:hover {
  border-color: rgba(99,102,241,0.4);
}

/* Collapsed header */
.mb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}

.mb-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.mb-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary-light);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mb-question-preview {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mb-section-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.mb-chevron {
  font-size: 12px;
  color: var(--muted);
  width: 14px;
  text-align: center;
  transition: color 0.15s;
}

.mb-header:hover .mb-chevron { color: var(--text); }

/* Expanded detail */
.mb-detail {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.mb-detail.hidden { display: none; }

.mb-full-question {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 14px 0 12px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Text answer rows (short/long) */
.mb-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  align-items: start;
}

.mb-row-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.mb-row-value {
  line-height: 1.5;
}

.wrong-text  { color: #dc2626; }
.correct-text { color: #15803d; }

/* MCQ options in mistake detail */
.mb-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.mb-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.mb-option.correct {
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
  color: var(--text);
}

.mb-option.wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,0.08);
  color: var(--text);
}

.mb-option-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--panel-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.mb-option.correct .mb-option-letter { background: #22c55e; color: white; }
.mb-option.wrong   .mb-option-letter { background: #ef4444; color: white; }

.mb-option-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.correct-tag { color: #15803d; }
.wrong-tag   { color: #dc2626; }

/* AI feedback block */
.mb-feedback {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

.mb-feedback-icon { flex-shrink: 0; }

/* Resolve button row */
.mb-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Past Tests — admin panel rows
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--panel-light);
  transition: border-color 0.15s;
}

.pt-admin-row:hover { border-color: rgba(99,102,241,0.35); }

.pt-admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.pt-admin-icon { font-size: 22px; flex-shrink: 0; }

.pt-admin-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-admin-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.pt-admin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Past Tests — student card
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-student-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pt-student-card:hover {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 4px 16px rgba(99,102,241,0.1);
}

.pt-student-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.pt-student-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.pt-student-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.pt-student-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.pt-student-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.course-limit-note {
  margin: 4px 2px 8px;
  padding: 7px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.dash-add-course-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.uni-add-btn.limit-reached {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Practice type cards with progress
   ═══════════════════════════════════════════════════════════════════════════ */

.practice-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.practice-type-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  user-select: none;
}

.practice-type-card:hover {
  border-color: rgba(99,102,241,0.5);
  transform: translateY(-1px);
}

.practice-type-card.selected {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
}

/* Top row: icon + name + checkmark */
.ptc-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.ptc-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-light);
  border-radius: 10px;
}

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

.ptc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.ptc-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.ptc-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ptc-check.hidden { display: none; }

/* Progress bar */
.ptc-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ptc-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--panel-light);
  border-radius: 99px;
  overflow: hidden;
}

.ptc-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #6ee7b7);
  transition: width 0.5s ease;
}

.ptc-progress-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Continue button */
.ptc-resume-btn {
  width: 100%;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.ptc-resume-btn:hover {
  background: rgba(99,102,241,0.2);
}

.ptc-resume-btn.hidden { display: none; }

/* Mock Exam — full paper view */
.mock-paper-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.mock-paper-instructions {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-light);
}

.mock-paper-sheet {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.mock-paper-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.mock-paper-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-light);
}

.mock-paper-section-head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}

.mock-paper-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.mock-paper-section-head span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.mock-paper-question {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.mock-paper-question:last-child {
  border-bottom: 0;
}

.mock-paper-question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--text);
}

.mock-paper-question-head span {
  font-size: 12px;
  color: var(--muted);
}

.mock-paper-question-text {
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 12px;
}

.mock-paper-options {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.mock-paper-options li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  line-height: 1.55;
}

.mock-paper-option-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mock-paper-answer-space {
  min-height: 74px;
  margin-top: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.mock-paper-answer {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.08);
  color: var(--text);
  line-height: 1.6;
}

.mock-paper-answer-label {
  font-size: 11px;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.mock-paper-rationale {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.section-intro {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  background: rgba(99,102,241,0.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Aceology final design system
   Based on the selected reference screens.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy: #0f1e3a;
  --navy-2: #13294b;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #d4a373;
  --orange: #f28a18;
  --success: #16a34a;
  --danger: #dc2626;
  --text: #0f172a;
  --muted: #64748b;
  --secondary: #475569;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-light: #f8fafc;
  --primary: var(--blue);
  --primary-light: var(--blue);
  --primary-soft: rgba(37, 99, 235, 0.09);
  --accent: var(--success);
  --error: var(--danger);
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.05), transparent 30%),
    var(--bg);
}

.topbar {
  min-height: 56px;
  padding: 10px 22px;
  background: var(--navy);
  border-bottom: 0;
  box-shadow: 0 8px 24px rgba(15, 30, 58, 0.14);
}

.brand-title,
.topbar .brand-title {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.brand-subtitle,
.topbar .brand-subtitle {
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  line-height: 1.2;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 3px;
  box-shadow: none;
}

.topbar-search {
  max-width: 430px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 13px;
}

.topbar-search input,
.topbar-search svg {
  color: #fff !important;
}

.topbar-search input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.topbar-search:focus-within {
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.uni-browse-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 999px;
  padding: 7px 13px;
}

.uni-browse-btn:hover,
.uni-browse-btn.open {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
}

.uni-browse-arrow {
  color: rgba(255, 255, 255, 0.7);
}

.topbar .ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.account-chip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.account-chip-sub {
  color: rgba(255, 255, 255, 0.65);
}

.account-chip-status.free {
  background: var(--orange);
  color: #fff;
}

.layout {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  background: #fff;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
}

.nav {
  margin-top: 0;
}

.nav-link,
.qc-module-btn,
.section-link {
  border-radius: 8px;
  color: var(--secondary);
  font-size: 13px;
}

.nav-link.active,
.nav-link:hover,
.qc-module-btn.active,
.qc-module-btn:hover,
.section-link.active,
.section-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.qc-module-btn.active {
  border-left-color: transparent;
  font-weight: 700;
}

.sidebar-courses-header,
.course-group-title {
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
  font-weight: 700;
}

.content {
  padding: 28px 30px;
}

.panel,
.card,
.login-card,
.modal-content,
.dash-course-card,
.practice-type-card,
.mock-paper-section,
.mb-card,
.review-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.hero {
  grid-template-columns: 1.15fr 0.85fr;
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.hero-line1 {
  font-size: 21px;
  line-height: 1.35;
}

.hero-line2 {
  font-size: 14px;
  color: var(--secondary);
}

.hero .primary,
#continueBtn,
#submitAnswerBtn,
#nextQuestionBtn,
#finishSessionBtn,
#mockExamSubmitBtn,
#mockExamNextBtn,
#mockExamFinishBtn {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.primary {
  border: 1px solid var(--blue);
  background: var(--blue);
}

.ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--navy);
}

.ghost:hover,
.primary:hover {
  filter: brightness(0.98);
}

.course-progress-bar,
.progress-bar,
.ptc-progress-bar,
.stat-bar {
  background: #e8eef7;
}

.course-progress-fill,
.progress-fill,
.ptc-progress-fill,
.stat-bar-fill {
  background: var(--blue);
}

.metric {
  background: var(--panel-light);
  border-radius: 10px;
}

.metric-value,
.stat-value,
.score-big {
  color: var(--navy);
}

.dash-course-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.dash-course-card {
  min-height: 118px;
  padding: 14px;
}

.dash-course-card:hover {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.1);
}

.dash-course-code {
  font-size: 15px;
}

.dash-course-name,
.dash-course-uni,
.course-progress-pct,
.material-meta,
.review-answer,
.review-rationale {
  color: var(--secondary);
}

.course-home-header {
  border-bottom: 0;
  padding-bottom: 4px;
}

.course-tabs {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0;
  gap: 18px;
}

.course-tab {
  flex: 0 0 auto;
  border-radius: 0;
  padding: 11px 0;
  border-bottom: 2px solid transparent;
}

.course-tab:hover,
.course-tab.active {
  background: transparent;
  color: var(--blue);
  border-bottom-color: var(--blue);
}

input,
select,
textarea,
.answer-input {
  background: #fff;
  border-color: var(--border);
  border-radius: 8px;
}

input:focus,
select:focus,
textarea:focus,
.answer-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-bar select,
.topbar select {
  min-height: 34px;
}

.mistake-list {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.mb-card,
.mistake-item,
.review-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.mb-card:last-child,
.mistake-item:last-child,
.review-item:last-child {
  border-bottom: 0;
}

.mb-header {
  min-height: 52px;
  padding: 12px 16px;
}

.mb-type-badge,
.q-badge,
.review-type-badge,
.badge,
.pill {
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 6px;
}

.q-badge[style*="34,197,94"],
.q-badge[style*="245,158,11"] {
  color: inherit;
}

.question-prompt {
  margin-top: 18px;
  font-size: 18px;
  color: var(--navy);
}

.option-label {
  background: #f8fafc;
  border-radius: 8px;
  min-height: 52px;
}

.option-label:hover,
.option-label.selected {
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, 0.35);
}

.option-letter,
.mock-paper-option-letter {
  background: #fff;
  color: var(--navy);
}

.feedback-box,
#correctAnswerBox > div,
.mb-feedback {
  border-radius: 8px !important;
}

.feedback-box.correct,
.mock-paper-answer,
.mb-option.correct {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.26);
}

.feedback-box.incorrect,
.mb-option.wrong {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.22);
}

.wrong-text,
.wrong-tag,
.feedback-box.incorrect .feedback-label {
  color: var(--danger);
}

.correct-text,
.correct-tag,
.feedback-box.correct .feedback-label,
.mock-paper-answer-label {
  color: var(--success);
}

.modal {
  background: rgba(15, 23, 42, 0.42);
}

.modal-content {
  border-radius: 12px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.2);
}

#session-modal,
#mock-exam-modal {
  width: min(980px, 96vw);
}

.session-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.star-btn {
  background: #fff;
}

.mock-paper-title {
  font-size: 24px;
  color: var(--navy);
}

.mock-paper-instructions {
  background: var(--blue-soft);
  color: var(--navy);
  border-color: #dbeafe;
  padding: 16px;
  border-radius: 8px;
}

.mock-paper-section {
  box-shadow: none;
  overflow: hidden;
}

.mock-paper-section-head {
  background: #fff;
  padding: 16px 18px;
}

.mock-paper-section-head h3 {
  font-size: 15px;
}

.mock-paper-question {
  background: #fff;
}

.mock-paper-answer-space {
  background: #fff;
  min-height: 70px;
}

.practice-type-card {
  border-width: 1px;
}

.practice-type-card:hover,
.practice-type-card.selected {
  border-color: rgba(37, 99, 235, 0.42);
  background: #fff;
}

.ptc-icon {
  background: var(--blue-soft);
}

.ptc-resume-btn {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.account-practice-notice,
.session-limit-notice,
.section-intro {
  background: var(--blue-soft);
  border-color: #dbeafe;
  color: var(--navy);
}

.search-dropdown,
.uni-browse-panel {
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.toast {
  background: var(--navy);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-search {
    order: 10;
    max-width: none;
    flex-basis: 100%;
    margin: 0;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: 18px;
  }

  .hero,
  .practice-type-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }
}

.topbar-search:focus-within,
.uni-browse-btn.open,
.practice-type-card:focus-within,
.answer-input:focus,
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.uni-toggle:hover,
.ptc-resume-btn:hover,
.section-intro,
.mb-feedback {
  background: var(--blue-soft);
}

.practice-type-card:hover,
.pt-admin-row:hover,
.mock-admin-question-row:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

/* Final pass: match selected Aceology reference more closely. */

.primary,
button.primary,
.hero .primary,
#heroStartBtn,
#requestCourseBtn,
#loadReviewBtn,
#refreshMistakesBtn,
#closeResultsBtn,
#mockExamAbandonBtn,
#mockExamSubmitBtn,
#mockExamNextBtn,
#mockExamFinishBtn,
.ptc-resume-btn,
.uni-add-btn:hover,
.tab-btn.active {
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  color: var(--blue);
  box-shadow: none;
}

.primary:hover,
button.primary:hover,
.ptc-resume-btn:hover,
.topbar-signin-btn:hover {
  background: #cfe3ff;
  border-color: #93c5fd;
  color: var(--blue);
  filter: none;
}

#submitAnswerBtn,
#nextQuestionBtn,
#finishSessionBtn,
#fcYes[style*="background:var(--primary)"],
#fcNo[style*="background:var(--primary)"] {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: #fff !important;
}

#mockExamNextBtn,
#mockExamFinishBtn {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.topbar-actions {
  min-width: 180px;
  justify-content: flex-end;
}

.topbar-signin-btn {
  min-width: 112px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: #dbeafe;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.account-chip {
  border-radius: 12px;
  padding: 7px 12px;
}

.account-chip-status.vip {
  background: var(--orange);
  color: #fff;
}

.layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 10px;
}

.sidebar .nav {
  padding: 0 10px;
  margin-bottom: 22px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  font-weight: 700;
}

.sidebar-courses-header {
  padding: 0 14px 10px;
  color: #64748b;
}

.qc-course-block {
  margin: 0 0 8px;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.qc-course-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 4px 10px;
  cursor: pointer;
}

.qc-course-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.qc-course-uni {
  max-width: 170px;
  overflow: hidden;
  color: #8090a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qc-course-code {
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.qc-course-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qc-chevron {
  color: #8090a8;
  font-size: 12px;
  line-height: 1;
}

.qc-remove-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
}

.qc-course-row:hover .qc-remove-btn {
  color: #94a3b8;
}

.qc-module-list {
  display: grid;
  gap: 4px;
}

.qc-module-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.qc-module-btn.active,
.qc-module-btn:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.qc-module-icon {
  width: 22px;
  text-align: center;
}

.course-home-header {
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}

.course-back-btn {
  border-color: #dbeafe;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.course-home-title {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.course-home-sub {
  font-size: 14px;
  font-weight: 600;
}

.course-tabs {
  margin-bottom: 24px;
}

.course-tab {
  font-size: 16px;
  font-weight: 900;
}

.course-tab.active {
  color: var(--blue);
}

#tab-practice > .panel:first-child {
  padding: 22px;
  border-radius: 12px;
}

#tab-practice .form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

#practiceSection {
  min-height: 48px;
  font-size: 16px;
}

#practiceAccountNotice {
  border-color: rgba(212, 163, 115, 0.55);
  background: rgba(212, 163, 115, 0.12);
  color: #92400e;
  font-weight: 700;
}

.practice-type-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.practice-type-card {
  min-height: 168px;
  padding: 22px 24px;
  border-radius: 12px;
}

.ptc-top {
  margin-bottom: 22px;
}

.ptc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.ptc-name {
  font-size: 18px;
  color: var(--navy);
}

.ptc-desc {
  font-size: 13px;
  font-weight: 600;
}

.ptc-progress-wrap {
  margin-bottom: 14px;
}

.ptc-progress-bar {
  height: 7px;
}

.ptc-resume-btn {
  min-height: 38px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.ptc-resume-btn::before {
  content: "▶ ";
}

.topbar .ghost,
.topbar .primary {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: var(--blue);
}

@media (max-width: 900px) {
  .topbar-actions {
    min-width: 0;
  }

  .topbar-signin-btn {
    min-width: 96px;
  }

  #tab-practice .form {
    grid-template-columns: 1fr;
  }
}

/* Dashboard reference reconstruction + PDF preview */

.app {
  min-height: 100vh;
}

.layout {
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  padding: 28px 22px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 28px;
}

.sidebar-footer-link {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.sidebar-footer-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  text-align: left;
}

.sidebar-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-soft);
  font-size: 22px;
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
}

.sidebar-profile strong {
  font-size: 16px;
  font-weight: 900;
}

.sidebar-profile small {
  margin-top: 2px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
}

.content {
  padding: 34px 48px 40px;
}

.dash-shell {
  max-width: 1120px;
}

.dash-welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.dash-welcome-row h1 {
  color: var(--navy);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dash-welcome-row p {
  margin-top: 8px;
  color: #33456f;
  font-size: 18px;
  font-weight: 600;
}

.dash-streak-card {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 82px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.dash-streak-card strong {
  color: var(--navy);
  font-size: 30px;
  line-height: 1;
}

.dash-streak-card span {
  font-size: 24px;
  margin-left: 8px;
}

.dash-streak-card small {
  grid-column: 1 / -1;
  margin-top: 8px;
  color: #33456f;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.dash-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 24px;
  margin-bottom: 18px;
}

.dash-panel {
  min-height: 250px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.dash-panel h2,
.dash-section-head h2,
.dash-recommend-card h2 {
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
}

.dash-continue-panel {
  display: flex;
  flex-direction: column;
}

#dashContinuePractice {
  flex: 1;
  padding-top: 30px;
}

.dash-continue-course-line {
  display: flex;
  align-items: baseline;
  gap: 28px;
  margin-bottom: 28px;
}

.dash-continue-course-line strong {
  color: var(--navy);
  font-size: 23px;
  font-weight: 900;
}

.dash-continue-course-line span,
.dash-continue-section-line {
  color: #33456f;
  font-size: 15px;
  font-weight: 700;
}

.dash-continue-section-line {
  margin-bottom: 26px;
}

.dash-continue-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
}

.dash-continue-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.dash-continue-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.dash-continue-progress-row strong {
  color: var(--navy);
  font-size: 22px;
}

.dash-continue-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 28px;
  border-radius: 8px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.dash-performance-panel {
  display: flex;
  flex-direction: column;
}

.dash-performance-panel h2 {
  margin-bottom: 28px;
}

.dash-perf-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  color: #33456f;
  font-size: 15px;
  font-weight: 600;
}

.dash-perf-row strong {
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
}

.dash-link-btn {
  align-self: flex-end;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
}

.dash-section-head {
  margin: 8px 0 14px;
}

.dash-course-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin-bottom: 18px;
}

.dash-course-card {
  min-height: 232px;
  padding: 22px;
  border-radius: 12px;
}

.dash-course-code {
  margin-bottom: 10px;
  font-size: 20px;
}

.dash-course-name,
.dash-course-uni,
.dash-course-prof,
.dash-course-mastery {
  color: #33456f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.dash-course-name,
.dash-course-uni,
.dash-course-prof {
  margin-bottom: 6px;
}

.dash-course-mastery {
  margin-top: 18px;
}

.dash-course-mini-bar {
  height: 4px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.dash-course-mini-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.dash-course-continue {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
}

.dash-add-course-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  border-style: dashed;
  color: #33456f;
}

.dash-add-course-card span {
  color: #33456f;
  font-size: 34px;
  line-height: 1;
}

.dash-add-course-card strong {
  font-size: 15px;
}

.dash-recommend-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  min-height: 86px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--blue-soft);
}

.dash-recommend-content {
  margin-top: 16px;
}

.dash-recommend-content strong,
.dash-recommend-content span {
  display: block;
}

.dash-recommend-content strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
}

.dash-recommend-content span {
  margin-top: 8px;
  color: #33456f;
  font-size: 14px;
  font-weight: 600;
}

.dash-recommend-btn {
  min-width: 226px;
  min-height: 44px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  background: #fff;
  color: #ea740c;
  font-size: 15px;
  font-weight: 900;
}

.dash-recommend-icon {
  font-size: 24px;
}

.pt-student-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pt-student-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pt-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.pdf-preview-content {
  width: min(1180px, 96vw);
  height: min(860px, 94vh);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.pdf-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.pdf-preview-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.pdf-preview-head p {
  margin: 4px 0 0;
  color: var(--secondary);
  font-size: 13px;
}

#pdfPreviewFrame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #f8fafc;
}

.pdf-preview-content .modal-close {
  top: 16px;
  right: 18px;
}

.upgrade-modal-content {
  width: min(980px, 94vw);
  max-height: 92vh;
  overflow: auto;
  padding: 0;
}

.upgrade-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
  gap: 0;
}

.upgrade-intro,
.upgrade-panel {
  padding: 34px;
}

.upgrade-intro {
  background: linear-gradient(145deg, #eff6ff 0%, #ffffff 62%);
  border-right: 1px solid var(--border);
}

.upgrade-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.upgrade-intro h2 {
  max-width: 420px;
  margin: 18px 0 12px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.upgrade-intro p {
  margin: 0;
  color: #33456f;
  font-size: 15px;
  line-height: 1.65;
}

.upgrade-benefits {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}

.upgrade-benefits div {
  padding: 14px;
  border: 1px solid #d7e6fb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.upgrade-benefits strong,
.upgrade-benefits span {
  display: block;
}

.upgrade-benefits strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
}

.upgrade-benefits span {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.45;
}

.upgrade-proof-note {
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.upgrade-section-title {
  margin: 4px 0 10px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.vip-plan-options,
.payment-method-tabs {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.vip-plan-options {
  grid-template-columns: 1fr 1fr;
}

.payment-method-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.vip-plan-option,
.payment-method-tab {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  font-weight: 900;
}

.payment-method-tab {
  text-align: center;
  font-size: 13px;
}

.vip-plan-option span {
  display: block;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.vip-plan-option.active,
.payment-method-tab.active {
  border-color: var(--blue);
  background: #eef6ff;
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.payment-panels {
  margin-bottom: 20px;
}

.payment-panel {
  display: none;
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.payment-panel.active {
  display: grid;
  place-items: center;
  gap: 12px;
}

.payment-panel p {
  max-width: 340px;
  margin: 0 auto;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.payment-qr-placeholder {
  width: 172px;
  height: 172px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  text-align: center;
}

.payment-qr-placeholder span {
  font-size: 16px;
  font-weight: 900;
}

.payment-qr-placeholder small {
  max-width: 130px;
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.35;
}

.payment-qr-card {
  width: min(260px, 100%);
  max-height: 360px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #fff;
}

.payment-qr-card img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 6px;
}

.emt-box {
  display: grid;
  place-items: center;
  gap: 10px;
  min-width: min(360px, 100%);
  padding: 22px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
}

.emt-box span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
}

.emt-box strong {
  color: var(--navy);
  font-size: 18px;
}

.vip-proof-form {
  display: grid;
  gap: 12px;
}

.vip-proof-form label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.vip-proof-form input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
}

.vip-submit-btn {
  min-height: 44px;
  margin-top: 4px;
}

.vip-proof-msg {
  min-height: 18px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
}

.account-menu-wrap {
  position: relative;
}

.account-menu-caret {
  color: #c7d2fe;
  font-size: 13px;
  font-weight: 900;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 80;
  width: 238px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.16);
}

.account-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 24px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: #fff;
}

.account-dropdown button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font-size: 15px;
  font-weight: 850;
  text-align: left;
}

.account-dropdown button:hover,
.account-dropdown button[data-account-action="subscription"] {
  background: #dbeafe;
  color: var(--blue);
}

.account-dropdown button strong {
  font-size: 15px;
}

.subscription-modal-content {
  width: min(1120px, 94vw);
  max-height: 92vh;
  overflow: auto;
  padding: 34px;
  background: #f8fafc;
}

.subscription-hero {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.subscription-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.subscription-hero h2 {
  margin: 14px 0 10px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.subscription-hero p {
  margin: 0;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.65;
}

.subscription-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.subscription-card {
  position: relative;
  min-height: 510px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.subscription-card.featured-plan {
  border-color: #0f3f3f;
  background: #315f5f;
  color: #fff;
  transform: translateY(-8px);
}

.subscription-card-head {
  text-align: center;
}

.subscription-card-head span,
.subscription-card-head strong {
  display: block;
}

.subscription-card-head span {
  color: var(--secondary);
  font-size: 14px;
  font-weight: 900;
}

.subscription-card-head strong {
  margin-top: 4px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1;
}

.featured-plan .subscription-card-head span,
.featured-plan .subscription-card-head strong {
  color: #fff;
}

.subscription-features {
  display: grid;
  gap: 13px;
  margin: 32px 0 28px;
  padding: 0;
  list-style: none;
}

.subscription-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.featured-plan .subscription-features li {
  color: #f8fafc;
}

.subscription-features li::before {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.subscription-features li.yes::before {
  content: "✓";
  background: #bbf7d0;
  color: #16a34a;
}

.subscription-features li.no {
  color: #94a3b8;
}

.subscription-features li.no::before {
  content: "×";
  background: #e2e8f0;
  color: #94a3b8;
}

.subscription-price {
  margin-top: auto;
  color: var(--navy);
  font-size: 28px;
  font-weight: 950;
  text-align: center;
}

.featured-plan .subscription-price {
  color: #fff;
}

.subscription-price span {
  color: inherit;
  font-size: 14px;
  font-weight: 800;
}

.subscription-card button {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
}

.featured-plan .subscription-choose-btn {
  background: #d9ff4f;
  color: #264646;
}

.subscription-current-btn:disabled {
  opacity: 1;
  color: var(--secondary);
  cursor: default;
}

.save-ribbon {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #d9ff4f;
  color: #264646;
  font-size: 12px;
  font-weight: 950;
}

.upgrade-cn,
.upgrade-proof-note small,
.upgrade-contact-line,
.payment-panel p small,
.vip-proof-form label small {
  display: block;
  margin-top: 5px;
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 750;
}

.upgrade-proof-note small {
  color: #9a3412;
}

.upgrade-contact-line {
  color: #9a3412;
}

.selected-payment-plan {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 18px;
  padding: 7px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
}

.rmb-price-chip,
.cad-price-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #ea580c;
  font-size: 13px;
  font-weight: 950;
}

.cad-price-chip {
  background: #eef6ff;
  color: var(--blue);
}

@media (max-width: 1100px) {
  .dash-top-grid,
  .dash-course-grid,
  .dash-recommend-card {
    grid-template-columns: 1fr;
  }

  .dash-streak-card {
    min-width: 108px;
  }

  .upgrade-layout {
    grid-template-columns: 1fr;
  }

  .subscription-plans {
    grid-template-columns: 1fr;
  }

  .subscription-card.featured-plan {
    transform: none;
  }

  .upgrade-intro {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 620px) {
  .upgrade-intro,
  .upgrade-panel {
    padding: 24px 18px;
  }

  .vip-plan-options,
  .payment-method-tabs {
    grid-template-columns: 1fr;
  }

  .upgrade-intro h2 {
    font-size: 25px;
  }

  .subscription-modal-content {
    padding: 24px 16px;
  }

  .subscription-hero h2 {
    font-size: 24px;
  }

  .subscription-card {
    min-height: auto;
    padding: 24px 18px;
  }
}

/* Final mobile override: keep the phone layout readable and prevent desktop
   dashboard/sidebar rules from forcing a two-column page. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app {
    width: 100%;
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
  }

  .brand {
    min-width: 0;
    gap: 9px;
  }

  .logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .brand-title,
  .topbar .brand-title {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  .brand-subtitle,
  .topbar .brand-subtitle {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .topbar-actions {
    min-width: 0;
    justify-content: flex-end;
  }

  .account-chip {
    max-width: 150px;
    min-height: 38px;
    padding: 6px 8px;
    gap: 6px;
    border-radius: 12px;
  }

  .account-chip-status {
    padding: 3px 7px;
    font-size: 10px;
  }

  .account-chip-name {
    max-width: 72px;
    font-size: 12px;
  }

  .account-chip-sub {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .account-dropdown {
    right: 0;
    width: min(230px, calc(100vw - 28px));
  }

  .uni-browse-wrap {
    grid-column: 1 / 2;
    grid-row: 2;
    min-width: 0;
  }

  .uni-browse-btn {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    padding: 8px 10px;
    font-size: 13px;
  }

  .topbar-search {
    grid-column: 1 / -1;
    grid-row: 3;
    order: initial;
    width: 100%;
    max-width: none;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
  }

  .topbar-search input {
    min-width: 0;
    font-size: 14px;
  }

  .search-dropdown,
  .uni-browse-panel {
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
  }

  .layout {
    width: 100%;
    min-height: auto;
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .content {
    order: 1;
    width: 100%;
    padding: 16px 14px 22px;
  }

  .sidebar {
    order: 2;
    width: 100%;
    min-height: auto;
    padding: 14px;
    border-right: 0;
    border-top: 1px solid var(--border);
    border-bottom: 0;
  }

  .sidebar .nav {
    display: none;
  }

  .sidebar-courses-header {
    margin: 0 0 10px;
    font-size: 13px;
  }

  #courseList {
    display: grid;
    gap: 10px;
  }

  .qc-course-block {
    margin-bottom: 0;
  }

  .qc-course-row {
    min-height: 64px;
    padding: 12px;
    border-radius: 12px;
  }

  .qc-course-uni {
    max-width: none;
    font-size: 11px;
  }

  .qc-course-code {
    font-size: 16px;
  }

  .qc-module-list {
    padding: 8px 4px 0;
  }

  .qc-module-btn {
    min-height: 38px;
    font-size: 13px;
  }

  .sidebar-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .sidebar-profile {
    min-height: 60px;
    margin-top: 8px;
  }

  .dash-shell {
    width: 100%;
    max-width: none;
  }

  .dash-welcome-row {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .dash-welcome-row > div:first-child {
    min-width: 0;
    flex: 1;
  }

  .dash-welcome-row h1 {
    font-size: 24px;
    line-height: 1.15;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .dash-welcome-row p {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.35;
  }

  .dash-streak-card {
    flex: 0 0 96px;
    min-width: 96px;
    min-height: 82px;
    padding: 12px 10px;
  }

  .dash-streak-card strong {
    font-size: 27px;
  }

  .dash-streak-card span {
    margin-left: 4px;
    font-size: 20px;
  }

  .dash-streak-card small {
    font-size: 12px;
  }

  .dash-top-grid,
  .dash-course-grid,
  .dash-recommend-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dash-panel {
    min-height: auto;
    padding: 18px 16px;
    border-radius: 12px;
  }

  .dash-panel h2,
  .dash-section-head h2,
  .dash-recommend-card h2 {
    font-size: 18px;
  }

  #dashContinuePractice {
    padding-top: 18px;
  }

  .dash-continue-course-line {
    display: grid;
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }

  .dash-continue-course-line strong {
    font-size: 22px;
  }

  .dash-continue-course-line span,
  .dash-continue-section-line {
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .dash-continue-section-line {
    margin-bottom: 18px;
  }

  .dash-continue-progress-row {
    gap: 12px;
  }

  .dash-continue-progress-row strong {
    font-size: 20px;
  }

  .dash-continue-btn {
    min-height: 46px;
    margin-top: 20px;
    font-size: 15px;
  }

  .dash-performance-panel h2 {
    margin-bottom: 14px;
  }

  .dash-perf-row {
    padding: 8px 0;
    font-size: 14px;
  }

  .dash-perf-row strong {
    font-size: 16px;
  }

  .dash-course-grid {
    margin-bottom: 14px;
  }

  .dash-course-card {
    min-height: auto;
    padding: 16px;
  }

  .dash-course-code {
    font-size: 19px;
  }

  .dash-course-name,
  .dash-course-uni,
  .dash-course-prof,
  .dash-course-mastery {
    font-size: 13px;
  }

  .dash-course-continue {
    min-height: 42px;
  }

  .dash-recommend-card {
    min-height: auto;
    padding: 16px;
  }

  .dash-recommend-content {
    margin-top: 10px;
  }

  .dash-recommend-btn {
    width: 100%;
    min-width: 0;
  }

  .dash-recommend-icon {
    display: none;
  }

  .course-home-header {
    display: grid;
    gap: 10px;
  }

  .course-home-title {
    font-size: 22px;
    line-height: 1.15;
  }

  .course-tabs {
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .course-tab {
    white-space: nowrap;
    font-size: 13px;
  }

  .practice-type-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .practice-type-card {
    min-height: auto;
    padding: 16px;
  }

  .modal-content,
  #session-modal,
  #mock-exam-modal {
    width: min(94vw, 520px);
    max-height: 88vh;
    padding: 18px;
  }
}

@media (max-width: 390px) {
  .brand-title,
  .topbar .brand-title {
    max-width: 150px;
  }

  .brand-subtitle,
  .topbar .brand-subtitle {
    max-width: 170px;
  }

  .account-chip {
    max-width: 132px;
  }

  .account-chip-name {
    max-width: 58px;
  }

  .dash-welcome-row h1 {
    font-size: 22px;
  }

  .dash-streak-card {
    flex-basis: 88px;
    min-width: 88px;
  }
}
