/* المترجم الحي — page styles (brand tokens come from styles.css) */

.live-body {
  background: var(--g950); color: var(--cream);
  height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
}

.live-top {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 14px 3vw; border-bottom: 1px solid rgba(139, 124, 246, 0.18);
}
.live-top .brand-mark { color: var(--gold); }
.live-top h1 { font-size: 20px; font-weight: 700; }
.live-top .muted { color: var(--gold-soft); font-weight: 500; font-size: 15px; }
.live-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; opacity: 0.55; }
.live-chips .pill { font-size: 10.5px; padding: 3px 9px; }

.pill {
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 12px;
  background: rgba(243, 241, 251, 0.07); border: 1px solid rgba(243, 241, 251, 0.15);
  color: rgba(243, 241, 251, 0.85); white-space: nowrap;
}
.pill.ok { border-color: rgba(60, 200, 140, 0.6); color: #8FD4B4; }
.pill.bad { border-color: rgba(228, 87, 61, 0.6); color: #F0907C; }

.live-grid {
  flex: 1; min-height: 0; overflow: hidden; position: relative;
  display: grid; grid-template-columns: 1fr 340px; gap: 16px;
  padding: 14px 18px 16px;
  transition: grid-template-columns 0.35s ease;
}
body.panel-closed .live-grid { grid-template-columns: 1fr 0px; gap: 0; }
body.panel-closed .side-panel { opacity: 0; pointer-events: none; }

/* stage */
.stage-panel {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid rgba(139, 124, 246, 0.25);
  background: radial-gradient(700px 420px at 50% 20%, rgba(139, 124, 246, 0.14), transparent 60%), var(--g900);
  height: 100%; min-height: 0; display: flex; flex-direction: column;
}
#stage3d { width: 100%; height: 100%; flex: 1; display: block; }
.boot-error { position: absolute; inset: 40% 10% auto; text-align: center; color: #F0907C; }

.stage-flag {
  position: absolute; top: 10px; right: 10px;
  background: rgba(10, 7, 34, 0.7); color: rgba(220, 192, 132, 0.85);
  border: 1px solid rgba(139, 124, 246, 0.3);
  font-size: 10px; font-weight: 600; border-radius: 999px; padding: 3px 10px;
}
.stage-flag.warn {
  top: 44px; color: #F0C987;
  border-color: rgba(232, 181, 99, 0.5); background: rgba(184, 117, 20, 0.25);
}

.stage-bottom {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 5;
  padding: 26px 18px 14px;
  background: linear-gradient(180deg, transparent, rgba(10, 7, 34, 0.92) 55%);
  display: flex; flex-direction: column; gap: 9px; align-items: center;
  pointer-events: none;
}
.stage-bottom > * { pointer-events: auto; }
.sign-row { display: flex; gap: 10px; align-items: center; min-height: 1.5em; }
.gloss-strip { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 86%; }
.gchip {
  font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 3px 11px;
  background: rgba(139, 124, 246, 0.14); border: 1px solid rgba(139, 124, 246, 0.35);
  color: rgba(243, 241, 251, 0.8); transition: all 0.15s;
}
.gchip.spell { border-style: dashed; color: #F0C987; border-color: rgba(232, 181, 99, 0.5); }
.gchip.on { background: var(--gold); color: var(--g950); border-color: var(--gold); transform: translateY(-1px); }
#caption { font-size: clamp(14px, 1.4vw, 18px); font-weight: 600; min-height: 1.5em; color: var(--gold-soft); }
#caption:not(:empty)::before { content: "الإشارة الحالية: "; color: rgba(243, 241, 251, 0.5); font-weight: 400; }
#srcBadge:empty { display: none; }

/* side panel */
.side-panel {
  border-radius: var(--radius-lg); border: 1px solid rgba(139, 124, 246, 0.2);
  background: rgba(18, 12, 46, 0.65);
  min-width: 0; min-height: 0; height: 100%; overflow: hidden;
  transition: opacity 0.3s;
}
.panel-body { width: 340px; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.panel-sec { padding: 14px 14px 10px; }
.panel-sec h3 { font-size: 14px; font-weight: 700; color: var(--gold-soft); margin-bottom: 8px; }
.panel-sec .sent-list { max-height: 36vh; overflow-y: auto; }
.panel-sec.listen-box {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  border-top: 1px solid rgba(139, 124, 246, 0.15);
}
.panel-handle {
  position: absolute; left: 0; top: 50%; translate: 0 -50%; z-index: 9;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(18, 12, 46, 0.92); color: var(--gold-soft);
  border: 1px solid rgba(139, 124, 246, 0.35); border-left: none;
  border-radius: 0 14px 14px 0; padding: 14px 7px; cursor: pointer; font: inherit;
}
.panel-handle:hover { background: rgba(139, 124, 246, 0.22); }
.panel-handle .ph-label { writing-mode: vertical-rl; font-size: 12px; letter-spacing: 1px; }
.panel-handle .ph-arrow { font-size: 13px; transition: rotate 0.3s; }
body.panel-closed .panel-handle .ph-arrow { rotate: 180deg; }

.pane { padding: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.pane-hint { font-size: 12.5px; color: rgba(243, 241, 251, 0.55); margin-bottom: 12px; line-height: 1.8; }

.sent-list { display: grid; gap: 8px; }
.sent {
  text-align: right; font: inherit; font-size: 14px; line-height: 1.8;
  background: rgba(243, 241, 251, 0.05); color: var(--cream);
  border: 1px solid rgba(243, 241, 251, 0.12); border-radius: 12px;
  padding: 10px 14px; cursor: pointer; transition: all 0.15s;
}
.sent:hover { background: rgba(139, 124, 246, 0.14); }
.sent.on { border-color: var(--gold); background: rgba(139, 124, 246, 0.18); }

#freeText {
  width: 100%; font: inherit; font-size: 15px; line-height: 1.9;
  background: rgba(243, 241, 251, 0.06); color: var(--cream);
  border: 1px solid rgba(243, 241, 251, 0.15); border-radius: 12px;
  padding: 12px; resize: vertical; margin-bottom: 10px;
}
#freeText:focus { outline: none; border-color: var(--gold); }

.mic-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
#btnMic.live { background: var(--live); color: #fff; }
.vu-track { height: 6px; border-radius: 999px; background: rgba(243, 241, 251, 0.1); overflow: hidden; margin-bottom: 12px; }
#vu { height: 100%; width: 0; background: linear-gradient(270deg, var(--gold), #B7ABFA); transition: width 0.12s; }

.side-panel .mode-toggle { margin-bottom: 12px; }
.interim { min-height: 1.6em; color: rgba(243, 241, 251, 0.5); font-size: 13.5px; }
.transcript { display: grid; gap: 6px; }
.transcript p {
  font-size: 13.5px; padding: 8px 12px; border-radius: 10px;
  background: rgba(243, 241, 251, 0.05); border-right: 3px solid rgba(243, 241, 251, 0.2);
}
.transcript p.hit { border-right-color: #8FD4B4; }
.transcript p.auto { border-right-color: #F0C987; }

.side-foot {
  padding: 10px 14px; font-size: 11.5px; color: rgba(243, 241, 251, 0.45);
  border-top: 1px solid rgba(139, 124, 246, 0.15);
}
.side-foot code { color: var(--gold-soft); }

@media (max-width: 920px) {
  .live-grid { grid-template-columns: 1fr; }
  .stage-panel { min-height: 54vh; }
}

/* ---- product flow: onboarding, QR hand-off, phone viewer ---- */
.pill.gold { border-color: rgba(201,162,75,.55); color: var(--gold-soft); }
.pill.linkish { cursor: pointer; background: none; font: inherit; font-size: 12px; }
.pill.linkish:hover { border-color: var(--gold); color: var(--gold-soft); }

.ob-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 50% 0%, rgba(139,124,246,.12), transparent 60%), rgba(10,7,34,.97);
  padding: 4vw; transition: opacity .4s;
}
.ob-overlay.gone { opacity: 0; pointer-events: none; }
.ob-card {
  width: min(600px, 100%); border-radius: var(--radius-lg);
  border: 1px solid rgba(139,124,246,.3); background: rgba(18,12,46,.85);
  padding: 26px 28px 30px; max-height: 92vh; overflow-y: auto;
}
.ob-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.ob-logo { font-size: 22px; font-weight: 700; color: var(--gold-soft); }
.ob-dots { display: flex; gap: 8px; }
.ob-dot { width: 26px; height: 5px; border-radius: 99px; background: rgba(243,241,251,.15); }
.ob-dot.on { background: var(--gold); }
.ob-step h2 { font-size: 22px; margin-bottom: 6px; }
.ob-hint { font-size: 13.5px; color: rgba(243,241,251,.6); line-height: 1.9; margin-bottom: 16px; }
.ob-card .mosque-list { width: 100%; }
.ob-card .dropzone {
  border: 2px dashed rgba(139,124,246,.4); border-radius: 14px; padding: 26px;
  text-align: center; color: rgba(243,241,251,.6); font-size: 14px; cursor: pointer; margin-bottom: 12px;
  background: rgba(243,241,251,.03);
}
.ob-card .dropzone:hover { border-color: var(--gold); }
.ob-card .btn { width: 100%; }
.ob-pipe-title { font-size: 13.5px; color: var(--gold-soft); margin-bottom: 12px; }
.ob-pipe { list-style: none; display: grid; gap: 10px; }
.ob-pipe li {
  position: relative; padding: 11px 42px 11px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(243,241,251,.05); border: 1px solid rgba(243,241,251,.1);
  color: rgba(243,241,251,.45); transition: all .3s;
}
.ob-pipe li::before {
  content: ""; position: absolute; right: 13px; top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(243,241,251,.25);
}
.ob-pipe li.busy { color: var(--cream); border-color: rgba(201,162,75,.5); }
.ob-pipe li.busy::before { border-color: var(--gold); border-top-color: transparent; animation: spin .7s linear infinite; }
.ob-pipe li.done { color: var(--cream); background: rgba(14,138,95,.1); border-color: rgba(14,138,95,.4); }
.ob-pipe li.done::before { content: "✓"; border-color: #2FA97C; background: #2FA97C; color: #08261b; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.ob-summary { font-size: 14.5px; color: rgba(243,241,251,.85); margin-bottom: 18px; line-height: 2; }
.ob-golive { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ob-qr { display: flex; gap: 14px; align-items: center; font-size: 13px; color: rgba(243,241,251,.7); line-height: 1.9; }
.ob-qr small { color: var(--gold-soft); direction: ltr; unicode-bidi: embed; font-size: 11px; }
.ob-actions { display: grid; gap: 10px; flex: 1; min-width: 220px; }

.qr-box { width: 96px; height: 96px; background: #fff; border-radius: 10px; padding: 6px; flex-shrink: 0; }
.qr-box.lg { width: 132px; height: 132px; }
.qr-box svg { width: 100%; height: 100%; display: block; }

.qr-toggle {
  position: absolute; bottom: 14px; left: 14px; z-index: 7;
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: rgba(10,7,34,.8); color: var(--gold-soft);
  border: 1px solid rgba(139,124,246,.35);
  display: flex; align-items: center; justify-content: center;
}
.qr-toggle:hover { background: rgba(139,124,246,.22); }
.qr-card {
  position: absolute; bottom: 64px; left: 14px; z-index: 8; cursor: pointer;
  display: flex; gap: 10px; align-items: center;
  background: rgba(10,7,34,.85); border: 1px solid rgba(139,124,246,.35);
  border-radius: 14px; padding: 10px 12px; font-size: 11.5px; line-height: 1.7;
  color: rgba(243,241,251,.75);
}
.qr-card .qr-box { width: 72px; height: 72px; }
.qr-card small { color: var(--gold-soft); }

/* phone viewer */
.mobile-bar {
  position: absolute; top: 12px; inset-inline: 12px; z-index: 6;
  display: flex; gap: 10px; align-items: center; font-size: 13.5px;
  background: rgba(10,7,34,.8); border: 1px solid rgba(139,124,246,.3);
  border-radius: 12px; padding: 8px 14px;
}
.live-dot-sm { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
#mobileTicker { margin-inline-start: auto; }
body.mobile-viewer .side-panel, body.mobile-viewer .live-chips,
body.mobile-viewer .qr-card, body.mobile-viewer #btnSetup, body.mobile-viewer .rec-dock { display: none; }
body.mobile-viewer .stage-flag { top: 58px; font-size: 10.5px; }
body.mobile-viewer .stage-flag.warn { top: 88px; }
body.mobile-viewer .live-grid { grid-template-columns: 1fr; padding: 10px; }
body.mobile-viewer .stage-panel { min-height: calc(100vh - 86px); }
body.mobile-viewer .live-top { padding: 10px 4vw; }
body.mobile-viewer #caption { font-size: clamp(20px, 5.5vw, 30px); }

/* primary subtitle: the imam's original sentence, always readable */
.subtitle {
  font-size: clamp(19px, 2.1vw, 30px); font-weight: 600; line-height: 1.9;
  text-align: center; color: #F6F3FF;
  background: rgba(10, 7, 34, 0.78);
  border: 1px solid rgba(201, 162, 75, 0.3); border-bottom: 3px solid var(--gold);
  border-radius: 12px; padding: 9px 20px; max-width: min(88%, 860px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: subIn 0.25s ease;
}
@keyframes subIn { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
body.mobile-viewer .subtitle { font-size: clamp(16px, 4.4vw, 21px); padding: 8px 12px; }
.ob-sim { color: #F0C987; font-size: 11.5px; }

/* ---- record FAB + collapsible sentence menu ---- */
.rec-dock { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.rec-fab {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gold); color: var(--g950);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 6px rgba(201,162,75,.18);
  transition: transform .15s, background .2s;
}
.rec-fab:hover { transform: scale(1.06); }
.rec-fab.live {
  background: var(--live); color: #fff;
  animation: recPulse 1.6s ease-in-out infinite;
}
@keyframes recPulse {
  0%,100% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 6px rgba(228,87,61,.25); }
  50% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 14px rgba(228,87,61,.08); }
}
.rec-dock .pill { backdrop-filter: blur(4px); background: rgba(10,7,34,.75); }


.ob-error {
  margin-top: 16px; padding: 14px; border-radius: 12px;
  background: rgba(228,87,61,.12); border: 1px solid rgba(228,87,61,.45);
  color: #F0907C; font-size: 13.5px; display: grid; gap: 10px;
}

.ob-skip {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  font: inherit; font-size: 11px; color: rgba(243,241,251,.4);
  background: none; border: 1px dashed rgba(243,241,251,.25);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.ob-skip:hover { color: var(--gold-soft); border-color: var(--gold); }
body.mobile-viewer .panel-handle, body.mobile-viewer .qr-toggle { display: none; }
.listen-box .transcript { flex: 1; min-height: 0; overflow-y: auto; }

/* mosque photo picker */
.mosque-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mosque-photo {
  position: relative; border: 2px solid rgba(139, 124, 246, 0.25); border-radius: 16px;
  padding: 0; overflow: hidden; cursor: pointer; background: var(--g900);
  aspect-ratio: 4 / 4.6; transition: transform 0.15s, border-color 0.15s;
}
.mosque-photo:hover { transform: translateY(-3px); border-color: var(--gold); }
.mosque-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,7,34,0) 30%, rgba(10,7,34,0.92)); }
.mp-info {
  position: absolute; inset-inline: 10px; bottom: 10px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px; text-align: start;
}
.mp-info strong { font-size: 14.5px; color: #fff; }
.mp-info small { font-size: 11px; color: rgba(243,241,251,0.7); }
.mp-live {
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(10,7,34,0.75); color: #F0907C;
  border: 1px solid rgba(228,87,61,0.5); border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 3px 9px;
}
.mp-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }

/* locked dropzone + ready-file list */
.ob-card .dropzone { cursor: default; display: flex; flex-direction: column; align-items: center; gap: 8px; color: rgba(243,241,251,0.55); }
.ob-card .dropzone.over { border-color: var(--gold); background: rgba(201,162,75,0.08); color: var(--gold-soft); }
.dz-browse {
  font: inherit; background: none; border: none; cursor: pointer;
  color: var(--gold-soft); text-decoration: underline; padding: 0;
}
.files-label { font-size: 12.5px; color: rgba(243,241,251,0.55); margin: 14px 0 8px; }
.file-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start;
  background: rgba(243,241,251,0.05); border: 1px solid rgba(243,241,251,0.14);
  border-radius: 14px; padding: 10px 14px; cursor: pointer; font: inherit; color: var(--cream);
  transition: border-color 0.15s, background 0.15s;
}
.file-item:hover { border-color: var(--gold); background: rgba(201,162,75,0.1); }
.pdf-ico { width: 34px; flex-shrink: 0; }
.pdf-ico svg { width: 100%; height: auto; display: block; }
.file-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.file-meta strong { font-size: 13.5px; }
.file-meta small { font-size: 11.5px; color: rgba(243,241,251,0.55); }

/* settings */
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  background: rgba(243,241,251,0.06); color: rgba(243,241,251,0.75);
  border: 1px solid rgba(243,241,251,0.15);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--gold-soft); border-color: var(--gold); }
.settings-overlay {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: rgba(10,7,34,0.85); backdrop-filter: blur(4px); padding: 4vw;
}
.settings-card {
  width: min(480px, 100%); border-radius: var(--radius-lg);
  border: 1px solid rgba(139,124,246,0.35); background: rgba(18,12,46,0.95);
  padding: 24px 26px;
}
.settings-card h2 { font-size: 20px; margin-bottom: 16px; }
.set-field { display: block; margin-bottom: 16px; }
.set-field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--gold-soft); margin-bottom: 6px; }
.set-field input {
  width: 100%; font: inherit; font-size: 13px; padding: 10px 12px;
  background: rgba(243,241,251,0.06); color: var(--cream);
  border: 1px solid rgba(243,241,251,0.18); border-radius: 10px;
}
.set-field input:focus { outline: none; border-color: var(--gold); }
.set-field small { display: block; margin-top: 6px; font-size: 11.5px; color: rgba(243,241,251,0.5); line-height: 1.8; }
.set-field .warn-note { color: #F0C987; }
.key-row { display: flex; gap: 8px; align-items: center; }
.key-row input { flex: 1; }
.set-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ===== two modes: public (default, deaf worshipper) and imam ===== */
body.mode-public .only-imam, body.mode-imam .only-public { display: none !important; }
.mode-switch { text-decoration: none; }
body.mode-public .live-chips, body.mode-public .rec-dock, body.mode-public #btnSettings,
body.mode-public .qr-toggle, body.mode-public .qr-card, body.mode-public #mobileSentence,
body.mode-public #mobileBar { display: none !important; }

/* public layout: the character and the text are separate sections — the text never covers the hands */
body.mode-public .live-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
body.mode-public .stage-panel { min-height: 0; }
body.mode-public .stage-bottom { background: none; padding: 0 12px 10px; }
body.mode-public .gloss-strip { display: none; }
body.mode-public .sign-row { background: rgba(10, 7, 34, 0.72); border-radius: 999px; padding: 4px 14px; }
.pub-text {
  border-radius: var(--radius-lg); border: 1px solid rgba(139, 124, 246, 0.22);
  background: var(--g900); padding: 14px 18px 12px; display: flex; flex-direction: column; gap: 8px;
  max-height: 44vh; min-height: 150px;
}
.pub-status { font-size: 12.5px; color: rgba(243, 241, 251, 0.6); }
.pub-lines { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pub-prev { font-size: 15px; line-height: 1.8; color: rgba(243, 241, 251, 0.45); margin: 0; }
.pub-prev:empty { display: none; }
.pub-now { font-size: clamp(19px, 2.2vw, 28px); line-height: 1.85; font-weight: 500; }
.pub-tr { font-size: 15.5px; line-height: 1.7; color: #B9AEFF; margin: 0; }
.pub-tr small { display: block; font-size: 11px; color: rgba(243, 241, 251, 0.45); }
.pub-tr.ltr { direction: ltr; text-align: left; }
.pub-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid rgba(139, 124, 246, 0.15); padding-top: 9px; }
.pub-bar .grow { flex: 1; }
.lang-select { cursor: pointer; font-family: inherit; }
.lang-select option { background: var(--g900); color: var(--cream); }
.listen-btn { padding: 8px 16px; font-size: 14px; }
.listen-btn.on { background: #E4573D; color: #fff; }
/* listening controls: live (green, microphone) above the demo, language on the other side */
.pub-bar { align-items: center; }
.listen-stack { display: flex; flex-direction: column; gap: 7px; min-width: 190px; }
.listen-stack .listen-btn { width: 100%; justify-content: center; font-size: 15px; padding: 10px 18px; }
.live-btn { background: #1FAF6E; border: 1px solid #1FAF6E; color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(31, 175, 110, 0.35); }
.live-btn:hover { background: #25C27B; }
.live-btn.on { background: #E4573D; border-color: #E4573D; box-shadow: none; }
.demo-btn { background: transparent; border: 1px solid rgba(220, 192, 132, 0.55); color: #DCC084; }
.demo-btn.on { background: #E4573D; border-color: #E4573D; color: #fff; }
.imam-cta { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; padding: 10px 20px; border-radius: 999px;
  background: linear-gradient(135deg, #8B7CF6, #6150EA); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 6px 20px rgba(97, 80, 234, 0.5); }
.imam-cta:hover { filter: brightness(1.12); }
@media (max-width: 560px) {
  .pub-bar { flex-wrap: wrap; }
  .listen-stack { min-width: 0; flex: 1 1 55%; }
  .listen-stack .listen-btn { font-size: 14px; padding: 9px 10px; }
  .pub-bar .lang-select { flex: 0 1 40%; min-width: 0; max-width: 40%; }
  .pub-bar .grow { display: none; }
  .pub-bar #pubMode { order: 5; flex-basis: 100%; text-align: center; }
  body.mode-public .live-top h1 { font-size: 15px; }
  .imam-cta { padding: 8px 14px; font-size: 14px; }
}
.mode-chip.prepared { border-color: rgba(60, 200, 140, 0.55); color: #8FD4B4; }
.mode-chip.improvised { border-color: rgba(232, 181, 99, 0.6); color: #F0C987; }

/* verified verses — official King Fahd Complex mushaf text, no tafsir */
.ayah { margin: 2px 0 4px; }
.ayah-t { font-family: "Amiri Quran", "Amiri", serif; color: var(--gold); font-size: clamp(22px, 2.4vw, 32px); line-height: 2.05; }
.ayah-ref { display: inline-block; margin-inline-start: 8px; font-size: 12.5px; color: var(--gold); border: 1px solid rgba(220, 192, 132, 0.4); border-radius: 999px; padding: 1px 10px; vertical-align: middle; font-family: inherit; }
.ayah-said { display: block; font-size: 14px; color: rgba(243, 241, 251, 0.55); }
.unverified { display: block; font-size: 12px; color: #F0907C; }

/* login */
.login-card { max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.login-card .set-field input { width: 100%; }
.login-err { color: #F0907C; font-size: 13px; margin: 0; }

@media (max-width: 760px) {
  body.mode-public .live-top { gap: 10px; padding: 10px 4vw; }
  body.mode-public .live-top h1 { font-size: 16px; }
  body.mode-public .live-grid { padding: 8px; }
  .pub-text { max-height: 46vh; padding: 10px 12px; }
  .pub-now { font-size: 19px; }
  .ayah-t { font-size: 21px; }
}

/* imam / mosque screen: text and controls sit BELOW the character, never over the hands */
body.mode-imam .stage-panel { display: flex; flex-direction: column; }
body.mode-imam #stage3d { flex: 1; min-height: 0; }
body.mode-imam .stage-bottom { position: relative; inset: auto; background: rgba(10, 7, 34, 0.55); border-top: 1px solid rgba(139, 124, 246, 0.18); padding: 10px 18px 12px; }
/* the sign label only appears while a sign is playing */
.sign-row:has(#caption:empty):has(#srcBadge:empty) { display: none; }
body.mode-public .sign-row:has(#caption:empty) { display: none; }
@media (max-width: 760px) { body.mode-public .stage-flag { font-size: 9.5px; max-width: 92%; } }

/* public mode: where am I + no technical labels on the stage */
body.mode-public .sign-row, body.mode-public #flagAuto { display: none !important; }
.mosque-here {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 6;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(10, 7, 34, 0.72); color: #F3F1FB; backdrop-filter: blur(6px);
  border: 1px solid rgba(200, 180, 92, 0.45); border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; font-weight: 500;
}
.mosque-here strong { color: #DCC084; font-weight: 700; }
.mosque-here small { color: rgba(243, 241, 251, 0.6); font-size: 12px; }
.mosque-here .mh-dot { width: 7px; height: 7px; border-radius: 50%; background: #DCC084; box-shadow: 0 0 0 3px rgba(220, 192, 132, 0.2); }
body.mode-imam .mosque-here { display: none; }
@media (max-width: 760px) { .mosque-here { font-size: 12.5px; padding: 5px 12px; top: 10px; } }

/* a chosen language replaces the Arabic text */
body.pub-foreign .pub-now, body.pub-foreign .pub-prev { display: none; }
body.pub-foreign.pub-tr-missing .pub-now { display: block; }
body.pub-foreign .pub-tr { font-size: clamp(18px, 2.1vw, 26px); line-height: 1.75; color: #F3F1FB; font-weight: 500; }
body.pub-foreign .pub-tr small { font-size: 11.5px; margin-top: 6px; font-weight: 400; }
body.pub-foreign .pub-tr.ltr { direction: ltr; text-align: left; }
.pub-prev-tr { font-size: 15px; line-height: 1.7; color: rgba(243, 241, 251, 0.45); margin: 0; }
.pub-prev-tr.ltr { direction: ltr; text-align: left; }
.pub-prev-tr:empty, body:not(.pub-foreign) .pub-prev-tr { display: none; }

/* the imam's words as he says them */
#mobileSentence.speaking { border-bottom-color: #8FD4B4; }
#mobileSentence.speaking::after, .pub-now .speaking::after, .pub-tr .speaking::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-start: 8px; border-radius: 50%;
  background: #8FD4B4; vertical-align: middle; animation: spk 1s ease-in-out infinite;
}
@keyframes spk { 50% { opacity: 0.25; } }
.pub-now .speaking { color: #F3F1FB; }


/* imam mode: only the words he says — no technical labels, no prepared list */
body.mode-imam #flagAuto, body.mode-imam .sign-row, body.mode-imam #glossStrip,
body.mode-imam #mobileSentence, body.mode-imam #chipEngine { display: none !important; }
.live-words-sec { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.live-words {
  flex: 1; margin: 0; overflow-y: auto;
  font-size: clamp(22px, 2.2vw, 30px); line-height: 1.9; font-weight: 600; color: #F6F3FF;
}
.live-words:empty::before { content: attr(data-empty); font-size: 15px; font-weight: 400; color: rgba(243, 241, 251, 0.45); }
.live-words.speaking::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: 10px; border-radius: 50%;
  background: #8FD4B4; vertical-align: middle; animation: spk 1s ease-in-out infinite;
}
