/* === Media Generation Panel === */

.media-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1099;
  backdrop-filter: blur(2px);
  transition: opacity 0.2s;
}
.media-backdrop.open { display: block; }

.media-panel {
  position: fixed;
  top: 0; right: -480px;
  width: 460px; height: 100vh;
  background: var(--bg-secondary, #161b22);
  border-left: 1px solid var(--border, #30363d);
  z-index: 1100;
  display: flex; flex-direction: column;
  transition: right 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.media-panel.open { right: 0; }

/* Header */
.media-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border, #30363d);
  flex-shrink: 0;
}
.media-panel-title {
  font-weight: 700; font-size: 0.95rem;
  color: var(--color-text-bright, #e6edf3);
  letter-spacing: 0.01em;
}
.media-panel-close {
  background: none; border: none;
  color: var(--color-text-muted, #8b949e);
  font-size: 1rem; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.media-panel-close:hover { color: var(--color-text, #e6edf3); background: rgba(255,255,255,0.07); }

/* Type toggle */
.media-type-toggle {
  display: flex; gap: 6px;
  padding: 10px 16px 8px;
  flex-shrink: 0;
}
.media-type-btn {
  flex: 1; padding: 6px 0;
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  color: var(--color-text-muted, #8b949e);
  border-radius: 8px; cursor: pointer;
  font-size: 0.82rem; font-weight: 500;
  transition: all 0.15s;
}
.media-type-btn.active {
  background: var(--accent, #58a6ff);
  border-color: var(--accent, #58a6ff);
  color: #fff;
}

/* Scrollable content area */
.media-panel > *:not(.media-panel-header):not(.media-type-toggle):not(.media-generate-btn) {
  padding: 0 16px;
}
.media-panel {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Prompt */
.media-prompt-area { padding: 0 16px 8px; flex-shrink: 0; }
.media-prompt {
  width: 100%; box-sizing: border-box;
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 10px 12px;
  color: var(--color-text, #e6edf3);
  font-size: 0.85rem; font-family: inherit;
  resize: vertical; min-height: 70px;
  transition: border-color 0.15s;
}
.media-prompt:focus {
  outline: none;
  border-color: var(--accent, #58a6ff);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.12);
}
.media-prompt-hint {
  font-size: 0.71rem; color: var(--color-text-muted, #8b949e);
  margin-top: 5px; min-height: 18px;
  line-height: 1.4;
}
.hint-label { color: var(--accent, #58a6ff); font-weight: 600; }

/* Section label */
.media-section-label {
  font-size: 0.69rem; font-weight: 600;
  color: var(--color-text-muted, #8b949e);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 6px; padding: 0 16px;
}
.media-opt-hint { text-transform: none; font-weight: 400; letter-spacing: 0; opacity: 0.8; }

/* Reference image upload zone */
.media-ref-section { padding: 4px 0 10px; }
.media-ref-drop {
  margin: 0 16px;
  border: 1.5px dashed var(--border-color, #30363d);
  border-radius: 8px;
  background: var(--bg-tertiary, #21262d);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 72px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.media-ref-drop:hover, .media-ref-drop:focus { border-color: var(--accent, #58a6ff); outline: none; }
.media-ref-drop.drag-over {
  border-color: var(--accent, #58a6ff);
  background: rgba(88,166,255,0.08);
}
.media-ref-drop.has-image { border-style: solid; border-color: var(--accent, #58a6ff); }
.media-ref-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 12px; text-align: center;
  font-size: 0.74rem; color: var(--color-text-muted, #8b949e);
  pointer-events: none;
}
.media-ref-icon { font-size: 1.4rem; line-height: 1; }
.media-ref-preview {
  width: 100%; position: relative;
}
.media-ref-thumb {
  width: 100%; max-height: 160px;
  object-fit: contain; display: block;
  border-radius: 6px;
}
.media-ref-remove {
  position: absolute; top: 5px; right: 5px;
  background: rgba(13,17,23,0.75); border: none;
  color: #e6edf3; border-radius: 50%;
  width: 22px; height: 22px; font-size: 0.75rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.media-ref-remove:hover { background: var(--color-error, #f85149); }

/* Model grid */
.media-model-section { padding: 4px 0 8px; }
.media-model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px; padding: 0 16px;
}
.media-model-card {
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 8px 6px;
  cursor: pointer; text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  transition: all 0.15s;
  font-size: 0.75rem; color: var(--color-text-muted, #8b949e);
}
.media-model-card:hover:not([disabled]) {
  border-color: rgba(88,166,255,0.4);
  background: rgba(88,166,255,0.06);
  color: var(--color-text, #e6edf3);
}
.media-model-card.selected {
  border-color: var(--accent, #58a6ff);
  background: rgba(88,166,255,0.12);
  color: var(--color-text-bright, #fff);
  box-shadow: 0 0 0 1px rgba(88,166,255,0.3);
}
.media-model-card.unavailable { opacity: 0.45; cursor: not-allowed; }
.mmc-icon { font-size: 1.1rem; }
.mmc-name { font-weight: 600; font-size: 0.72rem; line-height: 1.2; }
.mmc-desc { font-size: 0.65rem; color: var(--color-text-muted, #8b949e); }
.mmc-badges { display: flex; gap: 3px; }
.mmc-badge { font-size: 0.7rem; }
.mmc-key-needed {
  font-size: 0.6rem; color: var(--color-error, #f85149);
  background: rgba(248,81,73,0.1); border-radius: 4px;
  padding: 1px 5px;
}
.mmc-avail-badge {
  font-size: 0.6rem; color: var(--color-success, #3fb950);
  background: rgba(63,185,80,0.1); border-radius: 4px;
  padding: 1px 5px; font-weight: 600;
}
.mmc-avail-badge.free {
  color: #f0c040; background: rgba(240,192,64,0.15);
}
.mmc-avail-badge.free-key {
  color: #58a6ff; background: rgba(88,166,255,0.15);
}
.mmc-avail-badge.credits {
  color: #d4a574; background: rgba(210,153,97,0.15);
}
.mmc-free-tag {
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.04em;
  color: #3fb950; background: rgba(63,185,80,0.18);
  border-radius: 3px; padding: 1px 4px; vertical-align: middle;
}
.mmc-section-label {
  grid-column: 1 / -1;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted, #8b949e);
  padding: 6px 2px 2px; border-top: 1px solid var(--border, #30363d);
  margin-top: 4px;
}
.mmc-section-label:first-child { border-top: none; margin-top: 0; }
.media-notice {
  grid-column: 1 / -1; font-size: 0.72rem; color: #c9a227;
  background: rgba(201,162,39,0.1); border: 1px solid rgba(201,162,39,0.25);
  border-radius: 6px; padding: 8px 10px; line-height: 1.4;
}
.media-loading { color: var(--color-text-muted); font-size: 0.8rem; padding: 12px; text-align: center; }
.media-error { color: var(--color-error, #f85149); }

/* Options */
.media-options { padding: 6px 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.media-option-row { display: flex; align-items: center; gap: 10px; }
.media-opt-label { font-size: 0.75rem; color: var(--color-text-muted); min-width: 70px; }
.media-opt-select {
  flex: 1; background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px; padding: 5px 8px;
  color: var(--color-text, #e6edf3); font-size: 0.8rem;
  cursor: pointer;
}
.media-opt-select:focus { outline: none; border-color: var(--accent, #58a6ff); }

/* Generate button */
.media-generate-btn {
  margin: 8px 16px 10px;
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--accent, #58a6ff), #7c5cbf);
  border: none; border-radius: 10px;
  color: #fff; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: all 0.2s; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(88,166,255,0.25);
}
.media-generate-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(88,166,255,0.4);
}
.media-generate-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Progress */
.media-progress { padding: 0 16px 10px; }
.media-progress-bar {
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden; margin-bottom: 6px;
}
.media-progress-fill {
  height: 100%; background: var(--accent, #58a6ff);
  border-radius: 2px; transition: width 0.4s ease;
  width: 0%;
}
.media-progress-msg { font-size: 0.76rem; color: var(--color-text-muted); }

/* Result */
.media-result { padding: 0 16px 10px; }
.media-result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.media-result-model { font-size: 0.72rem; color: var(--color-text-muted); font-family: monospace; }
.media-result-dl-btn {
  background: #238636; border: 1px solid #2ea043; color: #fff;
  font-size: 0.75rem; font-weight: 600; padding: 5px 12px;
  border-radius: 6px; cursor: pointer; transition: background 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.media-result-dl-btn:hover { background: #2ea043; }

/* Refine section */
.media-refine-section {
  display: flex; gap: 8px; margin-top: 12px; align-items: flex-end;
}
.media-refine-input {
  flex: 1; background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 8px 10px;
  color: var(--color-text, #e6edf3);
  font-size: 0.8rem; font-family: inherit;
  resize: vertical; min-height: 40px;
  transition: border-color 0.15s;
}
.media-refine-input:focus {
  outline: none; border-color: var(--accent, #58a6ff);
  box-shadow: 0 0 0 2px rgba(88,166,255,0.12);
}
.media-refine-btn {
  background: linear-gradient(135deg, #7c5cbf, #58a6ff);
  border: none; border-radius: 8px;
  color: #fff; font-weight: 600; font-size: 0.8rem;
  padding: 8px 14px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
  flex-shrink: 0;
}
.media-refine-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 10px rgba(124,92,191,0.35); }
.media-result-media {
  width: 100%; border-radius: 10px;
  border: 1px solid var(--border, #30363d);
  display: block;
}
.media-result-prompt {
  margin-top: 6px; font-size: 0.73rem;
  color: var(--color-text-muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* History */
.media-history { padding: 6px 0 20px; }
.media-history-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 0 16px;
}
.media-hist-item {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  cursor: pointer; border: 1px solid var(--border, #30363d);
  transition: transform 0.15s, border-color 0.15s;
}
.media-hist-item:hover { transform: scale(1.03); border-color: var(--accent, #58a6ff); }
.media-hist-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Audio player */
.media-audio-player {
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.media-result-audio {
  width: 100%; height: 40px;
  accent-color: var(--accent, #58a6ff);
}
.media-audio-meta {
  font-size: 0.72rem; color: var(--color-text-muted, #8b949e);
  line-height: 1.4; text-align: center;
}

/* Audio history thumbnail */
.media-hist-audio {
  background: var(--bg-tertiary, #21262d);
  display: flex; align-items: center; justify-content: center;
}
.media-hist-audio-icon {
  font-size: 1.8rem; line-height: 1;
}

/* Open button (if injected into toolbar) */
.media-open-btn {
  background: none; border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 6px 10px;
  color: var(--color-text-muted); cursor: pointer;
  font-size: 1rem; transition: all 0.15s;
}
.media-open-btn:hover { border-color: var(--accent, #58a6ff); color: var(--accent, #58a6ff); }

/* ── Docs Tab ───────────────────────────────────────────────── */
.dt-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 6px; flex-shrink: 0;
}
.dt-select {
  flex: 1; background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px; padding: 5px 8px;
  color: var(--color-text); font-size: 0.8rem; cursor: pointer;
}
.dt-upload-btn {
  background: var(--color-brand, #1e6fd9);
  border: none; border-radius: 6px;
  color: #fff; font-size: 0.8rem; font-weight: 600;
  padding: 6px 12px; cursor: pointer;
  transition: background 0.15s; white-space: nowrap;
}
.dt-upload-btn:hover { background: var(--color-brand-hover, #1b5fc0); }
.dt-upload-zone {
  margin: 0 16px 10px;
  border: 1.5px dashed var(--border, #30363d);
  border-radius: 8px; padding: 22px 16px;
  text-align: center; cursor: pointer;
  color: var(--color-text-muted);
  transition: border-color 0.15s, background 0.15s;
}
.dt-upload-zone:hover, .dt-upload-zone.drag-over {
  border-color: var(--color-brand, #1e6fd9);
  background: rgba(30,111,217,0.05);
}
.dt-upload-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.dt-upload-text { font-size: 0.83rem; }
.dt-upload-hint { font-size: 0.72rem; opacity: 0.7; margin-top: 4px; }
.dt-uploading {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 0.82rem;
  color: var(--color-text-muted);
}
.dt-spin { animation: dt-pulse 1s ease-in-out infinite; }
@keyframes dt-pulse { 0%,100%{opacity:1}50%{opacity:0.3} }
.dt-doc-card {
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 12px 14px;
  margin: 0 16px 10px;
}
.dt-doc-title {
  font-weight: 600; font-size: 0.88rem;
  color: var(--color-text-bright);
}
.dt-doc-meta {
  font-size: 0.75rem; color: var(--color-text-muted); margin-top: 3px;
}
.dt-doc-actions {
  display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap;
}
.dt-btn {
  padding: 4px 10px; border-radius: 5px;
  border: 1px solid var(--border, #30363d);
  background: transparent; color: var(--color-text);
  font-size: 0.78rem; cursor: pointer; transition: all 0.15s;
}
.dt-btn:hover { background: var(--bg-secondary, #161b22); }
.dt-btn-primary {
  background: var(--color-brand, #1e6fd9);
  border-color: var(--color-brand, #1e6fd9); color: #fff;
}
.dt-btn-primary:hover { background: var(--color-brand-hover, #1b5fc0); }
.dt-btn-danger { color: var(--color-error, #f85149); border-color: var(--color-error, #f85149); }
.dt-btn-danger:hover { background: rgba(248,81,73,0.1); }
.dt-progress { margin: 10px 0; }
.dt-progress-bar {
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden; margin-bottom: 5px;
}
.dt-progress-fill {
  height: 100%; background: var(--color-brand, #1e6fd9);
  border-radius: 2px; transition: width 0.4s ease; width: 0%;
}
.dt-progress-label { font-size: 0.72rem; color: var(--color-text-muted); }
.dt-result {
  background: var(--color-base);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 12px 14px; margin-top: 10px;
  font-size: 0.84rem; line-height: 1.6;
  max-height: 320px; overflow-y: auto;
  white-space: pre-wrap;
}
.dt-error { color: var(--color-error, #f85149) !important; }
.dt-qa-bar {
  display: flex; gap: 8px; margin-top: 10px;
}
.dt-qa-bar input {
  flex: 1; padding: 7px 10px;
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px; color: var(--color-text);
  font-size: 0.83rem;
}
.dt-qa-bar input:focus {
  outline: none; border-color: var(--color-brand, #1e6fd9);
}

/* ── Podcast Config ─────────────────────────────────────────── */
.dt-podcast-config {
  margin: 0 0 10px;
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px; padding: 14px 16px;
}
.dt-podcast-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.dt-podcast-emoji { font-size: 1.6rem; line-height: 1; }
.dt-podcast-title {
  font-weight: 700; font-size: 0.9rem; color: var(--color-text-bright);
}
.dt-podcast-subtitle { font-size: 0.73rem; color: var(--color-text-muted); margin-top: 2px; }
.dt-podcast-speakers {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-secondary, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
}
.dt-speaker { display: flex; align-items: center; gap: 8px; flex: 1; }
.dt-speaker-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.dt-speaker-alex .dt-speaker-avatar { background: rgba(164,230,53,0.15); color: #a3e635; }
.dt-speaker-sam .dt-speaker-avatar { background: rgba(212,165,116,0.15); color: #d4a574; }
.dt-speaker-name { font-size: 0.83rem; font-weight: 600; color: var(--color-text-bright); }
.dt-speaker-role { font-size: 0.7rem; color: var(--color-text-muted); margin-top: 1px; }
.dt-speaker-vs { color: var(--color-text-muted); font-size: 1rem; flex-shrink: 0; }
.dt-podcast-opt-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.dt-podcast-opt-label { font-size: 0.75rem; color: var(--color-text-muted); min-width: 44px; }
.dt-podcast-length-btns { display: flex; gap: 5px; flex: 1; }
.dt-len-btn {
  flex: 1; padding: 6px 4px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border, #30363d);
  background: var(--bg-secondary, #161b22);
  color: var(--color-text-muted); font-size: 0.75rem; font-weight: 500;
  text-align: center; line-height: 1.4; transition: all 0.15s;
}
.dt-len-btn span { font-size: 0.62rem; opacity: 0.7; }
.dt-len-btn:hover { border-color: var(--color-brand, #1e6fd9); color: var(--color-text); }
.dt-len-btn.dt-len-active {
  border-color: var(--color-brand, #1e6fd9);
  background: rgba(30,111,217,0.12);
  color: var(--color-text-bright);
}
.dt-podcast-gen-btn {
  width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #1e6fd9, #7c5cbf);
  color: #fff; font-weight: 700; font-size: 0.88rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(30,111,217,0.3);
}
.dt-podcast-gen-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(30,111,217,0.45); }

/* ── Podcast Progress (mic waveform) ────────────────────────── */
.dt-podcast-progress {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 20px 0 10px;
}
.dt-mic-anim { display: flex; align-items: flex-end; gap: 4px; height: 32px; }
.dt-mic-bar {
  width: 5px; border-radius: 3px;
  background: linear-gradient(to top, #1e6fd9, #a3e635);
  animation: dtMicBounce 0.7s ease-in-out infinite alternate;
}
@keyframes dtMicBounce {
  0% { height: 6px; opacity: 0.4; }
  100% { height: 28px; opacity: 1; }
}
.dt-podcast-progress-label {
  font-size: 0.78rem; color: var(--color-text-muted);
}

/* ── Podcast Result / Transcript ────────────────────────────── */
.dt-podcast-result {
  border: 1px solid var(--border, #30363d);
  border-radius: 10px; overflow: hidden; margin-top: 6px;
}
.dt-podcast-result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-tertiary, #21262d);
  border-bottom: 1px solid var(--border, #30363d);
}
.dt-podcast-result-title { font-weight: 700; font-size: 0.85rem; color: var(--color-text-bright); }
.dt-podcast-result-actions { display: flex; gap: 6px; }
.dt-pcast-btn {
  padding: 4px 10px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--color-brand, #1e6fd9);
  background: rgba(30,111,217,0.12); color: var(--color-text);
  font-size: 0.75rem; font-weight: 600; transition: all 0.15s;
}
.dt-pcast-btn:hover { background: rgba(30,111,217,0.2); }
.dt-pcast-btn-secondary {
  border-color: var(--border, #30363d);
  background: transparent;
}
.dt-podcast-transcript {
  padding: 12px 14px; display: flex; flex-direction: column; gap: 12px;
  max-height: 380px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.dt-turn { display: flex; align-items: flex-start; gap: 9px; }
.dt-turn-sam { flex-direction: row-reverse; }
.dt-turn-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
}
.dt-turn-avatar-alex { background: rgba(164,230,53,0.15); color: #a3e635; }
.dt-turn-avatar-sam { background: rgba(212,165,116,0.15); color: #d4a574; }
.dt-turn-bubble { max-width: 82%; }
.dt-turn-sam .dt-turn-bubble { text-align: right; }
.dt-turn-name { font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 3px; opacity: 0.6; }
.dt-turn-alex .dt-turn-name { color: #a3e635; }
.dt-turn-sam .dt-turn-name { color: #d4a574; }
.dt-turn-text {
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px; padding: 8px 11px;
  font-size: 0.82rem; line-height: 1.55;
  color: var(--color-text);
}
.dt-turn-alex .dt-turn-text { border-top-left-radius: 3px; }
.dt-turn-sam .dt-turn-text { border-top-right-radius: 3px; }
.dt-turn-active .dt-turn-text {
  border-color: var(--color-brand, #1e6fd9);
  box-shadow: 0 0 0 2px rgba(30,111,217,0.15);
}

/* Docs tab light mode */
body.light-theme .dt-select,
body.light-theme .dt-upload-zone,
body.light-theme .dt-doc-card,
body.light-theme .dt-qa-bar input,
html.light-theme-init body .dt-select,
html.light-theme-init body .dt-upload-zone,
html.light-theme-init body .dt-doc-card,
html.light-theme-init body .dt-qa-bar input {
  background: #dde4ed; border-color: rgba(0,0,0,0.10);
}
body.light-theme .dt-progress-bar,
html.light-theme-init body .dt-progress-bar { background: rgba(0,0,0,0.08); }
body.light-theme .dt-result,
html.light-theme-init body .dt-result {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.10);
}
body.light-theme .dt-btn:hover,
html.light-theme-init body .dt-btn:hover { background: #c8d2df; }

/* Mobile */
@media (max-width: 520px) {
  .media-panel { width: 100%; right: -100%; }
  .media-model-grid { grid-template-columns: repeat(2, 1fr); }
  .media-history-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Light theme overrides ──────────────────────────────────── */
body.light-theme .media-panel,
html.light-theme-init body .media-panel {
  background: #ffffff;
  border-left-color: rgba(0,0,0,0.10);
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}
body.light-theme .media-panel-header,
html.light-theme-init body .media-panel-header {
  border-bottom-color: rgba(0,0,0,0.10);
}
body.light-theme .media-panel-close:hover,
html.light-theme-init body .media-panel-close:hover {
  background: rgba(0,0,0,0.06);
}
body.light-theme .media-type-btn,
html.light-theme-init body .media-type-btn {
  background: #dde4ed;
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .media-type-btn.active,
html.light-theme-init body .media-type-btn.active {
  background: #1a5ec7;
  border-color: #1a5ec7;
}
body.light-theme .media-prompt,
body.light-theme .media-refine-input,
body.light-theme .media-opt-select,
html.light-theme-init body .media-prompt,
html.light-theme-init body .media-refine-input,
html.light-theme-init body .media-opt-select {
  background: #dde4ed;
  border-color: rgba(0,0,0,0.10);
  color: #1a2636;
}
body.light-theme .media-prompt:focus,
body.light-theme .media-refine-input:focus,
body.light-theme .media-opt-select:focus,
html.light-theme-init body .media-prompt:focus,
html.light-theme-init body .media-refine-input:focus,
html.light-theme-init body .media-opt-select:focus {
  border-color: #1a5ec7;
  box-shadow: 0 0 0 3px rgba(26,94,199,0.12);
}
body.light-theme .hint-label,
html.light-theme-init body .hint-label {
  color: #1a5ec7;
}
body.light-theme .media-ref-drop,
html.light-theme-init body .media-ref-drop {
  background: #dde4ed;
  border-color: rgba(0,0,0,0.18);
}
body.light-theme .media-ref-drop:hover,
html.light-theme-init body .media-ref-drop:hover { border-color: #1a5ec7; }
body.light-theme .media-model-card,
html.light-theme-init body .media-model-card {
  background: #dde4ed;
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .media-model-card:hover:not([disabled]),
html.light-theme-init body .media-model-card:hover:not([disabled]) {
  border-color: rgba(26,94,199,0.4);
  background: rgba(26,94,199,0.06);
}
body.light-theme .media-model-card.selected,
html.light-theme-init body .media-model-card.selected {
  border-color: #1a5ec7;
  background: rgba(26,94,199,0.10);
  box-shadow: 0 0 0 1px rgba(26,94,199,0.3);
}
body.light-theme .mmc-section-label,
html.light-theme-init body .mmc-section-label {
  border-top-color: rgba(0,0,0,0.10);
}
body.light-theme .media-generate-btn,
html.light-theme-init body .media-generate-btn {
  background: linear-gradient(135deg, #1a5ec7, #7c5cbf);
  box-shadow: 0 2px 12px rgba(26,94,199,0.25);
}
body.light-theme .media-generate-btn:hover:not([disabled]),
html.light-theme-init body .media-generate-btn:hover:not([disabled]) {
  box-shadow: 0 4px 20px rgba(26,94,199,0.4);
}
body.light-theme .media-progress-bar,
html.light-theme-init body .media-progress-bar {
  background: rgba(0,0,0,0.08);
}
body.light-theme .media-progress-fill,
html.light-theme-init body .media-progress-fill {
  background: #1a5ec7;
}
body.light-theme .media-result-media,
html.light-theme-init body .media-result-media {
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .media-hist-item,
html.light-theme-init body .media-hist-item {
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .media-hist-item:hover,
html.light-theme-init body .media-hist-item:hover { border-color: #1a5ec7; }
body.light-theme .media-audio-player,
html.light-theme-init body .media-audio-player {
  background: #dde4ed;
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .media-result-audio,
html.light-theme-init body .media-result-audio {
  accent-color: #1a5ec7;
}
body.light-theme .media-hist-audio,
html.light-theme-init body .media-hist-audio {
  background: #dde4ed;
}
body.light-theme .media-open-btn,
html.light-theme-init body .media-open-btn {
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .media-open-btn:hover,
html.light-theme-init body .media-open-btn:hover {
  border-color: #1a5ec7;
  color: #1a5ec7;
}
