/* ═══════════════════════════════════════════════════════════════
   PRÉSENTATEUR LITURGIQUE — Styles
   Aesthetic: Sacred Manuscript · Illuminated Codex
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
  --bg-deep:        #0b0b11;
  --bg-surface:     #12121c;
  --bg-card:        #181826;
  --bg-hover:       #1f1f30;
  --bg-selected:    #1a1a2e;

  --gold:           #c8a84b;
  --gold-dim:       #9a7e38;
  --gold-glow:      rgba(200, 168, 75, 0.15);
  --gold-line:      rgba(200, 168, 75, 0.3);

  --text-primary:   #e8d5b0;
  --text-secondary: #a89870;
  --text-muted:     #6a5e45;
  --text-white:     #f5f0e8;

  --accent-red:     #9e3e3e;
  --accent-blue:    #2e4e7e;
  --success:        #4a8c5c;
  --warning:        #9e7a2e;

  --border:         rgba(200, 168, 75, 0.18);
  --border-hover:   rgba(200, 168, 75, 0.4);
  --shadow:         0 4px 24px rgba(0,0,0,0.6);
  --shadow-deep:    0 8px 48px rgba(0,0,0,0.8);

  --radius:         6px;
  --radius-lg:      12px;

  --font-display:   'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-body:      Georgia, 'Times New Roman', serif;
  --font-ui:        'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  --timeline-line-x: 2.8rem;
  --section-indent:  5rem;

  --transition:     0.2s ease;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(200,168,75,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(46,78,126,0.06) 0%, transparent 60%);
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─── HEADER ─── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,11,17,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 2rem 0.6rem;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-emblem {
  font-size: 2rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(200,168,75,0.5);
  flex-shrink: 0;
  animation: emblemPulse 4s ease-in-out infinite;
}

@keyframes emblemPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(200,168,75,0.4); }
  50%       { text-shadow: 0 0 36px rgba(200,168,75,0.8); }
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.header-meta { margin-left: auto; }

.header-tag {
  display: inline-block;
  background: var(--gold-glow);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.header-ornament {
  text-align: center;
  color: var(--gold-dim);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  padding: 0.4rem 0 0.2rem;
  opacity: 0.7;
}

/* ─── MAIN CONTAINER ─── */
.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ─── INSTRUCTIONS BAR ─── */
.instructions-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(46,78,126,0.15);
  border: 1px solid rgba(46,78,126,0.4);
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.instr-icon {
  color: var(--accent-blue);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.badge-opt {
  display: inline-block;
  background: rgba(158,122,46,0.2);
  border: 1px solid rgba(158,122,46,0.4);
  color: var(--warning);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  vertical-align: middle;
}

/* ─── PROGRESS BAR ─── */
.progress-bar-wrap {
  margin-bottom: 2rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.progress-track {
  height: 3px;
  background: rgba(200,168,75,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(200,168,75,0.4);
}

/* ─── TIMELINE WRAPPER ─── */
.timeline-wrapper {
  position: relative;
}

.timeline-line {
  position: absolute;
  left: var(--timeline-line-x);
  top: 1.5rem;
  bottom: 1.5rem;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--gold-line) 5%,
    var(--gold-line) 95%,
    transparent
  );
  pointer-events: none;
}

.timeline {
  list-style: none;
  position: relative;
}

/* ─── SECTION CARD ─── */
.section-item {
  position: relative;
  padding-left: var(--section-indent);
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateX(-12px);
  animation: slideIn 0.4s ease forwards;
}

@keyframes slideIn {
  to { opacity: 1; transform: translateX(0); }
}

/* Timeline node dot */
.section-item::before {
  content: '';
  position: absolute;
  left: calc(var(--timeline-line-x) - 5px);
  top: 1.15rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--gold-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
  z-index: 1;
}

.section-item.is-selected::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 10px rgba(200,168,75,0.6);
}

.section-item.is-optional::before {
  border-color: var(--text-muted);
  border-style: dashed;
}

/* ─── SECTION HEADER ─── */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  padding: 0.6rem 0;
}

.section-num {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  min-width: 1.4rem;
  letter-spacing: 0.06em;
}

.section-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 1;
}

.section-item.is-selected .section-name { color: var(--text-white); }

.section-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-required {
  background: rgba(158,62,62,0.2);
  border: 1px solid rgba(158,62,62,0.4);
  color: #c07070;
}

.badge-optional {
  background: rgba(158,122,46,0.15);
  border: 1px solid rgba(158,122,46,0.35);
  color: var(--warning);
}

.badge-group {
  background: rgba(74,140,92,0.15);
  border: 1px solid rgba(74,140,92,0.35);
  color: #70b080;
  font-size: 0.62rem;
}

.section-toggle-icon {
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.section-item.is-open .section-toggle-icon { transform: rotate(180deg); }

/* ─── SELECTED FILE PILL ─── */
.selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gold-glow);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem 0.2rem 0.4rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  max-width: 100%;
}

.selected-pill:hover { background: rgba(200,168,75,0.22); border-color: var(--gold); }

.selected-pill-icon { font-size: 0.7rem; color: var(--success); }

.selected-pill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.selected-pill-remove {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.1rem;
  transition: color var(--transition);
}

.selected-pill:hover .selected-pill-remove { color: var(--accent-red); }

/* ─── SECTION BODY (collapsible) ─── */
.section-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.section-item.is-open .section-body { max-height: 600px; }

.section-body-inner {
  padding: 0 0 1rem 0;
}

/* Search field */
.search-wrap {
  position: relative;
  margin-bottom: 0.6rem;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 2.5rem 0.55rem 2.2rem;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--gold-dim);
  background: var(--bg-hover);
}

.search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  line-height: 1;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}

.search-input:not(:placeholder-shown) ~ .search-clear { opacity: 1; }
.search-clear:hover { color: var(--text-primary); }

/* File list */
.file-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.file-list-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-style: italic;
}

.file-list-loading {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(200,168,75,0.06);
  transition: background var(--transition);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-hover); }
.file-item.is-active {
  background: var(--gold-glow);
  color: var(--gold);
}

.file-item-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.file-item.is-active .file-item-icon { color: var(--gold); }

.file-item-name { flex: 1; }

.file-item-preview {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  font-family: var(--font-ui);
  letter-spacing: 0.05em;
  transition: border-color var(--transition), color var(--transition);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition), border-color var(--transition), color var(--transition);
}

.file-item:hover .file-item-preview { opacity: 1; }
.file-item-preview:hover { border-color: var(--gold-dim); color: var(--gold); }

/* Section divider group label */
.section-group-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1rem var(--section-indent);
  pointer-events: none;
}

.section-group-divider::before,
.section-group-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-group-divider::before { max-width: 2rem; }

.group-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── DOWNLOAD AREA ─── */
.download-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.download-summary {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  min-height: 1.4em;
  letter-spacing: 0.03em;
}

.download-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: linear-gradient(135deg, #2a1a08, #1a1000);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 1rem 3rem;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-display);
  transition: all 0.25s ease;
  overflow: hidden;
  min-width: 280px;
}

.download-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200,168,75,0.1), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.download-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(200,168,75,0.25), 0 4px 20px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}

.download-btn:hover::before { opacity: 1; }
.download-btn:active { transform: translateY(0); }

.download-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.download-btn-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.download-btn-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.download-btn-sub {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
}

/* ─── FOOTER ─── */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  font-style: italic;
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-deep);
  z-index: 200;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.toast.success { border-color: rgba(74,140,92,0.5); color: #80d095; }
.toast.error   { border-color: rgba(158,62,62,0.5); color: #d08080; }
.toast.info    { border-color: var(--gold-line);    color: var(--gold); }

/* ─── FILE PREVIEW OVERLAY ─── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.overlay[hidden] { display: none; }

.overlay-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-deep);
  animation: panelIn 0.25s ease;
}

@keyframes panelIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.overlay-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}

.overlay-close:hover { color: var(--text-primary); border-color: var(--text-muted); }

.overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.preview-slides { display: flex; flex-direction: column; gap: 0.75rem; }

.preview-slide {
  background: #000;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.preview-slide-text {
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-line;
}

.preview-slide-num {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.25);
  margin-bottom: 0.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.overlay-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.overlay-select-btn {
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  letter-spacing: 0.04em;
}

.overlay-select-btn:hover {
  background: rgba(200,168,75,0.22);
  border-color: var(--gold);
}

/* ─── SKIP TOGGLE ─── */
.skip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.skip-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  :root {
    --timeline-line-x: 1.8rem;
    --section-indent:  3.5rem;
  }

  .app-header { padding: 0.75rem 1rem 0.5rem; }
  .header-title { font-size: 1.2rem; }
  .app-main { padding: 1.25rem 0.9rem 3rem; }

  .section-item::before {
    left: calc(var(--timeline-line-x) - 4px);
    width: 8px; height: 8px;
  }

  .download-btn { padding: 0.85rem 1.75rem; min-width: 240px; }
  .download-btn-text { font-size: 1rem; }

  .file-list { max-height: 200px; }
}

/* ─── SLIDE SETTINGS PANEL ─── */
.slide-settings {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.slide-settings:focus-within {
  box-shadow: 0 0 0 2px rgba(200,168,75,0.15);
}

.slide-settings-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  cursor: default;
}

.slide-settings-icon {
  color: var(--gold-dim);
  font-size: 1rem;
  flex-shrink: 0;
}

.slide-settings-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1;
}

.slide-settings-toggle {
  background: var(--gold-glow);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: 0.05em;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.slide-settings-toggle:hover {
  background: rgba(200,168,75,0.2);
  border-color: var(--gold);
}

.settings-chevron {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.7rem;
}

.slide-settings-toggle[aria-expanded="true"] .settings-chevron {
  transform: rotate(180deg);
}

.slide-settings-body {
  padding: 0 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: slideIn 0.2s ease;
}

.slide-settings-body[hidden] { display: none; }

/* Settings row */
.settings-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.settings-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.size-value-badge {
  display: inline-block;
  background: var(--gold-glow);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.06em;
  min-width: 3.2rem;
  text-align: center;
  font-style: normal;
}

/* Font picker cards */
.font-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.font-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 110px;
  flex: 1;
}

.font-card:hover {
  border-color: var(--gold-dim);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.font-card.is-active {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.font-card-sample {
  font-size: 1.25rem;
  color: var(--text-white);
  line-height: 1.2;
  white-space: nowrap;
}

.font-card-name {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.font-card.is-active .font-card-name { color: var(--gold); }

/* Size slider */
.size-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.size-min, .size-max {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 1.5rem;
  text-align: center;
}

.size-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dim) 0%, var(--gold-dim) var(--pct, 30%), rgba(200,168,75,0.15) var(--pct, 30%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(200,168,75,0.5);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}

.size-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(200,168,75,0.8);
  transform: scale(1.15);
}

.size-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-deep);
  cursor: pointer;
}

/* Preview slide */
.settings-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.settings-preview-slide {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}

.settings-preview-text {
  color: #fff;
  text-align: center;
  line-height: 1.65;
  max-width: 100%;
  /* font-family and font-size set dynamically via JS */
}

.settings-preview-caption {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-style: italic;
}

/* ─── INLINE STANZA PREVIEW ─── */
.inline-preview {
  margin-top: 1rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

.inline-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: var(--gold-glow);
  border-bottom: 1px solid var(--gold-line);
}

.inline-preview-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-preview-count {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.inline-preview-slides {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #0a0a0f;
  padding: 2px;
  max-height: 320px;
  overflow-y: auto;
}

.inline-slide {
  background: #000;
  padding: 0.9rem 1.1rem;
  text-align: center;
  position: relative;
  border-radius: 3px;
}

.inline-slide-num {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  color: rgba(200,168,75,0.35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.inline-slide-text {
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.88rem;
  line-height: 1.75;
  white-space: pre-line;
}

/* ─── READING TEXT INPUT ─── */
.text-input-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.text-input-hint {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

.reading-text-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  color: var(--text-white);
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.reading-text-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}

.reading-text-input:focus {
  border-color: var(--gold);
  background: var(--bg-hover);
  box-shadow: 0 0 0 2px rgba(200,168,75,0.12);
}

.reading-text-input:not(:placeholder-shown) {
  border-left-color: var(--gold);
  color: var(--gold);
}

/* ─── PRINT HIDDEN ─── */
@media print { .app-header, .download-area, .app-footer, .toast { display: none; } }
