/* Mini Test — TOEIC Computer-Based Test UI */

:root {
  --mt-indigo: #4f46e5;
  --mt-indigo-dark: #4338ca;
  --mt-purple: #7c3aed;
  --mt-emerald: #059669;
  --mt-violet: #7c3aed;
  --mt-cyan: #0891b2;
  --mt-amber: #d97706;
  --mt-slate-950: #0f172a;
  --mt-slate-900: #1e293b;
  --mt-slate-800: #334155;
  --mt-slate-600: #475569;
  --mt-slate-500: #64748b;
  --mt-slate-100: #f1f5f9;
  --mt-border: #e2e8f0;
  --mt-bg: #f8fafc;
  --mt-panel: #ffffff;
  --mt-text: #1e293b;
  --mt-muted: #64748b;
  --mt-timer-warn: #ef4444;
  --mt-correct: #10b981;
  --mt-wrong: #ef4444;
  --mt-unanswered: #94a3b8;
  --mt-radius-lg: 1rem;
  --mt-radius-xl: 1.25rem;
  --mt-radius-2xl: 1.5rem;
  --mt-radius-3xl: 1.75rem;
  font-family: 'Inter', 'Noto Sans', system-ui, sans-serif;
}

#miniTestExamOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--mt-bg);
  display: none;
  flex-direction: column;
  font-family: 'Inter', 'Noto Sans', system-ui, sans-serif;
  color: var(--mt-text);
}

#miniTestExamOverlay.mt-open {
  display: flex;
}

.mt-header {
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 45%, #7c3aed 100%);
  color: #fff;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
}

.mt-header-brand {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.mt-header-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-header-section {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.mt-timer {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  min-width: 5.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.75rem;
  border-radius: 0.375rem;
}

.mt-timer.mt-low {
  color: #fca5a5;
  animation: mt-pulse 1s ease-in-out infinite;
}

@keyframes mt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.mt-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mt-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  border-top: 1px solid var(--mt-border);
}

@media (max-width: 900px) {
  .mt-split {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.mt-left,
.mt-right {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.mt-left {
  background: #f8fafc;
  border-right: 1px solid var(--mt-border);
}

.mt-right {
  background: var(--mt-panel);
}

.mt-q-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mt-indigo);
  margin-bottom: 0.35rem;
}

.mt-q-number {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--mt-slate-900);
  margin-bottom: 0.75rem;
}

.mt-q-prompt {
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

/* Part 1 photo placeholder */
.mt-photo-frame {
  background: linear-gradient(145deg, #eef2ff 0%, #f8fafc 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--mt-radius-2xl);
  aspect-ratio: 4 / 3;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  margin: 0 auto;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.08);
}

.mt-photo-frame i {
  font-size: 2.5rem;
  color: #818cf8;
  margin-bottom: 0.75rem;
}

.mt-photo-caption {
  font-size: 0.9rem;
  color: #475569;
  font-style: italic;
  line-height: 1.45;
}

.mt-photo-frame--image {
  padding: 0;
  overflow: hidden;
  justify-content: flex-end;
}

.mt-photo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  flex: 1;
  min-height: 0;
}

.mt-photo-frame--image .mt-audio-hint {
  width: 100%;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid #e2e8f0;
}

.mt-graphic-frame {
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: var(--mt-radius-xl);
  padding: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.06);
}

.mt-graphic-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4338ca;
  margin-bottom: 0.5rem;
}

.mt-graphic-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mt-graphic-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #fff;
  border-radius: calc(var(--mt-radius-xl) - 4px);
}

.mt-graphic-frame--placeholder {
  text-align: center;
  padding: 1.25rem;
}

/* Passage */
.mt-passage-box {
  background: #fff;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-2xl);
  padding: 1.15rem 1.35rem;
  font-size: 0.92rem;
  line-height: 1.65;
  max-height: 100%;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.mt-passage-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--mt-slate-900);
  border-bottom: 1px solid var(--mt-border);
  padding-bottom: 0.5rem;
}

/* Audio controls */
.mt-audio-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: var(--mt-radius-xl);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.mt-audio-player {
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: var(--mt-radius-xl);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.06);
}

.mt-ap-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mt-ap-btn {
  background: var(--mt-indigo);
  color: #fff;
  border: none;
  border-radius: var(--mt-radius-lg);
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s, transform 0.1s;
  min-width: 2.25rem;
  justify-content: center;
}

.mt-ap-btn:hover:not(:disabled) {
  background: var(--mt-indigo-dark);
  transform: translateY(-1px);
}

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

.mt-ap-time {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mt-slate-900);
  min-width: 7.5rem;
  padding: 0.35rem 0.5rem;
  background: #f1f5f9;
  border-radius: 0.375rem;
}

.mt-ap-speed {
  display: inline-flex;
  gap: 0.2rem;
  margin-left: auto;
}

.mt-ap-speed-btn {
  background: #f1f5f9;
  border: 1px solid var(--mt-border);
  color: #475569;
  border-radius: 0.375rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.mt-ap-speed-btn:hover {
  border-color: #a5b4fc;
  color: var(--mt-indigo);
}

.mt-ap-speed-btn--active {
  background: var(--mt-indigo);
  border-color: var(--mt-indigo);
  color: #fff;
}

.mt-ap-hint {
  font-size: 0.78rem;
  color: var(--mt-muted);
  margin: 0.55rem 0 0;
}

.mt-ap-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mt-indigo);
  margin: 0.35rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Session progress in header */
.mt-session-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  max-width: 280px;
}

.mt-session-track {
  flex: 1;
  height: 0.35rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 60px;
}

.mt-session-fill {
  height: 100%;
  background: linear-gradient(90deg, #a5f3fc 0%, #fef08a 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.mt-session-stat {
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.92;
}

.mt-session-stat--correct {
  color: #bbf7d0;
}

/* Part 1 split layout */
.mt-split--part1 {
  grid-template-columns: 1.05fr 0.95fr;
}

.mt-left--part1 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mt-left--part1 .mt-photo-frame {
  max-height: min(42vh, 380px);
  max-width: none;
  width: 100%;
  flex-shrink: 0;
}

.mt-left--part1 .mt-audio-player {
  margin-top: auto;
  margin-bottom: 0;
}

.mt-right--part1 .mt-options {
  gap: 0.65rem;
}

.mt-right--part1 .mt-option--letter-only {
  padding: 1rem 1.15rem;
}

.mt-right--part1 .mt-option-letter {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .mt-session-wrap {
    order: 10;
    flex-basis: 100%;
    max-width: none;
  }

  .mt-header {
    flex-wrap: wrap;
  }
}

.mt-audio-btn {
  background: var(--mt-indigo);
  color: #fff;
  border: none;
  border-radius: var(--mt-radius-lg);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s, transform 0.1s;
}

.mt-audio-btn:hover {
  background: var(--mt-indigo-dark);
  transform: translateY(-1px);
}

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

.mt-audio-hint {
  font-size: 0.8rem;
  color: var(--mt-muted);
}

/* Answer options — TOEIC style */
.mt-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mt-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-xl);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  background: #fff;
}

.mt-option:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.mt-option.mt-selected {
  border-color: var(--mt-indigo);
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.mt-option-letter {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mt-indigo) 0%, var(--mt-purple) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt-option-text {
  font-size: 0.95rem;
  line-height: 1.45;
  padding-top: 0.1rem;
}

.mt-option--letter-only {
  align-items: center;
  min-height: 3rem;
}

.mt-option--letter-only .mt-option-letter {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.95rem;
}

.mt-option-text--listen {
  font-size: 0.8rem;
  color: var(--mt-slate-500);
  font-weight: 600;
}

.mt-audio-bar--part1 {
  margin-top: 0.75rem;
}

.mt-audio-countdown {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--mt-radius-xl);
  border: 1px solid #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mt-audio-countdown-ring {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mt-indigo) 0%, var(--mt-purple) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
  animation: mt-countdown-pulse 1s ease-in-out infinite;
}

.mt-audio-countdown--playing .mt-audio-countdown-ring {
  animation: none;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.mt-audio-countdown--done .mt-audio-countdown-ring {
  animation: none;
  background: #64748b;
  box-shadow: none;
  font-size: 1.1rem;
}

.mt-audio-countdown-label {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--mt-slate-600);
  font-weight: 600;
}

.mt-audio-countdown-label strong {
  color: var(--mt-indigo);
  font-size: 0.95rem;
}

@keyframes mt-countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.mt-part1-statements {
  border-top: 1px dashed var(--mt-border);
  padding-top: 0.65rem;
}

/* Footer nav */
.mt-footer {
  background: var(--mt-slate-950);
  color: #fff;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.mt-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: var(--mt-radius-lg);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}

.mt-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.mt-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mt-nav-btn.mt-primary {
  background: var(--mt-indigo);
  border-color: var(--mt-indigo);
}

.mt-nav-btn.mt-primary:hover:not(:disabled) {
  background: var(--mt-indigo-dark);
}

.mt-nav-btn.mt-danger {
  background: #059669;
  border-color: #059669;
}

.mt-nav-btn.mt-danger:hover:not(:disabled) {
  background: #047857;
}

.mt-q-grid {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  max-height: 4.5rem;
  overflow-y: auto;
  padding: 0.15rem;
}

.mt-q-dot {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.mt-q-dot:hover {
  background: rgba(255, 255, 255, 0.22);
}

.mt-q-dot.mt-pending {
  background: rgba(234, 179, 8, 0.9);
  border-color: #eab308;
  color: #422006;
}

.mt-q-dot.mt-correct {
  background: rgba(16, 185, 129, 0.85);
  border-color: #10b981;
  color: #fff;
}

.mt-q-dot.mt-wrong {
  background: rgba(239, 68, 68, 0.9);
  border-color: #ef4444;
  color: #fff;
}

.mt-q-dot.mt-current {
  box-shadow: 0 0 0 2px var(--mt-slate-950), 0 0 0 3.5px #fff, 0 0 0 5px var(--mt-indigo);
  transform: scale(1.08);
  z-index: 1;
}

.mt-q-dot.mt-answered {
  background: rgba(16, 185, 129, 0.65);
  border-color: #10b981;
}

/* Screens: intro, transition, results */
.mt-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.mt-card {
  background: #fff;
  border-radius: var(--mt-radius-3xl);
  border: 1px solid var(--mt-border);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  max-width: 560px;
  width: 100%;
  padding: 2rem;
}

.mt-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mt-slate-900);
  margin-bottom: 0.75rem;
}

.mt-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--mt-muted);
  margin-bottom: 0.75rem;
}

.mt-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.mt-stat {
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-xl);
  padding: 1rem 0.5rem;
}

.mt-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--mt-indigo);
}

.mt-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mt-muted);
  margin-top: 0.25rem;
}

.mt-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.mt-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.7rem 1.25rem;
  border-radius: var(--mt-radius-xl);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.mt-btn-primary {
  background: var(--mt-indigo);
  color: #fff;
}

.mt-btn-primary:hover {
  background: var(--mt-indigo-dark);
  transform: translateY(-1px);
}

.mt-btn-secondary {
  background: #f1f5f9;
  color: var(--mt-text);
  border: 1px solid var(--mt-border);
}

.mt-btn-secondary:hover {
  background: #e2e8f0;
}

/* Review list */
.mt-review-list {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 1rem;
}

.mt-review-item {
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-2xl);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.mt-review-item.mt-wrong-item {
  border-left: 4px solid var(--mt-wrong);
}

.mt-review-item.mt-correct-item {
  border-left: 4px solid var(--mt-correct);
}

.mt-review-qhead {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.mt-review-answers {
  font-size: 0.85rem;
  line-height: 1.5;
}

.mt-review-answers .mt-your {
  color: var(--mt-wrong);
}

.mt-review-answers .mt-correct-ans {
  color: var(--mt-correct);
  font-weight: 700;
}

.mt-review-explain {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #475569;
  background: #f8fafc;
  padding: 0.65rem 0.85rem;
  border-radius: var(--mt-radius-lg);
  border: 1px solid #e2e8f0;
}

/* ─── Hub (matches Friendly TOEIC dashboard) ─── */
.mt-hub {
  max-width: 960px;
  margin: 0 auto;
  font-family: 'Inter', 'Noto Sans', system-ui, sans-serif;
}

.mt-hub-hero {
  background: linear-gradient(90deg, #4f46e5 0%, #4338ca 40%, #7c3aed 100%);
  color: #fff;
  border-radius: var(--mt-radius-2xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(79, 70, 229, 0.22);
}

.mt-hub-hero::after {
  content: '';
  position: absolute;
  right: -1rem;
  bottom: -1.5rem;
  width: 8rem;
  height: 8rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.mt-hub-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: #e0e7ff;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.mt-hub-hero h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 1;
}

.mt-hub-hero p {
  opacity: 0.9;
  font-size: 0.875rem;
  line-height: 1.55;
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.mt-level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mt-level-tab {
  padding: 0.55rem 1rem;
  border-radius: var(--mt-radius-xl);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--mt-border);
  background: #fff;
  color: var(--mt-slate-600);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.mt-level-tab:hover {
  border-color: #c7d2fe;
  background: #fafbff;
}

.mt-level-tab.mt-active {
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.mt-level-tab.mt-active[data-accent="emerald"] {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}

.mt-level-tab.mt-active[data-accent="violet"] {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.mt-level-tab.mt-active[data-accent="cyan"] {
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.28);
}

.mt-level-tab.mt-active[data-accent="amber"] {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.28);
}

.mt-level-panel {
  background: #fff;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-3xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.mt-level-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.mt-level-panel-head p:first-child {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mt-indigo);
}

.mt-level-panel-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--mt-slate-900);
  margin-top: 0.15rem;
}

.mt-level-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid;
}

.mt-version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}

.mt-version-card {
  background: #fff;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-3xl);
  padding: 1.15rem 1.25rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mt-version-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}

.mt-version-card[data-accent="emerald"]:hover { border-color: #a7f3d0; box-shadow: 0 8px 28px rgba(5, 150, 105, 0.12); }
.mt-version-card[data-accent="violet"]:hover { border-color: #ddd6fe; box-shadow: 0 8px 28px rgba(124, 58, 237, 0.12); }
.mt-version-card[data-accent="cyan"]:hover { border-color: #a5f3fc; box-shadow: 0 8px 28px rgba(8, 145, 178, 0.12); }
.mt-version-card[data-accent="amber"]:hover { border-color: #fde68a; box-shadow: 0 8px 28px rgba(217, 119, 6, 0.12); }

.mt-version-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--mt-radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
}

.mt-version-icon[data-accent="emerald"] { background: linear-gradient(135deg, #059669, #34d399); }
.mt-version-icon[data-accent="violet"] { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.mt-version-icon[data-accent="cyan"] { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.mt-version-icon[data-accent="amber"] { background: linear-gradient(135deg, #d97706, #fbbf24); }
.mt-version-icon[data-accent="indigo"] { background: linear-gradient(135deg, #4f46e5, #818cf8); }

.mt-version-card h4 {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--mt-slate-900);
  margin: 0;
  line-height: 1.3;
}

.mt-version-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mt-slate-500);
}

.mt-version-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--mt-indigo);
  margin-top: auto;
  padding-top: 0.25rem;
}

.mt-version-card[data-accent="emerald"] .mt-version-action { color: #059669; }
.mt-version-card[data-accent="violet"] .mt-version-action { color: #7c3aed; }
.mt-version-card[data-accent="cyan"] .mt-version-action { color: #0891b2; }
.mt-version-card[data-accent="amber"] .mt-version-action { color: #d97706; }

.mt-close-exam {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  margin-left: -0.25rem;
}

.mt-close-exam:hover {
  color: #fff;
}

.mt-structure-list {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: #475569;
  margin: 0.75rem 0;
}

.mt-structure-list li {
  margin-bottom: 0.25rem;
}

/* ─── Dark site integration ─── */
html.dark-site {
  --mt-bg: #0f172a;
  --mt-panel: #1e293b;
  --mt-border: #334155;
  --mt-text: #e2e8f0;
  --mt-muted: #94a3b8;
}

html.dark-site #miniTestExamOverlay {
  background: #0f172a;
}

html.dark-site .mt-left {
  background: #1e293b;
}

html.dark-site .mt-right {
  background: #0f172a;
}

html.dark-site .mt-passage-box,
html.dark-site .mt-audio-bar,
html.dark-site .mt-audio-player,
html.dark-site .mt-option {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-site .mt-option:hover {
  background: #334155;
  border-color: #6366f1;
}

html.dark-site .mt-option.mt-selected {
  background: rgba(79, 70, 229, 0.25);
  border-color: #818cf8;
}

html.dark-site .mt-ap-time {
  background: #0f172a;
  color: #e2e8f0;
}

html.dark-site .mt-ap-speed-btn {
  background: #0f172a;
  border-color: #475569;
  color: #cbd5e1;
}

html.dark-site .mt-ap-speed-btn--active {
  background: var(--mt-indigo);
  border-color: var(--mt-indigo);
  color: #fff;
}

html.dark-site .mt-photo-frame {
  background: linear-gradient(145deg, #312e81 0%, #1e293b 100%);
  border-color: #4338ca;
}

html.dark-site .mt-photo-caption {
  color: #c7d2fe;
}

html.dark-site .mt-card {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-site .mt-card h2 {
  color: #f1f5f9;
}

html.dark-site .mt-card p,
html.dark-site .mt-structure-list {
  color: #94a3b8;
}

html.dark-site .mt-stat {
  background: #0f172a;
  border-color: #334155;
}

html.dark-site .mt-btn-secondary {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}

html.dark-site .mt-review-item {
  background: #1e293b;
  border-color: #334155;
}

html.dark-site .mt-review-explain {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

html.dark-site .mt-level-panel {
  background: #1e293b;
  border-color: #334155;
}

html.dark-site .mt-level-panel-head {
  border-bottom-color: #334155;
}

html.dark-site .mt-level-panel-head h3 {
  color: #f1f5f9;
}

html.dark-site .mt-level-tab {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

html.dark-site .mt-level-tab:hover {
  background: #334155;
  border-color: #475569;
}

html.dark-site .mt-version-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark-site .mt-version-card h4 {
  color: #f1f5f9;
}

html.dark-site .mt-q-prompt {
  color: #e2e8f0;
}

html.dark-site .mt-option-text {
  color: #e2e8f0;
}

html.dark-site .mt-audio-countdown {
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.45) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(129, 140, 248, 0.35);
}

html.dark-site .mt-audio-countdown-label {
  color: #cbd5e1;
}

html.dark-site .mt-audio-countdown-label strong {
  color: #a5b4fc;
}

.mt-listen-only {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: #c7d2fe;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.mt-option--listen-only .mt-option-text--listen {
  font-style: italic;
  opacity: 0.85;
}

/* Phase 2b — test card history badges */
.mt-version-history {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.mt-version-history--score {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.mt-version-history--done {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.mt-version-last {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--mt-slate-500);
  margin: 0;
}

html.dark-site .mt-version-history--score {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

html.dark-site .mt-version-history--done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}

html.dark-site .mt-version-last {
  color: #94a3b8;
}

/* Phase 2c — result analysis */
.mt-screen--results {
  align-items: flex-start;
  padding-top: 1.25rem;
}

.mt-card--results {
  max-width: 760px;
}

.mt-result-best {
  font-size: 0.85rem;
  color: #475569;
  margin: -0.25rem 0 0.75rem;
}

.mt-analysis {
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--mt-border);
  background: #f8fafc;
}

.mt-analysis-heading {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0 0 0.65rem;
}

.mt-analysis-heading--parts {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #cbd5e1;
}

.mt-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 4.5rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.mt-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}

.mt-bar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mt-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #6366f1;
  transition: width 0.35s ease;
}

.mt-bar-fill--weak {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.mt-bar-value {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-align: right;
}

.mt-rec-box {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #c7d2fe;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

.mt-rec-box--good {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5, #f8fafc);
}

.mt-rec-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4338ca;
  margin: 0 0 0.5rem;
}

.mt-rec-box--good .mt-rec-title {
  color: #047857;
}

.mt-rec-lead {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

.mt-rec-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mt-rec-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #312e81;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  text-align: left;
}

.mt-rec-step span {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #4338ca;
  color: #fff;
  font-size: 0.65rem;
}

.mt-rec-step:hover {
  background: #eef2ff;
  transform: translateY(-1px);
}

html.dark-site .mt-analysis {
  background: rgba(15, 23, 42, 0.65);
  border-color: #334155;
}

html.dark-site .mt-bar-track {
  background: #334155;
}

html.dark-site .mt-bar-label,
html.dark-site .mt-rec-lead {
  color: #e2e8f0;
}

html.dark-site .mt-rec-box {
  border-color: rgba(129, 140, 248, 0.35);
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.35), rgba(15, 23, 42, 0.8));
}

html.dark-site .mt-rec-step {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(129, 140, 248, 0.35);
  color: #e0e7ff;
}

@media (max-width: 640px) {
  .mt-rec-steps {
    grid-template-columns: 1fr;
  }

  .mt-bar-row {
    grid-template-columns: 4.5rem 1fr 3.5rem;
  }
}

/* History panel + passage translate (2026-07-18 UX) */
.mt-history-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.mt-history-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.mt-history-head p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.mt-history-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mt-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem;
  border-radius: 0.85rem;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
}

.mt-history-row-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.mt-history-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mt-history-name {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.mt-history-meta,
.mt-history-lr,
.mt-history-hint {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: #64748b;
}

.mt-history-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mt-history-score {
  font-size: 1rem;
  font-weight: 800;
  color: #0d9488;
}

.mt-history-review {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.7rem !important;
}

.mt-passage-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mt-passage-translate {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.55rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.mt-passage-translate:hover {
  background: #dbeafe;
}

.mt-passage-body {
  white-space: pre-wrap;
  line-height: 1.55;
}

.mt-passage-translation {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.82rem;
  color: #334155;
}

html.dark-site .mt-history-panel {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(51, 65, 85, 0.8);
}

html.dark-site .mt-history-head h3 {
  color: #f1f5f9;
}

html.dark-site .mt-history-row {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.7);
}

html.dark-site .mt-history-name {
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .mt-history-row {
    flex-direction: column;
    align-items: stretch;
  }
  .mt-history-row-actions {
    justify-content: space-between;
  }
}

.mt-version-card {
  position: relative;
}

.mt-star-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

.mt-star-btn:hover {
  color: #f59e0b;
  border-color: #fde68a;
}

.mt-star-btn--on {
  color: #f59e0b;
  background: #fffbeb;
  border-color: #fde68a;
}

.mt-version-card--starred {
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.mt-version-flags {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
}

.mt-q-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.mt-flag-btn {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.mt-flag-btn:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.mt-flag-btn--on {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.mt-flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.35rem;
}

.mt-q-dot.mt-flagged::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ef4444;
}

.mt-q-dot {
  position: relative;
}

.mt-score-990 {
  margin: 1rem 0;
  padding: 0.85rem;
  border-radius: 1rem;
  border: 1px solid #cffafe;
  background: linear-gradient(135deg, #ecfeff 0%, #f8fafc 100%);
}

.mt-score-990-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0e7490;
}

.mt-score-990-note {
  font-weight: 600;
  color: #64748b;
  font-size: 0.65rem;
}

.mt-score-990-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.mt-score-990-card {
  border-radius: 0.85rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.65rem;
  text-align: center;
}

.mt-score-990-card--total {
  border-color: #a5f3fc;
  background: #ecfeff;
}

.mt-score-990-k {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.mt-score-990-v {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
}

.mt-score-990-s {
  margin: 0;
  font-size: 0.65rem;
  color: #64748b;
}

html.dark-site .mt-score-990 {
  background: rgba(8, 51, 68, 0.45);
  border-color: rgba(34, 211, 238, 0.25);
}

html.dark-site .mt-score-990-card {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(51, 65, 85, 0.8);
}

html.dark-site .mt-score-990-v {
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .mt-score-990-grid {
    grid-template-columns: 1fr;
  }
}

.lesson-audio-speed {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
}

.lesson-audio-speed-btn {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}

.lesson-audio-speed-btn.is-active {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}


