/* Master stylesheet importing modular styles *//* Modern Dictation Studio Design System (Base & Navigation) */
:root {
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-secondary: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-focus: #3b82f6;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg-primary: #080c15;
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-secondary: rgba(30, 41, 59, 0.72);
  --border-color: rgba(51, 65, 85, 0.65);
  --border-color-focus: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-hover: #60a5fa;
  --primary-light: rgba(56, 189, 248, 0.16);
  --primary-border: #0284c7;
  --success-bg: rgba(6, 78, 59, 0.4);
  --success-border: #059669;
  --danger-bg: rgba(127, 29, 29, 0.4);
  --warning-bg: rgba(120, 53, 15, 0.4);
}

[data-theme="dark"] body {
  background-color: #080c15;
  background-image: 
    radial-gradient(circle at 20% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.07) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none'%3E%3Ccircle cx='30' cy='40' r='1' fill='rgba(255,255,255,0.25)'/%3E%3Ccircle cx='140' cy='25' r='1.2' fill='rgba(255,255,255,0.3)'/%3E%3Ccircle cx='90' cy='110' r='0.8' fill='rgba(255,255,255,0.2)'/%3E%3Ccircle cx='160' cy='135' r='1.5' fill='rgba(255,255,255,0.35)'/%3E%3Ccircle cx='50' cy='150' r='1' fill='rgba(255,255,255,0.22)'/%3E%3Cpath d='M30 40L60 70L90 110' stroke='rgba(255,255,255,0.03)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

[data-theme="dark"] .card,
[data-theme="dark"] .app-header,
[data-theme="dark"] .tabs-header,
[data-theme="dark"] .lang-selector-group,
[data-theme="dark"] .dictation-translation-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
}


[data-theme="forest"] {
  --bg-primary: #101412;
  --bg-card: rgba(18, 22, 20, 0.78);
  --bg-secondary: rgba(28, 34, 30, 0.65);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-color-focus: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #f59e0b;
  --primary-hover: #fbbf24;
  --primary-light: rgba(245, 158, 11, 0.18);
  --primary-border: rgba(245, 158, 11, 0.4);
  --success: #34d399;
  --success-bg: rgba(16, 185, 129, 0.2);
  --success-border: #059669;
  --danger-bg: rgba(127, 29, 29, 0.4);
  --warning: #f59e0b;
  --warning-bg: rgba(120, 53, 15, 0.4);
}

[data-theme="forest"] body {
  background-color: #0f1712;
  background-image: 
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.32)),
    var(--forest-bg-url, url("/tb_forest_1.jpg"));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: background-image 1.2s ease-in-out;
}

[data-theme="forest"] .card,
[data-theme="forest"] .app-header,
[data-theme="forest"] .tabs-header,
[data-theme="forest"] .lang-selector-group,
[data-theme="forest"] .dictation-translation-card {
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.25);
}





* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.brand-icon {
  color: var(--primary);
}
.brand span { color: var(--text-primary); }

.url-input-form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
  align-items: center;
}
.url-input-container {
  position: relative;
  flex: 2 1 450px;
  min-width: 200px;
  display: flex;
  align-items: center;
}
.input-url-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.url-input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-family);
  outline: none;
  transition: all 0.2s;
}
.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: var(--bg-card);
}

/* Header Language Selectors (Ultra-Compact) */
.lang-selector-group {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.lang-selector-group:hover,
.lang-selector-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}
.lang-select-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.lang-select-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.header-lang-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  padding: 1px 0;
  max-width: 65px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-lang-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.lang-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
  padding: 0 1px;
}
.url-input-form .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .url-input-form {
    flex-wrap: wrap;
  }
  .lang-selector-group {
    width: 100%;
    justify-content: space-between;
  }
}

/* Buttons */
.btn {
  padding: 6px 13px;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family);
  transition: all 0.15s;
}
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-with-icon svg {
  flex-shrink: 0;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.btn-warning {
  background: var(--warning);
  color: white;
}
.btn-warning:hover {
  opacity: 0.92;
}
.btn-primary-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-primary-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}
.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}
.btn-danger-outline:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-1px);
}
.btn-icon {
  padding: 5px 8px;
  border-radius: 7px;
}
.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Loading Spinner */
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main Layout */
.main-container {
  max-width: 1440px;
  margin: 10px auto;
  padding: 0 16px;
  width: 100%;
  flex: 1;
}

/* Tabs Navigation - Compact Single-Row Design */
.tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border-color);
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
}
.tabs-header::-webkit-scrollbar {
  display: none; /* Safari & Chrome */
}
.tabs-nav-group {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex: 1;
}
.tab-btn {
  padding: 6px 10px;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-family);
  margin-bottom: -1.5px;
  white-space: nowrap;
  transition: all 0.15s ease;
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
  background: rgba(99, 102, 241, 0.08);
}
.tabs-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  padding-bottom: 4px;
}
.tab-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

/* Exercise Grid */
.exercise-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}
@media (max-width: 1024px) {
  .exercise-grid { grid-template-columns: 1fr; }
}
/* Modern Dictation Studio Design System (Dictation & Practice Elements) */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: black;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}
.video-wrapper iframe, .video-wrapper #youtube-player {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%; border: none;
}

.playback-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.speed-group {
  display: flex;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-left: 4px;
}
.speed-btn {
  padding: 4px 9px;
  background: var(--bg-card);
  border: none;
  border-right: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-family: var(--font-family);
  cursor: pointer;
  color: var(--text-secondary);
}
.speed-btn:last-child { border-right: none; }
.speed-btn.active {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

/* Dictation Section Header - Nhỏ gọn */
.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.challenge-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.challenge-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
  margin-top: 1px;
}
.challenge-nav-buttons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 0.3s ease;
}

/* Masked Card (So khớp ký tự thời gian thực) */
.masked-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.masked-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.masked-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 1px 6px;
  border-radius: 4px;
}
.masked-hint-note {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.diff-preview-container {
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.masked-sentence {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  line-height: 1.35;
}
.masked-word {
  display: inline-flex;
  gap: 1px;
  background: var(--bg-card);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.char-box {
  display: inline-block;
  min-width: 8px;
  text-align: center;
  font-weight: 600;
  transition: color 0.1s;
}
.char-masked {
  color: var(--text-muted);
  opacity: 0.5;
}
.char-correct {
  color: var(--primary);
  font-weight: 700;
}
.char-punct {
  color: var(--text-primary);
  font-weight: 600;
}
.char-wrong {
  color: #ef4444 !important;
  font-weight: 800 !important;
  animation: shakeChar 0.35s ease-in-out;
  display: inline-block;
}

@keyframes shakeChar {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Dictation Input Box */
.input-wrapper {
  position: relative;
  margin-bottom: 8px;
}
.dictation-input {
  width: 100%;
  min-height: 88px;
  padding: 10px 45px 10px 12px;
  font-size: 1.05rem;
  font-family: var(--font-family);
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.45;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}
.dictation-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}
.dictation-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
  opacity: 0.8;
}

.mic-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.mic-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.mic-btn.listening {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.55) !important;
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.mic-icon-active {
  animation: rotateMic 1.8s ease infinite alternate;
}

@keyframes rotateMic {
  0% { transform: rotate(-3deg); }
  100% { transform: rotate(3deg); }
}

.mic-listening-pill {
  position: absolute;
  bottom: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 10px;
  border-radius: 9999px;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

.mic-listening-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: blinkDot 1s infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Action Buttons Toolbar */
.dictation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

/* Dedicated Bilingual Translation Card */
.dictation-translation-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: block;
  transition: all 0.2s ease;
}
[data-theme="dark"] .dictation-translation-card {
  background: #082f4922;
  border-color: #0369a1;
}
.dictation-translation-card.hidden {
  display: none;
}
.translation-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.translation-lang-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0284c7;
}
.lang-code {
  background: #0284c7;
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text-action {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
}
.btn-text-action:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}
.dictation-translation-content {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 500;
  transition: filter 0.2s;
}
.dictation-translation-content.blurred {
  filter: blur(5px);
  user-select: none;
}

/* Completion Card */
.completion-card {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 8px;
  display: none;
}
.completion-card.active { display: block; animation: fadeIn 0.3s ease; }
.original-sentence {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}
.translation-sentence {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
  line-height: 1.4;
}

/* ==========================================================================
   Resizable Split-Pane Container (Video & Dictation Studio)
   ========================================================================== */
.exercise-split-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  position: relative;
  gap: 0;
}

.exercise-pane {
  min-width: 0;
  box-sizing: border-box;
}

.exercise-pane-left {
  min-width: 320px;
}

.exercise-pane-right {
  min-width: 320px;
}

.split-divider {
  width: 18px;
  margin: 0 3px;
  cursor: col-resize;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: relative;
  z-index: 10;
  transition: all 0.15s ease;
}

.split-divider-line {
  width: 4px;
  height: 100%;
  min-height: 380px;
  background: var(--border-color, #e2e8f0);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, width 0.2s, box-shadow 0.2s;
}

.split-divider:hover .split-divider-line,
.split-divider.active .split-divider-line {
  background: var(--primary, #3b82f6);
  width: 6px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.45);
}

.split-divider-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 1px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.split-divider-handle span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted, #94a3b8);
}

.split-divider:hover .split-divider-handle,
.split-divider.active .split-divider-handle {
  border-color: var(--primary, #3b82f6);
}

.split-divider:hover .split-divider-handle span,
.split-divider.active .split-divider-handle span {
  background: var(--primary, #3b82f6);
}

.split-drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  cursor: col-resize;
  user-select: none;
}

/* Modern Dictation Studio Design System (Components, Drawer, Audio & Presets) */

/* Full Audio Hero Section (Tab 2) */
.full-audio-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  /* Sticky: luôn hiển thị trên cùng khi scroll danh sách transcript
     top được set động qua inline style trong TranscriptPage.jsx */
  position: sticky;
  z-index: 10;
}
.full-audio-hero-header {
  margin-bottom: 16px;
}
.hero-header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-header-title svg {
  color: var(--primary);
  flex-shrink: 0;
}
.full-audio-player-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.full-audio-play-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.full-audio-play-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}
.full-audio-time {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.full-audio-progress {
  flex: 1;
  cursor: pointer;
  accent-color: var(--primary);
  height: 6px;
}

/* Transcript List (Tab 2) */
.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Không giới hạn chiều cao – để trang cuộn tự nhiên,
     hero card sticky sẽ không bị cuộn mất */
  padding-right: 4px;
}
.transcript-item {
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s;
}
.transcript-item:hover, .transcript-item.current, .transcript-item.active-sentence {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  border-width: 2px !important;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}
.transcript-item.active-sentence .transcript-time {
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}
.transcript-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.transcript-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
}
.transcript-en {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.5;
}
.transcript-vi {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Shortcuts Table (Tab 3) */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}
.shortcuts-table th, .shortcuts-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
.shortcuts-table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Bottom Presets Section - Multi-Language Mastery */
.bottom-presets-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  margin-bottom: 30px;
}
.presets-section-header {
  margin-bottom: 16px;
}
.presets-header-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.presets-header-title svg {
  color: var(--primary);
}
.presets-header-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  letter-spacing: 0.3px;
}
.presets-header-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}
.preset-author-contact-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}
.preset-author-contact-link:hover {
  color: #38bdf8;
  filter: brightness(1.15);
}

/* Language Selection Tabs */
.presets-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px 0;
}
.preset-lang-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}
.preset-lang-tab:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: var(--bg-secondary);
  transform: translateY(-1px);
}
.preset-lang-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.preset-lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

/* Subcategory Pills (TOEIC, IELTS, General) */
.presets-subcat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px 0;
}
.preset-subcat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}
.preset-subcat-tab:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}
.preset-subcat-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.preset-subcat-tag {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-weight: 500;
}
.preset-subcat-tab.active .preset-subcat-tag {
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary);
}

/* Category Info & Level Stepper */
.presets-level-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
}
.presets-category-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.presets-category-icon {
  font-size: 1rem;
}
.presets-level-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  flex-wrap: wrap;
}
.step-tag {
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}
.step-arrow {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.step-tag.step-1 { color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.step-tag.step-2 { color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.25); }
.step-tag.step-3 { color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }
.step-tag.step-4 { color: #f97316; border: 1px solid rgba(249, 115, 22, 0.25); }
.step-tag.step-5 { color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }

/* 5 Cards Grid */
.presets-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
@media (min-width: 1400px) {
  .presets-cards-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.preset-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: var(--font-family);
  min-height: 180px;
}
.preset-card:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.preset-card.active {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.preset-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.preset-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 1.25;
}
.preset-level-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.preset-level-text {
  white-space: nowrap !important;
  font-size: 0.68rem;
}
.preset-card-duration {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.preset-card-body {
  flex: 1;
  margin-bottom: 12px;
}
.preset-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preset-card-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preset-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  margin-top: auto;
}
.preset-card-meta-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.preset-card-channel {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preset-card-lang-target {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
}
.preset-card-action-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}
.preset-card:hover .preset-card-action-btn {
  background: var(--primary);
  color: #fff;
}
.preset-card-action-btn.btn-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Question Drawer / Modal */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
}
.drawer-overlay.active { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; width: 440px; max-width: 90vw; height: 100%;
  background: var(--bg-card);
  z-index: 201;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.active { transform: translateX(0); }
.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.drawer-legend {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot-success { background: var(--success); }
.dot-current { background: var(--primary); }
.dot-default { background: var(--border-color); }

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
}
.q-btn {
  padding: 10px 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-family);
  transition: all 0.15s;
}
.q-btn:hover { border-color: var(--primary); }
.q-btn.current { border: 2px solid var(--primary); background: var(--primary-light); color: var(--primary); }
.q-btn.completed { background: var(--success-bg); border-color: var(--success); color: var(--success); }

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

/* Daily Vocab Reminder Floating Toast */
.daily-reminder-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 420px;
  width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(245, 158, 11, 0.15);
  border-radius: 14px;
  padding: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(12px);
  animation: slideUpReminder 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpReminder {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.daily-reminder-toast-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.daily-reminder-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.flame-icon-pulse {
  animation: pulseFlame 1.8s infinite ease-in-out;
}

@keyframes pulseFlame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.daily-reminder-text {
  flex: 1;
  min-width: 0;
}

.daily-reminder-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.daily-reminder-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  padding: 2px 6px;
  border-radius: 4px;
}

.daily-reminder-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.daily-reminder-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.btn-reminder-practice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-reminder-practice:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
}

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

.btn-reminder-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Settings Modal & Voice Input Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.settings-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 520px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal-overlay.active .settings-modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 22px;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
}
.settings-table tr {
  border-bottom: 1px solid var(--border-color);
}
.settings-table tr:last-child {
  border-bottom: none;
}
.settings-table td {
  padding: 12px 6px;
  vertical-align: middle;
}
.settings-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.settings-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.settings-select:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   Guide & Shortcuts Modal Styles (Modern, Tabbed Navigation)
   ========================================================================== */
.guide-modal {
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.guide-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.guide-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.guide-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.guide-tab-btn:hover {
  color: var(--primary);
}

.guide-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* Guide Tab 1: Vocab Steps */
.guide-hero-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.guide-hero-title {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-hero-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.guide-step-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.guide-step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.guide-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-step-text h4 {
  margin: 0 0 4px 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guide-step-text p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.guide-demo-card {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  font-size: 0.86rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Guide Tab 2: Categorized Shortcuts */
.shortcuts-category-group {
  margin-bottom: 20px;
}

.shortcuts-category-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.shortcut-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.shortcut-row-action {
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Guide Tab 3: Pro Tips */
.tips-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tip-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.tip-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tip-card-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* ShotLang Comprehensive Responsive Design System (Mobile, Tablet, Desktop) */
/* Excludes Admin Portal (.admin-*) */

/* 🖥️ Large Desktop / Widescreen (min-width: 1400px) */
@media (min-width: 1400px) {
  .main-container {
    max-width: 1560px;
    padding: 0 24px;
  }
  .player-card {
    position: sticky;
    top: 68px;
    align-self: start;
    z-index: 10;
  }
  .presets-cards-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 💻 Medium Desktop & Laptops (1025px - 1399px) */
@media (min-width: 1025px) and (max-width: 1399px) {
  .main-container {
    max-width: 1280px;
    padding: 0 20px;
  }
  .player-card {
    position: sticky;
    top: 68px;
    align-self: start;
    z-index: 10;
  }
  .presets-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 12px;
  }
}

/* 📱 Tablet & Medium Screens (769px - 1024px) */
@media (max-width: 1024px) {
  .main-container {
    padding: 0 16px;
    margin: 12px auto;
  }

  /* Exercise Split View: Stack vertically on tablet */
  .exercise-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .exercise-split-container {
    flex-direction: column !important;
    gap: 16px !important;
  }
  .exercise-pane-left,
  .exercise-pane-right {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .split-divider {
    display: none !important;
  }
  .player-card {
    position: static !important;
  }

  /* Bottom Presets on Tablet */
  .presets-level-overview {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 14px;
  }
  .presets-level-stepper {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 4px;
  }
  .presets-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
  }
}

/* 📱 Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  /* Header */
  .app-header {
    position: sticky;
    top: 0;
    padding: 8px 12px;
    z-index: 100;
  }
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .brand {
    order: 1;
    font-size: 1.1rem;
    flex-shrink: 0;
  }
  .brand img {
    width: 26px !important;
    height: 26px !important;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .header-actions .btn {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
  }

  /* URL & Language Form */
  .url-input-form {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .url-input-container {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }
  .url-input {
    width: 100% !important;
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding: 8px 12px 8px 34px !important;
    border-radius: 8px;
  }
  .lang-selector-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 8px;
  }
  .lang-select-wrapper {
    flex: 1;
    min-width: 0;
  }
  .header-lang-select {
    width: 100%;
    max-width: none;
    font-size: 0.8rem;
    padding: 4px 6px;
  }
  .url-input-form .btn {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Main Container & Tab Navigation */
  .main-container {
    padding: 0 10px;
    margin: 6px auto;
  }
  .tabs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .tabs-nav-group {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 4px;
  }
  .tabs-nav-group::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    font-size: 0.78rem;
    padding: 6px 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Challenge Header & Nav Buttons */
  .challenge-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .challenge-nav-buttons {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
  }
  .challenge-nav-buttons .btn {
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  /* Dictation Textarea (16px font-size prevents iOS Safari zoom) */
  .dictation-input {
    font-size: 16px !important;
    min-height: 82px;
    padding: 10px 42px 10px 12px;
  }
  .mic-btn {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }

  /* Action Buttons Toolbar */
  .dictation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .dictation-actions .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.8rem;
    min-height: 40px;
  }

  /* Full Audio Player Bar (Tab 2) */
  .full-audio-player-bar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .full-audio-progress {
    width: 100%;
    flex: 100%;
    order: 3;
    margin-top: 4px;
  }

  /* Vocabulary Notebook (Tab 3) */
  .vocab-header-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .vocab-filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .vocab-filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .vocab-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Question Drawer / Modal */
  .drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  .question-grid {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 5px;
  }
  .q-btn {
    padding: 8px 2px;
    font-size: 0.78rem;
  }

  /* Bottom Presets Section Responsive */
  .bottom-presets-section {
    margin-top: 32px;
    padding-top: 18px;
  }
  .presets-header-title {
    font-size: 1.05rem;
    gap: 8px;
  }
  .presets-lang-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 6px;
    margin: 10px 0 8px 0;
  }
  .presets-lang-tabs::-webkit-scrollbar {
    display: none;
  }
  .preset-lang-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .presets-subcat-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 4px;
    margin: 2px 0 10px 0;
  }
  .presets-subcat-tabs::-webkit-scrollbar {
    display: none;
  }
  .preset-subcat-tab {
    padding: 5px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .presets-level-overview {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
  }
  .presets-category-info {
    font-size: 0.78rem;
  }
  .presets-level-stepper {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    padding-bottom: 4px;
  }
  .presets-level-stepper::-webkit-scrollbar {
    display: none;
  }
  .step-tag {
    font-size: 0.68rem;
    padding: 2px 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .step-arrow {
    font-size: 0.65rem;
    flex-shrink: 0;
  }

  .presets-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
  }
}

/* 📱 Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  .header-actions {
    gap: 4px;
  }
  .header-actions .btn {
    padding: 5px 6px !important;
  }
  /* Hide text label on compact header action buttons, retain icon & badges */
  .btn-feedback > span:not([class*="badge"]),
  .header-actions .btn-secondary > span:not([class*="badge"]) {
    display: none;
  }
  .dictation-actions .btn {
    flex: 1 1 100%;
  }
  .controls-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .speed-group {
    margin-left: 0 !important;
    margin-top: 4px;
    width: 100%;
    justify-content: center;
  }
  .speed-btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 0.75rem;
  }

  /* 1 Column for Cards on narrow phones */
  .presets-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .preset-card {
    min-height: 160px;
    padding: 12px 14px;
  }
  .preset-card-title {
    font-size: 0.88rem;
  }
  .preset-card-summary {
    font-size: 0.75rem;
  }

  /* Modals on small phones */
  .modal-card,
  .feedback-modal-card,
  .feedback-modal-content,
  .preview-card-modal,
  .preview-card-content,
  .preview-modal-dialog,
  .settings-modal,
  .guide-modal {
    width: 100% !important;
    max-width: 95vw !important;
    max-height: 94vh !important;
    margin: 8px auto !important;
  }
  .feedback-modal-card {
    padding: 0 !important;
  }
  .feedback-modal-header {
    padding: 12px 14px !important;
  }
  .feedback-modal-body {
    padding: 12px 14px !important;
  }
  .preview-card-body {
    padding: 14px 16px !important;
  }
  .preview-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .preview-btn-start,
  .preview-btn-cancel {
    width: 100% !important;
    justify-content: center;
  }
  .preview-meta-row {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  /* Input fields: prevent iOS Safari auto-zoom */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}
/* Styling for Authentication, Streak Counter, Video Preview Card, and Smart Visual Vocabulary */

/* Header Streak & Auth */
.header-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-streak-badge .streak-fire {
  color: #f97316;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-streak-badge .streak-words {
  color: #0284c7;
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid var(--border, #e2e8f0);
  padding-left: 8px;
}

.user-profile-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 4px 10px 4px 4px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  transition: all 0.2s;
}

.user-avatar-btn:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}

.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #3b82f6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  padding: 6px 0;
  z-index: 1000;
  display: none;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text, #1e293b);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: var(--hover-bg, #f1f5f9);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border, #e2e8f0);
  margin: 4px 0;
}

/* Video Preview Card Modal */
.preview-card-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.preview-card-content {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.preview-card-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}

.preview-card-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card-body {
  padding: 1.5rem;
}

.preview-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.preview-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.preview-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preview-resume-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-actions {
  display: flex;
  gap: 12px;
}

.preview-btn-start {
  flex: 2;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  transition: all 0.2s;
}

.preview-btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.45);
}

.preview-btn-cancel {
  flex: 1;
  background: var(--hover-bg, #f1f5f9);
  color: var(--text, #334155);
  border: 1px solid var(--border, #cbd5e1);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* Floating Word Selection Tooltip */
.floating-vocab-btn {
  position: absolute;
  z-index: 1500;
  background: #1e293b;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transform: translate(-50%, -100%);
  margin-top: -8px;
  white-space: nowrap;
  animation: fadeIn 0.15s ease-out;
}

.floating-vocab-btn:hover {
  background: #0f172a;
  transform: translate(-50%, -100%) scale(1.04);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -90%); }
  to { opacity: 1; transform: translate(-50%, -100%); }
}

/* Smart Vocabulary Tab Flashcards */
.vocab-tab-wrapper {
  padding: 1.5rem 0;
}

.vocab-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 1.5rem;
}

.vocab-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vocab-filter-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card-bg, #fff);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s;
}

.vocab-filter-btn.active, .vocab-filter-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

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

.vocab-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.vocab-card:hover {
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.vocab-card-img-wrap {
  position: relative;
  width: 100%;
  height: 105px;
  background: #f1f5f9;
  overflow: hidden;
}

.vocab-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vocab-img-rotate-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

.vocab-card-body {
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vocab-word-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.vocab-word-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

.vocab-pronunciation-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 1px 0 4px 0;
  user-select: none;
}

.vocab-pron-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
}

.vocab-pron-speaker-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 3px;
  border-radius: 3px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.vocab-pron-speaker-btn:hover {
  color: #2563eb;
  background: #f1f5f9;
}

.vocab-pron-ipa-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.78rem;
  color: #334155;
  letter-spacing: 0.01em;
}

.vocab-meaning-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 5px;
  line-height: 1.35;
}

.vocab-context-box {
  background: var(--hover-bg, #f8fafc);
  border-left: 2.5px solid #3b82f6;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  margin-bottom: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 98px;
  overflow: hidden;
}

.vocab-context-orig {
  font-size: 0.72rem;
  color: var(--text, #334155);
  font-style: italic;
  line-height: 1.35;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.vocab-context-trans {
  font-size: 0.7rem;
  color: #15803d;
  font-style: normal;
  line-height: 1.35;
  font-weight: 500;
  border-top: 1px dashed var(--border, #cbd5e1);
  padding-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.vocab-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--border, #f1f5f9);
}

.vocab-status-select {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 14px;
  cursor: pointer;
  outline: none;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-width: 90px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.vocab-status-select.status-NEW {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.vocab-status-select.status-LEARNING {
  background-color: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.vocab-status-select.status-MASTERED {
  background-color: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.vocab-status-select:hover {
  filter: brightness(0.96);
}

.vocab-status-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.vocab-status-select option {
  background-color: #ffffff;
  color: #1e293b;
  font-weight: 600;
  padding: 6px 10px;
}

.vocab-audio-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}

/* Toast Notifications */
.dict-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.dict-toast {
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.2s ease-out;
  pointer-events: auto;
}

.dict-toast.toast-success {
  border-left: 4px solid #10b981;
}

.dict-toast.toast-error {
  border-left: 4px solid #ef4444;
}

.dict-toast.toast-info {
  border-left: 4px solid #3b82f6;
}

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

/* ==========================================================================
   VOCABULARY SAVING INSTRUCTIONS & TIPS
   ========================================================================== */
.vocab-guide-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

[data-theme="dark"] .vocab-guide-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(30, 41, 59, 0.7));
  border-color: rgba(99, 102, 241, 0.35);
}

.vocab-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.vocab-guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.vocab-guide-toggle-btn {
  background: transparent;
  border: 1px solid var(--border, #cbd5e1);
  color: var(--text-muted, #64748b);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.vocab-guide-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-color: #6366f1;
}

.vocab-guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.vocab-guide-step-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

[data-theme="dark"] .vocab-guide-step-card {
  background: #1e293b;
  border-color: #334155;
}

.vocab-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.vocab-step-content h4 {
  margin: 0 0 4px 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.vocab-step-content p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}

.vocab-guide-interactive-hint {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  font-size: 0.82rem;
  color: var(--text, #1e293b);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

[data-theme="dark"] .vocab-guide-interactive-hint {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

/* Completion Card & Transcript Vocab Hint */
.vocab-save-hint-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.25);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  line-height: 1.25;
  width: fit-content;
}

[data-theme="dark"] .vocab-save-hint-card {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* Saved Vocab Highlight Chip & Popover */
.saved-vocab-chip {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 2px dashed #6366f1;
  border-radius: 3px;
  padding: 0 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 600;
  display: inline-block;
}

.saved-vocab-chip:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #4338ca;
}

[data-theme="dark"] .saved-vocab-chip {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  border-bottom-color: #818cf8;
}

[data-theme="dark"] .saved-vocab-chip:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
}

.saved-vocab-popover {
  position: fixed;
  transform: translate(-50%, -100%);
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  width: 280px;
  max-width: 90vw;
  pointer-events: auto;
  animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -90%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

.popover-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--bg-card, #ffffff);
  border-right: 1px solid var(--border-color, #e2e8f0);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.popover-audio-btn {
  background: rgba(99, 102, 241, 0.12);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6366f1;
  cursor: pointer;
  transition: all 0.15s;
}

.popover-audio-btn:hover {
  background: #6366f1;
  color: #ffffff;
}

/* Pronunciation Practice on Vocab Card */
.pronounce-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-card-hover, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pronounce-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: #818cf8;
  color: #6366f1;
}

.pronounce-btn.listening {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
  animation: pulseMic 1.2s infinite ease-in-out;
}

@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pronounce-result-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  animation: fadeIn 0.2s ease;
}

.pronounce-result-badge.success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pronounce-result-badge.retry {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Export Dropdown */
.vocab-export-container {
  position: relative;
  display: inline-block;
}

.vocab-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  padding: 6px;
  min-width: 200px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vocab-export-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-primary, #1e293b);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}

.vocab-export-item:hover {
  background: var(--bg-card-hover, #f1f5f9);
  color: #4f46e5;
}

/* ==========================================================================
   Interactive Word Lookup (Image 2 style with dotted underline & rich popover)
   ========================================================================== */

.interactive-word {
  position: relative;
  cursor: pointer;
  display: inline-block;
  transition: all 0.15s ease;
  border-radius: 4px;
  padding: 0 1.5px;
}

.word-lookup-trigger {
  border-bottom: 1.5px dotted #94a3b8;
}

.word-lookup-trigger:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-bottom-color: #6366f1;
}

[data-theme="dark"] .word-lookup-trigger {
  border-bottom-color: #64748b;
}

[data-theme="dark"] .word-lookup-trigger:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-bottom-color: #818cf8;
}

.interactive-word.active-inspect {
  background: rgba(99, 102, 241, 0.18) !important;
  color: #4338ca !important;
  border-bottom: 2px solid #4f46e5 !important;
}

[data-theme="dark"] .interactive-word.active-inspect {
  background: rgba(99, 102, 241, 0.3) !important;
  color: #c7d2fe !important;
  border-bottom-color: #818cf8 !important;
}

/* Rich Lookup Popover */
.word-lookup-popover {
  position: fixed;
  z-index: 1200;
  width: 310px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  animation: lookupPopoverIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-lookup-popover.placement-top {
  transform: translateY(-100%);
  animation: lookupPopoverInTop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lookupPopoverIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes lookupPopoverInTop {
  from {
    opacity: 0;
    transform: translateY(-100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(-100%) scale(1);
  }
}

.lookup-popover-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-card, #ffffff);
  transform: translateX(-50%) rotate(45deg);
}

.word-lookup-popover.placement-bottom .lookup-popover-arrow {
  top: -6px;
  border-left: 1px solid var(--border-color, #e2e8f0);
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.word-lookup-popover.placement-top .lookup-popover-arrow {
  bottom: -6px;
  border-right: 1px solid var(--border-color, #e2e8f0);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

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

.lookup-word-title-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.lookup-word-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-pos-badge {
  font-size: 0.72rem;
  font-weight: 600;
  font-style: italic;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-card-hover, #f1f5f9);
  color: var(--text-secondary, #64748b);
  flex-shrink: 0;
}

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

.lookup-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1.5px solid #059669;
  background: transparent;
  color: #059669;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lookup-audio-btn:hover {
  background: rgba(5, 150, 105, 0.1);
  transform: translateY(-1px);
}

.lookup-audio-btn.playing {
  background: #059669;
  color: #ffffff;
}

.lookup-audio-btn .accent-label {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.lookup-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.lookup-close-btn:hover {
  background: var(--bg-card-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

.lookup-divider {
  height: 1px;
  background: var(--border-color, #e2e8f0);
  margin: 10px 0;
}

.lookup-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lookup-section-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
}

.lookup-ipa-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-primary, #1e293b);
}

.lookup-ipa-row .ipa-accent {
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  font-size: 0.78rem;
}

.lookup-ipa-row .ipa-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #6366f1;
  font-weight: 500;
}

[data-theme="dark"] .lookup-ipa-row .ipa-text {
  color: #818cf8;
}

.lookup-meaning-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  line-height: 1.35;
}

.lookup-definition-text {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
  margin-top: 2px;
  font-style: italic;
}

.lookup-skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-card-hover, #f1f5f9) 25%, var(--border-color, #e2e8f0) 50%, var(--bg-card-hover, #f1f5f9) 75%);
  background-size: 200% 100%;
  animation: lookupShimmer 1.5s infinite;
}

@keyframes lookupShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.lookup-action-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

.lookup-save-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.lookup-save-btn:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.lookup-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lookup-saved-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.saved-indicator-group {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.saved-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #059669;
}

.saved-status-tag {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.saved-status-tag:hover {
  filter: brightness(0.95);
  transform: scale(1.03);
}

.pulse-anim {
  animation: wavePulse 0.8s ease-in-out;
}

@keyframes wavePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Vocab List Pagination System */
.vocab-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 14px 18px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.vocab-pagination-info {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
}

.vocab-pagination-info strong {
  color: var(--text-primary, #0f172a);
}

.vocab-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vocab-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vocab-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #334155);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.vocab-page-btn:hover:not(:disabled) {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.08));
}

.vocab-page-btn.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.vocab-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border-color, #e2e8f0);
}

.vocab-page-btn.nav-btn {
  gap: 4px;
  padding: 0 10px;
}

.vocab-page-dots {
  padding: 0 4px;
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
}

.vocab-page-size-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vocab-page-size-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.vocab-page-size-select:focus {
  border-color: var(--primary, #2563eb);
}
/* VocabExerciseHubModal.css - Dạng 1: Từ tiếng Anh -> Nghĩa tiếng Việt
   Theo tông màu hệ thống giao diện (Theme CSS variables), không fix cứng màu đen */

.exercise-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: exFadeIn 0.2s ease-out;
}

.exercise-modal-window {
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  width: 100%;
  max-width: 840px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.18));
  overflow: hidden;
  position: relative;
  animation: exScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes exFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes exScaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.exercise-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card, #ffffff);
  gap: 16px;
}

.ex-header-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.ex-header-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.ex-header-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.ex-header-subtitle strong {
  color: var(--primary, #2563eb);
}

.ex-back-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #334155);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ex-back-menu-btn:hover {
  background: var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

.ex-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ex-progress-track {
  height: 6px;
  background: var(--bg-secondary, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
}

.ex-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #2563eb), #38bdf8, #10b981);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.ex-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ex-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--warning-bg, #fffbeb);
  border: 1px solid var(--warning, #d97706);
  color: var(--warning, #d97706);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.ex-combo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--danger-bg, #fef2f2);
  border: 1px solid var(--danger, #dc2626);
  color: var(--danger, #dc2626);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  animation: pulseCombo 1s infinite alternate;
}

@keyframes pulseCombo {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.btn-ex-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ex-close:hover {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

/* Sub-header Banner in Practice Mode */
.ex-mode-banner {
  padding: 10px 24px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ex-mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--primary-border, #bfdbfe);
}

.ex-counter-tag {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.ex-counter-tag strong {
  color: var(--text-primary, #0f172a);
}

/* Body / Arena */
.exercise-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   MENU CARD SELECTION STYLES
   ============================================================ */
.ex-menu-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.ex-menu-headline h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.ex-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .ex-cards-grid {
    grid-template-columns: 1fr;
  }
}

.ex-format-card {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
  user-select: none;
}

.ex-format-card:hover {
  border-color: var(--primary-border, #93c5fd);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 6px 14px rgba(0, 0, 0, 0.08));
}

.ex-format-card.active {
  border-color: var(--primary, #2563eb);
  background: var(--primary-light-bg, rgba(37, 99, 235, 0.03));
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

.ex-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ex-card-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ex-card-icon-wrap.d1 { background: rgba(37, 99, 235, 0.1); color: var(--primary, #2563eb); }
.ex-card-icon-wrap.d2 { background: rgba(168, 85, 247, 0.1); color: #9333ea; }
.ex-card-icon-wrap.d3 { background: rgba(16, 185, 129, 0.1); color: #059669; }
.ex-card-icon-wrap.d4 { background: rgba(245, 158, 11, 0.1); color: #d97706; }

.ex-format-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: var(--bg-secondary, #f1f5f9);
  padding: 2px 7px;
  border-radius: 6px;
}

.ex-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--primary, #2563eb);
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.ex-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ex-card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1.3;
}

.ex-card-desc {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ex-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

.ex-card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Interactive Preview Box inside card */
.ex-preview-box {
  background: var(--bg-secondary, #f8fafc);
  border: 1px dashed var(--border-color, #cbd5e1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ex-preview-word-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ex-preview-word {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.ex-preview-ipa {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  padding: 2px 8px;
  border-radius: 6px;
}

.ex-preview-eye-demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 4px 10px;
  border-radius: 6px;
  align-self: flex-start;
}

.ex-preview-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ex-preview-opt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #334155);
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 6px 10px;
}

.ex-preview-opt.correct {
  border-color: var(--success, #059669);
  color: var(--success, #059669);
  background: var(--success-bg, #ecfdf5);
}

/* Quantity selector */
.ex-quantity-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.ex-quantity-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.ex-quantity-subtext {
  font-size: 0.82rem;
  color: var(--primary, #2563eb);
}

.ex-quantity-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ex-quantity-btn {
  background: var(--bg-secondary, #f1f5f9);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary, #334155);
  cursor: pointer;
  transition: all 0.15s;
}

.ex-quantity-btn:hover {
  border-color: var(--primary-border, #bfdbfe);
  background: var(--primary-light, rgba(37, 99, 235, 0.08));
}

.ex-quantity-btn.selected {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.ex-quantity-helper {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.ex-start-btn {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--primary, #2563eb), #0284c7);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.ex-start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.ex-start-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   PRACTICE ARENA STYLES
   ============================================================ */
.ex-question-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin: auto;
  width: 100%;
  max-width: 680px;
}

/* Target Word & Audio */
.ex-target-word {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  line-height: 1.2;
}

.ex-audio-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #2563eb), #6366f1);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.ex-audio-circle-btn:hover {
  transform: scale(1.08);
}

.ex-audio-circle-btn.playing {
  animation: audioPulse 0.8s infinite alternate;
}

@keyframes audioPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.12); filter: brightness(1.2); }
}

/* IPA Phonetic */
.ex-target-ipa {
  font-family: var(--font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  padding: 3px 12px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  display: inline-block;
}

/* EYE HINT BUTTON & CONTEXT CONTAINER */
.ex-context-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ex-eye-hint-btn {
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-secondary, #334155);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.ex-eye-hint-btn:hover {
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  color: var(--primary, #2563eb);
  border-color: var(--primary-border, #bfdbfe);
}

.ex-eye-hint-btn.active {
  background: var(--primary-light, rgba(37, 99, 235, 0.15));
  color: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
}

.ex-context-quote {
  font-size: 0.95rem;
  color: var(--text-secondary, #334155);
  background: var(--bg-secondary, #f8fafc);
  padding: 12px 18px;
  border-radius: 12px;
  border-left: 3px solid var(--primary, #2563eb);
  width: 100%;
  box-sizing: border-box;
  line-height: 1.55;
  text-align: left;
  font-style: italic;
  animation: exFadeIn 0.2s ease-out;
}

/* 4 Options Grid (MCQ 2x2) */
.ex-mcq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 620px) {
  .ex-mcq-grid {
    grid-template-columns: 1fr;
  }
}

.ex-mcq-btn {
  background: var(--bg-secondary, #f8fafc);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  outline: none;
}

.ex-mcq-btn:hover:not(:disabled) {
  background: var(--primary-light, rgba(37, 99, 235, 0.08));
  border-color: var(--primary, #2563eb);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ex-mcq-btn.correct {
  background: var(--success-bg, #ecfdf5) !important;
  border-color: var(--success, #059669) !important;
  color: var(--success, #059669) !important;
  box-shadow: 0 0 12px rgba(5, 150, 105, 0.2) !important;
}

.ex-mcq-btn.wrong {
  background: var(--danger-bg, #fef2f2) !important;
  border-color: var(--danger, #dc2626) !important;
  color: var(--danger, #dc2626) !important;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.2) !important;
}

.ex-mcq-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ex-mcq-text {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

.ex-mcq-feedback-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}

/* Keyboard hint */
.ex-keyboard-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 4px;
}

.ex-keyboard-hint strong {
  color: var(--text-primary, #0f172a);
}

/* ============================================================
   SUMMARY SCREEN STYLES
   ============================================================ */
.ex-summary-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 24px 20px;
  margin: auto;
  max-width: 660px;
  width: 100%;
}

.ex-trophy-badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.35);
}

.ex-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.ex-stat-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ex-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary, #2563eb);
}

.ex-stat-title {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* History List */
.ex-history-list {
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.ex-history-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}

.ex-history-items-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.ex-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.88rem;
}

.ex-history-row.correct {
  border-left: 3px solid var(--success, #059669);
}

.ex-history-row.wrong {
  border-left: 3px solid var(--danger, #dc2626);
}

.ex-status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.ex-status-pill.correct {
  background: var(--success-bg, #ecfdf5);
  color: var(--success, #059669);
}

.ex-status-pill.wrong {
  background: var(--danger-bg, #fef2f2);
  color: var(--danger, #dc2626);
}

.ex-history-ipa {
  font-family: var(--font-mono, monospace);
  color: var(--primary, #2563eb);
  font-size: 0.82rem;
}

.ex-audio-mini-btn {
  background: transparent;
  border: none;
  color: var(--primary, #2563eb);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.ex-audio-mini-btn:hover {
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
}

/* Action Buttons */
.ex-btn-primary {
  background: linear-gradient(135deg, var(--success, #059669), #10b981);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.ex-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

.ex-btn-secondary {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-secondary, #334155);
  border: 1px solid var(--border-color, #cbd5e1);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ex-btn-secondary:hover {
  background: var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

/* Category Navigation Filter Pills */
.ex-category-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ex-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #475569);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ex-category-pill:hover {
  background: var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

.ex-category-pill.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Dạng 2 Target Meaning & Revealed word styling */
.ex-target-meaning-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ex-target-meaning-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
}

.ex-target-meaning-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary, #2563eb);
  text-align: center;
  line-height: 1.35;
}

.ex-target-thumb-wrap {
  width: 100px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}

.ex-target-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ex-target-revealed-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary, #f8fafc);
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  margin-top: 6px;
  animation: exFadeIn 0.2s ease-out;
}

.ex-revealed-word {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary, #0f172a);
}

.ex-revealed-ipa {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--primary, #2563eb);
}

.ex-lang-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  background: var(--bg-card, #ffffff);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.ex-lang-mini-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: var(--bg-card, #ffffff);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.ex-preview-meaning-target {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary, #2563eb);
}

/* ============================================================
   DẠNG 3: ĐIỀN TỪ VÀO CÂU NGỮ CẢNH (CONTEXT CLOZE)
   ============================================================ */
.ex-target-cloze-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ex-cloze-prompt-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.08));
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--primary-border, rgba(37, 99, 235, 0.25));
}

.ex-cloze-sentence-display {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary, #0f172a);
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
}

.ex-cloze-blank-box {
  display: inline-block;
  padding: 2px 10px;
  margin: 0 4px;
  border-radius: 6px;
  background: var(--bg-card, #ffffff);
  border: 2px dashed var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  font-weight: 800;
  letter-spacing: 1px;
}

.ex-cloze-blank-filled {
  display: inline-block;
  padding: 2px 10px;
  margin: 0 4px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  color: #059669;
  font-weight: 800;
  animation: exScaleUp 0.2s ease-out;
}

.ex-cloze-hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ex-cloze-meaning-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary, #334155);
  background: var(--bg-card, #ffffff);
  padding: 5px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.ex-cloze-meaning-badge strong {
  color: #10b981;
}

.ex-cloze-hint-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ex-cloze-ipa-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.08));
  padding: 5px 12px;
  border-radius: 10px;
  border: 1px solid var(--primary-border, rgba(37, 99, 235, 0.25));
}

.ex-cloze-translation-box {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary, #475569);
  font-style: italic;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10b981;
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 650px;
  animation: exFadeIn 0.25s ease-out;
}

.ex-cloze-trans-label {
  font-weight: 700;
  color: #059669;
  font-style: normal;
  margin-right: 4px;
}

/* Preview Card Dạng 3 */
.ex-preview-cloze-demo {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-primary, #0f172a);
  line-height: 1.45;
}

.ex-cloze-target-blank {
  font-weight: 800;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.12));
  padding: 1px 6px;
  border-radius: 4px;
  font-style: normal;
}

.ex-preview-meaning-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  margin: 6px 0;
}

/* ============================================================
   DẠNG 4: LISTENING RECALL STYLES
   ============================================================ */
.ex-target-audio-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  width: 100%;
}

.ex-audio-prompt-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-align: center;
}

.ex-audio-center-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.ex-audio-large-btn {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary, #2563eb), #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ex-audio-large-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.ex-audio-large-btn:active {
  transform: scale(0.96);
}

.ex-audio-large-btn.playing {
  animation: pulseAudioLarge 0.8s infinite alternate;
}

@keyframes pulseAudioLarge {
  from {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  to {
    transform: scale(1.08);
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
  }
}

.ex-audio-click-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.ex-revealed-meaning {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary, #334155);
}


/* Modern AI Vocabulary Import Modal Styles */
.ai-import-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: aiModalFadeIn 0.25s ease-out;
}

.ai-import-modal-container {
  background: var(--card-bg, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: aiModalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aiModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes aiModalScaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ai-import-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
}

.ai-import-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-import-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.ai-import-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-badge-vip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-import-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

.ai-import-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-import-close-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text, #0f172a);
}

.ai-import-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Controls Bar (Tabs + 6 Languages Selector) */
.ai-import-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding-bottom: 12px;
}

.ai-import-tabs {
  display: flex;
  gap: 8px;
}

.ai-lang-selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-lang-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ai-lang-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-lang-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-lang-pill-btn:hover {
  color: var(--text, #0f172a);
  border-color: #6366f1;
}

.ai-lang-pill-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.ai-lang-flag {
  font-size: 0.95rem;
  line-height: 1;
}

/* Level Selector Bar */
.ai-level-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 12px;
}

.ai-level-label-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4f46e5;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.ai-level-title {
  color: #4f46e5;
  font-weight: 700;
}

.ai-level-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-level-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #cbd5e1);
  background: var(--card-bg, #ffffff);
  color: var(--text, #334155);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-level-pill-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.06);
}

.ai-level-pill-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ai-level-name {
  font-weight: 600;
}

.ai-level-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-weight: 700;
}

.ai-level-pill-btn.active .ai-level-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.ai-large-file-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
  line-height: 1.4;
}

.ai-normal-file-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.ai-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-tab-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text, #0f172a);
}

.ai-tab-btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

/* Paste Text Area */
.ai-paste-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--input-bg, #f8fafc);
  color: var(--text, #0f172a);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ai-textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ai-quick-samples-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-sample-btn {
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed #6366f1;
  color: #6366f1;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.ai-sample-btn:hover {
  background: #6366f1;
  color: white;
}

/* File Upload Zone */
.ai-dropzone {
  border: 2px dashed var(--border, #cbd5e1);
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--input-bg, #f8fafc);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ai-dropzone:hover, .ai-dropzone.dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.04);
}

.ai-dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Results Table */
.ai-results-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.ai-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-results-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: #6366f1;
}

.ai-table-container {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
}

.ai-vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.ai-vocab-table th {
  background: var(--table-header, #f8fafc);
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--text-muted, #475569);
}

.ai-vocab-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border, #f1f5f9);
  vertical-align: middle;
}

.ai-vocab-table tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

.ai-inline-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.85rem;
  color: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}

.ai-inline-input:hover {
  border-color: var(--border, #cbd5e1);
  background: var(--input-bg, #fff);
}

.ai-inline-input:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* Footer */
.ai-import-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--footer-bg, #f8fafc);
  flex-wrap: wrap;
  gap: 12px;
}

.ai-btn-analyze {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s;
}

.ai-btn-analyze:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.ai-btn-analyze:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
}

.ai-btn-save:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.ai-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Lock Screen */
.ai-restricted-box {
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.ai-restricted-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Selective Page Range Card */
.ai-page-range-card {
  margin-top: 14px;
  background: var(--input-bg, #f8fafc);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: aiModalFadeIn 0.2s ease-out;
}

.ai-page-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-page-range-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text, #0f172a);
}

.ai-page-range-badge {
  font-size: 0.78rem;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.ai-page-range-inputs {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ai-page-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-page-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

/* Stepper Box with [-] [input] [+] */
.ai-page-stepper-box {
  display: inline-flex;
  align-items: center;
  background: var(--card-bg, #ffffff);
  border: 1.5px solid var(--border, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ai-page-stepper-box:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ai-stepper-btn {
  background: var(--input-bg, #f8fafc);
  border: none;
  width: 32px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text, #334155);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ai-stepper-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
}

.ai-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ai-page-number-input {
  width: 52px;
  padding: 6px 4px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  background: transparent;
  text-align: center;
  outline: none;
}

.ai-page-arrow {
  color: var(--text-muted, #94a3b8);
  font-weight: 800;
  font-size: 0.9rem;
}

/* Presets pills bar */
.ai-page-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-preset-chip {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #4f46e5;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ai-preset-chip:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: #6366f1;
}

.ai-preset-chip.active {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.ai-page-range-notice {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10b981;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
}

/* File Slice Trigger Card */
.ai-file-slice-trigger-card {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(168, 85, 247, 0.06) 100%);
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: aiModalFadeIn 0.25s ease-out;
}

.ai-file-slice-info {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-file-slice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #4338ca;
}

.ai-file-slice-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.ai-btn-slice-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-btn-slice-trigger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(79, 70, 229, 0.45);
}

.ai-btn-slice-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sliced / Cut File Presentation Card */
.ai-sliced-file-card {
  margin-top: 14px;
  background: var(--card-bg, #ffffff);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: aiModalFadeIn 0.25s ease-out;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
}

.ai-sliced-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ai-sliced-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.ai-sliced-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-btn-file-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.ai-btn-file-action.preview {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.25);
}

.ai-btn-file-action.preview:hover {
  background: #4f46e5;
  color: #ffffff;
}

.ai-btn-file-action.download {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.ai-btn-file-action.download:hover {
  background: #059669;
  color: #ffffff;
}

.ai-btn-file-action.reslice {
  background: var(--input-bg, #f1f5f9);
  color: var(--text-muted, #64748b);
  border-color: var(--border, #cbd5e1);
}

.ai-btn-file-action.reslice:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.ai-sliced-meta-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--input-bg, #f8fafc);
  border-radius: 12px;
  padding: 12px 16px;
}

.ai-sliced-file-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-sliced-file-details {
  flex: 1;
  min-width: 200px;
}

.ai-sliced-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  word-break: break-all;
}

.ai-sliced-meta-stats {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Embedded preview viewer */
.ai-sliced-preview-embed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.ai-sliced-preview-header {
  padding: 8px 14px;
  background: var(--table-header, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #334155);
}

.ai-sliced-iframe-viewer {
  width: 100%;
  height: 320px;
  border: none;
  background: #525659;
}

.ai-sliced-ready-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #065f46;
  line-height: 1.45;
}

.ai-image-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--input-bg, #f8fafc);
  border-radius: 12px;
}

.ai-image-preview {
  max-height: 260px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   DUPLICATE CONFLICT RESOLUTION MODAL
   ========================================================= */
.ai-conflict-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: aiModalFadeIn 0.2s ease-out;
}

.ai-conflict-modal-container {
  background: var(--bg-card, var(--card-bg, #ffffff));
  color: var(--text-primary, var(--text, #0f172a));
  border: 1px solid var(--border-color, var(--border, #e2e8f0));
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: aiModalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-conflict-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color, var(--border, #e2e8f0));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--bg-secondary, #f8fafc);
  gap: 12px;
}

.ai-conflict-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-conflict-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.ai-conflict-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.ai-conflict-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.ai-conflict-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card, #ffffff);
}

.ai-conflict-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-conflict-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color, var(--border, #e2e8f0));
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-conflict-card:hover {
  border-color: var(--primary, #3b82f6);
  background: var(--bg-secondary, #f8fafc);
}

.ai-conflict-card.selected {
  border-color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 1px var(--primary, #3b82f6);
}

.ai-conflict-radio {
  padding-top: 2px;
  flex-shrink: 0;
}

.ai-radio-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color, #cbd5e1);
  background: transparent;
  position: relative;
  transition: all 0.2s ease;
}

.ai-conflict-card.selected .ai-radio-dot {
  border-color: var(--primary, #3b82f6);
  background: var(--primary, #3b82f6);
}

.ai-conflict-card.selected .ai-radio-dot::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.ai-conflict-card-info {
  flex: 1;
}

.ai-conflict-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ai-conflict-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary, #0f172a);
}

.ai-strategy-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.ai-strategy-badge.badge-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-strategy-badge.badge-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.ai-strategy-badge.badge-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.ai-conflict-card-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.ai-conflict-preview-box {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
}

.ai-conflict-preview-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #334155);
  margin-bottom: 8px;
}

.ai-conflict-table-wrapper {
  max-height: 160px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
}

.ai-conflict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.ai-conflict-table th {
  padding: 8px 10px;
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-muted, #64748b);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.ai-conflict-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

.ai-dup-ipa {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  font-weight: normal;
  margin-left: 4px;
}

.ai-dup-old {
  color: var(--text-muted, #64748b);
}

.ai-dup-new {
  color: var(--primary, #3b82f6);
  font-weight: 500;
}

.ai-conflict-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-color, var(--border, #e2e8f0));
  background: var(--bg-secondary, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

[data-theme="dark"] .ai-conflict-modal-overlay {
  background-color: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .ai-conflict-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .ai-conflict-card:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--primary);
}

[data-theme="dark"] .ai-conflict-card.selected {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--primary);
}

[data-theme="dark"] .ai-conflict-table th {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-secondary);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .ai-conflict-table td {
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}



/* ThemeVocabExplorerModal.css - Khám phá từ vựng theo chủ đề */

.theme-vocab-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: themeFadeIn 0.2s ease-out;
}

.theme-vocab-modal-window {
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  width: 100%;
  max-width: 1080px;
  height: 90vh;
  max-height: 880px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.18));
  overflow: hidden;
  position: relative;
  animation: themeScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes themeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes themeScaleUp {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.theme-vocab-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card, #ffffff);
}

.theme-vocab-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-vocab-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.theme-vocab-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.theme-vocab-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.theme-vocab-close-btn:hover {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

/* Filter Toolbar */
.theme-vocab-filter-bar {
  padding: 12px 24px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-filter-pill-group {
  display: flex;
  gap: 4px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 3px;
}

.theme-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-lang-btn.active {
  background: var(--primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.theme-select-wrap {
  position: relative;
  min-width: 260px;
  flex: 1;
}

.theme-dropdown-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-primary, #0f172a);
  padding: 7px 30px 7px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #64748b);
  pointer-events: none;
}

.theme-type-pills {
  display: flex;
  gap: 4px;
}

.theme-type-btn {
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #475569);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-type-btn.active {
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.theme-search-box {
  position: relative;
  min-width: 200px;
}

.theme-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94a3b8);
}

.theme-search-input {
  width: 100%;
  padding: 7px 12px 7px 30px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  font-size: 0.82rem;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
}

/* Action Controls Bar */
.theme-vocab-actions-bar {
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card, #ffffff);
  gap: 12px;
  flex-wrap: wrap;
}

.theme-select-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-secondary, #334155);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-select-all-btn:hover:not(:disabled) {
  background: var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

.theme-stats-label {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.theme-limit-pills {
  display: flex;
  gap: 4px;
}

.theme-limit-btn {
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-secondary, #475569);
  border-radius: 6px;
  cursor: pointer;
}

.theme-limit-btn.active {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: var(--primary, #2563eb);
}

.theme-import-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary, #2563eb), #1d4ed8);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: all 0.15s;
}

.theme-import-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.theme-import-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Modal Body */
.theme-vocab-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  background: var(--bg-secondary, #f8fafc);
}

.theme-vocab-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.theme-word-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.theme-word-card:hover {
  border-color: var(--primary-border, #93c5fd);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm, 0 4px 10px rgba(0, 0, 0, 0.05));
}

.theme-word-card.selected {
  border-color: var(--primary, #2563eb);
  background: var(--primary-light-bg, rgba(37, 99, 235, 0.03));
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.18);
}

.theme-word-card.already-saved {
  opacity: 0.65;
  background: var(--bg-secondary, #f8fafc);
  cursor: default;
}

.theme-word-card.already-saved:hover {
  transform: none;
  border-color: var(--border-color, #e2e8f0);
}

.theme-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #2563eb);
  cursor: pointer;
}

.theme-word-text {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.theme-badge-saved {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--success, #059669);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
}

.theme-badge-level {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: var(--primary-light, rgba(37, 99, 235, 0.1));
  padding: 2px 6px;
  border-radius: 6px;
}

.theme-audio-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
}

.theme-audio-btn:hover {
  color: var(--primary, #2563eb);
}

.theme-word-ipa {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.theme-word-meaning {
  font-size: 0.88rem;
  font-weight: 700;
  color: #059669;
}

.theme-word-context {
  font-size: 0.76rem;
  font-style: italic;
  color: var(--text-secondary, #475569);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-vocab-loading-state,
.theme-vocab-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted, #64748b);
}

.theme-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color, #e2e8f0);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* ShotLang Professional Modern Footer Styling */

.shotlang-footer {
  margin-top: 48px;
  background: var(--card-bg, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding: 24px 20px 20px;
  color: var(--text-color, #1e293b);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  font-size: 0.875rem;
}

.shotlang-footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Author Invitation Banner */
.footer-invite-banner {
  max-width: 1200px;
  margin: 0 auto 16px auto;
  padding: 10px 18px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.84rem;
  color: var(--text-muted, #475569);
  text-align: center;
}

.footer-invite-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.footer-invite-contact-link:hover {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  transform: translateY(-1px);
}

/* Left: Brand */
.shotlang-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.footer-brand-logo {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.35);
}

.footer-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-color, #0f172a);
}

.footer-brand-name strong {
  color: var(--primary, #2563eb);
}

.shotlang-footer-desc {
  font-size: 0.775rem;
  color: var(--text-muted, #64748b);
  margin: 0;
  max-width: 320px;
  line-height: 1.35;
}

/* Center: Developer & Contact */
.shotlang-footer-center {
  display: flex;
  justify-content: center;
}

.footer-author-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary, rgba(241, 245, 249, 0.6));
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 9999px;
  padding: 6px 14px;
}

.author-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  color: var(--text-muted, #64748b);
}

.footer-icon-dev {
  color: var(--primary, #2563eb);
}

.author-title {
  font-weight: 500;
}

.author-badge-name {
  font-weight: 700;
  color: var(--text-color, #0f172a);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  padding: 1px 7px;
  border-radius: 4px;
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: all 0.15s ease;
}

.footer-contact-link:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: scale(1.03);
}

/* Right: Actions & Copyright */
.shotlang-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.footer-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-muted, #64748b);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.footer-action-btn:hover {
  color: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
}

.footer-copyright-text {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

/* Responsive */
@media (max-width: 768px) {
  .shotlang-footer-container {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .shotlang-footer-brand {
    align-items: center;
  }

  .shotlang-footer-right {
    align-items: center;
  }
}

/* ==========================================================================
   Audio & Phonology Studio Styles (Isolated Scope)
   ========================================================================== */

.audio-studio-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Studio Hero Header */
.audio-studio-hero {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.audio-studio-hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.audio-studio-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main, #0f172a);
  margin-bottom: 6px;
}

.dark .audio-studio-hero-title {
  color: #f8fafc;
}

.audio-studio-hero-subtitle {
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
  max-width: 700px;
  line-height: 1.5;
}

/* Upload Dropzone Card */
.audio-upload-card {
  background: var(--bg-card, #ffffff);
  border: 2px dashed var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.audio-upload-card:hover,
.audio-upload-card.drag-over {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.03);
  transform: translateY(-2px);
}

.dark .audio-upload-card {
  background: #1e293b;
  border-color: #334155;
}

.dark .audio-upload-card:hover,
.dark .audio-upload-card.drag-over {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}

.upload-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: transform 0.2s ease;
}

.audio-upload-card:hover .upload-icon-wrapper {
  transform: scale(1.08);
}

.dark .upload-icon-wrapper {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.upload-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main, #0f172a);
}

.dark .upload-title {
  color: #f1f5f9;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 16px;
}

.supported-formats-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.format-chip {
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-primary, #f8fafc);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border, #e2e8f0);
}

.dark .format-chip {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

/* Sample Audio Pills Bar */
.sample-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
}

.dark .sample-bar {
  background: #1e293b;
  border-color: #334155;
}

.sample-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 8px;
  background: var(--bg-primary, #f1f5f9);
  color: var(--text-main, #1e293b);
  border: 1px solid var(--border, #cbd5e1);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dark .sample-btn {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.sample-btn:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Player & Control Bar */
.audio-player-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.dark .audio-player-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.audio-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.audio-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main, #0f172a);
}

.dark .audio-file-badge {
  color: #f8fafc;
}

.audio-progress-container {
  width: 100%;
  margin-bottom: 16px;
}

.audio-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-primary, #e2e8f0);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.dark .audio-progress-bar {
  background: #334155;
}

.audio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.audio-progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  margin-top: 6px;
}

.player-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.player-main-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.player-main-btn:hover {
  background: #0369a1;
  transform: scale(1.05);
}

.loop-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Two-Column Studio Split */
.studio-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .studio-split-layout {
    grid-template-columns: 1fr;
  }
}

/* Phonology Card */
.phonology-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
}

.dark .phonology-card {
  background: #1e293b;
  border-color: #334155;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #f1f5f9);
}

.dark .card-header-bar {
  border-color: #334155;
}

.card-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main, #0f172a);
}

.dark .card-header-title {
  color: #f1f5f9;
}

/* Visual Connected Sentence */
.connected-sentence-display {
  background: var(--bg-primary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 20px;
  font-size: 1.3rem;
  line-height: 1.8;
  margin-bottom: 16px;
  color: var(--text-main, #0f172a);
  font-family: inherit;
}

.dark .connected-sentence-display {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

/* Ligatures & Linking Markers */
.phonology-symbol-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.symbol-cv {
  color: #0284c7;
  font-size: 1.4rem;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.symbol-glide-w {
  color: #0ea5e9;
  font-size: 0.95rem;
  vertical-align: super;
  background: rgba(14, 165, 233, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.symbol-glide-j {
  color: #8b5cf6;
  font-size: 0.95rem;
  vertical-align: super;
  background: rgba(139, 92, 246, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.symbol-elision {
  color: #f59e0b;
  font-size: 1.1rem;
  text-decoration: line-through;
  font-weight: 800;
}

.symbol-assimilation {
  color: #ef4444;
  font-size: 1.1rem;
}

.word-interactive-link {
  cursor: pointer;
  border-bottom: 2px dashed rgba(56, 189, 248, 0.4);
  transition: all 0.2s ease;
}

.word-interactive-link:hover {
  border-bottom-color: #0284c7;
  color: #0284c7;
}

/* Phenomena Breakdown List */
.phenomena-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.phenomenon-item {
  background: var(--bg-primary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.dark .phenomenon-item {
  background: #0f172a;
  border-color: #334155;
}

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

.phenomenon-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-cv {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.badge-glide {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.badge-elision {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.badge-assimilation {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.badge-weak {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.phenomenon-explanation {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

/* Connected IPA Box */
.connected-ipa-box {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: monospace;
  font-size: 0.95rem;
  color: #4f46e5;
}

.dark .connected-ipa-box {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
}

/* Sentence Navigation List */
.sentence-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.sentence-item-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-primary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dark .sentence-item-btn {
  background: #0f172a;
  border-color: #334155;
}

.sentence-item-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

.sentence-item-btn.active {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  box-shadow: inset 3px 0 0 #0284c7;
}

.dark .sentence-item-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.sentence-item-text {
  font-size: 0.9rem;
  color: var(--text-main, #1e293b);
  line-height: 1.4;
  font-weight: 500;
}

.dark .sentence-item-text {
  color: #f1f5f9;
}

.sentence-item-time {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Audio Dictation Input Area */
.audio-dictation-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dark .audio-dictation-card {
  background: #1e293b;
  border-color: #334155;
}

.dictation-input-area {
  width: 100%;
  min-height: 110px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 1.05rem;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.2s ease;
  font-family: inherit;
}

.dark .dictation-input-area {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.dictation-input-area:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.dictation-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Text Analyzer Tab */
.instant-analyzer-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.analyzer-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.95rem;
}

.dark .analyzer-input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
/* Smart Reader (Đọc Báo & Ôn Từ Vựng) Stylesheet */

.smart-reader-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Keyboard shortcut badge shown on play button */
.reader-kbd {
  display: inline-flex;
  align-items: center;
  font-size: 0.63rem;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: inherit;
  line-height: 1.5;
  margin-left: 4px;
  opacity: 0.78;
  pointer-events: none;
  user-select: none;
}

.btn-primary .reader-kbd {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .reader-kbd {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Header & Controls */
.reader-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.reader-header-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #6366f1);
}

.reader-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.reader-header-titles h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.reader-badge-sparkle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.reader-header-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Stats Ribbon */
.reader-stats-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.reader-stats-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.reader-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.reader-stat-item strong {
  color: var(--text-primary);
}

.reader-matched-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(6, 182, 212, 0.18));
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  font-weight: 700;
}

[data-theme="dark"] .reader-matched-badge {
  color: #34d399;
}

/* Reader Toolbar Controls (Font, Audio, Actions) */
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.reader-toolbar-left,
.reader-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-control-btn-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
}

.reader-control-btn {
  background: transparent;
  border: none;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reader-control-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .reader-control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.reader-control-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Editor Card & Paste Box */
.reader-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reader-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.reader-editor-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-editor-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.reader-editor-box {
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  border: 2px dashed rgba(16, 185, 129, 0.45);
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  transition: all 0.2s ease;
  word-break: break-word;
}

.reader-editor-box:focus {
  border-color: #10b981;
  border-style: solid;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.reader-editor-box[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  display: block;
}

.reader-editor-box img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px auto;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.reader-editor-box p {
  margin-bottom: 1em;
}

.reader-editor-box h1,
.reader-editor-box h2,
.reader-editor-box h3 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 700;
}

.reader-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.reader-editor-actions-left,
.reader-editor-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Nav Back Row in Reader Mode */
.reader-nav-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Article Reading View */
.reader-article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 36px 48px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.25s ease;
}

@media (max-width: 768px) {
  .reader-article-card {
    padding: 24px 18px;
  }
}

/* Theme variations for article reading */
.reader-article-card.theme-sepia {
  background: #fbf0d9 !important;
  color: #2b2518 !important;
  border-color: #ebdcb9 !important;
}

.reader-article-card.theme-sepia .reader-article-body {
  color: #2c2519 !important;
}

.reader-article-card.theme-sepia .reader-article-body h1,
.reader-article-card.theme-sepia .reader-article-body h2,
.reader-article-card.theme-sepia .reader-article-body h3 {
  color: #1a160d !important;
}

.reader-article-card.theme-dark {
  background: #090d16 !important;
  color: #e2e8f0 !important;
  border-color: rgba(51, 65, 85, 0.7) !important;
}

.reader-article-card {
  --reader-font-size: 18px;
  font-size: var(--reader-font-size) !important;
}

.reader-article-card.font-serif,
.reader-article-card.font-serif .reader-article-body,
.reader-article-card.font-serif .reader-article-body * {
  font-family: "Merriweather", "Georgia", "Cambria", "Times New Roman", Times, serif !important;
}

.reader-article-card.font-sans,
.reader-article-card.font-sans .reader-article-body,
.reader-article-card.font-sans .reader-article-body * {
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.reader-article-body {
  font-size: var(--reader-font-size) !important;
  line-height: 1.85 !important;
  color: var(--text-primary);
}

.reader-article-body,
.reader-article-body p,
.reader-article-body span:not(.smart-vocab-star),
.reader-article-body div,
.reader-article-body li,
.reader-article-body a,
.reader-article-body strong,
.reader-article-body em,
.reader-article-body b,
.reader-article-body i,
.reader-article-body font,
.reader-article-body .reader-sentence {
  font-size: var(--reader-font-size) !important;
}

.reader-article-body p {
  margin-bottom: 1.25em;
  line-height: 1.8;
}

.reader-article-body h1,
.reader-article-body h2,
.reader-article-body h3,
.reader-article-body h4 {
  color: var(--text-primary);
  line-height: 1.35;
}

.reader-article-body h1 {
  font-size: calc(var(--reader-font-size) * 1.55) !important;
  margin-top: 1.4em;
  margin-bottom: 0.5em;
  font-weight: 800;
}

.reader-article-body h2 {
  font-size: calc(var(--reader-font-size) * 1.35) !important;
  margin-top: 1.3em;
  margin-bottom: 0.5em;
  font-weight: 750;
}

.reader-article-body h3 {
  font-size: calc(var(--reader-font-size) * 1.2) !important;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  font-weight: 700;
}

.reader-article-body h4 {
  font-size: calc(var(--reader-font-size) * 1.08) !important;
  margin-top: 1.1em;
  margin-bottom: 0.4em;
  font-weight: 650;
}

.reader-article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.reader-article-body figure {
  margin: 24px 0;
  text-align: center;
}

.reader-article-body figcaption,
.reader-article-body img + em,
.reader-article-body img + p {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-top: -12px;
  margin-bottom: 24px;
  display: block;
}

.reader-article-body blockquote {
  margin: 20px 0;
  padding: 12px 20px;
  border-left: 4px solid var(--primary);
  background: rgba(37, 99, 235, 0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.reader-article-body ul,
.reader-article-body ol {
  margin: 16px 0;
  padding-left: 28px;
}

.reader-article-body li {
  margin-bottom: 8px;
}

/* VOCABULARY HIGHLIGHT TOKEN */
.smart-vocab-mark {
  display: inline-block;
  cursor: pointer;
  padding: 1px 4px;
  margin: 0 1px;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 3px;
}

/* Status: NEW (Mới lưu - Blue) */
.smart-vocab-mark.status-new {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  text-decoration-color: #3b82f6;
  border-bottom: 2px solid #3b82f6;
}

[data-theme="dark"] .smart-vocab-mark.status-new {
  background: rgba(59, 130, 246, 0.24);
  color: #93c5fd;
  text-decoration-color: #60a5fa;
  border-bottom-color: #60a5fa;
}

/* Status: LEARNING (Đang học - Amber/Orange) */
.smart-vocab-mark.status-learning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  text-decoration-color: #f59e0b;
  border-bottom: 2px solid #f59e0b;
}

[data-theme="dark"] .smart-vocab-mark.status-learning {
  background: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
  text-decoration-color: #fbbf24;
  border-bottom-color: #fbbf24;
}

/* Status: MASTERED (Đã thuộc - Emerald/Green) */
.smart-vocab-mark.status-mastered {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  text-decoration-color: #10b981;
  border-bottom: 2px solid #10b981;
}

[data-theme="dark"] .smart-vocab-mark.status-mastered {
  background: rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
  text-decoration-color: #34d399;
  border-bottom-color: #34d399;
}

.smart-vocab-mark:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.smart-vocab-star {
  font-size: 0.68em;
  margin-left: 2px;
  vertical-align: super;
  opacity: 0.8;
}

/* Matched Vocab Drawer / Quick Chips */
.reader-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: thin;
}

.reader-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.reader-word-chip:hover {
  border-color: #10b981;
  color: #10b981;
  transform: translateY(-1px);
}

.reader-word-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chip-dot.status-new { background: #3b82f6; }
.chip-dot.status-learning { background: #f59e0b; }
.chip-dot.status-mastered { background: #10b981; }

/* Active TTS Sentence Highlight */
.reader-tts-active {
  background: rgba(254, 240, 138, 0.45) !important;
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(254, 240, 138, 0.45);
  transition: background 0.2s ease;
}

[data-theme="dark"] .reader-tts-active {
  background: rgba(234, 179, 8, 0.22) !important;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.22);
}

/* ======================================================== */
/* AUDIO PLAYER & TIMELINE SCRUBBER                         */
/* ======================================================== */

.reader-player-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.reader-player-main-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.reader-player-controls-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
}

.reader-player-controls-left .btn-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reader-player-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-play-btn {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  font-weight: 700;
  font-size: 0.82rem;
  justify-content: center;
  white-space: nowrap;
  gap: 6px;
}

.reader-player-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.reader-sentence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

[data-theme="dark"] .reader-sentence-badge {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Timeline Scrubber Row */
.reader-scrubber-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.reader-time-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 44px;
  text-align: center;
  user-select: none;
}

.reader-time-badge.current-time {
  color: #10b981;
}

.reader-range-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.reader-seek-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #10b981 var(--progress-percent, 0%),
    rgba(148, 163, 184, 0.3) var(--progress-percent, 0%)
  );
  outline: none;
  cursor: pointer;
  transition: height 0.15s ease;
}

.reader-seek-range:hover {
  height: 8px;
}

/* Webkit (Chrome, Edge, Safari) */
.reader-seek-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reader-seek-range:hover::-webkit-slider-thumb,
.reader-seek-range:active::-webkit-slider-thumb {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
}

/* Firefox */
.reader-seek-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reader-seek-range:hover::-moz-range-thumb,
.reader-seek-range:active::-moz-range-thumb {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
}

.reader-scrubber-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.reader-scrubber-hint strong {
  color: var(--text-primary);
}

/* Sentence Spans in Reader View */
.reader-sentence {
  display: inline;
  border-radius: 4px;
  padding: 1px 2px;
  margin: 0 1px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.reader-sentence:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

/* Karaoke / Active Speaking Sentence */
.reader-sentence.active-speaking {
  background-color: rgba(254, 240, 138, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(254, 240, 138, 0.55);
  border-radius: 4px;
  position: relative;
}

[data-theme="dark"] .reader-sentence.active-speaking {
  background-color: rgba(234, 179, 8, 0.25) !important;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
}

.theme-sepia .reader-sentence.active-speaking {
  background-color: rgba(217, 119, 6, 0.22) !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.22);
}

[data-theme="dark"] .reader-seek-range {
  background: linear-gradient(
    to right,
    #10b981 var(--progress-percent, 0%),
    rgba(255, 255, 255, 0.15) var(--progress-percent, 0%)
  );
}

[data-theme="dark"] .reader-seek-range::-webkit-slider-thumb {
  border-color: #0f172a;
}

/* ======================================================== */
/* 2-COLUMN SPLIT LAYOUT (SIDEBAR LEFT, ARTICLE RIGHT)     */
/* ======================================================== */

.smart-reader-container.reader-split-mode {
  max-width: 1420px;
  margin: 0 auto !important;
  padding: 16px 20px 48px !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  box-sizing: border-box;
}

.reader-split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
  height: auto !important;
  max-height: none !important;
  width: 100%;
  overflow: visible !important;
  box-sizing: border-box;
}

/* Left Sidebar Panel - Sticky on Desktop so it stays visible while scrolling */
.reader-sidebar-panel {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  z-index: 10;
  box-sizing: border-box;
}

.reader-sidebar-panel::-webkit-scrollbar {
  width: 5px;
}

.reader-sidebar-panel::-webkit-scrollbar-track {
  background: transparent;
}

.reader-sidebar-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.reader-sidebar-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.65);
}

.reader-sidebar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Sidebar Stats & Chips Card */
.reader-sidebar-stats-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reader-sidebar-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-sidebar-chips-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.reader-sidebar-chips-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.reader-chips-bar.sidebar-chips {
  flex-wrap: wrap;
  overflow-x: visible;
  max-height: 120px;
  overflow-y: auto;
  padding: 2px 0;
  gap: 6px;
  scrollbar-width: thin;
}

/* Sidebar Display Settings Card */
.reader-sidebar-display-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reader-sidebar-display-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.reader-display-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reader-display-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reader-display-row-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Right Column Content Panel */
.reader-content-panel {
  min-width: 0;
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-sizing: border-box;
}

/* Article Reading View */
.reader-content-panel .reader-article-card {
  min-height: calc(100vh - 140px);
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 36px 48px 60px;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.reader-content-panel .reader-article-card::-webkit-scrollbar {
  width: 7px;
}

.reader-content-panel .reader-article-card::-webkit-scrollbar-track {
  background: transparent;
}

.reader-content-panel .reader-article-card::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.reader-content-panel .reader-article-card::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.75);
}

/* Single sentence mode toggle pill button in player row */
.reader-single-sentence-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.reader-single-sentence-pill:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.reader-single-sentence-pill.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.5);
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
}

[data-theme="dark"] .reader-single-sentence-pill:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

[data-theme="dark"] .reader-single-sentence-pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Voice & Accent Customization in Reader Sidebar */
.reader-voice-control-box {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

[data-theme="dark"] .reader-voice-control-box {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
}

.reader-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1;
}

.reader-voice-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.reader-voice-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.reader-voice-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  line-height: 1;
}

.reader-voice-test-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Row 2: Accent Segmented Bar - 5 equal columns, strictly 1 row */
.reader-accent-segmented-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  box-sizing: border-box;
}

.reader-accent-seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
  line-height: 1;
  text-align: center;
}

.reader-accent-seg-btn:hover {
  color: var(--text-primary);
}

.reader-accent-seg-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.reader-accent-seg-btn.is-indian.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(249, 115, 22, 0.3);
}

/* Row 3: Voice dropdown select */
.reader-voice-dropdown-wrapper {
  position: relative;
  width: 100%;
}

.reader-voice-dropdown {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 6px 26px 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  height: 32px;
  line-height: 1.2;
}

.reader-voice-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light, rgba(37, 99, 235, 0.15));
}

.reader-dropdown-arrow-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Row 4: Tone / Pitch Persona Segmented Bar - 4 equal columns */
.reader-pitch-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reader-pitch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reader-pitch-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.reader-pitch-segmented-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  box-sizing: border-box;
}

.reader-pitch-seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
  line-height: 1;
  text-align: center;
}

.reader-pitch-seg-btn:hover {
  color: var(--text-primary);
}

.reader-pitch-seg-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.reader-pitch-seg-btn.is-indian.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(249, 115, 22, 0.3);
}

/* Responsive breakpoint: Tablets & Mobile (< 1024px) */
@media (max-width: 1024px) {
  .smart-reader-container.reader-split-mode {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .reader-split-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .reader-sidebar-panel {
    height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .reader-content-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .reader-content-panel .reader-article-card {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 24px 18px 40px;
  }
}
/* Modern AI Writing Studio Design System */

.writing-studio-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 18px 40px 18px;
}

/* Header */
.writing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.writing-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.writing-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  flex-shrink: 0;
}

.writing-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  letter-spacing: -0.02em;
}

.writing-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

.writing-auth-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.writing-auth-tag.authorized {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.writing-auth-tag.restricted {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Main Studio Layout: Draggable Split Screen */
.writing-studio-layout {
  display: flex;
  align-items: stretch;
  position: relative;
  width: 100%;
  gap: 0;
}

/* Split Divider between left (editor) & right (feedback) panels */
.writing-split-divider {
  width: 16px;
  margin: 0 3px;
  cursor: col-resize;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.writing-split-divider .split-divider-line {
  width: 4px;
  height: 100%;
  min-height: 420px;
  background: var(--border-color, #e2e8f0);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, width 0.2s, box-shadow 0.2s;
}

.writing-split-divider:hover .split-divider-line,
.writing-split-divider.active .split-divider-line {
  background: #8b5cf6;
  width: 6px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.45);
}

.writing-split-divider .split-divider-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 2px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.writing-split-divider .split-divider-handle span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted, #94a3b8);
}

.writing-split-divider:hover .split-divider-handle,
.writing-split-divider.active .split-divider-handle {
  border-color: #8b5cf6;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.writing-split-divider:hover .split-divider-handle span,
.writing-split-divider.active .split-divider-handle span {
  background: #8b5cf6;
}

@media (max-width: 992px) {
  .writing-studio-layout {
    flex-direction: column;
    gap: 14px;
  }

  .writing-split-divider {
    display: none;
  }
}

/* Left Panel: Genre Nav, Prompt & Editor */
.writing-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 300px;
}

@media (max-width: 992px) {
  .writing-editor-panel {
    width: 100% !important;
    min-width: 0;
  }
}

.genre-nav-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  overflow-x: auto;
}

.genre-btn {
  flex: 1;
  min-width: 80px;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.15s ease;
  color: var(--text-muted);
}

.genre-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.genre-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.genre-btn-label {
  font-size: 0.82rem;
  font-weight: 700;
}

.genre-btn-sub {
  font-size: 0.7rem;
  opacity: 0.85;
}

/* Sub-type selector bar for Task 1 & Task 2 */
.writing-subtype-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.subtype-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.subtype-pills-list {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.subtype-pill-btn {
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 600;
}

.subtype-pill-btn:hover {
  border-color: #8b5cf6;
  color: var(--text-primary);
}

.subtype-pill-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* Prompt Card */
.writing-prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

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

.prompt-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 5px;
}

.prompt-target-pill {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.prompt-action-group {
  display: flex;
  gap: 5px;
}

.btn-prompt-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-prompt-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-prompt-action.ai-action {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
  border-color: rgba(139, 92, 246, 0.4);
  color: #8b5cf6;
}

.btn-prompt-action.ai-action:hover {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
}

.btn-prompt-action.active {
  background: var(--primary);
  color: #fff;
}

.prompt-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
  font-weight: 500;
  font-style: italic;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  transition: all 0.2s ease;
}

.prompt-text.collapsed {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Authentic IELTS Exam Prompt Layout */
.ielts-exam-prompt-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: inherit;
}

.ielts-exam-prompt-box.collapsed {
  padding: 8px 12px;
  gap: 4px;
}

.ielts-exam-prompt-box.collapsed .exam-question-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
}

.exam-meta-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

.exam-intro-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.exam-question-text {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 500;
}

.exam-question-text.bold {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.55;
  padding: 4px 0;
}

.exam-closing-req {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 500;
  margin-top: 4px;
}

.exam-min-words {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.prompt-keywords-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.keywords-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 600;
}

.keywords-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.keyword-chip {
  font-size: 0.7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}

/* AI Topic Prompt Input */
.ai-topic-prompt-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ai-topic-prompt-input {
  width: 155px;
  height: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 22px 0 8px;
  font-size: 0.74rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.ai-topic-prompt-input:focus {
  border-color: #8b5cf6;
  width: 195px;
  background: var(--bg-card);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.btn-clear-ai-topic {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}

.btn-clear-ai-topic:hover {
  color: var(--text-primary);
}

/* Custom Prompt with Copy/Paste Text & Images */
.custom-prompt-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
}

.custom-prompt-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-prompt-textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.custom-prompt-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.custom-prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-upload-prompt-image {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-upload-prompt-image:hover {
  background: var(--primary);
  color: #fff;
}

.custom-prompt-tip {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.custom-prompt-tip strong {
  color: var(--primary);
}

.custom-prompt-images-gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

.custom-prompt-image-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  max-width: 320px;
  display: flex;
  flex-direction: column;
}

.custom-prompt-preview-img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #0f172a;
  display: block;
}

.custom-prompt-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.custom-image-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-remove-prompt-image {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.btn-remove-prompt-image:hover {
  background: #ef4444;
  color: #fff;
}

.custom-prompt-collapsed-badge {
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 600;
  background: rgba(99, 102, 241, 0.08);
  padding: 4px 8px;
  border-radius: 5px;
}

/* Workspace Editor */
.writing-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-toolbar {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

.workspace-stats {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 16px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.stat-pill .stat-val {
  font-weight: 800;
  color: var(--text-primary);
}

.timer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.timer-dot.active {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.workspace-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.target-band-select-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.band-select-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.band-select {
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
}

.btn-workspace-start {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-workspace-start:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.writing-textarea {
  width: 100%;
  min-height: 400px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.65;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.writing-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.workspace-footer {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-guide {
  font-size: 0.78rem;
}

.guide-alert {
  color: #f59e0b;
}

.guide-success {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #10b981;
  font-weight: 600;
}

.btn-submit-essay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-submit-essay:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-submit-essay:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Right Panel: Feedback & History */
.writing-feedback-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 540px;
}

@media (max-width: 992px) {
  .writing-feedback-panel {
    width: 100% !important;
    min-width: 0;
  }
}

.feedback-nav-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
}

.feedback-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.feedback-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 820px;
}

/* Initial Guide State */
.feedback-initial-guide {
  text-align: center;
  padding: 40px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.guide-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.feedback-initial-guide h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.feedback-initial-guide p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.criteria-intro-box {
  text-align: left;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ci-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
}

.ci-row strong {
  color: var(--text-primary);
}

.ci-row span {
  color: var(--text-muted);
}

/* Evaluating Loading State */
.evaluating-state {
  padding: 60px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evaluating-animation-card {
  text-align: center;
  max-width: 440px;
}

.pulse-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  animation: pulseScale 1.6s infinite ease-in-out;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.4);
}

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.evaluating-animation-card h3 {
  margin: 0 0 6px 0;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.evaluating-animation-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.evaluating-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.step-item {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.step-item.active {
  color: #10b981;
  font-weight: 600;
}

/* Result Content */
.feedback-result-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Score Hero Card */
.score-hero-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.score-circle-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.score-band-number {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.score-band-sub {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.9;
}

.score-summary-text {
  flex: 1;
}

.score-summary-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.score-summary-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

/* Criteria Grid */
.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .criteria-grid {
    grid-template-columns: 1fr;
  }
}

.criteria-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criteria-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.criteria-score {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.criteria-feedback {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-title.space-between {
  justify-content: space-between;
}

.section-title .title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Corrections */
.corrections-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.correction-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.corr-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
}

.corr-diff {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.diff-original {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 3px 8px;
  border-radius: 5px;
  text-decoration: line-through;
  font-weight: 600;
}

.diff-arrow {
  color: var(--text-muted);
}

.diff-corrected {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 700;
}

.corr-explanation {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Vocab Upgrades */
.vocab-upgrades-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.vocab-upgrade-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vu-word {
  font-size: 0.95rem;
  color: var(--primary);
  margin-right: 8px;
}

.vu-phonetic {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}

.btn-add-vocab-quick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-vocab-quick:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.btn-add-vocab-quick.added {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  cursor: default;
}

.vu-meaning {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.vu-replace {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.vu-replace del {
  color: #ef4444;
}

.vu-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  border-left: 2px solid var(--border-color);
  padding-left: 8px;
}

/* Model Essay */
.btn-copy-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-model:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.model-essay-box {
  background: var(--bg-secondary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-line;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.history-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-genre-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}

.history-band-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-start-history {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-start-history:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

.prompt-generating-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  justify-content: center;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.history-topic-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.history-empty .empty-icon {
  margin-bottom: 12px;
  opacity: 0.5;
}

.history-empty h4 {
  margin: 0 0 6px 0;
  color: var(--text-primary);
}

.history-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.history-draft-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Toolbar Buttons & Save Status */
.btn-workspace-structures {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(59, 130, 246, 0.16));
  border: 1.5px solid rgba(139, 92, 246, 0.45);
  color: #7c3aed;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-workspace-structures:hover {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.btn-workspace-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  color: #059669;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-workspace-save:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-workspace-ai-suggest {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.16), rgba(139, 92, 246, 0.16));
  border: 1.5px solid rgba(236, 72, 153, 0.45);
  color: #db2777;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-workspace-ai-suggest:hover {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.25);
}

.btn-workspace-ai-suggest:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.language-selector-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.language-select-dropdown {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
}

.structures-tab-switcher {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.structures-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.structures-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.save-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.save-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.save-status-dot.saved {
  background: #10b981;
}

.save-status-dot.unsaved {
  background: #f59e0b;
}

/* Modal / Drawer for Academic Structures & Collocations */
.structures-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.18s ease-out;
}

.structures-modal-card {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.structures-modal-header {
  padding: 18px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.structures-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.structures-modal-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.structures-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
}

.structures-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.btn-close-structures {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
}

.btn-close-structures:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.structures-modal-toolbar {
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.structures-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 14px;
}

.structures-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.structures-filters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

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

.band-filter-btn {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.band-filter-btn.active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.structures-category-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.structures-category-nav::-webkit-scrollbar {
  display: none;
}

.cat-filter-btn {
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-filter-btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.25);
  font-weight: 700;
}

.structures-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.structure-card-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.structure-card-item:hover {
  border-color: #8b5cf6;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

.structure-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.structure-band-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.structure-band-tag.band8 {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.2));
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.structure-band-tag.band7 {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.structure-band-tag.band6 {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.structure-kind-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.structure-kind-tag.collocation {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.structure-kind-tag.structure {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.28);
}

.placeholder-slot {
  display: inline-block;
  background: rgba(139, 92, 246, 0.14);
  color: #7c3aed;
  border: 1px dashed rgba(139, 92, 246, 0.45);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.88em;
  font-weight: 600;
  margin: 0 2px;
}

.structure-phrase-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  font-family: inherit;
}

.structure-meaning-text {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.structure-usage-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: 6px;
  border-left: 2px solid #8b5cf6;
}

.structure-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.btn-insert-structure {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #7c3aed;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-insert-structure:hover {
  background: #6d28d9;
  transform: scale(1.02);
}

.btn-copy-structure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-structure:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   TASK 1 VISUALIZER (Charts, Tables, Processes, Maps)
========================================================= */
.task1-visual-container {
  margin-top: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task1-visual-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task1-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
}

.task1-visual-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.visual-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.svg-chart-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  justify-content: center;
}

.task1-svg-chart {
  width: 100%;
  max-width: 440px;
  height: auto;
  overflow: visible;
}

/* Data Table Styling */
.visual-data-table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.task1-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  text-align: left;
}

.task1-data-table th,
.task1-data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
}

.task1-data-table th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-muted);
}

.task1-data-table td {
  color: var(--text-primary);
}

.task1-data-table tbody tr:last-child td {
  border-bottom: none;
}

.task1-data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.06);
}

.table-row-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.table-bold-cell {
  font-weight: 700;
}

/* Bar Chart */
.bars-group-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.bar-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-group-cat-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.bar-group-bars-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: flex-end;
  height: 90px;
  padding-top: 6px;
}

.single-bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  height: 100%;
}

.bar-pill-outer {
  width: 100%;
  max-width: 28px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.bar-pill-inner {
  width: 100%;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
  transition: height 0.3s ease;
}

.bar-value-text {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
}

.bar-series-name {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Pie Chart */
.pie-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.pie-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pie-card-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pie-svg-wrapper {
  width: 110px;
  height: 110px;
}

.task1-pie-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pie-slice-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pie-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
}

.pie-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pie-legend-name {
  color: var(--text-muted);
  flex: 1;
}

.pie-legend-val {
  color: var(--text-primary);
}

/* Industrial Process */
.process-sub-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.process-section-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.process-flow-track {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.process-step-node {
  min-width: 130px;
  max-width: 150px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.step-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: #3b82f6;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
}

.step-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
}

.step-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.process-arrow-divider {
  font-size: 1rem;
  color: var(--primary);
  flex-shrink: 0;
  padding: 0 2px;
}

.concrete-recipe-bar {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recipe-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 4px;
}

.process-machine-note {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

/* Map Comparisons */
.map-periods-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 768px) {
  .map-periods-comparison-grid {
    grid-template-columns: 1fr;
  }
}

.map-period-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.map-period-header {
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border-color);
}

.map-period-header.past {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-primary);
}

.map-period-header.present {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.map-zones-list {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-zone-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.zone-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-area-badge {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.zone-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
}

.map-tag {
  font-size: 0.66rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Real Exam Image & SVG Visual Maps */
.map-view-mode-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btn-map-mode {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-map-mode:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-map-mode.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.map-real-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
}

.map-real-exam-image {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 4px;
}

.map-svg-comparison-wrap {
  width: 100%;
}

.lakeside-svg-grid,
.dynamic-map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.island-svg-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 768px) {
  .lakeside-svg-grid,
  .dynamic-map-grid {
    grid-template-columns: 1fr;
  }
}

.svg-map-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.svg-map-card-header {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-color);
}

.svg-map-card-header h5 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
}

.svg-map-card-header.past {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-primary);
}

.svg-map-card-header.present {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.svg-canvas-wrapper {
  padding: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fdfbf7;
}

.ielts-map-svg {
  width: 100%;
  height: auto;
  max-height: 380px;
  display: block;
}

/* =========================================================
   SENTENCE-BY-SENTENCE EVALUATION BREAKDOWN
========================================================= */
.sentence-breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.sentence-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 6px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.sentence-filter-btn {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sentence-filter-btn:hover {
  color: var(--text-primary);
}

.sentence-filter-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sentence-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sentence-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.sentence-card.has-error {
  border-left: 4px solid #ef4444;
}

.sentence-card.is-correct {
  border-left: 4px solid #10b981;
}

.sentence-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sentence-num-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}

.sentence-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.sentence-status-pill.correct {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sentence-status-pill.error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sentence-original-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  font-style: italic;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 2px solid var(--border-color);
}

.sentence-detail-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.sentence-detail-box.analysis-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.sentence-detail-box.analysis-correct {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #047857;
}

.sentence-detail-box.grammar-fix {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.sentence-detail-box.upgrade {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #7c3aed;
}

.box-title-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.box-content-text {
  font-size: 0.84rem;
  font-weight: 500;
}

.box-content-text strong {
  font-weight: 700;
}

.sentence-no-upgrade-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 4px;
}

/* ==========================================================================
   AUTHENTIC IELTS PROMPT LIBRARY MODAL (KHO ĐỀ THI THẬT 2020 - NAY)
   ========================================================================== */

.ielts-prompt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModalBackdrop 0.2s ease-out;
}

@keyframes fadeInModalBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ielts-prompt-modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 65px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideUpPromptModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ielts-prompt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.modal-header-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-header-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.modal-header-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-header-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Task Tab Buttons */
.ielts-prompt-modal-tabs {
  display: flex;
  padding: 10px 24px 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.prompt-task-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
}

.prompt-task-tab-btn:hover {
  color: var(--text-primary);
}

.prompt-task-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}

.task-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border-radius: 999px;
}

/* Filter Section */
.ielts-prompt-modal-filters {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.prompt-filter-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.prompt-filter-search-box .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.prompt-search-input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  font-size: 0.88rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
}

.prompt-filter-dropdowns-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

.filter-group-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.prompt-filter-select {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.prompt-filter-select:focus {
  border-color: var(--primary);
}

.btn-reset-filters {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-color);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.btn-reset-filters:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* Counter Bar */
.ielts-prompt-modal-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.exam-verified-badge {
  font-weight: 600;
  color: #10b981;
}

/* Cards List */
.ielts-prompt-modal-list {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-main, #0f172a);
}

.prompt-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt-item-card:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.25);
}

.prompt-item-card.current-active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.03);
  box-shadow: 0 0 0 1px #10b981;
}

.prompt-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.badge-exam-date {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-exam-source {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-radius: 6px;
}

.badge-topic-category {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border-radius: 6px;
}

.badge-exam-subtype {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.badge-currently-writing {
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 9px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.prompt-card-question-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
}

.prompt-card-question-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
  font-weight: 500;
}

/* Collocations */
.prompt-card-keywords-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.keywords-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
}

.keywords-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
}

/* Outline Accordion */
.prompt-outline-accordion {
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.btn-toggle-outline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.btn-toggle-outline:hover {
  background: rgba(99, 102, 241, 0.06);
}

.outline-toggle-arrow {
  margin-left: auto;
  font-size: 0.68rem;
  opacity: 0.7;
}

.prompt-outline-content {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
}

.outline-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.outline-sec-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
}

.outline-sec-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Card Bottom Footer */
.prompt-card-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.prompt-meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.badge-has-data {
  color: #059669;
  font-weight: 600;
}

.btn-select-prompt-now {
  padding: 8px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-select-prompt-now:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

.btn-select-prompt-now.btn-already-selected {
  background: #10b981;
  box-shadow: none;
  cursor: default;
}

/* Empty State */
.prompt-modal-empty-state {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.prompt-modal-empty-state .empty-icon {
  color: var(--text-muted);
  opacity: 0.6;
}

.prompt-modal-empty-state h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.prompt-modal-empty-state p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.btn-primary-ghost {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary-ghost:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Nút mở Kho Đề trên thanh công cụ của WritingPage */
.btn-prompt-action.ielts-bank-action {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--primary);
  font-weight: 700;
}

.btn-prompt-action.ielts-bank-action:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.ielts-bank-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  margin-left: 3px;
}

.btn-prompt-action.ielts-bank-action:hover .ielts-bank-badge {
  background: #fff;
  color: #4f46e5;
}

/* Task 1 Authentic Image Preview in Cards */
.prompt-card-image-box {
  margin: 12px 0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-card-image-box:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.prompt-card-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
}

.image-header-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--primary);
}

.btn-zoom-image {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zoom-image:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  border-color: var(--primary);
}

.prompt-card-image-wrapper {
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  cursor: zoom-in;
  max-height: 260px;
  overflow: hidden;
}

.prompt-card-image-img {
  max-width: 100%;
  max-height: 240px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.prompt-card-image-wrapper:hover .prompt-card-image-img {
  transform: scale(1.02);
}

/* Lightbox Fullscreen Modal */
.prompt-image-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeInModalBackdrop 0.2s ease;
}

.prompt-image-lightbox-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}

.lightbox-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-lightbox {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-lightbox:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.lightbox-full-img {
  max-width: 86vw;
  max-height: 78vh;
  object-fit: contain;
  padding: 16px;
  background: #ffffff;
}

/* Task1Visualizer Official Exam Image & Tabs */
.task1-view-mode-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.btn-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-mode-tab:hover {
  color: var(--text-primary);
}

.btn-mode-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.task1-official-image-card {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  overflow: hidden;
}

.official-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.official-image-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-expand-official-image {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-expand-official-image:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  border-color: var(--primary);
}

.official-image-img-wrap {
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  cursor: zoom-in;
  max-height: 480px;
  overflow: hidden;
}

.official-image-img {
  max-width: 100%;
  max-height: 440px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.official-image-img-wrap:hover .official-image-img {
  transform: scale(1.015);
}



/* ==========================================================================
   Admin Portal & Feedback Modal Styles
   Modern, Glassmorphism, Micro-animations & High-contrast Badges
   ========================================================================== */

/* ----------------- FEEDBACK MODAL ----------------- */
.feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: fbFadeIn 0.2s ease-out;
}

@keyframes fbFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.feedback-modal-card {
  background: var(--surface-bg, #ffffff);
  color: var(--text-color, #0f172a);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

[data-theme="dark"] .feedback-modal-card {
  background: #1e293b;
  color: #f8fafc;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.feedback-modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .feedback-modal-header {
  border-bottom-color: #334155;
}

.feedback-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.feedback-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-close-btn:hover {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-primary);
}

.feedback-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feedback-type-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.type-pill {
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .type-pill {
  border-color: #475569;
  color: #cbd5e1;
}

.type-pill.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.feedback-rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-stars {
  display: flex;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #cbd5e1;
  transition: transform 0.15s, color 0.15s;
  padding: 2px;
  line-height: 1;
}

.star-btn:hover,
.star-btn.filled {
  color: #f59e0b;
  transform: scale(1.15);
}

.feedback-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: inherit;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 110px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-textarea:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .feedback-textarea {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .feedback-textarea:focus {
  border-color: #38bdf8;
  background: #0b1120;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.feedback-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
}

.feedback-modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

[data-theme="dark"] .feedback-modal-actions {
  border-top-color: #334155;
}

/* My Feedbacks Mini List inside modal */
.my-feedbacks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.my-feedback-card {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.85rem;
}

/* ----------------- ADMIN PORTAL ----------------- */
.admin-portal-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  animation: fbFadeIn 0.3s ease-out;
}

.admin-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-title-group h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-title-group p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.admin-nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(148, 163, 184, 0.12);
  padding: 4px;
  border-radius: 12px;
}

.admin-tab-btn {
  padding: 8px 18px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
}

.admin-tab-btn.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .admin-tab-btn.active {
  background: #334155;
  color: #f8fafc;
}

/* Overview Stat Cards Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .stat-card {
  background: #1e293b;
  border-color: #334155;
}

.stat-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-users { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.stat-icon-lessons { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.stat-icon-sessions { background: rgba(16, 185, 129, 0.12); color: #059669; }
.stat-icon-completed { background: rgba(234, 88, 12, 0.12); color: #c2410c; }
.stat-icon-feedbacks { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.stat-icon-vocab { background: rgba(236, 72, 153, 0.12); color: #db2777; }

.stat-info .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

/* User & Lesson Analytics Table */
.admin-card-section {
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .admin-card-section {
  background: #1e293b;
  border-color: #334155;
}

.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.admin-search-input {
  max-width: 320px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: inherit;
  font-size: 0.88rem;
  outline: none;
}

[data-theme="dark"] .admin-search-input {
  background: #0f172a;
  border-color: #334155;
}

.admin-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* User item accordion card */
.user-item-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--surface-bg, #ffffff);
  overflow: hidden;
  transition: all 0.2s;
}

[data-theme="dark"] .user-item-card {
  background: #1e293b;
  border-color: #334155;
}

.user-item-summary {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 14px;
}

.user-item-summary:hover {
  background: rgba(148, 163, 184, 0.06);
}

.user-left-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-text-meta .user-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-text-meta .user-email {
  font-size: 0.8rem;
  color: #64748b;
}

.user-right-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-pill {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="dark"] .metric-pill {
  color: #cbd5e1;
}

/* User Expanded Lessons Breakdown */
.user-lessons-breakdown {
  padding: 16px 20px 20px;
  background: rgba(148, 163, 184, 0.04);
  border-top: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .user-lessons-breakdown {
  border-top-color: #334155;
  background: rgba(15, 23, 42, 0.3);
}

.lessons-table-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 12px;
}

.user-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-bg, #ffffff);
  border: 1px solid rgba(148, 163, 184, 0.15);
  margin-bottom: 8px;
}

[data-theme="dark"] .user-lesson-row {
  background: #1e293b;
}

.lesson-meta-thumb {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.lesson-meta-thumb img {
  width: 56px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.lesson-meta-thumb .lesson-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-progress-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-rate-text {
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 50px;
  text-align: right;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-reviewed {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-resolved {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-admin {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Feedbacks management card */
.feedback-admin-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 12px;
  background: var(--surface-bg, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="dark"] .feedback-admin-card {
  background: #1e293b;
  border-color: #334155;
}

.feedback-admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.feedback-sender-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.feedback-content-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: inherit;
  background: rgba(148, 163, 184, 0.05);
  padding: 10px 12px;
  border-radius: 8px;
  white-space: pre-wrap;
}

.feedback-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ----------------- ADMIN FEEDBACK BADGE (HEADER) ----------------- */
.btn-feedback {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-feedback-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.2px;
  transition: all 0.25s ease;
  user-select: none;
}

.admin-feedback-badge.active-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
  animation: adminBadgePulse 2.4s infinite ease-in-out;
}

.admin-feedback-badge.zero-badge {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

@keyframes adminBadgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.admin-feedback-banner-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  color: #b91c1c;
  font-size: 0.85rem;
}

[data-theme="dark"] .admin-feedback-banner-hint {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ----------------- FEEDBACK IMAGE ATTACHMENT (MINIO) ----------------- */
.feedback-upload-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-upload-dropzone {
  border: 2px dashed var(--border-color, #cbd5e1);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  cursor: pointer;
  background: rgba(241, 245, 249, 0.5);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feedback-upload-dropzone:hover,
.feedback-upload-dropzone.drag-active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}

[data-theme="dark"] .feedback-upload-dropzone {
  background: rgba(30, 41, 59, 0.6);
  border-color: #334155;
}

[data-theme="dark"] .feedback-upload-dropzone:hover,
[data-theme="dark"] .feedback-upload-dropzone.drag-active {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
}

.feedback-attached-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .feedback-attached-preview {
  background: #0f172a;
  border-color: #334155;
}

.feedback-preview-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-preview-meta {
  flex: 1;
  min-width: 0;
}

.feedback-preview-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color, #0f172a);
}

[data-theme="dark"] .feedback-preview-name {
  color: #f8fafc;
}

.feedback-preview-size {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.feedback-preview-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  border: none;
  color: #dc2626;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.feedback-preview-remove-btn:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Lightbox Modal */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fbFadeIn 0.2s ease-out;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lightbox-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}

.lightbox-close-btn:hover {
  transform: scale(1.1);
}

/* ----------------- CONVERSATION THREAD & CHAT STYLES ----------------- */
.user-unread-feedback-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.5);
  animation: pulseRedBadge 2s infinite;
}

@keyframes pulseRedBadge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.conversation-container {
  display: flex;
  flex-direction: column;
  height: 520px;
  max-height: 70vh;
}

.conversation-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 12px;
}

.conversation-back-btn {
  background: transparent;
  border: none;
  color: var(--primary, #3b82f6);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.conversation-back-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.conversation-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Original Feedback Ticket Card inside Conversation */
.conversation-original-ticket {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 6px;
}

[data-theme="dark"] .conversation-original-ticket {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Message Bubble */
.chat-message-row {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.chat-message-row.from-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-row.from-admin {
  align-self: flex-start;
}

.chat-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-avatar-circle.admin {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.chat-avatar-circle.user {
  background: #64748b;
  color: #ffffff;
}

.chat-bubble {
  border-radius: 14px;
  padding: 10px 14px;
  position: relative;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-bubble.admin {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.chat-bubble.user {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

[data-theme="dark"] .chat-bubble.user {
  background: #1d4ed8;
  color: #ffffff;
}

.chat-bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.chat-bubble.admin .chat-bubble-meta {
  color: #64748b;
}

[data-theme="dark"] .chat-bubble.admin .chat-bubble-meta {
  color: #94a3b8;
}

.chat-bubble.user .chat-bubble-meta {
  color: rgba(255, 255, 255, 0.8);
}

.chat-bubble-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.chat-bubble-role-tag.admin {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
}

[data-theme="dark"] .chat-bubble-role-tag.admin {
  background: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.chat-bubble.user .chat-bubble-role-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.chat-bubble-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-img-preview {
  margin-top: 8px;
  max-width: 220px;
  max-height: 150px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: transform 0.15s;
}

.chat-bubble-img-preview:hover {
  transform: scale(1.02);
}

/* Reply Bar at Bottom */
.conversation-reply-bar {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-input-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--input-bg, #f8fafc);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .reply-input-group {
  background: #0f172a;
  border-color: #334155;
}

.reply-input-group:focus-within {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.reply-textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 0.88rem;
  color: inherit;
  outline: none;
  max-height: 100px;
  min-height: 38px;
  line-height: 1.4;
}

.reply-attach-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.reply-attach-btn:hover {
  background: rgba(100, 116, 139, 0.15);
  color: var(--primary, #3b82f6);
}

.reply-send-btn {
  background: var(--primary, #3b82f6);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.reply-send-btn:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.reply-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reply-attached-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  color: var(--primary, #3b82f6);
  font-weight: 600;
}

