:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f3f4f6;
  --border: #d9dde3;
  --text: #111827;
  --text-muted: #4b5563;
  --primary: #23085a;
  --primary-hover: #18053f;
  --primary-soft: #f3f0fa;
  --accent-green: #15803d;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}
body.exam-mode {
  background: #ffffff;
}
body.a11y-large {
  font-size: 17.5px;
}

.hidden { display: none !important; }

/* Navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
}
.brand-dots {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  gap: 3px;
}
.brand-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  display: block;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.nav-btn:hover { background: var(--surface-alt); color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.user-pill { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }

/* Layout */
.main-content {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-title { margin: 0 0 4px; font-size: 24px; font-weight: 700; color: var(--text); }
.page-subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: #ffffff; border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--surface-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-vip { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--surface-alt); color: var(--text-muted); }

/* Resume Banner */
.resume-banner {
  background: var(--primary-soft);
  border: 1px solid #d4c8ee;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* Auth */
.auth-wrapper { max-width: 440px; margin: 48px auto; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.auth-tab {
  flex: 1; background: none; border: none; padding: 10px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(35, 8, 90, 0.12);
}

/* Exam & Skill Cards */
.exam-card {
  cursor: pointer; transition: transform 0.12s, border-color 0.15s;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
}
.exam-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.skill-mini-row { display: flex; gap: 6px; flex-wrap: wrap; }
.skill-card { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.skill-card.locked { background: #fafafa; border-style: dashed; }
.lock-box { background: var(--warning-bg); color: #92400e; border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* =========================================================
   BRITISH COUNCIL TESTREACH EXAM UI (3 MÀN HÌNH CHUẨN)
   ========================================================= */
.tr-start-wrap {
  max-width: 720px;
  margin: 44px auto;
  background: #ffffff;
  padding: 20px 10px;
}
.tr-subtitle { font-size: 20px; font-weight: 500; color: var(--text); margin: 0 0 10px; }
.tr-title { font-size: 32px; font-weight: 500; color: var(--text); margin: 0 0 28px; }
.tr-meta-row { display: flex; gap: 60px; flex-wrap: wrap; margin-bottom: 28px; }
.tr-meta-label { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.tr-meta-val { font-size: 16px; color: var(--text-muted); }

.tr-instructions-wrap {
  max-width: 680px;
  margin: 40px auto 110px;
  background: #ffffff;
  padding: 16px 10px;
}
.tr-instructions-wrap h2 { font-size: 26px; font-weight: 500; margin: 0 0 20px; }
.tr-instructions-wrap p { font-size: 15.5px; margin: 0 0 14px; color: #1f2937; }

/* Top-right floating countdown timer (giống ảnh 3: 00:39:57 Time remaining) */
.tr-timer-floating {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 35;
  background: #ffffff;
  padding: 6px 12px 8px;
  text-align: right;
  border-radius: 6px;
}
.tr-timer-digits {
  font-size: 23px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: #111827;
  line-height: 1.15;
}
.tr-timer-digits.urgent { color: var(--danger); }
.tr-timer-label { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.tr-timer-bar { height: 4px; width: 120px; background: #e5e7eb; border-radius: 2px; overflow: hidden; margin-left: auto; }
.tr-timer-bar-fill { height: 100%; background: var(--primary); transition: width 0.5s linear; }

/* Centered Question Area */
.tr-question-wrap {
  max-width: 820px;
  margin: 18px auto 110px;
  padding: 0 12px;
}
.tr-question-wrap.wide { max-width: 1100px; }

.tr-q-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.tr-q-skill { font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.tr-q-number { font-size: 23px; font-weight: 500; margin: 0; }

.tr-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.tr-bookmark-btn:hover { background: var(--surface-alt); }
.tr-bookmark-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* Listening Play/Stop link button (giống ảnh 3) */
.tr-audio-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 16px;
}
.tr-audio-trigger:disabled { opacity: 0.45; cursor: not-allowed; text-decoration: none; }

/* TestReach A / B / C Option Rows (giống ảnh 3) */
.tr-options-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  overflow: hidden;
  max-width: 680px;
}
.tr-option-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  border-bottom: 1px solid #d1d5db;
  cursor: pointer;
  background: #ffffff;
  transition: background 0.12s;
}
.tr-option-row:last-child { border-bottom: none; }
.tr-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 400;
  color: #111827;
  background: #ffffff;
  border-right: 1px solid #d1d5db;
  padding: 16px 0;
}
.tr-option-text {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  background: #f3f4f6;
  font-size: 15px;
  color: #111827;
}
.tr-option-row:hover .tr-option-text { background: #e9ecf0; }
.tr-option-row.selected .tr-option-letter {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}
.tr-option-row.selected .tr-option-text {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* Fixed Bottom Bar (giống ảnh 2 & 3) */
.tr-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tr-bottom-left, .tr-bottom-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tr-icon-btn {
  width: 42px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tr-icon-btn:hover { background: var(--surface-alt); }
.tr-icon-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Slide-over Question Palette Drawer */
.tr-palette-drawer {
  position: fixed;
  left: 16px;
  bottom: 70px;
  z-index: 55;
  width: 310px;
  max-width: calc(100vw - 32px);
  max-height: 65vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.q-num-btn {
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.q-num-btn.answered { background: var(--success-bg); border-color: #86efac; color: var(--success); }
.q-num-btn.current { border: 2px solid var(--primary); box-shadow: 0 0 0 2px rgba(35, 8, 90, 0.2); }
.q-num-btn.bookmarked::after {
  content: "⚑";
  position: absolute;
  top: -5px;
  right: 2px;
  font-size: 11px;
  color: var(--warning);
}

/* Reading / Writing Split */
.reading-split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.passage-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; white-space: pre-wrap; max-height: 460px; overflow-y: auto; font-size: 14.5px; line-height: 1.65;
}
.ordering-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; margin-bottom: 8px;
}
.writing-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.word-counter {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 6px; background: var(--surface-alt); font-weight: 700; font-size: 13px;
}
.word-counter.ok { background: var(--success-bg); color: var(--success); }
.word-counter.warn { background: var(--warning-bg); color: var(--warning); }

/* Speaking Recorder */
.speaking-panel { border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: #f8fafc; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
  border-radius: 999px; font-weight: 700; border: none; cursor: pointer; background: var(--primary); color: #fff;
}
.rec-btn.recording { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(185, 28, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}
.meter-bar { width: 100%; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter-fill { height: 100%; width: 0%; background: var(--success); transition: width 0.08s; }

/* Video Cards */
.video-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
}
.video-thumb {
  height: 130px;
  border-radius: 8px;
  background: linear-gradient(135deg, #23085a 0%, #4c1d95 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.video-thumb.locked {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}
.video-frame-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}
.video-frame-wrap iframe, .video-frame-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Tables & Admin */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-alt); font-weight: 700; color: var(--text-muted); font-size: 13px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }

/* Modal & Toast */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-card {
  background: #fff; border-radius: 12px; max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}
.toast-container { position: fixed; bottom: 72px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 8px; font-size: 13.5px; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

@media (max-width: 900px) {
  .grid-4, .grid-3, .grid-2, .grid-5, .reading-split, .writing-split { grid-template-columns: 1fr; }
  .tr-timer-floating { position: static; text-align: left; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--border); }
  .tr-timer-bar { margin-left: 0; }
}

/* Listening Q14 & Q15 Inline Dropdown Layout (chuẩn British Council) */
.tr-match-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tr-match-label {
  font-size: 15.5px;
  color: #111827;
  min-width: 115px;
}
.tr-match-select {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14.5px;
  background: #ffffff;
  color: #111827;
  min-width: 140px;
  max-width: 100%;
}
.tr-subq-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

/* === TESTREACH READING 5-PART UI (Q1-Q5) === */
.tr-reading-wrap { max-width: 860px; }
.tr-reading-instr { margin: 0 0 22px; font-size: 15.5px; font-weight: 700; color: #111827; line-height: 1.5; }
.tr-email-body { font-size: 16px; line-height: 2.1; color: #1f2937; }
.tr-email-line { margin: 0 0 14px; }
.tr-inline-select {
  display: inline-block;
  min-width: 112px;
  padding: 5px 10px;
  margin: 0 4px;
  font-size: 15px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  vertical-align: middle;
  cursor: pointer;
}
.tr-inline-select:focus { outline: 2px solid #23085a; border-color: #23085a; }
.tr-inline-example { background: #f9fafb; color: #111827; opacity: 1; cursor: default; }

/* Question 2 & 3: 2-Column Drag & Drop Ordering */
.tr-order-board {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  border: 1px solid #cbd5e1;
  background: #fff;
  min-height: 460px;
}
.tr-order-left { padding: 20px 22px; background: #fff; border-right: 1px solid #cbd5e1; }
.tr-order-title { font-size: 15.5px; font-weight: 700; color: #111827; margin-bottom: 14px; }
.tr-order-sent0 { margin: 0 0 20px; font-size: 14.5px; line-height: 1.65; color: #1f2937; }
.tr-order-slots { display: flex; flex-direction: column; gap: 14px; }
.tr-order-slot {
  min-height: 50px;
  border-radius: 3px;
  transition: all 0.15s ease;
}
.tr-order-slot.empty {
  border: 1.5px dashed #9ca3af;
  background: #f3f4f6;
}
.tr-order-slot.drag-over {
  border: 2px dashed #23085a;
  background: #ede9fe;
}
.tr-order-slot.filled {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #4b5563;
  background: #fff;
  cursor: grab;
}
.tr-slot-text { flex: 1; font-size: 14px; line-height: 1.5; color: #111827; }
.tr-card-grip { color: #6b7280; font-size: 14px; user-select: none; margin-top: 2px; }
.tr-slot-clear {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.tr-slot-clear:hover { color: #dc2626; }

.tr-order-right {
  padding: 16px;
  background: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tr-order-right.drag-over { background: #dbeafe; }
.tr-order-card {
  background: #fff;
  border: 1px solid #9ca3af;
  padding: 8px 14px 12px;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tr-order-card:hover { border-color: #23085a; box-shadow: 0 2px 6px rgba(35,8,90,0.12); }
.tr-order-card.dragging, .tr-order-slot.dragging { opacity: 0.45; }
.tr-card-grip-top { text-align: center; color: #374151; font-size: 13px; letter-spacing: 1px; margin-bottom: 4px; user-select: none; }
.tr-card-body { font-size: 14px; line-height: 1.5; color: #111827; }
.tr-order-done-hint { font-size: 13.5px; color: #374151; background: #fff; padding: 14px; border-radius: 6px; border: 1px dashed #9ca3af; }

/* Question 4: Opinion Matching */
.tr-opinion-texts { margin-bottom: 24px; }
.tr-opinion-person { margin-bottom: 18px; }
.tr-opinion-name { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.tr-opinion-body { margin: 0; font-size: 14.5px; line-height: 1.65; color: #1f2937; }
.tr-opinion-questions { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.tr-opinion-qrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; color: #111827; }
.tr-opinion-qtext { line-height: 1.5; }

/* Question 5: Heading Matching */
.tr-article-title { margin: 0 0 18px; font-size: 24px; font-weight: 500; color: #111827; }
.tr-headings-list { display: flex; flex-direction: column; gap: 22px; }
.tr-heading-select-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tr-heading-select {
  min-width: 280px;
  max-width: 100%;
  padding: 6px 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  border: 1px solid #9ca3af;
  border-radius: 4px;
}
.tr-heading-select:focus { outline: 2px solid #23085a; border-color: #23085a; }
.tr-heading-para { margin: 0; font-size: 14.5px; line-height: 1.75; color: #1f2937; }

@media (max-width: 768px) {
  .tr-order-board { grid-template-columns: 1fr; }
  .tr-order-left { border-right: none; border-bottom: 1px solid #cbd5e1; }
}

/* === TESTREACH SPEAKING UI (PROMPT + SIDEBAR INSTRUCTIONS/RECORDING) === */
.tr-speak-prompt-page {
  min-height: calc(100vh - 64px);
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px 24px 90px;
}
.tr-speak-prompt-inner {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}
.tr-speak-prompt-heading {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 36px;
}
.tr-speak-prompt-text {
  font-size: 15.5px;
  line-height: 1.65;
  color: #111827;
  margin: 0 0 18px;
}
.tr-speak-prompt-sound {
  font-size: 15.5px;
  color: #111827;
  margin: 0;
}

.tr-speak-layout {
  display: grid;
  grid-template-columns: 1fr 264px;
  min-height: calc(100vh - 20px);
  background: #fff;
}
.tr-speak-main {
  padding: 56px 48px 48px 72px;
  background: #fff;
}
.tr-speak-content {
  max-width: 760px;
}
.tr-speak-part-title {
  margin: 4px 0 32px;
  font-size: 22px;
  font-weight: 500;
  color: #111827;
}
.tr-speak-img-wrap {
  margin-bottom: 14px;
}
.tr-speak-img {
  display: block;
  max-width: 460px;
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  border-radius: 2px;
}
.tr-speak-img-wrap.dual .tr-speak-img {
  max-width: 640px;
  max-height: 340px;
}
.tr-speak-prompt-line {
  font-size: 15.5px;
  line-height: 1.65;
  color: #111827;
  margin-top: 8px;
}

.tr-speak-sidebar {
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 16px rgba(15, 23, 42, 0.06);
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}
.tr-speak-side-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.tr-speak-phase-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 26px;
}
.tr-speak-speaker-circle {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 8, 90, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tr-speak-ring-box {
  position: relative;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tr-speak-ring-svg { display: block; }
.tr-speak-ring-text {
  position: absolute;
  font-size: 32px;
  font-weight: 500;
  color: #23085a;
}
.tr-speak-wave-wrap {
  margin-top: 26px;
  width: 100%;
  display: flex;
  justify-content: center;
}
.tr-speak-side-msg {
  margin-top: 14px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}
.tr-speak-side-bottom {
  width: 100%;
}
.tr-finish-rec-btn {
  width: 100%;
  padding: 12px 16px;
  background: #23085a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.tr-finish-rec-btn:hover { opacity: 0.92; }
.tr-finish-rec-btn:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 820px) {
  .tr-speak-layout { grid-template-columns: 1fr; }
  .tr-speak-main { padding: 24px 18px; }
  .tr-speak-sidebar {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    gap: 20px;
  }
}

/* === TESTREACH WRITING 4-PART UI (Q1-Q4) === */
.tr-w-wrap { max-width: 680px; }
.tr-w-instr { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #111827; line-height: 1.55; }
.tr-w-example { margin: 0 0 24px; font-size: 14.5px; color: #1f2937; }
.tr-w-notice {
  margin: 0 0 26px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #1f2937;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.tr-w-list { display: flex; flex-direction: column; gap: 26px; }
.tr-w-item { display: flex; flex-direction: column; }
.tr-w-bm-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.tr-w-bm-btn {
  width: 38px;
  height: 36px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 4px;
  color: #111827;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tr-w-bm-btn.active { background: #23085a; color: #fff; border-color: #23085a; }
.tr-w-prompt { font-size: 14.5px; line-height: 1.55; color: #111827; margin-bottom: 12px; }
.tr-w-toolbar { display: flex; gap: 6px; margin-bottom: 10px; }
.tr-w-tool-btn {
  width: 30px;
  height: 28px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 3px;
  font-size: 13px;
  color: #111827;
  cursor: default;
}
.tr-w-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  outline: none;
}
.tr-w-input:focus, .tr-w-textarea:focus {
  border-color: #23085a;
  box-shadow: 0 0 0 2px rgba(35, 8, 90, 0.14);
}
.tr-w-textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
  resize: vertical;
  outline: none;
}
.tr-w-counter {
  text-align: right;
  margin-top: 8px;
  font-size: 13.5px;
  color: #374151;
}

/* ============================================================================
   APTIS PREP MODERN UI OVERHAUL (V7) — Thân thiện, tươi sáng, dễ hiểu
   (Giữ nguyên 100% phòng thi TestReach khi body có class .exam-mode)
   ============================================================================ */
:root {
  --bg-soft: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e5e9f2;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #3b28cc;
  --primary-hover: #2d1ca8;
  --primary-soft: #eef2ff;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 28px rgba(59, 40, 204, 0.10), 0 4px 10px rgba(15, 23, 42, 0.04);
}

body {
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body.exam-mode {
  background: #ffffff;
  --primary: #23085a;
  --primary-hover: #18053f;
  --radius: 10px;
}

/* Navbar hiện đại kiểu Prep */
.top-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: 68px; max-width: 1240px; }
.brand { gap: 10px; }
.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b28cc 0%, #6366f1 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(59, 40, 204, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 17px; font-weight: 800; color: #0f172a; }
.brand-sub { font-size: 11px; font-weight: 600; color: #6366f1; letter-spacing: 0.4px; }

.nav-btn {
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  transition: all 0.16s ease;
}
.nav-btn:hover { background: #f1f5f9; color: #0f172a; }
.nav-btn.active {
  background: #eef2ff;
  color: #3b28cc;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}
.user-pill {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #334155;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
  background: linear-gradient(135deg, #3b28cc 0%, #4f46e5 100%);
  box-shadow: 0 4px 12px rgba(59, 40, 204, 0.22);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2d1ca8 0%, #4338ca 100%);
  transform: translateY(-1px);
}

/* Auth 2 cột hiện đại */
.prep-auth-shell {
  max-width: 960px;
  margin: 34px auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.prep-auth-visual {
  background: linear-gradient(145deg, #23085a 0%, #3b28cc 55%, #6366f1 100%);
  color: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.prep-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  width: fit-content;
}
.prep-auth-visual h1 {
  margin: 18px 0 12px;
  font-size: 28px;
  line-height: 1.28;
  font-weight: 800;
}
.prep-auth-visual p {
  margin: 0 0 24px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.6;
}
.prep-feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prep-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.10);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
}
.prep-auth-form-col {
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Dashboard Hero + Mục tiêu ngày thi kiểu AptisPrep */
.prep-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.prep-hero-card {
  background: linear-gradient(135deg, #2b187a 0%, #3b28cc 55%, #6366f1 100%);
  color: #fff;
  border-radius: 20px;
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(59, 40, 204, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.prep-hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.prep-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 12px;
}
.prep-hero-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}
.prep-hero-sub {
  margin: 0 0 22px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 500px;
}
.prep-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-hero-white {
  background: #ffffff;
  color: #2b187a;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-hero-white:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.16); }
.btn-hero-ghost {
  background: rgba(255,255,255,0.14);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.28);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-hero-ghost:hover { background: rgba(255,255,255,0.22); }

/* Widget Mục tiêu & Ngày thi dự kiến */
.prep-goal-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.prep-goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.prep-goal-title { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; }
.prep-days-pill {
  background: #eef2ff;
  color: #3b28cc;
  font-weight: 700;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
}
.prep-band-row {
  display: flex;
  gap: 8px;
}
.prep-band-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  font-weight: 700;
  font-size: 13.5px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.prep-band-btn.active {
  background: #3b28cc;
  color: #fff;
  border-color: #3b28cc;
  box-shadow: 0 4px 10px rgba(59, 40, 204, 0.22);
}
.prep-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.prep-date-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  background: #f8fafc;
}
.prep-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.prep-stat-box {
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.prep-stat-num { font-size: 17px; font-weight: 800; color: #0f172a; }
.prep-stat-lbl { font-size: 11px; color: var(--text-muted); }

/* Lưới 5 kỹ năng luyện nhanh kiểu AptisPrep */
.prep-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.prep-section-title { margin: 0; font-size: 20px; font-weight: 800; color: #0f172a; }
.prep-section-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--text-muted); }

.prep-skill-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.prep-skill-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.prep-skill-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #c7d2fe;
}
.prep-skill-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}
.prep-skill-tile.sk-listening .prep-skill-icon { background: #eff6ff; color: #2563eb; }
.prep-skill-tile.sk-speaking .prep-skill-icon { background: #fff1f2; color: #e11d48; }
.prep-skill-tile.sk-reading .prep-skill-icon { background: #ecfdf5; color: #059669; }
.prep-skill-tile.sk-writing .prep-skill-icon { background: #fffbeb; color: #d97706; }
.prep-skill-tile.sk-core .prep-skill-icon { background: #f5f3ff; color: #7c3aed; }

.prep-skill-name { font-size: 15.5px; font-weight: 700; color: #0f172a; margin: 0 0 4px; }
.prep-skill-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; margin: 0; }
.prep-skill-cta {
  font-size: 13px;
  font-weight: 700;
  color: #3b28cc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Bộ lọc & Tìm kiếm Kho 23 Đề */
.prep-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.prep-search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.prep-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.prep-search-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14); }
.prep-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}
.prep-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.prep-pill-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.prep-pill-btn.active { background: #3b28cc; color: #fff; border-color: #3b28cc; }

/* Exam Card hiện đại có thanh tiến độ */
.exam-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
}
.exam-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #c7d2fe;
}
.prep-exam-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #3b28cc;
  font-size: 12px;
  font-weight: 700;
}
.prep-progress-track {
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.prep-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b28cc 0%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Skill detail cards trong openExam */
.prep-skill-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 1080px) {
  .prep-skill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .prep-auth-shell { grid-template-columns: 1fr; margin: 16px auto; }
  .prep-hero-grid { grid-template-columns: 1fr; }
  .prep-skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .prep-skill-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   APTIS PREP FULL LAYOUT V8 — SIDEBAR + TOPBAR + ROADMAP HERO + PRIORITY CARDS
   ============================================================================ */
.prep-shell {
  display: flex;
  min-height: 100vh;
  background: #f5f7fb;
}
body.exam-mode .prep-sidebar,
body.exam-mode .prep-topbar,
body.exam-mode .prep-notebook-fab {
  display: none !important;
}
body.exam-mode .prep-shell {
  display: block;
  background: #ffffff;
}
body.exam-mode .prep-main-wrap {
  margin-left: 0 !important;
  width: 100% !important;
}

/* SIDEBAR TRÁI */
.prep-sidebar {
  width: 262px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e5e9f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 45;
  transition: width 0.2s ease;
}
.prep-sidebar.collapsed { width: 76px; }
.prep-sidebar.collapsed .brand-text,
.prep-sidebar.collapsed .sb-lbl,
.prep-sidebar.collapsed .sb-chev,
.prep-sidebar.collapsed .prep-sb-group-lbl,
.prep-sidebar.collapsed .prep-acc-body,
.prep-sidebar.collapsed .prep-sb-foot-txt {
  display: none !important;
}
.prep-sb-head {
  height: 66px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}
.prep-sb-collapse {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prep-sb-collapse:hover { background: #f1f5f9; }
.prep-sb-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 18px;
}
.prep-sb-group-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.6px;
  padding: 12px 10px 6px;
}
.prep-sb-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}
.prep-sb-item:hover { background: #f1f5f9; color: #0f172a; }
.prep-sb-item.active {
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 700;
}
.sb-lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-chev { font-size: 13px; color: #94a3b8; transition: transform 0.15s; }
.prep-acc-toggle.open .sb-chev { transform: rotate(180deg); }
.prep-acc-body {
  padding: 2px 0 6px 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prep-sb-sub {
  border: none;
  background: transparent;
  text-align: left;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
}
.prep-sb-sub:hover { background: #f1f5f9; color: #1d4ed8; }

.prep-sb-foot {
  margin: 10px 12px 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.prep-sb-foot:hover { border-color: #c7d2fe; background: #eef2ff; }
.prep-sb-foot-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ede9fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.prep-sb-foot-tag { font-size: 11px; font-weight: 700; color: #6366f1; }
.prep-sb-foot-title { font-size: 12.5px; font-weight: 700; color: #0f172a; }

/* TOPBAR */
.prep-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.prep-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e9f2;
}
.prep-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.prep-mobile-menu {
  display: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
}
.prep-top-search {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  color: #64748b;
  font-size: 13.5px;
}
.prep-top-search:hover { border-color: #94a3b8; background: #fff; }
.prep-top-search-ph { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prep-kbd {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  font-family: inherit;
}
.prep-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prep-pill-pkg {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.prep-pill-pkg:hover { background: #ffedd5; }
.prep-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}
.prep-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* HERO LỘ TRÌNH 2 CỘT CHUẨN ẢNH APTISPREP */
.prep-v8-hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.prep-v8-banner {
  background: linear-gradient(125deg, #e0edff 0%, #f4f7ff 48%, #ffecd9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}
.prep-v8-kicker {
  display: inline-block;
  background: #ffedd5;
  color: #c2410c;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.prep-v8-title {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.prep-v8-title span { color: #c2410c; }
.prep-v8-desc {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: #475569;
  max-width: 420px;
}
.prep-v8-band-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}
.prep-v8-band-pill {
  border: none;
  background: transparent;
  padding: 7px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}
.prep-v8-band-pill.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.prep-v8-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-prep-orange {
  background: #c2410c;
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-prep-orange:hover { background: #9a3412; }
.btn-prep-soft {
  background: #dbeafe;
  color: #1e3a8a;
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-prep-soft:hover { background: #bfdbfe; }
.prep-v8-mascot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CARD PHẢI: MỤC TIÊU B1/B2/C1 (LƯỚI 2x2) */
.prep-v8-goal {
  background: #ffffff;
  border: 1px solid #e5e9f2;
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prep-v8-goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prep-v8-goal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.prep-v8-time-pill {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}
.prep-v8-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.prep-v8-target-box {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 12px 14px;
}
.prep-v8-target-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.prep-v8-target-sk { font-size: 12.5px; font-weight: 700; color: #334155; }
.prep-v8-target-num { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.prep-v8-target-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.tag-teal { background: #ccfbf1; color: #0f766e; }
.tag-sage { background: #dcfce7; color: #166534; }
.prep-v8-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #1e3a8a;
  line-height: 1.5;
}

/* KHỐI CHIẾN LƯỢC AIM + 4 THẺ THỨ TỰ ƯU TIÊN */
.prep-v8-strategy {
  background: #ffffff;
  border: 1px solid #e5e9f2;
  border-radius: 22px;
  padding: 24px 26px;
  margin-bottom: 28px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}
.prep-v8-priority-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.prep-prio-card {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.prep-prio-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
}
.prep-prio-card.p1 { background: #f0fdf4; border-color: #bbf7d0; }
.prep-prio-card.p2 { background: #fff7ed; border-color: #fed7aa; }
.prep-prio-card.p3 { background: #faf5ff; border-color: #e9d5ff; }
.prep-prio-card.p4 { background: #eff6ff; border-color: #bfdbfe; }
.prep-prio-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.p1 .prep-prio-num { background: #16a34a; }
.p2 .prep-prio-num { background: #ea580c; }
.p3 .prep-prio-num { background: #9333ea; }
.p4 .prep-prio-num { background: #2563eb; }

/* NÚT SỔ TAY NỔI */
.prep-notebook-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.35);
}
.prep-notebook-fab:hover { background: #1e40af; transform: translateY(-1px); }

@media (max-width: 1100px) {
  .prep-v8-hero { grid-template-columns: 1fr; }
  .prep-v8-priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .prep-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    transition: left 0.2s ease;
  }
  .prep-sidebar.mobile-open { left: 0; box-shadow: 10px 0 30px rgba(15,23,42,0.18); }
  .prep-mobile-menu { display: inline-flex; }
  .prep-v8-mascot { display: none; }
  .prep-v8-priority-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   MOBILE RESPONSIVE FIX V9 — CHỐNG TRÀN KHUNG, CHÈN CHỮ & NHẢY CỠ CHỮ (320-768px)
   ============================================================================ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  overflow-x: hidden;
  max-width: 100%;
}
img, svg, canvas, video, iframe {
  max-width: 100%;
}
.prep-sb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 44;
  backdrop-filter: blur(2px);
}

/* Đảm bảo chữ dài không bao giờ phá khung */
.card, .prep-v8-banner, .prep-v8-goal, .prep-v8-strategy, .prep-prio-card,
.tr-reading-wrap, .tr-w-wrap, .tr-speak-content, .modal-card {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Chống bảng bị tràn ngang */
.table-wrap, table {
  max-width: 100%;
}

@media (max-width: 860px) {
  .prep-sidebar {
    z-index: 60;
    width: 272px !important;
  }
  .prep-sidebar.collapsed {
    width: 272px !important;
  }
  .prep-sidebar.collapsed .brand-text,
  .prep-sidebar.collapsed .sb-lbl,
  .prep-sidebar.collapsed .sb-chev,
  .prep-sidebar.collapsed .prep-sb-group-lbl,
  .prep-sidebar.collapsed .prep-sb-foot-txt {
    display: block !important;
  }
  .prep-sb-collapse { display: none !important; }

  .prep-topbar-inner {
    height: 58px;
    padding: 0 12px;
    gap: 8px;
  }
  .prep-top-search {
    min-width: 0;
    padding: 7px 11px;
    font-size: 13px;
  }
  .prep-kbd { display: none !important; }
  .prep-pill-pkg { display: none !important; }
  #nav-user-name { display: none !important; }
  .prep-user-chip {
    padding: 4px;
    border-radius: 50%;
  }
  #logout-btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .main-content {
    padding: 14px 12px 92px;
    width: 100%;
    max-width: 100%;
  }

  /* Lưới chuyển gọn về 1 cột để không bị bóp chữ */
  .grid-2, .grid-3, .grid-4, .grid-5,
  .reading-split, .writing-split {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Auth 2 cột -> 1 cột gọn gàng trên điện thoại */
  .prep-auth-shell {
    margin: 10px 0;
    border-radius: 16px;
  }
  .prep-auth-visual {
    padding: 22px 18px;
  }
  .prep-auth-visual h1 { font-size: 21px; }
  .prep-auth-visual p { font-size: 13.5px; margin-bottom: 14px; }
  .prep-feature-item { font-size: 12.5px; padding: 8px 10px; }
  .prep-auth-form-col { padding: 22px 18px; }

  /* Hero Lộ trình & Mục tiêu trên điện thoại */
  .prep-v8-hero { gap: 14px; margin-bottom: 16px; }
  .prep-v8-banner {
    padding: 18px 16px;
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .prep-v8-title { font-size: 22px; }
  .prep-v8-desc { font-size: 13.5px; margin-bottom: 14px; }
  .prep-v8-band-tabs { width: 100%; justify-content: space-between; }
  .prep-v8-band-pill { flex: 1; padding: 7px 10px; font-size: 13.5px; text-align: center; }
  .prep-v8-cta-row { width: 100%; }
  .btn-prep-orange, .btn-prep-soft {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .prep-v8-goal { padding: 16px; border-radius: 16px; }
  .prep-v8-goal-head { flex-wrap: wrap; }
  .prep-v8-goal-title { font-size: 15.5px; }
  .prep-v8-2x2 { gap: 8px; }
  .prep-v8-target-box { padding: 10px; }
  .prep-v8-target-num { font-size: 19px; }
  .prep-v8-target-tag { font-size: 10.5px; padding: 2px 7px; }

  .prep-v8-strategy { padding: 16px; border-radius: 16px; margin-bottom: 18px; }
  .prep-v8-strategy h2 { font-size: 17px !important; }
  .prep-v8-priority-grid { grid-template-columns: 1fr !important; gap: 10px; }

  /* Toolbar tìm kiếm & bộ lọc Kho đề */
  .prep-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .prep-search-box { max-width: 100%; width: 100%; }
  .prep-filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .prep-pill-btn { white-space: nowrap; flex-shrink: 0; font-size: 12.5px; padding: 6px 12px; }

  .page-title { font-size: 20px; }
  .prep-section-title { font-size: 18px; }

  /* Nút Sổ tay thu gọn tránh che nội dung */
  .prep-notebook-fab {
    right: 12px;
    bottom: 14px;
    padding: 8px 13px;
    font-size: 12.5px;
    border-radius: 999px;
  }

  /* Modal vừa khít màn hình điện thoại */
  .modal-card {
    width: calc(100vw - 24px) !important;
    max-width: 100% !important;
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px 16px !important;
  }

  /* Chống Safari/iOS tự phóng to làm vỡ khung khi bấm ô nhập hoặc dropdown */
  input, select, textarea,
  .form-input, .form-select, .form-textarea,
  .tr-inline-select, .tr-heading-select, .tr-match-select,
  .tr-w-input, .tr-w-textarea, .prep-search-input {
    font-size: 16px !important;
  }

  /* === PHÒNG THI TESTREACH TRÊN ĐIỆN THOẠI === */
  .tr-top-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px !important;
  }
  .tr-q-title, .tr-title { font-size: 19px !important; }
  .tr-start-wrap, .tr-instructions-wrap {
    padding: 16px 12px 96px !important;
  }
  .tr-meta-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .tr-bottom-bar {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .tr-bottom-bar .btn {
    padding: 8px 11px !important;
    font-size: 13px !important;
  }

  /* Reading Q1-Q5 trên mobile */
  .tr-reading-wrap, .tr-w-wrap { max-width: 100%; }
  .tr-reading-instr { font-size: 14.5px; margin-bottom: 14px; }
  .tr-email-body { font-size: 15px; line-height: 2.0; }
  .tr-inline-select {
    min-width: 96px;
    max-width: 100%;
    padding: 4px 8px;
  }
  .tr-order-board { grid-template-columns: 1fr !important; min-height: auto; }
  .tr-order-left { padding: 14px 12px; border-right: none; border-bottom: 1px solid #cbd5e1; }
  .tr-order-right { padding: 12px; }
  .tr-opinion-qrow { flex-direction: column; align-items: stretch; gap: 6px; }
  .tr-opinion-qrow .tr-inline-select { width: 100%; margin: 0; }
  .tr-article-title { font-size: 20px; }
  .tr-heading-select-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .tr-heading-select { min-width: 0 !important; width: 100% !important; }

  /* Listening Q14-Q15 dropdown trên mobile */
  .tr-match-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  .tr-match-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Speaking Prompt & Sidebar trên mobile */
  .tr-speak-prompt-page { padding: 20px 14px 90px; }
  .tr-speak-main { padding: 18px 14px; }
  .tr-speak-part-title { font-size: 19px; margin-bottom: 16px; }
  .tr-speak-sidebar { padding: 16px 14px; }
}

@media (max-width: 380px) {
  .prep-v8-2x2 { grid-template-columns: 1fr; }
}

/* Trang Thanh toán chuyển khoản responsive PC 2 cột -> Mobile 1 cột */
.prep-pay-shell {
  max-width: 920px;
  margin: 10px auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
@media (max-width: 860px) {
  .prep-pay-shell {
    grid-template-columns: 1fr !important;
    margin: 4px 0 24px;
  }
  .prep-pay-shell > div {
    padding: 20px 16px !important;
  }
  .prep-pay-shell h2 {
    font-size: 17px !important;
    line-height: 1.4 !important;
  }
}

/* === FIX CHỐNG NẨY / XÊ DỊCH KHUNG NGANG KHI CHUYỂN TAB (V16) === */
html {
  scrollbar-gutter: stable;
}
.prep-main-wrap {
  width: 100%;
  min-width: 0;
}
.main-content {
  width: 100% !important;
  max-width: 1240px;
  margin: 0 auto;
}


/* === EMERALD SPLIT AUTH UI (v21) === */
.em-auth-page {
  position: relative;
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: #f6f7fb;
  overflow: hidden;
}
.em-auth-page::before {
  content: "";
  position: fixed;
  top: -110px;
  left: -90px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.20), rgba(99, 102, 241, 0));
  pointer-events: none;
}
.em-auth-page::after {
  content: "";
  position: fixed;
  bottom: -120px;
  right: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16), rgba(168, 85, 247, 0));
  pointer-events: none;
}
.em-auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 44% 56%;
  background: #ffffff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(37, 27, 122, 0.12), 0 4px 16px rgba(37, 27, 122, 0.05);
}
.em-auth-left {
  position: relative;
  background: linear-gradient(155deg, #1e1654 0%, #3726a6 55%, #5b3df5 100%);
  color: #ffffff;
  padding: 36px 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.em-auth-left::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, 0.045);
  pointer-events: none;
}
.em-auth-left::after {
  content: "";
  position: absolute;
  bottom: -90px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: none;
}
.em-brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
}
.em-brand-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.em-brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.em-brand-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.72); }
.em-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e0e7ff;
  margin-bottom: 16px;
}
.em-left-title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.em-left-sub {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(238, 242, 255, 0.85);
}
.em-glass-list { display: flex; flex-direction: column; gap: 11px; }
.em-glass-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.11);
}
.em-glass-ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
}
.em-glass-item strong { display: block; font-size: 13.5px; color: #fff; margin-bottom: 2px; }
.em-glass-item span { display: block; font-size: 12px; color: rgba(224, 231, 255, 0.78); }
.em-left-foot {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(238, 242, 255, 0.85);
}
.em-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.25);
}
.em-auth-right {
  padding: 40px 46px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.em-right-title { margin: 0 0 4px; font-size: 26px; font-weight: 800; color: #0f172a; letter-spacing: -0.02em; }
.em-right-sub { margin: 0 0 22px; font-size: 13.5px; color: #64748b; }
.em-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid #d8dcf5;
  background: #f8f9ff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.em-google-btn:hover { background: #eef2ff; border-color: #a5b4fc; }
.em-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: #94a3b8;
  font-size: 12px;
}
.em-divider::before, .em-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.em-field { margin-bottom: 14px; }
.em-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}
.em-field label .req { color: #ef4444; }
.em-field .form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d7e0ea;
  border-radius: 11px;
  font-size: 14.5px;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.em-field .form-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.em-hint { font-size: 11.5px; color: #64748b; margin-top: 5px; }
.em-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.em-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 18px;
  font-size: 13px;
  color: #475569;
}
.em-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #475569; }
.em-link {
  background: none;
  border: none;
  padding: 0;
  color: #3b28cc;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.em-link:hover { text-decoration: underline; }
.em-submit-wrap { position: relative; margin-top: 4px; }
.em-last-badge {
  position: absolute;
  top: -11px;
  right: 14px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  pointer-events: none;
}
.em-submit-btn {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #3b28cc;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.em-submit-btn:hover { background: #2e1fa3; }
.em-submit-btn:disabled { background: #a8a8a3; cursor: not-allowed; }
.em-pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 14px;
  font-size: 12px;
  color: #64748b;
}
.em-pw-rule { display: inline-flex; align-items: center; gap: 5px; }
.em-pw-rule i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
}
.em-pw-rule.ok { color: #15803d; font-weight: 600; }
.em-pw-rule.ok i { background: #16a34a; }
.em-switch-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: #64748b;
}
@media (max-width: 820px) {
  .em-auth-card { grid-template-columns: 1fr; max-width: 480px; }
  .em-auth-left { padding: 26px 24px; }
  .em-left-title { font-size: 24px; }
  .em-auth-right { padding: 28px 24px; }
  .em-row-2 { grid-template-columns: 1fr; }
}


/* =====================================================================
   APTIS ED — TICKET CARDS + LIGHT / DARK MODE TOGGLE (v28)
   ===================================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.theme-toggle-btn:hover { background: #f1f5f9; border-color: #94a3b8; }

/* === TICKET CARDS (LIGHT MODE DEFAULT: vibrant top + crisp white bottom) === */
.tk-card {
  position: relative;
  border-radius: 18px !important;
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.tk-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12) !important;
}
.tk-top {
  position: relative;
  padding: 16px 16px 18px;
  color: #ffffff;
  text-align: center;
}
.tk-g-0 .tk-top { background: linear-gradient(155deg, #3b82f6 0%, #1d4ed8 65%, #172554 100%); }
.tk-g-1 .tk-top { background: linear-gradient(155deg, #ef4444 0%, #b91c1c 65%, #450a0a 100%); }
.tk-g-2 .tk-top { background: linear-gradient(155deg, #9333ea 0%, #6d28d9 65%, #2e1065 100%); }
.tk-g-3 .tk-top { background: linear-gradient(155deg, #22c55e 0%, #15803d 65%, #052e16 100%); }
.tk-g-4 .tk-top { background: linear-gradient(155deg, #f97316 0%, #c2410c 65%, #431407 100%); }
.tk-g-5 .tk-top { background: linear-gradient(155deg, #475569 0%, #1e293b 65%, #0f172a 100%); }

.tk-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tk-stock-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.36); border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11.5px; font-weight: 700; color: #ffffff;
}
.tk-bolt {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(15, 23, 42, 0.36); display: grid; place-items: center; font-size: 12px;
}
.tk-icon-tile {
  width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 13px;
  background: #ffffff; color: #0f172a; display: grid; place-items: center;
  font-size: 20px; font-weight: 800; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.tk-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: #ffffff !important; }
.tk-sub-pill {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: #ffffff;
}
.tk-perf {
  border-top: 1.5px dashed rgba(255, 255, 255, 0.32);
  margin: 12px -16px 0; padding: 9px 16px 0;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.92);
}
.tk-bottom {
  padding: 14px 16px 16px;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tk-bottom-lbl { font-size: 11.5px; color: #64748b; }
.tk-bottom-val { font-size: 15px; font-weight: 800; color: #0f172a; }
.tk-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.tk-plus-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #ffffff;
  font-size: 17px; font-weight: 700; cursor: pointer; display: grid; place-items: center; flex-shrink: 0;
}

/* === COBALT BOARDING-PASS AUTH SCREEN === */
.ls-auth-page {
  position: relative; min-height: 100vh; width: 100%;
  background: linear-gradient(135deg, #2b54f5 0%, #3b6cf7 52%, #2448d8 100%);
  display: flex; align-items: center; justify-content: center; padding: 32px 20px; overflow: hidden;
}
.ls-auth-page::before {
  content: ""; position: absolute; left: -8%; bottom: 18%; width: 116%; height: 260px;
  border-top: 5px solid rgba(255, 255, 255, 0.85); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: rotate(-10deg); pointer-events: none; opacity: 0.55;
}
.ls-auth-wrap {
  position: relative; z-index: 2; width: 100%; max-width: 1020px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center;
}
.ls-auth-hero { color: #ffffff; }
.ls-auth-kicker { font-size: 18px; font-weight: 500; opacity: 0.9; margin-bottom: 8px; }
.ls-auth-brand { margin: 0 0 18px; font-size: 62px; font-weight: 900; line-height: 0.98; letter-spacing: -0.03em; color: #ffffff !important; }
.ls-auth-desc { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); max-width: 420px; }
.ls-ticket-card {
  position: relative; background: #ffffff; color: #0f172a; border-radius: 24px;
  padding: 28px 30px 26px; box-shadow: 0 28px 70px rgba(10, 25, 85, 0.35);
}
.ls-ticket-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ls-ticket-head h2 { margin: 0; font-size: 22px; font-weight: 800; color: #0f172a !important; }
.ls-boarding-tag { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #2b54f5; }
.ls-seg-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f1f5f9; padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.ls-seg-tab { padding: 9px 10px; border: none; border-radius: 9px; background: transparent; color: #475569; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.ls-seg-tab.active { background: #ffffff; color: #0f172a; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08); }
.ls-ticket-card .form-input { background: #f8fafc !important; border: 1px solid #cbd5e1 !important; color: #0f172a !important; border-radius: 11px; }
.ls-ticket-card label { color: #1e293b !important; }
.ls-midnight-btn { width: 100%; padding: 13px 16px; border: none; border-radius: 12px; background: #0d1124; color: #ffffff; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.ls-midnight-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ls-notch-divider { position: relative; margin: 20px -30px 16px; padding: 0 30px; border-top: 1.5px dashed #e2e8f0; text-align: center; }
.ls-notch-divider::before, .ls-notch-divider::after { content: ""; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: #2f5cf5; }
.ls-notch-divider::before { left: -9px; }
.ls-notch-divider::after { right: -9px; }
.ls-notch-label { display: inline-block; margin-top: 10px; font-size: 12px; color: #64748b; }
.ls-social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ls-social-pill { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 999px; border: 1px solid #e2e8f0; background: #ffffff; color: #0f172a; font-size: 13.5px; font-weight: 700; cursor: pointer; }

/* =====================================================================
   DARK MODE (100% SCOPED TO html[data-theme="dark"] body:not(.exam-mode) — HIGH CONTRAST)
   ===================================================================== */
html[data-theme="dark"] body:not(.exam-mode) {
  --bg: #070c1b;
  --surface: #0e172c;
  --surface-2: #15213d;
  --border: rgba(148, 163, 184, 0.18);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
}
html[data-theme="dark"] body:not(.exam-mode),
html[data-theme="dark"] body:not(.exam-mode) .prep-shell,
html[data-theme="dark"] body:not(.exam-mode) .prep-main-wrap {
  background-color: #070c1b !important;
  background-image:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, 0.14), transparent 40%),
    radial-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px) !important;
  background-size: 100% 100%, 24px 24px !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-topbar,
html[data-theme="dark"] body:not(.exam-mode) #top-nav {
  background: rgba(9, 15, 32, 0.92) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-sidebar,
html[data-theme="dark"] body:not(.exam-mode) #prep-sidebar {
  background: #0a1022 !important;
  border-right: 1px solid rgba(148, 163, 184, 0.16) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-item,
html[data-theme="dark"] body:not(.exam-mode) .prep-acc-toggle,
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-sub {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-item:hover,
html[data-theme="dark"] body:not(.exam-mode) .prep-acc-toggle:hover,
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-sub:hover {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-item.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-foot {
  background: #131f3a !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-sb-foot-title { color: #f8fafc !important; }
html[data-theme="dark"] body:not(.exam-mode) .prep-top-search,
html[data-theme="dark"] body:not(.exam-mode) .prep-user-chip,
html[data-theme="dark"] body:not(.exam-mode) .theme-toggle-btn {
  background: #131f3a !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-kbd {
  background: #0a1122 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-pill-pkg {
  background: rgba(251, 191, 36, 0.16) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fde68a !important;
}
html[data-theme="dark"] body:not(.exam-mode) .brand-name,
html[data-theme="dark"] body:not(.exam-mode) .page-title,
html[data-theme="dark"] body:not(.exam-mode) .prep-section-title,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-title,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-goal-title,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-target-num,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-target-sk,
html[data-theme="dark"] body:not(.exam-mode) .prep-skill-name,
html[data-theme="dark"] body:not(.exam-mode) h1, html[data-theme="dark"] body:not(.exam-mode) h2, html[data-theme="dark"] body:not(.exam-mode) h3, html[data-theme="dark"] body:not(.exam-mode) h4 {
  color: #f8fafc !important;
}
html[data-theme="dark"] body:not(.exam-mode) .brand-sub,
html[data-theme="dark"] body:not(.exam-mode) .page-subtitle,
html[data-theme="dark"] body:not(.exam-mode) .prep-section-sub,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-desc,
html[data-theme="dark"] body:not(.exam-mode) .prep-skill-desc {
  color: #94a3b8 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .card,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-banner,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-hero,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-goal,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-strategy,
html[data-theme="dark"] body:not(.exam-mode) .modal-box,
html[data-theme="dark"] body:not(.exam-mode) .modal-content,
html[data-theme="dark"] body:not(.exam-mode) .table-wrap {
  background: #0e172c !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.45) !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-target-box,
html[data-theme="dark"] body:not(.exam-mode) .prep-prio-card,
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-note,
html[data-theme="dark"] body:not(.exam-mode) .passage-box {
  background: #131f3a !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-band-tabs {
  background: #0a1122 !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-band-pill { color: #cbd5e1 !important; }
html[data-theme="dark"] body:not(.exam-mode) .prep-v8-band-pill.active { background: #3b82f6 !important; color: #ffffff !important; }
html[data-theme="dark"] body:not(.exam-mode) .prep-pill-btn,
html[data-theme="dark"] body:not(.exam-mode) .btn-outline {
  background: #131f3a !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] body:not(.exam-mode) .prep-pill-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}
html[data-theme="dark"] body:not(.exam-mode) .form-input,
html[data-theme="dark"] body:not(.exam-mode) .form-select,
html[data-theme="dark"] body:not(.exam-mode) .prep-search-box,
html[data-theme="dark"] body:not(.exam-mode) .prep-search-input {
  background: #0a1122 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] body:not(.exam-mode) .form-label { color: #cbd5e1 !important; }
html[data-theme="dark"] body:not(.exam-mode) table th { background: #15213d !important; color: #f1f5f9 !important; border-color: rgba(148,163,184,0.16) !important; }
html[data-theme="dark"] body:not(.exam-mode) table td { color: #cbd5e1 !important; border-color: rgba(148,163,184,0.14) !important; }
html[data-theme="dark"] body:not(.exam-mode) .tk-card { background: #0b1224 !important; border-color: rgba(255,255,255,0.14) !important; }
html[data-theme="dark"] body:not(.exam-mode) .tk-bottom { background: #0b1224 !important; color: #f1f5f9 !important; }
html[data-theme="dark"] body:not(.exam-mode) .tk-bottom-lbl { color: #94a3b8 !important; }
html[data-theme="dark"] body:not(.exam-mode) .tk-bottom-val { color: #f8fafc !important; }

/* Giữ phòng thi TestReach luôn nền sáng dễ đọc */
html[data-theme="dark"] body:not(.exam-mode) .tr-shell,
html[data-theme="dark"] body:not(.exam-mode) .tr-body,
html[data-theme="dark"] body:not(.exam-mode) .tr-card,
html[data-theme="dark"] body:not(.exam-mode) .tr-w-wrap,
html[data-theme="dark"] body:not(.exam-mode) .tr-w-notice,
html[data-theme="dark"] body:not(.exam-mode) .tr-w-item {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="dark"] body:not(.exam-mode) .tr-shell h1, html[data-theme="dark"] body:not(.exam-mode) .tr-shell h2, html[data-theme="dark"] body:not(.exam-mode) .tr-shell h3,
html[data-theme="dark"] body:not(.exam-mode) .tr-shell h4, html[data-theme="dark"] body:not(.exam-mode) .tr-shell p, html[data-theme="dark"] body:not(.exam-mode) .tr-shell strong, html[data-theme="dark"] body:not(.exam-mode) .tr-shell label {
  color: #0f172a !important;
}
html[data-theme="dark"] body:not(.exam-mode) .tr-shell .tr-w-textarea, html[data-theme="dark"] body:not(.exam-mode) .tr-shell input, html[data-theme="dark"] body:not(.exam-mode) .tr-shell select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

@media (max-width: 860px) {
  .ls-auth-wrap { grid-template-columns: 1fr; gap: 22px; }
  .ls-auth-brand { font-size: 40px; }
  .ls-auth-hero { text-align: center; }
}


/* Đảm bảo tuyệt đối mọi màn hình phòng thi (Core, Reading, Listening, Writing, Speaking) luôn ở chế độ sáng chuẩn TestReach */
body.exam-mode {
  background: #f5f6f8 !important;
  background-image: none !important;
  color: #111827 !important;
}
body.exam-mode .prep-shell,
body.exam-mode .prep-main-wrap,
body.exam-mode #main-content {
  background: #f5f6f8 !important;
  background-image: none !important;
  color: #111827 !important;
}


/* ============================================================================
   V36: GIAO DIỆN CHỌN KỸ NĂNG ACCORDION + PHÒNG THI SẠCH CHUẨN BRITISH COUNCIL / VTED
   ============================================================================ */
.vted-select-wrap {
  max-width: 780px;
  margin: 12px auto 40px;
}
.vted-select-heading {
  font-size: 16.5px;
  font-weight: 700;
  color: #4b5563;
  margin: 0 0 18px;
}
html[data-theme="dark"] body:not(.exam-mode) .vted-select-heading {
  color: #cbd5e1;
}
.vted-acc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vted-acc-item {
  border-radius: 2px;
  overflow: hidden;
}
.vted-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: #dcd9e3;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.16s ease;
}
.vted-acc-head:hover {
  background: #d2cedc;
}
.vted-acc-title {
  font-size: 18px;
  font-weight: 500;
  color: #111827;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}
.vted-acc-sign {
  font-size: 22px;
  font-weight: 500;
  color: #374151;
  line-height: 1;
  margin-left: 12px;
}
.vted-acc-body {
  background: #f5f6f8;
  padding: 24px 24px 28px;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}
.vted-acc-desc {
  margin: 0 0 22px;
  font-size: 15.5px;
  line-height: 1.7;
  color: #4b5563;
  max-width: 680px;
}
.vted-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.vted-pill-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 218px;
  padding: 13px 28px;
  border-radius: 999px;
  border: none;
  background: #2557b8;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease;
}
.vted-pill-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.vted-pill-sub {
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0.96;
}
html[data-theme="dark"] body:not(.exam-mode) .vted-acc-head {
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
html[data-theme="dark"] body:not(.exam-mode) .vted-acc-head:hover {
  background: rgba(38, 52, 74, 0.96);
}
html[data-theme="dark"] body:not(.exam-mode) .vted-acc-title,
html[data-theme="dark"] body:not(.exam-mode) .vted-acc-sign {
  color: #f1f5f9;
}
html[data-theme="dark"] body:not(.exam-mode) .vted-acc-body {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-top: none;
}
html[data-theme="dark"] body:not(.exam-mode) .vted-acc-desc {
  color: #cbd5e1;
}

/* Màn hình Instructions & Phòng thi sạch (Ảnh 6–10) */
.vted-instr-page {
  min-height: calc(100vh - 76px);
  background: #ffffff;
  padding: 56px 24px 100px;
}
.vted-instr-inner {
  max-width: 760px;
  margin: 0 auto;
  color: #111827;
}
.vted-instr-title {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px;
}
.vted-instr-skill {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 14px;
}
.vted-instr-body p {
  font-size: 15px;
  line-height: 1.75;
  color: #1f2937;
  margin: 0 0 12px;
}
.vted-bottom-bar {
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}
.vted-exit-btn {
  width: 42px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 18px;
  cursor: pointer;
}
.vted-next-btn {
  height: 40px;
  padding: 0 22px;
  border-radius: 6px;
  border: none;
  background: #2557b8;
  color: #ffffff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}
.vted-next-btn:hover {
  background: #1d4ed8;
}

/* Header trong phòng thi: Writing / Question 1 of 4 / 00: 02: 53 / Bookmark */
.vted-exam-wrap {
  max-width: 860px !important;
  margin: 0 auto;
  padding-top: 26px !important;
}
.vted-exam-top {
  margin-bottom: 18px;
}
.vted-exam-skill {
  font-size: 30px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.vted-exam-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.vted-exam-qnum {
  font-size: 22px;
  font-weight: 500;
  color: #1f2937;
  margin: 0;
}
.vted-inline-timer {
  font-size: 21px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}
.vted-inline-timer.urgent {
  color: #dc2626;
}
.vted-bookmark-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.vted-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.vted-bookmark-btn.active {
  border-color: #2557b8;
  color: #2557b8;
  background: #eff6ff;
}

/* Khung soạn thảo Writing chuẩn toolbar giống ảnh mẫu 7–10 */
.vted-editor-box {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
  margin-top: 8px;
}
.vted-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 9px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
  font-size: 13.5px;
  user-select: none;
}
.vted-tb-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #4b5563;
}
.vted-tb-sep {
  width: 1px;
  height: 16px;
  background: #e2e8f0;
}
.vted-tb-icon {
  font-size: 14px;
  color: #4b5563;
}
.vted-editor-area {
  width: 100%;
  border: none !important;
  outline: none !important;
  resize: vertical;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.65;
  color: #111827;
  background: #ffffff;
  box-sizing: border-box;
}

/* Writing Question 4 of 4: Club Manager notice in clean italic (image_ae663b) */
.tr-w-notice {
  background: transparent !important;
  border: none !important;
  padding: 4px 0 12px !important;
  font-style: italic;
  font-weight: 600;
  color: #111827;
  line-height: 1.75;
}
/* Speaking Finish Recording royal-blue button & soft-shadow circle (image_ae66f4) */
.tr-finish-rec-btn {
  background: #2557b8 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  padding: 12px 18px !important;
}
.tr-finish-rec-btn:hover {
  background: #1d4ed8 !important;
}
.tr-speak-ring-box {
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(37, 87, 184, 0.14);
}

/* Che & chặn bấm nút 'Hiện cửa sổ nhỏ mới' (Pop-out) góc trên phải của Google Drive iframe */
.drive-popout-shield {
  position: absolute;
  top: 0;
  right: 0;
  width: 78px;
  height: 64px;
  background: #0b0d12;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: default;
  user-select: none;
  pointer-events: auto;
}
