:root {
  --font-family-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family: var(--font-family-serif);
  --font-size: 18px;
  --line-height: 1.7;
  --page-padding: 24px;
  --column-width: 680px;
  --paragraph-spacing: 1rem;
  --pericope-spacing: 3rem;
  
  --bg: #FAF9F6;
  --fg: #1A1A1A;
  --fg-secondary: #666666;
  --fg-tertiary: #999999;
  --verse-num: #888888;
  --pericope-title: #333333;
  --ui-chrome: #E8E6E1;
  --ui-chrome-hover: #D8D6D1;
  --ui-chrome-border: #D1D1D1;
  --highlight: rgba(0, 0, 0, 0.08);
  --overlay-bg: #FFFFFF;
  --overlay-backdrop: rgba(0, 0, 0, 0.5);
  --input-bg: #FFFFFF;
  --input-border: #D1D1D1;
  --button-primary: #0066CC;
  --button-primary-hover: #0055AA;
  --button-primary-fg: #FFFFFF;
  --button-danger: #DC3545;
  --slider-track: #D1D1D1;
  --slider-thumb: #0066CC;
  --toggle-off: #D1D1D1;
  --toggle-on: #0066CC;
  
  --gutter-width: 12vw;
  --top-zone-height: 64px;
  --overlay-header-height: 56px;
  
  --transition-fast: 150ms ease-out;
  --transition-normal: 250ms ease-out;
}

[data-theme="dark"] {
  --bg: #2C2C2E;
  --fg: #E5E5E7;
  --fg-secondary: #AEAEB2;
  --fg-tertiary: #8E8E93;
  --verse-num: #8E8E93;
  --pericope-title: #AEAEB2;
  --ui-chrome: #3A3A3C;
  --ui-chrome-hover: #4A4A4C;
  --ui-chrome-border: #4A4A4C;
  --highlight: rgba(255, 255, 255, 0.1);
  --overlay-bg: #1A1A1C;
  --overlay-backdrop: rgba(0, 0, 0, 0.7);
  --input-bg: #3A3A3C;
  --input-border: #4A4A4C;
  --button-danger: #E04050;
  --slider-track: #4A4A4C;
}

[data-theme="oled"] {
  --bg: #000000;
  --fg: #EBEBF5;
  --fg-secondary: #AEAEB2;
  --fg-tertiary: #636366;
  --verse-num: #636366;
  --pericope-title: #8E8E93;
  --ui-chrome: #1C1C1E;
  --ui-chrome-hover: #2C2C2E;
  --ui-chrome-border: #3A3A3C;
  --highlight: rgba(255, 255, 255, 0.08);
  --overlay-bg: #000000;
  --overlay-backdrop: rgba(0, 0, 0, 0.85);
  --input-bg: #1C1C1E;
  --input-border: #3A3A3C;
  --button-danger: #E04050;
  --slider-track: #3A3A3C;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--fg);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.gutter-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--gutter-width);
  z-index: 10;
  touch-action: pan-y;
  pointer-events: auto;
  cursor: default;
}

#gutter-left {
  left: 0;
}

#gutter-right {
  right: 0;
}

.gutter-top {
  position: fixed;
  top: 36px;
  height: var(--top-zone-height);
  width: 50vw;
  bottom: auto;
  pointer-events: auto;
}

.gutter-top-center {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  height: var(--top-zone-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 50;
  pointer-events: auto;
  background-color: #f0ede6;
  color: #9ca3af;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-left: none;
  border-right: none;
}

/* TTS button in verse picker bar - left 25%, noticeably darker than verse picker */
.verse-picker-tts {
  flex: 0 0 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: rgba(0, 0, 0, 0.20);
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  color: var(--fg-secondary, #9ca3af);
  transition: all 0.2s ease;
}

/* Simple play icon - no oval/circle border */
.verse-picker-tts svg {
  width: 16px;
  height: 16px;
}

.verse-picker-tts:hover {
  background: rgba(0, 0, 0, 0.28);
  color: var(--fg-primary, #666);
}

.verse-picker-tts:active {
  background: rgba(0, 0, 0, 0.35);
}

.verse-picker-tts.playing {
  color: var(--accent-color, #8b7355);
}

[data-theme="dark"] .verse-picker-tts {
  background: rgba(0, 0, 0, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .verse-picker-tts:hover {
  background: rgba(0, 0, 0, 0.45);
}

[data-theme="oled"] .verse-picker-tts {
  background: rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="oled"] .verse-picker-tts:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Override .tts-button styles when inside verse picker - NO oval, NO pulsing */
.verse-picker-tts.tts-button {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.20);
  box-shadow: none;
  animation: none;
}

.verse-picker-tts.tts-button:hover {
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid rgba(0, 0, 0, 0.15);
}

.verse-picker-tts.tts-button:active {
  transform: none;
  background: rgba(0, 0, 0, 0.35);
}

.verse-picker-tts.tts-button.playing {
  background: rgba(0, 0, 0, 0.20);
  border-right: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--accent-color, #8b7355);
  animation: none;
  box-shadow: none;
}

[data-theme="dark"] .verse-picker-tts.tts-button {
  background: rgba(0, 0, 0, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .verse-picker-tts.tts-button:hover {
  background: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .verse-picker-tts.tts-button.playing {
  background: rgba(0, 0, 0, 0.35);
  color: var(--accent-color, #a89070);
  animation: none;
  box-shadow: none;
}

[data-theme="oled"] .verse-picker-tts.tts-button {
  background: rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="oled"] .verse-picker-tts.tts-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

[data-theme="oled"] .verse-picker-tts.tts-button.playing {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-color, #a89070);
  animation: none;
  box-shadow: none;
}

/* Verse picker label - right 75%, centered text */
.verse-picker-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer;
}

[data-theme="dark"] .gutter-top-center {
  background-color: #1A1A1C;
  color: #6B6B6E;
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="oled"] .gutter-top-center {
  background-color: #0A0A0A;
  color: #3A3A3C;
  border-color: rgba(255, 255, 255, 0.12);
}

.gutter-top-center.invisible {
  background-color: transparent !important;
  color: transparent !important;
  border-color: transparent !important;
}

.gutter-top-center.invisible * {
  background-color: transparent !important;
  color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

[data-theme="dark"] .gutter-top-center.invisible,
[data-theme="oled"] .gutter-top-center.invisible {
  background-color: transparent !important;
  color: transparent !important;
  border-color: transparent !important;
}

.reader {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 4rem var(--page-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reader-content {
  width: 100%;
  max-width: var(--column-width);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.lsb-copyright {
  width: 100%;
  max-width: var(--column-width);
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--ui-chrome);
  text-align: center;
  font-family: var(--font-family-sans);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--fg-tertiary);
}

.lsb-copyright p {
  margin: 0.25rem 0;
}

.lsb-copyright .copyright-title {
  font-size: 0.8125rem;
  color: var(--fg-secondary);
  margin-bottom: 0.5rem;
}

.lsb-copyright .copyright-trademark,
.lsb-copyright .copyright-permissions {
  margin-top: 0.75rem;
}

.lsb-copyright a {
  color: var(--fg-secondary);
  text-decoration: none;
}

.lsb-copyright a:hover {
  text-decoration: underline;
}

.chapter-name {
  text-align: center;
  font-family: var(--font-family);
  font-size: 1.5em;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.chapter-name.hidden {
  display: none;
}

.verse {
  margin-bottom: var(--paragraph-spacing);
}

.verse-num {
  font-family: var(--font-family-sans);
  font-size: 0.75em;
  font-weight: 600;
  color: var(--verse-num);
  vertical-align: super;
  margin-right: 0.25em;
  padding: 0.35em 0.2em;
  opacity: 0.8;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: none;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.verse-num.hidden {
  display: none;
}

.verse-num.highlight {
  background-color: var(--highlight);
  border-radius: 2px;
}

.verse.verse-highlight,
.interlinear-verse.verse-highlight {
  background-color: rgba(0, 102, 204, 0.15);
  border-radius: 4px;
  padding: 4px 8px;
  margin-left: -8px;
  margin-right: -8px;
  animation: verse-flash 2s ease-out forwards;
}

[data-theme="dark"] .verse.verse-highlight,
[data-theme="dark"] .interlinear-verse.verse-highlight,
[data-theme="oled"] .verse.verse-highlight,
[data-theme="oled"] .interlinear-verse.verse-highlight {
  background-color: rgba(0, 102, 204, 0.25);
}

@keyframes verse-flash {
  0% { background-color: rgba(0, 102, 204, 0.3); }
  100% { background-color: transparent; }
}

.w {
  cursor: default;
  border-radius: 2px;
  transition: background-color var(--transition-fast);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.w.highlight,
.interlinear-word.highlight {
  background-color: var(--highlight);
}

.overlay-backdrop {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  z-index: 3000;
}

.overlay-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.overlay {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 3001;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
}

.overlay.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.overlay-header {
  min-height: var(--overlay-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-bottom: 1px solid var(--ui-chrome);
  gap: 0.5rem;
  flex-shrink: 0;
}

.overlay-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.overlay-close:hover {
  background-color: var(--ui-chrome);
}

.overlay-title {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  flex: 1;
  min-width: 0;
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .overlay-title {
    font-size: 1rem;
  }
}

.overlay-external {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-secondary);
  border-radius: 8px;
  transition: background-color var(--transition-fast);
  text-decoration: none;
}

.overlay-external:hover {
  background-color: var(--ui-chrome);
}

.overlay-external.hidden {
  visibility: hidden;
}

/* Overlay header right section - groups external link and edit button */
.overlay-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.content-pericope-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  flex-shrink: 0;
  background: var(--bg);
}

.content-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--ui-chrome);
  background: var(--bg);
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-family: var(--font-family-sans);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.content-nav-btn:hover {
  background: var(--highlight);
  color: var(--fg);
  border-color: var(--fg-tertiary);
}

.content-nav-btn:active {
  transform: scale(0.98);
}

.content-nav-btn svg {
  flex-shrink: 0;
}

.overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.overlay-body .fallback-content {
  padding: 2rem var(--page-padding);
  font-family: var(--font-family-sans);
}

.fallback-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--fg);
}

.fallback-content dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1rem;
}

.fallback-content dt {
  font-weight: 500;
  color: var(--fg-secondary);
}

.fallback-content dd {
  color: var(--fg);
}

.fallback-content .not-found {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--ui-chrome);
  border-radius: 8px;
  color: var(--fg-secondary);
}

.word-study-content {
  padding: 1.5rem var(--page-padding);
  font-family: var(--font-family-sans);
  line-height: 1.7;
}

.word-study-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--fg);
}

.word-study-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--fg);
}

.word-study-content p {
  margin-bottom: 1rem;
  color: var(--fg);
}

.word-study-content em {
  font-style: italic;
}

.word-study-content strong {
  font-weight: 600;
}

.word-study-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.word-study-content li {
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.word-loading {
  padding: 2rem var(--page-padding);
  text-align: center;
  color: var(--fg-secondary);
  font-family: var(--font-family-sans);
}

.word-error {
  padding: 2rem var(--page-padding);
  text-align: center;
  color: var(--fg-secondary);
  font-family: var(--font-family-sans);
}

.word-error p {
  margin-bottom: 0.5rem;
}

.settings-body {
  padding: 1.5rem var(--page-padding);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 60px);
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-label {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: 0.75rem;
  display: block;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-option {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  background: var(--ui-chrome);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-option:hover {
  background: var(--ui-chrome-hover);
}

.settings-option.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
}

.settings-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.settings-slider-label {
  font-family: var(--font-family-sans);
  font-size: 0.75rem;
  color: var(--fg-tertiary);
  min-width: 3rem;
  text-align: center;
}

.settings-slider input[type="range"] {
  flex: 1;
  height: 4px;
  background: var(--slider-track);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.settings-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--slider-thumb);
  border-radius: 50%;
  cursor: pointer;
}

.settings-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--slider-thumb);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.settings-toggle-label {
  font-family: var(--font-family-sans);
  font-size: 1rem;
  color: var(--fg);
}

.toggle-checkbox {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  width: 51px;
  min-width: 51px;
  height: 31px;
  min-height: 31px;
  background-color: #D1D1D1;
  border-radius: 15.5px;
  cursor: pointer;
  outline: none;
  border: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.toggle-checkbox:checked {
  background-color: #0066CC;
  background-color: var(--toggle-on, #0066CC);
}

.toggle-checkbox::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background-color: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle-checkbox:checked::before {
  transform: translateX(20px);
}

/* Free TTS Settings */
.settings-tts-section {
  background: var(--surface-elevated);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--ui-chrome);
}

.settings-tts-row {
  margin-bottom: 1rem;
}

.settings-tts-row:last-of-type {
  margin-bottom: 1.25rem;
}

.settings-tts-label {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  color: var(--fg-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

.settings-tts-select {
  width: 100%;
  font-family: var(--font-family-sans);
  font-size: 1rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 6px;
  color: var(--fg);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.settings-tts-select:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-tts-value {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  color: var(--fg-secondary);
  min-width: 3rem;
  text-align: right;
  display: inline-block;
  margin-left: 0.5rem;
}

.settings-tts-buttons {
  display: flex;
  gap: 0.75rem;
}

.settings-tts-btn {
  flex: 1;
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-tts-btn:hover {
  opacity: 0.9;
}

.settings-tts-btn.secondary {
  background: transparent;
  border: 1px solid var(--ui-chrome);
  color: var(--fg);
}

.settings-tts-btn.secondary:hover {
  background: var(--surface-elevated);
}

.settings-reset {
  width: 100%;
  font-family: var(--font-family-sans);
  font-size: 1rem;
  padding: 0.875rem;
  background: transparent;
  border: 1px solid var(--ui-chrome);
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 2rem;
}

.settings-reset:hover {
  background: var(--ui-chrome);
}

.settings-account-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ui-chrome);
}

.settings-account-buttons {
  display: flex;
  gap: 0.75rem;
}

.settings-account-btn {
  flex: 1;
  font-family: var(--font-family-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  background: var(--button-primary);
  border: none;
  border-radius: 8px;
  color: var(--button-primary-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-account-btn:hover {
  opacity: 0.9;
}

.settings-account-btn.secondary {
  background: transparent;
  border: 1px solid var(--ui-chrome);
  color: var(--fg);
}

.settings-account-btn.secondary:hover {
  background: var(--ui-chrome);
}

.settings-account-info {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  color: var(--fg-secondary);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.nav-body {
  padding: 0.75rem var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  overflow: hidden;
}

.nav-search {
  position: relative;
}

.nav-search input {
  width: 100%;
  height: 36px;
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  padding: 0 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--fg);
  outline: none;
  transition: border-color var(--transition-fast);
}

.nav-search input:focus {
  border-color: var(--button-primary);
}

.nav-search input::placeholder {
  color: var(--fg-tertiary);
}

.nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--ui-chrome);
}

.nav-tab {
  flex: 1;
  font-family: var(--font-family-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--fg);
}

.nav-tab.active {
  color: var(--fg);
  border-bottom-color: var(--button-primary);
}

.nav-books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 600px) {
  .nav-books {
    grid-template-columns: repeat(5, 1fr);
  }
}

.nav-book {
  font-family: var(--font-family-sans);
  font-size: 0.8125rem;
  padding: 0.5rem;
  min-height: 2.5rem;
  background: var(--ui-chrome);
  border: none;
  border-radius: 6px;
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: background-color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-book:hover {
  background: var(--ui-chrome-hover);
}

.nav-book.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
}

.nav-overlay.chapters-view .overlay-header {
  height: 40px;
  min-height: 40px;
  border-bottom: none;
}

.nav-overlay.chapters-view .overlay-close {
  width: 36px;
  height: 36px;
}

.nav-body.chapters-view {
  padding: 2px;
  gap: 0;
}

.nav-chapters {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: stretch;
}

@media (min-width: 600px) {
  .nav-chapters {
    grid-template-columns: repeat(10, 1fr);
  }
}

.nav-chapter {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-chrome);
  border: none;
  border-radius: 3px;
  color: var(--fg);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.nav-chapter:hover {
  background: var(--ui-chrome-hover);
}

.nav-back {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--ui-chrome);
  border: none;
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.nav-back:hover {
  background: var(--ui-chrome-hover);
}

.nav-section-label {
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.loading-indicator {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.loading-indicator.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ui-chrome);
  border-top-color: var(--button-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .w.highlight {
    background-color: var(--highlight);
  }
}

@media (min-width: 768px) {
  :root {
    --gutter-width: 14vw;
    --page-padding: 32px;
  }
}

@media (min-width: 1024px) {
  :root {
    --page-padding: 48px;
  }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ui-chrome);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ui-chrome-hover);
}

::selection {
  background: rgba(0, 102, 204, 0.2);
}

/* Pericope structure */
.pericope-block {
  margin-bottom: var(--pericope-spacing);
}

.pericope-text {
  font-family: var(--font-family);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

/* Action Sheet */
.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.action-sheet.active {
  opacity: 1;
  visibility: visible;
}

.action-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-backdrop);
}

.action-sheet-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 0.5rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}

.action-sheet.active .action-sheet-container {
  transform: translateY(0);
}

.action-sheet-title {
  font-family: var(--font-family-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-secondary);
  text-align: center;
  padding: 0.5rem 1rem;
  background: var(--overlay-bg);
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid var(--ui-chrome);
}

.action-sheet-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  font-family: var(--font-family-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--button-primary);
  background: var(--overlay-bg);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.action-sheet-button:first-of-type {
  border-radius: 0;
}

.action-sheet-button:last-of-type:not(.action-sheet-cancel) {
  border-radius: 0 0 12px 12px;
}

.action-sheet-button:hover {
  background: var(--ui-chrome);
}

.action-sheet-button:active {
  background: var(--ui-chrome-hover);
}

.action-sheet-button svg {
  color: var(--button-primary);
}

.action-sheet-cancel {
  margin-top: 0.375rem;
  border-radius: 12px;
  color: var(--fg);
  font-weight: 600;
}

/* Content overlay body styling */
.content-summary-banner {
  color: var(--fg-secondary);
  padding: 0 0 1rem 0;
  font-size: 0.95rem;
  font-style: italic;
  text-align: left;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.content-body {
  padding: 1.5rem var(--page-padding);
  font-family: var(--font-family-serif);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
  font-family: var(--font-family-sans);
  color: var(--fg);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.content-body h1 { font-size: 1.75rem; font-weight: 700; }
.content-body h2 { font-size: 1.5rem; font-weight: 600; }
.content-body h3 { font-size: 1.25rem; font-weight: 600; }
.content-body h4 { font-size: 1.125rem; font-weight: 500; }

.content-body p {
  margin-bottom: 1em;
}

.content-body ul,
.content-body ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.content-body li {
  margin-bottom: 0.5em;
}

.content-body blockquote {
  margin: 1.5em 0 !important;
  padding: 1em !important;
  border-left: 3px solid var(--button-primary) !important;
  background-color: var(--bg-elevated, rgba(0, 0, 0, 0.03)) !important;
  border-radius: 0 6px 6px 0 !important;
  color: var(--fg-secondary) !important;
  font-style: italic;
}

[data-theme="dark"] .content-body blockquote {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--fg) !important;
}

[data-theme="oled"] .content-body blockquote {
  background-color: #1a1a1a !important;
  color: var(--fg) !important;
}

/* Sermon questions - override inline styles from fetched content */
.sermon-questions {
  background: var(--bg-elevated, rgba(0, 0, 0, 0.03)) !important;
  border-left-color: var(--button-primary) !important;
}

.sermon-questions p {
  color: var(--fg-secondary) !important;
}

[data-theme="dark"] .sermon-questions {
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .sermon-questions p {
  color: var(--fg) !important;
}

[data-theme="oled"] .sermon-questions {
  background: #1a1a1a !important;
}

[data-theme="oled"] .sermon-questions p {
  color: var(--fg) !important;
}

.content-body a {
  color: var(--button-primary);
  text-decoration: none;
}

.content-body a:hover {
  text-decoration: underline;
}

.content-body::after {
  content: "Legacy Standard Bible - LSB\A Copyright \00a9  2021 by The Lockman Foundation\A A Corporation Not for Profit, La Habra, California\A All Rights Reserved\A\A The \"Legacy Standard Bible\" and \"LSB\" are trademarks registered in the United States Patent and Trademark Office by The Lockman Foundation.\A\A https://www.lockman.org\A\A Managed in Partnership with Three Sixteen Publishing, Inc.\A www.316Publishing.com\A\A Requests for quotations, reprints, or other permission requests, must be directed to and approved in writing by Three Sixteen Publishing, www.316publishing.com";
  display: block;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ui-chrome);
  text-align: center;
  font-family: var(--font-family-sans);
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--fg-tertiary);
  white-space: pre-wrap;
}

.content-error {
  text-align: center;
  padding: 3rem 1rem;
}

.content-error h3 {
  font-family: var(--font-family-sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}

.content-error p {
  font-family: var(--font-family-sans);
  font-size: 1rem;
  color: var(--fg-secondary);
  margin-bottom: 1.5rem;
}

.content-error a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-family-sans);
  font-size: 0.875rem;
  color: var(--button-primary);
  text-decoration: none;
}

.content-error a:hover {
  text-decoration: underline;
}

/* Interlinear styles */
.settings-hint {
  font-family: var(--font-family-sans);
  font-size: 0.75rem;
  color: var(--fg-tertiary);
  margin-top: 0.5rem;
  padding-left: 0;
}

.interlinear-verse {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 0.5rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.interlinear-verse.interlinear-rtl {
  flex-direction: row-reverse;
  justify-content: flex-start;
  position: relative;
  padding-right: 1.5rem;
}

.interlinear-verse.interlinear-rtl .verse-num {
  position: absolute;
  right: 0;
  top: 0;
}

/* Hebrew text size increase (OT books) */
.interlinear-verse.is-hebrew .interlinear-greek {
  font-size: 2.0em;
  font-weight: normal;
}
.interlinear-verse.is-hebrew .greek-text {
  font-size: 2.0em;
  font-weight: normal;
}
.interlinear-verse.is-hebrew .reverse-greek {
  font-size: 2.0em;
  font-weight: normal;
}
.mode-interlinear .interlinear-verse.is-hebrew .greek-text {
  font-size: 2.0em;
  font-weight: normal;
}
.mode-reverse .interlinear-verse.is-hebrew .greek-text {
  font-size: 2.0em;
  font-weight: normal;
}
.mode-reverse .interlinear-verse.is-hebrew .reverse-greek {
  font-size: 2.0em;
  font-weight: normal;
}

.interlinear-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.interlinear-word:active {
  background: var(--highlight);
  border-radius: 4px;
}

.interlinear-greek {
  font-family: 'SBL Hebrew', 'SBL Greek', 'Times New Roman', serif;
  font-size: 1.3em;
  color: var(--fg);
  font-weight: 500;
}

.interlinear-translit {
  font-family: var(--font-family-sans);
  font-size: 0.65em;
  color: var(--fg-tertiary);
  font-style: italic;
}

.interlinear-lsb {
  font-family: var(--font-family);
  font-size: 0.85em;
  color: var(--fg-secondary);
}

.interlinear-verse .verse-num {
  align-self: flex-start;
  margin-right: 0.25rem;
}

/* Reverse Interlinear styles (LSB on top, Greek underneath) */
.interlinear-verse {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.35rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.reverse-interlinear-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.reverse-interlinear-word:active {
  background: var(--highlight);
  border-radius: 4px;
}

.reverse-interlinear-word.highlight {
  background: var(--highlight);
  border-radius: 4px;
}

.reverse-lsb {
  font-family: var(--font-family);
  font-size: 1em;
  color: var(--fg);
}

.reverse-greek {
  font-family: 'SBL Hebrew', 'SBL Greek', 'Times New Roman', serif;
  font-size: 1.4em;
  color: var(--fg-secondary);
}

.reverse-translit {
  font-family: var(--font-family-sans);
  font-size: 0.6em;
  color: var(--fg-tertiary);
  font-style: italic;
}

.interlinear-verse .verse-num {
  align-self: flex-start;
  margin-right: 0.25rem;
}

/* Anchor-based segment alignment styles */
.aligned-segment {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-right: 0.25rem;
  margin-bottom: 0.5rem;
  vertical-align: top;
}

.anchor-segment {
  background: rgba(128, 128, 128, 0.08);
  border-radius: 4px;
  padding: 0.15rem 0.25rem;
}

.filler-segment {
  background: rgba(128, 128, 128, 0.04);
  border-radius: 4px;
  padding: 0.15rem 0.25rem;
  opacity: 0.85;
}

.segment-eng {
  display: block;
  font-family: var(--font-family);
  font-size: 1em;
  color: var(--fg);
  line-height: 1.3;
}

.eng-word {
  cursor: pointer;
}

.eng-word:active {
  background: var(--highlight);
  border-radius: 4px;
}

.segment-greek {
  display: block;
  min-height: 1.4em;
}

.greek-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.greek-text {
  font-family: 'SBL Greek', 'Times New Roman', serif;
  font-size: 1.05em;
  color: var(--fg-secondary);
}

.greek-translit {
  font-family: var(--font-family-sans);
  font-size: 0.65em;
  color: var(--fg-tertiary);
  font-style: italic;
}

.implied-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  color: var(--fg-tertiary);
  opacity: 0.4;
  cursor: help;
}

.implied-marker::before {
  content: "—";
  font-size: 1.05em;
  line-height: 1.2;
}

.implied-marker::after {
  content: "\00a0";
  font-size: 0.65em;
  line-height: 1;
}

.mode-interlinear .implied-marker::before {
  font-size: 1.4em;
  line-height: 1.2;
}

.mode-interlinear .implied-marker::after {
  font-size: 0.7em;
}

.mode-reverse .implied-marker::before {
  font-size: 1.4em;
  line-height: 1.2;
}

.mode-reverse .implied-marker::after {
  font-size: 0.65em;
}

/* Regular interlinear mode: Greek bold on top, English subdued below */
.mode-interlinear .greek-text {
  font-size: 1.4em;
  font-weight: normal;
  color: var(--fg);
}

.mode-interlinear .greek-translit {
  font-size: 0.7em;
  color: var(--fg-secondary);
}

.mode-interlinear .segment-eng {
  font-size: 0.75em;
  color: var(--fg-tertiary);
  line-height: 1.2;
}

/* Reverse interlinear mode: English prominent on top, Greek subdued below */
.mode-reverse .segment-eng {
  font-size: 1em;
  color: var(--fg);
}

.mode-reverse .greek-text {
  font-size: 1.4em;
  color: var(--fg-secondary);
}

/* Timeline styles */
.timeline-overlay {
  display: flex;
  flex-direction: column;
}

.timeline-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--ui-chrome);
  border-bottom: 1px solid var(--input-border);
}

.timeline-zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--overlay-bg);
  color: var(--fg);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.timeline-zoom-btn:hover {
  background: var(--ui-chrome-hover);
}

.timeline-zoom-level {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  min-width: 80px;
  text-align: center;
  font-weight: 500;
}

.timeline-container {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
}

/* Timeline Search Panel */
.overlay-action-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.overlay-action-btn:hover {
  background: var(--ui-chrome-hover);
}

.overlay-action-btn.active {
  background: var(--accent-bg);
  color: var(--accent-fg);
}

.timeline-search-overlay {
  display: flex;
  flex-direction: column;
}

.timeline-search-panel {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--ui-chrome);
  border-bottom: 1px solid var(--input-border);
}

.timeline-search-panel.active {
  display: flex;
}

.timeline-search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 0 0.5rem;
}

.timeline-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.625rem 0.5rem;
  font-size: 1rem;
  color: var(--fg);
  outline: none;
}

.timeline-search-input::placeholder {
  color: var(--fg-tertiary);
}

.timeline-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--fg-tertiary);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.timeline-search-clear:hover {
  background: var(--ui-chrome-hover);
  color: var(--fg);
}

.timeline-search-results-info {
  padding: 0.5rem 1rem;
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-search-results-info button {
  background: transparent;
  border: none;
  color: var(--accent-fg);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.875rem;
}

.timeline-search-examples-container {
  padding: 0.5rem 1rem;
  text-align: center;
}

.timeline-search-examples {
  margin: 0;
  color: var(--fg-tertiary);
  font-size: 0.75rem;
  line-height: 1.5;
}

.timeline-track {
  position: relative;
  min-height: 100%;
  padding-bottom: 2rem;
}

/* Date axis at top */
.timeline-axis {
  position: sticky;
  top: 0;
  left: 0;
  height: 50px;
  background: var(--overlay-bg);
  border-bottom: 3px solid var(--fg);
  z-index: 100;
}

.timeline-marker {
  position: absolute;
  top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg);
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-marker::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: var(--fg-tertiary);
  margin-top: 4px;
}

/* Entries container */
.timeline-entries {
  position: relative;
  margin-top: 10px;
}

/* Each entry is a wrapper for bar, connector, summary - all absolutely positioned */
.timeline-entry {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.timeline-entry:hover {
  z-index: 50;
}

.timeline-entry:hover .timeline-entry-summary {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* The summary box - all boxes use same neutral style */
.timeline-entry-summary {
  position: absolute;
  width: 130px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 2px solid rgba(100, 116, 139, 0.5);
  background: rgba(100, 116, 139, 0.1);
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.35;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
}

[data-theme="dark"] .timeline-entry-summary,
[data-theme="oled"] .timeline-entry-summary {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.15);
}

.timeline-entry-date {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.timeline-entry.selected .timeline-entry-summary {
  border-color: #DC2626;
  background: rgba(100, 116, 139, 0.1);
}

[data-theme="dark"] .timeline-entry.selected .timeline-entry-summary,
[data-theme="oled"] .timeline-entry.selected .timeline-entry-summary {
  border-color: #EF4444;
  background: rgba(148, 163, 184, 0.15);
}

.timeline-entry-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.timeline-entry-ref {
  font-size: 0.65rem;
  margin-top: 4px;
  font-weight: 600;
  opacity: 0.8;
}

.timeline-era-label {
  position: absolute;
  top: 60px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--button-primary);
  background: var(--overlay-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  z-index: 5;
  opacity: 0.8;
}

.timeline-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 1rem;
}

.timeline-loading p {
  color: var(--fg-secondary);
}

.timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
  padding: 2rem;
}

.timeline-empty h3 {
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.timeline-empty p {
  color: var(--fg-secondary);
  max-width: 300px;
}

.timeline-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--overlay-bg);
  z-index: 10;
}

.timeline-sort-toggle {
  display: flex;
  gap: 0.5rem;
}

.timeline-sort-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
}

.timeline-sort-btn.active {
  background: var(--button-primary);
  color: #fff;
  border-color: var(--button-primary);
}

.timeline-count {
  font-size: 0.75rem;
  color: var(--fg-secondary);
}

.timeline-list-table {
  display: flex;
  flex-direction: column;
}

.timeline-list-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: start;
}

.timeline-list-row:hover:not(.header) {
  background: rgba(100, 116, 139, 0.1);
}

.timeline-list-row.selected {
  background: rgba(37, 99, 235, 0.15);
  border-left: 3px solid var(--button-primary);
}

.timeline-list-row.header {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--fg-secondary);
  cursor: default;
  position: sticky;
  top: 45px;
  background: var(--overlay-bg);
  z-index: 9;
}

.timeline-col {
  font-size: 0.75rem;
  line-height: 1.4;
}

.timeline-col.date {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.7rem;
}

.timeline-col.summary {
  color: var(--button-primary);
}

.timeline-col.passage {
  font-weight: 500;
  color: var(--fg-secondary);
  text-align: right;
  font-size: 0.7rem;
}

@media (max-width: 400px) {
  .timeline-list-row {
    grid-template-columns: 65px 1fr 80px;
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
  }
  
  .timeline-col {
    font-size: 0.7rem;
  }
  
  .timeline-col.date,
  .timeline-col.passage {
    font-size: 0.65rem;
  }
}

.timeline-detail-overlay {
  z-index: 3001;
}

/* Bookmarks Tab Styles */
.bookmarks-wrapper {
  display: none;
  position: fixed;
  top: 45px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
}

.bookmarks-wrapper.active {
  display: block;
}

.bookmarks-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.bookmarks-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px;
}

.bookmarks-header {
  margin-bottom: 24px;
  text-align: center;
}

.bookmarks-header h2 {
  font-family: var(--font-family);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.bookmarks-header p {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  margin: 0;
}

.bookmarks-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.bookmarks-empty-state svg {
  color: var(--fg-tertiary);
  margin-bottom: 16px;
}

.bookmarks-empty-state h3 {
  font-size: 1.1rem;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.bookmarks-empty-state p {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  margin: 0;
}

.bookmarks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--ui-chrome);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.bookmark-item:hover {
  background: var(--ui-chrome-hover);
}

.bookmark-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bookmark-date-range {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bookmark-summary {
  font-weight: 500;
  color: var(--accent);
  font-size: 0.95rem;
}

.bookmark-reference {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

.bookmark-delete {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--fg-tertiary);
  border-radius: 4px;
}

.bookmark-delete:hover {
  color: #CC3333;
  background: rgba(204, 51, 51, 0.1);
}

.bookmark-reorder-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
}

.bookmark-move-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--fg-tertiary);
  cursor: pointer;
  border-radius: 4px;
  -webkit-user-select: none;
  user-select: none;
}

.bookmark-move-btn:hover:not(:disabled) {
  background: var(--surface-elevated);
  color: var(--fg-secondary);
}

.bookmark-move-btn:active:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
}

.bookmark-move-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Bookmarks Sub-tabs */
.bookmarks-subtabs {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--ui-chrome);
  background: var(--bg);
}

.bookmarks-subtab {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 500px) {
  .bookmarks-subtab {
    padding: 12px 14px;
    font-size: 13px;
  }
}

.bookmarks-subtab:hover {
  color: var(--fg);
}

.bookmarks-subtab.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.bookmarks-subtab-content {
  display: none;
}

.bookmarks-subtab-content.active {
  display: block;
}

/* Bookmarks Settings Panel */
.bookmarks-settings {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px;
}

.bookmarks-settings h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.bookmarks-settings .settings-description {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  margin: 0 0 24px 0;
}

.bookmarks-settings .settings-section {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--ui-chrome);
  border-radius: 8px;
}

.bookmarks-settings .settings-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.bookmarks-settings .settings-section p {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin: 0 0 12px 0;
}

.bookmark-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--ui-chrome-hover);
  border-radius: 6px;
  cursor: pointer;
}

.bookmark-select:focus {
  outline: none;
  border-color: var(--button-primary);
}

.clear-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clear-bookmark-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--ui-chrome-hover);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.clear-bookmark-btn:hover {
  background: rgba(204, 51, 51, 0.1);
  border-color: #CC3333;
  color: #CC3333;
}

/* Help Tab Styles */
.help-wrapper {
  display: none;
  position: fixed;
  top: 45px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
}

.help-wrapper.active {
  display: block;
}

.help-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px;
}

.help-header {
  margin-bottom: 24px;
  text-align: center;
}

.help-header h2 {
  font-family: var(--font-family);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.help-header p {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  margin: 0;
}

.help-section {
  margin-bottom: 24px;
}

.help-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-section li {
  padding: 8px 0;
  color: var(--fg-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.help-section li strong {
  color: var(--fg);
}

/* Toast Messages */
.toast-message {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================ */
/* CONCORDANCE STYLES                          */
/* ============================================ */

.concordance-overlay,
.concordance-search-overlay,
.concordance-word-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 3100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.concordance-overlay.active,
.concordance-search-overlay.active,
.concordance-word-overlay.active {
  opacity: 1;
  visibility: visible;
}

.concordance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  background: var(--bg);
  flex-shrink: 0;
}

.concordance-toolbar-left,
.concordance-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.concordance-toolbar h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}

.concordance-toolbar button {
  background: none;
  border: none;
  color: var(--fg-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.concordance-toolbar button:hover {
  background: var(--ui-chrome);
  color: var(--fg);
}

.concordance-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.concordance-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.concordance-loading p {
  color: var(--fg-secondary);
  margin-top: 16px;
}

.concordance-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.concordance-empty h3 {
  color: var(--fg);
  margin: 0 0 8px;
}

.concordance-empty p {
  color: var(--fg-secondary);
  margin: 0;
}

.concordance-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.concordance-content {
  min-height: 100%;
}

.concordance-header {
  text-align: center;
  padding: 12px 16px 8px;
}

.concordance-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 2px;
}

.concordance-subtitle {
  font-size: 0.8rem;
  color: var(--fg-secondary);
  margin: 0;
}

.concordance-testament-filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
}

.concordance-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.concordance-filter-btn:hover {
  background: var(--ui-chrome-hover);
  color: var(--fg);
}

.concordance-filter-btn.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
}

.concordance-alphabet {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px 12px 16px;
}

.concordance-letter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--ui-chrome);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.concordance-letter-btn:hover {
  background: var(--ui-chrome);
  border-color: var(--accent);
}

.concordance-letter-btn .letter {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
}

.concordance-letter-btn .count {
  font-size: 0.65rem;
  color: var(--fg-secondary);
  margin-top: 2px;
}

.concordance-words-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.concordance-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.concordance-back-btn:hover {
  background: var(--ui-chrome);
}

.concordance-letter-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  flex: 1;
}

.concordance-word-count {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

.concordance-words-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--ui-chrome);
  position: sticky;
  top: 0;
  z-index: 10;
}

.concordance-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 0;
}

.concordance-letter-title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.concordance-word-list {
  padding: 8px 0;
}

.concordance-word-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--ui-chrome-subtle);
}

.concordance-word-item:hover {
  background: var(--ui-chrome);
}

.concordance-word-item .word-text {
  font-size: 1rem;
  color: var(--fg);
  font-weight: 500;
}

.concordance-word-item .word-count {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

/* Concordance Word Overlay */
.concordance-word-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Word page filter buttons */
.concordance-word-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.concordance-word-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.concordance-word-filter-btn:hover {
  background: var(--ui-chrome-hover);
  color: var(--fg);
}

.concordance-word-filter-btn.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
}

.concordance-occurrences-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
}

.concordance-occurrence-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

.concordance-occurrence-count .count-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--fg-tertiary);
}

.concordance-occurrence-count .count-total {
  font-weight: 600;
  color: var(--fg);
}

.concordance-occurrences-list {
  padding: 8px 0;
}

.concordance-occurrence {
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--ui-chrome-subtle);
}

.concordance-occurrence:hover {
  background: var(--ui-chrome);
}

.occurrence-ref {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.occurrence-text {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  font-style: italic;
  line-height: 1.5;
}

.occurrence-text .highlight,
.occurrence-text b,
.occurrence-text strong {
  background: rgba(var(--accent-rgb), 0.25);
  color: var(--fg);
  font-weight: 800;
  font-style: normal;
  padding: 2px 4px;
  border-radius: 3px;
}

/* Concordance Search */
.concordance-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  background: var(--bg);
}

.concordance-search-input-wrapper {
  flex: 1;
  position: relative;
}

.concordance-search-input-wrapper input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--ui-chrome);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--fg);
  font-size: 1rem;
  outline: none;
}

.concordance-search-input-wrapper input:focus {
  border-color: var(--accent);
}

.concordance-search-input-wrapper input::placeholder {
  color: var(--fg-tertiary);
}

.concordance-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--fg-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.concordance-search-results {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.concordance-search-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.concordance-search-hint p {
  color: var(--fg-tertiary);
  font-size: 0.95rem;
}

.concordance-search-result-list {
  padding: 8px 0;
}

.concordance-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--ui-chrome-subtle);
}

.concordance-search-result:hover {
  background: var(--ui-chrome);
}

.concordance-search-result .word-text {
  font-size: 1rem;
  color: var(--fg);
  font-weight: 500;
}

.concordance-search-result .word-count {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

/* Concordance Load More */
.concordance-load-more {
  padding: 16px;
  text-align: center;
}

.concordance-load-more-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.concordance-load-more-btn:hover {
  opacity: 0.9;
}

.concordance-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   HELP SYSTEM - Award-Winning Design
   ============================================ */

/* Help Wrapper - Only show when active */
.help-wrapper.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.help-container {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* Help Navigation Sidebar */
.help-nav {
  width: 280px;
  min-width: 280px;
  background: var(--overlay-bg);
  border-right: 1px solid var(--ui-chrome);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.help-nav-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-nav-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 4px 0;
}

.help-nav-subtitle {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin: 0;
}

.help-nav-list {
  list-style: none;
  padding: 12px 8px;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.help-nav-list li {
  margin-bottom: 2px;
}

.help-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--fg-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.help-nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.help-nav-link:hover {
  background: var(--highlight);
  color: var(--fg);
}

.help-nav-link:hover svg {
  opacity: 1;
}

.help-nav-link.active {
  background: var(--button-primary);
  color: white;
}

.help-nav-link.active svg {
  opacity: 1;
}

/* Help Content Area */
.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 60px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Help Sections */
.help-section {
  max-width: 800px;
  margin: 0 auto 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.help-section-header {
  margin-bottom: 28px;
}

.help-section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.help-section-subtitle {
  font-size: 1rem;
  color: var(--fg-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Quick Start Grid */
.help-quickstart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.help-quickstart-card {
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.help-quickstart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .help-quickstart-card:hover,
[data-theme="oled"] .help-quickstart-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.help-quickstart-number {
  width: 36px;
  height: 36px;
  background: var(--button-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 auto 12px;
}

.help-quickstart-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.help-quickstart-card p {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Interface Demo */
.help-demo-container {
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.help-demo-container h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 16px 0;
}

.help-interface-demo {
  background: var(--bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 8px;
  overflow: hidden;
}

.help-demo-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--ui-chrome);
  border-bottom: 1px solid var(--ui-chrome-hover);
}

.help-demo-tabs {
  display: flex;
  gap: 4px;
}

.help-demo-tab {
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--fg-secondary);
  background: transparent;
  border-radius: 4px;
}

.help-demo-tab.active {
  background: var(--bg);
  color: var(--fg);
}

.help-demo-icons {
  display: flex;
  gap: 8px;
}

.help-demo-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--fg-secondary);
  background: var(--bg);
  border-radius: 4px;
}

.help-demo-reader {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  min-height: 160px;
}

.help-demo-gutter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight);
  padding: 8px;
}

.help-demo-label {
  font-size: 0.65rem;
  color: var(--fg-tertiary);
  text-align: center;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

.help-demo-gutter-right .help-demo-label {
  transform: none;
}

.help-demo-content {
  padding: 20px;
  position: relative;
}

.help-demo-verse-picker {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--fg-tertiary);
  background: var(--highlight);
  padding: 4px 8px;
  border-radius: 4px;
}

.help-demo-text {
  font-family: var(--font-family-serif);
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.8;
  margin-top: 16px;
}

.help-demo-versenum {
  font-size: 0.65rem;
  color: var(--verse-num);
  vertical-align: super;
  margin-right: 2px;
}

.help-demo-longpress-hint {
  font-size: 0.7rem;
  color: var(--button-primary);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--ui-chrome);
  text-align: center;
}

/* Feature Blocks */
.help-feature-block {
  margin-bottom: 24px;
}

.help-feature-block h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 12px 0;
}

.help-feature-block p {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.help-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-feature-list li {
  position: relative;
  padding: 8px 0 8px 24px;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.5;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-feature-list li:last-child {
  border-bottom: none;
}

.help-feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--button-primary);
  border-radius: 50%;
}

.help-feature-list li strong {
  color: var(--fg);
}

/* Ordered lists in feature blocks */
ol.help-feature-list {
  counter-reset: feature-counter;
}

ol.help-feature-list li {
  counter-increment: feature-counter;
}

ol.help-feature-list li::before {
  content: counter(feature-counter);
  width: 20px;
  height: 20px;
  background: var(--button-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  top: 10px;
}

/* Navigation Demo */
.help-navigation-demo {
  margin: 24px 0;
}

.help-nav-demo-screen {
  position: relative;
  background: var(--bg);
  border: 2px solid var(--ui-chrome);
  border-radius: 12px;
  height: 240px;
  overflow: hidden;
}

.help-nav-zone {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--fg-secondary);
  font-size: 0.75rem;
  background: var(--highlight);
  transition: background 0.2s;
}

.help-nav-zone:hover {
  background: rgba(0, 102, 204, 0.1);
  color: var(--button-primary);
}

.help-nav-zone-left {
  left: 0;
  top: 40px;
  bottom: 0;
  width: 80px;
}

.help-nav-zone-right {
  right: 0;
  top: 40px;
  bottom: 0;
  width: 80px;
}

.help-nav-zone-top {
  top: 0;
  left: 80px;
  right: 80px;
  height: 40px;
  flex-direction: row;
  background: var(--ui-chrome);
}

.help-nav-demo-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  color: var(--fg-tertiary);
}

/* Action Sheet Demo */
.help-action-sheet-demo {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.help-action-demo-trigger {
  font-family: var(--font-family-serif);
  font-size: 1rem;
  color: var(--fg);
  padding: 16px 24px;
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 8px;
}

.help-action-demo-trigger sup {
  font-size: 0.7rem;
  color: var(--button-primary);
  cursor: pointer;
}

.help-action-demo-sheet {
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .help-action-demo-sheet,
[data-theme="oled"] .help-action-demo-sheet {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.help-action-demo-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ui-chrome);
  margin-bottom: 8px;
}

.help-action-demo-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  font-size: 0.9rem;
  color: var(--fg);
  border-radius: 8px;
  transition: background 0.15s;
}

.help-action-demo-option:hover {
  background: var(--highlight);
}

.help-action-demo-option svg {
  color: var(--fg-secondary);
}

/* Interlinear Demo */
.help-interlinear-demo {
  margin: 24px 0;
}

.help-interlinear-example {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  padding: 24px;
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 12px;
}

.help-interlinear-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.help-il-english {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
}

.help-il-translit {
  font-size: 0.8rem;
  color: var(--fg-secondary);
  font-style: italic;
}

.help-il-original {
  font-size: 1.1rem;
  color: var(--button-primary);
}

/* Tips and Highlights */
.help-tip {
  background: rgba(0, 102, 204, 0.08);
  border-left: 4px solid var(--button-primary);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.5;
}

.help-tip strong {
  color: var(--button-primary);
}

[data-theme="dark"] .help-tip,
[data-theme="oled"] .help-tip {
  background: rgba(0, 102, 204, 0.15);
}

.help-highlight-box {
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 102, 204, 0.05) 100%);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}

.help-highlight-box h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--button-primary);
  margin: 0 0 8px 0;
}

.help-highlight-box p {
  font-size: 0.95rem;
  color: var(--fg);
  margin: 0;
  line-height: 1.5;
}

/* Instruction Steps */
.help-instruction-steps {
  margin: 16px 0;
}

.help-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-step:last-child {
  border-bottom: none;
}

.help-step-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--button-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.help-step-content {
  flex: 1;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.5;
}

.help-step-content strong {
  color: var(--fg);
}

/* Code Examples */
.help-code-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.help-code-example {
  background: var(--ui-chrome);
  border-radius: 8px;
  padding: 12px;
}

.help-code-example code {
  display: block;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.help-code-example code:last-child {
  margin-bottom: 0;
}

.help-code-example.help-code-large {
  grid-column: 1 / -1;
}

.help-code-large code {
  margin-bottom: 8px;
}

/* Keyboard Shortcuts Grid */
.help-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.help-shortcut-group {
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 12px;
  padding: 20px;
}

.help-shortcut-group h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ui-chrome);
}

.help-shortcut:last-child {
  border-bottom: none;
}

.help-shortcut kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--bg);
  border: 1px solid var(--ui-chrome-hover);
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.help-shortcut span {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

/* Inline KBD styling */
.help-feature-block kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--ui-chrome);
  border: 1px solid var(--ui-chrome-hover);
  border-radius: 3px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.7rem;
  color: var(--fg);
  margin: 0 2px;
  vertical-align: middle;
}

/* Help Footer */
.help-footer {
  max-width: 800px;
  margin: 0 auto;
  padding-top: 40px;
}

.help-footer-content {
  text-align: center;
  padding: 32px;
  background: var(--overlay-bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 16px;
}

.help-footer-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.help-footer-content > p {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  margin: 0 0 24px 0;
}

.help-footer-info {
  padding-top: 20px;
  border-top: 1px solid var(--ui-chrome);
}

.help-footer-info p {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin: 4px 0;
}

.help-copyright {
  font-size: 0.75rem !important;
  color: var(--fg-tertiary) !important;
  margin-top: 12px !important;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .help-wrapper.active {
    position: fixed;
    top: 45px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
  }
  
  .help-container {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .help-nav {
    width: 100%;
    min-width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--ui-chrome);
    flex-shrink: 0;
  }
  
  .help-nav-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  
  .help-nav-list li {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .help-nav-link {
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  
  .help-nav-link svg {
    display: none;
  }
  
  .help-content {
    padding: 20px 16px 40px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .help-section-header h2 {
    font-size: 1.4rem;
  }
  
  .help-quickstart-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .help-quickstart-card {
    padding: 16px;
  }
  
  .help-demo-reader {
    grid-template-columns: 60px 1fr 60px;
  }
  
  .help-demo-label {
    font-size: 0.55rem;
  }
  
  .help-shortcuts-grid {
    grid-template-columns: 1fr;
  }
  
  .help-interlinear-example {
    gap: 16px;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .help-quickstart-grid {
    grid-template-columns: 1fr;
  }
  
  .help-nav-header {
    display: none;
  }
  
  .help-code-examples {
    grid-template-columns: 1fr;
  }
  
  .help-action-sheet-demo {
    width: 100%;
  }
  
  .help-action-demo-sheet {
    max-width: 100%;
  }
}

/* TTS Button Styles - Elegant ghost button design */
.tts-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid var(--text-tertiary);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.tts-button:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.tts-button:active {
  transform: scale(0.95);
}

.tts-button.playing {
  border-color: var(--accent-color, #8b7355);
  background: var(--accent-color, #8b7355);
  color: #fff;
  animation: tts-pulse 2s ease-in-out infinite;
}

@keyframes tts-pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(139, 115, 85, 0.4);
  }
  50% { 
    box-shadow: 0 0 0 6px rgba(139, 115, 85, 0);
  }
}

.tts-icon {
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.overlay-header-right .tts-button {
  margin-right: 0;
}

.overlay-header-right .copy-btn {
  margin-right: 0;
}

/* Override for overlay context */
.tts-button.overlay-action-btn {
  width: 36px;
  height: 36px;
}

.tts-button.overlay-action-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Dark mode adjustments */
.dark .tts-button.playing,
[data-theme="dark"] .tts-button.playing {
  border-color: var(--accent-color, #a89070);
  background: var(--accent-color, #a89070);
}

/* OLED mode adjustments */
[data-theme="oled"] .tts-button {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="oled"] .tts-button:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="oled"] .tts-button.playing {
  border-color: var(--accent-color, #a89070);
  background: var(--accent-color, #a89070);
  color: #000;
}

/* Copy Button Styles - Matches TTS button design */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--ui-chrome-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.copy-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn .check-icon {
  color: var(--accent-color, #8b7355);
}

/* Dark mode adjustments */
[data-theme="dark"] .copy-btn .check-icon,
.dark .copy-btn .check-icon {
  color: var(--accent-color, #a89070);
}

/* OLED mode adjustments */
[data-theme="oled"] .copy-btn {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="oled"] .copy-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="oled"] .copy-btn .check-icon {
  color: var(--accent-color, #a89070);
}

/* Bible Reader TTS Button (now integrated into verse picker bar, see .verse-picker-tts) */
