/* ============================================================
   IELTS Classroom — Global Stylesheet v3
   Full dark/light mode via CSS custom properties
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Brand */
  --brand:        #173f70;
  --brand-light:  #2a6ab5;
  --red:          #c8102e;
  --red-dark:     #a80d26;
  --gold:         #f9c74f;
  --green:        #1a7c3e;

  /* Light mode surfaces */
  --bg:           #f4f6f8;
  --surface:      #ffffff;
  --surface2:     #f8f9fb;
  --border:       #e4e7ec;
  --border2:      #d0d5dd;

  /* Light mode text */
  --text:         #17202a;
  --text2:        #344054;
  --text3:        #667085;

  /* Interactive */
  --hover-bg:     #eaf0fb;
  --input-focus:  #173f70;

  /* Passage reading */
  --passage-bg:   #ffffff;
  --passage-text: #1a1a2e;
  --passage-font-size: 15.5px;
  --passage-line-height: 1.9;

  /* Misc */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.05);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.10);
  --radius:       10px;
  --radius-lg:    14px;
}

[data-theme="dark"] {
  --bg:           #0f1117;
  --surface:      #1a1d27;
  --surface2:     #222636;
  --border:       #2e3347;
  --border2:      #3a4060;

  --text:         #e8eaf0;
  --text2:        #b0b8cc;
  --text3:        #7a8499;

  --hover-bg:     #1e2438;

  --passage-bg:   #1a1d27;
  --passage-text: #dde2ee;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--brand-light); }

.hidden { display: none !important; }

/* ── Theme toggle button ── */
.theme-toggle {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--hover-bg); border-color: var(--brand); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-ghost   { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: var(--hover-bg); opacity: 1; }
.btn-full { width: 100%; }
.btn-sm   { padding: 7px 14px; font-size: 13px; }

/* ── Tags / Pills ── */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.tag--open   { background: #e6f0fb; color: var(--brand); }
.tag--done   { background: #e6f9ed; color: var(--green); }
.tag--listen { background: #fff3e0; color: #b05e00; }

[data-theme="dark"] .tag--open   { background: #1e2d46; color: #7ab3f0; }
[data-theme="dark"] .tag--done   { background: #1a2e22; color: #5ecf85; }
[data-theme="dark"] .tag--listen { background: #2a2010; color: #e0a060; }

.band-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.band-pill--sm { padding: 2px 9px; font-size: 12px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 7px; font-size: 14px; margin-bottom: 18px; }
.alert--error { background: #fde8ec; color: #9b0d21; border: 1px solid #f5c2cb; }
[data-theme="dark"] .alert--error { background: #2d1018; color: #f08090; border-color: #5a1a26; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-bg {
  background: linear-gradient(145deg, #0d2b50 0%, #1a5090 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
}
.landing-wrapper {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
.landing-hero { text-align: center; color: #fff; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.5px; color: #fff; }
.hero-title .accent { color: var(--gold); }
.hero-sub { font-size: 1.05rem; color: rgba(255,255,255,0.75); margin-top: 12px; max-width: 500px; margin-inline: auto; }

.landing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; }
@media (max-width: 600px) { .landing-cards { grid-template-columns: 1fr; } }

.role-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
}
.role-card--teacher { border-top: 4px solid var(--red); }
.role-icon { font-size: 2.4rem; line-height: 1; }
.role-card h2 { font-size: 1.2rem; color: var(--brand); }
.role-card p { font-size: 13.5px; color: var(--text3); flex: 1; margin-bottom: 8px; }
.role-card .btn { width: 100%; }
.role-card .btn + .btn { margin-top: 4px; }

.landing-footer { color: rgba(255,255,255,0.45); font-size: 13px; text-align: center; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
body:not(.app-bg):not(.landing-bg):not(.test-body) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.back-link { display: inline-block; font-size: 13px; color: var(--text3); margin-bottom: 24px; }
.back-link:hover { color: var(--brand); }
.auth-logo { font-size: 2.4rem; margin-bottom: 10px; }
.auth-card h1 { font-size: 1.5rem; color: var(--brand); margin-bottom: 6px; }
.auth-sub { color: var(--text3); font-size: 14px; margin-bottom: 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text2); }
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border2);
  border-radius: 7px;
  font-size: 14.5px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--input-focus); }
.field-hint { display: block; font-size: 12px; color: var(--text3); margin-top: 5px; }
.auth-switch { margin-top: 22px; font-size: 13.5px; color: var(--text3); text-align: center; }
.auth-switch a { color: var(--brand); font-weight: 600; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { font-size: 1rem; font-weight: 800; color: var(--brand); letter-spacing: -0.3px; }
.topbar-badge { padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: #e6f0fb; color: var(--brand); }
.topbar-badge--teacher { background: #fde8ec; color: #9b0d21; }
[data-theme="dark"] .topbar-badge { background: #1e2d46; color: #7ab3f0; }
[data-theme="dark"] .topbar-badge--teacher { background: #2d1018; color: #f08090; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 13.5px; color: var(--text2); font-weight: 500; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.app-bg { background: var(--bg); }

.dash-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
@media (max-width: 700px) { .dash-layout { grid-template-columns: 1fr; } .dash-sidebar { display: none; } }

.dash-sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 0; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link {
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--hover-bg); color: var(--brand); text-decoration: none; }
.sidebar-link--active { border-left-color: var(--brand); background: var(--hover-bg); color: var(--brand); font-weight: 700; }

.dash-content { padding: 32px 28px; overflow-x: hidden; }
.dash-section-header { margin-bottom: 24px; }
.dash-section-header h1 { font-size: 1.5rem; color: var(--brand); }
.dash-section-header p  { color: var(--text3); font-size: 14px; margin-top: 4px; }

/* ============================================================
   STATS ROW
   ============================================================ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-val { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.stat-lbl { font-size: 12.5px; color: var(--text3); margin-top: 2px; }

/* ============================================================
   TEST CARDS
   ============================================================ */
.test-grid { display: flex; flex-direction: column; gap: 16px; }
.test-card2 {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.test-card2-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.colour-blue   { background: #e6f0fb; }
.colour-green  { background: #e6f9ed; }
.colour-orange { background: #fff3e0; }
.colour-purple { background: #f3e8ff; }
[data-theme="dark"] .colour-blue   { background: #1e2d46; }
[data-theme="dark"] .colour-green  { background: #1a2e22; }
[data-theme="dark"] .colour-orange { background: #2a2010; }
[data-theme="dark"] .colour-purple { background: #2a1a3a; }

.test-card2-body { flex: 1; min-width: 0; }
.test-card2-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.test-card2-top h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.test-card2-meta { font-size: 12.5px; color: var(--text3); margin-bottom: 4px; }
.test-card2-desc { font-size: 13.5px; color: var(--text2); }
.test-card2-action { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ============================================================
   RESULTS LIST
   ============================================================ */
.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
}
.result-icon { font-size: 1.3rem; }
.result-body { flex: 1; min-width: 0; }
.result-body strong { display: block; font-size: 14px; }
.result-meta { font-size: 12px; color: var(--text3); }
.result-score { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.score-detail { font-size: 12px; color: var(--text3); }

/* ============================================================
   ACCOUNT CARD
   ============================================================ */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 540px;
}
.account-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 1.6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.teacher-avatar { background: var(--red); }
.account-info p { font-size: 14px; margin-bottom: 8px; color: var(--text2); }
.account-info strong { color: var(--text); }
.access-code-display {
  display: inline-block;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 6px; padding: 8px 16px;
  font-size: 1.1rem; font-family: monospace; font-weight: 700;
  letter-spacing: 2px; color: var(--brand); margin-top: 6px;
}

/* ============================================================
   OVERVIEW PANELS (teacher)
   ============================================================ */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .overview-grid { grid-template-columns: 1fr; } }
.overview-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; box-shadow: var(--shadow-sm);
}
.overview-panel h3 { font-size: 14px; font-weight: 700; color: var(--text2); margin-bottom: 16px; }

.recent-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-row:last-child { border-bottom: none; }
.recent-icon { font-size: 1.2rem; flex-shrink: 0; }
.recent-body { flex: 1; min-width: 0; }
.recent-body strong { display: block; font-size: 13.5px; color: var(--text); }
.recent-test { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.recent-date { font-size: 11.5px; color: var(--text3); white-space: nowrap; }

.band-chart { display: flex; flex-direction: column; gap: 10px; }
.bc-row { display: flex; align-items: center; gap: 10px; }
.bc-label { width: 60px; font-size: 12.5px; color: var(--text3); text-align: right; flex-shrink: 0; }
.bc-bar-wrap { flex: 1; background: var(--surface2); border-radius: 4px; height: 18px; overflow: hidden; }
.bc-bar { height: 100%; background: var(--brand); border-radius: 4px; transition: width 0.4s ease; min-width: 4px; }
.bc-count { width: 24px; font-size: 12px; color: var(--text2); font-weight: 600; }

/* ============================================================
   TABLES
   ============================================================ */
.table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input {
  padding: 9px 14px; border: 1.5px solid var(--border2); border-radius: 7px;
  font-size: 14px; outline: none; min-width: 220px; flex: 1; max-width: 360px;
  background: var(--surface); color: var(--text);
}
.search-input:focus { border-color: var(--input-focus); }
.filter-select {
  padding: 9px 14px; border: 1.5px solid var(--border2); border-radius: 7px;
  font-size: 14px; outline: none; background: var(--surface); color: var(--text); cursor: pointer;
}
.filter-select:focus { border-color: var(--input-focus); }
.table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead { background: var(--surface2); }
.data-table th { padding: 12px 16px; text-align: left; font-weight: 700; color: var(--text2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.data-table small { color: var(--text3); }
.empty-cell { text-align: center; color: var(--text3); padding: 28px 0 !important; }

/* ============================================================
   TEST INTERFACE
   ============================================================ */
.test-body { background: var(--bg); }

.test-topbar {
  position: sticky; top: 0; z-index: 100;
  width: 100%; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); gap: 12px;
}
.test-topbar-left { flex: 1; min-width: 0; }
.test-title-label {
  font-size: 15px; font-weight: 700; color: var(--brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.test-topbar-center { flex-shrink: 0; }
.timer-wrap {
  display: flex; align-items: center; gap: 6px;
  background: #fde8ec; padding: 6px 16px; border-radius: 20px;
}
[data-theme="dark"] .timer-wrap { background: #2d1018; }
.timer-icon { font-size: 1rem; }
.timer-display { font-size: 1rem; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-warn { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.test-topbar-right { flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.q-progress { font-size: 13px; color: var(--text3); white-space: nowrap; }

/* ── Split layout ── */
.test-split {
  display: grid; grid-template-columns: 1fr 400px;
  height: calc(100vh - 60px);
}
@media (max-width: 840px) { .test-split { grid-template-columns: 1fr; grid-template-rows: 50vh auto; } }

/* ── Passage pane — optimised for reading ── */
.test-passage-pane {
  overflow-y: auto;
  background: var(--passage-bg);
  border-right: 1px solid var(--border);
  line-height: var(--passage-line-height);
  display: flex;
  flex-direction: column;
}

.passage-pane-area {
  padding: 32px 44px;
  flex: 1;
}

.passage-block { max-width: 680px; }

.passage-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  line-height: 1.4;
}

.passage-block p {
  margin-bottom: 20px;
  color: var(--passage-text);
  font-size: var(--passage-font-size);
  line-height: var(--passage-line-height);
  font-family: Georgia, "Times New Roman", Times, serif;
  text-align: justify;
  hyphens: auto;
}

.passage-divider { margin: 30px 0; border: none; border-top: 2px solid var(--border); }

/* Transcript */
.transcript-header { padding: 20px 44px 0; }
.transcript-note { font-size: 13px; color: var(--text3); margin-top: 8px; }
.transcript-section {
  font-size: 13.5px; font-weight: 800; color: var(--brand);
  margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Audio player ── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 44px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.audio-controls { display: flex; align-items: center; gap: 8px; }
.audio-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1rem;
  background: var(--brand); color: #fff;
  transition: background 0.15s;
}
.audio-btn:hover { background: var(--brand-light); }
.audio-btn--secondary { background: var(--surface); color: var(--text2); border: 1.5px solid var(--border2); }
.audio-btn--secondary:hover { background: var(--hover-bg); }
.audio-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.audio-progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  accent-color: var(--brand);
  cursor: pointer;
}
.audio-status { font-size: 12px; color: var(--text3); }
.audio-speed {
  padding: 5px 10px; border: 1.5px solid var(--border2);
  border-radius: 6px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); color: var(--text2);
  cursor: pointer; outline: none;
}

/* ── Questions pane ── */
.test-questions-pane {
  overflow-y: auto; padding: 28px 20px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 14px;
}

.q-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.q-text { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; line-height: 1.5; }

.q-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 6px;
  border: 1.5px solid var(--border); border-radius: 7px;
  cursor: pointer; font-size: 13.5px; color: var(--text2);
  transition: border-color 0.12s, background 0.12s;
}
.q-option:hover { border-color: var(--brand); background: var(--hover-bg); }
.q-option input[type="radio"] { accent-color: var(--brand); flex-shrink: 0; }
.q-option-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #e6f0fb; color: var(--brand);
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
[data-theme="dark"] .q-option-key { background: #1e2d46; }
.tfng-key { width: auto; padding: 0 8px; border-radius: 4px; font-size: 11.5px; }

.fill-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border2); border-radius: 7px;
  font-size: 14px; outline: none;
  background: var(--surface); color: var(--text);
}
.fill-input:focus { border-color: var(--input-focus); }

/* Passage question headers */
.passage-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0; position: sticky; top: 0; z-index: 10;
}
.passage-tab {
  padding: 11px 20px; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--text3);
  cursor: pointer; transition: color 0.12s, border-color 0.12s; white-space: nowrap;
}
.passage-tab:hover { color: var(--brand); }
.passage-tab--active { color: var(--brand); border-bottom-color: var(--brand); background: var(--passage-bg); }

.passage-tab--done::after {
  content: " ✓";
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}

.passage-q-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; margin-bottom: 10px;
  background: var(--hover-bg); border-radius: 7px; border-left: 4px solid var(--brand);
}
.passage-q-label { font-weight: 800; color: var(--brand); font-size: 13px; }
.passage-q-range { font-size: 12px; color: var(--text3); }

/* ── Writing layout ── */
.writing-layout {
  padding: 28px 32px; max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 28px;
}
.writing-task-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.writing-task-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--surface2); border-bottom: 1px solid var(--border);
}
.writing-task-label { font-weight: 700; color: var(--brand); font-size: 14px; }
.writing-time-guide { font-size: 12px; color: var(--text3); margin-left: 10px; font-style: italic; }
.writing-word-count { font-size: 13px; color: var(--text3); }
.writing-prompt {
  padding: 18px 20px; font-size: 14px; color: var(--text2);
  line-height: 1.75; border-bottom: 1px solid var(--border); background: var(--surface2);
}
[data-theme="dark"] .writing-prompt { background: var(--surface2); }
.writing-area {
  width: 100%; min-height: 280px; padding: 20px;
  border: none; outline: none; resize: vertical;
  font-size: 15px; font-family: Georgia, serif;
  line-height: 1.85; color: var(--text); background: var(--surface);
}
.writing-task-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; background: var(--surface2); border-top: 1px solid var(--border); font-size: 12.5px;
}
.writing-min-label { color: var(--text3); }
.wc-status { font-weight: 600; }
.wc-ok    { color: var(--green); }
.wc-short { color: #b05e00; }

/* ── Submit modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 999; padding: 16px;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 32px 28px; max-width: 420px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
}
.modal-box h2 { font-size: 1.2rem; color: var(--brand); margin-bottom: 12px; }
.modal-box p  { font-size: 14px; color: var(--text2); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Writing visuals ── */
.visual-container {
  background: var(--surface2); border: 1px solid var(--border);
  border-bottom: none; padding: 20px 24px;
}
.visual-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 16px; text-align: center; }
.chart-wrap { width: 100%; }
.chart-unit { text-align: center; font-size: 11.5px; color: var(--text3); margin-top: 8px; font-style: italic; }
.bar-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text2); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.bar-chart-grid {
  display: flex; align-items: flex-end; justify-content: space-around;
  gap: 16px; height: 180px; border-bottom: 2px solid var(--border2); padding: 0 8px;
}
.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; }
.bar-group-bars { display: flex; align-items: flex-end; gap: 4px; flex: 1; width: 100%; justify-content: center; }
.bar-item-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; }
.bar-val { font-size: 10px; color: var(--text2); margin-bottom: 3px; font-weight: 600; white-space: nowrap; }
.bar-item { width: 100%; min-width: 14px; border-radius: 3px 3px 0 0; cursor: default; }
.bar-item:hover { opacity: 0.8; }
.bar-cat-label { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text2); text-align: center; }
.line-svg { width: 100%; height: auto; display: block; }
.pie-chart-wrap { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.pie-chart-item { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 180px; max-width: 260px; }
.pie-chart-label { font-size: 13px; font-weight: 800; color: var(--brand); margin-bottom: 8px; }
.pie-svg { width: 100%; max-width: 180px; height: auto; display: block; }
.pie-legend { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.pie-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.process-wrap { overflow-x: auto; }
.process-steps { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; padding: 8px 0; }
.process-step { display: flex; align-items: center; gap: 0; }
.process-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-right: 8px;
}
.process-step-body {
  background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: 8px; padding: 10px 14px; min-width: 110px; max-width: 150px;
}
.process-step-title { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.process-step-desc { font-size: 11.5px; color: var(--text2); line-height: 1.4; }
.process-arrow { font-size: 1.3rem; color: var(--brand); padding: 0 6px; flex-shrink: 0; font-weight: 900; }
@media (max-width: 700px) {
  .process-steps { flex-direction: column; }
  .process-arrow { transform: rotate(90deg); padding: 4px 0; }
  .process-step-body { max-width: 100%; }
}

/* ============================================================
   RESULTS PAGE
   ============================================================ */
.results-main { max-width: 860px; margin: 0 auto; padding: 32px 24px 60px; }
.results-hero {
  background: linear-gradient(135deg, #173f70 0%, #1a5090 100%);
  border-radius: 16px; padding: 40px 24px;
  text-align: center; margin-bottom: 28px; color: #fff;
}
.results-hero-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.results-label { font-size: 14px; opacity: 0.75; font-weight: 600; letter-spacing: 0.3px; }
.band-circle {
  width: 120px; height: 120px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900; color: #fff; letter-spacing: -0.5px;
}
.band-circle--sm { width: 80px; height: 80px; font-size: 1rem; }
.band-subtitle { font-size: 1rem; opacity: 0.85; }
.results-meta  { font-size: 12.5px; opacity: 0.65; }
.results-detail { display: flex; flex-direction: column; gap: 20px; }
.results-section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; box-shadow: var(--shadow-sm);
}
.results-section-card h2 { font-size: 1rem; font-weight: 700; color: var(--brand); margin-bottom: 18px; }

.answer-grid { display: flex; flex-direction: column; gap: 10px; }
.answer-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 12px; align-items: center; padding: 12px 16px;
  border-radius: 8px; border: 1px solid var(--border); font-size: 13.5px;
}
.answer-row--correct { border-left: 4px solid var(--green); background: #f0faf4; }
.answer-row--wrong   { border-left: 4px solid var(--red);   background: #fff0f2; }
[data-theme="dark"] .answer-row--correct { background: #0e2018; }
[data-theme="dark"] .answer-row--wrong   { background: #1e0a0e; }
.answer-q { flex: 1; color: var(--text); }
.answer-your, .answer-correct { display: flex; gap: 6px; align-items: center; }
.answer-label { font-size: 12px; color: var(--text3); white-space: nowrap; }
.answer-val { font-weight: 700; }
.val--correct { color: var(--green); }
.val--wrong   { color: var(--red); }
.answer-tick  { font-size: 1.1rem; font-weight: 900; }
@media (max-width: 600px) { .answer-row { grid-template-columns: 1fr; gap: 6px; } }

.band-table { display: flex; flex-direction: column; gap: 6px; }
.band-row { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-radius: 7px; background: var(--surface2); font-size: 13.5px; }
.band-row--active { background: var(--hover-bg); border: 1.5px solid var(--brand); }
.band-cell-score { font-weight: 800; color: var(--brand); width: 56px; flex-shrink: 0; }
.band-cell-desc  { color: var(--text2); }

.writing-note { font-size: 13.5px; color: var(--text3); margin-bottom: 18px; }
.writing-response-block { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.writing-response-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.writing-response-block h3 { font-size: 15px; color: var(--brand); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.wc-pill { padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #e6f0fb; color: var(--brand); }
.wc-pill--ok    { background: #e6f9ed; color: var(--green); }
.wc-pill--short { background: #fff3e0; color: #b05e00; }
[data-theme="dark"] .wc-pill     { background: #1e2d46; color: #7ab3f0; }
[data-theme="dark"] .wc-pill--ok { background: #1a2e22; color: #5ecf85; }
[data-theme="dark"] .wc-pill--short { background: #2a2010; color: #e0a060; }
.writing-prompt-small { font-size: 13px; color: var(--text3); margin-bottom: 12px; font-style: italic; }
.writing-response-text {
  font-size: 14.5px; line-height: 1.85; color: var(--text);
  background: var(--surface2); border-radius: 8px; padding: 16px; white-space: pre-wrap; min-height: 60px;
  font-family: Georgia, serif;
}
.results-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   TEACHER RESULTS PAGE
   ============================================================ */
.teacher-results-main { max-width: 1000px; margin: 0 auto; padding: 32px 24px 60px; }
.tr-page-header { margin-bottom: 24px; }
.tr-page-header h1 { font-size: 1.4rem; color: var(--brand); }
.tr-page-header p  { color: var(--text3); font-size: 14px; margin-top: 4px; }
.tr-result-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.student-profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.student-profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 1.4rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ============================================================
   MISC
   ============================================================ */
.empty-msg { color: var(--text3); font-size: 14px; text-align: center; padding: 32px 0; }
.dash-section { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .dash-content { padding: 20px 14px; }
  .test-passage-pane { /* padding handled by pane-area */ }
  .passage-pane-area { padding: 20px 18px; }
  .test-questions-pane { padding: 14px; }
  .writing-layout { padding: 14px; }
  .auth-card { padding: 28px 20px; }
  .results-main, .teacher-results-main { padding: 20px 14px 40px; }
  .results-hero { padding: 28px 16px; }
  .test-card2 { flex-direction: column; }
  .test-card2-action { flex-direction: row; }
  .result-row { flex-wrap: wrap; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .audio-player { padding: 12px 18px; }
}

/* ============================================================
   TOPBAR AVATAR BUTTON
   ============================================================ */
.avatar-topbar-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 1rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--border2); cursor: pointer;
  flex-shrink: 0; transition: border-color 0.15s;
  overflow: hidden;
}
.avatar-topbar-btn:hover { border-color: var(--brand-light); }

/* ============================================================
   PROGRESS TRACK  (section test list with lock/unlock)
   ============================================================ */
.progress-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pt-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s, border-color 0.2s;
  position: relative;
}

.pt-card--locked {
  opacity: 0.55;
  background: var(--surface2);
}
.pt-card--locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  cursor: not-allowed;
}

.pt-card--done {
  border-left: 4px solid var(--green);
}

.pt-card--open {
  border-left: 4px solid var(--brand);
}

.pt-badge {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pt-card--done .pt-badge  { background: var(--green); }
.pt-card--locked .pt-badge { background: var(--border2); color: var(--text3); }

.pt-icon-wrap { font-size: 1.5rem; flex-shrink: 0; width: 32px; text-align: center; }

.pt-body { flex: 1; min-width: 0; }
.pt-top  { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.pt-title { font-size: 15px; font-weight: 700; color: var(--text); }
.pt-meta  { font-size: 12.5px; color: var(--text3); margin-bottom: 3px; }
.pt-desc  { font-size: 13.5px; color: var(--text2); }

.pt-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.pt-locked-btn {
  background: var(--surface2); color: var(--text3);
  border: 1.5px solid var(--border2); cursor: not-allowed;
}

.tag--locked { background: #f0f0f0; color: #888; }
[data-theme="dark"] .tag--locked { background: #2a2a3a; color: #666; }

/* ============================================================
   RESULT FILTER TABS
   ============================================================ */
.result-filter-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.rfTab {
  padding: 7px 16px; border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface); color: var(--text2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.rfTab:hover { border-color: var(--brand); color: var(--brand); }
.rfTab--active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ============================================================
   PROFILE EDITOR
   ============================================================ */
.profile-editor-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 820px;
}
@media (max-width: 700px) { .profile-editor-wrap { grid-template-columns: 1fr; } }

/* ── Avatar side ── */
.avatar-picker-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.profile-avatar-preview {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 2.4rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--border2);
  overflow: hidden; flex-shrink: 0;
}
.profile-avatar-preview.avatar-img {
  font-size: 0; /* hide letter when image shown */
}
.teacher-avatar { background: var(--red); }

.avatar-picker-label { font-size: 13px; color: var(--text3); font-weight: 600; }

.avatar-emoji-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%;
}

.avatar-emoji-btn {
  font-size: 1.3rem; padding: 6px 2px;
  border: 2px solid transparent; border-radius: 8px;
  background: var(--surface2); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  line-height: 1;
}
.avatar-emoji-btn:hover { border-color: var(--brand); background: var(--hover-bg); }
.avatar-emoji-btn--active { border-color: var(--brand); background: var(--hover-bg); }

.avatar-upload-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ── Fields side ── */
.profile-fields-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}

.profile-readonly-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.profile-readonly-block p { margin: 0; font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.prf-label { font-weight: 700; color: var(--text3); min-width: 120px; flex-shrink: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.prf-val   { color: var(--text); }

.profile-save-msg {
  padding: 10px 14px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600;
  margin-bottom: 14px;
}
.profile-save-msg--ok    { background: #e6f9ed; color: var(--green); }
.profile-save-msg--error { background: #fde8ec; color: var(--red); }
[data-theme="dark"] .profile-save-msg--ok    { background: #1a2e22; color: #5ecf85; }
[data-theme="dark"] .profile-save-msg--error { background: #2d1018; color: #f08090; }

/* ============================================================
   LISTENING COVER  (no transcript visible)
   ============================================================ */
.listening-cover {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 32px;
  height: 100%; gap: 16px; text-align: center;
  background: var(--passage-bg);
}

.listening-cover-icon { font-size: 3.5rem; line-height: 1; }

.listening-cover-title {
  font-size: 1.2rem; font-weight: 800; color: var(--brand); margin: 0;
}

.listening-cover-sub {
  font-size: 14px; color: var(--text3); max-width: 360px; line-height: 1.6;
}

.audio-player-centered {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 28px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-md);
}

.audio-controls-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 18px;
}

.audio-btn { 
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  font-size: 1rem; transition: background 0.15s;
}

.audio-btn--big {
  width: 54px; height: 54px; font-size: 1.4rem;
  background: var(--brand); color: #fff;
}
.audio-btn--big:hover { background: var(--brand-light); }

.audio-btn--secondary {
  width: 40px; height: 40px; font-size: 0.85rem;
  background: var(--surface2); color: var(--text2);
  border: 1.5px solid var(--border2); border-radius: 20px;
  padding: 0 10px; width: auto;
}
.audio-btn--secondary:hover { background: var(--hover-bg); }

.audio-speed {
  padding: 5px 10px; border: 1.5px solid var(--border2);
  border-radius: 6px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); color: var(--text2);
  cursor: pointer; outline: none;
}

.audio-progress-wrap {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.audio-time { font-size: 12px; color: var(--text3); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.audio-progress {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border); accent-color: var(--brand); cursor: pointer;
}

.audio-now-playing {
  text-align: center; font-size: 13px; color: var(--text3);
  font-weight: 500; min-height: 20px;
}

.listening-section-indicator {
  font-size: 13px; font-weight: 800; color: var(--brand);
  padding: 8px 20px; border-radius: 20px;
  background: var(--hover-bg); border: 1.5px solid var(--brand);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.section-indicator--show {
  opacity: 1; transform: translateY(0);
}

/* ── Audio progress bar (listening — no scrubber, decorative only) ── */
.audio-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 14px;
}
.audio-progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ============================================================
   SPEAKING TEST UI
   ============================================================ */

/* Part tabs */
.spk-part-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.spk-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 28px;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  min-width: 120px;
  position: relative;
}
.spk-tab:hover { background: var(--hover-bg); }
.spk-tab--active { border-bottom-color: var(--brand); background: var(--surface); }
.spk-tab--locked { opacity: .5; cursor: not-allowed; }
.spk-tab-num { font-size: 13px; font-weight: 800; color: var(--brand); }
.spk-tab-topic { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.spk-tab-done { position: absolute; top: 8px; right: 8px; color: var(--green); font-size: 12px; font-weight: 800; }
.spk-tab-lock { position: absolute; top: 8px; right: 8px; font-size: 11px; }

/* Layout */
.spk-layout { padding: 24px 28px; max-width: 860px; margin: 0 auto; }

/* Part header */
.spk-part-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
}
.spk-part-badge {
  padding: 4px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.spk-part-title { font-size: 1.1rem; font-weight: 800; color: var(--brand); margin: 0 0 6px; }
.spk-part-instruction { font-size: 13.5px; color: var(--text2); line-height: 1.6; margin: 0; }

/* Questions */
.spk-questions { display: flex; flex-direction: column; gap: 16px; }
.spk-q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s, opacity .15s;
}
.spk-q-card--done  { border-left: 4px solid var(--green); }
.spk-q-card--locked { opacity: .55; }

.spk-q-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 12px;
}
.spk-q-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spk-q-text { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.5; padding-top: 4px; }

/* Cue card */
.spk-cue-list {
  margin: 0 20px 12px 62px;
  padding: 12px 16px;
  background: var(--surface2);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  list-style: none;
}
.spk-cue-list li {
  font-size: 13.5px;
  color: var(--text2);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}
.spk-cue-list li::before {
  content: "▸";
  color: var(--brand);
  position: absolute;
  left: 0;
}
.spk-cue-sm { font-size: 12.5px; margin: 0 20px 10px 52px; }

/* Controls area */
.spk-q-controls { padding: 0 20px 18px 20px; }

.spk-locked-note {
  font-size: 13px;
  color: var(--text3);
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Record button */
.spk-rec-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.spk-rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 30px;
  border: 2px solid var(--brand);
  background: var(--surface);
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.spk-rec-btn:hover { background: var(--hover-bg); }
.spk-rec-btn--recording {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  animation: recPulse 1.2s infinite;
}
@keyframes recPulse { 0%,100%{opacity:1} 50%{opacity:.75} }
.spk-mic { font-size: 1.2rem; }
.spk-rec-timer { font-size: 13px; font-weight: 700; color: var(--red); min-height: 20px; }

/* Recorded row */
.spk-recorded-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #e6f9ed;
  border-radius: 8px;
  border: 1px solid #a8e0bc;
}
[data-theme="dark"] .spk-recorded-row { background: #0e2018; border-color: #1a4028; }
.spk-rec-ok { font-size: 13.5px; font-weight: 800; color: var(--green); }
.spk-rec-dur { font-size: 12.5px; color: var(--text3); }

/* Progress */
.spk-progress { font-size: 13px; color: var(--text3); white-space: nowrap; }

/* ── Teacher review ── */
.spk-review-part { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.spk-review-part:last-child { border-bottom: none; margin-bottom: 0; }
.spk-review-part-title { font-size: 14px; font-weight: 800; color: var(--brand); margin: 0 0 14px; }
.spk-review-q { margin-bottom: 16px; }
.spk-review-q-label { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.spk-audio-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.spk-audio-el { height: 40px; flex: 1; min-width: 220px; max-width: 480px; }
.spk-rec-dur-label { font-size: 12px; color: var(--text3); }
.spk-no-rec { font-size: 13px; color: var(--red); margin-top: 6px; }

/* ── Grading form ── */
.spk-grade-form { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.spk-grade-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.spk-grade-lbl { font-size: 13.5px; font-weight: 700; color: var(--text2); min-width: 180px; }
.spk-grade-sel {
  padding: 8px 12px;
  border: 1.5px solid var(--border2);
  border-radius: 7px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  min-width: 100px;
}
.spk-grade-sel:focus { border-color: var(--brand); }
.spk-criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.spk-crit { display: flex; flex-direction: column; gap: 6px; }
.spk-crit label { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.spk-feedback-ta {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  background: var(--surface);
  color: var(--text);
  outline: none;
  resize: vertical;
}
.spk-feedback-ta:focus { border-color: var(--brand); }

/* ============================================================
   PENDING TAG
   ============================================================ */
.tag--pending { background: #fff3e0; color: #b05e00; }
[data-theme="dark"] .tag--pending { background: #2a1a00; color: #e0a040; }

/* ============================================================
   SIDEBAR FLEX FIX  (for dictionary bottom link)
   ============================================================ */
.dash-sidebar { display: flex; flex-direction: column; }
.sidebar-nav  { display: flex; flex-direction: column; flex: 1; }

/* ── Sidebar divider + dictionary link ── */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

.sidebar-link--dict {
  color: var(--text3);
  font-size: 13.5px;
}
.sidebar-link--dict:hover {
  color: var(--brand);
  background: var(--hover-bg);
}

/* ── Public Profiles ── */
.profile-link { color: var(--text); text-decoration: none; }
.profile-link:hover { color: var(--brand); text-decoration: underline; }

.teacher-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 12px;
  transition: border-color 0.15s;
}
.teacher-card:hover { border-color: var(--brand); }
.teacher-card-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.teacher-card-avatar.avatar-img { background-size: cover; background-position: center; font-size: 0; }
.teacher-card-body { flex: 1; }
.teacher-card-body strong { font-size: 15px; display: block; margin-bottom: 2px; }
.teacher-card-body p { font-size: 13px; color: var(--text3); margin: 0; }

/* ============================================================
   BITS BADGE
   ============================================================ */

/* ============================================================
   SHOP ITEM VISUAL EFFECTS
   ============================================================ */

/* ── Frame animations ── */
@keyframes gold-shimmer {
  0%,100% { box-shadow: 0 0 0 3px #c8960c, 0 0 10px 4px #f9c74f88; }
  50%     { box-shadow: 0 0 0 3px #ffe066, 0 0 22px 10px #f9c74fcc; }
}
@keyframes silver-reflect {
  0%,100% { box-shadow: 0 0 0 3px #8a9ab5, 0 0 8px 3px #b0b8cc66; filter: brightness(1); }
  30%     { box-shadow: 0 0 0 3px #dde6f5, 0 0 20px 10px #c8d0e0cc; filter: brightness(1.25); }
  60%     { box-shadow: 0 0 0 3px #8a9ab5, 0 0 8px 3px #b0b8cc66; filter: brightness(1); }
}
@keyframes neon-pulse {
  0%,100% { box-shadow: 0 0 0 3px #00cfff, 0 0 14px 5px #00cfff88, 0 0 30px 10px #00cfff33; }
  50%     { box-shadow: 0 0 0 4px #00e5ff, 0 0 28px 12px #00cfffcc, 0 0 50px 20px #00cfff66; }
}
@keyframes red-fire {
  0%,100% { box-shadow: 0 0 0 3px #c8102e, 0 0 10px 4px #c8102e88; }
  50%     { box-shadow: 0 0 0 3px #ff2244, 0 0 22px 10px #c8102ecc; }
}
@keyframes rainbow-cycle {
  0%   { box-shadow: 0 0 0 3px #ff0000, 0 0 12px 5px #ff000077; }
  14%  { box-shadow: 0 0 0 3px #ff7700, 0 0 12px 5px #ff770077; }
  28%  { box-shadow: 0 0 0 3px #ffee00, 0 0 12px 5px #ffee0077; }
  43%  { box-shadow: 0 0 0 3px #00dd44, 0 0 12px 5px #00dd4477; }
  57%  { box-shadow: 0 0 0 3px #0099ff, 0 0 12px 5px #0099ff77; }
  71%  { box-shadow: 0 0 0 3px #8800ff, 0 0 12px 5px #8800ff77; }
  85%  { box-shadow: 0 0 0 3px #ff00cc, 0 0 12px 5px #ff00cc77; }
  100% { box-shadow: 0 0 0 3px #ff0000, 0 0 12px 5px #ff000077; }
}

.frame-gold    { animation: gold-shimmer  2s   ease-in-out infinite !important; border-radius: 50% !important; }
.frame-silver  { animation: silver-reflect 2.4s ease-in-out infinite !important; border-radius: 50% !important; }
.frame-neon    { animation: neon-pulse    1.6s ease-in-out infinite !important; border-radius: 50% !important; }
.frame-red     { animation: red-fire      2s   ease-in-out infinite !important; border-radius: 50% !important; }
.frame-rainbow { animation: rainbow-cycle 3s   linear     infinite !important; border-radius: 50% !important; }

/* ── Avatar backgrounds ── */
.bg-dark    { background: #0f1117 !important; color: #e8eaf0 !important; }
.bg-sunset  { background: linear-gradient(135deg,#ff6b35,#f7c59f) !important; color: #1a0a00 !important; }
.bg-ocean   { background: linear-gradient(135deg,#0077b6,#00b4d8) !important; color: #fff !important; }
.bg-forest  { background: linear-gradient(135deg,#1b4332,#52b788) !important; color: #fff !important; }
.bg-galaxy  { background: linear-gradient(135deg,#10002b,#7b2d8b,#e040fb) !important; color: #fff !important; }

/* ── Profile badges ── */
.badge-display {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 3px 12px; border-radius: 12px; color: #fff;
  margin-top: 4px; letter-spacing: 0.4px;
}
.badge-display.badge_master  { background: linear-gradient(90deg,#92620a,#f6c90e,#92620a); color: #1a1100 !important; background-size: 200% !important; animation: badge-scroll 2s linear infinite; }
.badge-display.badge_seeker  { background: linear-gradient(90deg,#173f70,#2a6ab5); }
.badge-display.badge_scholar { background: linear-gradient(90deg,#1b4332,#52b788); }
.badge-display.badge_ace     { background: linear-gradient(90deg,#6d28d9,#c026d3); }
.badge-display.badge_legend  { background: linear-gradient(90deg,#7c3aed,#f9c74f,#c8102e,#7c3aed); background-size: 300% !important; animation: badge-scroll 2.5s linear infinite; }
@keyframes badge-scroll { 0% { background-position:0% 50%; } 100% { background-position:200% 50%; } }

/* ============================================================
   APP THEMES — cinematic full-app colour overrides
   ============================================================ */

/* MIDNIGHT: calm moon, deep space, peaceful dark blues */
html[data-app-theme="midnight"]{--brand:#5865f2;--brand-light:#7983f5;--bg:#0e0e18;--surface:#1a1a2e;--surface2:#22223a;--border:#2e2e4a;--border2:#3a3a5c;--text:#e8e8f0;--text2:#b0b0cc;--text3:#7070a0;--hover-bg:#2a2a50}
html[data-app-theme="midnight"] .topbar{background:linear-gradient(90deg,#0e0e18,#1a1a2e)}
html[data-app-theme="midnight"] .dash-sidebar{background:linear-gradient(180deg,#0e0e18,#1a1a2e)}
html[data-app-theme="midnight"] .topbar-badge{background:#2a2a50;color:#7983f5}
html[data-app-theme="midnight"] .sidebar-link--active{border-left-color:#5865f2;background:#2a2a50;color:#7983f5}
html[data-app-theme="midnight"] .btn-primary{background:#5865f2}
html[data-app-theme="midnight"] .band-pill{background:#5865f2}
html[data-app-theme="midnight"] .bc-bar{background:#5865f2}
html[data-app-theme="midnight"] .results-hero{background:linear-gradient(135deg,#0e0e18,#2a2a50)}

/* CRIMSON: hell, fire, dark demonic red */
html[data-app-theme="crimson"]{--brand:#e84040;--brand-light:#ff6060;--bg:#0a0404;--surface:#180808;--surface2:#220c0c;--border:#3a1010;--border2:#4a1818;--text:#f5dada;--text2:#c89090;--text3:#906060;--hover-bg:#2e1010}
html[data-app-theme="crimson"] .topbar{background:linear-gradient(90deg,#0a0404,#180808)}
html[data-app-theme="crimson"] .dash-sidebar{background:linear-gradient(180deg,#0a0404,#180808)}
html[data-app-theme="crimson"] .topbar-badge{background:#3a1010;color:#ff6060}
html[data-app-theme="crimson"] .sidebar-link--active{border-left-color:#e84040;background:#2e1010;color:#ff6060}
html[data-app-theme="crimson"] .btn-primary{background:linear-gradient(135deg,#c8102e,#e84040)}
html[data-app-theme="crimson"] .band-pill{background:#e84040}
html[data-app-theme="crimson"] .bc-bar{background:#e84040}
html[data-app-theme="crimson"] .results-hero{background:linear-gradient(135deg,#0a0404,#3a0a0a,#c8102e)}

/* ABYSS: deep ocean, marine life, waves */
html[data-app-theme="abyss"]{--brand:#00b4d8;--brand-light:#00d4f8;--bg:#010d18;--surface:#031524;--surface2:#051e30;--border:#082a40;--border2:#0c3850;--text:#c8eeff;--text2:#70b8d8;--text3:#3878a0;--hover-bg:#062030}
html[data-app-theme="abyss"] .topbar{background:linear-gradient(90deg,#010d18,#031524)}
html[data-app-theme="abyss"] .dash-sidebar{background:linear-gradient(180deg,#010d18,#031524)}
html[data-app-theme="abyss"] .topbar-badge{background:#062030;color:#00d4f8}
html[data-app-theme="abyss"] .sidebar-link--active{border-left-color:#00b4d8;background:#062030;color:#00d4f8}
html[data-app-theme="abyss"] .btn-primary{background:linear-gradient(135deg,#0077b6,#00b4d8);color:#010d18}
html[data-app-theme="abyss"] .band-pill{background:#00b4d8;color:#010d18}
html[data-app-theme="abyss"] .bc-bar{background:#00b4d8}
html[data-app-theme="abyss"] .results-hero{background:linear-gradient(135deg,#010d18,#062030,#0077b6)}

/* EMERALD: deep forest, glowing shiny stones */
html[data-app-theme="emerald"]{--brand:#22c55e;--brand-light:#4ade80;--bg:#020d06;--surface:#06180a;--surface2:#0a2010;--border:#142e18;--border2:#1c3e22;--text:#c8f0d0;--text2:#78b890;--text3:#387850;--hover-bg:#0c2014}
html[data-app-theme="emerald"] .topbar{background:linear-gradient(90deg,#020d06,#06180a)}
html[data-app-theme="emerald"] .dash-sidebar{background:linear-gradient(180deg,#020d06,#06180a)}
html[data-app-theme="emerald"] .topbar-badge{background:#0c2014;color:#4ade80}
html[data-app-theme="emerald"] .sidebar-link--active{border-left-color:#22c55e;background:#0c2014;color:#4ade80}
html[data-app-theme="emerald"] .btn-primary{background:linear-gradient(135deg,#166534,#22c55e);color:#020d06}
html[data-app-theme="emerald"] .band-pill{background:#22c55e;color:#020d06}
html[data-app-theme="emerald"] .bc-bar{background:#22c55e}
html[data-app-theme="emerald"] .results-hero{background:linear-gradient(135deg,#020d06,#0c2014,#22c55e)}

/* SOLAR: ancient gold, warm amber power */
html[data-app-theme="solar"]{--brand:#f59e0b;--brand-light:#fbbf24;--bg:#0c0800;--surface:#1a1000;--surface2:#221600;--border:#342000;--border2:#462e00;--text:#fff8e0;--text2:#c8a040;--text3:#907020;--hover-bg:#281800}
html[data-app-theme="solar"] .topbar{background:linear-gradient(90deg,#0c0800,#1a1000)}
html[data-app-theme="solar"] .dash-sidebar{background:linear-gradient(180deg,#0c0800,#1a1000)}
html[data-app-theme="solar"] .topbar-badge{background:#281800;color:#fbbf24}
html[data-app-theme="solar"] .sidebar-link--active{border-left-color:#f59e0b;background:#281800;color:#fbbf24}
html[data-app-theme="solar"] .btn-primary{background:linear-gradient(135deg,#b45309,#f59e0b);color:#0c0800}
html[data-app-theme="solar"] .band-pill{background:#f59e0b;color:#0c0800}
html[data-app-theme="solar"] .bc-bar{background:#f59e0b}
html[data-app-theme="solar"] .results-hero{background:linear-gradient(135deg,#0c0800,#281800,#f59e0b)}

/* ============================================================

/* ============================================================
   ANIMATED THEME LAYERS — Discord-level stunning animations
   Each theme transforms the ENTIRE app with motion and depth
   ============================================================ */

/* ═══════════════════════════════════════════
   MIDNIGHT — Deep space, drifting starfield,
   purple nebulae, pulsing constellations
   ═══════════════════════════════════════════ */
@keyframes space-drift{0%{background-position:0% 0%,50px 50px,0% 100%,100px 0px,0% 50%}100%{background-position:200px 200px,250px 250px,200px 300px,300px 200px,200px 250px}}
@keyframes nebula-pulse{0%,100%{opacity:0.04}50%{opacity:0.12}}
@keyframes midnight-topbar{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes twinkle-a{0%,100%{opacity:.2}33%{opacity:1}66%{opacity:.4}}
@keyframes twinkle-b{0%,100%{opacity:.5}50%{opacity:.1}}

html[data-app-theme="midnight"] body{background:#0e0e18 !important}
html[data-app-theme="midnight"] body::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:0;background-image:radial-gradient(1.5px 1.5px at 5% 8%,rgba(255,255,255,.9) 0%,transparent 100%),radial-gradient(1px 1px at 20% 15%,rgba(200,200,255,.8) 0%,transparent 100%),radial-gradient(2px 2px at 35% 5%,rgba(255,255,255,.7) 0%,transparent 100%),radial-gradient(1px 1px at 50% 30%,rgba(220,200,255,.9) 0%,transparent 100%),radial-gradient(1.5px 1.5px at 65% 12%,rgba(255,255,255,.8) 0%,transparent 100%),radial-gradient(1px 1px at 80% 25%,rgba(180,160,255,.9) 0%,transparent 100%),radial-gradient(2px 2px at 90% 8%,rgba(255,255,255,.9) 0%,transparent 100%),radial-gradient(1px 1px at 15% 60%,rgba(200,200,255,.7) 0%,transparent 100%),radial-gradient(1.5px 1.5px at 40% 75%,rgba(255,255,255,.8) 0%,transparent 100%),radial-gradient(1px 1px at 60% 65%,rgba(220,200,255,.8) 0%,transparent 100%),radial-gradient(2px 2px at 75% 82%,rgba(255,255,255,.7) 0%,transparent 100%),radial-gradient(1.5px 1.5px at 92% 70%,rgba(180,160,255,.9) 0%,transparent 100%);animation:twinkle-a 4s ease-in-out infinite;will-change:opacity}
html[data-app-theme="midnight"] body::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(ellipse 600px 300px at 20% 30%, rgba(88,101,242,.06) 0%,transparent 70%),
    radial-gradient(ellipse 400px 200px at 80% 70%, rgba(124,58,237,.05) 0%,transparent 60%),
    radial-gradient(ellipse 500px 250px at 50% 10%, rgba(88,101,242,.04) 0%,transparent 60%);
  animation:nebula-pulse 8s ease-in-out infinite;
}
html[data-app-theme="midnight"] .topbar{
  background:linear-gradient(90deg,#0e0e18,#1a1a2e 20%,#2a2a50 50%,#1a1a2e 80%,#0e0e18) !important;
  background-size:300% 100% !important;
  animation:midnight-topbar 12s ease infinite !important;
  border-bottom:1px solid rgba(88,101,242,.3) !important;
  box-shadow:0 2px 20px rgba(88,101,242,.15) !important;
}
html[data-app-theme="midnight"] .dash-sidebar{
  background:linear-gradient(180deg,#0e0e18 0%,#1a1a2e 40%,#0e0e18 100%) !important;
  border-right:1px solid rgba(88,101,242,.2) !important;
}
html[data-app-theme="midnight"] .sidebar-link:hover{background:rgba(88,101,242,.15) !important}
html[data-app-theme="midnight"] .sidebar-link--active{background:rgba(88,101,242,.2) !important;border-left-color:#5865f2 !important;color:#7983f5 !important}
html[data-app-theme="midnight"] .stat-card{background:#1a1a2e !important;border-color:rgba(88,101,242,.2) !important;box-shadow:0 2px 12px rgba(88,101,242,.1) !important}
html[data-app-theme="midnight"] .overview-panel{background:#1a1a2e !important;border-color:rgba(88,101,242,.2) !important}
html[data-app-theme="midnight"] .band-pill{background:linear-gradient(135deg,#5865f2,#7983f5) !important;box-shadow:0 0 12px rgba(88,101,242,.5) !important}
html[data-app-theme="midnight"] .btn-primary{background:linear-gradient(135deg,#4752c4,#5865f2) !important;box-shadow:0 4px 15px rgba(88,101,242,.4) !important}
html[data-app-theme="midnight"] .btn-primary:hover{box-shadow:0 6px 20px rgba(88,101,242,.6) !important}

/* ═══════════════════════════════════════════
   CRIMSON — Hell, eternal fire, lava rivers,
   glowing ember sparks raining down
   ═══════════════════════════════════════════ */
@keyframes lava-flow{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes ember-rise{0%{transform:translateY(0) translateX(0) scale(1);opacity:0}10%{opacity:.8}80%{opacity:.3}100%{transform:translateY(-100vh) translateX(30px) scale(.2);opacity:0}}
@keyframes fire-glow{0%,100%{box-shadow:0 0 8px rgba(200,16,46,.3),0 0 20px rgba(200,16,46,.1)}50%{box-shadow:0 0 20px rgba(200,16,46,.6),0 0 40px rgba(255,68,0,.2)}}

html[data-app-theme="crimson"] body{background:#0a0404 !important}
html[data-app-theme="crimson"] body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(ellipse 800px 400px at 50% 100%,rgba(200,16,46,.18) 0%,transparent 60%),
    radial-gradient(ellipse 400px 300px at 20% 80%, rgba(255,68,0,.12) 0%,transparent 50%),
    radial-gradient(ellipse 600px 200px at 80% 90%, rgba(200,16,46,.1) 0%,transparent 50%),
    radial-gradient(ellipse 300px 200px at 50% 50%, rgba(255,34,0,.05) 0%,transparent 60%);
  animation:lava-flow 6s ease infinite;
}
html[data-app-theme="crimson"] body::after{
  content:"";position:fixed;bottom:0;left:0;right:0;height:30%;pointer-events:none;z-index:0;
  background:linear-gradient(180deg,transparent 0%,rgba(200,16,46,.08) 50%,rgba(200,16,46,.2) 100%);
  animation:fire-glow 3s ease-in-out infinite;
}
html[data-app-theme="crimson"] .topbar{
  background:linear-gradient(90deg,#0a0404,#3a0808 20%,rgba(200,16,46,.3) 50%,#3a0808 80%,#0a0404) !important;
  background-size:300% 100% !important;
  animation:lava-flow 4s ease infinite !important;
  border-bottom:1px solid rgba(200,16,46,.4) !important;
  box-shadow:0 2px 20px rgba(200,16,46,.25) !important;
}
html[data-app-theme="crimson"] .dash-sidebar{
  background:linear-gradient(180deg,#0a0404 0%,#1e0a0a 40%,#0a0404 100%) !important;
  border-right:1px solid rgba(200,16,46,.2) !important;
  box-shadow:4px 0 20px rgba(200,16,46,.1) !important;
}
html[data-app-theme="crimson"] .sidebar-link:hover{background:rgba(200,16,46,.15) !important}
html[data-app-theme="crimson"] .sidebar-link--active{background:rgba(200,16,46,.2) !important;border-left-color:#e84040 !important;color:#ff6060 !important}
html[data-app-theme="crimson"] .stat-card{background:#180808 !important;border-color:rgba(200,16,46,.2) !important;transition:box-shadow .3s !important}
html[data-app-theme="crimson"] .stat-card:hover{box-shadow:0 0 24px rgba(200,16,46,.4) !important}
html[data-app-theme="crimson"] .band-pill{background:linear-gradient(135deg,#c8102e,#e84040) !important;box-shadow:0 0 12px rgba(200,16,46,.5) !important}
html[data-app-theme="crimson"] .btn-primary{background:linear-gradient(135deg,#9b0d21,#c8102e) !important;box-shadow:0 4px 15px rgba(200,16,46,.4) !important;animation:fire-glow 3s ease-in-out infinite !important}

/* ═══════════════════════════════════════════
   ABYSS — Deep ocean, bioluminescence,
   swimming creatures, pressure waves
   ═══════════════════════════════════════════ */
@keyframes ocean-current{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes bio-luminate{0%,100%{opacity:.03}25%{opacity:.12}50%{opacity:.05}75%{opacity:.15}}
@keyframes deep-pressure{0%,100%{box-shadow:0 0 8px rgba(0,180,216,.2),0 0 30px rgba(0,180,216,.05)}50%{box-shadow:0 0 20px rgba(0,180,216,.4),0 0 60px rgba(0,180,216,.1)}}

html[data-app-theme="abyss"] body{background:#010d18 !important}
html[data-app-theme="abyss"] body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(ellipse 600px 400px at 30% 60%,rgba(0,180,216,.1) 0%,transparent 60%),
    radial-gradient(ellipse 400px 300px at 70% 30%, rgba(0,212,248,.08) 0%,transparent 50%),
    radial-gradient(ellipse 800px 200px at 50% 80%, rgba(0,119,182,.12) 0%,transparent 50%),
    radial-gradient(ellipse 300px 400px at 10% 20%, rgba(0,180,216,.06) 0%,transparent 60%);
  animation:ocean-current 8s ease infinite;
}
html[data-app-theme="abyss"] body::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background-image:
    radial-gradient(3px 3px at 15% 25%,rgba(0,212,248,.6) 0%,transparent 100%),
    radial-gradient(2px 2px at 35% 55%,rgba(0,180,216,.5) 0%,transparent 100%),
    radial-gradient(4px 4px at 55% 15%,rgba(72,202,228,.7) 0%,transparent 100%),
    radial-gradient(2px 2px at 75% 75%,rgba(0,212,248,.4) 0%,transparent 100%),
    radial-gradient(3px 3px at 90% 40%,rgba(0,180,216,.6) 0%,transparent 100%),
    radial-gradient(2px 2px at 45% 85%,rgba(72,202,228,.5) 0%,transparent 100%),
    radial-gradient(3px 3px at 25% 70%,rgba(0,212,248,.4) 0%,transparent 100%);
  animation:bio-luminate 4s ease-in-out infinite;
}
html[data-app-theme="abyss"] .topbar{
  background:linear-gradient(90deg,#010d18,#031524 20%,rgba(0,180,216,.15) 50%,#031524 80%,#010d18) !important;
  background-size:300% 100% !important;
  animation:ocean-current 6s ease infinite !important;
  border-bottom:1px solid rgba(0,180,216,.3) !important;
  box-shadow:0 2px 20px rgba(0,180,216,.15) !important;
}
html[data-app-theme="abyss"] .dash-sidebar{
  background:linear-gradient(180deg,#010d18 0%,#031524 30%,#051e30 60%,#031524 80%,#010d18 100%) !important;
  background-size:100% 300% !important;
  animation:ocean-current 10s ease infinite !important;
  border-right:1px solid rgba(0,180,216,.2) !important;
}
html[data-app-theme="abyss"] .sidebar-link:hover{background:rgba(0,180,216,.12) !important}
html[data-app-theme="abyss"] .sidebar-link--active{background:rgba(0,180,216,.18) !important;border-left-color:#00b4d8 !important;color:#00d4f8 !important}
html[data-app-theme="abyss"] .stat-card{background:#031524 !important;border-color:rgba(0,180,216,.2) !important;animation:deep-pressure 4s ease-in-out infinite !important}
html[data-app-theme="abyss"] .band-pill{background:linear-gradient(135deg,#0077b6,#00b4d8) !important;box-shadow:0 0 12px rgba(0,180,216,.6) !important;color:#010d18 !important}
html[data-app-theme="abyss"] .btn-primary{background:linear-gradient(135deg,#005f8f,#0077b6) !important;box-shadow:0 4px 15px rgba(0,180,216,.4) !important;color:#010d18 !important}

/* ═══════════════════════════════════════════
   EMERALD — Living forest, glowing crystals,
   fireflies, breathe of nature
   ═══════════════════════════════════════════ */
@keyframes forest-sway{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes crystal-shine{0%,100%{opacity:.04}33%{opacity:.14}66%{opacity:.06}}
@keyframes firefly{0%{transform:translateY(0) translateX(0);opacity:0}10%{opacity:.8}50%{transform:translateY(-40px) translateX(20px);opacity:.6}100%{transform:translateY(-80px) translateX(-10px);opacity:0}}

html[data-app-theme="emerald"] body{background:#020d06 !important}
html[data-app-theme="emerald"] body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(ellipse 700px 400px at 30% 70%,rgba(34,197,94,.09) 0%,transparent 60%),
    radial-gradient(ellipse 500px 300px at 70% 30%, rgba(74,222,128,.07) 0%,transparent 50%),
    radial-gradient(ellipse 600px 500px at 50% 50%, rgba(22,101,52,.08) 0%,transparent 60%),
    radial-gradient(ellipse 400px 200px at 10% 50%, rgba(34,197,94,.06) 0%,transparent 50%);
  animation:forest-sway 10s ease infinite;
}
html[data-app-theme="emerald"] body::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background-image:
    radial-gradient(3px 3px at 8%  20%,rgba(74,222,128,.9) 0%,transparent 100%),
    radial-gradient(2px 2px at 22% 65%,rgba(34,197,94,.8) 0%,transparent 100%),
    radial-gradient(3px 3px at 40% 35%,rgba(74,222,128,.7) 0%,transparent 100%),
    radial-gradient(2px 2px at 58% 80%,rgba(34,197,94,.9) 0%,transparent 100%),
    radial-gradient(3px 3px at 75% 15%,rgba(74,222,128,.8) 0%,transparent 100%),
    radial-gradient(2px 2px at 88% 55%,rgba(34,197,94,.7) 0%,transparent 100%),
    radial-gradient(3px 3px at 95% 85%,rgba(74,222,128,.9) 0%,transparent 100%);
  animation:crystal-shine 5s ease-in-out infinite;
}
html[data-app-theme="emerald"] .topbar{
  background:linear-gradient(90deg,#020d06,#1b4332 20%,rgba(34,197,94,.15) 50%,#1b4332 80%,#020d06) !important;
  background-size:300% 100% !important;
  animation:forest-sway 9s ease infinite !important;
  border-bottom:1px solid rgba(34,197,94,.25) !important;
  box-shadow:0 2px 20px rgba(34,197,94,.1) !important;
}
html[data-app-theme="emerald"] .dash-sidebar{
  background:linear-gradient(180deg,#020d06 0%,#06180a 30%,#0a2010 60%,#06180a 80%,#020d06 100%) !important;
  background-size:100% 300% !important;
  animation:forest-sway 12s ease infinite !important;
  border-right:1px solid rgba(34,197,94,.15) !important;
}
html[data-app-theme="emerald"] .sidebar-link:hover{background:rgba(34,197,94,.12) !important}
html[data-app-theme="emerald"] .sidebar-link--active{background:rgba(34,197,94,.18) !important;border-left-color:#22c55e !important;color:#4ade80 !important}
html[data-app-theme="emerald"] .stat-card{background:#06180a !important;border-color:rgba(34,197,94,.15) !important;transition:box-shadow .3s !important}
html[data-app-theme="emerald"] .stat-card:hover{box-shadow:0 0 24px rgba(34,197,94,.3),0 0 4px rgba(74,222,128,.2) !important}
html[data-app-theme="emerald"] .band-pill{background:linear-gradient(135deg,#166534,#22c55e) !important;box-shadow:0 0 12px rgba(34,197,94,.5) !important;color:#020d06 !important}
html[data-app-theme="emerald"] .btn-primary{background:linear-gradient(135deg,#14532d,#166534) !important;box-shadow:0 4px 15px rgba(34,197,94,.35) !important;color:#020d06 !important}

/* ═══════════════════════════════════════════
   SOLAR — Ancient golden sun, cosmic warmth,
   solar flares, amber energy pulses
   ═══════════════════════════════════════════ */
@keyframes sun-rotate{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes solar-flare{0%,100%{opacity:.05}30%{opacity:.18}60%{opacity:.08}}
@keyframes gold-aura{0%,100%{box-shadow:0 0 8px rgba(245,158,11,.2),0 0 20px rgba(245,158,11,.05)}50%{box-shadow:0 0 24px rgba(245,158,11,.5),0 0 50px rgba(251,191,36,.15)}}

html[data-app-theme="solar"] body{background:#0c0800 !important}
html[data-app-theme="solar"] body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(ellipse 800px 600px at 50% -10%,rgba(245,158,11,.15) 0%,transparent 60%),
    radial-gradient(ellipse 500px 400px at 20% 80%, rgba(251,191,36,.08) 0%,transparent 50%),
    radial-gradient(ellipse 600px 300px at 80% 60%, rgba(180,83,9,.1) 0%,transparent 50%),
    radial-gradient(ellipse 400px 400px at 50% 50%, rgba(245,158,11,.05) 0%,transparent 60%);
  animation:sun-rotate 7s ease infinite;
}
html[data-app-theme="solar"] body::after{
  content:"";position:fixed;top:0;left:0;right:0;height:40%;pointer-events:none;z-index:0;
  background:linear-gradient(180deg,rgba(245,158,11,.12) 0%,rgba(245,158,11,.04) 50%,transparent 100%);
  animation:solar-flare 5s ease-in-out infinite;
}
html[data-app-theme="solar"] .topbar{
  background:linear-gradient(90deg,#0c0800,#462e00 20%,rgba(245,158,11,.25) 50%,#462e00 80%,#0c0800) !important;
  background-size:300% 100% !important;
  animation:sun-rotate 5s ease infinite !important;
  border-bottom:1px solid rgba(245,158,11,.3) !important;
  box-shadow:0 2px 20px rgba(245,158,11,.2) !important;
}
html[data-app-theme="solar"] .dash-sidebar{
  background:linear-gradient(180deg,#0c0800 0%,#1a1000 30%,#281800 60%,#1a1000 80%,#0c0800 100%) !important;
  background-size:100% 300% !important;
  animation:sun-rotate 8s ease infinite !important;
  border-right:1px solid rgba(245,158,11,.2) !important;
}
html[data-app-theme="solar"] .sidebar-link:hover{background:rgba(245,158,11,.12) !important}
html[data-app-theme="solar"] .sidebar-link--active{background:rgba(245,158,11,.18) !important;border-left-color:#f59e0b !important;color:#fbbf24 !important}
html[data-app-theme="solar"] .stat-card{background:#1a1000 !important;border-color:rgba(245,158,11,.2) !important;animation:gold-aura 3s ease-in-out infinite !important}
html[data-app-theme="solar"] .band-pill{background:linear-gradient(135deg,#b45309,#f59e0b) !important;box-shadow:0 0 14px rgba(245,158,11,.6) !important;color:#0c0800 !important;animation:gold-aura 2s ease-in-out infinite !important}
html[data-app-theme="solar"] .btn-primary{background:linear-gradient(135deg,#92400e,#b45309) !important;box-shadow:0 4px 15px rgba(245,158,11,.4) !important;color:#fff8e0 !important;animation:gold-aura 2.5s ease-in-out infinite !important}
html[data-app-theme="solar"] .stat-val{color:#fbbf24 !important;text-shadow:0 0 20px rgba(245,158,11,.6) !important}

/* ═══════════════════════════════════════════
   BANNER FIXES — pdc-banner must show banners
   ═══════════════════════════════════════════ */
.pdc-banner{height:100px;background:linear-gradient(135deg,var(--brand),var(--brand-light));position:relative;overflow:hidden}
.pdc-banner.banner-aurora{background:linear-gradient(135deg,#0d0221,#4a00e0,#8e2de2,#00d2ff,#8e2de2,#4a00e0,#0d0221) !important;background-size:400% 400% !important;animation:banner-pan 7s ease infinite !important}
.pdc-banner.banner-lava{background:linear-gradient(135deg,#1a0000,#7f0000,#c8102e,#ff4500,#ff8c00,#ff4500,#c8102e,#7f0000) !important;background-size:400% 400% !important;animation:banner-pan 4s ease infinite !important}
.pdc-banner.banner-ocean{background:linear-gradient(135deg,#000428,#003d6b,#0077b6,#00b4d8,#48cae4,#00b4d8,#0077b6,#000428) !important;background-size:400% 400% !important;animation:banner-pan 6s ease infinite !important}
.pdc-banner.banner-forest{background:linear-gradient(135deg,#020e04,#0a1a0a,#1b4332,#2d6a4f,#52b788,#2d6a4f,#1b4332,#020e04) !important;background-size:400% 400% !important;animation:banner-pan 8s ease infinite !important}
.pdc-banner.banner-cosmic{background:linear-gradient(135deg,#04001a,#0e0030,#2e0060,#6600cc,#cc00ff,#6600cc,#2e0060,#04001a) !important;background-size:400% 400% !important;animation:banner-pan 5s ease infinite !important}

/* ═══════════════════════════════════════════
   BANNERS — profile card banners with !important
   ═══════════════════════════════════════════ */
.profile-banner{height:120px;position:relative;overflow:hidden;background:linear-gradient(135deg,var(--hover-bg),var(--surface2))}
.profile-section-banner{height:80px;border-radius:10px;margin-bottom:20px;overflow:hidden;background:linear-gradient(135deg,var(--hover-bg),var(--surface2));transition:background .3s}
@keyframes banner-pan{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes banner-pulse{0%,100%{opacity:1}50%{opacity:.8}}
@keyframes stars-drift{0%{background-position:0 0,50px 50px,100px 100px}100%{background-position:300px 300px,350px 350px,400px 400px}}
.banner-aurora{background:linear-gradient(135deg,#0d0221,#4a00e0,#8e2de2,#00d2ff,#8e2de2,#4a00e0,#0d0221) !important;background-size:400% 400% !important;animation:banner-pan 7s ease infinite !important}
.banner-lava{background:linear-gradient(135deg,#1a0000,#7f0000,#c8102e,#ff4500,#ff8c00,#ff4500,#c8102e,#7f0000) !important;background-size:400% 400% !important;animation:banner-pan 4s ease infinite !important}
.banner-ocean{background:linear-gradient(135deg,#000428,#003d6b,#0077b6,#00b4d8,#48cae4,#00b4d8,#0077b6,#000428) !important;background-size:400% 400% !important;animation:banner-pan 6s ease infinite !important}
.banner-forest{background:linear-gradient(135deg,#020e04,#0a1a0a,#1b4332,#2d6a4f,#52b788,#2d6a4f,#1b4332,#020e04) !important;background-size:400% 400% !important;animation:banner-pan 8s ease infinite !important}
.banner-cosmic{background:linear-gradient(135deg,#04001a,#0e0030,#2e0060,#6600cc,#cc00ff,#6600cc,#2e0060,#04001a) !important;background-size:400% 400% !important;animation:banner-pan 5s ease infinite !important;position:relative}
.banner-cosmic::before{content:"";position:absolute;inset:0;background-image:radial-gradient(1.5px 1.5px at 10% 20%,rgba(255,255,255,.9) 0%,transparent 100%),radial-gradient(1px 1px at 30% 60%,rgba(255,255,255,.7) 0%,transparent 100%),radial-gradient(2px 2px at 50% 10%,rgba(255,255,255,.8) 0%,transparent 100%),radial-gradient(1px 1px at 70% 80%,rgba(255,255,255,.6) 0%,transparent 100%),radial-gradient(1.5px 1.5px at 85% 40%,rgba(255,255,255,.9) 0%,transparent 100%),radial-gradient(2px 2px at 60% 50%,rgba(220,180,255,.7) 0%,transparent 100%);animation:stars-drift 14s linear infinite,banner-pulse 4s ease-in-out infinite}

/* ═══════════════════════════════════════════
   DISCORD-STYLE PROFILE CARD
   ═══════════════════════════════════════════ */
.discord-profile-card{background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:hidden;margin-bottom:24px;box-shadow:var(--shadow-lg)}
.dpc-banner{height:120px;background:linear-gradient(135deg,var(--brand),var(--brand-light));position:relative;overflow:hidden}
.dpc-avatar-row{padding:0 24px;margin-top:-44px;display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:12px;position:relative;z-index:2}
.dpc-avatar-wrap{width:92px;height:92px;border-radius:50%;background:var(--surface);display:flex;align-items:center;justify-content:center;flex-shrink:0;border:4px solid var(--surface);position:relative}
.dpc-avatar{width:80px;height:80px;border-radius:50%;background:var(--brand);color:#fff;font-size:2rem;font-weight:800;display:flex;align-items:center;justify-content:center;overflow:visible;position:relative}
.dpc-actions{display:flex;gap:8px;align-items:center;padding-bottom:8px}
.dpc-body{padding:0 24px 20px}
.dpc-name{font-size:1.3rem;font-weight:800;color:var(--text);margin-bottom:4px}
.dpc-role-badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 10px;border-radius:12px;margin-bottom:8px}
.dpc-role-badge--teacher{background:#fde8ec;color:#9b0d21}
.dpc-role-badge--student{background:var(--hover-bg);color:var(--brand)}
.dpc-since{font-size:12px;color:var(--text3);margin-bottom:10px}
.dpc-bio{font-size:14px;color:var(--text2);line-height:1.6}
.dpc-bio-empty{font-style:italic;color:var(--text3)}
.dpc-divider{height:1px;background:var(--border);margin:14px 0}
.dpc-stats{display:flex;gap:20px;flex-wrap:wrap}
.dpc-stat-val{font-size:1.1rem;font-weight:800;color:var(--brand)}
.dpc-stat-lbl{font-size:11px;color:var(--text3);text-transform:uppercase;letter-spacing:.5px}
