:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f97316;
  --warning-light: #ffedd5;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  padding: 16px 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

.logo-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 20px;
}

.logo-text h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-text p {
  font-size: 12px;
  color: #bfdbfe;
}

.lesson-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 10px;
}

.lesson-selector select {
  background: white;
  color: #1e3a8a;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
  flex: 1;
  width: 100%;
}

/* Top Stats & Quick Info */
.info-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow);
}

.info-title h2 {
  font-size: 20px;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-title span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: normal;
}

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

.pill-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
}

/* Picture Viewer */
.picture-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

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

.picture-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pictures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.pic-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  cursor: zoom-in;
}

.pic-wrapper img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #fafafa;
  display: block;
  transition: transform 0.2s ease;
}

.pic-wrapper:hover img {
  transform: scale(1.02);
}

.pic-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  color: white;
  padding: 4px 8px;
  font-size: 11px;
  text-align: center;
}

/* Practice Mode (Sentence by Sentence) */
.sentence-coach-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
}

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

.sentence-stepper {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 20px;
}

.teacher-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #047857;
  font-weight: 600;
}

.target-sentence-box {
  background: #fdfdfe;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.target-pinyin {
  font-size: 17px;
  color: #0284c7;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.target-chinese {
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 1px;
  margin-bottom: 12px;
  cursor: pointer;
}

.target-meaning {
  font-size: 15px;
  color: #475569;
  font-style: italic;
}

/* Controls Area */
.controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.btn-teacher-speak {
  background: #3b82f6;
  color: white;
}

.btn-teacher-speak:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-record {
  background: #ef4444;
  color: white;
  font-size: 16px;
  padding: 14px 28px;
}

.btn-record:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-record.recording {
  background: #b91c1c;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.btn-nav-prev, .btn-nav-next {
  background: #f1f5f9;
  color: #334155;
  padding: 10px 16px;
  border-radius: 8px;
}

.btn-nav-prev:hover, .btn-nav-next:hover {
  background: #e2e8f0;
}

.speed-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

/* AI Teacher Evaluation Feedback Box */
.evaluation-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 16px;
  display: none;
}

.evaluation-box.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.eval-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.eval-score-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
  background: var(--success);
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.score-circle.score-medium {
  background: var(--accent);
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.score-circle.score-low {
  background: var(--danger);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.eval-badge-title {
  font-size: 17px;
  font-weight: 700;
  color: #14532d;
}

.eval-stars {
  font-size: 18px;
  color: #f59e0b;
}

.eval-feedback-msg {
  background: white;
  border-left: 4px solid var(--success);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 14px;
}

.eval-diff-analysis {
  background: white;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.diff-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #047857;
  margin-bottom: 6px;
}

.diff-chars {
  font-size: 22px;
  letter-spacing: 2px;
  line-height: 1.6;
}

.char-correct {
  color: #10b981;
  font-weight: bold;
}

.char-wrong {
  color: #ef4444;
  text-decoration: underline wavy #ef4444;
  font-weight: bold;
  background: #fee2e2;
  padding: 0 2px;
  border-radius: 4px;
}

.char-missing {
  color: #f97316;
  opacity: 0.7;
}

.student-transcript-box {
  font-size: 13px;
  color: #4b5563;
  margin-top: 8px;
  font-style: italic;
}

/* Audio Comparison Section */
.audio-compare-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Full Speech Mode & Shadowing */
.full-speech-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.full-speech-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.font-size-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  color: #475569;
}

.font-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.font-btn:hover, .font-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.speech-row-item {
  padding: 16px 20px;
  border-radius: 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}

.speech-row-item:hover {
  background: #f1f5f9;
}

.speech-row-item.playing {
  background: #eff6ff;
  border-left: 5px solid var(--primary);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.row-num {
  background: #e2e8f0;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  shrink: 0;
  margin-top: 4px;
}

.speech-row-item.playing .row-num {
  background: var(--primary);
  color: white;
}

.row-content {
  flex: 1;
}

/* Chữ Hán to rõ ràng ở mục đọc cả bài */
.row-zh {
  font-size: 25px; /* Chữ to rõ ràng mặc định */
  font-weight: 700;
  color: #0f172a;
  line-height: 1.6;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  transition: font-size 0.2s ease;
}

.row-zh.size-sm { font-size: 20px; }
.row-zh.size-md { font-size: 25px; }
.row-zh.size-lg { font-size: 30px; }
.row-zh.size-xl { font-size: 36px; }

.row-py {
  font-size: 15px;
  color: #0284c7;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.row-vi {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
}

/* =========================================
   BANNER CHỮ CHẠY SONG SONG (TELEPROMPTER)
   ========================================= */
.challenge-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ticker-panel {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 14px;
  padding: 16px 20px;
  color: white;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
  position: relative;
  overflow: hidden;
  border: 1px solid #334155;
}

.ticker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.ticker-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.ticker-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ticker-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.ticker-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.ticker-select {
  background: #1e293b;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  outline: none;
}

/* Vùng chạy chữ ngang (Horizontal Marquee) */
.ticker-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 16px 0;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
  gap: 40px;
  animation: marquee-scroll 45s linear infinite;
}

.ticker-track.paused {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid #38bdf8;
  padding: 8px 18px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.ticker-item-zh {
  font-size: 26px; /* Chữ Hán to trên banner */
  font-weight: bold;
  color: #f8fafc;
  letter-spacing: 1px;
}

.ticker-item-py {
  font-size: 14px;
  color: #38bdf8;
  margin-top: 2px;
}

.ticker-item-vi {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 2px;
}

/* Máy nhắc chữ kiểu Dọc (Vertical Teleprompter Mode) */
.teleprompter-vertical-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  scroll-behavior: smooth;
  display: none;
}

.teleprompter-line {
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.teleprompter-line.active {
  background: rgba(56, 189, 248, 0.2);
  border-left-color: #38bdf8;
  transform: scale(1.01);
}

.teleprompter-line .t-zh {
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
}

.teleprompter-line .t-py {
  font-size: 13.5px;
  color: #7dd3fc;
}

.teleprompter-line .t-vi {
  font-size: 13px;
  color: #cbd5e1;
}

/* Grammar & Vocab Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.study-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.study-card h4 {
  font-size: 15px;
  color: #1e3a8a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modal for Image Zoom */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 95%;
  max-height: 95%;
  position: relative;
}

.modal-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  display: block;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 28px;
  cursor: pointer;
  background: none;
  border: none;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: white;
}

/* =========================================
   SƠ ĐỒ THỨ TỰ HÀNH ĐỘNG (ACTION ROADMAP)
   ========================================= */
.roadmap-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.roadmap-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.roadmap-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.roadmap-step-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  border-top: 4px solid #2563eb;
}

.roadmap-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #3b82f6;
}

.step-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.step-num-pill {
  background: #2563eb;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.step-connector-pill {
  background: #fef3c7;
  color: #92400e;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.step-zh {
  font-size: 19px;
  font-weight: bold;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 4px;
  cursor: pointer;
}

.step-zh:hover {
  color: #2563eb;
}

.step-py {
  font-size: 12.5px;
  color: #0284c7;
  margin-bottom: 6px;
}

.step-vi {
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
  flex: 1;
}

.step-keywords {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kw-chip {
  background: #f1f5f9;
  color: #1e3a8a;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

/* Question & Answer Card Enhanced */
.qa-card-enhanced {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.qa-card-enhanced:hover {
  border-color: #86efac;
  box-shadow: var(--shadow-lg);
}

.qa-q-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.qa-q-zh {
  font-size: 18px;
  font-weight: bold;
  color: #166534;
  line-height: 1.4;
  margin-bottom: 4px;
}

.qa-q-py {
  font-size: 13.5px;
  color: #0284c7;
  margin-bottom: 4px;
}

.qa-q-vi {
  font-size: 13.5px;
  color: #374151;
  font-style: italic;
}

.qa-a-box {
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
}

.qa-a-zh {
  font-size: 17px;
  font-weight: bold;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 4px;
}

.qa-a-py {
  font-size: 13px;
  color: #0284c7;
  margin-bottom: 4px;
}

.qa-a-vi {
  font-size: 13px;
  color: #475569;
}

/* Status & Live Speech Indicator */
.recording-status-box {
  text-align: center;
  font-size: 14px;
  color: #475569;
  margin: 10px auto;
  padding: 8px 16px;
  border-radius: 8px;
  background: #f1f5f9;
  max-width: 600px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.recording-status-box.active {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  animation: pulse-border 1.5s infinite;
  border: 1px solid #f87171;
}

.recording-status-box.error {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.recording-status-box.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Fallback Keyboard / Dictation Input */
.dictation-fallback-panel {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px auto;
  max-width: 600px;
  display: none;
}

.dictation-fallback-panel.visible {
  display: block;
}

.dictation-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dictation-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.dictation-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-dictation-grade {
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-dictation-grade:hover {
  background: #059669;
}

.btn-toggle-fallback {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-fallback:hover {
  background: #f1f5f9;
  color: var(--primary);
}

/* Troubleshoot Guide */
.troubleshoot-guide {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
  display: none;
}
