/* ==========================================================================
   Bilingual Bible - Modern App Layout & Aesthetic Controls
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Header Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.brand-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(179, 135, 56, 0.3);
}

.brand-titles h1 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.brand-titles .subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Header Controls Center & Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-nav-book {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

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

.btn-nav-book svg {
  width: 0.95rem;
  height: 0.95rem;
  stroke-width: 2.2;
}

.segmented-control {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

/* Read-Aloud Click-to-Speak Switch Button */
.btn-toggle-speak {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-toggle-speak:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-toggle-speak.is-active {
  background: var(--accent-gold-soft);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(179, 135, 56, 0.2);
}

.btn-toggle-speak .speak-icon-on {
  display: none;
}
.btn-toggle-speak.is-active .speak-icon-off {
  display: none;
}
.btn-toggle-speak.is-active .speak-icon-on {
  display: inline-block;
}

.segmented-control button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.segmented-control button.active {
  background: var(--bg-surface);
  color: var(--accent-gold);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.icon-button {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-button:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold-border);
  background: var(--accent-gold-soft);
}

/* Secondary Scripture Toolbar */
.scripture-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 2rem;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.chapter-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chapter-pagination button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

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

.chapter-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--accent-gold-soft);
  transition: all 0.2s;
}

.subbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subbar-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.subbar-speak-btn:hover {
  border-color: var(--accent-gold);
  color: var(--text-main);
}

.subbar-speak-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s;
}

.subbar-speak-btn.is-active {
  background: var(--accent-gold-soft);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 600;
}

.subbar-speak-btn.is-active .subbar-speak-dot {
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
}

.pdf-source-link:hover {
  text-decoration: underline;
  background: rgba(179, 135, 56, 0.2);
}

/* Main Scripture Reading Container */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem 10rem;
}

.book-title-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.book-title-hero::after {
  content: "✤";
  position: absolute;
  bottom: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-app);
  padding: 0 1rem;
  color: var(--accent-gold);
  font-size: 1rem;
}

.book-title-hero h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.book-title-hero .english-subhead {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.book-title-hero .chapter-pill {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 1.1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-border);
}

/* Scripture Layout: Side by Side (Default) */
.scripture-view-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.scripture-header-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 0.5rem 1rem 0.8rem;
  border-bottom: 2px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.verse-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  transition: all 0.25s ease;
  position: relative;
  border: 1px solid transparent;
}

.verse-row:hover {
  background: var(--bg-surface-elevated);
}

/* Active Read-Aloud Highlight */
.verse-row.is-reading {
  background: var(--audio-playing-bg) !important;
  border-color: var(--audio-playing-border) !important;
  box-shadow: 0 0 20px var(--audio-playing-glow), 0 2px 10px rgba(0,0,0,0.05);
  transform: scale(1.006);
}

.verse-side-zh, .verse-side-en {
  position: relative;
  word-break: break-word;
}

.verse-actions-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  opacity: 0.25;
  transition: opacity 0.2s;
  cursor: pointer;
  vertical-align: middle;
}

.verse-row:hover .verse-actions-mini,
.verse-row.is-reading .verse-actions-mini {
  opacity: 1;
}

.btn-verse-speak {
  background: transparent;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 2px 4px;
  border-radius: 4px;
  transition: transform 0.15s, background 0.15s;
}

.btn-verse-speak:hover {
  transform: scale(1.15);
  background: var(--accent-gold-soft);
}

/* Scripture Layout: Interlinear / Stacked Mode */
.scripture-view-interlinear {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scripture-view-interlinear .verse-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.15rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.scripture-view-interlinear .verse-side-en {
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-muted);
}

/* Scripture Layout: Pinyin Large-Print Mode (中文拼音大字版) */
.scripture-view-pinyin {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 860px;
  margin: 0 auto;
}

.verse-row-pinyin {
  padding: 0.9rem 1.25rem;
  border-radius: 10px;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.verse-row-pinyin:hover {
  background: var(--bg-surface-elevated);
}

.verse-row-pinyin.is-reading {
  background: var(--audio-playing-bg) !important;
  border-color: var(--audio-playing-border) !important;
  box-shadow: 0 0 20px var(--audio-playing-glow), 0 2px 10px rgba(0,0,0,0.05);
}

.verse-row-pinyin .verse-number {
  min-width: calc(1.65rem * var(--font-scale-ratio));
  height: calc(1.65rem * var(--font-scale-ratio));
  font-size: calc(0.78rem * var(--font-scale-ratio));
  margin-right: 0.7rem;
}

/* 拼音版隐藏英文相关界面元素 */
body.mode-pinyin .scripture-header-row,
body.mode-pinyin .audio-dock-container,
body.mode-pinyin .btn-toggle-speak,
body.mode-pinyin .subbar-speak-btn,
body.mode-pinyin .pdf-source-link,
body.mode-pinyin .book-title-hero .english-subhead {
  display: none !important;
}

/* Floating Large Font Zoom Dock (Pinyin / Senior Mode) */
.pinyin-zoom-dock {
  position: fixed;
  right: 1.4rem;
  bottom: 5.5rem;
  z-index: 150;
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}

body.mode-pinyin .pinyin-zoom-dock {
  display: flex;
}

.zoom-btn {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  border: none;
  background: var(--accent-gold);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg), 0 4px 14px rgba(179, 135, 56, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.zoom-btn:hover {
  transform: scale(1.07);
  background: var(--accent-gold-hover);
}

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

.zoom-btn .zoom-glyph {
  font-family: var(--font-serif-zh);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
}

.zoom-btn .zoom-sign {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  margin-top: -0.1rem;
}

.zoom-btn .zoom-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

/* Floating Audio Player Control Bar */
.audio-dock-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: 92%;
  max-width: 820px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 50px;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(0,0,0,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.audio-track-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 170px;
}

.audio-wave-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
}

.wave-bar {
  width: 3px;
  background: var(--accent-gold);
  border-radius: 2px;
  height: 4px;
}

.is-playing .wave-bar:nth-child(1) { animation: soundwave 0.6s infinite ease-in-out; }
.is-playing .wave-bar:nth-child(2) { animation: soundwave 0.8s infinite ease-in-out 0.15s; }
.is-playing .wave-bar:nth-child(3) { animation: soundwave 0.5s infinite ease-in-out 0.3s; }
.is-playing .wave-bar:nth-child(4) { animation: soundwave 0.7s infinite ease-in-out 0.1s; }

@keyframes soundwave {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.track-text .title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.track-text .status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.audio-main-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ctrl {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-ctrl:hover {
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
}

.btn-play-pause {
  width: 2.8rem;
  height: 2.8rem;
  background: var(--accent-gold);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(179, 135, 56, 0.4);
  transition: transform 0.15s, background 0.15s;
}

.btn-play-pause:hover {
  transform: scale(1.06);
  background: var(--accent-gold-hover);
}

.audio-settings {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.speed-selector select,
.voice-selector select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  outline: none;
}

/* Books & Chapters Drawer Overlay */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.books-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: var(--bg-surface);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.books-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.search-box {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.search-box input {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  outline: none;
  font-size: 0.88rem;
}

.search-box input:focus {
  border-color: var(--accent-gold);
}

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

.drawer-tab-btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.drawer-tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.drawer-book-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.book-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem;
}

.book-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.book-item-btn:hover {
  background: var(--bg-surface-elevated);
}

.book-item-btn.selected {
  background: var(--accent-gold-soft);
  border-color: var(--accent-gold-border);
  color: var(--accent-gold);
  font-weight: 600;
}

.book-item-btn .name-en {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Chapter Selector Modal in Drawer */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  padding: 1rem;
}

.chapter-btn {
  height: 2.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.chapter-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.chapter-btn.current {
  background: var(--accent-gold);
  color: #ffffff;
  border-color: var(--accent-gold);
}

/* Click-to-Speak Enabled/Disabled Visual States */
body.click-speak-enabled .verse-row {
  cursor: pointer;
}

body.click-speak-disabled .verse-row {
  cursor: default;
}

body.click-speak-disabled .verse-actions-mini {
  opacity: 0.15;
}

body.click-speak-disabled .btn-verse-speak {
  color: var(--text-muted);
}

/* Toast Notification */
.bible-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--accent-gold);
  border-radius: 20px;
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.bible-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Adaptations
   ========================================================================== */

@media (max-width: 960px) {
  .scripture-header-row {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Compact App Header: wraps into two rows so every control stays tappable */
  .app-header {
    padding: 0.45rem 0.65rem;
    padding-top: calc(0.45rem + env(safe-area-inset-top));
    gap: 0.35rem;
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .brand-section {
    gap: 0.4rem;
  }

  .brand-icon {
    width: 1.8rem;
    height: 1.8rem;
    min-width: 1.8rem;
    font-size: 0.95rem;
    border-radius: 6px;
  }

  .brand-titles .subtitle {
    display: none;
  }

  .brand-titles h1 {
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  /* Center Navigator Button: fills remaining space in first row */
  .btn-nav-book {
    flex: 1;
    min-width: 0;
    max-width: none;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 16px;
  }

  .btn-nav-book span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-nav-book svg {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
  }

  /* Header Right Actions: own full-width second row */
  .header-actions {
    width: 100%;
    gap: 0.3rem;
    justify-content: space-between;
  }

  /* View-mode segmented control stretches across available space */
  #viewModeControl {
    flex: 1;
  }

  #viewModeControl button {
    flex: 1;
    justify-content: center;
  }

  /* Hide font-scaler buttons on mobile to avoid overcrowding */
  .font-scaler-group {
    display: none;
  }

  .btn-toggle-speak {
    padding: 0.28rem 0.45rem;
    font-size: 0.74rem;
  }

  .subbar-speak-btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
  }

  .segmented-control button {
    padding: 0.28rem 0.45rem;
    font-size: 0.74rem;
  }

  .icon-button {
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 6px;
  }

  /* Secondary Scripture Toolbar */
  .scripture-subbar {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }

  .chapter-pagination {
    gap: 0.35rem;
  }

  .chapter-pagination button {
    padding: 0.25rem 0.45rem;
    font-size: 0.74rem;
    border-radius: 4px;
    white-space: nowrap;
  }

  #currentChapterDisplay {
    font-size: 0.75rem;
    white-space: nowrap;
    padding: 0 0.15rem;
  }

  .pdf-source-link {
    font-size: 0.74rem;
    padding: 0.22rem 0.5rem;
    white-space: nowrap;
    border-radius: 4px;
  }

  /* Hero Section: Reduce massive vertical padding */
  .main-content {
    padding: 1.15rem 0.75rem 13rem;
  }

  .book-title-hero {
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
  }

  .book-title-hero h2 {
    font-size: 1.45rem;
    margin-bottom: 0.25rem;
  }

  .book-title-hero .english-subhead {
    font-size: 0.92rem;
  }

  .book-title-hero .chapter-pill {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    padding: 0.2rem 0.8rem;
  }

  /* Verse Rows: Clear, Elegant Vertical Flow */
  .verse-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }

  .verse-side-zh {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .verse-number {
    min-width: 1.45rem;
    height: 1.45rem;
    font-size: 0.72rem;
    margin-right: 0.4rem;
    border-radius: 3px;
  }

  .verse-side-en {
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .verse-actions-mini {
    opacity: 0.8; /* Always easily clickable on mobile touch */
    margin-left: 0.4rem;
  }

  .btn-verse-speak {
    padding: 4px 6px;
  }

  /* Mobile Streamlined Audio Dock: Single-line Sleek Pill */
  .audio-dock-container {
    width: 95%;
    max-width: 440px;
    height: 58px;
    bottom: 0.85rem;
    padding: 0.35rem 0.75rem;
    flex-wrap: nowrap !important;
    gap: 0.45rem;
    border-radius: 35px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  }

  .audio-track-info {
    min-width: unset;
    gap: 0.45rem;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .audio-wave-icon {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }

  .wave-bars {
    height: 12px;
    gap: 2px;
  }

  .wave-bar {
    width: 2.5px;
  }

  .track-text {
    overflow: hidden;
    line-height: 1.25;
  }

  .track-text .title {
    font-size: 0.78rem;
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .track-text .status {
    font-size: 0.64rem;
    white-space: nowrap;
  }

  .audio-main-controls {
    gap: 0.25rem;
    flex-shrink: 0;
  }

  .btn-ctrl {
    width: 1.85rem;
    height: 1.85rem;
  }

  .btn-play-pause {
    width: 2.45rem;
    height: 2.45rem;
    box-shadow: 0 2px 10px rgba(179, 135, 56, 0.35);
  }

  .btn-play-pause svg {
    width: 16px;
    height: 16px;
  }

  .audio-settings {
    flex-shrink: 0;
    gap: 0.2rem;
  }

  .speed-selector select {
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
    border-radius: 14px;
    font-weight: 700;
  }

  .voice-selector {
    display: none; /* Hide heavy system voice dropdown on mobile */
  }

  /* Pinyin mode mobile: compact zoom dock */
  .pinyin-zoom-dock {
    right: 0.7rem;
    bottom: 1.4rem;
    gap: 0.6rem;
  }

  .zoom-btn {
    width: 3.6rem;
    height: 3.6rem;
  }

  .verse-row-pinyin {
    padding: 0.7rem 0.85rem;
  }
}

/* Ultra Small Screens (iPhone SE / <= 390px) */
@media (max-width: 390px) {
  .brand-titles h1 {
    display: none; /* Icon only, pristine minimalism */
  }
  .btn-nav-book {
    max-width: 130px;
    font-size: 0.78rem;
  }
  .btn-toggle-speak .speak-toggle-text {
    display: none;
  }
  .chapter-pagination button span {
    display: none; /* Icon-only prev/next chapter buttons */
  }
}
