/* ---------- Main / slide deck ---------- */
.main-toolbar{
  display:flex; align-items:center; gap:14px; padding:14px 22px; border-bottom:1px solid var(--line);
  flex-wrap:wrap; row-gap:10px;
}
.now-playing{ font-family:var(--font-display); font-size:18px; font-weight:600; margin-right:auto; }
.now-playing .sub{ font-family:var(--font-ui); font-size:12px; color:var(--text-dim); font-weight:400; display:block; }
select{
  background:var(--ink-soft); color:var(--parchment); border:1px solid var(--line); border-radius:8px;
  padding:8px 10px; font-size:16px; font-family:var(--font-ui);
}
.toggle-row{ display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--text-dim); }
.switch{ position:relative; width:38px; height:21px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.slider-track{
  position:absolute; inset:0; background:var(--ink-softer); border-radius:20px; transition:.15s; cursor:pointer;
}
.slider-track::before{
  content:''; position:absolute; height:15px; width:15px; left:3px; top:3px; background:var(--parchment);
  border-radius:50%; transition:.15s;
}
.switch input:checked + .slider-track{ background:var(--teal); }
.switch input:checked + .slider-track::before{ transform:translateX(17px); }

.fontsize-row{ display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--text-dim); }
.fontsize-row input[type=range]{ width:90px; accent-color:var(--gold); }
.color-row{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text-dim); }
input[type=color]{
  width:32px; height:26px; border:1px solid var(--line); border-radius:6px; background:none; padding:2px; cursor:pointer;
}

.main-content-row{ flex:1; display:flex; min-height:0; }

.settings-panel{
  display:none; flex-direction:column; gap:16px; width:min(280px, 100%); flex-shrink:0;
  border-left:1px solid var(--line); background:var(--ink-soft); padding:18px; overflow-y:auto;
}
.settings-panel.open{ display:flex; }
.settings-panel-header{
  display:flex; align-items:center; justify-content:space-between;
  font-family:var(--font-display); font-size:15px; font-weight:600;
}
.settings-group{ display:flex; flex-direction:column; gap:8px; }
.settings-group label{
  font-size:11px; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-dim);
}
.settings-group select, .settings-group input[type=range]{ width:100%; }
.settings-group-row{ flex-direction:row; flex-wrap:wrap; gap:14px; }
.settings-group.toggle-row{ flex-direction:row; align-items:center; justify-content:space-between; }

/* Original Text / Translation Text formatting groups */
.settings-fieldset{
  border:1px solid var(--line); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:10px;
}
.settings-fieldset-title{
  font-size:11px; text-transform:uppercase; letter-spacing:0.06em; color:var(--gold); font-weight:600;
}
/* Mobile-only section labels for the Projector settings panel — purely
   visual grouping (see the mobile media query for display:block), same
   look as .settings-fieldset-title. Nothing here hides or collapses
   any control; every group stays exactly as visible as it is today. */
.settings-section-label{
  display:none; font-size:11px; text-transform:uppercase; letter-spacing:0.06em;
  color:var(--gold); font-weight:600; margin:18px 0 2px; padding-top:14px;
  border-top:1px solid var(--line);
}
.settings-section-label:first-of-type{ margin-top:0; padding-top:0; border-top:none; }
.number-row{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text-dim); }
.number-row input[type=number]{
  width:56px; padding:5px 6px; border-radius:6px; border:1px solid var(--line);
  background:var(--ink); color:var(--parchment); font-size:16px;
}
#btn-toggle-settings.active{ background:var(--teal); border-color:var(--teal); }
#btn-toggle-database.active{ background:var(--teal); border-color:var(--teal); }

#voice-status-line, .voice-status-line{ display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-dim); }
#voice-status-dot, .voice-status-dot{ width:8px; height:8px; border-radius:50%; background:var(--ink-softer); flex-shrink:0; }
#voice-status-dot.listening, .voice-status-dot.listening{ background:var(--teal); }
#voice-status-dot.busy, .voice-status-dot.busy{ background:var(--gold); animation:voice-pulse 1s ease-in-out infinite; }
#voice-status-dot.error, .voice-status-dot.error{ background:var(--vermillion); }
@keyframes voice-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:0.35; } }
#btn-toggle-voice.active{ background:var(--teal); border-color:var(--teal); }

.slide-grid{
  flex:1; overflow-y:auto; padding:20px 22px; display:grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap:16px; align-content:start;
}
/* Slide preview cards mirror the live projector style (colors, text
   sizes, translation layout) via these custom properties — set by
   applyPreviewStyle() whenever a style control changes, alongside the
   same values being pushed to the actual projector over the WebSocket.
   Unset (default) falls back to the original parchment-card look. */
.slide-card{
  background-color:var(--preview-bg, var(--parchment));
  background-image:var(--preview-bg-image, none);
  background-size:cover; background-position:center;
  color:var(--preview-fg, var(--ink));
  border-radius:var(--radius); padding:18px 18px 14px;
  cursor:pointer; position:relative; border:2px solid transparent; box-shadow:0 1px 2px rgba(0,0,0,0.25);
  transition:border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.slide-card:hover{ transform:translateY(-1px); }
/* A video background isn't actually played across every card in the
   grid (dozens of simultaneous <video>s would be wasteful) — a neutral
   placeholder plus a small badge stands in instead; the real preview is
   the projector itself. See applyPreviewStyle()'s bg-video-active class. */
body.bg-video-active .slide-card::after{
  content:"🎬 Video background"; position:absolute; bottom:8px; right:8px;
  font-size:11px; color:var(--parchment); background:rgba(0,0,0,0.45);
  padding:2px 7px; border-radius:4px; pointer-events:none;
}
.slide-card.active{
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(201,162,39,0.5), 0 10px 22px rgba(0,0,0,0.4);
  transform:translateY(-3px) scale(1.02);
  z-index:1;
}
/* While live (projecting), the active card's border/glow turns red as an
   on-air indicator, matching the toggle button's own live coloring —
   reverts to the gold rule above automatically when paused. */
#slide-area.live-mode .slide-card.active{
  border-color:var(--vermillion);
  box-shadow:0 0 0 4px rgba(162,59,46,0.5), 0 10px 22px rgba(0,0,0,0.4);
}
/* A translucent dark chip regardless of the card's own (user-chosen)
   background color/image, so the icon stays legible either way. */
.slide-edit-btn{
  position:absolute; top:8px; right:8px; z-index:2;
  background:rgba(11,12,20,0.55); color:var(--parchment); border:1px solid rgba(255,255,255,0.15);
}
.slide-edit-btn:hover{ background:rgba(11,12,20,0.8); color:var(--gold); }
.verse-marker{
  font-family:var(--font-ethiopic); color:var(--vermillion); font-size:15px; margin-bottom:8px; display:block;
}
.verse-original{
  font-family:var(--preview-original-font, var(--font-ethiopic)); font-size:calc(3.2px * var(--preview-font-scale, 5));
  line-height:1.55; white-space:pre-line;
}
.verse-original.latin-script{ font-style:italic; }
.verse-translation{
  font-family:var(--preview-translation-font, var(--font-ui)); font-size:calc(3.2px * var(--preview-translation-scale, 5));
  color:var(--preview-translation-color, var(--teal)); margin-top:8px; white-space:pre-line;
  border-top:1px dashed var(--parchment-dim); padding-top:8px;
}
.line-pair-preview{ margin-bottom:8px; }
.line-pair-preview:first-child{ margin-top:0; }

/* Bible verse numbers — printed-Bible style small number before each
   verse's line, in both the original and translation blocks. em-sized so
   it scales with whatever font-size its containing block ends up at. */
.bible-verse-line{ margin-bottom:0.25em; }
.bible-verse-num{ font-size:0.6em; vertical-align:super; opacity:0.7; margin-right:0.2em; }
.orig-line-preview{
  font-family:var(--preview-original-font, var(--font-ethiopic)); font-size:calc(3.2px * var(--preview-font-scale, 5)); line-height:1.4;
}
.trans-line-preview{
  font-family:var(--preview-translation-font, var(--font-ui)); font-size:calc(3.2px * var(--preview-translation-scale, 5));
  color:var(--preview-translation-color, var(--teal)); margin-top:2px; line-height:1.3;
}
.divider-ornament{ text-align:center; color:var(--gold); opacity:0.5; margin:4px 0 0; font-size:11px; }

.placeholder{
  flex:1; display:flex; align-items:center; justify-content:center; color:var(--text-dim); font-size:14px; text-align:center; padding:40px;
}

