/* ==========================================================
   Listener experience — join page, listen page, embed widget
   Loaded after style.css. Tokens only; night mode = data-theme="dark".
   ========================================================== */

:root {
  --lsn-scale: 1;
  /* Scripture accent (amber), tuned per theme for contrast */
  --lsn-verse-accent: #f59e0b;
  --lsn-verse-ref: #92400e;
  --lsn-verse-text: #78350f;
  --lsn-verse-bg: linear-gradient(#f3f3f3, #f3f3f3);
  --lsn-verse-border: #e6e6e6;
  --lsn-bar-h: 72px;
}
[data-theme="dark"] {
  --lsn-verse-ref: #d7d7d7;
  --lsn-verse-text: #e6e6e6;
  --lsn-verse-bg: var(--bg-subtle);
  --lsn-verse-border: rgba(200, 200, 200, 0.28);
}
/* Night mode must win over a white-label background color, which
   APP.applyBranding writes as an inline style on <html>. */
html[data-theme="dark"] { --bg-page: #070b14 !important; }

body.lsn-body { background: var(--bg-page); }
.lsn-body .navbar .logo { max-width: calc(100vw - 120px); overflow: hidden; }
.lsn-body .navbar .logo img { border-radius: 10px; }

.lsn-page { max-width: 760px; padding: 20px 16px 48px; }

/* Round icon button used for the night-mode toggle */
.lsn-theme-toggle {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: color var(--dur) ease, border-color var(--dur) ease, background var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.lsn-theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.lsn-theme-toggle:active { transform: scale(0.94); }
.lsn-theme-toggle svg { width: 20px; height: 20px; }
.lsn-theme-toggle[aria-pressed="true"] { color: var(--warning); }

/* ==========================================================
   LISTEN PAGE
   ========================================================== */
.lsn-listen .lsn-page { padding-bottom: calc(var(--lsn-bar-h) + 40px + var(--safe-bottom)); }

/* Event pill above the picker */
.lsn-event-eyebrow {
  display: flex; align-items: center; gap: 8px;
  width: fit-content; max-width: 100%;
  margin: 0 auto 20px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--bg-card); box-shadow: var(--shadow-xs);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
}
.lsn-event-eyebrow.hidden { display: none; }
.lsn-event-eyebrow #listen-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn-event-eyebrow .live-dot { flex-shrink: 0; }
/* In the player the "now playing" card carries the event name */
.lsn-page:has(#player-section:not(.hidden)) #team-header { display: none; }

/* ---- Language picker ---- */
.lsn-picker { animation: fadeUp var(--dur-slow) var(--ease-out) both; }
.lsn-picker-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  margin-bottom: 20px;
}
.lsn-picker-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-primary);
}
.lsn-picker-icon svg { width: 28px; height: 28px; }
.lsn-picker-head h1 { font-size: var(--fs-3xl); margin: 0; }
.lsn-picker-head p { color: var(--text-muted); margin-top: 4px; font-size: var(--fs-base); line-height: 1.5; }
.lsn-picker-head .lsn-theme-toggle { align-self: start; }

/* "Continue in …" */
.lsn-recent { margin-bottom: 16px; }
.lsn-recent-btn {
  width: 100%; display: flex; align-items: center; gap: 14px;
  min-height: 80px; padding: 14px 16px;
  border: 0; border-radius: var(--radius-lg);
  background: var(--grad-brand); color: #fff; text-align: left; cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(96, 96, 96, 0.55), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.lsn-recent-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(96, 96, 96, 0.6); }
.lsn-recent-btn:active { transform: scale(0.99); }
.lsn-recent-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.lsn-recent-btn .lang-badge { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.25); color: #fff; }
.lsn-recent-text { display: flex; flex-direction: column; min-width: 0; }
.lsn-recent-label { font-size: var(--fs-sm); font-weight: 500; opacity: 0.9; }
.lsn-recent-lang { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsn-recent-go {
  margin-left: auto; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,0.2);
}
.lsn-recent-go svg { width: 22px; height: 22px; }

/* Search */
.lsn-search { margin-bottom: 16px; }
.lsn-picker .lsn-search {
  position: sticky; top: calc(var(--nav-h) + 8px); z-index: 5;
  border-radius: var(--radius);
  box-shadow: 0 8px 18px -14px rgba(23, 23, 23, 0.35);
}
.lsn-search .search-input {
  -webkit-appearance: none; appearance: none;
  min-height: 52px; font-size: var(--fs-base);
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding-left: 46px;
}
.lsn-search .search-input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.lsn-search .search-icon { width: 20px; height: 20px; left: 15px; }

/* Language list */
.lsn-body .language-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 10px; margin-top: 0;
}
.lsn-body .language-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 68px; padding: 12px 14px;
  font: inherit; color: inherit; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  animation: fadeIn var(--dur) ease both;
}
.lsn-body .language-card:hover { border-color: var(--primary); background: var(--primary-bg); transform: translateY(-2px); box-shadow: var(--shadow); }
.lsn-body .language-card:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.lsn-body .language-card.featured { background: var(--bg-card); border-color: var(--border); }
.lsn-body .language-card.featured:hover { background: var(--primary-bg); border-color: var(--primary); }
.lsn-body .language-card.featured::after { content: none; }
.lsn-body .language-card.is-current { border-color: var(--primary); background: var(--primary-bg); box-shadow: 0 0 0 1px var(--primary) inset; }
.lsn-body .language-card .lang-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lsn-body .language-card .lang-native {
  font-size: 1.125rem; font-weight: 600; color: var(--text); margin: 0; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lsn-body .language-card .lang-name {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lsn-body .language-card .lang-go { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; transition: transform var(--dur) var(--ease-out), color var(--dur) ease; }
.lsn-body .language-card:hover .lang-go { color: var(--primary); transform: translateX(2px); }
.lsn-body .language-card.is-current .lang-go { color: var(--primary); }

.lang-badge {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border); background: var(--bg-subtle);
}
.lang-badge-flag img { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.1); }
.lang-badge-mono {
  font-family: var(--font-heading); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--primary); background: var(--primary-bg); border-color: var(--primary-border);
}

.lsn-body .lang-section-divider { grid-column: 1 / -1; text-align: left; padding: 14px 2px 2px; }
.lsn-body .lang-section-divider:first-child { padding-top: 0; }
.lsn-body .lang-section-divider::before { content: none; }
.lsn-body .lang-section-divider span {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; padding: 0;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-light);
}
.lsn-body .lang-section-divider svg { width: 14px; height: 14px; }

.lsn-skel-card { display: block; height: 68px; border-radius: var(--radius); margin-bottom: 10px; }
.lsn-list-msg {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 16px; text-align: center; color: var(--text-muted);
}
.lsn-list-msg svg { width: 28px; height: 28px; color: var(--text-faint); }

/* ---- Guest form (sheet on phones, dialog on desktop) ---- */
.lsn-sheet-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--overlay);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn var(--dur) ease both;
}
.lsn-sheet {
  width: 100%; max-width: 440px; margin: auto;
  padding: 28px 24px 24px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: modalIn var(--dur-slow) var(--ease-out) both;
}
.lsn-sheet form { text-align: left; }
.lsn-sheet-grabber { display: none; }
.lsn-sheet-icon {
  width: 60px; height: 60px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 20px;
  background: var(--grad-brand-soft); color: var(--primary);
}
.lsn-sheet-icon svg { width: 30px; height: 30px; }
.lsn-sheet h2 { font-size: var(--fs-2xl); margin-bottom: 6px; }
.lsn-sheet-desc { color: var(--text-muted); margin-bottom: 20px; font-size: var(--fs-base); }
.lsn-sheet .form-group label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-secondary); }
.lsn-sheet .form-control { min-height: 50px; font-size: var(--fs-base); }
.lsn-sheet .lsn-skip { margin-top: 8px; color: var(--text-muted); }
.lsn-sheet-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; font-size: var(--fs-xs); color: var(--text-light); text-align: center;
}
.lsn-sheet-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---- Player ---- */
/* Opacity-only entrance: a transform here would trap the fixed control bar. */
.lsn-player { animation: fadeIn var(--dur-slow) var(--ease-out) both; }

/* The service on air */
.lsn-now {
  display: grid; gap: 12px;
  padding: 16px 18px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px;
}
.lsn-now-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.lsn-now-meta { min-width: 0; flex: 1; }
.lsn-now-team {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lsn-now-team:empty { display: none; }
.lsn-now-title {
  font-family: var(--font-heading); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Connection status chip (#listen-status-ring keeps its legacy class names) */
.lsn-now .status-ring {
  width: auto; height: auto; min-height: 32px; max-width: 58%; margin: 0;
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--bg-subtle); box-shadow: none; animation: none;
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  transition: background var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease;
}
.lsn-now .status-ring #listen-status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn-now .status-ring .status-icon {
  width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%;
  background: var(--text-faint);
}
.lsn-now .status-ring.connected {
  color: var(--success); background: var(--success-bg); border-color: var(--success-border);
  box-shadow: none; animation: none;
}
.lsn-now .status-ring.connected .status-icon { background: var(--success); animation: lsnPingGreen 1.8s var(--ease-out) infinite; }
.lsn-now .status-ring.reconnecting {
  color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border);
  box-shadow: none; animation: none;
}
.lsn-now .status-ring.reconnecting .status-icon { background: var(--warning); animation: pulse 1.2s ease-in-out infinite; }
@keyframes lsnPingGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  80%, 100% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

/* Language chip */
.lsn-lang-chip {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; min-width: 0; max-width: 100%;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--bg-card); color: var(--text);
  font-size: var(--fs-base); font-weight: 600; cursor: pointer;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease, background var(--dur) ease;
}
.lsn-lang-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lsn-lang-chip:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.lsn-lang-chip-badge {
  width: 34px; height: 34px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
}
.lsn-lang-chip-badge svg { width: 18px; height: 18px; }
.lsn-lang-chip-badge .lang-badge { width: 34px; height: 34px; border-radius: 50%; border: 0; }
.lsn-lang-chip-badge .lang-badge-flag img { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.lsn-lang-chip-badge .lang-badge-mono { font-size: 0.68rem; }
.lsn-lang-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a meeting's "Listening in Vietnamese" (widget.js): two lines on a narrow phone rather than "Listening in Vietnam…" */
.lsn-lang-chip-name.is-sentence { white-space: normal; overflow: visible; line-height: 1.15; text-align: left; overflow-wrap: anywhere; }
.lsn-lang-chip-caret { width: 16px; height: 16px; color: var(--text-light); flex-shrink: 0; }

/* Speaking indicator */
.lsn-speaking { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lsn-speaking-label {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--primary); opacity: 0; transition: opacity var(--dur) ease;
}
.lsn-speaking.is-speaking .lsn-speaking-label { opacity: 1; }
.lsn-now .audio-visualizer {
  width: auto; height: 28px; padding: 0; gap: 3px;
  background: none; border-radius: 0; overflow: visible;
}
.lsn-now .wave-bar {
  width: 3px; height: 6px; border-radius: 3px;
  background: var(--border-strong);
  animation: lsnWave 0.95s ease-in-out infinite; animation-play-state: paused;
  transition: background var(--dur) ease;
}
.lsn-now .audio-visualizer.is-speaking .wave-bar { background: var(--primary); animation-play-state: running; }
.lsn-now .wave-bar:nth-child(2n) { animation-duration: 0.8s; }
.lsn-now .wave-bar:nth-child(3n) { animation-duration: 1.1s; }
@keyframes lsnWave { 0%, 100% { height: 5px; } 50% { height: 24px; } }

/* Status banner */
.lsn-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--warning-border); border-radius: var(--radius);
  background: var(--warning-bg); color: var(--text-secondary);
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.5;
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.lsn-banner svg { width: 18px; height: 18px; color: var(--warning); flex-shrink: 0; margin-top: 1px; }

/* Device speech can't play here (TINL-1428): the notice text, plus a dismiss button sized for a thumb */
.lsn-speech-notice > span { flex: 1; color: var(--text); }
.lsn-banner-close {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -12px -10px -12px 0;
  border: 0; border-radius: var(--radius-full); background: transparent;
  color: var(--text-secondary); cursor: pointer;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.lsn-banner-close:hover { background: var(--bg-hover); color: var(--text); }
.lsn-banner-close:focus-visible { outline: none; box-shadow: var(--ring); }
.lsn-banner-close svg { width: 18px; height: 18px; color: currentColor; margin: 0; }

/* Scripture card */
.lsn-player .bible-verse-card {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 12px; padding: 14px 16px;
  background: var(--lsn-verse-bg);
  border: 1px solid var(--lsn-verse-border); border-left: 4px solid var(--lsn-verse-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.lsn-player .bible-verse-card.hidden { display: none; }
.lsn-player .bible-verse-card.bible-verse-show { animation: fadeUp var(--dur-slow) var(--ease-out) both; }
.bible-verse-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 10px;
  background: rgba(245, 158, 11, 0.16); color: var(--lsn-verse-ref);
}
.bible-verse-icon svg { width: 18px; height: 18px; }
.bible-verse-body { min-width: 0; }
.lsn-player .bible-verse-ref { color: var(--lsn-verse-ref); font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.01em; margin-bottom: 4px; }
.lsn-player .bible-verse-text { color: var(--lsn-verse-text); font-size: calc(1.0625rem * var(--lsn-scale)); line-height: 1.65; }

/* Above-the-fold column: now playing + notices + transcript fill the space
   between the nav and the control bar; notices shrink the transcript. */
.lsn-player-main {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-h) - 104px - var(--safe-bottom));
  height: calc(100dvh - var(--nav-h) - 104px - var(--safe-bottom));
  min-height: 440px;
}
.lsn-player-main > .lsn-now, .lsn-player-main > .lsn-banner, .lsn-player-main > .bible-verse-card { flex-shrink: 0; }

/* Live translation stage */
.lsn-stage {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 220px;
  position: relative; margin-top: 12px; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px;
}
.lsn-stage-head {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border-light);
}
.lsn-stage-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0;
  color: var(--text-muted);
}
.lsn-stage-title svg { width: 16px; height: 16px; color: var(--primary); }

.lsn-size { display: inline-flex; flex-shrink: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--bg-subtle); overflow: hidden; }
.lsn-size-btn {
  min-width: 52px; height: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 1px;
  border: 0; background: transparent; color: var(--text);
  font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; cursor: pointer;
  transition: background var(--dur-fast) ease;
}
.lsn-size-btn + .lsn-size-btn { border-left: 1px solid var(--border-strong); }
.lsn-size-btn:hover:not(:disabled) { background: var(--bg-hover); }
.lsn-size-btn:focus-visible { outline: none; box-shadow: var(--ring) inset; }
.lsn-size-btn:disabled { opacity: 0.35; cursor: default; }
.lsn-size-a { font-size: 1.2rem; line-height: 1; }
.lsn-size-a-sm { font-size: 0.85rem; }

.lsn-stage .lsn-log {
  flex: 1 1 auto; height: auto; min-height: 0; max-height: none;
  padding: 8px 16px 28px;
  border: 0; border-radius: 0; background: transparent;
  overflow-y: auto; overscroll-behavior: contain;
}
.lsn-stage .lsn-log:focus-visible { outline: none; box-shadow: var(--ring) inset; }
.lsn-log .transcript-line {
  padding: 10px 0; border: 0;
  font-size: calc(1.0625rem * var(--lsn-scale)); line-height: 1.5; font-weight: 500;
  /* Earlier lines fade by color, not opacity, so every line keeps AA contrast. */
  color: var(--text-light);
  overflow-wrap: anywhere;
  transition: color var(--dur) ease, font-size var(--dur) var(--ease-out);
  animation: lsnLineIn var(--dur-slow) var(--ease-out) both;
}
.lsn-log .transcript-line:nth-last-child(2) { color: var(--text-muted); }
/* The sentence being heard now: larger, and marked with an ink rule */
.lsn-log .transcript-line:last-child {
  font-size: calc(1.375rem * var(--lsn-scale)); line-height: 1.42; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text);
  padding-left: 14px; border-left: 3px solid var(--text); border-radius: 2px;
}
.lsn-branded .lsn-log .transcript-line:last-child { border-left-color: var(--primary); }
.lsn-log .transcript-time { display: none; }
.lsn-log .transcript-line:last-child .transcript-time {
  display: block; margin: 0 0 4px;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.lsn-log .transcript-line.transcript-singing {
  background: none; border-left: 3px solid var(--accent); padding-left: 12px; font-style: italic;
}
.lsn-log .singing-icon { color: var(--accent); }
@keyframes lsnLineIn { from { opacity: 0; transform: translateY(8px); } }

.lsn-log-empty {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 24px 12px; text-align: center; color: var(--text-muted);
}
.lsn-log-empty-title { font-size: calc(1.25rem * var(--lsn-scale)); font-weight: 600; color: var(--text); }
.lsn-log-empty-hint { max-width: 34ch; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.55; }
.lsn-typing { display: inline-flex; gap: 6px; margin-bottom: 10px; }
.lsn-typing i { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); opacity: 0.25; animation: lsnTyping 1.3s ease-in-out infinite; }
.lsn-typing i:nth-child(2) { animation-delay: 0.18s; }
.lsn-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes lsnTyping { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.lsn-jump {
  position: absolute; left: 50%; bottom: 14px; z-index: 2;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px 8px 16px;
  border: 0; border-radius: var(--radius-full);
  background: var(--text); color: var(--bg);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-lg);
  animation: lsnPop var(--dur) var(--ease-out) both;
}
.lsn-jump svg { width: 16px; height: 16px; }
.lsn-jump-count {
  min-width: 22px; padding: 1px 7px; border-radius: var(--radius-full);
  background: var(--primary); color: var(--text-on-primary);
  font-size: var(--fs-xs); font-weight: 700; text-align: center;
}
@keyframes lsnPop { from { opacity: 0; transform: translate(-50%, 8px) scale(0.96); } }

/* Secondary cards: shared screen, original transcript, voice */
.lsn-card {
  margin-top: 12px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.lsn-card.hidden { display: none; }
.lsn-card-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0;
  color: var(--text-muted);
}
.lsn-card-title svg, .lsn-card-subtitle svg { width: 16px; height: 16px; color: var(--primary); }
.lsn-card-subtitle { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-light); }
.lsn-card .screen-display { border-radius: var(--radius-sm); background: #000; }
.lsn-card .screen-display img { width: 100%; display: block; border-radius: var(--radius-sm); }
.lsn-screen-context { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
#screen-context-text { margin: 0; font-size: calc(0.95rem * var(--lsn-scale)); line-height: 1.6; color: var(--text-secondary); }

.lsn-disclosure { padding: 0; }
.lsn-disclosure > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 16px; border-radius: var(--radius-lg);
}
.lsn-disclosure > summary::-webkit-details-marker { display: none; }
.lsn-disclosure > summary .lsn-card-title { margin: 0; }
.lsn-disclosure > summary:hover .lsn-card-title { color: var(--text); }
.lsn-disclosure-caret { width: 18px; height: 18px; color: var(--text-light); transition: transform var(--dur) var(--ease-out); }
.lsn-disclosure[open] .lsn-disclosure-caret { transform: rotate(180deg); }
.lsn-host-log.transcript-log {
  min-height: 0; max-height: 280px; padding: 0 16px 10px;
  border: 0; border-top: 1px solid var(--border-light); border-radius: 0; background: transparent;
}
.lsn-host-log .transcript-line {
  padding: 8px 0; font-size: calc(0.95rem * var(--lsn-scale)); line-height: 1.55;
  color: var(--text-secondary); border-bottom: 1px solid var(--border-light);
}
.lsn-host-log .transcript-line:last-child { border-bottom: 0; }
.lsn-host-log .transcript-time { font-size: 0.7rem; color: var(--text-faint); margin-right: 6px; font-variant-numeric: tabular-nums; }
.lsn-host-empty { padding: 14px 0 6px; font-size: var(--fs-sm); color: var(--text-light); text-align: center; }
.line-pending { color: var(--text-light); font-style: italic; }
.line-pending-tag { font-size: 0.8em; font-style: normal; color: var(--warning); }

#voice-settings.lsn-card { padding: 0; }
.lsn-voice-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px 16px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
}
.lsn-voice-summary::-webkit-details-marker { display: none; }
.lsn-voice-summary svg { width: 16px; height: 16px; color: var(--primary); }
.lsn-voice-body { padding: 0 16px 14px; }
.lsn-voice-body label { display: block; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }

/* Sticky player controls */
.lsn-controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  display: flex; justify-content: center; gap: 4px;
  padding: 8px max(12px, env(safe-area-inset-left, 0px)) calc(8px + var(--safe-bottom));
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px -20px rgba(23, 23, 23, 0.25);
}
/* Phones: the bar floats above the bottom edge, like the app's tab bar */
@media (max-width: 767px) {
  .lsn-controls {
    left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom));
    padding: 6px; border: 1px solid var(--border); border-radius: 24px;
    box-shadow: var(--shadow-lg);
  }
  .lsn-listen .lsn-page { padding-bottom: calc(var(--lsn-bar-h) + 52px + var(--safe-bottom)); }
}
.lsn-ctrl {
  position: relative; flex: 1 1 0; min-width: 0; max-width: 120px; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 4px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-muted);
  font-size: 0.75rem; font-weight: 600; line-height: 1.15; cursor: pointer;
  transition: background var(--dur) ease, color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.lsn-ctrl.hidden { display: none; }
.lsn-ctrl svg { width: 22px; height: 22px; flex-shrink: 0; }
.lsn-ctrl > span:not(.immerse-wake-dot) { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn-ctrl:hover { background: var(--bg-hover); color: var(--text); }
.lsn-ctrl:active { transform: scale(0.96); }
.lsn-ctrl:focus-visible { outline: none; box-shadow: var(--ring); }
.lsn-ctrl[aria-pressed="true"] { color: var(--primary); background: var(--primary-bg); }
#audio-toggle-btn.is-off, #audio-toggle-btn[aria-pressed="false"] { color: var(--warning); background: var(--warning-bg); }
.lsn-ctrl .immerse-wake-dot { position: absolute; top: 8px; right: calc(50% - 20px); margin: 0; }
.lsn-ctrl#immerse-btn.immerse-on { border: 0; }

/* Footer */
.lsn-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 28px; text-align: center; }
.lsn-install-hint { max-width: 300px; font-size: var(--fs-xs); color: var(--text-light); }
.lsn-powered { padding: 4px 0 0; }

/* Switch-language sheet */
.lsn-lang-modal { max-width: 600px; padding: 24px; }
.lsn-lang-modal h2 { margin-bottom: 14px; padding-right: 40px; }
.lsn-lang-modal .lsn-search { position: sticky; top: -24px; z-index: 3; margin: 0 -4px 12px; padding: 8px 4px; background: var(--bg-card); }
.lsn-sheet-current { margin-bottom: 8px; }
.lsn-keep-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--primary-border); border-radius: var(--radius);
  background: var(--primary-bg); color: var(--text); font: inherit; font-weight: 600;
}
.lsn-keep-btn:hover { border-color: var(--primary); }
.lsn-keep-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.lsn-keep-btn .lang-badge { width: 36px; height: 36px; border-radius: 10px; }
.lsn-keep-btn small { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
.lsn-keep-btn > svg { width: 20px; height: 20px; margin-left: auto; color: var(--primary); flex-shrink: 0; }
.lsn-body .lsn-sheet-list { grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 641px) { .lsn-body .lsn-sheet-list { grid-template-columns: 1fr 1fr; } }

/* Audio watchdog overlay + skip notice (sit above immerse view) */
.audio-resume-overlay {
  gap: 22px; padding: 24px;
  background: rgba(7, 7, 7, 0.84);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fadeIn var(--dur) ease both;
}
.audio-resume-btn {
  gap: 16px; min-width: min(320px, 100%); padding: 32px 36px;
  border-radius: var(--radius-xl);
  background: var(--grad-brand); color: #fff;
  font-family: var(--font-heading); font-size: 1.5rem; letter-spacing: -0.01em;
  box-shadow: 0 24px 60px -12px rgba(96, 96, 96, 0.65), inset 0 1px 0 rgba(255,255,255,0.2);
  animation: modalIn var(--dur-slow) var(--ease-out) both;
}
.audio-resume-btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.audio-resume-icon {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.18);
  animation: lsnRing 1.8s var(--ease-out) infinite;
}
.audio-resume-icon svg { width: 46px; height: 46px; }
@keyframes lsnRing {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  100% { box-shadow: 0 0 0 24px rgba(255, 255, 255, 0); }
}
.audio-resume-hint { color: rgba(255, 255, 255, 0.9); font-size: 1.05rem; line-height: 1.55; }

.lsn-listen .audio-skip-notice {
  bottom: calc(var(--lsn-bar-h) + 20px + var(--safe-bottom));
  max-width: calc(100vw - 32px); padding: 10px 18px;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: 600; text-align: center;
}
body.immerse-focus-on .audio-skip-notice { bottom: calc(64px + var(--safe-bottom)); }

/* Immerse focus view: typography polish (layout lives in style.css) */
.immerse-focus { background: #000; }
.immerse-focus-exit svg { width: 22px; height: 22px; }
.immerse-focus-exit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.immerse-focus-current::before { background: var(--grad-brand); opacity: 1; }
body.immerse-focus-on .lsn-controls { display: none; }

/* Phones */
@media (max-width: 640px) {
  .lsn-page { padding: 16px 16px 40px; }
  .lsn-picker-head { grid-template-columns: 1fr auto; gap: 12px; }
  .lsn-picker-icon { display: none; }
  .lsn-sheet-backdrop { align-items: flex-end; padding: 0; }
  .lsn-sheet {
    max-width: none; max-height: 92vh; overflow-y: auto; margin: 0;
    padding: 10px 20px calc(20px + var(--safe-bottom));
    border-radius: 22px 22px 0 0; border-bottom: 0;
    animation: sheetIn var(--dur-slow) var(--ease-out) both;
  }
  .lsn-sheet-grabber { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: var(--border-strong); }
  .lsn-lang-modal { padding: 22px 16px calc(16px + var(--safe-bottom)); }
  .lsn-lang-modal .lsn-search { top: -22px; }
}
@media (max-width: 400px) {
  .lsn-speaking-label { display: none; }
  .lsn-now { padding: 12px 14px; }
  .lsn-now-title { font-size: var(--fs-lg); }
  .lsn-lang-chip { font-size: var(--fs-sm); }
  .lsn-ctrl { font-size: 0.7rem; }
}

/* Larger screens: floating control dock */
@media (min-width: 768px) {
  .lsn-page { padding-top: 32px; }
  .lsn-controls {
    left: 50%; right: auto; bottom: calc(20px + var(--safe-bottom));
    transform: translateX(-50%);
    padding: 8px; gap: 6px;
    border: 1px solid var(--border); border-radius: 22px;
    box-shadow: var(--shadow-lg);
  }
  .lsn-ctrl { flex: 0 0 auto; width: 104px; max-width: none; }
  .lsn-listen .lsn-page { padding-bottom: calc(var(--lsn-bar-h) + 64px); }
  .lsn-player-main {
    height: calc(100vh - var(--nav-h) - 236px);    /* room for the floating dock under the collapsed host transcript */
    height: calc(100dvh - var(--nav-h) - 236px);
    max-height: 1000px; min-height: 520px;
  }
}

/* ==========================================================
   JOIN PAGE (/j/:slug)
   ========================================================== */
.lsn-join .lsn-page { max-width: 640px; padding-top: 24px; }

/* The church's name, plain and large on a flat panel */
.lsn-hero {
  position: relative; text-align: center;
  margin: 0 0 28px; padding: 40px 24px 32px;
  background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 28px;
  overflow: hidden;
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.lsn-hero > * { position: relative; }
.lsn-hero-theme { position: absolute; top: 14px; right: 14px; z-index: 1; }
.lsn-hero-avatar {
  width: 88px; height: 88px; margin: 0 auto 18px;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 26px; background: var(--grad-brand); color: #fff;
  font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em;
}
.lsn-hero-avatar.has-logo { background: var(--bg-card); border: 1px solid var(--border); }
.lsn-hero-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.lsn-hero-avatar-skel { width: 100%; height: 100%; border-radius: 0; }
.lsn-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.lsn-hero-eyebrow svg { width: 14px; height: 14px; }
.lsn-join .join-header { margin-bottom: 28px; }
.lsn-join .join-header h1 {
  font-size: var(--fs-4xl); line-height: 1.1;
  background: none; -webkit-text-fill-color: currentColor; color: var(--text);
  overflow-wrap: anywhere;
}
.lsn-skel-title { display: inline-block; width: 60%; height: 36px; vertical-align: middle; }
.lsn-hero-desc { max-width: 46ch; margin: 10px auto 0; color: var(--text-muted); font-size: var(--fs-base); line-height: 1.6; }
.lsn-hero-desc:empty { display: none; }

.lsn-section-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: var(--fs-lg); font-weight: 600;
}
.lsn-section-title svg { width: 20px; height: 20px; color: var(--text-light); }
.lsn-section-title.is-live svg { color: var(--live); }

/* Live event cards */
.lsn-event-card {
  margin-bottom: 14px; padding: 22px 20px 18px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.lsn-event-card.is-live { border-color: var(--primary-border); box-shadow: var(--shadow-glow); }
.lsn-event-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lsn-event-top .badge { font-size: 0.75rem; padding: 4px 12px; }
.lsn-event-title { font-size: var(--fs-2xl); margin: 0 0 6px; overflow-wrap: anywhere; }
.lsn-event-desc { color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.lsn-event-card .lsn-listen-cta { margin-top: 12px; min-height: 64px; font-size: 1.2rem; border-radius: 16px; }
.lsn-event-card .lsn-listen-cta svg { width: 22px; height: 22px; }
.lsn-event-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; font-size: var(--fs-sm); color: var(--text-muted); text-align: center;
}
.lsn-event-note svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--primary); }
.lsn-event-skel {
  padding: 22px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card);
}
.lsn-skel-btn { display: block; height: 60px; margin-top: 18px; border-radius: 16px; }

/* Waiting for the broadcast */
.lsn-waiting {
  padding: 32px 22px 26px; text-align: center;
  background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.lsn-waiting h3 { font-size: var(--fs-2xl); margin: 18px 0 6px; }
.lsn-waiting p { max-width: 38ch; margin: 0 auto; color: var(--text-muted); font-size: var(--fs-base); line-height: 1.6; }
.lsn-waiting-visual { position: relative; width: 96px; height: 96px; margin: 0 auto; display: grid; place-items: center; }
.lsn-waiting-core {
  position: relative; z-index: 1;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary-border);
}
.lsn-waiting-core svg { width: 28px; height: 28px; }
.lsn-waiting-ring {
  position: absolute; inset: 16px; border-radius: 50%;
  border: 2px solid rgba(var(--primary-rgb), 0.35);
  animation: lsnBroadcast 2.6s var(--ease-out) infinite;
}
.lsn-waiting-ring + .lsn-waiting-ring { animation-delay: 1.3s; }
@keyframes lsnBroadcast { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
.lsn-waiting-status {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px;
  padding: 8px 14px; border-radius: var(--radius-full);
  background: var(--bg-subtle); border: 1px solid var(--border);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
}
.lsn-waiting-status .lsn-typing { margin: 0; gap: 4px; }
.lsn-waiting-status .lsn-typing i { width: 6px; height: 6px; }
.lsn-event-card .lsn-waiting-status { margin-top: 4px; }

/* Tips */
.lsn-tips { display: grid; gap: 10px; margin-top: 28px; }
.lsn-tip {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border-light);
}
.lsn-tip-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; background: var(--grad-brand-soft); color: var(--primary);
}
.lsn-tip-icon svg { width: 20px; height: 20px; }
.lsn-tip strong { display: block; font-size: var(--fs-base); color: var(--text); }
.lsn-tip p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; }
@media (min-width: 641px) {
  .lsn-tips { grid-template-columns: repeat(3, 1fr); }
  .lsn-tip { flex-direction: column; gap: 10px; }
}
.lsn-join .powered-by-footer { padding: 8px 16px calc(28px + var(--safe-bottom)); }
.lsn-empty { margin-top: 24px; }

/* Guest dialog (bottom sheet on phones via the shared .modal rules) */
.lsn-guest-modal { max-width: 440px; }
.lsn-guest-head { text-align: center; }
.lsn-guest-modal h2 { margin: 0 0 6px; font-size: var(--fs-2xl); }
.lsn-guest-modal .form-group label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-secondary); }
.lsn-guest-modal .form-control { min-height: 50px; font-size: var(--fs-base); }
.lsn-guest-hint { margin: -6px 0 14px; }
.lsn-guest-modal .alert { margin-bottom: 14px; }

@media (max-width: 640px) {
  .lsn-hero { padding: 30px 18px 22px; border-radius: var(--radius-lg); }
  .lsn-hero-avatar { width: 76px; height: 76px; border-radius: 22px; font-size: 1.75rem; }
  .lsn-event-card { padding: 20px 16px 16px; }
}

/* White-label: when a team sets its own color, brand surfaces follow it
   (applyBranding only rewrites --primary, not the TruBible gradient). */
/* A church with its own brand colour: the same plain layout, tinted with that colour */
.lsn-branded .lsn-hero { background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.10), var(--bg-card) 72%); }
.lsn-branded .lsn-log .transcript-line:last-child { border-left-color: var(--primary); }
.lsn-branded .lsn-hero-eyebrow { color: var(--primary); }
.lsn-branded {
  --primary-bg: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
  --primary-border: color-mix(in srgb, var(--primary) 35%, transparent);
}
.lsn-branded .btn-brand,
.lsn-branded .lsn-recent-btn,
.lsn-branded .lsn-hero-avatar:not(.has-logo),
.lsn-branded .lsn-picker-icon,
.lsn-branded .audio-resume-btn,
.lsn-branded .immerse-focus-current::before { background: var(--primary); }
.lsn-branded .btn-brand, .lsn-branded .lsn-recent-btn { box-shadow: var(--shadow-md); }
.lsn-branded .lsn-hero::before { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.lsn-branded .lsn-tip-icon, .lsn-branded .lsn-sheet-icon { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.lsn-branded .navbar .logo { background: none; -webkit-text-fill-color: currentColor; color: var(--text); }

/* ==========================================================
   EMBED WIDGET (/widget.html, usually in a ~400×600 iframe)
   ========================================================== */
body.lsn-widget { background: var(--widget-bg, var(--bg-page)); min-height: 100vh; min-height: 100dvh; }
.wdg { display: flex; flex-direction: column; gap: 12px; min-height: 100vh; min-height: 100dvh; padding: 14px; }
.wdg-head { display: flex; align-items: center; gap: 12px; }
.wdg-logo {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; background: var(--grad-brand); color: #fff;
}
.lsn-branded .wdg-logo { background: var(--primary); }
.wdg-logo svg { width: 20px; height: 20px; }
.wdg-head-text { min-width: 0; }
.wdg-eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.wdg-head h2 { font-size: var(--fs-lg); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wdg-picker .lsn-search { margin-bottom: 10px; }
.wdg-picker .lsn-search .search-input { min-height: 46px; }
.lsn-widget .wdg-langs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
.lsn-widget .language-card { min-height: 56px; padding: 10px 12px; gap: 10px; }
.lsn-widget .language-card .lang-native { font-size: var(--fs-base); }
.lsn-widget .language-card .lang-name { font-size: var(--fs-xs); }
.wdg-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
.wdg-msg p { max-width: 32ch; }
.wdg-msg-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-subtle); color: var(--text-light); border: 1px solid var(--border);
}
.wdg-msg-icon.is-live { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-border); animation: pulse 2s ease-in-out infinite; }
.wdg-msg-icon svg { width: 24px; height: 24px; }

.wdg-player { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.wdg-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wdg-bar .lsn-lang-chip { min-height: 44px; font-size: var(--fs-sm); }
.wdg-bar .lsn-lang-chip-badge { width: 30px; height: 30px; }
.lsn-widget .status {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 55%;
  margin: 0; padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--bg-subtle);
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lsn-widget .status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.lsn-widget .status.connected { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.lsn-widget .status.connected::before { background: var(--success); animation: lsnPingGreen 1.8s var(--ease-out) infinite; }
.lsn-widget .status.reconnecting { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.lsn-widget .status.reconnecting::before { background: var(--warning); animation: pulse 1.2s ease-in-out infinite; }

.lsn-widget .wdg-log {
  flex: 1 1 auto; min-height: 220px; max-height: none; height: auto;
  padding: 6px 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow-y: auto; overscroll-behavior: contain;
}
.lsn-widget .wdg-log .transcript-line:last-child { font-size: calc(1.2rem * var(--lsn-scale)); }
.wdg-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 8px; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.wdg-empty .lsn-typing { margin: 0; }
.wdg-source { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.wdg-source > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
}
.wdg-source > summary::-webkit-details-marker { display: none; }
.wdg-source > summary svg { width: 16px; height: 16px; color: var(--primary); }
.wdg-source .transcript-box { max-height: 160px; overflow-y: auto; padding: 0 14px 10px; border-top: 1px solid var(--border-light); }
.wdg-source .transcript-line { padding: 6px 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
.wdg-source .wdg-empty { padding: 12px 0; }
.lsn-widget .btn-back { min-height: 42px; }
.wdg-foot { margin-top: auto; text-align: center; font-size: var(--fs-xs); color: var(--text-light); }

/* Status chip text: deepen the status hue toward the body text color so small
   bold labels clear 4.5:1 on their tinted backgrounds in both themes. */
.lsn-now .status-ring.connected, .lsn-widget .status.connected { color: color-mix(in srgb, var(--success) 62%, var(--text)); }
.lsn-now .status-ring.reconnecting, .lsn-widget .status.reconnecting { color: color-mix(in srgb, var(--warning) 52%, var(--text)); }
#audio-toggle-btn.is-off, #audio-toggle-btn[aria-pressed="false"] { color: color-mix(in srgb, var(--warning) 52%, var(--text)); }

/* Meeting widget (TINL-1444): which voice reads the translation — this device (free) or an AI voice */
.wdg-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 8px 0 4px; }
.wdg-voice-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.wdg-voice .segmented > button { min-height: 36px; font-size: var(--fs-sm); }
.wdg-voice .segmented > button:disabled { opacity: 0.45; cursor: not-allowed; }
.wdg-voice-hint { flex-basis: 100%; margin: 0; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }
