/* =============================================================================
   reddit.css — Realtime Mode styles (UI/UX enhanced)
   Includes: step wizard · form elements · voice/aligner UI · subtitle editor
             phone shell · waveform editor (WED) · offline/queue banners
   Imported on: redditstyle.html only
   ============================================================================= */

/* ── CSS variables for easier theming ─────────────────────────────────────── */
:root {
  --bg-step:          #0f1420;
  --border-light:     #2a3548;
  --accent-primary:   #6366f1;
  --accent-secondary: #818cf8;
  --accent-warm:      #f59e0b;
  --text-bright:      #f1f5f9;
  --text-muted:       #b0c4de;
  --text-dim:         #6b7f9a;
  --glass-bg:         rgba(255, 255, 255, 0.03);
  --glass-border:     rgba(255, 255, 255, 0.07);
}

/* Popup */

/* Realtime Mode Popup Styles */
.realtime-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.realtime-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.realtime-popup-content {
    position: relative;
    background: linear-gradient(135deg, #0b1120 0%, #0f1a2a 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 32px;
    max-width: 700px;  /* Changed from 550px to 700px */
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.realtime-popup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  position: sticky;
  top: 0;
  background: inherit;
  border-radius: 32px 32px 0 0;
}

.realtime-popup-header i {
  font-size: 1.5rem;
}

.realtime-popup-header h3 {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.realtime-popup-close {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.realtime-popup-close:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.realtime-popup-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.realtime-popup-section {
    display: flex;
    gap: 1.25rem;  /* Increased from 1rem */
    padding: 1.25rem;  /* Increased from 1rem */
    background: rgba(7, 12, 22, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.realtime-popup-section > i {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.realtime-popup-section strong {
  display: block;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.realtime-popup-section p {
  color: #8897b3;
  font-size: 0.85rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.5;
}

.realtime-popup-section ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.2rem;
  color: #6b7fa0;
  font-size: 0.8rem;
}

.realtime-popup-section li {
  margin: 0.25rem 0;
}

.realtime-popup-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.realtime-popup-dontshow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #809ab3;
  font-size: 0.85rem;
}

.realtime-popup-dontshow input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #6366f1;
}

.realtime-popup-gotit {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 60px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.realtime-popup-gotit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .realtime-popup-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .realtime-popup-section {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .realtime-popup-section > i {
    font-size: 1.2rem;
  }
  
  .realtime-popup-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  
  .realtime-popup-gotit {
    justify-content: center;
  }
  
  .realtime-popup-dontshow {
    justify-content: center;
  }
}

/* Rate limit toast - distinct color */
.toast-rate-limit {
    border-left-color: #f59e0b !important;
    background: linear-gradient(90deg, rgba(245,158,11,0.15), rgba(17,24,39,0.95)) !important;
}

.toast-rate-limit i {
    color: #fbbf24 !important;
}

#archxRlPill {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 40px;
    padding: 0.35rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
#archxRlPill.near-limit {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.4);
    color: #f59e0b;
}
#archxRlPill.at-limit {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}
.rl-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    opacity: 0.8;
}

/* ── Rate limit pill (navbar area) ── */
#archxRlPill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.72rem; font-family: 'Inter', sans-serif; font-weight: 600;
    padding: 0.28rem 0.7rem; border-radius: 30px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8; cursor: default; white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
#archxRlPill.warn  { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
#archxRlPill.full  { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
#archxRlPill .rl-dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}

/* ── Rate limit popout (shown on 429) ── */
#archxRlPopout {
    display: none; position: fixed; top: 60px; right: 16px; z-index: 9999;
    background: #0f1a2c; border: 1px solid rgba(245,158,11,0.35);
    border-radius: 14px; padding: 1rem 1.1rem;
    width: 290px; font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideDown 0.2s ease;
}
#archxRlPopout.visible { display: block; }
#archxRlPopout .rl-pop-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem;
}
#archxRlPopout .rl-pop-title { font-size: 0.88rem; font-weight: 700; color: #fbbf24; }
#archxRlPopout .rl-pop-close {
    background: transparent; border: none; color: #546180;
    cursor: pointer; font-size: 1rem; padding: 0; line-height: 1;
    transition: color 0.15s;
}
#archxRlPopout .rl-pop-close:hover { color: #e2e8f0; }
#archxRlPopout .rl-pop-msg  { font-size: 0.78rem; color: #94a3b8; margin-bottom: 0.85rem; line-height: 1.45; }
#archxRlPopout .rl-pop-track { background: rgba(255,255,255,0.07); border-radius: 30px; height: 4px; overflow: hidden; margin-bottom: 0.35rem; }
#archxRlPopout .rl-pop-bar   { height: 100%; border-radius: 30px; background: #f59e0b; transition: width 0.3s ease; }
#archxRlPopout .rl-pop-meta  {
    display: flex; justify-content: space-between;
    font-size: 0.7rem; font-variant-numeric: tabular-nums; color: #546180;
}
#archxRlPopout .rl-pop-meta strong { color: #fbbf24; }

/* ════════════════════════════════════════════════════════════════════════════
   SHARED BUTTON — btn-primary-solid
   Used throughout all steps
   ════════════════════════════════════════════════════════════════════════════ */
.btn-primary-solid {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  border: none;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
  text-decoration: none;
}
.btn-primary-solid:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
}
.btn-primary-solid:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   STEP WIZARD
   ════════════════════════════════════════════════════════════════════════════ */
.step-wizard {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 2rem;
  display: none;
}
.step-wizard.active { display: block; }

.step-indicators {
  display: flex;
  justify-content: center;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.step-indicator.active    { opacity: 1; }
.step-indicator.completed { opacity: 0.8; }
.step-indicator .step-circle {
  width: 46px;
  height: 46px;
  background: #1e2638;
  border: 2px solid var(--border-light);
  border-radius: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.25s;
}
.step-indicator.active .step-circle,
.step-indicator.completed .step-circle {
  background: var(--accent-primary);
  border-color: var(--accent-secondary);
  color: white;
  box-shadow: 0 0 20px rgba(99,102,241,0.5);
}
.step-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.step-content {
  display: none;
  background: var(--bg-step);
  border-radius: 48px;
  border: 1px solid var(--border-light);
  padding: 2.5rem 2.5rem;
  box-shadow: 0 25px 40px -12px #03050b;
}
.step-content.active { display: block; }

.step-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
}
.btn-nav {
  background: transparent;
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.7rem 2.2rem;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-nav:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: white;
  background: rgba(99,102,241,0.05);
}
.btn-nav:disabled { opacity: 0.3; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════════════════════════════════════════ */
.script-textarea {
  width: 100%;
  background: #0b121f;
  border: 1px solid var(--border-light);
  border-radius: 32px;
  padding: 1.5rem 1.8rem;
  color: var(--text-bright);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  resize: vertical;
  min-height: 200px;
  transition: border 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.script-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.char-counter {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.char-counter.warning { color: #f59e0b; }
.char-counter.error   { color: #ef4444; }

.explicit-warning {
  background: rgba(239,68,68,0.1);
  border-left: 4px solid #ef4444;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  color: #fecaca;
  display: none;
}

.status-message {
  padding: 0.8rem 1.5rem;
  border-radius: 40px;
  background: #111a2a;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}
.status-success { background: #0f1d15; color: #a7f3d0; border-color: rgba(16,185,129,0.3); }
.status-error   { background: #1e1015; color: #fecaca; border-color: rgba(239,68,68,0.3); }

/* ════════════════════════════════════════════════════════════════════════════
   VOICE & SPEED ROW
   ════════════════════════════════════════════════════════════════════════════ */
.voice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-end;
  margin: 2rem 0 1.5rem;
}
.voice-select-group,
.rate-group {
  flex: 1 1 200px;
}
.voice-select-group label,
.rate-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Base select/range reset */
select {
  width: 100%;
  background: #0b121f;
  border: 1px solid var(--border-light);
  color: var(--text-bright);
  padding: 0.7rem 1.2rem;
  border-radius: 60px;
  transition: border 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23546180' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
select:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
select option {
  background: #0f1420;
  color: var(--text-bright);
}

input[type=range] {
  width: 100%;
  background: transparent;
  border: none;
  accent-color: var(--accent-primary);
  cursor: pointer;
  padding: 0.7rem 0;
}
input[type=range]:focus { outline: none; }

.rate-value {
  display: inline-block;
  margin-left: 0.8rem;
  font-weight: 600;
  color: var(--accent-secondary);
}
.audio-preview-box {
  background: #0b121f;
  border-radius: 36px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border-light);
}
.audio-preview-box audio {
  width: 100%;
  border-radius: 60px;
  display: block;
  margin-bottom: 0.8rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   ALIGNER PICKER
   ════════════════════════════════════════════════════════════════════════════ */
.aligner-picker {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 28px;
  padding: 1.2rem 1.5rem;
  margin: 1.2rem 0;
}
.aligner-picker-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.aligner-badge {
  margin-left: auto;
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  color: #a5b4fc;
}
.aligner-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
@media (max-width: 580px) {
  .aligner-cards { grid-template-columns: 1fr; }
}
.aligner-card {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.aligner-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.aligner-card:hover {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.05);
}
.aligner-card.active {
  border-color: var(--accent-primary);
  background: rgba(99,102,241,0.1);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
}
.aligner-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--accent-secondary);
}
.aligner-card.active .aligner-card-icon {
  background: rgba(99,102,241,0.25);
  border-color: rgba(99,102,241,0.5);
  color: white;
}
.aligner-card-body { flex: 1; min-width: 0; }
.aligner-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
}
.aligner-card.active .aligner-card-name { color: white; }
.aligner-card-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 0.2rem;
}
.aligner-card-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.aligner-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 30px;
  text-transform: uppercase;
}
.aligner-tag-green  { background: rgba(34,197,94,0.1);   color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.aligner-tag-blue   { background: rgba(59,130,246,0.1);  color: #818cf8; border: 1px solid rgba(59,130,246,0.3); }
.aligner-tag-purple { background: rgba(168,85,247,0.1);  color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.aligner-tag-yellow { background: rgba(251,191,36,0.1);  color: #f59e0b; border: 1px solid rgba(251,191,36,0.3); }
.aligner-tag-gray   { background: rgba(100,116,139,0.12);color: #8897b3; border: 1px solid rgba(100,116,139,0.3); }
.aligner-pass-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.aligner-pass-hint {
  font-size: 0.7rem;
  color: #5a6f8f;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════════════
   VIDEO GRID & PROGRESS
   ════════════════════════════════════════════════════════════════════════════ */
.video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin: 2rem 0;
}
.video-btn {
  background: var(--bg-step);
  border: 1px solid var(--border-light);
  border-radius: 60px;
  padding: 0.7rem 1.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.video-btn:hover {
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
}
.video-btn.selected {
  background: var(--accent-primary);
  border-color: var(--accent-secondary);
  color: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.4);
}
.progress-container {
  background: #0b121f;
  border-radius: 60px;
  height: 20px;
  margin: 2rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 60px;
}
.result-video-box {
  margin: 1.5rem 0;
}
.result-video-box video {
  max-width: 100%;
  border-radius: 36px;
  border: 1px solid var(--border-light);
  display: block;
  margin: 0 auto;
  max-height: 500px;
}

/* ════════════════════════════════════════════════════════════════════════════
   SUBTITLE EDITOR LAYOUT
   ════════════════════════════════════════════════════════════════════════════ */
.sub-editor-cols {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
@media (max-width: 820px) {
  .sub-editor-cols { grid-template-columns: 1fr; }
  .sub-editor-right { order: -1; }
}
.sub-editor-left  { display: flex; flex-direction: column; gap: 1rem; }
.sub-editor-right { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.sub-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* ── Subtitle mode toggle ── */
.sub-mode-toggle {
  display: flex;
  gap: 0.6rem;
}
.sub-mode-btn {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--glass-bg);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.sub-mode-btn:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-bright);
}
.sub-mode-btn.active {
  background: rgba(245,158,11,0.15);
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

/* ── Style panel ── */
.sub-style-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.sub-style-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.sub-style-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 100px;
}
.sub-style-field label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sub-style-field select {
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}
.sub-style-field input[type="range"] {
  padding: 0.3rem 0;
}

/* ── Colour picker button ── */
.colour-picker-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0b121f;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.colour-picker-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(99,102,241,0.1);
}
.colour-picker-btn input[type="color"] {
  width: 0; height: 0; padding: 0; border: none; opacity: 0;
  position: absolute;
}
.colour-picker-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  display: inline-block;
}
.colour-picker-label {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-bright);
  flex: 1;
}

/* ── Position toggle ── */
.pos-toggle {
  display: flex;
  gap: 0.3rem;
}
.pos-btn {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--glass-bg);
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
}
.pos-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-bright);
}
.pos-btn.active {
  background: rgba(245,158,11,0.15);
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

/* ── Colour pool (mix/gradient mode) ── */
.rand-colour-panel {
  background: var(--glass-bg);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.rand-colour-panel-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-warm);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.rand-swatch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 40px;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.rand-swatch-btn:hover {
  border-color: currentColor;
  background: rgba(255,255,255,0.08);
}
.rand-swatch-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  display: inline-block;
  flex-shrink: 0;
}

/* ── Pool colour items (generated by JS) ── */
.pool-colour-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem 0.3rem 0.3rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  position: relative;
  transition: border-color 0.15s;
}
.pool-colour-item:hover {
  background: rgba(255,255,255,0.04);
}
.pool-colour-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.pattern-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pattern-controls label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.pattern-controls input[type=number] {
  width: 70px;
  background: #0b121f;
  border: 1px solid var(--border-light);
  color: var(--text-bright);
  padding: 0.3rem 0.6rem;
  border-radius: 30px;
  font-size: 0.82rem;
  text-align: center;
}
.pattern-controls input[type=number]:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.rand-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════════════
   FONT DROPDOWN
   ════════════════════════════════════════════════════════════════════════════ */
.font-dd {
  position: relative;
  width: 100%;
}
.font-dd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0b121f;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
}
.font-dd-trigger:hover {
  border-color: var(--accent-primary);
  background: rgba(99,102,241,0.05);
}
.font-dd.open .font-dd-trigger {
  border-color: var(--accent-primary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.font-dd-preview {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.font-dd-chevron {
  color: var(--text-dim);
  width: 10px;
  transition: transform 0.2s;
}
.font-dd.open .font-dd-chevron {
  transform: rotate(180deg);
  color: var(--accent-primary);
}
.font-dd-panel {
  display: none;
  position: absolute;
  left: 0; right: 0; top: 100%;
  /* Solid opaque background — critical for readability */
  background: #111c2c;
  border: 1px solid var(--accent-primary);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 9000;
}
.font-dd.open .font-dd-panel { display: block; }
.font-dd-panel::-webkit-scrollbar { width: 4px; }
.font-dd-panel::-webkit-scrollbar-track { background: #0b121f; }
.font-dd-panel::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 4px; }
.font-dd-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  /* Solid background so font names are always readable */
  background: #111c2c;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.1s;
}
.font-dd-item:hover,
.font-dd-item.active {
  background: #192740;
  color: white;
  border-left-color: var(--accent-primary);
}

/* ════════════════════════════════════════════════════════════════════════════
   PHONE SHELL
   ════════════════════════════════════════════════════════════════════════════ */
.phone-shell {
  width: 220px;
  background: #111a2a;
  border-radius: 44px;
  border: 2px solid #2a3a55;
  box-shadow: 0 0 0 1px #0b121f, 0 0 0 6px #0b121f, 0 30px 50px rgba(0,0,0,0.7);
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.phone-notch {
  width: 75px;
  height: 24px;
  background: #111a2a;
  border-radius: 0 0 18px 18px;
  margin: 0 auto -6px;
  border: 2px solid #2a3a55;
  border-top: none;
}
.phone-screen {
  background: #0b121f;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
}
.phone-bg-sim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
}
.phone-bg-bars {
  display: flex;
  width: 100%;
  height: 65%;
  align-items: flex-end;
  gap: 1px;
}
.pb-bar {
  flex: 1;
  height: var(--h);
  background: var(--c);
  position: relative;
}
.phone-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.1) 70%, rgba(0,0,0,0.6));
}
.phone-status-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 22px;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}
.phone-time {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.phone-icons {
  display: flex;
  gap: 3px;
  color: rgba(255,255,255,0.8);
  font-size: 0.55rem;
}
.phone-sub-area {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.phone-screen-fade-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  z-index: 6;
  pointer-events: none;
}
.phone-home-bar {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  margin: 2px auto 0;
}
.phone-transport-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}
.wed-transport-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wed-play-btn {
  width: 46px !important;
  height: 46px !important;
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
}
.wed-play-btn:hover {
  background: var(--accent-primary) !important;
  color: white !important;
}
.phone-time-display {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--accent-secondary);
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   WAVEFORM EDITOR (WED)
   ════════════════════════════════════════════════════════════════════════════ */
.wed-container {
  background: #0b121f;
  border-radius: 36px;
  padding: 1.5rem 1.5rem 1.2rem;
  margin: 0 0 1rem;
  border: 1px solid var(--border-light);
}
.wed-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wed-toolbar-left,
.wed-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.wed-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wed-zoom-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wed-zoom-group input[type=range] {
  width: 90px;
  padding: 0;
  accent-color: #3b82f6;
}
.wed-timeline {
  background: #070c16;
  border-radius: 28px;
  padding: 0.8rem 0 0.8rem 0;
  margin-bottom: 1rem;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  scroll-behavior: smooth;
}
.wed-timeline::-webkit-scrollbar { height: 6px; }
.wed-timeline::-webkit-scrollbar-track { background: #0b121f; border-radius: 20px; }
.wed-timeline::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 20px; }
.wed-canvas-area {
  position: relative;
  min-width: 100%;
  height: auto;
}
#wedRuler,
#wedWave {
  display: block;
  pointer-events: none;
}
#wedRuler { height: 28px; }
#wedWave  { height: 90px; margin-bottom: 4px; }

/* Track labels (the S1/S2/S3 column) */
.wed-tracks-with-labels {
  display: flex;
  gap: 0;
}
.wed-labels-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 32px;
  gap: 2px;
}
.wed-label-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #3e5570;
  font-family: monospace;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.04);
}

.wed-tracks-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.wed-sub-track {
  position: relative;
  height: 44px;
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  margin: 0;
}
.wed-block {
  position: absolute;
  height: 36px;
  top: 4px;
  background: linear-gradient(135deg, #1e2d45, #162035);
  border-radius: 18px;
  border: 2px solid var(--accent-primary);
  box-sizing: border-box;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  user-select: none;
  transition: box-shadow 0.1s;
  min-width: 30px;
}
.wed-block:hover {
  box-shadow: 0 0 0 1px var(--accent-secondary), 0 4px 14px rgba(0,0,0,0.5);
}
.wed-block.wed-selected {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 2px var(--accent-secondary), 0 0 16px rgba(99,102,241,0.5);
}
.wed-block.wed-editing {
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 2px var(--accent-warm), 0 0 16px rgba(245,158,11,0.4);
}
.wed-handle {
  width: 10px;
  height: 22px;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  cursor: ew-resize;
  flex-shrink: 0;
  transition: background 0.1s;
}
.wed-handle:hover { background: rgba(255,255,255,0.35); }
.wed-block-text {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  font-size: 0.78rem;
  pointer-events: none;
}
.wed-block-input {
  background: #070c16;
  border: 1px solid var(--accent-secondary);
  color: white;
  border-radius: 30px;
  padding: 0.15rem 0.7rem;
  width: 0;
  flex: 1;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.wed-block-input:focus { outline: none; }

.wed-playhead {
  position: absolute;
  top: 0;
  width: 2px;
  background: var(--accent-warm);
  box-shadow: 0 0 12px rgba(245,158,11,0.8);
  z-index: 20;
  pointer-events: none;
  border-radius: 2px;
}
.wed-playhead::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--accent-warm);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(245,158,11,0.9);
}

/* ── WED Operations bar ── */
.wed-ops-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.wed-ops-sep { flex: 1; min-width: 1rem; }
.wed-shortcut-hint {
  font-size: 0.68rem;
  color: #3e5570;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ── WED Inspector ── */
.wed-inspector {
  background: #070c16;
  border-radius: 28px;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--border-light);
  min-height: 80px;
}
.wed-insp-empty {
  color: #3e5570;
  font-style: italic;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wed-insp-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
}
.wed-insp-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 80px;
  flex: 1;
}
.wed-insp-field-wide {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  flex-basis: 100%;
}
.wed-insp-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wed-insp-input {
  background: #0f1525;
  border: 1px solid var(--border-light);
  color: var(--text-bright);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  font-family: monospace;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.wed-insp-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.wed-insp-text {
  background: #0f1525;
  border: 1px solid var(--border-light);
  color: var(--text-bright);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.wed-insp-text:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

/* ── WED Buttons ── */
.wed-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.wed-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: white;
  background: rgba(99,102,241,0.08);
}
.wed-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.wed-danger       { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.wed-danger:hover { background: #ef4444 !important; color: white !important; border-color: #ef4444 !important; }
.wed-btn-dim      { opacity: 0.55; }
.wed-btn-dim:hover { opacity: 1; }

/* ── WED Context Menu ── */
.wed-context-menu {
  display: none;
  position: fixed;
  z-index: 99998;
  background: #111c2c;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.15);
  min-width: 140px;
  overflow: hidden;
}
.wed-context-menu.visible { display: block; }
.wed-context-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.12s;
  font-family: 'Inter', sans-serif;
  text-align: left;
}
.wed-context-item:hover {
  background: rgba(99,102,241,0.12);
  color: white;
}
.wed-context-item i {
  width: 14px;
  text-align: center;
  opacity: 0.7;
}

/* ════════════════════════════════════════════════════════════════════════════
   OFFLINE / QUEUE / PROGRESS BANNERS
   ════════════════════════════════════════════════════════════════════════════ */
#archxOfflineBanner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  background: linear-gradient(90deg, #7f1d1d, #991b1b);
  color: #fecaca;
  padding: 0.6rem 1.5rem;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}
#archxOfflineBanner.visible { display: flex; }
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
#archxOfflineCountdown {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #fef2f2;
}

.queue-banner {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 16px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: #fbbf24;
  margin-bottom: 1rem;
}
.queue-banner.visible { display: flex; }

/* TTS / MFA / Encode progress bars */
.tts-progress-bar {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  color: #6ee7b7;
  margin-top: 0.6rem;
  font-family: monospace;
}
.tts-progress-bar.visible { display: flex; }
.tts-prog-row { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.tts-prog-fill-track { height: 4px; background: #1e2d45; border-radius: 4px; overflow: hidden; }
.tts-prog-fill { height: 100%; background: linear-gradient(90deg,#10b981,#34d399); border-radius: 4px; transition: width 0.4s ease; }

.mfa-progress-bar {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(139,92,246,0.07);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  color: #c4b5fd;
  margin-top: 0.5rem;
  font-family: monospace;
}
.mfa-progress-bar.visible { display: flex; }
.mfa-prog-row { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.mfa-prog-fill-track { height: 4px; background: #1e2d45; border-radius: 4px; overflow: hidden; }
.mfa-prog-fill { height: 100%; background: linear-gradient(90deg,#7c3aed,#a78bfa); border-radius: 4px; transition: width 0.6s ease; }
.mfa-stat { display: flex; flex-direction: column; gap: 0.05rem; }
.mfa-stat-label { font-size: 0.62rem; color: #546180; text-transform: uppercase; letter-spacing: 0.05em; }
.mfa-stat-value { color: #a78bfa; font-weight: 700; font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.encode-stats-bar {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  color: #a5b4fc;
  margin-top: 0.5rem;
  font-family: monospace;
}
.encode-stats-bar.visible { display: flex; }
.encode-stats-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.encode-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.encode-stat-label { font-size: 0.65rem; color: #546180; text-transform: uppercase; letter-spacing: 0.05em; }
.encode-stat-value { color: #818cf8; font-weight: 600; }
.encode-time-bar { height: 3px; background: #1e2d45; border-radius: 3px; overflow: hidden; margin-top: 0.3rem; }
.encode-time-fill { height: 100%; background: linear-gradient(90deg,#4f46e5,#818cf8); border-radius: 3px; transition: width 0.5s ease; }

/* Pipeline approval bar */
.pipeline-approval-bar {
  display: none;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 20px;
  padding: 0.85rem 1.2rem;
  margin-top: 0.75rem;
}
.pipeline-approval-bar.visible { display: flex; }
.pipeline-approval-msg {
  font-size: 0.82rem;
  color: #6ee7b7;
  flex: 1;
  min-width: 160px;
}
.pipeline-approve-btn {
  background: linear-gradient(135deg,#10b981,#059669);
  border: none;
  color: white;
  padding: 0.55rem 1.4rem;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.pipeline-approve-btn:hover { opacity: 0.88; }
.pipeline-rerun-btn {
  background: transparent;
  border: 1px solid rgba(245,158,11,0.4);
  color: #fbbf24;
  padding: 0.5rem 1.1rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pipeline-rerun-btn:hover {
  background: rgba(245,158,11,0.1);
  border-color: #f59e0b;
}

/* ════════════════════════════════════════════════════════════════════════════
   EXAMPLES SECTION
   ════════════════════════════════════════════════════════════════════════════ */
.examples-section {
  max-width: 1200px;
  margin: 2rem auto 3rem;
  padding: 0 2rem;
  text-align: center;
}
.examples-heading {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}
.examples-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  justify-content: center;
}
.example-card {
  background: #0d1422;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid #1e2d45;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.example-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px #03050b, 0 0 0 2px #4f46e5;
}
.example-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  background: #070c16;
  overflow: hidden;
}
.example-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.example-card:hover .example-thumb img { opacity: 0.8; }
.example-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(99,102,241,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 0 20px rgba(99,102,241,0.5);
}
.example-card:hover .example-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}
.example-label {
  padding: 0.8rem 0.5rem;
  font-weight: 600;
  color: #b0c8e0;
  background: #0b1120;
  border-top: 1px solid #1e2d45;
  font-size: 0.9rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   HOW IT WORKS SECTION
   ════════════════════════════════════════════════════════════════════════════ */
.how-it-works {
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  text-align: center;
}
.how-it-works h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.step-card {
  background: #0d1422;
  border: 1px solid #1e2d45;
  border-radius: 28px;
  padding: 2rem 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -8px rgba(0,0,0,0.5);
}
.step-icon {
  width: 56px;
  height: 56px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-secondary);
  margin: 0 auto 1.2rem;
}
.step-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
}
.step-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════════════════════
   TOAST ANIMATIONS
   ════════════════════════════════════════════════════════════════════════════ */
@keyframes toastIn  { from { opacity:0; transform:translateX(14px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateX(14px); } }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .examples-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .step-wizard { padding: 0 1rem; }
  .step-content { padding: 1.5rem 1.2rem; border-radius: 28px; }
  .examples-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .steps-grid    { grid-template-columns: 1fr; }
  .examples-heading,
  .how-it-works h2 { font-size: 1.4rem; }
  .sub-mode-toggle { flex-direction: column; }
}
@media (max-width: 420px) {
  .examples-grid { grid-template-columns: 1fr; }
  .step-indicators { gap: 1rem 1.5rem; }
}

/* =============================================================================
   STATUS BAR ADDITIONS — append to reddit.css
   These styles handle placement of the three pipeline status bars.
   ============================================================================= */

/* ── TTS bar: sits below the Generate Audio button ── */
#archxTtsBar {
    margin-top: 0.75rem;
}

/* ── Align bar: sits below the audio preview box ── */
#archxAlignBar {
    margin-top: 0.75rem;
}

/* ── Video bar: sits inside step 4 generate box ── */
#archxVideoBar {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

/* ── Queued state colour override ── */
#archxVideoBar.archx-status-queued .archx-bar-fill {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}
#archxVideoBar.archx-status-queued .archx-label { color: #fcd34d; }
#archxVideoBar.archx-status-queued .archx-stage { color: #fbbf24; }

/* ── Make the stat values selectable for debugging ── */
.archx-stat-val { user-select: text; }

/* ── Responsive: stack stats on very narrow screens ── */
@media (max-width: 400px) {
    .archx-stats-row { gap: 0.6rem; }
    .archx-stat-val  { font-size: 0.72rem; }
}

/* =============================================================================
   PIPELINE STATUS BARS v2.0
   Styles for archx-bar components created by pipeline-status.js
   ============================================================================= */

.archx-bar {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: 14px;
    padding: 0.9rem 1.15rem 0.85rem;
    margin: 0.75rem 0 0;
    font-family: 'Inter', ui-monospace, monospace;
    font-size: 0.78rem;
    line-height: 1.4;
}
.archx-bar.show { display: flex; animation: archxIn 0.25s ease; }

@keyframes archxIn { 
    from { opacity:0; transform:translateY(5px); } 
    to { opacity:1; transform:translateY(0); } 
}
@keyframes archxSweep { 
    from { transform:translateX(-100%); } 
    to { transform:translateX(350%); } 
}
@keyframes archxPulse { 
    0%,100% { opacity:.5; } 
    50% { opacity:1; } 
}

/* ── TTS — emerald ── */
.archx-bar-tts  { 
    background:rgba(16,185,129,.07); 
    border:1px solid rgba(16,185,129,.22); 
}
.archx-bar-tts  .archx-fill { 
    background:linear-gradient(90deg,#059669,#34d399); 
}
.archx-bar-tts  .archx-head { color:#a7f3d0; }
.archx-bar-tts  .archx-msg  { color:#6ee7b7; }
.archx-bar-tts  .archx-sv   { color:#34d399; }

/* ── Align — violet ── */
.archx-bar-align { 
    background:rgba(139,92,246,.07); 
    border:1px solid rgba(139,92,246,.22); 
}
.archx-bar-align .archx-fill { 
    background:linear-gradient(90deg,#6d28d9,#a78bfa); 
}
.archx-bar-align .archx-head { color:#ddd6fe; }
.archx-bar-align .archx-msg  { color:#c4b5fd; }
.archx-bar-align .archx-sv   { color:#a78bfa; }

/* ── Video — sky ── */
.archx-bar-video { 
    background:rgba(14,165,233,.07); 
    border:1px solid rgba(14,165,233,.22); 
}
.archx-bar-video .archx-fill { 
    background:linear-gradient(90deg,#0284c7,#38bdf8); 
}
.archx-bar-video .archx-head { color:#bae6fd; }
.archx-bar-video .archx-msg  { color:#7dd3fc; }
.archx-bar-video .archx-sv   { color:#38bdf8; }

/* ── Bar structure ── */
.archx-top  { 
    display:flex; 
    align-items:center; 
    gap:.55rem; 
    flex-wrap:wrap; 
}
.archx-head { 
    font-size:.7rem; 
    font-weight:800; 
    letter-spacing:.07em; 
    text-transform:uppercase; 
    flex-shrink:0; 
}
.archx-msg  { 
    flex:1; 
    font-size:.76rem; 
    font-weight:500; 
    overflow:hidden; 
    text-overflow:ellipsis; 
    white-space:nowrap; 
}
.archx-pct  { 
    font-weight:800; 
    font-variant-numeric:tabular-nums; 
    font-size:.84rem; 
    color:#e2e8f0; 
    flex-shrink:0; 
}

/* ── Progress track ── */
.archx-track { 
    width:100%; 
    height:5px; 
    background:rgba(255,255,255,.07); 
    border-radius:99px; 
    overflow:hidden; 
}
.archx-fill  { 
    height:100%; 
    border-radius:99px; 
    width:0%; 
    transition:width .6s cubic-bezier(.4,0,.2,1); 
    position:relative; 
    overflow:hidden; 
}
.archx-fill::after { 
    content:''; 
    position:absolute; 
    inset:0; 
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent); 
    animation:archxSweep 2.2s linear infinite; 
}
.archx-fill.indet { 
    width:100% !important; 
    transition:none; 
    animation:archxPulse 1.6s ease-in-out infinite; 
}
.archx-fill.indet::after { display:none; }

/* ── Stats grid ── */
.archx-stats { 
    display:flex; 
    gap:1.4rem; 
    flex-wrap:wrap; 
    margin-top:.05rem; 
}
.archx-stat  { 
    display:flex; 
    flex-direction:column; 
    gap:.03rem; 
    min-width:44px; 
}
.archx-sl    { 
    font-size:.58rem; 
    color:rgba(148,163,184,.55); 
    text-transform:uppercase; 
    letter-spacing:.06em; 
}
.archx-sv    { 
    font-weight:700; 
    font-size:.79rem; 
    font-variant-numeric:tabular-nums; 
}
.archx-note  { 
    font-size:.67rem; 
    font-style:italic; 
    color:rgba(167,139,250,.55); 
    margin-top:.1rem; 
}

/* ── Responsive ── */
@media (max-width: 400px) {
    .archx-stats { gap: 0.8rem; }
    .archx-sv    { font-size: 0.72rem; }
}