/* ==========================================================================
   Dubber — Audio Engineering & Dubbing Console Styles
   Design Archetype: Dev Tools / Audio Engineering Console (Refs: Linear, Cloudflare, Teenage Engineering)
   Neutral high-contrast zinc palette, Swiss typographic grid, zero neon slop.
   ========================================================================== */

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Neutral Zinc Palette */
  --bg-app: #09090b;
  --bg-surface: #18181b;
  --bg-surface-raised: #27272a;
  --bg-surface-hover: #3f3f46;
  --border-subtle: #27272a;
  --border-medium: #3f3f46;
  --border-focus: #71717a;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Functional Accents */
  --accent-action: #f4f4f5;
  --accent-action-fg: #09090b;
  --accent-action-hover: #e4e4e7;

  --status-idle: #71717a;
  --status-listening: #22c55e;
  --status-translating: #eab308;
  --status-dubbing: #3b82f6;
  --status-error: #ef4444;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode Overrides if user system prefers or toggles */
@media (prefers-color-scheme: light) {
  body.theme-light {
    --bg-app: #f4f4f5;
    --bg-surface: #ffffff;
    --bg-surface-raised: #f4f4f5;
    --bg-surface-hover: #e4e4e7;
    --border-subtle: #e4e4e7;
    --border-medium: #d4d4d8;
    --border-focus: #71717a;
    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --accent-action: #18181b;
    --accent-action-fg: #fafafa;
    --accent-action-hover: #27272a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* Accessible Keyboard Focus Rings */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   1. DRAGGABLE FLOATING PILL (Overlay Widget)
   ========================================================================== */
.floating-pill {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(24, 24, 27, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 6px 10px 6px 8px;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
  touch-action: none;
}

.floating-pill:hover {
  border-color: var(--border-focus);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.floating-pill.is-dragging {
  cursor: grabbing !important;
  opacity: 0.92;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  border-color: var(--text-secondary);
}

.pill-grip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: grab;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.pill-grip:hover {
  color: var(--text-primary);
}

/* Pill Action Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pill-btn-primary {
  background: var(--accent-action);
  color: var(--accent-action-fg);
}

.pill-btn-primary:hover {
  background: var(--accent-action-hover);
}

.pill-btn-primary.is-active {
  background: #dc2626;
  color: #ffffff;
  border-color: #ef4444;
}

.pill-btn-icon {
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
}

.pill-btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

/* Status Indicator */
.pill-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-idle);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.status-dot.status-listening {
  background-color: var(--status-listening);
  animation: pulse-dot 1.8s infinite;
}

.status-dot.status-translating {
  background-color: var(--status-translating);
  animation: pulse-dot 1s infinite;
}

.status-dot.status-dubbing {
  background-color: var(--status-dubbing);
  box-shadow: 0 0 6px var(--status-dubbing);
}

.status-dot.status-error {
  background-color: var(--status-error);
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Language Badge */
.pill-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-lang-badge:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

/* VU Meter in Pill */
.pill-vu-meter {
  width: 24px;
  height: 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.vu-bar {
  width: 100%;
  height: 0%;
  background: #22c55e;
  transition: height 60ms ease-out, background-color 100ms ease;
}

.vu-bar.hot {
  background: #eab308;
}

.vu-bar.clip {
  background: #ef4444;
}

/* Subtitle Ticker */
.pill-ticker {
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
  border-left: 1px solid var(--border-subtle);
}

.ticker-content {
  display: inline-block;
  animation: ticker-fade 250ms ease-out;
}

@keyframes ticker-fade {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   2. APP LAYOUT & MAIN WORKSPACE
   ========================================================================== */
.app-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

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

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

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

/* Studio Grid Layout */
.studio-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

/* Standard Card */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.monitor-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-pill {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface-raised);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.stat-pill strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Subtitle Stage Display */
.subtitle-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.subtitle-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.box-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.lang-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.lang-tag.lang-target {
  border-color: #3f3f46;
  color: #fafafa;
}

.transcript-display {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 48px;
}

.transcript-display.highlight-display {
  font-weight: 500;
  color: #fafafa;
}

.placeholder-text {
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* Visualizer Container */
.visualizer-container {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.visualizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

#audioVisualizerCanvas {
  width: 100%;
  height: 60px;
  display: block;
}

/* Test Bench / Media Bench */
.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.media-bench {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.testbench-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.sample-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sample-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 4px;
}

/* Transcript History Table */
.transcript-card {
  margin-top: 4px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.transcript-log-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 320px;
}

.transcript-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.transcript-table th {
  background: var(--bg-surface-raised);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

.transcript-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.transcript-table tr:last-child td {
  border-bottom: none;
}

.transcript-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.col-time {
  width: 80px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.col-orig {
  width: 42%;
  color: var(--text-secondary);
}

.col-trans {
  width: 42%;
  color: var(--text-primary);
  font-weight: 500;
}

.col-action {
  width: 70px;
  text-align: right;
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
  font-style: italic;
}

/* ==========================================================================
   3. SETTINGS & CONFIGURATION DRAWER
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-medium);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

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

.drawer-title-wrap h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.section-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-raised);
}

/* Radio Cards */
.radio-card-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.radio-card:hover {
  border-color: var(--border-medium);
  background: rgba(255, 255, 255, 0.01);
}

.radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-action);
}

.radio-card:has(input[type="radio"]:checked) {
  border-color: var(--text-secondary);
  background: var(--bg-surface-raised);
}

.radio-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.radio-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.form-input, .form-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--bg-app);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  outline: none;
}

.form-select {
  cursor: pointer;
}

.input-with-btn {
  display: flex;
  gap: 6px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-action);
  width: 15px;
  height: 15px;
}

/* Sliders */
.slider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.slider-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
}

.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-medium);
  border-radius: 2px;
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-action);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ==========================================================================
   4. BUTTONS & UTILITIES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-action);
  color: var(--accent-action-fg);
}

.btn-primary:hover {
  background: var(--accent-action-hover);
}

.btn-secondary {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface-raised);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: var(--text-primary);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.btn-icon {
  width: 36px;
  padding: 0;
}

.badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-muted {
  background: var(--bg-surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.hidden { display: none !important; }

/* ==========================================================================
   5. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-medium);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms ease-out forwards;
  max-width: 360px;
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast.toast-success {
  border-color: rgba(34, 197, 94, 0.4);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS (Mobile-First Polish)
   ========================================================================== */
@media (max-width: 640px) {
  body {
    padding-bottom: 96px;
  }

  .brand-sub {
    display: none !important;
  }

  .app-header {
    padding: 8px 12px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .brand h1 {
    font-size: 15px !important;
  }

  .floating-pill {
    top: auto !important;
    bottom: 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    box-sizing: border-box !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    border-radius: var(--radius-full) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75) !important;
  }

  /* Hide bulky desktop drag grip & meters on mobile */
  .pill-grip {
    display: none !important;
  }

  .pill-vu-meter {
    display: none !important;
  }

  /* On mobile, keep only the LED dot to save horizontal space */
  .pill-status .status-text {
    display: none !important;
  }

  .pill-status {
    padding: 0 2px !important;
    flex-shrink: 0 !important;
  }

  .pill-btn-primary {
    height: 34px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }

  .pill-lang-badge {
    padding: 3px 6px !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
  }

  .pill-ticker {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 3px 6px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: var(--radius-sm) !important;
    border-left: none !important;
  }

  .pill-ticker .ticker-content {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
    max-width: 100% !important;
  }

  #openDrawerBtn {
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
  }

  .drawer {
    width: 100vw;
  }

  .grid-2col, .slider-grid {
    grid-template-columns: 1fr;
  }
}

