/**
 * Steno Platform - Phase 3 Audio Laboratory & 3-Stage Timed Test Engine Styles
 */

/* Audio Laboratory Card */
.steno-audio-lab-card {
  background: var(--steno-card-bg);
  border: 1px solid var(--steno-border);
  border-radius: var(--steno-radius-lg);
  padding: 24px;
  box-shadow: var(--steno-shadow-sm);
  margin-bottom: 24px;
}

.steno-audio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.steno-dictation-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--steno-text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Audio Source & Mode Badges */
.steno-synthetic-voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--steno-accent-secondary);
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.steno-mode-badge-practice {
  background: rgba(37, 99, 235, 0.1);
  color: var(--steno-accent-primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.steno-mode-badge-exam {
  background: rgba(220, 38, 38, 0.1);
  color: var(--steno-error);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

/* Waveform / Visual Audio Bar */
.steno-waveform-wrap {
  background: var(--steno-card-bg-subtle);
  border: 1px solid var(--steno-border);
  border-radius: var(--steno-radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.steno-waveform-bar {
  position: relative;
  height: 8px;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 12px;
  overflow: hidden;
}

.steno-waveform-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--steno-accent-primary), var(--steno-accent-secondary));
  border-radius: 4px;
  transition: width 0.1s linear;
}

.steno-waveform-times {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--steno-font-mono);
  font-size: 13px;
  color: var(--steno-text-secondary);
}

.steno-current-word-pill {
  font-family: var(--steno-font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--steno-accent-primary);
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 10px;
  border-radius: 12px;
}

/* Audio Player Controls */
.steno-player-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.steno-player-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.steno-btn-play-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--steno-accent-primary);
  color: #FFFFFF;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.steno-btn-play-large:hover {
  background: var(--steno-accent-hover);
  transform: scale(1.05);
}

.steno-btn-seek {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--steno-card-bg-subtle);
  border: 1px solid var(--steno-border);
  color: var(--steno-text-primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.steno-btn-seek:hover {
  border-color: var(--steno-accent-primary);
  color: var(--steno-accent-primary);
}

/* Speed Pills Selector */
.steno-speed-engine-wrap {
  margin-bottom: 20px;
}

.steno-speed-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--steno-text-primary);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.steno-wpm-pills-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.steno-wpm-pill {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--steno-border);
  background: var(--steno-card-bg-subtle);
  color: var(--steno-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.steno-wpm-pill:hover {
  border-color: var(--steno-accent-primary);
  color: var(--steno-accent-primary);
}

.steno-wpm-pill.active {
  background: var(--steno-accent-primary);
  color: #FFFFFF;
  border-color: var(--steno-accent-primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}

/* Ambient Exam Hall Noise Box */
.steno-ambient-box {
  background: var(--steno-card-bg-subtle);
  border: 1px dashed var(--steno-border);
  border-radius: var(--steno-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.steno-ambient-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.steno-ambient-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--steno-text-primary);
}

.steno-ambient-desc {
  font-size: 11px;
  color: var(--steno-text-secondary);
}

.steno-volume-slider {
  width: 100px;
  accent-color: var(--steno-accent-secondary);
}

/* 3-Stage Exam Stepper */
.steno-exam-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  background: var(--steno-card-bg-subtle);
  border: 1px solid var(--steno-border);
  border-radius: var(--steno-radius-md);
  padding: 12px 20px;
}

.steno-stepper-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--steno-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.steno-stepper-stage.active {
  color: var(--steno-accent-primary);
  font-weight: 700;
}

.steno-stepper-stage.completed {
  color: var(--steno-success);
}

.steno-stepper-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--steno-border);
  color: var(--steno-text-secondary);
}

.steno-stepper-stage.active .steno-stepper-num {
  background: var(--steno-accent-primary);
  color: #FFFFFF;
}

.steno-stepper-stage.completed .steno-stepper-num {
  background: var(--steno-success);
  color: #FFFFFF;
}

/* Exam Countdown Timer */
.steno-countdown-timer {
  font-family: var(--steno-font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--steno-accent-primary);
  background: var(--steno-card-bg-subtle);
  border: 2px solid var(--steno-border);
  border-radius: var(--steno-radius-md);
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.steno-countdown-timer.steno-timer-amber {
  color: var(--steno-warning);
  border-color: var(--steno-warning);
  background: var(--steno-warning-light);
}

.steno-countdown-timer.steno-timer-red {
  color: var(--steno-error);
  border-color: var(--steno-error);
  background: var(--steno-error-light);
  animation: steno-pulse-red 1s infinite alternate;
}

@keyframes steno-pulse-red {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

/* Exam Transcription Editor */
.steno-exam-editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.steno-exam-textarea {
  width: 100%;
  min-height: 380px;
  padding: 20px;
  font-size: 16px;
  line-height: 1.8;
  border: 1.5px solid var(--steno-border);
  border-radius: var(--steno-radius-md);
  background: var(--steno-input-bg);
  color: var(--steno-text-primary);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
  font-family: var(--steno-font-sans);
}

.steno-exam-textarea.font-mono {
  font-family: var(--steno-font-mono);
}

.steno-exam-textarea:focus {
  border-color: var(--steno-accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.steno-autosave-indicator {
  font-size: 12px;
  color: var(--steno-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.steno-autosave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steno-success);
}

/* Ready Countdown Overlay */
.steno-ready-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: #FFFFFF;
}

.steno-ready-number {
  font-size: 96px;
  font-weight: 900;
  font-family: var(--steno-font-mono);
  color: var(--steno-accent-secondary);
  animation: steno-pop 0.8s ease-out;
}

@keyframes steno-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Result Screen */
.steno-result-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.steno-result-metric-card {
  background: var(--steno-card-bg-subtle);
  border: 1px solid var(--steno-border);
  border-radius: var(--steno-radius-md);
  padding: 16px;
  text-align: center;
}

.steno-result-metric-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--steno-accent-primary);
  font-family: var(--steno-font-mono);
}

.steno-result-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--steno-text-secondary);
  margin-top: 4px;
}

.steno-side-by-side-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .steno-side-by-side-wrap {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SMART AUDIO DICTATION & MISTAKE DETECTION STUDIO (REDESIGNED)
   ========================================================================== */
.steno-practice-studio-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 16px 48px;
}

/* 1. Hero Header */
.sa-studio-hero {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

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

.sa-live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563EB;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.sa-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  display: inline-block;
  box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
  animation: saDotPulse 1.6s infinite;
}

@keyframes saDotPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.sa-studio-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 14px;
  line-height: 1.3;
}

.sa-hindi-sub {
  font-size: 1.2rem;
  font-weight: 500;
  color: #64748B;
  display: inline-block;
  margin-left: 6px;
}

.sa-studio-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sa-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #EFF6FF;
  color: #1E3A8A;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #BFDBFE;
}

.sa-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
}

.sa-step-divider {
  color: #94A3B8;
  font-weight: 700;
}

/* 2. Unified Studio Grid */
.sa-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px;
  align-items: start;
}
.sa-studio-col-left,
.sa-studio-col-right {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 991px) {
  .sa-studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sa-studio-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  margin-bottom: 22px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* 3. Control Card */
.sa-lang-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sa-lang-tab-btn {
  padding: 7px 14px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-lang-tab-btn.is-active {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #1D4ED8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.sa-passage-picker-row {
  margin-bottom: 18px;
}

.sa-field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.sa-select-passage {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.sa-select-passage:focus {
  border-color: #2563EB;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sa-wpm-selector-row {
  margin-bottom: 18px;
}

.sa-wpm-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 8px;
}

.sa-wpm-guide-txt {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748B;
}

.sa-wpm-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sa-wpm-pill {
  padding: 7px 14px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-wpm-pill:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
}

.sa-wpm-pill.is-active {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #1D4ED8;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.sa-audio-switches-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
}

.sa-voice-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.sa-voice-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  font-size: 12.5px;
}

.sa-switches-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.sa-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.sa-switch-label input[type="checkbox"] {
  accent-color: #2563EB;
  cursor: pointer;
}

/* 4. Centerpiece Animated Equalizer & Player */
.sa-player-card {
  border-left: 4px solid #2563EB;
}

.sa-player-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.sa-badge-audio-type {
  font-size: 11.5px;
  font-weight: 700;
  color: #0D9488;
  background: #F0FDFA;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
}

.sa-active-passage-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}

.sa-player-meta-badges {
  display: flex;
  gap: 8px;
}

.sa-meta-pill {
  padding: 4px 10px;
  border-radius: 8px;
  background: #F1F5F9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

/* 24-Bar Animated Equalizer */
.sa-equalizer-wrap {
  background: #0B1120;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.sa-equalizer-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 52px;
  margin-bottom: 14px;
  padding: 0 8px;
}

.sa-eq-bar {
  flex: 1;
  max-width: 8px;
  min-width: 4px;
  height: 6px;
  background: linear-gradient(180deg, #38BDF8 0%, #2563EB 100%);
  border-radius: 4px;
  transition: height 0.15s ease, opacity 0.2s ease;
  opacity: 0.4;
}

.sa-player-card.is-playing .sa-eq-bar {
  opacity: 1;
  animation: saEqBounce 0.75s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * 0.035s);
}

@keyframes saEqBounce {
  0% { height: 6px; }
  100% { height: 44px; filter: drop-shadow(0 0 6px #38BDF8); }
}

.sa-audio-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.sa-audio-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38BDF8, #10B981);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.sa-player-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #94A3B8;
  font-family: monospace;
}

.sa-player-word-live {
  color: #38BDF8;
  font-weight: 700;
  font-family: var(--steno-font-sans, inherit);
}

/* Transport Controls */
.sa-transport-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.sa-transport-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sa-btn-seek {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sa-btn-seek:hover {
  background: #E2E8F0;
  color: #0F172A;
  transform: scale(1.05);
}

.sa-btn-play-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 12px;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.sa-btn-play-hero:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.sa-btn-play-hero.is-playing {
  background: #0F172A;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3);
}

.sa-btn-drill-toggle {
  padding: 10px 18px;
  border-radius: 10px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #B45309;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-btn-drill-toggle:hover {
  background: #FEF3C7;
  border-color: #FCD34D;
}

/* Hard words panel */
.sa-hard-words-panel {
  margin-top: 18px;
  padding: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}

.sa-hwp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sa-hwp-head h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}

.sa-hwp-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #64748B;
}

.sa-hwp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sa-hwp-chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sa-hwp-chip:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.sa-hwp-chip:active {
  transform: scale(0.97);
}

/* 5. Seamless Inline Transcription Box */
.sa-workspace-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.sa-ws-tab {
  padding: 9px 18px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sa-ws-tab.is-active {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.sa-typing-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.sa-typing-stats {
  display: flex;
  gap: 12px;
}

.sa-type-badge {
  font-size: 13px;
  color: #475569;
}

.sa-type-badge b {
  color: #0F172A;
}

.sa-typing-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sa-eval-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.sa-select-rule {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  font-size: 12.5px;
  font-weight: 600;
}

.sa-textarea-wrap {
  margin-bottom: 16px;
}

.sa-studio-textarea {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #E2E8F0;
  font-size: 15px;
  line-height: 1.7;
  font-family: inherit;
  color: #0F172A;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.sa-studio-textarea:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.sa-check-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.sa-btn-check-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 12px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.sa-btn-check-hero:hover {
  background: #059669;
  transform: translateY(-1px);
}

.sa-btn-clear {
  padding: 12px 20px;
  border-radius: 12px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.sa-btn-clear:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Reference Box & Scanner */
.sa-ref-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
}

.sa-btn-copy-ref {
  padding: 6px 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sa-reference-text-content {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px;
  font-size: 14.5px;
  line-height: 1.8;
  color: #1E293B;
  max-height: 380px;
  overflow-y: auto;
}

.sa-scanner-dropzone {
  border: 2px dashed #93C5FD;
  background: #EFF6FF;
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
}

.sa-scanner-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.sa-scanner-dropzone h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1E3A8A;
  margin: 0 0 8px;
}

.sa-scanner-dropzone p {
  font-size: 13.5px;
  color: #475569;
  max-width: 480px;
  margin: 0 auto 18px;
}

.sa-btn-scanner-upload {
  padding: 12px 24px;
  border-radius: 10px;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* 6. Right Column: Drawer Cards */
.sa-drawer-card {
  padding: 20px;
}

.sa-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.sa-card-icon {
  font-size: 20px;
}

.sa-card-head h3 {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}

.sa-scheme-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sa-scheme-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: #F8FAFC;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.sa-scheme-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sa-scheme-badge.ssc-c { background: #FAF5FF; color: #7C3AED; border: 1px solid #E9D5FF; }
.sa-scheme-badge.ssc-d { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.sa-scheme-badge.highcourt { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }

.sa-scheme-item strong {
  font-size: 13px;
  color: #0F172A;
  display: block;
}

.sa-scheme-item p {
  font-size: 12px;
  color: #64748B;
  margin: 2px 0 0;
  line-height: 1.4;
}

.sa-rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sa-rules-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
}

.sa-rule-indicator {
  font-size: 16px;
  line-height: 1;
}

.sa-rule-indicator.red { color: #DC2626; }
.sa-rule-indicator.amber { color: #D97706; }
.sa-rule-indicator.green { color: #16A34A; }

.sa-rules-list strong {
  color: #0F172A;
  display: block;
  font-size: 12.5px;
}

.sa-rules-list p {
  margin: 2px 0 0;
  color: #64748B;
  line-height: 1.4;
}

.sa-quick-tools-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sa-quick-tool-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sa-quick-tool-link:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #2563EB;
  transform: translateX(2px);
}

/* Diff Output Scorecard */
.sa-diff-result {
  margin-top: 20px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.sa-diff-header {
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sa-diff-score {
  font-size: 1.4rem;
  font-weight: 800;
  color: #10B981;
}

.sa-diff-stats {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: #475569;
  flex-wrap: wrap;
}

.sa-diff-text {
  padding: 20px;
  font-size: 15px;
  line-height: 1.8;
  max-height: 300px;
  overflow-y: auto;
}

.sa-mk-full {
  background: #FEE2E2;
  color: #DC2626;
  text-decoration: line-through;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.sa-mk-half {
  background: #FEF3C7;
  color: #B45309;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.sa-mk-add {
  background: #EFF6FF;
  color: #2563EB;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* Mobile Responsiveness for Studio Layout (320px - 768px) */
@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on inputs */
  #sa-practice-typing-input,
  #sa-dictation-text,
  #sa-dictation-typing,
  .sa-studio-textarea,
  .sa-exam-textarea,
  .sa-select-passage,
  .sa-voice-select,
  .sa-select-rule,
  select,
  textarea,
  input {
    font-size: 16px !important;
  }

  .sa-studio-hero {
    padding: 20px 14px;
  }
  .sa-studio-title {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }
  .sa-studio-stepper {
    display: none !important;
  }
  .sa-studio-card {
    padding: 16px 14px;
    border-radius: 14px;
  }
  .sa-transport-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .sa-transport-main {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }
  .sa-btn-play-hero {
    flex: 1;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 15px;
    justify-content: center;
  }
  .sa-btn-seek {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }
  .sa-transport-extra {
    width: 100%;
  }
  .sa-btn-drill-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .sa-wpm-selector-row {
    padding: 10px 0;
  }
  .sa-wpm-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .sa-wpm-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .sa-wpm-pill {
    padding: 8px 4px;
    min-height: 44px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  .sa-btn-play-hero {
    width: 100%;
    min-height: 48px !important;
  }
  .sa-workspace-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .sa-ws-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sa-audio-switches-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .sa-voice-picker-wrap {
    width: 100%;
  }
  .sa-voice-select {
    width: 100%;
    height: 44px;
  }
  .sa-switches-group {
    flex-direction: column;
    gap: 8px;
  }
  .sa-typing-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sa-typing-stats {
    justify-content: space-between;
    width: 100%;
  }
  .sa-check-action-row {
    flex-direction: column;
    gap: 10px;
  }
  .sa-btn-check-hero,
  .sa-btn-clear {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sa-diff-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .sa-diff-stats {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .sa-diff-stats span {
    padding: 6px 10px !important;
    background: #F1F5F9 !important;
    border-radius: 8px !important;
    font-size: 12px !important;
  }
}

