:root {
  --bg: #0C0E14;
  --panel: #141722;
  --panel-2: #1B1E2D;
  --border: #262A3D;
  --gold: #D8BE82;
  --gold-glow: rgba(216, 190, 130, 0.25);
  --text: #F5F2EB;
  --muted: #8E92A4;
  --success: #2ECC71;
  --success-glow: rgba(46, 204, 113, 0.25);
  --danger: #E74C3C;
  --danger-glow: rgba(231, 76, 60, 0.25);
  --blue: #3498DB;
}

@font-face {
  font-family: 'QPC-Qaloun';
  src: url('/QPC-Qaloun.ttf') format('truetype');
  font-display: swap;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geeza Pro', 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  min-height: 100vh;
  padding-bottom: 90px;
}

header {
  background: #11131C;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  background: linear-gradient(135deg, #D8BE82, #9E854E);
  color: #0C0E14;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0.5px;
}

header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

header p {
  font-size: 12px;
  color: var(--muted);
}

.reciter-badge {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

main {
  max-width: 1080px;
  margin: 28px auto;
  padding: 0 20px;
}

.control-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.pills-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.progress-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.progress-text-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.pill-remaining {
  background: rgba(231, 76, 60, 0.15);
  color: #E74C3C;
  border: 1px solid rgba(231, 76, 60, 0.3);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #D8BE82, #2ECC71);
  transition: width 0.4s ease;
}

optgroup {
  font-weight: bold;
  background: var(--panel-2);
  color: var(--gold);
}

option {
  background: var(--panel);
  color: var(--text);
  font-weight: normal;
  padding: 8px;
}

.pill-label {
  font-size: 13px;
  color: var(--muted);
  margin-left: 6px;
}

.pill {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pill.active {
  background: var(--gold);
  color: #0C0E14;
  font-weight: bold;
  border-color: var(--gold);
}

.selector-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.select-wrapper {
  flex: 1;
  min-width: 240px;
}

select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: var(--gold);
}

.btn-primary {
  background: linear-gradient(135deg, #E6CA8F, #C2A562);
  color: #0C0E14;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px var(--gold-glow);
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0C0E14;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.is-loading .spinner { display: inline-block; }
.is-loading .btn-text { opacity: 0.8; }

/* Status banners */
.banner {
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid;
}

.banner-basmalah {
  background: rgba(216, 190, 130, 0.08);
  border-color: rgba(216, 190, 130, 0.3);
}

.banner-error {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.4);
}

.btn-close-error {
  background: none;
  border: none;
  color: #ff6b6b;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-close-error:hover {
  background: rgba(231, 76, 60, 0.2);
}

.banner-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.banner-title {
  font-weight: bold;
  color: var(--gold);
}

.banner-subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* Verse Cards */
.verses-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.verse-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s;
}

.verse-card:hover {
  border-color: rgba(216, 190, 130, 0.4);
}

.verse-card.playing {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

.verse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ayah-num {
  font-weight: 700;
  color: var(--gold);
  font-size: 15px;
}

.ayah-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  direction: ltr;
}

.badge {
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-family: Menlo, monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--muted);
}

.verse-text-qalun {
  font-family: 'QPC-Qaloun', 'Geeza Pro', serif;
  font-size: 26px;
  line-height: 2.1;
  color: var(--text);
  margin-bottom: 16px;
  direction: rtl;
  text-align: justify;
}

.word-token {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease-out;
}

.word-token:hover {
  background: rgba(216, 190, 130, 0.22);
  color: #FFE39F;
}

.word-token.active-word {
  color: #0C0E14 !important;
  background: linear-gradient(135deg, #FFE39F, #D8BE82) !important;
  box-shadow: 0 0 16px rgba(255, 227, 159, 0.75) !important;
  font-weight: bold;
  transform: scale(1.08);
}

.verse-transport {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel-2);
  padding: 10px 16px;
  border-radius: 10px;
}

.btn-play-ayah {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-play-ayah:hover {
  background: var(--gold);
  color: #0C0E14;
}

.ayah-scrub {
  flex: 1;
  accent-color: var(--gold);
  direction: ltr;
}

.ayah-time {
  font-family: Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  min-width: 55px;
  direction: ltr;
  text-align: right;
}

/* Bottom Action Bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #11131C;
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 0 -8px 25px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s ease;
  pointer-events: none;
}

.bottom-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.summary-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.btn-reject {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-reject:hover {
  background: var(--danger-glow);
}

.btn-confirm {
  background: linear-gradient(135deg, #2ECC71, #27AE60);
  color: white;
  border: none;
  padding: 10px 26px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--success-glow);
  transition: all 0.2s;
}

.btn-confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1B2E23;
  border: 1px solid var(--success);
  color: #A9DFBF;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Audio Spectre & Word Overlay Alignment Editor (Captions / Dubs Style)
   ========================================================================== */

.verse-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-modified {
  background: rgba(216, 190, 130, 0.16);
  border: 1px solid var(--gold);
  color: #FFE39F;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: none;
  align-items: center;
  gap: 4px;
}

.verse-card.is-modified .badge-modified {
  display: inline-flex;
}

.btn-toggle-spectre {
  background: var(--panel-2);
  border: 1px solid rgba(216, 190, 130, 0.35);
  color: var(--gold);
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-toggle-spectre:hover,
.btn-toggle-spectre.active {
  background: rgba(216, 190, 130, 0.16);
  border-color: var(--gold);
  color: #FFE39F;
}

.word-token.selected-word {
  outline: 2px solid var(--gold);
  background: rgba(216, 190, 130, 0.18);
  color: #FFE39F;
}

.word-token.modified-word {
  border-bottom: 2px dashed var(--gold);
}

.spectre-editor {
  margin-top: 14px;
  background: #0F121B;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spectre-editor.collapsed {
  display: none;
}

.spectre-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}

.spectre-legend {
  display: flex;
  align-items: center;
  gap: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.legend-dot.selected { background: #FFE39F; box-shadow: 0 0 6px rgba(255, 227, 159, 0.7); }
.legend-dot.word { background: rgba(216, 190, 130, 0.85); }
.legend-dot.silence { background: rgba(142, 146, 164, 0.35); }

/* Strictly LTR timeline container so X=0 is start of snippet and X=width is end */
.spectre-timeline-wrap {
  direction: ltr;
  text-align: left;
  position: relative;
  background: #090B10;
  border: 1px solid #1F2437;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.spectre-ruler {
  height: 22px;
  background: #10131E;
  border-bottom: 1px solid #1C2030;
  position: relative;
  font-family: Menlo, monospace;
  font-size: 10px;
  color: #6E7387;
  pointer-events: none;
}

.spectre-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 4px;
  line-height: 22px;
  white-space: nowrap;
}

.spectre-tick.minor {
  border-left-color: rgba(255, 255, 255, 0.04);
  top: 12px;
}

.spectre-viewport {
  position: relative;
  height: 124px;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}

.spectre-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.spectre-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  background: rgba(9, 11, 16, 0.72);
  z-index: 4;
  pointer-events: none;
}

.spectre-words-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.wf-word-box {
  position: absolute;
  top: 8px;
  bottom: 8px;
  background: rgba(216, 190, 130, 0.11);
  border: 1px solid rgba(216, 190, 130, 0.45);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  overflow: visible;
  min-width: 14px;
}

.wf-word-box:hover {
  background: rgba(216, 190, 130, 0.20);
  border-color: rgba(255, 227, 159, 0.85);
  z-index: 5;
}

.wf-word-box.selected {
  background: rgba(255, 227, 159, 0.19);
  border: 1.5px solid #FFE39F;
  box-shadow: 0 0 18px rgba(216, 190, 130, 0.32), inset 0 0 12px rgba(255, 227, 159, 0.12);
  z-index: 6;
}

.wf-word-box.active-playing {
  background: rgba(46, 204, 113, 0.22);
  border-color: var(--success);
  box-shadow: 0 0 16px var(--success-glow);
  z-index: 7;
}

.wf-word-box.is-waqf-idtirari {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.72);
}

.wf-word-box.is-ibtida-repeat {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.75);
}

.badge-waqf-idtirari {
  font-size: 11.5px;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.11);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 3px 9px;
}

.word-token.token-waqf-idtirari {
  border-bottom: 2px dashed rgba(245, 158, 11, 0.75);
}

.word-token.token-ibtida-repeat {
  border-bottom: 2px solid rgba(56, 189, 248, 0.8);
}

.wf-word-text {
  font-family: 'QPC-Qaloun', 'Geeza Pro', serif;
  font-size: 18px;
  line-height: 1.2;
  color: #FFF8E7;
  direction: rtl;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 3px;
}

.wf-word-box.selected .wf-word-text {
  color: #FFE39F;
  font-weight: bold;
}

.wf-word-dur {
  font-family: Menlo, monospace;
  font-size: 9px;
  color: rgba(245, 242, 235, 0.78);
  background: rgba(12, 14, 20, 0.75);
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

/* Drag handles on word left (start_ms) and right (end_ms) edges */
.wf-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  cursor: ew-resize;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.wf-handle::after {
  content: '';
  width: 3px;
  height: 26px;
  border-radius: 2px;
  background: rgba(255, 227, 159, 0.55);
  transition: all 0.15s;
}

.wf-handle:hover::after,
.wf-word-box.selected .wf-handle::after {
  background: #FFE39F;
  height: 38px;
  box-shadow: 0 0 6px rgba(255, 227, 159, 0.9);
}

.wf-handle-start {
  left: -4px;
}

.wf-handle-end {
  right: -4px;
}

/* Playhead needle */
.spectre-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background: #FF5E57;
  box-shadow: 0 0 10px rgba(255, 94, 87, 0.9);
  z-index: 10;
  pointer-events: none;
  transform: translateX(-1px);
}

.spectre-playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 10px;
  background: #FF5E57;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Word Timestamp Inspector Box */
.word-inspector-box {
  background: var(--panel-2);
  border: 1px solid rgba(216, 190, 130, 0.28);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  direction: rtl;
}

.inspector-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.inspector-word-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inspector-word-arabic {
  font-family: 'QPC-Qaloun', 'Geeza Pro', serif;
  font-size: 26px;
  color: #FFE39F;
  background: rgba(216, 190, 130, 0.12);
  border: 1px solid rgba(216, 190, 130, 0.35);
  padding: 2px 14px;
  border-radius: 8px;
  min-width: 70px;
  text-align: center;
}

.inspector-word-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspector-word-pos {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.inspector-word-rel {
  font-size: 11px;
  color: var(--muted);
  font-family: Menlo, monospace;
  direction: ltr;
  text-align: right;
}

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

.btn-inspector {
  background: #141722;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-inspector:hover:not(:disabled) {
  border-color: var(--gold);
  color: #FFE39F;
  background: rgba(216, 190, 130, 0.12);
}

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

.btn-inspector.btn-audition {
  background: linear-gradient(135deg, rgba(216, 190, 130, 0.25), rgba(158, 133, 78, 0.25));
  border-color: var(--gold);
  color: #FFE39F;
}

.btn-inspector.btn-audition:hover {
  background: var(--gold);
  color: #0C0E14;
}

.inspector-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}

.time-control-group {
  background: #11141F;
  border: 1px solid #222638;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.time-control-label {
  font-weight: 700;
  color: var(--text);
}

.time-control-row {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}

.time-input-ms {
  flex: 1;
  background: #090B10;
  border: 1px solid #2C3147;
  color: #FFE39F;
  font-family: Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  outline: none;
  min-width: 90px;
}

.time-input-ms:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.btn-nudge {
  background: #1B1E2D;
  border: 1px solid #2C3147;
  color: var(--text);
  font-family: Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-nudge:hover {
  background: rgba(216, 190, 130, 0.2);
  border-color: var(--gold);
  color: #FFE39F;
}

.btn-nudge:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Tajweed & Acoustic dB Auto-Snap Controls Panel
   ========================================================================== */

.tajweed-dsp-panel {
  margin-top: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #10131E 0%, #0C0E16 100%);
  border: 1px solid rgba(216, 190, 130, 0.28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.dsp-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dsp-badge {
  background: rgba(216, 190, 130, 0.18);
  border: 1px solid var(--gold);
  color: #FFE39F;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

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

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

.magnetic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #FFE39F;
  background: rgba(216, 190, 130, 0.1);
  border: 1px solid rgba(216, 190, 130, 0.3);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.magnetic-toggle input[type="checkbox"] {
  accent-color: var(--gold);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-auto-snap {
  background: linear-gradient(135deg, #2ECC71, #1F9E55);
  color: #09130D;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 14px rgba(46, 204, 113, 0.28);
  transition: all 0.18s;
}

.btn-auto-snap:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-auto-snap-ayah {
  background: rgba(46, 204, 113, 0.14);
  border: 1px solid rgba(46, 204, 113, 0.55);
  color: #7CE8A8;
  padding: 4px 10px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-auto-snap-ayah:hover {
  background: rgba(46, 204, 113, 0.28);
  color: #FFFFFF;
}

.dsp-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.dsp-slider-card {
  background: #151927;
  border: 1px solid #24293E;
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dsp-slider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text);
}

.dsp-slider-top b {
  font-family: Menlo, monospace;
  color: #FFE39F;
  font-size: 12px;
}

.dsp-slider-card input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

.dsp-slider-hint {
  font-size: 10.5px;
  color: var(--muted);
}

/* ==========================================================================
   Bulk Processor Bar & Review Queue Styles
   ========================================================================== */

.pill-ready {
  background: rgba(216, 190, 130, 0.14);
  border: 1px solid rgba(216, 190, 130, 0.45);
  color: #FFE39F;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.bulk-processor-bar {
  background: #10131E;
  border: 1px solid #252A3F;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bulk-bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.bulk-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-badge {
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid var(--blue);
  color: #74B9FF;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.bulk-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.bulk-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-mode-select {
  width: auto;
  min-width: 240px;
  padding: 8px 12px;
  font-size: 12.5px;
  background: #171B29;
  border: 1px solid #2C324B;
  border-radius: 8px;
}

.btn-bulk-start {
  background: linear-gradient(135deg, #3498DB, #2475B0);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
}

.btn-bulk-start:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-bulk-stop {
  background: rgba(231, 76, 60, 0.16);
  border: 1px solid var(--danger);
  color: #FF8A7A;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bulk-live-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #FFE39F;
  background: rgba(216, 190, 130, 0.08);
  border: 1px dashed rgba(216, 190, 130, 0.35);
  padding: 8px 12px;
  border-radius: 8px;
}

.btn-confirm-next {
  background: linear-gradient(135deg, #E6CA8F, #C2A562);
  color: #0C0E14;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--gold-glow);
  transition: all 0.2s;
}

.btn-confirm-next:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}



