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

/* Environment banners — CSS-driven, no JS conditionals.
   JS sets data-env and data-env-label on <body> from /api/status.
   Production has empty label so no banner appears. */
body[data-env-label]::before {
  content: attr(data-env-label);
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 2px 0;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.1em;
  z-index: 99999;
  pointer-events: none;
}

/* Hide banner when label is empty (production) */
body[data-env-label=""]::before { display: none; }

body[data-env="dev"]::before        { background: #f59e0b; color: #000; }
body[data-env="staging"]::before    { background: #3b82f6; color: #fff; }
body[data-env="ui_testing"]::before { background: #ef4444; color: #fff; }
body[data-env="test"]::before       { background: #ef4444; color: #fff; }

/* Push content down when banner is visible */
body[data-env="dev"] nav,
body[data-env="staging"] nav,
body[data-env="ui_testing"] nav,
body[data-env="test"] nav { margin-top: 20px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: #16213e;
  border-bottom: 1px solid #333;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e94560;
  text-decoration: none;
}

nav a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover { color: #fff; }

.nav-version {
  margin-left: auto;
  font-size: 0.7rem;
  color: #555;
  font-family: monospace;
}

#content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: 120px; /* FR 1.5: Prevent player bar from covering content */
}

h2 {
  font-size: 1.5rem;
  color: #e94560;
  margin-bottom: 1rem;
}

.subtitle { color: #888; margin-bottom: 1.5rem; }
.hint { color: #666; font-size: 0.85rem; }
.loading { color: #888; font-style: italic; }
.error { color: #e94560; }
.empty { text-align: center; padding: 4rem 0; }
.empty h2 { color: #666; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 600px; }
.form > label { color: #aaa; font-size: 0.9rem; margin-top: 0.5rem; }
.form input, .form textarea, .form select {
  background: #0f3460;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

.form textarea { resize: vertical; }
.radio-group { display: flex; gap: 1rem; }
.sample-prompts { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: -0.25rem; }
.sample-prompt-btn { text-align: left; white-space: normal; max-width: 100%; }
.radio-group label { color: #ccc; cursor: pointer; }

/* Form two-column layout */
.form-row { display: flex; gap: 1.5rem; margin-top: 0.25rem; }
.form-col { flex: 1; min-width: 0; }
.form-col > label { display: block; color: #aaa; font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Format picker — card-style radio buttons */
.format-picker { display: flex; flex-direction: column; gap: 0.35rem; }
.format-option { display: block; cursor: pointer; }
.format-option input[type="radio"] { display: none; }
.format-card {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #16213e;
  transition: all 0.15s;
}
.format-option input:checked + .format-card {
  border-color: #e94560;
  background: #1a2744;
}
.format-name { display: block; color: #e0e0e0; font-size: 0.85rem; font-weight: 500; }
.format-desc { display: block; color: #666; font-size: 0.75rem; margin-top: 0.1rem; }
.format-option input:checked + .format-card .format-desc { color: #888; }

/* Length picker — pill-style radio buttons */
.length-picker { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.length-option { cursor: pointer; }
.length-option input[type="radio"] { display: none; }
.length-option span {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #16213e;
  color: #aaa;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.length-option input:checked + span {
  border-color: #e94560;
  background: #1a2744;
  color: #e0e0e0;
}

/* Nonfiction toggle */
.nf-toggle { color: #aaa; font-size: 0.85rem; cursor: pointer; }
.nf-toggle input { margin-right: 0.4rem; }

/* Generate button */
.generate-btn { width: 100%; padding: 0.75rem; font-size: 1rem; margin-top: 0.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid #333;
  border-radius: 4px;
  background: #16213e;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover { background: #1a2744; border-color: #555; }
.btn.primary { background: #e94560; color: #fff; border-color: #e94560; }
.btn.primary:hover { background: #c13550; }
.btn.small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn.danger { color: #e94560; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.2rem;
}

/* Book list */
.book-list { display: flex; flex-direction: column; gap: 0.75rem; }
.book-card {
  background: #16213e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem;
  margin-left: 30px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.book-card:hover { border-color: #555; }
.book-card.ready { border-left: 3px solid #4caf50; }
.book-card.failed { border-left: 3px solid #e94560; }
.book-card.progress { border-left: 3px solid #ffc107; }
.book-title { font-weight: 600; margin-bottom: 0.5rem; }
.book-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: #888; }
.status-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.status-badge.ready { background: #1b3a1b; color: #4caf50; }
.status-badge.failed { background: #3a1b1b; color: #e94560; }
.status-badge.progress { background: #3a3a1b; color: #ffc107; }

/* Character form */
#char-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.char-form-card {
  background: #16213e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.char-form-row { display: flex; gap: 0.5rem; }
.char-form-row .cf-name { flex: 1; text-transform: uppercase; font-weight: 600; }
.char-form-row .cf-voice { width: 5.5rem; }
.char-form-card input, .char-form-card select {
  background: #0f3460;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.char-remove {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.char-remove:hover { color: #e94560; }

/* Progress */
.progress-page { max-width: 560px; }
.prog-activity { margin-bottom: 1.2rem; color: #aaa; font-size: 0.95rem; min-height: 1.2em; }
.prog-elapsed { margin-top: 1rem; color: #555; font-size: 0.85rem; }

.phase-list { display: flex; flex-direction: column; gap: 0; }
.phase-row {
  display: grid;
  grid-template-columns: 12px 90px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #1a1a2e;
}
.phase-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #333;
  transition: background 0.3s;
}
.phase-label { font-size: 0.85rem; font-weight: 600; color: #555; }
.phase-desc  { font-size: 0.8rem; color: #444; }
.phase-counter { font-size: 0.8rem; color: #888; white-space: nowrap; }

.phase-done .phase-dot   { background: #2ecc71; }
.phase-done .phase-label { color: #2ecc71; }
.phase-done .phase-desc  { color: #555; }

.phase-active .phase-dot   { background: #e94560; box-shadow: 0 0 6px #e94560; animation: pulse-dot 1.2s infinite; }
.phase-active .phase-label { color: #e94560; }
.phase-active .phase-desc  { color: #ccc; }
.phase-active .phase-counter { color: #e94560; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Chapter list */
.chapter-list { margin-bottom: 2rem; }
.chapter-item {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #222;
  cursor: pointer;
  align-items: center;
}

.chapter-item:hover { background: #16213e; }
.chapter-item.active { background: #1a2744; border-left: 3px solid #e94560; }
.ch-num { color: #666; font-size: 0.85rem; min-width: 1.5rem; }
.ch-title { flex: 1; }
.ch-dur { color: #666; font-size: 0.85rem; }
.chapter-item.pending { opacity: 0.5; pointer-events: none; cursor: default; }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Prompt block */
.prompt-block {
  background: #0f3460;
  border-left: 3px solid #e94560;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0 4px 4px 0;
  color: #ccc;
  font-style: italic;
  line-height: 1.5;
}

/* Metadata */
.metadata-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1rem;
  background: #16213e;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.meta-cell { display: flex; flex-direction: column; min-width: 6rem; }
.meta-label { color: #666; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { color: #ccc; font-size: 0.9rem; font-weight: 500; }

.llm-calls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}
.llm-calls-table th {
  text-align: left;
  color: #666;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid #333;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.llm-calls-table td {
  padding: 0.3rem 0.6rem;
  color: #aaa;
  border-bottom: 1px solid #1a1a2e;
  font-family: "Courier New", monospace;
}
.llm-calls-table tr:hover td { background: #1a2744; }

/* Screenplay */
.screenplay {
  margin-top: 0.5rem;
  padding: 1.5rem;
  background: #0f0f1a;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.section-heading {
  color: #aaa;
  font-size: 1rem;
  margin-top: 2rem;
  margin-bottom: 0;
}

.type-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  background: #1b2a3a;
  color: #4fc3f7;
}

.scene-heading {
  color: #e94560;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  text-transform: uppercase;
}

.scene-heading:first-child { margin-top: 0; }
.scene-line { margin-bottom: 0.5rem; padding-left: 2rem; }
.char-name { color: #4fc3f7; font-weight: 600; }
.paren { color: #888; font-style: italic; }
.line-text { color: #ccc; }

/* Player bar */
#player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #16213e;
  border-top: 1px solid #333;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 100;
}

.player-info { flex: 1; min-width: 0; }
#player-title { color: #ccc; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-picker-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0.1rem 0;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}
.chapter-picker-btn:hover #player-chapter { color: #4fc3f7; }
#player-chapter { color: #888; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-picker-arrow { color: #555; font-size: 0.65rem; flex-shrink: 0; }
.chapter-picker-btn:hover .chapter-picker-arrow { color: #4fc3f7; }

/* Chapter drawer */
#chapter-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: #0f1a30;
  border-top: 1px solid #2a3a5c;
  max-height: 60vh;
  overflow-y: auto;
}
.chapter-drawer-list { padding: 0.25rem 0; }
.drawer-ch-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 2rem;
  cursor: pointer;
  transition: background 0.1s;
}
.drawer-ch-row:hover { background: rgba(79,195,247,0.08); }
.drawer-ch-row.drawer-ch-active { background: rgba(79,195,247,0.12); }
.drawer-ch-row.pending { cursor: default; opacity: 0.5; }
.drawer-ch-icon {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  font-size: 0.75rem;
  color: #4fc3f7;
}
.drawer-ch-icon.done { color: #4caf50; }
.drawer-ch-icon.empty { display: inline-block; }
.drawer-ch-num {
  flex-shrink: 0;
  width: 1.8rem;
  color: #666;
  font-size: 0.8rem;
  text-align: right;
}
.drawer-ch-title {
  flex: 1;
  color: #ccc;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-ch-active .drawer-ch-title { color: #4fc3f7; font-weight: 600; }
.drawer-ch-rendering { color: #555; font-style: italic; }
.drawer-ch-dur {
  flex-shrink: 0;
  color: #666;
  font-size: 0.8rem;
  white-space: nowrap;
}

.player-controls { display: flex; align-items: center; gap: 0.5rem; }
.player-controls button {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.player-controls button:hover { background: #1a2744; }
.player-controls .skip-btn { font-size: 0.8rem; padding: 0.4rem 0.55rem; color: #aaa; border-color: #444; }
.player-controls select {
  background: #0f3460;
  border: 1px solid #333;
  color: #ccc;
  padding: 0.3rem;
  border-radius: 3px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #16213e;
  border-radius: 6px;
}

.filter-select {
  background: #0f3460;
  border: 1px solid #333;
  color: #ccc;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-select:hover { border-color: #555; }
.filter-active { border-color: #4fc3f7; background: #133060; }

.filter-search {
  background: #0f3460;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 10rem;
}

.filter-search:focus { border-color: #4fc3f7; outline: none; }

.filter-clear {
  color: #e94560;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.filter-clear:hover { color: #ff6b7f; }
.filter-spacer { flex: 1; }
.sort-select { margin-left: auto; }

/* Rich cards */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.card-duration { color: #888; font-size: 0.85rem; white-space: nowrap; margin-left: 12px; }

.card-prompt {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.4rem;
}

.card-meta span::after { content: "\00b7"; margin-left: 0.5rem; color: #555; }
.card-meta span:last-child::after { content: ""; margin-left: 0; }

.card-error {
  color: #e94560;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-banner {
  background: #3a1b1b;
  border: 1px solid #e94560;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #e94560;
  font-size: 0.9rem;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: #666;
}

.card-model { color: #4fc3f7; }
.card-hw { color: #888; }
.card-date { color: #777; }
.card-grade {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}
.grade-excellent { background: #1b3a1b; color: #4caf50; }
.grade-good { background: #2a3a1b; color: #8bc34a; }
.grade-acceptable { background: #3a3a1b; color: #ffc107; }
.grade-needs-work { background: #3a2a1b; color: #ff9800; }
.grade-failing { background: #3a1b1b; color: #e94560; }

/* Content Rating Badge */
.card-rating {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}
.rating-g { background: #1b3a1b; color: #4caf50; }
.rating-pg { background: #2a3a1b; color: #8bc34a; }
.rating-pg13 { background: #3a3a1b; color: #ffc107; }
.rating-r { background: #3a1b1b; color: #e94560; }

/* Content Rating Panel */
.content-tags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin: 0.5rem 0;
}
.content-tag {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0.4rem;
  background: #1a1a2e;
  border-radius: 3px;
  font-size: 0.8rem;
  text-transform: capitalize;
}
.severity-mild { color: #8bc34a; }
.severity-moderate { color: #ffc107; }
.severity-strong { color: #ff9800; }
.severity-graphic { color: #e94560; }

/* Quality Score Panel */
.quality-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: #1a1a2e;
  border-radius: 4px;
}
.quality-check { display: flex; justify-content: space-between; padding: 0.15rem 0.25rem; }
.quality-notes { font-style: italic; color: #aaa; margin-top: 0.5rem; }
.quality-meta { font-size: 0.8rem; color: #666; margin-top: 0.25rem; }

.card-audio-grade {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  border-left: 2px solid;
}
.audio-excellent { background: #1b3a1b; color: #4caf50; border-left-color: #4caf50; }
.audio-good { background: #2a3a1b; color: #8bc34a; border-left-color: #8bc34a; }
.audio-acceptable { background: #3a3a1b; color: #ffc107; border-left-color: #ffc107; }
.audio-needs-work { background: #3a2a1b; color: #ff9800; border-left-color: #ff9800; }
.audio-failing { background: #3a1b1b; color: #e94560; border-left-color: #e94560; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.5rem;
  padding: 0.75rem;
}

.page-num {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9rem;
}

.page-num:hover { background: #16213e; }
.page-num.active { background: #e94560; color: #fff; }
.page-ellipsis { color: #666; padding: 0.3rem; }
.page-info { color: #666; font-size: 0.8rem; margin-left: 1rem; }

/* Filtered empty state */
.empty-filtered {
  text-align: center;
  padding: 3rem 0;
  color: #888;
}

/* Queue page */
.queue-backends {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.backend-card {
  background: #16213e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 180px;
}

.backend-name { font-weight: 600; color: #4fc3f7; margin-bottom: 0.25rem; }
.backend-models { color: #888; font-size: 0.8rem; margin-bottom: 0.4rem; }
.backend-workers { color: #aaa; font-size: 0.85rem; margin-bottom: 0.4rem; }

.worker-dots { display: flex; gap: 4px; margin-bottom: 0.4rem; }
.worker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1b3a1b;
  border: 1px solid #333;
}
.worker-dot.busy { background: #e94560; border-color: #e94560; }
.worker-dot.idle { background: #1b3a1b; border-color: #4caf50; }

.backend-active { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.active-story {
  color: #ffc107;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

.queue-band-header {
  color: #aaa;
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

.queue-count { color: #666; font-weight: 400; }

.queue-list { display: flex; flex-direction: column; gap: 0.4rem; }

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #16213e;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
}

.queue-item.active { border-left: 3px solid #ffc107; }
.queue-item-info { display: flex; gap: 0.75rem; align-items: center; }
.queue-item-id { color: #4fc3f7; cursor: pointer; font-size: 0.85rem; }
.queue-item-id:hover { text-decoration: underline; }
.queue-item-model { color: #888; font-size: 0.8rem; }
.queue-item-backend { color: #ffc107; font-size: 0.8rem; }
.queue-item-age { color: #666; font-size: 0.8rem; }
.queue-item-actions { display: flex; gap: 0.3rem; }

.queue-empty { color: #666; padding: 2rem 0; text-align: center; }

/* QUEUED status */
.book-card.queued { border-left: 3px solid #4fc3f7; }
.status-badge.queued { background: #1b2a3a; color: #4fc3f7; }

/* Radio group wrap (for model selector with many options) */
.radio-group-wrap { flex-wrap: wrap; }

/* Prose content */
.prose-content {
  max-width: 700px;
  line-height: 1.7;
  margin-top: 0.5rem;
  padding: 1.5rem;
  background: #0f0f1a;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #ccc;
}

.prose-paragraph { margin-bottom: 1em; text-indent: 0; }
.chapter-title { margin: 2em 0 1em; font-style: italic; color: #e94560; font-size: 1.1rem; }
.chapter-title:first-child { margin-top: 0; }

.format-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  background: #2a1b3a;
  color: #bb86fc;
}

/* Nonfiction */
.nf-disclaimer { background: #2a1a0a; border-left: 3px solid #e9a545; padding: 0.75rem 1rem;
  margin-bottom: 1rem; border-radius: 4px; color: #cca; font-size: 0.85rem; }
.nf-block-quote { border-left: 3px solid #4fc3f7; padding-left: 1rem; margin: 1em 0;
  font-style: italic; color: #aaa; }
.nf-speaker { color: #4fc3f7; font-weight: 600; font-style: normal; }
/* Editor/Audio panel child styles (parent uses details.panel) */
.editor-stats { display: flex; gap: 1rem; margin: 0.5rem 0; color: #888; font-size: 0.8rem; }
.editor-summary { margin: 0.5rem 0; white-space: pre-wrap; color: #aaa; }
.editor-notes h4 { margin: 0.5rem 0 0.25rem; font-size: 0.85rem; color: #aaa; }
.editor-note { margin: 0.25rem 0; padding: 0.25rem 0.5rem; background: #12122a;
  border-radius: 3px; }
.note-fixed { color: #4caf50; font-size: 0.75rem; font-weight: 600; }
.note-unfixed { color: #ff9800; font-size: 0.75rem; font-weight: 600; }
.editor-diff { margin-top: 0.5rem; }
/* Audio quality check bars */
.aq-checks { margin: 0.5rem 0; }
.aq-check-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.2rem 0; }
.aq-check-label { color: #aaa; font-size: 0.8rem; min-width: 10rem; }
.aq-check-bar-wrap { flex: 1; background: #0f3460; border-radius: 3px; height: 8px; overflow: hidden; }
.aq-check-bar { height: 100%; border-radius: 3px; transition: width 0.3s; }
.aq-check-value { color: #ccc; font-size: 0.8rem; min-width: 2.5rem; text-align: right; font-family: "Courier New", monospace; }

.editor-diff summary { cursor: pointer; color: #888; font-size: 0.8rem; }
.editor-diff pre { background: #0d0d1a; padding: 0.5rem; border-radius: 3px;
  overflow-x: auto; font-size: 0.75rem; color: #999; max-height: 400px; overflow-y: auto; }

/* LLM expandable rows */
.llm-expandable { cursor: pointer; }
.llm-expandable:hover td { background: #1a2744; }
.llm-detail-row td { padding: 0.5rem 0.6rem !important; background: #0d0d1a; }
.llm-expand { margin: 0.3rem 0; }
.llm-expand summary { cursor: pointer; color: #888; font-size: 0.8rem; }
.llm-expand pre { background: #0a0a15; padding: 0.5rem; border-radius: 3px;
  overflow-x: auto; font-size: 0.75rem; color: #999; max-height: 300px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; }

/* Research facts */
.research-link { color: #4fc3f7; text-decoration: none; font-size: 0.8rem; }
.research-link:hover { text-decoration: underline; }

/* Chapter plans */
.chapter-plan { margin: 0.75rem 0; padding-bottom: 0.75rem; border-bottom: 1px solid #222; }
.chapter-plan:last-child { border-bottom: none; }
.chapter-plan-title { color: #e94560; font-size: 0.9rem; margin-bottom: 0.25rem; }
.chapter-plan-summary { color: #aaa; font-size: 0.85rem; margin-bottom: 0.4rem; }
.scene-plan { margin: 0.3rem 0 0.3rem 1rem; padding-left: 0.75rem;
  border-left: 2px solid #333; font-size: 0.85rem; color: #aaa; }
.scene-plan-chars { color: #4fc3f7; font-size: 0.8rem; }
.scene-plan-beat { color: #ffc107; font-size: 0.8rem; font-style: italic; }
.scene-plan-ends { color: #888; font-size: 0.8rem; }

/* Seek bar */
.player-seek-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}
#player-time-elapsed, #player-time-remaining {
  color: #888;
  font-size: 0.75rem;
  font-family: "Courier New", monospace;
  min-width: 3rem;
  text-align: center;
}
#player-seek {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e94560;
  cursor: pointer;
}
#player-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e94560;
  border: none;
  cursor: pointer;
}

/* Volume slider */
#player-volume {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e94560;
  cursor: pointer;
}
#player-volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e94560;
  border: none;
  cursor: pointer;
}

/* Unified collapsible panel (FR 3.7) */
details.panel {
  border: 1px solid #333;
  border-radius: 4px;
  margin: 0.75rem 0;
}
details.panel summary {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #ccc;
  list-style: none;
}
details.panel summary::marker { display: none; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::before {
  content: '\25B6'; margin-right: 8px; font-size: 0.7em;
  display: inline-block; transition: transform 0.2s;
}
details.panel[open] summary::before { transform: rotate(90deg); }
details.panel > :not(summary) { padding: 0.75rem 1rem; }

pre.world-context {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  font-size: 0.85em;
  line-height: 1.5;
}

/* Inline read-along highlight */
.ra-active {
  background: rgba(233,69,96,0.15);
  border-radius: 4px;
  transition: background 0.2s;
}
[data-scene][data-line] { cursor: pointer; transition: background 0.2s; }
[data-scene][data-line]:hover { background: rgba(255,255,255,0.04); }

/* Auto-scroll toggle */
.auto-scroll-toggle {
  color: #888;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

/* Welcome overlay */
#welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.welcome-card {
  background: #16213e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  color: #ccc;
  line-height: 1.7;
}
.welcome-card h1 { color: #e94560; margin-top: 0; margin-bottom: 1.5rem; }
.welcome-card h3 { color: #4fc3f7; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.welcome-card ul { padding-left: 1.2rem; }
.welcome-card li { margin-bottom: 0.5rem; }
.welcome-footer { margin-top: 2rem; text-align: center; }

/* Logline */
.logline { font-style: italic; color: #888; margin-top: -0.5rem; margin-bottom: 1rem; }
.card-logline {
  font-size: 0.82rem; color: #888; font-style: italic;
  margin-bottom: 0.3rem; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Cast table */
.cast-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cast-table th {
  text-align: left; color: #666; font-weight: 500; padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #333; text-transform: uppercase; font-size: 0.7rem;
}
.cast-table td {
  padding: 0.3rem 0.5rem; color: #aaa; border-bottom: 1px solid #1a1a2e;
}
.cast-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Detail row */
.detail-row { margin: 0.3rem 0; font-size: 0.9rem; color: #ccc; }

/* Timeline */
.timeline { list-style: none; padding-left: 0; margin: 0.5rem 0; }
.timeline li { margin: 0.3rem 0; font-size: 0.85rem; color: #aaa;
  padding-left: 1rem; border-left: 2px solid #333; }

/* Delete button */
.btn.danger { color: #e94560; border-color: #e94560; }
.btn.danger:hover { background: rgba(233,69,96,0.15); }

/* Stats card (queue page) */
.stats-card {
  background: #16213e; border: 1px solid #333; border-radius: 6px;
  padding: 1rem; margin-bottom: 1rem; font-size: 0.85rem; color: #aaa;
}
.stats-card .stat-row { display: flex; justify-content: space-between; margin: 0.2rem 0; }
.stats-card .stat-value { color: #ccc; font-weight: 500; font-family: "Courier New", monospace; }

/* Browse view — zippys */
.browse-group { margin-bottom: 0.5rem; }
.browse-subgroup { margin-left: 1.25rem; margin-bottom: 0.25rem; }

.zippy-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}
.zippy-header:hover { background: rgba(255,255,255,0.04); }
.zippy-header.sub { padding: 0.4rem 0.75rem; }

.zippy-arrow {
  font-size: 0.7rem;
  color: #888;
  min-width: 0.75rem;
  text-align: center;
  transition: color 0.2s;
}
.zippy-header:hover .zippy-arrow { color: #ccc; }

.zippy-label { font-weight: 600; color: #ccc; font-size: 0.95rem; }
.zippy-header.sub .zippy-label { font-weight: 500; font-size: 0.9rem; color: #aaa; }

.zippy-count {
  color: #666;
  font-size: 0.8rem;
  font-weight: 400;
}

.zippy-body { padding: 0 0 0.25rem 0; }
.zippy-body.collapsed { display: none; }
.zippy-body .book-list { padding: 0 0 0 0.25rem; }

/* Compact card for browse mode */
.book-card.compact {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.book-card.compact .book-title { margin-bottom: 0; font-size: 0.9rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #888;
}

/* View toggle */
.view-toggle {
  display: inline-flex;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}
.view-btn {
  padding: 0.3rem 0.7rem;
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.8rem;
  cursor: pointer;
}
.view-btn:hover { color: #ccc; background: rgba(255,255,255,0.04); }
.view-btn.active { background: #0f3460; color: #4fc3f7; cursor: default; }

.browse-total { color: #666; font-size: 0.8rem; margin-top: 0.75rem; text-align: right; }

/* Advanced options in gen form */
.advanced-options { margin: 0.25rem 0; border-top: 1px solid #222; padding-top: 0.5rem; }
.advanced-options summary { color: #666; font-size: 0.8rem; cursor: pointer; letter-spacing: 0.03em; }
.advanced-inner { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.75rem 0; }
.advanced-inner > label { color: #aaa; font-size: 0.85rem; margin-top: 0.25rem; }
.advanced-options .radio-group label { font-size: 0.85rem; }
.pipeline-toggles { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.pipeline-toggles label { color: #888; font-size: 0.8rem; cursor: pointer; }
.pipeline-toggles input[type="checkbox"] { margin-right: 0.3rem; }

/* Sleep Timer Button */
#sleep-timer-btn {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
#sleep-timer-btn:hover { background: #1a2744; }
#sleep-timer-btn.sleep-timer-active {
  border-color: #e94560;
  color: #e94560;
}
.sleep-badge {
  background: #e94560;
  color: #fff;
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
  line-height: 1.4;
}

/* Tablet */
@media (max-width: 768px) {
  .quality-checks { grid-template-columns: 1fr; }
  .metadata-grid { gap: 0.4rem 1rem; }
  .meta-cell { min-width: 5rem; }
  .queue-backends { flex-direction: column; }
  .backend-card { min-width: unset; }
}

/* Mobile */
@media (max-width: 600px) {
  #content { padding: 1rem; padding-bottom: 160px; }
  nav { gap: 0.75rem; padding: 0.75rem 1rem; font-size: 0.85rem; }
  nav .logo { font-size: 1.2rem; }
  .cast-grid { grid-template-columns: 1fr; }
  #player-bar { flex-direction: column; gap: 0.5rem; padding: 0.5rem 1rem; }
  .player-controls { flex-wrap: wrap; justify-content: center; }
  .player-seek-row { width: 100%; }
  #chapter-drawer { max-height: 60vh; }
  .drawer-ch-row { padding: 0.55rem 1rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-spacer { display: none; }
  .filter-search { width: 100%; }
  .sort-select { margin-left: 0; }
  .card-prompt { white-space: normal; }
  .card-logline { white-space: normal; }
  .radio-group { flex-wrap: wrap; gap: 0.5rem; }
  .form-row { flex-direction: column; gap: 0.75rem; }
  .form { max-width: 100%; }
  .welcome-card { padding: 1.5rem; }
  .cast-table, .llm-calls-table { display: block; overflow-x: auto; }
  .aq-check-label { min-width: 6rem; font-size: 0.75rem; }
  .metadata-grid { gap: 0.3rem 0.75rem; }
  .meta-cell { min-width: 4.5rem; }
  .prose-content { padding: 1rem; }
  .screenplay { padding: 1rem; }
  .browse-subgroup { margin-left: 0.5rem; }
  .book-card.compact { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .book-card.compact .book-title { white-space: normal; }
}

/* --- Offline / PWA --- */
.offline-badge {
  background: #e65100;
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.5rem;
}
.offline-count { color: #aaa; margin-bottom: 1rem; }
.dl-btn {
  background: #1a3a5c;
  border: 1px solid #2a6ab0;
  color: #8cc4ff;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: auto;
  white-space: nowrap;
}
.dl-btn:hover { background: #2a5a8c; border-color: #4a8ad0; color: #fff; }
.dl-btn:disabled { opacity: 0.5; cursor: default; }
.dl-btn.dl-done {
  border-color: #4caf50;
  color: #4caf50;
  cursor: default;
}
.view-link {
  text-decoration: none;
  font-size: 13px;
  opacity: 0.5;
  margin-left: 4px;
}
.view-link:hover { opacity: 1; }
.dl-badge {
  background: #2e7d32;
  color: white;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.dl-delete-btn {
  background: transparent;
  border: 1px solid #c62828;
  color: #c62828;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7rem;
  margin-left: auto;
}
.dl-delete-btn:hover { background: #c62828; color: white; }
body.offline nav a[onclick*="new"] { display: none; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #1a1a2e; border: 1px solid #333; border-radius: 8px; padding: 1.5rem; min-width: 320px; max-width: 400px; }
.modal-content h3 { margin: 0 0 1rem; }
.modal-content label { display: block; margin-bottom: 0.8rem; font-size: 0.9rem; color: #999; }
.modal-content input, .modal-content select { display: block; width: 100%; margin-top: 0.3rem; padding: 0.4rem; background: #111; border: 1px solid #444; border-radius: 4px; color: #eee; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.btn.danger { background: #c62828; }

/* Feedback panel */
.feedback-panel { padding: 1rem; border: 1px solid #333; border-radius: 4px; margin: 0.75rem 0; background: #16213e; }
.feedback-panel textarea { width: 100%; min-height: 60px; background: #1a1a2e; color: #e0e0e0; border: 1px solid #333; border-radius: 4px; padding: 0.5rem; font-family: inherit; font-size: 0.9rem; resize: vertical; margin-top: 0.3rem; }
.feedback-panel .chapter-row { border-bottom: 1px solid #222; }
.feedback-panel .chapter-row summary { cursor: pointer; color: #ccc; padding: 0.4rem 0; font-size: 0.9rem; }
.feedback-panel .chapter-row textarea { min-height: 40px; margin: 0.3rem 0 0.5rem; }

/* A/B/C Mix Test Page */
.abc-test-card { background: #16213e; border: 1px solid #333; border-radius: 8px; padding: 1rem; margin: 0.75rem 0; }
.abc-test-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.abc-status { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; }
.abc-status-pending { background: #555; color: #ccc; }
.abc-status-rendering { background: #e65100; color: #fff; }
.abc-status-ready { background: #2e7d32; color: #fff; }
.abc-status-done { background: #1565c0; color: #fff; }
.abc-status-failed { background: #c62828; color: #fff; }
.abc-notes { color: #999; font-size: 0.85rem; }
.abc-scene { color: #888; font-size: 0.85rem; margin-bottom: 0.75rem; }
.abc-scene code { background: #1a1a2e; padding: 2px 5px; border-radius: 3px; }
.abc-variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 0.75rem 0; }
.abc-variant { background: #1a1a2e; border: 1px solid #444; border-radius: 6px; padding: 0.75rem; text-align: center; }
.abc-variant.abc-chosen { border-color: #4caf50; box-shadow: 0 0 8px rgba(76, 175, 80, 0.3); }
.abc-variant-label { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; color: #fff; }
.abc-variant audio { width: 100%; margin: 0.5rem 0; }
.abc-reveal { font-size: 0.8rem; color: #aaa; margin-top: 0.5rem; padding: 4px 8px; background: #0a1929; border-radius: 4px; }
.abc-vote-btn { width: 100%; padding: 0.5rem; margin-top: 0.5rem; background: #1565c0; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.abc-vote-btn:hover { background: #1976d2; }
.abc-notes-input { margin: 0.5rem 0; }
.abc-notes-input input { background: #1a1a2e; color: #e0e0e0; border: 1px solid #444; border-radius: 4px; padding: 0.5rem; font-size: 0.85rem; }
.abc-votes-summary { color: #999; font-size: 0.85rem; margin-top: 0.5rem; }
.abc-pending { color: #888; font-style: italic; padding: 1rem; text-align: center; }
.abc-screenplay { margin: 0.5rem 0; }
.abc-screenplay summary { color: #888; font-size: 0.85rem; cursor: pointer; }
.abc-screenplay summary:hover { color: #ccc; }
.abc-screenplay pre { background: #0a1929; color: #c0c0c0; padding: 0.75rem; border-radius: 4px; font-size: 0.8rem; white-space: pre-wrap; margin-top: 0.5rem; max-height: 300px; overflow-y: auto; line-height: 1.5; }
.abc-variant.abc-selected { border-color: #ffc107; box-shadow: 0 0 10px rgba(255, 193, 7, 0.4); }
.abc-vote-btn.abc-btn-active { background: #ffc107; color: #000; }
.abc-confirm-bar { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; padding: 0.6rem 1rem; background: #0d2137; border: 1px solid #ffc107; border-radius: 6px; }
.abc-confirm-bar span { color: #e0e0e0; font-size: 0.9rem; }
.abc-confirm-btn { padding: 0.4rem 1.2rem; background: #2e7d32; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.abc-confirm-btn:hover { background: #388e3c; }
.abc-cancel-btn { padding: 0.4rem 1rem; background: #555; color: #ccc; border: none; border-radius: 4px; cursor: pointer; }
.abc-cancel-btn:hover { background: #666; }
.abc-meta-votes { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
.abc-meta-btn { padding: 0.4rem 1rem; background: #333; color: #aaa; border: 1px solid #555; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
.abc-meta-btn:hover { background: #444; color: #fff; }
@media (max-width: 700px) { .abc-variants { grid-template-columns: 1fr; } }

/* === Download dropdown === */
.download-wrapper {
  position: relative;
  display: inline-block;
}

.download-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: #16213e;
  border: 1px solid #444;
  border-radius: 6px;
  min-width: 270px;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.download-option {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #2a2a4a;
  min-height: 48px;
  justify-content: center;
  gap: 0.15rem;
  transition: background 0.15s;
}

.download-option:last-child { border-bottom: none; }
.download-option:hover { background: #1a2744; }

.dl-format-name {
  font-weight: 600;
  color: #e0e0e0;
  font-size: 0.88rem;
}

.dl-format-desc {
  color: #888;
  font-size: 0.76rem;
  line-height: 1.35;
}

.dl-format-size {
  color: #e94560;
  font-size: 0.76rem;
  margin-top: 0.1rem;
}

/* Download status area (below action buttons) */
.download-status-area {
  background: #16213e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.download-status-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  color: #ccc;
}

.download-progress-bar {
  height: 5px;
  background: #2a2a4a;
  border-radius: 3px;
  overflow: hidden;
}

.download-progress-fill {
  height: 100%;
  background: #e94560;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 4px;
}

/* === V2 sunset banner === */
.v2-banner {
  background: #1a3a5c; color: #e0e0e0; padding: 8px 16px;
  text-align: center; font-size: 14px; display: flex;
  align-items: center; justify-content: center; gap: 12px;
  margin-top: 20px;  /* Clear the fixed env banner on dev/staging */
}
.v2-banner a { color: #60a5fa; font-weight: bold; }
.v2-banner button {
  background: none; border: none; color: #aaa; font-size: 18px;
  cursor: pointer; margin-left: 4px; line-height: 1;
}
.v2-banner button:hover { color: #e0e0e0; }
