/* ==========================================================
   Page and feature blocks that grew inside the shared stylesheet (landing, auth, host,
   join, funds, admin, legal, white-label, listener extras, responsive rules, utilities).
   Loaded right after style.css on every page, so the cascade is unchanged.
   ========================================================== */

/* ==================================================
   LANDING PAGE
   ================================================== */

/* Hero */
.hero {
  position: relative;
  padding: 120px 24px 100px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(#f8fafc, #f8fafc);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 40% 30% at 20% 20%, rgba(133, 133, 133,0.08), transparent),
    radial-gradient(ellipse 40% 30% at 80% 30%, rgba(103, 103, 103,0.06), transparent),
    radial-gradient(ellipse 50% 40% at 50% 80%, rgba(133, 133, 133,0.04), transparent);
  background-size: 100% 100%;
  animation: gradientShift 12s ease infinite;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
  line-height: 1.1;
  animation: fadeUp 0.6s ease 0.1s both;
}

/* How It Works */
.how-it-works {
  padding: 100px 24px;
  background: var(--bg-page);
}

.step {
  text-align: center;
  position: relative;
}

.step h3 { margin-bottom: 10px; font-size: 1.15rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; max-width: 280px; margin: 0 auto; }

/* Product showcase */
.showcase {
  padding: 100px 24px;
  background: var(--bg);
}

/* Testimonials */
.testimonials {
  padding: 100px 24px;
  background: var(--bg);
}

.faq-list {
  max-width: 700px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
  background: var(--bg-page);
}

/* ---- Auth page ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-page);
  position: relative;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 50% 0%, rgba(133, 133, 133,0.06), transparent),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(103, 103, 103,0.04), transparent);
  z-index: 0;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s ease;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}
.google-btn:hover {
  border-color: #d4d4d4;
  box-shadow: var(--shadow);
  color: var(--text);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Mic selector */
.mic-selector {
  max-width: 300px;
  margin: 0 auto 20px;
  text-align: left;
}
.mic-selector label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Mic volume visualizer */
.mic-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 48px;
  margin: 0 auto 20px;
  max-width: 260px;
}
.mic-visualizer .viz-bar {
  width: 3px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 0.06s ease-out;
}
.mic-visualizer.active .viz-bar {
  background: linear-gradient(to top, var(--primary), var(--accent));
}

.share-qr {
  flex-shrink: 0;
}
.share-qr canvas {
  border-radius: 8px;
  display: block;
}

.transcript-log {
  flex: 1;
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  padding: 8px;
}
.transcript-line {
  padding: 4px 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border-light);
  animation: fadeIn 0.2s ease;
}
.transcript-line .transcript-speaker {
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 4px;
}
.transcript-line .transcript-time {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-right: 6px;
}
.transcript-line.transcript-singing {
  background: linear-gradient(90deg, rgba(123, 123, 123,0.08), transparent);
  border-left: 3px solid var(--primary, #676767);
  font-style: italic;
}
.singing-icon {
  color: var(--primary, #676767);
  font-style: normal;
  font-size: 0.9em;
}
.transcript-entry {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}
.transcript-entry.source {
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
}
.transcript-entry.translation {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
}

.transcript-entry.local {
  background: #f0fdf4;
  border-left: 3px solid var(--success);
}

.transcript-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-left: auto;
}

/* Host language selection grid */
.host-language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 0;
}
.host-lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  user-select: none;
}
.host-lang-item:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.host-lang-item.checked {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.host-lang-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.host-lang-item .lang-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.host-lang-item .ai-toggle-wrapper {
  margin-left: auto;
  flex-shrink: 0;
}

/* Small toggle switch (28x16px) for AI on/off per language */
.toggle-sm {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  vertical-align: middle;
}
.toggle-sm input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-sm-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d4d4d4;
  border-radius: 16px;
  transition: background 0.2s;
}
.toggle-sm-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-sm input:checked + .toggle-sm-slider {
  background: var(--primary);
}
.toggle-sm input:checked + .toggle-sm-slider::before {
  transform: translateX(12px);
}

@media (max-width: 768px) {
  
  .transcript-log {
    max-height: 300px;
  }
  
  
  .share-qr {
    order: 1;
  }
  .host-language-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ---- Join page ---- */
.join-header {
  text-align: center;
  margin-bottom: 32px;
}
.join-header h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Funds ---- */
.fund-option {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}
.fund-option:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.fund-option .fund-amount {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}
.fund-option .fund-hours {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Features Tab ---- */
.plan-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

/* ---- Admin ---- */
.admin-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 72px);
}
.admin-sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.admin-sidebar a:hover { color: var(--text); background: var(--bg-hover); }
.admin-sidebar a.active {
  color: var(--primary);
  background: var(--primary-bg);
  border-right: 2px solid var(--primary);
  font-weight: 600;
}
.admin-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-page);
}
.admin-content h1 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* Sidebar group labels */
.admin-sidebar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 24px 4px;
  font-weight: 600;
  opacity: 0.6;
}

/* Color swatch for branding */
.color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 6px;
}

/* ---- Legal pages ---- */
.legal-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.legal-section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text);
}
.legal-section p, .legal-section li {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.legal-section ul { margin: 12px 0 0 20px; }
.legal-section a { color: var(--primary); }

/* ---- Divider ---- */
.divider { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ---- Search ---- */
.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}
.search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(133, 133, 133,0.12);
}

/* ---- Spinner ---- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }
.spinner-glow { box-shadow: 0 0 16px rgba(133, 133, 133,0.2); }

/* ---- Avatar ---- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}
.avatar-cyan { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.avatar-violet { background: linear-gradient(135deg, var(--accent), #585858); }
.avatar-emerald { background: var(--grad-brand); }

/* ---- Utility ---- */
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.bg-white { background: var(--bg); }
.bg-page { background: var(--bg-page); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  
  .hero { padding: 80px 20px 60px; }
  .section { padding: 60px 20px; }
  
  :root { --nav-h: 64px; }
  .navbar { padding: 0 22px; }
  .navbar .logo { font-size: 1.25rem; }
  .navbar .logo .logo-mark { width: 32px; height: 32px; }
  .navbar .theme-btn { margin-left: auto; }
  .navbar .nav-links { display: none; }
  .navbar.nav-minimal .nav-links { display: flex; }
  .nav-hamburger { display: inline-flex; }
  .page { padding: 24px 16px 48px; }
  .page-header { margin-bottom: 20px; align-items: flex-start; }
  .page-header .page-actions { width: 100%; }
  .page-header .page-actions .btn { flex: 1 1 auto; }
  .card { padding: 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  
  
  
  
  
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .tab { flex: 0 0 auto; padding: 9px 14px; }
  .flex-between { flex-wrap: wrap; gap: 12px; }
  
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    display: flex;
    overflow-x: auto;
  }
  .admin-sidebar a { padding: 8px 16px; white-space: nowrap; }
  .admin-sidebar-label { display: none; }
  .admin-content { padding: 20px 16px; }
  #team-detail-content > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  
  .upgrade-banner { flex-direction: column; text-align: center; }
  .auth-card { padding: 32px 24px; border-radius: var(--radius); }
  
  
  
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .btn-lg { padding: 14px 28px; font-size: 0.95rem; }
  .btn-xl { padding: 14px 28px; font-size: 0.95rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .language-grid { grid-template-columns: 1fr 1fr; }
  
}

/* ---- Screen Sharing ---- */
.screen-preview { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-hover); max-height: 200px; margin-bottom: 8px; }
.screen-preview img { width: 100%; display: block; object-fit: contain; max-height: 200px; }
.screen-display { border-radius: 8px; overflow: hidden; background: #000; }
.screen-display img { width: 100%; display: block; object-fit: contain; }

@keyframes gear-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(90deg); }
}

/* Feature overlay */
.feature-overlay-body {
  padding: 0;
}

/* ---- White-Label & Branding ---- */
.custom-header {
  padding: 16px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.custom-footer {
  padding: 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.powered-by-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.powered-by-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* White-label management page */
.wl-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.wl-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.wl-tab:hover { color: var(--text); }
.wl-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.wl-panel { display: none; }
.wl-panel.active { display: block; }

.logo-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-hover);
}
.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

input[type="color"] {
  width: 48px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: var(--bg);
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

.nav-links-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-link-row input {
  flex: 1;
}
.nav-link-row .btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.domain-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.domain-card .domain-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.domain-card .domain-status {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
}
.domain-card .domain-status.verified {
  background: #f1f1f1;
  color: #065f46;
}
.domain-card .domain-status.unverified {
  background: #f3f3f3;
  color: #92400e;
}
.domain-card .domain-actions {
  display: flex;
  gap: 8px;
}

.share-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.share-url-box input {
  flex: 1;
  border: none;
  background: none;
  font-size: 0.9rem;
  color: var(--text);
  font-family: monospace;
}

.preview-frame {
  width: 100%;
  height: 600px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.bar-row { display: flex; align-items: center; gap: 10px; }

.bar-track { flex: 1; height: 24px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }

/* Guest form on listen page */
#guest-form-section .card { max-width: 400px; margin: 0 auto; }

/* Quill editor overrides */
.ql-toolbar { border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important; border-color: var(--border) !important; }
.ql-container { border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; border-color: var(--border) !important; min-height: 120px; }
.ql-editor { min-height: 120px; font-family: var(--font-body); }

/* Bible Verse Card */
.bible-verse-card {
  background: linear-gradient(#f7f7f7, #f7f7f7);
  border: 1px solid #e6e6e6;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.bible-verse-card.bible-verse-show { animation: verseSlideIn 0.4s ease; }
.bible-verse-card.bible-verse-hide { opacity: 0; transform: translateY(-8px); }
.bible-verse-ref { font-weight: 700; font-size: 0.9rem; color: #92400e; margin-bottom: 6px; }
.bible-verse-text { font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; line-height: 1.7; color: #78350f; font-style: italic; }
@keyframes verseSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

textarea.embed-code {
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  resize: vertical;
}

/* Voice demo panel */
#demo-text { resize: vertical; min-height: 48px; }
#demo-ai-btn.loading, #demo-browser-btn.loading {
  opacity: 0.6; pointer-events: none;
}

/* Unified host transcript: one source line + grouped translations */
.unified-transcript-log {
  overflow-y: auto;
  padding: 8px 4px;
}
.transcript-entry {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border, rgba(162, 162, 162,0.18));
}
.transcript-entry:last-child { border-bottom: none; }
.transcript-entry .transcript-source {
  font-size: 0.92rem;
  line-height: 1.4;
}
.transcript-entry .transcript-translations {
  margin-top: 6px;
  padding-left: 16px;
  border-left: 2px solid var(--primary, #606060);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.transcript-entry .transcript-translations:empty { display: none; }
.transcript-entry .translation-row {
  font-size: 0.9rem;
  line-height: 1.4;
}
.transcript-entry .translation-label {
  display: inline-block;
  min-width: 90px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.transcript-entry .translation-text { color: var(--text); }

/* Listener voice settings */
#voice-settings details summary { list-style: none; }
#voice-settings details summary::-webkit-details-marker { display: none; }
#voice-settings details[open] summary { margin-bottom: 8px; }

/* Listener Immerse Mode (fullscreen + wake lock) */
#immerse-btn.immerse-on {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.immerse-wake-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(5,150,105,0.6);
  margin-left: 4px;
}
/* When the listen page enters fullscreen, give the player some breathing room. */
:fullscreen #content,
:-webkit-full-screen #content { padding-top: 24px; }

/* ----- Immerse Focus View -----
   Activated by `body.immerse-focus-on`. Hides everything else on the listener
   page and shows only the latest 2 translations in big, centered text. */
.immerse-focus {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 6vw;
  background: #000;
  color: #ffffff;
  z-index: 9999;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}
body.immerse-focus-on .immerse-focus { display: flex; }
body.immerse-focus-on > nav.navbar,
body.immerse-focus-on > .page { display: none !important; }

.immerse-focus-exit {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: inherit;
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.immerse-focus-exit:hover { background: rgba(255,255,255,0.18); }

.immerse-focus-stage {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  justify-content: center;
}

.immerse-focus-line {
  width: 100%;
  line-height: 1.25;
  font-weight: 600;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.immerse-focus-prev {
  font-size: clamp(20px, 3.8vw, 38px);
  color: #d4d4d4;
  opacity: 0.55;
  font-weight: 500;
}
.immerse-focus-current {
  font-size: clamp(36px, 7.2vw, 92px);
  color: #ffffff;
  font-weight: 700;
}
.immerse-focus-current::before {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  background: var(--primary, #606060);
  border-radius: 2px;
  margin: 0 auto 20px auto;
  opacity: 0.7;
}
.immerse-focus-line.fade-in {
  animation: immerseFadeIn 240ms ease-out;
}
@keyframes immerseFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.immerse-focus-prev.fade-in { animation-name: immerseFadeInDim; }
@keyframes immerseFadeInDim {
  from { opacity: 0; }
  to   { opacity: 0.45; }
}

.immerse-focus-hint {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom, 18px));
  font-size: 0.85rem;
  opacity: 0.5;
  text-align: center;
  padding: 0 16px;
}
body.immerse-focus-on .immerse-focus-hint { display: block; }
.immerse-focus-stage:has(.immerse-focus-current:not(:empty)) ~ .immerse-focus-hint {
  display: none;
}

/* ── Listener audio watchdog ─────────────────────────────────────────────
   Shown when the device stopped Web Audio and only a tap can restart it.
   Sits above the immerse focus view (z-index 9999). */
.audio-resume-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
}
.audio-resume-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 40px;
  border: none;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-solid);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.audio-resume-btn:active { transform: scale(0.98); }
.audio-resume-hint {
  margin: 0;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
}

/* Brief pill when playback skips queued sentences to catch up. Never blocks
   taps, visible over the immerse focus view too. */
.audio-skip-notice {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 10001;
  transform: translate(-50%, 8px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.88);
  color: #ffffff;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.audio-skip-notice.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal:focus, .modal:focus-visible { outline: none; }
