/* ==========================================================================
   Phân hệ Luyện Thi THPT & ĐGNL (V-ACT) + Chấm Phiếu OMR
   ========================================================================== */
.exam-omr-container { max-width: 1320px; width: 100%; margin: 0 auto; padding: 24px 32px 48px; flex: 1; }
@media (max-width: 768px) { .exam-omr-container { padding: 16px; } }
.mono-badge,
.mono-input,
.timer-readout,
.ledger-count,
.ws-progress,
.report-table td {
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}

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

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 7px;
}

.btn-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-600);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- View 1: Catalog (Clean & Uncluttered) ---------- */
.view-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==================== BANNER TỰA ĐỀ THƯƠNG HIỆU UNIADMIN (MẪU 2 CHÍNH THỨC) ==================== */
.brand-header-banner {
  position: relative;
  background: linear-gradient(90deg, #b84c00 0%, #c85300 24%, #d96200 52%, #e77500 78%, #f08c00 100%);
  border-radius: 18px;
  padding: 24px 32px;
  box-shadow: 0 8px 24px rgba(184, 76, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  user-select: none;
}

.brand-banner-glow {
  position: absolute;
  top: -40px;
  right: 60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  pointer-events: none;
}

.brand-banner-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 65ch;
  position: relative;
  z-index: 1;
}

.brand-banner-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.brand-banner-sub {
  color: rgba(255, 255, 255, 0.94);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.brand-banner-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.brand-sheet {
  width: 156px;
  background: #ffffff !important;
  color: #8f223d !important;
  border: 1.5px solid #c83e60 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

@media (max-width: 768px) {
  .brand-header-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px;
  }
}


.omr-mini-sheet {
  position: relative;
  width: 154px;
  background: #fffafb;
  border: 1.5px solid #c83e60;
  border-radius: 8px;
  padding: 12px 10px 10px;
  color: #8f223d;
  font-family: var(--mono);
  font-size: 9px;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .omr-mini-sheet {
  background: #1f171b;
  border-color: #d65a7a;
  color: #f4a4b8;
}

.omr-mini-sheet .fid {
  position: absolute;
  width: 8px;
  height: 4px;
  background: #111827;
}
:root[data-theme="dark"] .omr-mini-sheet .fid {
  background: #f8fafc;
}
.omr-mini-sheet .fid.tl { top: 4px; left: 4px; }
.omr-mini-sheet .fid.tr { top: 4px; right: 4px; }
.omr-mini-sheet .fid.bl { bottom: 4px; left: 4px; }
.omr-mini-sheet .fid.br { bottom: 4px; right: 4px; }

.mini-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid rgba(200, 62, 96, 0.25);
  padding-bottom: 4px;
  margin-bottom: 6px;
  margin-top: 2px;
  font-weight: 700;
  font-size: 8px;
  line-height: 1.15;
  white-space: nowrap;
}

.mini-sheet-head strong {
  background: rgba(200, 62, 96, 0.12);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 7.5px;
}

.mini-bubbles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 8px;
}

.mini-row .b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #c83e60;
  display: inline-block;
}

.mini-row .b.on {
  background: #1e293b;
  border-color: #16a34a;
  box-shadow: 0 0 0 1.5px rgba(22, 163, 74, 0.25);
}

.mini-row .b.warn {
  background: #1e293b;
  border-color: #d97706;
  box-shadow: 0 0 0 1.5px rgba(217, 119, 6, 0.3);
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #16a34a, transparent);
  box-shadow: 0 0 8px #16a34a;
  animation: omrScanAnim 3.2s ease-in-out infinite;
}

@keyframes omrScanAnim {
  0%, 100% { top: 12%; opacity: 0.75; }
  50% { top: 88%; opacity: 1; }
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 4px;
}

.page-head h1 {
  font-size: 24px;
  font-weight: 700;
}

.page-sub {
  color: var(--text-soft);
  font-size: 14px;
  max-width: 58ch;
  margin-top: 4px;
}

/* Variant Switcher Pill Bar */
.variant-switcher-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 6px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.switcher-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
  white-space: nowrap;
}

.variant-pill-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.variant-btn {
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 130ms ease;
  white-space: nowrap;
}

.variant-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.variant-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(217, 119, 6, 0.3);
}

/* ---------- Miniature OMR Answer Sheet Component ---------- */
.card-mini-sheet {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  font-family: var(--mono);
  flex-shrink: 0;
}

.card-mini-sheet:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-mini-sheet.theme-pink {
  background: #fff8f9;
  border: 1.5px solid #d65a7a;
  color: #9f1239;
}
:root[data-theme="dark"] .card-mini-sheet.theme-pink {
  background: #1f1418;
  border-color: #d65a7a;
  color: #fda4af;
}

.card-mini-sheet.theme-blue {
  background: #f8faff;
  border: 1.5px solid #3b82f6;
  color: #1e40af;
}
:root[data-theme="dark"] .card-mini-sheet.theme-blue {
  background: #131b2e;
  border-color: #3b82f6;
  color: #93c5fd;
}

.card-mini-sheet .fid {
  position: absolute;
  width: 7px;
  height: 4px;
  background: #0f172a;
}
:root[data-theme="dark"] .card-mini-sheet .fid {
  background: #f8fafc;
}
.card-mini-sheet .fid.tl { top: 3px; left: 3px; }
.card-mini-sheet .fid.tr { top: 3px; right: 3px; }
.card-mini-sheet .fid.bl { bottom: 3px; left: 3px; }
.card-mini-sheet .fid.br { bottom: 3px; right: 3px; }

.card-mini-sheet.size-sm {
  width: 66px;
  padding: 8px 5px 6px;
  font-size: 8px;
}
.card-mini-sheet.size-sm .cms-head {
  display: flex;
  flex-direction: column;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  margin-bottom: 4px;
}
.card-mini-sheet.size-sm .cms-head strong {
  font-size: 6.5px;
  opacity: 0.85;
}
.card-mini-sheet.size-sm .cms-bubbles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-mini-sheet.size-sm .cms-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-mini-sheet.size-sm .cms-row span {
  font-size: 7px;
  font-weight: 600;
  line-height: 1;
}
.card-mini-sheet.size-sm .b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid currentColor;
}
.card-mini-sheet.size-sm .b.on {
  background: #0f172a;
  border-color: #16a34a;
  box-shadow: 0 0 0 1px #16a34a;
}
:root[data-theme="dark"] .card-mini-sheet.size-sm .b.on {
  background: #e2e8f0;
  border-color: #4ade80;
}

.card-mini-sheet.size-lg {
  width: 130px;
  padding: 12px 9px 8px;
  font-size: 9px;
}
.card-mini-sheet.size-lg .cms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  font-weight: 700;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.card-mini-sheet.size-lg .cms-bubbles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-mini-sheet.size-lg .cms-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-mini-sheet.size-lg .b {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid currentColor;
}
.card-mini-sheet.size-lg .b.on {
  background: #0f172a;
  border-color: #16a34a;
  box-shadow: 0 0 0 1.5px #16a34a;
}
:root[data-theme="dark"] .card-mini-sheet.size-lg .b.on {
  background: #e2e8f0;
  border-color: #4ade80;
}

.scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #16a34a, transparent);
  box-shadow: 0 0 6px #16a34a;
  animation: miniLaser 2.6s ease-in-out infinite;
}

@keyframes miniLaser {
  0%, 100% { top: 15%; opacity: 0.6; }
  50% { top: 85%; opacity: 1; }
}

.cms-cam-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 3px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 140ms ease;
}
.card-mini-sheet:hover .cms-cam-badge {
  opacity: 1;
}
.cms-cam-badge .i {
  width: 10px;
  height: 10px;
}

/* ---------- VARIANT 1: HÀNG NGANG + PHIẾU THU NHỎ ---------- */
.v1-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.v1-sheet-col {
  flex-shrink: 0;
}
.exam-cat-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-soft);
}

/* ---------- VARIANT 2: THẺ CARD LƯỚI 2 CỘT ---------- */
.exam-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 16px;
}

.v2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 16px;
  align-items: center;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.v2-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.v2-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.v2-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.v2-time-badge {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.v2-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.v2-sec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.sec-chip {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.v2-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.v2-card-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.v2-omr-btn {
  width: 100%;
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- VARIANT 3: ĐỀ TIÊU BIỂU SONG SONG + DANH SÁCH RÚT GỌN ---------- */
.v3-featured-card {
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.v3-featured-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v3-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.v3-featured-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--primary);
  color: var(--on-primary);
  padding: 2px 8px;
  border-radius: 4px;
}
.v3-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.v3-desc {
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.45;
}
.v3-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.v3-featured-right {
  display: flex;
  justify-content: center;
  align-items: center;
}
.v3-dual-stack {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}
.v3-paper-mock {
  width: 120px;
  height: 156px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  padding: 10px;
  font-size: 8px;
  color: #334155;
  transform: rotate(-4deg);
  transition: transform 180ms ease;
  z-index: 1;
}
.v3-dual-stack:hover .v3-paper-mock {
  transform: rotate(-7deg) scale(1.02);
}
.v3-paper-title {
  font-weight: 700;
  font-size: 8px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
  margin-bottom: 5px;
}
.v3-paper-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v3-paper-line {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
}
.v3-dual-stack .card-mini-sheet {
  transform: rotate(3deg);
  margin-left: -24px;
  z-index: 2;
  transition: transform 180ms ease;
}
.v3-dual-stack:hover .card-mini-sheet {
  transform: rotate(5deg) scale(1.04);
}
.v3-remaining-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 12px 0 4px;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.category-pills,
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  height: 32px;
  padding: 0 13px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.filter-pill:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-pill.is-active {
  background: var(--surface-2);
  color: var(--primary);
  border-color: var(--border);
}

.ledger-count {
  font-size: 13px;
  color: var(--muted);
}

/* Clean Exam Rows */
.exam-ledger {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exam-row-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: border-color 140ms ease;
}

.exam-row-card:hover {
  border-color: var(--muted);
}

.exam-row-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.exam-row-main h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.exam-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

.meta-dot {
  color: var(--border);
}

.exam-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- View 2: Workspace (Single-Row Topbar + Calm Split View) ---------- */
.workspace-topbar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.ws-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.ws-title-group h2 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.ws-progress {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.timer-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.timer-readout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  padding: 0 4px;
}

.timer-readout.is-paused {
  color: var(--warn);
}

.timer-readout.is-low {
  color: var(--danger);
}

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

.pause-curtain {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
}

.pause-dialog {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pause-dialog p {
  color: var(--text-soft);
}

.workspace-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: start;
}

.exam-paper-pane {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 66px);
  height: calc(100vh - var(--header-h) - 86px);
  display: flex;
  flex-direction: column;
}

.paper-quick-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  flex-shrink: 0;
}

.paper-title-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-soft);
}

.paper-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

#exam-paper-iframe {
  width: 100%;
  flex: 1;
  height: 100%;
  border: 0;
  display: block;
}

/* Calm Web Answer Sheet */
.omr-web-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.omr-sections-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.omr-section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.omr-section-Block + .omr-section-block {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.omr-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.omr-section-head h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.omr-section-head small {
  font-size: 12px;
  color: var(--muted);
}

.abcd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 6px 12px;
}

.abcd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface-2);
}

.abcd-row.is-flagged {
  outline: 1px solid var(--primary);
}

.q-num-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-soft);
  min-width: 30px;
  text-align: left;
}

.bubble-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.omr-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.omr-bubble:hover {
  border-color: var(--text-soft);
  color: var(--text);
}

.omr-bubble.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* Part II True/False */
.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
}

.tf-card {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
}

.tf-card-head {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.tf-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12.5px;
}

.tf-sub-label {
  font-family: var(--mono);
  color: var(--text-soft);
}

/* Part III Short Answer */
.sa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.sa-card {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sa-card label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.sa-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.sa-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* ---------- View 3: OMR Camera & Photo Workbench ---------- */
.inline-select,
.omr-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  max-width: min(360px, 100%);
  min-width: 0;
}

.omr-workbench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.omr-canvas-panel,
.omr-review-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.omr-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.omr-hint {
  font-size: 12.5px;
  color: var(--muted);
}

.omr-mode-switch {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 2px;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.mode-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.camera-stage {
  background: #0f172a;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.camera-viewport {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

#camera-video {
  width: 100%;
  display: block;
}

.camera-guide-frame {
  position: absolute;
  inset: 6%;
  border: 1.5px dashed rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  pointer-events: none;
  display: grid;
  place-items: end center;
  padding-bottom: 10px;
}

.guide-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #4ade80;
}
.guide-corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.guide-corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.guide-corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.guide-corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.guide-hint {
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.omr-canvas-stage {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  justify-content: center;
  overflow: auto;
}

#omr-preview-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  background: #ffffff;
  cursor: crosshair;
}

.omr-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.omr-review-head h3 {
  font-size: 15px;
}

.omr-detected-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.omr-detected-meta label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.mono-input {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  width: 76px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
}

.omr-warnings-box {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}

.omr-review-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 760px;
  overflow-y: auto;
}

.empty-omr-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ---------- View 4: Grading Report ---------- */
.ws-submeta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.mono-badge {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-soft);
}

.report-summary-band {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-cell span {
  font-size: 12.5px;
  color: var(--muted);
}

.stat-cell strong {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
}

.stat-cell.score-highlight strong {
  color: var(--primary);
}

.report-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.sec-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sec-score-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.sec-score-top h4 {
  font-size: 13.5px;
  font-weight: 600;
}

.sec-score-top strong {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.sec-score-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.report-details-panel,
.history-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.report-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.report-filter-bar h3 {
  font-size: 15px;
}

.report-items-table-wrap {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.report-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill.correct { background: var(--ok-soft); color: var(--ok); }
.status-pill.partial { background: var(--warn-soft); color: var(--warn); }
.status-pill.wrong { background: var(--danger-soft); color: var(--danger); }
.status-pill.unanswered { background: var(--surface-2); color: var(--muted); }

.tf-inline-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 3px;
}
.tf-inline-chip.ok { background: var(--ok-soft); color: var(--ok); }
.tf-inline-chip.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Admin Dialog ---------- */
.admin-dialog {
  width: min(620px, 94vw);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.admin-form {
  display: flex;
  flex-direction: column;
}

.admin-dialog-head,
.admin-dialog-foot {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-dialog-head h2 {
  font-size: 16px;
}

.admin-dialog-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  gap: 8px;
}

.admin-dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-dialog-body label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
}

.admin-dialog-body input,
.admin-dialog-body select,
.admin-dialog-body textarea {
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.6fr;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .catalog-top-split,
  .workspace-split,
  .omr-workbench-grid {
    grid-template-columns: 1fr;
  }
  .exam-paper-pane {
    position: static;
    height: 460px;
  }
}

@media (max-width: 768px) {
  .omr-quick-card {
    grid-template-columns: 1fr;
  }
  .exam-row-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .exam-row-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .workspace-topbar {
    flex-wrap: wrap;
  }
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
  .my-exams-header-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .my-exams-stats-bar {
    grid-template-columns: 1fr;
  }
  .my-exams-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .my-search-box {
    width: 100%;
  }
}

/* ==================== VIEW: KHO ĐỀ CÁ NHÂN & BANNER CAM ĐẶC TRƯNG ==================== */
.my-exams-header-banner {
  position: relative;
  background: linear-gradient(90deg, #b84c00 0%, #c85300 24%, #d96200 52%, #e77500 78%, #f08c00 100%);
  border-radius: 18px;
  padding: 24px 32px;
  box-shadow: 0 8px 24px rgba(184, 76, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  user-select: none;
  color: #fff;
}

:root[data-theme="dark"] .my-exams-header-banner {
  background: linear-gradient(90deg, #9a3e00 0%, #b84c00 30%, #c85300 65%, #d96200 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.my-exams-header-glow {
  position: absolute;
  top: -50px;
  right: -30px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: -80px 110px 0 -20px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.my-exams-header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 65ch;
  position: relative;
  z-index: 1;
}

.my-exams-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}

.my-exams-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 0;
}

.my-exams-sub {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

.my-exams-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.my-exams-ghost-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.my-exams-ghost-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Thống kê kho đề */
.my-exams-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.my-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

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

.icon-purple {
  background: rgba(124, 58, 237, 0.12);
  color: #8b5cf6;
}

.icon-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #3b82f6;
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* Toolbar */
.my-exams-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 16px;
}

.my-search-box {
  min-width: min(280px, 100%);
}

/* Grid & Cards */
.my-exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.my-exam-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  position: relative;
}

.my-exam-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.4);
}

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

.my-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-personal {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-template {
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

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

.my-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}

.my-card-desc {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.my-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
  padding: 10px 0 0;
  border-top: 1px dashed var(--border);
}

.my-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.btn-delete-personal {
  color: #dc2626 !important;
  margin-left: auto;
}
.btn-delete-personal:hover {
  background: rgba(220, 38, 38, 0.08) !important;
}

/* Empty State */
.my-exams-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
}

.my-exams-empty .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.my-exams-empty h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.my-exams-empty p {
  font-size: 13.5px;
  max-width: 48ch;
  margin: 0;
}

/* ==================== EXAM READY / PREPARATION MODAL ==================== */
.exam-ready-dialog {
  width: min(880px, 95vw);
  max-height: 94vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border);
  animation: readyModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes readyModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ready-head-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ready-badge-pill {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
:root[data-theme="dark"] .ready-badge-pill {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}

.ready-head-title h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.ready-dialog-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(85vh - 140px);
  overflow-y: auto;
}

/* Exam Brief Card */
.ready-exam-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(14, 165, 233, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

:root[data-theme="dark"] .ready-exam-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.ready-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ready-code-chip {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.ready-exam-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}

.ready-exam-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.ready-exam-specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px dashed rgba(99, 102, 241, 0.2);
}

.ready-spec-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-soft);
}

.ready-spec-item svg {
  width: 15px;
  height: 15px;
  color: #6366f1;
}

.ready-spec-item strong {
  color: var(--text);
}

/* Sections in modal */
.ready-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ready-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.ready-section-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* Download / Print cards */
.ready-download-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ready-dl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
  text-align: left;
}

.ready-dl-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ready-dl-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ready-dl-icon svg {
  width: 20px;
  height: 20px;
}

.ready-dl-icon.red {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.ready-dl-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.ready-dl-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ready-dl-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ready-dl-meta small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ready-dl-arrow {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

/* Exam Mode Selection */
.ready-modes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ready-dialog-body .ready-mode-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: var(--surface);
  transition: all 0.15s ease;
  font-weight: normal;
}

.ready-mode-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.ready-mode-option:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--surface-2);
}

.ready-mode-option.is-selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 1px var(--primary);
}

:root[data-theme="dark"] .ready-mode-option.is-selected {
  background: rgba(99, 102, 241, 0.12);
}

.ready-mode-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.ready-mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.ready-mode-text strong {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
}

.ready-mode-text small {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}

/* Meta inputs */
.ready-meta-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 4px;
}

.ready-dialog-body .ready-meta-inputs label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.ready-dialog-body .ready-meta-inputs input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}

/* Dialog foot */
.ready-dialog-foot {
  padding: 14px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ready-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.16s ease;
}

.ready-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}

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

@media (max-width: 600px) {
  .ready-download-cards {
    grid-template-columns: 1fr;
  }
  .ready-meta-inputs {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   2-MODE COMPARISON STYLES (ONLINE TEST vs PAPER PRINT & OMR)
   ============================================================ */
.ready-modes-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}

@media (max-width: 820px) {
  .ready-modes-comparison {
    grid-template-columns: 1fr;
  }
}

.ready-mode-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.ready-mode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.ready-mode-card.ready-mode-online {
  border-color: #6366f1;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, var(--surface) 100%);
}

.ready-mode-card.ready-mode-paper {
  border-color: #10b981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, var(--surface) 100%);
}

.ready-mode-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: #6366f1;
  color: #fff;
  text-transform: uppercase;
}

.ready-mode-card-badge.paper {
  background: #10b981;
}

.ready-mode-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ready-mode-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ready-mode-avatar.online {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.ready-mode-avatar.paper {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.ready-mode-avatar svg {
  width: 24px;
  height: 24px;
}

.ready-mode-title-wrap h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.ready-mode-title-wrap p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.ready-mode-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text);
  flex: 1;
}

.ready-mode-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.ready-mode-features li span {
  color: #10b981;
  font-weight: 800;
}

/* Online Submodes Popup & Grid (Vừa học vừa chill vs Học thi nghiêm túc) */
.online-submode-dialog {
  width: min(680px, 95vw);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.42);
  border: 1px solid var(--border);
  animation: readyModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.submode-dialog-body {
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.submode-dialog-foot {
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ready-online-submodes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 580px) {
  .ready-online-submodes {
    grid-template-columns: 1fr;
  }
}

.online-submode-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.18s ease;
}

.online-submode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.online-submode-card.submode-chill {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, var(--surface) 100%);
}

.online-submode-card.submode-chill:hover {
  border-color: #10b981;
}

.online-submode-card.submode-timed {
  border-color: rgba(99, 102, 241, 0.5);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, var(--surface) 100%);
}

.online-submode-card.submode-timed:hover {
  border-color: #6366f1;
}

.submode-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.submode-preview-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  color: #6366f1;
}

.submode-chill .submode-preview-badge {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}

.submode-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  margin: 4px 0;
}

.submode-icon {
  font-size: 26px;
  line-height: 1;
}

.submode-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.submode-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.submode-start-btn.chill-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.submode-start-btn.chill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.submode-start-btn.timed-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.submode-start-btn.timed-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.submode-start-btn svg {
  width: 15px;
  height: 15px;
}

.submode-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
}

.submode-perks li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.submode-bullet {
  flex-shrink: 0;
  font-size: 13px;
}

.ready-paper-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ready-paper-subbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ready-paper-subbtn:hover {
  background: var(--surface);
  border-color: #10b981;
  color: #10b981;
}

.ready-mode-online .ready-paper-subbtn:hover {
  background: var(--surface);
  border-color: #6366f1;
  color: #6366f1;
}

.ready-start-online-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14.5px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ready-start-online-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.ready-start-omr-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14.5px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ready-start-omr-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ============================================================
   DOL THPT TEST WORKSPACE (CHẾ ĐỘ 1: LÀM TRỰC TUYẾN)
   ============================================================ */
.dol-workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.dol-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: sticky;
  top: 10px;
  z-index: 40;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.dol-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dol-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dol-close-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
}

.dol-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dol-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 3px 8px 3px 4px;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.dol-brand-text {
  display: flex;
  flex-direction: column;
}

.dol-brand-text strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.dol-brand-text small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.dol-part-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.dol-part-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dol-part-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dol-part-btn.is-active {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #4f46e5;
  font-weight: 700;
}

:root[data-theme="dark"] .dol-part-btn.is-active {
  background: #1e293b;
  border-color: #334155;
  color: #818cf8;
}

.dol-part-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4f46e5;
  flex-shrink: 0;
}

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

.dol-timer-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

:root[data-theme="dark"] .dol-timer-readout {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.dol-timer-readout.is-low {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  animation: pulse-border 1.5s infinite;
}

.dol-timer-readout strong {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.05em;
}

.dol-bc-parent {
  color: var(--muted);
  font-weight: 500;
}

.dol-bc-sep {
  color: var(--border);
  font-weight: 300;
}

.dol-bc-exam {
  color: var(--text);
  font-weight: 700;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dol-tb-center {
  display: flex;
  align-items: center;
}

.dol-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

:root[data-theme="dark"] .dol-timer-pill {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.dol-timer-pill.is-low {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  animation: pulse-border 1.5s infinite;
}

.dol-timer-digits {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.05em;
}

.dol-timer-btn {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
  padding-left: 4px;
}

.dol-tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dol-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dol-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dol-tool-btn:hover {
  background: var(--surface);
  border-color: #6366f1;
  color: #6366f1;
}

.dol-submit-btn {
  padding: 7px 18px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* DOL CENTER STAGE */
.dol-center-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 140px; /* bottom padding for fixed bottom palette bar */
}

.dol-question-stage {
  flex: 1;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.dol-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.dol-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.dol-q-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dol-q-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: #4f46e5;
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--mono);
}

.dol-q-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.dol-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dol-flag-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}

.dol-flag-btn.is-flagged {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

.dol-q-prompt {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 24px;
  white-space: pre-line;
  word-break: break-word;
}

.dol-choices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dol-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dol-choice-card:hover {
  border-color: #a5b4fc;
  background: var(--surface-2);
}

.dol-choice-card.is-selected {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.06);
  box-shadow: 0 0 0 1px #4f46e5;
}

:root[data-theme="dark"] .dol-choice-card.is-selected {
  background: rgba(99, 102, 241, 0.15);
}

.dol-choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dol-choice-card.is-selected .dol-choice-letter {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #fff;
}

.dol-choice-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  padding-top: 3px;
  flex: 1;
  word-break: break-word;
}

/* Vừa học vừa chill: Choice States & Tags */
.dol-choice-card.is-correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 0 1px #10b981 !important;
}

:root[data-theme="dark"] .dol-choice-card.is-correct {
  background: rgba(16, 185, 129, 0.18) !important;
}

.dol-choice-card.is-correct .dol-choice-letter {
  border-color: #10b981 !important;
  background: #10b981 !important;
  color: #fff !important;
}

.dol-choice-card.is-wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
  box-shadow: 0 0 0 1px #ef4444 !important;
}

:root[data-theme="dark"] .dol-choice-card.is-wrong {
  background: rgba(239, 68, 68, 0.18) !important;
}

.dol-choice-card.is-wrong .dol-choice-letter {
  border-color: #ef4444 !important;
  background: #ef4444 !important;
  color: #fff !important;
}

.chill-choice-tag {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  align-self: center;
  flex-shrink: 0;
}

.chill-choice-tag.ok {
  background: #10b981;
  color: #fff;
}

.chill-choice-tag.bad {
  background: #ef4444;
  color: #fff;
}

/* Chill Inline Feedback Banner */
.dol-chill-feedback-wrap {
  margin-top: 18px;
}

.dol-chill-banner {
  padding: 16px 20px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  white-space: normal;
  animation: feedbackSlideIn 0.2s ease;
}

@keyframes feedbackSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dol-chill-banner.is-correct {
  background: rgba(16, 185, 129, 0.1);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  color: #065f46;
}

:root[data-theme="dark"] .dol-chill-banner.is-correct {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.dol-chill-banner.is-wrong {
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  color: #991b1b;
}

:root[data-theme="dark"] .dol-chill-banner.is-wrong {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.chill-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: normal;
}

.chill-banner-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.chill-banner-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.chill-banner-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  white-space: normal;
}

.chill-banner-desc {
  margin: 0;
  font-size: 13.5px;
  white-space: normal;
  line-height: 1.4;
}

.chill-banner-desc strong {
  display: inline !important;
  font-weight: 800;
}

.chill-banner-expl {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .chill-banner-expl {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Mode Badge in Topbar */
.dol-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

.dol-mode-badge.chill {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

:root[data-theme="dark"] .dol-mode-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

:root[data-theme="dark"] .dol-mode-badge.chill {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* Palette button status in chill mode */
.dol-palette-btn.pal-correct:not(.is-active) {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.dol-palette-btn.pal-wrong:not(.is-active) {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* PDF DRAWER */
.dol-pdf-drawer {
  width: 480px;
  margin-left: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.dol-pdf-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.dol-pdf-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.dol-pdf-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dol-pdf-drawer iframe {
  flex: 1;
  width: 100%;
  min-height: 580px;
  border: none;
}

/* ============================================================
   DOL THPT BOTTOM NAVIGATION BAR
   ============================================================ */
.dol-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.dol-palette-strip-wrap {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  gap: 8px;
}

.dol-palette-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dol-palette-nav-btn:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.dol-palette-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px;
  scrollbar-width: none;
}

.dol-palette-strip::-webkit-scrollbar {
  display: none;
}

.dol-palette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 6px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dol-palette-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.dol-palette-btn.is-active {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.dol-palette-btn.is-answered:not(.is-active) {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.dol-palette-btn.is-flagged {
  border-color: #ef4444;
  position: relative;
}

.dol-palette-btn.is-flagged::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
}

.dol-footer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 24px;
  gap: 36px;
}

.dol-footer-part-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dol-footer-part-info strong {
  font-size: 13.5px;
  color: var(--text);
  display: block;
}

.dol-footer-part-info small {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.dol-subpart-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dol-subpart-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dol-subpart-pill:hover,
.dol-subpart-pill.is-active {
  background: rgba(79, 70, 229, 0.1);
  border-color: #6366f1;
  color: #4f46e5;
}

.dol-nav-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dol-prev-btn {
  font-weight: 600 !important;
}

.dol-next-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
}

/* ============================================================
   CALCULATOR & SCRATCHPAD MODAL STYLES
   ============================================================ */
.dol-tool-modal {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  padding: 0;
  color: var(--text);
  max-width: 95vw;
  width: fit-content;
}

.dol-tool-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.dol-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
}

.dol-tool-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

/* ============================================================
   MỤC MÔN HỌC (THPT & ĐGNL) TRÊN TRANG LUYỆN ĐỀ
   ============================================================ */
.exam-subjects-overview-sec {
  margin-bottom: 36px;
}

.exam-subjects-overview-sec .section-head {
  margin-bottom: 18px;
}

.exam-subjects-overview-sec .section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.exam-subjects-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 28px 24px;
}

.exam-detail-back-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.exam-back-subjects-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--primary, #f05123);
  background: var(--primary, #f05123);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 3px 10px rgba(240, 81, 35, 0.22);
}

.exam-back-subjects-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.exam-detail-cur-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

/* ============================================================
   CASIO fx-580VN X CLASSWIZ CALCULATOR MODAL STYLES
   ============================================================ */
.fx580-modal {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible !important;
}

.fx580-casing {
  width: min(352px, 95vw);
  background: linear-gradient(180deg, #4b4e54 0%, #3d4046 55%, #35383e 100%);
  border: 5px solid #e5e7eb;
  border-radius: 34px 34px 40px 40px;
  padding: 16px 16px 22px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -4px 8px rgba(0, 0, 0, 0.45);
  color: #fff;
  user-select: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.fx580-header {
  padding: 0 6px 8px;
}

.fx580-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.fx580-casio {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  font-family: 'Arial Black', 'Inter', sans-serif;
}

.fx580-model {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  font-style: italic;
  margin-left: auto;
  margin-right: 10px;
}

.fx580-close-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.28);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.fx580-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.fx580-classwiz {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.36em;
  color: #f48fb1;
  margin-top: 2px;
}

/* Màn hình LCD của fx-580VN X */
.fx580-bezel {
  background: #141619;
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.12);
}

.fx580-lcd {
  background: linear-gradient(180deg, #d3dfd2 0%, #dce7db 100%);
  color: #0f172a;
  border-radius: 8px;
  padding: 6px 10px 8px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.18);
  border: 1px solid #9ca89b;
}

.fx580-status-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--mono);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.fx-ind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  height: 14px;
  border-radius: 2px;
  background: #111827;
  color: #dce7db;
  opacity: 0.15;
  font-size: 9.5px;
  line-height: 1;
}

.fx-ind.is-on {
  opacity: 1;
}

.fx-angle-toggle {
  border: none;
  cursor: pointer;
  padding: 0 4px;
}

.fx-ind-right {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  color: #1e293b;
}

.fx580-expr {
  font-family: 'Cambria Math', 'Times New Roman', var(--mono), serif;
  font-size: 15.5px;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  min-height: 24px;
  line-height: 1.35;
  overflow-x: auto;
  white-space: nowrap;
}

.fx580-result {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  text-align: right;
  min-height: 28px;
  line-height: 1.2;
  overflow-x: auto;
  white-space: nowrap;
}

/* Cụm phím tròn SHIFT, ALPHA, D-PAD, MENU, ON */
.fx580-top-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2px 4px 0;
  position: relative;
  margin-bottom: -16px;
  z-index: 2;
}

.fx580-side-pair {
  display: flex;
  gap: 10px;
  padding-top: 2px;
}

.fx580-round-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.fx-lbl-shift {
  font-size: 9.5px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.02em;
}

.fx-lbl-alpha {
  font-size: 9.5px;
  font-weight: 800;
  color: #f472b6;
  letter-spacing: 0.02em;
}

.fx-lbl-white {
  font-size: 9.5px;
  font-weight: 800;
  color: #f8fafc;
}

.fx-lbl-dual {
  font-size: 8.5px;
  font-weight: 800;
  display: flex;
  gap: 3px;
  white-space: nowrap;
}

.fx-lbl-dual .w {
  color: #f8fafc;
}

.fx-lbl-dual .y {
  color: #fbbf24;
}

.fx580-round-btn {
  width: 30px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
  border: 2px solid #27272a;
  box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.fx580-round-btn:active,
.fx580-round-btn.is-active {
  transform: translateY(1.5px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border-color: #fbbf24;
}

/* Cụm phím điều hướng 4 chiều D-Pad ở giữa */
.fx580-dpad {
  width: 102px;
  height: 68px;
  border-radius: 50px;
  background: linear-gradient(180deg, #2d3036 0%, #1f2227 100%);
  border: 2px solid #181a1e;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  padding: 4px;
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
  margin-top: 6px;
}

.fx-dpad-btn {
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
  border: 1px solid #1f2937;
  color: #1f2937;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: filter 0.1s ease;
}

.fx-dpad-btn:hover {
  filter: brightness(1.1);
}

.fx-dpad-btn:active {
  filter: brightness(0.9);
}

.fx-dpad-btn.up {
  grid-column: 2;
  grid-row: 1;
  border-radius: 14px 14px 4px 4px;
}

.fx-dpad-btn.left {
  grid-column: 1;
  grid-row: 2;
  border-radius: 14px 4px 4px 14px;
}

.fx-dpad-center {
  grid-column: 2;
  grid-row: 2;
  background: #272a30;
  border-radius: 50%;
  margin: 2px;
}

.fx-dpad-btn.right {
  grid-column: 3;
  grid-row: 2;
  border-radius: 4px 14px 14px 4px;
}

.fx-dpad-btn.down {
  grid-column: 2;
  grid-row: 3;
  border-radius: 4px 4px 14px 14px;
}

/* Lưới 6 cột phím chức năng màu đen */
.fx580-fn-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px 6px;
  margin-bottom: 10px;
}

.fx-key-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.fx-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.1;
  min-height: 11px;
  padding: 0 2px;
  margin-bottom: 2px;
  white-space: nowrap;
}

.fx-sub-row .y {
  color: #fbbf24;
}

.fx-sub-row .p {
  color: #f472b6;
  margin-left: auto;
}

.fx-sub-row .b {
  color: #38bdf8;
  margin-left: auto;
}

.fx-fn-btn {
  height: 27px;
  border-radius: 6px 6px 8px 8px;
  background: linear-gradient(180deg, #1e2024 0%, #111317 100%);
  border: 1px solid #090a0d;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.06s ease;
}

.fx-fn-btn.fx-italic {
  font-family: 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-size: 14px;
}

.fx-fn-btn:hover {
  background: linear-gradient(180deg, #2a2d33 0%, #181b20 100%);
}

.fx-fn-btn:active {
  transform: translateY(1px);
}

/* Lưới 5 cột phím số màu trắng & DEL/AC xanh dương */
.fx580-num-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px 8px;
}

.fx-num-btn {
  height: 34px;
  border-radius: 7px 7px 10px 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid #94a3b8;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  box-shadow:
    0 3px 4px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 #ffffff;
  transition: transform 0.06s ease;
}

.fx-num-btn:hover {
  filter: brightness(1.03);
}

.fx-num-btn:active {
  transform: translateY(1.5px);
}

.fx-num-btn.fx-blue-btn {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow:
    0 3px 4px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.fx-num-btn.fx-op-btn {
  font-size: 18px;
  font-weight: 800;
}

.fx-num-btn.fx-exp-btn {
  font-size: 12.5px;
  font-weight: 800;
}

.fx-num-btn.fx-ans-btn {
  font-size: 13px;
  font-weight: 800;
}

.fx-num-btn.fx-eq-btn {
  font-size: 18px;
  font-weight: 900;
}

/* SCRATCHPAD */
.dol-scratch-wrapper {
  width: min(840px, 100%);
  max-width: 100%;
}

.dol-scratch-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.scratch-color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scratch-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.scratch-color-dot.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #4f46e5;
}

.scratch-size-picker {
  display: flex;
  align-items: center;
  gap: 4px;
}

.scratch-size-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.scratch-size-btn.is-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.dol-scratch-canvas-container {
  padding: 10px;
  background: #fafafa;
  border-radius: 0 0 16px 16px;
}

:root[data-theme="dark"] .dol-scratch-canvas-container {
  background: #18181b;
}

#dol-scratch-canvas {
  width: 100%;
  height: 500px;
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: crosshair;
}

:root[data-theme="dark"] #dol-scratch-canvas {
  background: #27272a;
}

/* ============================================================
   DOL PASSAGE BOX, FIGURE GALLERY & MATH/RICH TEXT STYLES
   ============================================================ */
.dol-q-prompt {
  white-space: normal !important;
}

.dol-passage-box {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-left: 4px solid #4f46e5;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

:root[data-theme="dark"] .dol-passage-box {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(99, 102, 241, 0.35);
  border-left-color: #818cf8;
}

.dol-passage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dol-passage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

:root[data-theme="dark"] .dol-passage-badge {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
}

.dol-passage-content {
  font-size: 15px;
  line-height: 1.68;
  color: var(--text);
  text-align: justify;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.dol-prompt-text {
  font-size: 16px;
  line-height: 1.68;
  color: var(--text);
  font-weight: 500;
}

.dol-figure-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.dol-figure-item {
  margin: 0;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.dol-figure-item img {
  max-width: 100%;
  max-height: 320px;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.dol-underlined {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: #4f46e5;
  font-weight: 600;
}

.dol-err-tag {
  font-size: 13px;
  font-weight: 800;
  color: #4f46e5;
  margin-left: 2px;
}

:root[data-theme="dark"] .dol-underlined {
  text-decoration-color: #818cf8;
}

:root[data-theme="dark"] .dol-err-tag {
  color: #a5b4fc;
}

.dol-blank {
  display: inline-block;
  min-width: 52px;
  border-bottom: 2px solid currentColor;
  color: #4f46e5;
  font-weight: 700;
  text-align: center;
  margin: 0 3px;
  line-height: 1;
}

.dol-sqrt {
  display: inline-flex;
  align-items: stretch;
  white-space: nowrap;
  vertical-align: middle;
  margin: 1px 1px;
}

.dol-sqrt-idx {
  font-size: 0.65em;
  margin-right: -2px;
  align-self: flex-start;
  line-height: 1;
}

.dol-sqrt-sym {
  display: inline-flex;
  align-items: stretch;
  width: 0.58em;
  flex-shrink: 0;
}

.dol-sqrt-sym svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.dol-sqrt-rad {
  border-top: 1.5px solid currentColor;
  padding: 2px 3px 0 2px;
  margin-left: -0.5px;
  line-height: 1.2;
  display: inline-block;
}

.dol-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 2px;
  font-size: 0.88em;
  line-height: 1.1;
  transform: translateY(-0.06em);
}

.dol-frac-num {
  padding: 0 3px 1px;
  border-bottom: 1.4px solid currentColor;
  text-align: center;
  white-space: nowrap;
}

.dol-frac-den {
  padding: 1px 3px 0;
  text-align: center;
  white-space: nowrap;
}

.dol-lim {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 3px 0 1px;
  line-height: 1;
  transform: translateY(0.18em);
}

.dol-lim-op {
  font-weight: 500;
  font-size: 0.98em;
}

.dol-lim-sub {
  font-size: 0.7em;
  margin-top: 1px;
  white-space: nowrap;
}

.dol-int {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 2px;
  line-height: 1;
}

.dol-int-sym {
  font-size: 1.45em;
  line-height: 1;
  font-family: "Cambria Math", "Times New Roman", serif;
}

.dol-int-limits {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.68em;
  line-height: 1.05;
  margin-left: 1px;
  height: 1.9em;
}

.dol-int-up,
.dol-int-low {
  white-space: nowrap;
}

.dol-cases {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  margin: 3px 4px;
}

.dol-cases-brace {
  display: inline-flex;
  align-items: stretch;
  width: 11px;
  margin-right: 3px;
  flex-shrink: 0;
}

.dol-brace-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.dol-orcases-bracket {
  width: 6px;
  border-left: 1.8px solid currentColor;
  border-top: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  margin-right: 5px;
  flex-shrink: 0;
}

.dol-cases-rows {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  text-align: left;
  line-height: 1.35;
}

.dol-cases-row {
  display: block;
  white-space: nowrap;
}

/* ==================== OMR PAPER SBD & MÃ ĐỀ GUIDANCE ==================== */
.omr-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12.5px;
  font-weight: 500;
  margin-left: 6px;
}

.omr-target-pill strong {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  color: #c2410c;
  letter-spacing: 0.5px;
}

.omr-target-pill.is-code {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.omr-target-pill.is-code strong {
  color: #1d4ed8;
}

.omr-sheet-info-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.omr-sheet-info-title {
  font-size: 13px;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 8px;
}

.omr-sheet-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.omr-sheet-info-item {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #475569;
}

.omr-sheet-info-item strong {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  font-weight: 800;
  color: #ea580c;
  letter-spacing: 1px;
}

.omr-sheet-info-note {
  margin: 0;
  font-size: 11.5px;
  color: #7c2d12;
  line-height: 1.4;
}

.ready-paper-meta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff7ed;
  border: 1px dashed #fb923c;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #9a3412;
  font-weight: 600;
}

.paper-meta-chip {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 2px 8px;
  color: #475569;
  font-weight: 500;
}

.paper-meta-chip strong {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  color: #ea580c;
  margin-left: 2px;
}

/* ==================== PHIẾU ĐIỂM ĐGNL (KẾT QUẢ THI) ==================== */
.dgnl-certificate-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 12px 36px;
}

.dgnl-certificate-wrap[hidden] {
  display: none !important;
}

.dgnl-certificate-card {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.dgnl-cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.dgnl-cert-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.dgnl-cert-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
}

.dgnl-cert-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.dgnl-cert-body {
  padding: 22px 24px 26px;
  font-size: 15.5px;
  line-height: 1.75;
  color: #1e293b;
}

.dgnl-cert-section + .dgnl-cert-section {
  margin-top: 20px;
}

.dgnl-cert-section h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.dgnl-cert-section p {
  margin: 4px 0;
  color: #334155;
}

.dgnl-cert-section p strong {
  color: #0f172a;
  font-weight: 700;
}

.dgnl-score-list {
  margin: 6px 0 12px;
  padding-left: 24px;
  list-style-type: disc;
}

.dgnl-score-list li {
  color: #15803d;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.85;
}

.dgnl-score-list li::marker {
  color: #15803d;
}

.dgnl-score-total {
  color: #dc2626;
  font-weight: 700;
  font-size: 16.5px;
  margin-top: 8px;
}

.dgnl-cert-download-line {
  margin: 12px 0 0;
  font-size: 15px;
  color: #334155;
  line-height: 1.6;
}

.dgnl-cert-download-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.dgnl-cert-download-link:hover {
  color: #1d4ed8;
}

.dgnl-cert-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* ==================== KIỂM TRA SBD & MÃ ĐỀ (GHI SAI = 0 ĐIỂM) ==================== */
.dol-meta-inputs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.dol-meta-inputs.is-invalid {
  background: #fef2f2;
  border-color: #f87171;
}

.dol-meta-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.dol-meta-input {
  width: 72px;
  padding: 3px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
  outline: none;
}

.dol-meta-input.code {
  width: 48px;
}

.dol-meta-input:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15);
}

.dol-meta-input.is-invalid {
  color: #dc2626;
  border-color: #ef4444;
  background: #fff5f5;
}

.omr-meta-check-box {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}

.omr-meta-check-box.is-valid {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.omr-meta-check-box.is-invalid {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.mono-input.is-invalid {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.mono-input.is-valid {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
}

.dgnl-meta-err {
  color: #dc2626;
  font-weight: 700;
  font-size: 13.5px;
  margin-left: 6px;
}

.dgnl-zero-score-alert {
  margin: 6px 0 12px;
  padding: 11px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.55;
}

.report-invalid-meta-banner {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-left: 4px solid #dc2626;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-invalid-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  color: #dc2626;
  font-size: 11.5px;
  font-weight: 700;
}

.mono-badge.is-err {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ==================== BÚT TÔ SÁNG VĂN BẢN MÀU VÀNG (HIGHLIGHT) ==================== */
#dol-toggle-highlight-btn.is-active {
  background: #fef08a;
  border-color: #eab308;
  color: #854d0e;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.28);
}

:root[data-theme="dark"] #dol-toggle-highlight-btn.is-active {
  background: #fde047;
  border-color: #facc15;
  color: #422006;
}

.dol-question-card.is-highlight-mode #dol-question-prompt,
.dol-question-card.is-highlight-mode .dol-choice-text {
  cursor: text;
  user-select: text;
}

.dol-question-card.is-highlight-mode ::selection {
  background: #fde047;
  color: #0f172a;
}

mark.dol-text-highlight {
  background: #fef08a;
  color: #0f172a;
  padding: 1px 2px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background 0.15s ease;
}

.dol-question-card.is-highlight-mode mark.dol-text-highlight {
  cursor: pointer;
}

.dol-question-card.is-highlight-mode mark.dol-text-highlight:hover {
  background: #fde047;
  outline: 1px dashed #ca8a04;
}


/* Tích hợp với Header & Sidebar của hệ thống chính */
.dol-topbar { top: calc(var(--header-h) + 10px); }
@media (min-width: 901px) { .dol-bottom-bar { left: var(--sidebar-w); } }

/* ==================== MOBILE EXAM WORKSPACE OVERRIDES (<= 860px) ==================== */
@media (max-width: 860px) {
  .my-exams-grid,
  .exam-grid-container,
  .v2-card,
  .v3-featured-card {
    grid-template-columns: 1fr;
  }
  .dol-topbar {
    top: calc(var(--header-h) + 4px);
    margin: 6px auto 0;
    width: calc(100% - 16px);
    min-height: auto;
    padding: 10px 12px;
    border-radius: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .dol-top-left {
    width: 100%;
    gap: 8px;
  }
  .dol-exam-title {
    font-size: 13.5px;
  }
  .dol-top-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }
  .dol-meta-inputs,
  .dol-candidate-meta {
    display: none;
  }
  .dol-timer-pill {
    padding: 5px 10px;
    font-size: 13px;
  }
  .dol-tool-btn {
    padding: 5px 9px;
    font-size: 12px;
  }
  .dol-submit-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    margin-left: auto;
  }
  .dol-center-container {
    flex-direction: column;
    padding: 12px 10px 150px;
  }
  .dol-question-card {
    padding: 18px 14px;
    border-radius: 14px;
    min-height: 280px;
  }
  .dol-q-head,
  .dol-q-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .dol-q-prompt {
    font-size: 15px;
  }
  .dol-choice-card,
  .dol-choice-item {
    padding: 11px 12px;
    gap: 10px;
  }
  .dol-footer-controls {
    margin-top: 0;
    padding: 4px 2px 0;
    gap: 6px;
    flex-wrap: wrap;
  }
  .dol-footer-part-info {
    display: none;
  }
  .dol-prev-btn,
  .dol-next-btn,
  .dol-nav-btn {
    padding: 7px 12px;
    font-size: 12.5px;
  }
  .dol-bottom-bar {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    height: auto;
    min-height: 0;
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
  }
  .dol-pdf-drawer {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 8px;
    right: 8px;
    bottom: 112px;
    width: auto;
    height: auto;
    margin-left: 0;
    z-index: 96;
  }
}
@media (max-width: 480px) {
  .dol-calc-grid {
    padding: 10px;
    gap: 5px;
  }
  .calc-btn {
    height: 38px;
    font-size: 13px;
  }
}

/* ============================================================
   THPT 2025/2026: PART II (TRUE / FALSE) & PART III (SHORT ANSWER) STYLES
   ============================================================ */

/* Prompt Notice when reading from PDF */
.dol-prompt-notice {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, #4f46e5);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 8px;
}

.dol-notice-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent, #4f46e5);
  margin-bottom: 8px;
}

:root[data-theme="dark"] .dol-notice-tag {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}

.dol-notice-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 10px;
}

.dol-notice-tip {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

/* Partial correctness in Chill mode */
.dol-chill-banner.is-partial {
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  color: #b45309;
}

:root[data-theme="dark"] .dol-chill-banner.is-partial {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

/* Part II: True / False Sub-items Table */
.dol-tf-wrapper {
  margin-top: 12px;
  margin-bottom: 12px;
}

.dol-tf-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dol-tf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: all 0.15s ease;
}

.dol-tf-row:hover {
  border-color: #a5b4fc;
  background: var(--surface-2);
}

.dol-tf-row.is-correct-row {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

.dol-tf-row.is-wrong-row {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.04);
}

.dol-tf-label-side {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.dol-tf-sub-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--accent, #4f46e5);
  flex-shrink: 0;
}

.dol-tf-sub-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  padding-top: 2px;
  word-break: break-word;
}

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

.dol-tf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.dol-tf-btn .tf-btn-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid currentColor;
}

/* Dung button */
.dol-tf-btn.btn-dung:hover {
  border-color: #10b981;
  color: #059669;
  background: rgba(16, 185, 129, 0.06);
}

.dol-tf-btn.btn-dung.is-active {
  border-color: #10b981;
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.dol-tf-btn.btn-dung.is-active .tf-btn-check {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
}

/* Sai button */
.dol-tf-btn.btn-sai:hover {
  border-color: #ef4444;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.06);
}

.dol-tf-btn.btn-sai.is-active {
  border-color: #ef4444;
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.dol-tf-btn.btn-sai.is-active .tf-btn-check {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
}

/* Part III: Short Answer */
.dol-short-wrapper {
  margin-top: 14px;
  margin-bottom: 14px;
}

.dol-short-card {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.dol-short-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 12px;
}

.dol-short-header .short-icon {
  font-size: 18px;
}

.dol-short-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dol-short-input {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  padding: 10px 14px;
  font-family: var(--mono, 'Fira Code', monospace);
  font-size: 17px;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}

.dol-short-input:focus {
  border-color: var(--accent, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
  background: var(--surface);
}

.dol-short-save-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
}

.dol-short-del-btn {
  padding: 9px 12px;
  font-size: 12.5px;
}

.dol-short-hint {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.dol-short-hint code {
  font-family: var(--mono, monospace);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 12px;
  color: var(--accent, #4f46e5);
}

/* Certificate Meta alerts */
.dgnl-meta-err {
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
  margin-left: 6px;
}

.dgnl-zero-score-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0 14px;
  color: #991b1b;
  font-size: 13.5px;
  line-height: 1.5;
}

:root[data-theme="dark"] .dgnl-zero-score-alert {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

@media (max-width: 640px) {
  .dol-tf-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .dol-tf-actions-side {
    justify-content: flex-end;
  }
  .dol-short-input {
    max-width: 100%;
    width: 100%;
  }
  .dol-short-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .dol-short-save-btn {
    width: 100%;
  }
}

/* ==================== PHÂN LOẠI KỲ THI CHÍNH: ĐGNL vs THPT ==================== */
.exam-main-group-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.exam-group-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.exam-group-tab:hover {
  border-color: rgba(240, 81, 35, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

.exam-group-tab.is-active {
  border-color: #f05123;
  background: linear-gradient(135deg, rgba(240, 81, 35, 0.09) 0%, rgba(255, 138, 92, 0.03) 100%);
  box-shadow: 0 8px 22px rgba(240, 81, 35, 0.14);
}

.exam-group-tab .egt-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.exam-group-tab.is-active .egt-icon {
  background: linear-gradient(135deg, #f05123, #ff8a5c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(240, 81, 35, 0.28);
}

.exam-group-tab .egt-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.exam-group-tab .egt-text strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.exam-group-tab.is-active .egt-text strong {
  color: #ea580c;
}

.exam-group-tab .egt-text small {
  font-size: 12.5px;
  color: var(--muted);
}

.exam-group-tab .egt-count {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.exam-group-tab.is-active .egt-count {
  background: #f05123;
  color: #fff;
}

.thpt-subject-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.thpt-subject-toolbar[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .exam-main-group-tabs {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Điện thoại: bản tối giản cho Luyện đề (ưu tiên thấy đề, bỏ phần trang trí)
   ========================================================================== */
@media (max-width: 700px) {
  .exam-omr-container {
    padding: 10px 10px 16px;
  }

  /* danh mục: bỏ banner lớn, bộ lọc thành một hàng cuộn ngang */
  #view-catalog .my-exams-header-banner {
    display: none;
  }
  .thpt-subject-toolbar:not([hidden]),
  .my-exams-toolbar .category-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin: 0 -10px 8px;
    padding: 2px 10px 4px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .thpt-subject-toolbar::-webkit-scrollbar,
  .my-exams-toolbar .category-pills::-webkit-scrollbar {
    display: none;
  }
  .thpt-subject-toolbar .filter-pill,
  .my-exams-toolbar .filter-pill {
    flex: none;
    white-space: nowrap;
    min-height: 36px;
  }
  .my-exams-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .exam-detail-back-bar {
    margin-bottom: 8px;
  }

  /* thẻ đề: chỉ giữ tên, năm, thời lượng và nút làm bài */
  .my-card-desc,
  .my-card-meta > span:nth-child(n + 4),
  .my-badges-row .badge-template {
    display: none;
  }
  .my-exam-card {
    padding: 14px;
  }
  .my-card-title {
    font-size: 16px;
    margin: 6px 0 8px;
  }
  .my-card-actions {
    gap: 8px;
  }
  .my-card-actions .btn-primary {
    flex: 1;
    min-height: 44px;
  }
  .my-card-actions .btn-ghost {
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  /* đang làm bài: ẩn thanh trang web để dành toàn bộ màn hình cho câu hỏi */
  body:has(#view-workspace:not([hidden])) .header {
    display: none;
  }
  body:has(#view-workspace:not([hidden])) .layout {
    padding-top: 0;
  }
  .dol-topbar {
    top: 0;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border-radius: 0 0 14px 14px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }
  .dol-top-left {
    width: auto;
    flex: none;
  }
  /* bản điện thoại giữ lại: thoát, đồng hồ, nộp bài (bỏ nháp / highlight / ẩn đáp án) */
  .dol-brand-badge,
  .dol-tool-btn {
    display: none;
  }
  .dol-top-right {
    width: auto;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .dol-submit-btn,
  #ws-submit-btn {
    flex: none;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 12.5px;
  }

  /* thanh dưới: hàng số câu + một hàng chọn phần / câu trước / câu sau */
  .dol-center-container {
    padding: 10px 8px 104px;
  }
  .dol-bottom-bar {
    padding: 4px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }
  .dol-palette-strip-wrap {
    padding: 0;
  }
  .dol-footer-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 0;
  }
  .dol-subpart-pills {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .dol-subpart-pills::-webkit-scrollbar {
    display: none;
  }
  .dol-subpart-pills > * {
    flex: none;
  }
  .dol-nav-buttons {
    flex: none;
    gap: 6px;
  }
  .dol-nav-buttons .btn,
  .dol-nav-buttons button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .dol-question-card {
    padding: 14px 12px;
    min-height: 0;
  }
}
