/* The Word in Context — Bible Reader */
:root {
  --gold: #c9a227;
  --gold-soft: rgba(201, 162, 39, 0.14);
  --gold-dim: rgba(201, 162, 39, 0.55);
  --sans: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --serif: 'Literata', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --reader-max: 42rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-bar: 52px;
  --header-h: calc(var(--header-bar) + var(--safe-top));
  --audio-h: calc(64px + var(--safe-bottom));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='light'] {
  --bg: #f7f4ee;
  --bg-elevated: #fffdf8;
  --bg-sheet: #ffffff;
  --text: #1a1814;
  --text-soft: #5c574d;
  --text-faint: #8a8478;
  --border: rgba(26, 24, 20, 0.08);
  --shadow: 0 8px 32px rgba(26, 24, 20, 0.08);
  --verse-num: var(--gold);
}

[data-theme='dark'] {
  --bg: #12100e;
  --bg-elevated: #1a1714;
  --bg-sheet: #1e1b17;
  --text: #f0ebe3;
  --text-soft: #b8b0a4;
  --text-faint: #7a7368;
  --border: rgba(240, 235, 227, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --verse-num: #e0c060;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.reader-immersive .reader-header,
body.reader-immersive .reader-audio-bar {
  transform: translateY(0);
  opacity: 1;
}

#reader-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
}

.reader-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.reader-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  padding: var(--safe-top) 12px 0 8px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.reader-header.hidden-chrome {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.reader-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.reader-icon-btn:hover,
.reader-icon-btn.active {
  background: var(--gold-soft);
  color: var(--gold);
}

.reader-title-block {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.reader-site-title {
  margin: 0 0 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.2;
}

.reader-title-block button {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--sans);
  color: inherit;
  border-radius: 8px;
  max-width: 100%;
}

.reader-title-block button:hover {
  background: var(--gold-soft);
}

.reader-book-title {
  margin: 0;
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-chapter-sub {
  margin: 0;
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reader-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}

.reader-link:hover {
  color: var(--gold);
  background: var(--gold-soft);
}

/* Main reading area */
.reader-main {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.reader-scroll {
  max-width: var(--reader-max);
  margin: 0 auto;
  padding: 28px 20px calc(var(--audio-h) + 32px);
}

.reader-free-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
}

.reader-chapter-heading {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.reader-trans-label {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 28px;
}

.reader-section-heading {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 28px 0 12px;
}

/* Scripture typography */
.reader-prose {
  font-family: var(--serif);
  color: var(--text);
  hyphens: auto;
  text-rendering: optimizeLegibility;
}

.reader-prose.size-sm { font-size: 1.05rem; line-height: 1.72; }
.reader-prose.size-md { font-size: 1.2rem; line-height: 1.78; }
.reader-prose.size-lg { font-size: 1.38rem; line-height: 1.82; }
.reader-prose.size-xl { font-size: 1.55rem; line-height: 1.86; }

.reader-prose.lh-normal { line-height: 1.65 !important; }
.reader-prose.lh-relaxed { /* default per size */ }
.reader-prose.lh-loose { line-height: 2 !important; }

.reader-verse {
  display: inline;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.reader-verse-num {
  font-family: var(--sans);
  font-size: 0.62em;
  font-weight: 700;
  color: var(--verse-num);
  vertical-align: super;
  margin-right: 0.15em;
  opacity: 0.85;
  user-select: none;
}

.reader-verse-text {
  font-weight: 400;
}

.reader-verse.active-audio .reader-verse-text {
  background: linear-gradient(transparent 60%, var(--gold-soft) 60%);
  border-radius: 2px;
}

.reader-verse.selected-verse .reader-verse-text {
  background: var(--gold-soft);
  border-radius: 4px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 22%, transparent);
}

.reader-verse-block {
  margin-bottom: 0.65em;
}

.reader-verse-wrap {
  display: inline;
}

.reader-verse-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.15s;
}

.reader-verse-wrap:hover .reader-verse-actions,
.reader-verse-wrap:focus-within .reader-verse-actions {
  opacity: 1;
}

.reader-verse-btn {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: var(--gold-soft);
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  line-height: 22px;
}

.reader-verse-btn:hover,
.reader-verse-btn.bookmarked {
  color: var(--gold);
}

/* Continue reading card */
.reader-continue {
  max-width: var(--reader-max);
  margin: 16px auto 0;
  padding: 0 20px;
}

.reader-continue-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s;
}

.reader-continue-card:hover {
  border-color: var(--gold-dim);
}

.reader-continue-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.reader-continue-ref {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Nav sheet */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-sheet {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(380px, 92vw);
  z-index: 51;
  background: var(--bg-sheet);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.nav-sheet.open {
  transform: translateX(0);
}

.nav-sheet-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-sheet-title {
  font-size: 14px;
  font-weight: 700;
}

.nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.nav-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.nav-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.nav-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}

.nav-search:focus {
  border-color: var(--gold);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 8px 0 8px 4px;
}

.nav-books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.nav-book-btn {
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  line-height: 1.25;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.nav-book-btn:hover,
.nav-book-btn.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.nav-chapters-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.nav-chapter-btn {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.nav-chapter-btn:hover,
.nav-chapter-btn.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.nav-trans-row {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.nav-trans-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.nav-trans-row select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

/* Bookmarks list */
.bookmark-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.bookmark-item:hover {
  border-color: var(--gold-dim);
}

.bookmark-ref {
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
  white-space: nowrap;
}

.bookmark-text {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-remove {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

/* Settings panel in sheet */
.reader-settings-group {
  margin-bottom: 16px;
}

.reader-settings-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.reader-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reader-pill {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
}

.reader-pill.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.reader-voice-select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.reader-voice-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
  line-height: 1.45;
}

.reader-tool-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reader-tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.reader-tool-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.reader-tool-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.reader-library-link {
  display: block;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--gold-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.reader-library-link:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.reader-study-panel {
  margin: 8px 0 12px 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--border));
  border-radius: 12px;
  background: var(--bg-elevated);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
}

.reader-study-panel[hidden] {
  display: none !important;
}

.reader-study-panel.loading {
  color: var(--text-faint);
  font-style: italic;
}

.reader-study-ref {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.reader-study-section {
  margin-bottom: 14px;
}

.reader-study-section:last-child {
  margin-bottom: 0;
}

.reader-study-section h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reader-study-original {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.reader-study-word {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.reader-study-word:last-child {
  border-bottom: none;
}

.reader-study-word strong {
  color: var(--text);
  font-weight: 600;
}

.reader-study-context {
  color: var(--text-soft);
  white-space: pre-wrap;
}

.reader-verse.tappable {
  cursor: pointer;
}

/* Audio bar */
.reader-audio-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: var(--audio-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px max(8px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-elevated) 95%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  transition: transform 0.35s var(--ease);
}

.reader-audio-bar.hidden-chrome {
  transform: translateY(100%);
}

.reader-audio-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: #1a1814;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.35);
}

.reader-audio-info {
  flex: 1;
  min-width: 0;
}

.reader-audio-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-audio-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.reader-audio-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s linear;
}

.reader-audio-voice-btn,
.reader-audio-mode-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
}

.reader-audio-voice-btn:hover,
.reader-audio-mode-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.reader-audio-mode-btn.active-mode {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

/* Chapter nav footer */
.reader-chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.reader-chapter-nav button {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
}

.reader-chapter-nav button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.reader-chapter-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Loading / error */
.reader-status {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

.reader-status.error {
  color: #c45c5c;
}

/* Responsive */
@media (min-width: 768px) {
  .reader-scroll {
    padding-left: 32px;
    padding-right: 32px;
  }
  .nav-books-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .reader-verse-actions {
    opacity: 1;
  }
}

/* Multi-verse selection + share bar (sits above the audio bar) */
.reader-selection-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--audio-h);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
}

body.reader-has-selection .reader-scroll {
  padding-bottom: calc(var(--audio-h) + 72px);
}

.reader-selection-bar[hidden] {
  display: none !important;
}

.reader-selection-count {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-selection-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.reader-selection-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 36px;
}

.reader-selection-btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1814;
}

.reader-selection-btn.ghost {
  padding: 8px 10px;
  color: var(--text-soft);
}

.reader-selection-btn:active {
  transform: scale(0.97);
}

.reader-share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: #1a1814;
  color: #fffdf8;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow);
  animation: reader-toast-in 0.2s ease;
}

.reader-share-toast.failed {
  background: #8b2e2e;
}

@keyframes reader-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.reader-share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.28);
}

.reader-share-menu {
  position: fixed;
  z-index: 71;
  min-width: 220px;
  max-width: min(92vw, 300px);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  font-family: var(--sans);
}

.reader-share-menu-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 10px 8px;
}

.reader-share-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.reader-share-menu-item:hover,
.reader-share-menu-item:active {
  background: var(--gold-soft);
}

.reader-share-menu-item .share-icon {
  width: 1.25em;
  text-align: center;
  opacity: 0.85;
}

.reader-verse-btn.share-verse-btn {
  font-size: 12px;
  font-weight: 700;
}

.reader-share-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 12px 4px;
}

.reader-share-menu-item.featured {
  background: var(--gold-soft);
  font-weight: 600;
}

.reader-share-menu-item.featured:hover,
.reader-share-menu-item.featured:active {
  background: color-mix(in srgb, var(--gold) 28%, transparent);
}

/* Voice video progress modal */
.reader-video-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}

.reader-video-panel {
  width: min(92vw, 360px);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px 20px 16px;
  font-family: var(--sans);
}

.reader-video-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.reader-video-status {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
}

.reader-video-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}

.reader-video-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.2s ease;
}

.reader-video-hint {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-faint);
}

.reader-video-cancel {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

/* In-app share result (preview stays in app — no forced download) */
.reader-share-result-panel {
  max-width: min(92vw, 400px);
  max-height: min(92dvh, 720px);
  overflow: auto;
}

.reader-share-result-preview {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  margin: 0 0 12px;
  aspect-ratio: 9 / 16;
  max-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-share-result-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #111;
}

.reader-share-result-meta {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.reader-share-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reader-share-result-actions .reader-selection-btn {
  width: 100%;
  justify-content: center;
  min-height: 42px;
}