    html, body {
      margin: 0;
      padding: 0;
      background: var(--surface-base);
      min-height: 100vh;
    }

* {
  box-sizing: border-box;
}

/* Top Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--gradient-nav);
  border-bottom: 1px solid var(--border-subtle);
}

.top-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-nav-icon {
  font-size: 1.8em;
}

.top-nav-text {
  display: flex;
  flex-direction: column;
}

.top-nav-title {
  font-size: 1.3em;
  color: var(--accent-primary);
  font-weight: bold;
  text-shadow: none;
  font-family: 'Georgia', serif;
}

.top-nav-tagline {
  font-size: 0.75em;
  color: var(--accent-gold);
  font-style: italic;
  font-family: 'Georgia', serif;
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: var(--border-subtle);
}

/* Top Nav Right Section */
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-primary);
  font-size: 1.1em;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.top-nav-profile:hover {
  background: var(--border-subtle);
}

.top-nav-profile-moon {
  font-size: 1.2em;
  line-height: 1;
}

.top-nav-profile .dropdown-arrow {
  font-size: 0.7em;
  opacity: 0.7;
}

/* Today Button */
.today-btn {
  background: var(--gradient-btn-primary);
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  font-size: 0.95em;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
  z-index: 10;
}

.today-btn:hover {
  background: var(--gradient-btn-primary-hover);
  border-color: var(--accent-primary-strong);
  color: var(--accent-primary-hover);
}

.today-btn:active {
  transform: scale(0.98);
}

/* Hamburger Menu Dropdown */
.nav-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  z-index: 999;
}

.nav-menu-overlay.open {
  display: block;
}

.nav-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  z-index: 1001;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px var(--surface-scrim);
  display: flex;
  flex-direction: column;
}

.nav-menu.open {
  right: 0;
}

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

.nav-menu-header h3 {
  margin: 0;
  color: var(--accent-primary);
  font-family: 'Georgia', serif;
}

.nav-menu-close {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

.nav-menu-items {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.1em;
  font-family: 'Georgia', serif;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-menu-item:hover {
  background: var(--border-subtle);
}

.nav-menu-item .icon {
  font-size: 1.3em;
  width: 30px;
  text-align: center;
}

.nav-menu-item.active {
  background: var(--accent-gold-muted);
  border-left: 3px solid var(--accent-gold);
}

.nav-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 10px 20px;
}

/* Book advertisement in nav menu */
.book-ad {
  margin: 15px 20px;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.book-ad-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.book-ad-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
}

.book-ad-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 10px;
}

.book-ad-title {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: 2.7em;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 2px;
  text-align: center;
}

.book-ad-subtitle {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: 1.05em;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  margin-bottom: 2px;
  text-align: center;
}

.book-ad-tagline {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: 0.55em;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
  margin-bottom: 0;
  text-align: center;
  white-space: nowrap;
}

.book-ad-author {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: 0.8em;
  font-style: italic;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.book-ad-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold) 100%);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px var(--surface-scrim);
}

.book-ad-download:hover {
  background: linear-gradient(135deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--surface-scrim);
}

.book-ad-download .icon {
  font-size: 1.1em;
}

.book-ad-link {
  display: block;
  margin-bottom: 10px;
}

.book-ad-cover {
  width: 100%;
  max-width: 160px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 3px 10px var(--surface-scrim);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-ad-cover:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px var(--surface-scrim);
}

.calendar-app {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px;
  font-family: 'Georgia', serif;
  min-height: 100vh;
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--surface-base);
  border-radius: 8px;
  color: var(--text-primary);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-group label {
  font-size: 0.85em;
  opacity: 0.9;
}

.control-group input, .control-group select {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  font-size: 1em;
}

.btn {
  padding: 10px 20px;
  background: var(--accent-gold);
  color: var(--surface-base);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  align-self: flex-end;
}

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

/* Month Calendar Container */
.month-calendar {
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-highlight) 100%);
  overflow: hidden;
  margin-bottom: 0;
  border-radius: 12px;
}

/* Header Section - 2-row grid layout (Profile, Controls) */
.calendar-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  padding: 0;
  background: var(--gradient-nav);
  color: var(--text-primary);
  gap: 0;
  width: 100%;
  overflow: hidden;
}

/* Row 1: Jubilee indicator */
.header-row-1 {
  grid-column: 1;
  grid-row: 1;
  padding: 6px 12px 2px;
}

/* Row 2: Year | Month | Time | Location */
.header-row-2 {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 6px;
  flex-wrap: wrap;
}

/* Day 1 cell spans both rows */
.new-moon-box {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* Dropdown item styles */
.header-dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  white-space: nowrap;
}

.header-dropdown:hover {
  background: var(--border-subtle);
}

.header-dropdown .dropdown-arrow {
  font-size: 0.7em;
  opacity: 0.7;
}

.header-dropdown.year {
  color: var(--accent-primary);
  font-weight: bold;
  font-size: 1.3em;
}

.header-dropdown.month {
  color: var(--accent-gold);
  font-weight: bold;
  font-size: 1.3em;
}

.header-dropdown.time {
  color: var(--accent-gold);
  font-size: 1.3em;
}

.header-dropdown.location {
  color: var(--accent-primary);
  font-size: 1.3em;
}

.header-separator {
  color: var(--border-strong);
  font-size: 0.8em;
}

/* Jubilee Indicator Styles */
.jubilee-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 1.3em;
  font-weight: bold;
  color: var(--accent-gold);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.jubilee-indicator:hover {
  background: var(--border-subtle);
}

.jubilee-indicator.sabbath-year {
  color: var(--color-success);
}

.jubilee-indicator.jubilee-year {
  color: var(--accent-gold-hover);
}

.jubilee-text {
  white-space: nowrap;
}

.jubilee-info-link {
  color: inherit;
  opacity: 0.7;
  text-decoration: none;
  font-size: 0.9em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.jubilee-info-link:hover {
  opacity: 1;
  text-decoration: none;
}

/* Legacy support - keep for compatibility */
.header-left {
  display: none;
}

.calendar-title {
  text-align: left;
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.calendar-title .site-title {
  font-size: 1.6em;
  color: var(--accent-primary);
  font-weight: bold;
  text-shadow: none;
  margin-bottom: 2px;
}

.calendar-title .site-tagline .book-link {
  text-decoration: none;
  font-size: 1.1em;
  margin-left: 6px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.calendar-title .site-tagline .book-link:hover {
  opacity: 1;
}

.calendar-title .site-tagline {
  font-size: 0.85em;
  color: var(--accent-gold);
  font-style: italic;
  margin-bottom: 4px;
}

.calendar-title .profile-name {
  font-size: 0.85em;
  color: var(--accent-primary);
  margin-bottom: 2px;
}

.calendar-title .month-name {
  font-size: 1.2em;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-title .dropdown-arrow {
  font-size: 0.6em;
  opacity: 0.7;
}

.calendar-title .year-display {
  font-size: 1em;
  color: var(--accent-primary);
  font-weight: bold;
}

.calendar-title .year .location-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.calendar-title .location-link:hover {
  text-decoration-style: solid;
  color: var(--accent-primary-hover);
}

.month-picker-target {
  cursor: pointer;
  padding: 8px 12px;
  padding-bottom: 5px;
  border-radius: 8px;
  transition: background 0.2s;
}

.month-picker-target:hover {
  background: var(--border-subtle);
}

.year-display {
  color: rgba(255,255,255,0.7);
  font-size: 0.85em;
  margin-top: 2px;
}

/* Time display in header */
.time-display {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 0.85em;
  color: var(--text-primary);
}

.time-display:hover {
  background: var(--border-subtle);
}


/* Time picker dropdown */
.time-picker-dropdown {
  min-width: 220px;
  max-width: 280px;
  padding: 12px;
}

.time-picker-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-picker-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-picker-row label {
  color: rgba(255,255,255,0.7);
  font-size: 0.85em;
}

.time-picker-row input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-size: 1em;
}

.time-picker-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.time-picker-buttons .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.95em;
}

.location-display {
  color: rgba(255,255,255,0.7);
  font-size: 0.85em;
  margin-top: 4px;
  padding-left: 12px;
}

.location-time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  padding-right: 10px;
  padding-bottom: 5px;
  text-align: right;
  flex: 1;
}

.location-time-col .time-display {
  font-size: 1.2em;
  color: var(--accent-gold);
  font-weight: bold;
}

.location-time-col .location-link {
  font-size: 1em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  color: var(--accent-primary);
  font-weight: bold;
}

.location-time-col .location-link:hover {
  color: var(--text-primary);
}

/* Picker Overlay (shared for year/month pickers) */
.picker-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 500;
}

.picker-overlay.open {
  display: block;
}

/* Dropdown Picker (shared styles for year/month pickers) */
.dropdown-picker {
  position: fixed;
  background: var(--surface-base);
  border-radius: 16px;
  padding: 20px;
  z-index: 1001;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 8px 32px var(--surface-scrim);
  border: 1px solid var(--border-subtle);
}

.picker-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
  position: relative;
}

.picker-header h3 {
  margin: 0;
  color: var(--accent-primary);
  font-size: 1.2em;
}

.dropdown-picker .close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--border-subtle);
  border: none;
  color: var(--text-primary);
  font-size: 1.1em;
  cursor: pointer;
  padding: 8px 12px;
  line-height: 1;
  border-radius: 8px;
  min-width: 40px;
  min-height: 40px;
}

.dropdown-picker .close-btn:hover {
  background: var(--border-default);
}

/* Year Picker specific styles */
.year-picker {
  min-width: auto;
  padding: 8px 12px;
}

.year-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.year-arrow-btn {
  background: var(--surface-raised);
  border: none;
  color: var(--accent-gold);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-arrow-btn:hover {
  background: var(--surface-highlight);
}

.year-arrow-btn:active {
  background: var(--surface-highlight);
}

/* Month Picker specific styles */
.month-picker {
  min-width: 260px;
  max-width: 300px;
  padding: 10px;
}



.year-display-container {
  position: relative;
  min-width: 80px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-picker-row .year-display {
  font-size: 1.4em;
  font-weight: bold;
  cursor: pointer;
  padding: 6px 12px;
  color: var(--text-primary);
  border-radius: 6px;
  transition: background 0.2s;
}

.year-picker-row .year-display:hover {
  background: var(--border-subtle);
}

.year-input {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 1.2em;
  font-weight: bold;
  width: 100%;
  text-align: center;
  padding: 6px 8px;
  border: 2px solid var(--accent-gold);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: inherit;
  display: none;
  box-sizing: border-box;
}

.year-input.visible {
  display: block;
}

.era-toggle {
  background: var(--surface-raised);
  border: 2px solid var(--accent-gold-strong);
  border-radius: 8px;
  color: var(--accent-gold);
  padding: 8px 16px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  margin-left: 0;
  min-width: 50px;
  min-height: 44px;
  text-align: center;
  transition: all 0.2s ease;
}

.era-toggle:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.era-toggle:active {
  transform: scale(0.95);
}

.era-toggle.bc {
  color: var(--accent-primary);
  border-color: var(--accent-primary-strong);
}

.era-toggle.bc:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.month-grid button {
  background: var(--surface-raised);
  border: none;
  color: var(--text-primary);
  padding: 14px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.2s;
  min-height: 48px;
}

.month-grid button:hover {
  background: var(--surface-highlight);
}

.month-grid button.active {
  background: var(--accent-gold);
  color: var(--surface-base);
  font-weight: bold;
}

.month-grid button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.month-grid .today-btn {
  background: var(--accent-gold);
  border: none;
  color: var(--surface-base);
  font-weight: bold;
}

.month-grid .today-btn:hover {
  background: var(--accent-gold-hover);
}

/* City Picker Modal */
.city-picker-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 500;
}

.city-picker-overlay.visible {
  display: block;
}

.city-picker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-base);
  border-radius: 20px;
  padding: 24px;
  z-index: 1001;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px var(--surface-scrim);
}

.city-picker-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
  position: relative;
}

.city-picker-header h3 {
  margin: 0;
  color: var(--accent-primary);
  font-size: 1.3em;
}

.city-picker .close-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 1.5em;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#city-picker-map {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

#city-picker-map .dateline-map {
  cursor: crosshair !important;
}

.city-picker-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.city-action-btn {
  background: var(--accent-primary-muted);
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  white-space: nowrap;
}

.city-action-btn:hover {
  background: var(--border-accent);
}

.city-picker-select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-size: 0.95em;
  cursor: pointer;
}

.city-picker-select option {
  background: var(--surface-base);
  color: var(--text-primary);
}

.city-picker-controls {
  margin-bottom: 16px;
}

.city-picker-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.city-picker-profile-row label {
  color: rgba(255,255,255,0.7);
  font-size: 0.9em;
  white-space: nowrap;
}

.city-picker-profile-row select {
  flex: 1;
}

.city-picker-confirm-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.city-picker-confirm-row .btn {
  min-width: 100px;
}

#city-picker-map {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

/* Profile Picker Dropdown */
.profile-picker-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 999;
}

.profile-picker-overlay.visible {
  display: block;
}

.profile-picker {
  position: fixed;
  background: var(--surface-base);
  border-radius: 12px;
  padding: 12px;
  z-index: 1001;
  min-width: 280px;
  max-width: 350px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px var(--surface-scrim);
  border: 1px solid var(--border-subtle);
}

.profile-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-picker-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1em;
}

.profile-picker-header .close-btn {
  display: none;
}

.profile-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.profile-add-btn:hover {
  background: var(--border-subtle);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.profile-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-hover);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-option:hover {
  background: var(--border-subtle);
}

.profile-option.selected {
  border-color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.profile-option-icon {
  font-size: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
}

.profile-option-icon img {
  width: 1.4em;
  height: 1.4em;
  object-fit: contain;
}

.profile-option-info {
  flex: 1;
}

.profile-option-name {
  color: var(--text-primary);
  font-weight: bold;
  font-size: 1.05em;
}

.profile-option-hint {
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-top: 2px;
}


/* Date Jump Popup */
.date-jump-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  z-index: 1000;
}

.date-jump-overlay.open {
  display: block;
}

.date-jump-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-base);
  border-radius: 20px;
  padding: 28px;
  z-index: 1001;
  width: 70%;
  max-width: 630px;
  box-shadow: 0 10px 40px var(--surface-scrim);
}

.date-jump-popup h3 {
  margin: 0 0 24px 0;
  color: var(--accent-primary);
  font-size: 1.5em;
  text-align: center;
}

.date-jump-popup .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--border-subtle);
  border: none;
  color: var(--text-primary);
  font-size: 1.3em;
  cursor: pointer;
  padding: 12px 16px;
  line-height: 1;
  border-radius: 10px;
  min-width: 48px;
  min-height: 48px;
}

.date-jump-popup .close-btn:hover {
  background: var(--border-default);
}

.date-jump-popup input {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 1.2em;
  margin-bottom: 20px;
  box-sizing: border-box;
  min-height: 60px;
}

.date-jump-popup .btn-row {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.date-jump-popup .btn {
  flex: 1;
  padding: 18px;
  background: var(--accent-gold);
  color: var(--surface-base);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2em;
  min-height: 60px;
}

.date-jump-popup .btn:hover {
  background: var(--accent-gold-hover);
}

.date-jump-popup .btn.secondary {
  background: var(--surface-highlight);
  color: var(--text-primary);
}

.date-jump-popup .btn.secondary:hover {
  background: var(--surface-highlight);
}

.days-jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border-default);
}

.days-jump input {
  width: 100px;
  text-align: center;
  margin-bottom: 0;
  min-height: 58px;
  font-size: 1.3em;
  border-radius: 12px;
}

.days-jump button {
  background: var(--surface-raised);
  border: none;
  color: var(--accent-gold);
  padding: 16px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.5em;
  min-height: 58px;
  min-width: 58px;
}

.days-jump button:hover {
  background: var(--surface-highlight);
}

.days-jump span {
  color: var(--text-secondary);
  font-size: 1.2em;
  margin-left: 4px;
}

/* Old jump button styles removed - button is now in day detail header */

.full-moon-info {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  padding: 6px;
  transition: background 0.2s;
  position: relative;
}

.full-moon-info:hover {
  background: var(--border-subtle);
}

.full-moon-info .moon-icon {
  font-size: 68px;
  line-height: 1;
}

.moon-icon-wrapper {
  position: relative;
  display: inline-block;
}

.moon-gear-badge {
  position: absolute;
  bottom: -4px;
  right: -2px;
  font-size: 22px;
  color: var(--accent-primary);
  opacity: 0.7;
  text-shadow: none;
}

.full-moon-info:hover .moon-gear-badge {
  opacity: 1;
}

/* Export/Feasts page specific styles */
html.feasts-open,
body.feasts-open {
  overflow: hidden !important;
  height: 100%;
}

/* Sabbath Tester page overflow control - hide body scroll, page has its own */
body.sabbath-tester-open {
  overflow: hidden !important;
}

#export-page {
  position: fixed;
  top: 55px; /* Below the top nav */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  border-radius: 0;
  margin: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-highlight) 100%);
}

#export-page .settings-page-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

#export-page .export-header {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
}

#export-page .export-header h2 {
  flex: 1;
  text-align: left;
  font-size: 1.2em;
  margin: 0;
  line-height: 1.2;
}

#export-page .export-download-btn {
  padding: 10px 16px;
  font-size: 0.95em;
  white-space: nowrap;
  flex-shrink: 0;
}

.export-settings-context {
  background: var(--surface-sunken);
  padding: 12px 20px;
  font-size: 0.9em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.export-settings-context span {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
}

.export-context-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.export-context-label {
  color: var(--text-secondary);
}

.export-context-value {
  color: var(--accent-gold);
  font-weight: 500;
}

/* Priestly Divisions Page - matches Sabbath Tester styling */
#priestly-page {
  position: fixed;
  top: 55px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.priestly-header {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 50%);
  z-index: 10;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.priestly-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.priestly-header h2 {
  margin: 0;
  font-size: 1.3em;
  color: var(--accent-primary);
  flex: 1;
}

.priestly-header .close-btn {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.2em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.priestly-header .close-btn:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.priestly-page-content {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.priestly-page-content > h3 {
  color: var(--accent-primary);
  font-size: 1.2em;
  margin: 24px 0 8px 0;
}

.priestly-intro {
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  overflow: hidden;
}

.priestly-intro h3 {
  color: var(--accent-primary);
  margin-top: 0;
  font-size: 1.3em;
}

.priestly-intro h4 {
  color: var(--accent-gold);
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.05em;
}

.priestly-intro p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 10px 0;
}

.priestly-intro ul {
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 20px;
}

.priestly-intro blockquote {
  border-left: 3px solid var(--accent-gold);
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--surface-sunken);
  border-radius: 0 8px 8px 0;
}

.priestly-intro blockquote p {
  font-style: italic;
  margin: 0 0 8px 0;
}

.priestly-intro blockquote cite {
  display: block;
  color: var(--accent-gold);
  font-size: 0.9em;
  font-style: normal;
}

/* Collapsible sections */
.priestly-details {
  margin-top: 16px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  overflow: hidden;
}

.priestly-details summary {
  padding: 12px 16px;
  background: var(--surface-sunken);
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.priestly-details summary::-webkit-details-marker {
  display: none;
}

.priestly-details summary::before {
  content: "▶";
  font-size: 0.8em;
  transition: transform 0.2s;
}

.priestly-details[open] summary::before {
  transform: rotate(90deg);
}

.priestly-details summary:hover {
  background: var(--accent-primary-muted);
}

.priestly-details-content {
  padding: 16px;
  border-top: 1px solid var(--accent-primary-muted);
}

.priestly-details-content h4 {
  color: var(--accent-gold);
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 1em;
}

.priestly-details-content h4:first-child {
  margin-top: 0;
}

.priestly-details-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 10px 0;
}

.priestly-details-content ol,
.priestly-details-content ul {
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 24px;
  margin: 10px 0;
}

.priestly-details-content li {
  margin-bottom: 6px;
}

.priestly-table-desc {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin: 8px 0 8px 0;
}

.priestly-table-note {
  color: var(--accent-primary);
  margin: 0 0 16px 0;
  font-size: 0.85em;
  font-style: italic;
}

.priestly-table-note a {
  color: var(--accent-gold);
  text-decoration: none;
}

.priestly-table-note a:hover {
  text-decoration: underline;
}

.priestly-warning-message {
  background: var(--color-error-muted);
  border: 1px solid var(--color-error-muted);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--color-error);
  font-size: 0.9em;
}

.priestly-warning-message.priestly-info-message {
  background: var(--accent-primary-subtle);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
}

.priestly-table-container {
  overflow-x: auto;
}

.priestly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.priestly-table th,
.priestly-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.priestly-table th {
  background: var(--gradient-nav);
  color: var(--accent-primary);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.priestly-table tbody tr:hover {
  background: var(--accent-primary-subtle);
}

.priestly-table .course-order {
  color: var(--text-secondary);
  font-weight: 600;
  width: 40px;
  text-align: center;
}

.priestly-table .course-name {
  color: var(--accent-primary);
  font-weight: 600;
  white-space: nowrap;
}

.priestly-table .course-lineage {
  color: var(--accent-gold);
  font-size: 0.85em;
  font-weight: normal;
  margin-top: 2px;
}

.priestly-table .course-meaning {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.9em;
  white-space: normal;
  word-wrap: break-word;
}

.priestly-table .course-dates {
  font-size: 0.85em;
  color: var(--text-secondary);
  min-width: 110px;
  white-space: nowrap;
}

.course-notes-indicator {
  color: var(--accent-primary);
  cursor: pointer;
  font-style: normal;
  margin-left: 4px;
  transition: color 0.2s;
}

.course-notes-indicator:hover {
  color: var(--accent-gold);
}

.course-notes-indicator.active {
  color: var(--accent-gold);
}

/* Expandable details row */
.course-details-row td {
  background: var(--surface-overlay);
  padding: 0 !important;
  border-bottom: 1px solid var(--border-accent);
}

.course-details-content {
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.6;
}

.course-detail-notes {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-style: italic;
  border-left: 3px solid var(--accent-gold);
  padding-left: 12px;
}

.course-famous-people {
  margin: 0;
}

.course-famous-people > strong {
  color: var(--accent-primary);
  font-size: 0.95em;
}

.course-famous-people ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  list-style: none;
}

.course-famous-people li {
  margin-bottom: 10px;
  padding-left: 16px;
  position: relative;
}

.course-famous-people li::before {
  content: "•";
  color: var(--accent-gold);
  position: absolute;
  left: 0;
}

.course-famous-people li strong {
  color: var(--accent-gold);
}

/* Responsive priestly table */
@media (max-width: 768px) {
  .priestly-table {
    font-size: 0.85em;
  }
  
  .priestly-table th,
  .priestly-table td {
    padding: 8px 6px;
  }
  
  .priestly-table .course-meaning {
    white-space: normal;
    word-wrap: break-word;
    min-width: 80px;
  }
  
  .priestly-table .course-dates {
    min-width: 100px;
    white-space: nowrap;
  }
}

.course-dates-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.priestly-table .course-date-link {
  color: var(--accent-gold);
  cursor: pointer;
  text-decoration: none;
  display: block;
  line-height: 1.3;
  white-space: nowrap;
}

.priestly-table .course-date-link:hover {
  text-decoration: underline;
}

.priestly-course-clickable {
  cursor: pointer;
  text-decoration: none;
}

.priestly-course-clickable:hover {
  text-decoration: underline;
}

.priestly-course-display.before-dedication {
  font-style: italic;
}

.priestly-dedication-link {
  color: var(--accent-gold);
  text-decoration: none;
  cursor: pointer;
}

.priestly-dedication-link:hover {
  text-decoration: underline;
}

/* Priestly info popup trigger */
.priestly-info-trigger {
  cursor: pointer;
  color: var(--accent-primary);
  font-size: 0.85em;
  margin-right: 4px;
  vertical-align: baseline;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.priestly-info-trigger:hover {
  opacity: 1;
}

/* Priestly info popup */
.priestly-info-popup {
  position: fixed;
  z-index: 10000;
  background: linear-gradient(135deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  border: 1px solid var(--accent-primary-strong);
  border-radius: 10px;
  padding: 16px;
  max-width: 350px;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px var(--surface-scrim);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.priestly-info-popup::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 20px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--accent-primary-strong);
}

.priestly-popup-notes {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.priestly-popup-famous strong {
  color: var(--accent-gold);
}

.priestly-popup-famous ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.priestly-popup-famous li {
  margin-bottom: 8px;
}

.priestly-popup-famous li strong {
  color: var(--accent-primary);
}

/* Dateline Visualization */
.dateline-container {
  margin-top: 20px;
  padding: 15px;
  background: var(--surface-sunken);
  border-radius: 8px;
  width: 100%;
}

.dateline-label {
  font-size: 0.7em;
  color: var(--accent-primary);
  margin-bottom: 5px;
}

.dateline-map {
  position: relative;
  aspect-ratio: 2 / 1;
  background: var(--surface-base);
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.dateline-map.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.dateline-map-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Fallback gradient if image fails */
  background: linear-gradient(to bottom, 
    #1a4a6e 0%, 
    #2d6a4f 20%, 
    #2d6a4f 40%,
    #1a4a6e 50%,
    #2d6a4f 60%,
    #1a4a6e 100%);
}

.dateline-map-bg img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.85;
}

.dateline-location-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

/* Vertical dashed line */
.dateline-location-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 100vh;
  border-left: 1px dashed var(--color-error);
  transform: translateX(-50%) translateY(-50vh);
}

/* Horizontal dashed line */
.dateline-location-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100vw;
  height: 0;
  border-top: 1px dashed var(--color-error);
  transform: translateY(-50%) translateX(-50vw);
}

/* Central red dot */
.dateline-location-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--color-error);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.8), 0 0 12px rgba(255, 50, 50, 0.5);
}

.dateline-click-hint {
  font-size: 0.6em;
  color: var(--accent-primary);
  text-align: center;
  margin-top: 3px;
  font-style: italic;
}

.dateline-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent-gold-hover), var(--color-error));
  box-shadow: 0 0 15px rgba(255,107,107,0.8), 0 0 30px rgba(255,204,0,0.5);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.dateline-marker-icon {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-gold-hover);
  font-size: 18px;
  text-shadow: 0 0 10px rgba(255,204,0,0.8);
}

.dateline-marker-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-gold-hover);
  font-size: 8px;
  font-weight: bold;
  text-shadow: none;
  white-space: nowrap;
}

.dateline-cities {
  display: flex;
  justify-content: space-between;
  font-size: 0.65em;
  color: var(--accent-primary);
  margin-top: 5px;
  padding: 0 5px;
}

.dateline-info {
  font-size: 0.65em;
  color: var(--accent-gold);
  margin-top: 5px;
}


/* Day 1 in header - inherits from .day-cell */
.new-moon-box {
  aspect-ratio: unset;
  min-height: 80px;
  width: calc((min(100vw, 900px) - 16px) / 7);
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.new-moon-box .gregorian {
  flex-direction: row;
  gap: 4px;
  white-space: nowrap;
}

.new-moon-box .gregorian .day-year {
  font-size: 0.85em;
}

/* Year Uncertainty Banner */
.year-uncertainty-banner {
  background: linear-gradient(90deg, #ff6b00 0%, #ff8c00 100%);
  color: var(--text-primary);
  text-align: center;
  padding: 6px 12px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: help;
  border-bottom: 1px solid #cc5500;
}

/* Week Header */
.week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--calendar-grid-line);
  gap: 1px;
  border-top: 2px solid var(--calendar-grid-line);
}

.week-header .day-label {
  padding: 10px 5px;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.85em;
  /* Grid lines handled by gap + background — no cell border */
}

.week-header .day-label.sabbath-header {
  background: var(--accent-gold);
  color: var(--surface-base);
  font-weight: bold;
}

.week-header .day-label .day-name {
  font-weight: bold;
}

.week-header .day-label .weekday {
  font-size: 0.9em;
  opacity: 0.8;
}

/* Day Cycle Bar - shows daylight/night alignment with calendar days */
/* Gradient is generated dynamically based on actual sunrise/sunset times */
.day-cycle-bar {
  height: 6px;
  border-left: 1px solid var(--surface-highlight);
  border-right: 1px solid var(--surface-highlight);
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  background: var(--calendar-grid-line);
  gap: 1px;
  aspect-ratio: 7 / 5;
}

.day-cell {
  aspect-ratio: 1;
  min-height: 70px;
  padding: 5px;
  background: var(--calendar-cell-bg);
  /* Grid lines handled by .calendar-grid gap + background — no cell border */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-primary);
  cursor: pointer;
}

.day-cell:not(.empty):hover {
  background: var(--calendar-cell-hover);
}

.day-cell.empty {
  background: var(--calendar-grid-line);
}

.day-cell.quote-row-spacer {
  background: var(--surface-raised);
}

.day-cell .gregorian {
  font-size: 1em;
  color: var(--text-primary);
  position: absolute;
  top: 5px;
  left: 5px;
  font-weight: 600;
  text-shadow: none;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.day-cell .gregorian .day-year {
  font-size: 0.75em;
  color: var(--accent-primary);
  font-weight: normal;
}

.day-cell .lunar-day {
  font-size: 2em;
  font-weight: bold;
  color: var(--text-primary);
}

.day-cell .moon-phase {
  font-size: 1.2em;
  position: absolute;
  top: 5px;
  right: 5px;
}

.day-cell .moon-phase.blood-moon {
  /* Blood red glow effect for lunar eclipse */
  filter: sepia(1) saturate(5) hue-rotate(320deg) brightness(0.9);
  text-shadow: 0 0 10px rgba(180, 0, 0, 1), 0 0 20px rgba(255, 50, 50, 0.8), 0 0 30px rgba(200, 0, 0, 0.6);
  background: var(--color-error-muted);
  border-radius: 50%;
  padding: 2px 4px;
}

.day-cell .moon-phase.solar-eclipse {
  /* Dark corona effect for solar eclipse */
  filter: brightness(0.6) contrast(1.4);
  text-shadow: 0 0 8px rgba(255, 200, 50, 0.9), 0 0 16px rgba(255, 165, 0, 0.6), 0 0 24px rgba(255, 140, 0, 0.3);
  background: rgba(30, 30, 30, 0.6);
  border-radius: 50%;
  padding: 2px 4px;
}

.day-cell.blood-moon-day {
  box-shadow: inset 0 0 0 2px rgba(180, 0, 0, 0.5);
}

.day-cell.solar-eclipse-day {
  box-shadow: inset 0 0 0 2px rgba(255, 165, 0, 0.4);
}

/* Sabbath Days - gold-tinted background for more contrast */
.day-cell.sabbath {
  background: linear-gradient(135deg, var(--calendar-sabbath-dark) 0%, var(--calendar-sabbath-light) 100%);
  box-shadow: inset 0 0 0 1px var(--accent-gold-muted);
}

.day-cell.sabbath .lunar-day {
  color: var(--accent-gold);
  font-weight: bold;
}

/* New Moon Day */
.day-cell.new-moon {
  background: var(--calendar-cell-bg);
}

.day-cell.new-moon .lunar-day {
  color: var(--accent-primary);
}

/* New Moon + Feast */
.day-cell.new-moon.feast {
  background: linear-gradient(135deg, var(--calendar-feast-sabbath-dark) 0%, var(--calendar-feast-sabbath-light) 100%);
}

/* New Moon + Sabbath */
.day-cell.new-moon.sabbath {
  background: linear-gradient(135deg, var(--calendar-sabbath-dark) 0%, var(--calendar-sabbath-light) 100%);
}

.day-cell.new-moon.sabbath .lunar-day {
  color: var(--accent-gold);
}

/* New Moon + Feast + Sabbath */
.day-cell.new-moon.feast.sabbath {
  background: linear-gradient(135deg, var(--calendar-feast-sabbath-dark) 0%, var(--calendar-feast-sabbath-light) 100%);
}

/* Highlighted/Selected Day */
.day-cell.highlighted {
  box-shadow: inset 0 0 0 3px var(--accent-primary);
}

/* Today's date - moderate warm highlight */
.day-cell.today {
  background: linear-gradient(135deg, #4a5535 0%, #3a4528 100%);
  box-shadow: inset 0 0 0 1px #7a9050;
}

.day-cell.today .gregorian {
  color: #b8d080;
}

/* When today is also a sabbath - combine both highlights */
.day-cell.today.sabbath {
  background: linear-gradient(135deg, #4a5535 0%, #3a4020 100%);
  box-shadow: inset 0 0 0 1px #7a9050;
}

.day-cell .feast-icons {
  font-size: 1em;
  position: absolute;
  bottom: 2px;
  right: 3px;
  text-align: right;
  line-height: 1;
  letter-spacing: 0.15em;
  line-height: 1.2;
  font-weight: bold;
  text-shadow: none;
}

/* Event icons (historical/biblical) in bottom left */
.day-cell .day-event-icon {
  font-size: 0.85em;
  position: absolute;
  bottom: 2px;
  left: 3px;
  text-align: left;
  line-height: 1;
  opacity: 0.8;
  text-shadow: none;
  cursor: pointer;
}

.day-cell .day-event-icon:hover {
  opacity: 1;
}

/* Scripture Quote - integrated into last row */
.scripture-quote {
  padding: 10px 15px;
  text-align: center;
  color: var(--accent-gold);
  font-style: italic;
  background: var(--surface-raised);
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scripture-quote.span-4 {
  grid-column: span 4;
}

/* Month navigation cells in last row */
.month-nav-cell {
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.month-nav-cell.nav-group {
  gap: 8px;
  cursor: default;
}

.month-nav-cell:hover:not(.disabled):not(.nav-group) {
  background: var(--surface-base);
}

.month-nav-cell.disabled {
  cursor: default;
  opacity: 0.3;
}

.month-nav-cell .nav-arrow {
  color: var(--accent-gold);
  font-size: 1.3em;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.month-nav-cell .nav-arrow:hover {
  background: var(--accent-gold-muted);
  color: var(--accent-gold-hover);
}

.month-nav-cell .nav-arrow.year-nav {
  font-size: 1.3em;
}

.month-nav-cell .nav-arrow.year-nav:hover {
  background: var(--accent-gold-muted);
}

.scripture-quote .reference {
  color: var(--accent-primary);
  font-style: normal;
  margin-left: 10px;
}

/* Settings Dialog */
/* Old settings overlay - now hidden, replaced by settings page */
.settings-overlay {
  display: none !important;
}

.settings-overlay.open {
  display: none !important;
}

/* Old settings dialog - now hidden, replaced by settings page */
.settings-dialog {
  display: none !important;
}

.settings-dialog.open {
  display: none !important;
}

.settings-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 24px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-default);
  position: relative;
}

.settings-header h3 {
  margin: 0;
  font-size: 1.4em;
  color: var(--accent-primary);
}

.settings-dialog .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--border-subtle);
  border: none;
  color: var(--text-primary);
  font-size: 1.2em;
  cursor: pointer;
  padding: 12px 16px;
  line-height: 1;
  border-radius: 10px;
  min-width: 48px;
  min-height: 48px;
}

.settings-dialog .close-btn:hover {
  background: var(--border-default);
}

.settings-content {
  padding: 24px;
}

.setting-group {
  margin-bottom: 24px;
}

.setting-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--accent-primary);
  font-size: 1.1em;
}

.setting-group select,
.setting-group input {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1.1em;
  box-sizing: border-box;
  background: var(--surface-raised);
  color: var(--text-primary);
  min-height: 54px;
}

.city-select-styled {
  margin-top: 12px;
}

.setting-info {
  font-size: 0.95em;
  color: var(--text-secondary);
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  text-align: center;
}

/* Moon Phase Buttons */
.moon-phase-buttons {
  display: flex;
  gap: 12px;
}

.moon-phase-btn {
  flex: 1;
  background: var(--surface-raised);
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 16px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  min-height: 90px;
}

.moon-phase-btn:hover {
  background: var(--surface-highlight);
}

.moon-phase-btn.active {
  border-color: var(--accent-gold);
  background: var(--surface-highlight);
}

.moon-phase-btn .phase-icon {
  font-size: 2em;
}

.moon-phase-btn .phase-name {
  color: var(--text-primary);
  font-size: 0.85em;
  font-weight: bold;
}

/* Settings Map */
#settings-map-container {
  margin-bottom: 12px;
}

#settings-map-container .dateline-container {
  margin-top: 0;
  padding: 12px;
}


.location-btn {
  width: 100%;
  padding: 16px;
  background: var(--surface-highlight);
  color: var(--text-primary);
  border: none;
  border-radius: 12px;
  font-size: 1.1em;
  cursor: pointer;
  margin-top: 12px;
  min-height: 54px;
}

.location-btn:hover {
  background: var(--surface-highlight);
}

.location-btn {
  width: 100%;
  padding: 12px;
  background: var(--surface-highlight);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  margin-bottom: 15px;
}

.location-btn:hover {
  background: var(--surface-base);
}

.location-btn:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
}


/* Month Navigation */
.month-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

/* Prevent .month-nav class on nav arrows from inheriting the above margin */
span.nav-arrow.month-nav {
  margin-bottom: 0;
}

.month-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.month-btn {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0;
  background: var(--surface-base);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.2s;
}

/* 13th month button with calendar icon overlay */
.month-btn.month-13 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-13-icon {
  font-size: 1.2em;
  position: relative;
}

.month-13-num {
  position: absolute;
  font-size: 0.6em;
  font-weight: bold;
  color: var(--surface-base);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -35%);
  text-shadow: 0 0 2px white, 0 0 2px white;
}

.month-btn:hover {
  background: var(--surface-highlight);
  transform: scale(1.05);
}

.month-btn.active {
  background: var(--accent-gold);
  color: var(--surface-base);
}

.month-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Settings Page - Full Screen Slide-in */
.settings-page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  overflow-y: auto;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  box-shadow: -5px 0 20px var(--surface-scrim);
}

.settings-page.visible {
  transform: translateX(0);
}

.settings-page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.settings-page-overlay.visible {
  opacity: 0;
  visibility: visible;
}

@media (max-width: 500px) {
  .settings-page {
    max-width: 100%;
  }
}

.settings-page-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: var(--gradient-nav);
  border-bottom: 2px solid var(--accent-gold);
}

.settings-page-header h2 {
  margin: 0;
  color: var(--accent-gold);
  font-size: 1.4em;
  flex: 1;
}

.settings-page-header .close-btn {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.2em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-page-header .close-btn:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.profile-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.profile-row .profile-select {
  flex: 1;
}

.profile-icon-btn {
  background: var(--border-subtle);
  border: 2px solid transparent;
  color: var(--text-primary);
  font-size: 1.4em;
  font-weight: bold;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.profile-icon-btn:hover:not(:disabled) {
  background: var(--border-default);
  border-color: var(--accent-gold);
}

.profile-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Profile Name Modal */
.profile-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.profile-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.profile-modal {
  background: linear-gradient(135deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  border: 1px solid var(--surface-highlight);
  border-radius: 12px;
  padding: 24px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 10px 40px var(--surface-scrim);
  transform: scale(0.9);
  transition: transform 0.2s;
}

.profile-modal-overlay.visible .profile-modal {
  transform: scale(1);
}

.profile-modal h3 {
  margin: 0 0 16px 0;
  color: var(--accent-primary);
  font-size: 1.2em;
}

.profile-modal-input {
  width: 100%;
  padding: 12px 15px;
  font-size: 1.1em;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-highlight);
  border-radius: 8px;
  color: var(--text-primary);
  margin-bottom: 8px;
  box-sizing: border-box;
}

.profile-modal-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.profile-modal-error {
  color: var(--color-error);
  font-size: 0.9em;
  margin-bottom: 12px;
  min-height: 1.2em;
}

.profile-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.profile-modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.profile-modal-btn.cancel {
  background: var(--border-subtle);
  color: var(--text-secondary);
}

.profile-modal-btn.cancel:hover {
  background: var(--border-default);
}

.profile-modal-btn.save {
  background: var(--surface-highlight);
  color: var(--text-primary);
}

.profile-modal-btn.save:hover {
  background: var(--surface-highlight);
}

.settings-option-btn.disabled,
.settings-select.disabled,
.settings-location-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.settings-location-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-location-btn {
  background: var(--accent-primary-muted);
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
}

.settings-location-btn:hover:not(:disabled) {
  background: var(--border-accent);
  border-color: var(--accent-primary-strong);
}

.settings-location-hint {
  font-size: 0.8em;
  color: var(--text-tertiary);
  font-style: italic;
}

.settings-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  margin: 0 0 8px 0;
  color: var(--accent-primary);
  font-size: 1.2em;
}

.settings-description {
  margin: 0 0 15px 0;
  color: rgba(255,255,255,0.7);
  font-size: 0.9em;
}

/* Settings Expandable Details */
.settings-details {
  margin-top: 15px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-sunken);
}

.settings-details-toggle {
  cursor: pointer;
  padding: 12px 15px;
  color: var(--accent-primary);
  font-size: 0.95em;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-details-toggle::-webkit-details-marker {
  display: none;
}

.settings-details-toggle::before {
  content: '▶';
  font-size: 0.7em;
  transition: transform 0.2s;
}

.settings-details[open] .settings-details-toggle::before {
  transform: rotate(90deg);
}

.settings-details-toggle:hover {
  color: var(--accent-primary-hover);
}

.settings-details-content {
  padding: 15px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.9em;
  line-height: 1.6;
}

.settings-details-content h4 {
  color: var(--accent-primary);
  margin: 0 0 8px 0;
  font-size: 1em;
}

.settings-details-content h4:not(:first-child) {
  margin-top: 18px;
}

.settings-details-content p {
  margin: 0 0 10px 0;
}

.settings-details-content p:last-child {
  margin-bottom: 0;
}

/* Settings Checkbox Row */
.settings-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1.05em;
  color: var(--text-primary);
}

.settings-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.settings-checkbox-label .checkbox-text {
  font-weight: 500;
}

.settings-checkbox-hint {
  font-size: 0.85em;
  color: var(--text-tertiary);
  font-style: italic;
}

.settings-info-box {
  margin-top: 15px;
  padding: 15px;
  background: var(--accent-primary-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.9em;
  line-height: 1.5;
}

.settings-info-box p {
  margin: 0 0 10px 0;
  color: rgba(255,255,255,0.9);
}

.settings-info-box p:last-child {
  margin-bottom: 0;
}

.settings-info-box blockquote {
  margin: 10px 0;
  padding: 10px 15px;
  background: var(--surface-sunken);
  border-radius: 4px;
  font-style: italic;
  color: var(--text-primary);
}

.settings-info-box em {
  color: var(--accent-primary);
}

.settings-accordion {
  margin-top: 15px;
  border-top: 1px solid var(--border-default);
  padding-top: 10px;
}

.settings-accordion summary {
  cursor: pointer;
  color: var(--accent-primary);
  font-weight: 500;
  padding: 8px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-accordion summary::-webkit-details-marker {
  display: none;
}

.settings-accordion summary::before {
  content: '▶';
  font-size: 0.7em;
  transition: transform 0.2s;
}

.settings-accordion[open] summary::before {
  transform: rotate(90deg);
}

.settings-accordion summary:hover {
  color: var(--accent-primary-hover);
}

.settings-accordion .accordion-content {
  padding: 15px 0 5px 0;
  animation: accordionOpen 0.2s ease-out;
}

@keyframes accordionOpen {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-accordion .accordion-content p {
  margin: 0 0 10px 0;
}

.settings-accordion .accordion-content blockquote {
  margin: 10px 0;
  padding: 10px 15px;
  background: var(--surface-sunken);
  border-radius: 4px;
  font-style: italic;
  color: var(--text-primary);
}

.settings-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-row-label {
  color: var(--text-primary);
  font-size: 0.95em;
  white-space: nowrap;
}

.settings-engine-info {
  margin-top: 15px;
  padding: 12px 15px;
  background: var(--surface-sunken);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.engine-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.engine-info-row:not(:last-child) {
  border-bottom: 1px solid var(--surface-hover);
}

.engine-info-label {
  color: var(--text-secondary);
  font-size: 0.85em;
}

.engine-info-value {
  color: var(--accent-primary);
  font-size: 0.9em;
  font-family: monospace;
}

.profile-select {
  width: 100%;
  padding: 12px 15px;
  font-size: 1.1em;
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 2px solid var(--accent-gold);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.profile-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.profile-select option {
  padding: 10px;
  background: var(--surface-base);
}

.settings-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  background: var(--border-subtle);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  flex: 1;
  min-width: 90px;
  transition: all 0.2s;
}

.settings-option-btn:hover {
  background: var(--border-default);
}

.settings-option-btn.selected {
  border-color: var(--accent-gold);
  background: var(--accent-gold-muted);
}

.settings-option-btn .option-icon {
  font-size: 2.5em;
}

/* Moon phase icons in Month Starts section - extra large */
.settings-option-btn[data-phase] .option-icon {
  font-size: 3.5em;
}

.settings-option-btn .option-label {
  font-size: 0.85em;
  font-weight: 500;
}

.settings-option-btn .option-hint {
  font-size: 0.75em;
  opacity: 0.7;
  font-weight: normal;
}

#settings-page-map {
  margin-bottom: 15px;
}

#settings-page-map .dateline-container {
  margin-top: 0;
  padding: 12px;
  background: var(--surface-sunken);
  border-radius: 10px;
}

.settings-select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1em;
  border: none;
  border-radius: 10px;
  background: var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 12px;
}

.settings-select option,
.settings-select optgroup {
  background: var(--surface-base);
  color: var(--text-primary);
}

.settings-custom-coords {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-custom-coords input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  background: var(--border-subtle);
  color: var(--text-primary);
}

.settings-custom-coords input::placeholder {
  color: var(--text-tertiary);
}

/* Day Detail Panel */
.day-detail-panel {
  background: var(--gradient-nav);
  border-top: 3px solid var(--accent-gold);
  padding: 15px 20px;
  margin-top: 0;
}

.day-detail-panel.hidden {
  display: none;
}

.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.day-detail-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-detail-header .day-detail-astro-times {
  display: flex;
  flex-direction: column;
  font-size: 0.85em;
  background: var(--accent-gold-subtle);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent-gold-muted);
}

.day-detail-header .astro-times-title {
  font-weight: 600;
  color: var(--accent-gold-hover);
  margin-bottom: 6px;
  font-size: 0.95em;
}

.day-detail-header .astro-times-row {
  display: flex;
  gap: 16px;
}

.day-detail-header .astro-times-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-detail-header .astro-time {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}

.day-detail-header .astro-label {
  color: var(--text-secondary);
  text-align: left;
}

.day-detail-header .astro-value {
  color: var(--text-secondary);
  font-family: monospace;
  text-align: right;
}

.day-detail-lunar {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--accent-gold);
}

.day-detail-gregorian {
  font-size: 1em;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.day-detail-gregorian:hover {
  background: var(--accent-primary-muted);
}

.day-detail-gregorian-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.day-detail-jump-btn {
  background: var(--accent-gold);
  border: none;
  color: var(--surface-base);
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.day-detail-jump-btn:hover {
  background: var(--accent-gold-hover);
  transform: scale(1.1);
}

.day-detail-content {
  color: var(--text-primary);
}

.day-detail-feasts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-detail-feast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--accent-primary-muted);
  border-radius: 8px;
  border-left: 3px solid var(--color-success);
}

.day-detail-feast-icon {
  font-size: 1.5em;
  line-height: 1;
}

.day-detail-feast-icon.blood-moon-icon {
  filter: sepia(1) saturate(5) hue-rotate(320deg) brightness(0.9);
  text-shadow: 0 0 10px rgba(180, 0, 0, 1), 0 0 20px rgba(255, 50, 50, 0.8), 0 0 30px rgba(200, 0, 0, 0.6);
  background: rgba(139, 0, 0, 0.3);
  border-radius: 50%;
  padding: 4px 6px;
}

.day-detail-feast-icon.solar-eclipse-icon {
  filter: brightness(0.6) contrast(1.4);
  text-shadow: 0 0 8px rgba(255, 200, 50, 0.9), 0 0 16px rgba(255, 165, 0, 0.6), 0 0 24px rgba(255, 140, 0, 0.3);
  background: rgba(30, 30, 30, 0.5);
  border-radius: 50%;
  padding: 4px 6px;
}

.day-detail-feast-info {
  flex: 1;
}

.day-detail-feast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.day-detail-feast-name {
  font-weight: bold;
  color: var(--color-success);
  font-size: 1.1em;
}

.day-detail-feast-header .stellarium-link {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 0.8em;
  flex-shrink: 0;
}

.day-detail-feast-desc {
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.4;
}

.day-detail-feast-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9em;
}

.day-detail-feast-link:hover {
  text-decoration: underline;
}

.equinox-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

.equinox-link:hover {
  text-decoration: underline;
  color: var(--accent-gold-hover);
}

.day-detail-info {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-accent);
  color: var(--text-secondary);
  font-size: 0.9em;
}

.stellarium-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--accent-primary-muted);
  border: 1px solid var(--accent-primary-strong);
  border-radius: 6px;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.2s, border-color 0.2s;
}

.stellarium-link:hover {
  background: rgba(100, 150, 200, 0.35);
  border-color: rgba(100, 150, 200, 0.6);
  color: var(--text-primary);
}

.stellarium-link img {
  width: 16px;
  height: 16px;
}

.day-detail-dateline {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-accent);
}

.day-detail-dateline .dateline-container {
  margin-top: 0;
  padding: 10px;
  background: var(--surface-sunken);
  border-radius: 8px;
}

.day-detail-dateline .dateline-map {
  cursor: default;
  pointer-events: none;
}

.day-detail-dateline .dateline-click-hint {
  display: none;
}

.day-detail-profile-compare {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-accent);
}

.profile-compare-title {
  font-size: 0.9em;
  color: var(--accent-primary);
  margin-bottom: 8px;
  font-weight: 600;
}

.profile-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.profile-compare-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.profile-compare-item:hover {
  background: var(--accent-primary-muted);
  border-color: var(--border-accent);
}

.profile-compare-item.current {
  background: var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-muted);
}

.profile-compare-item.current:hover {
  background: var(--accent-gold-muted);
}

.profile-compare-name {
  color: var(--text-secondary);
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-compare-name img {
  width: 1.2em;
  height: 1.2em;
  object-fit: contain;
  vertical-align: middle;
}

.profile-compare-item.current .profile-compare-name {
  color: var(--accent-gold);
}

.profile-compare-day {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1em;
}

.profile-compare-feasts {
  margin-top: 4px;
  font-size: 1.1em;
  line-height: 1.2;
}

.profile-compare-location {
  font-size: 0.8em;
  color: var(--text-secondary);
}

.profile-compare-priest {
  color: var(--accent-primary);
  font-weight: normal;
  font-size: 0.85em;
  white-space: nowrap;
  cursor: help;
}

.profile-compare-priest .priest-icon {
  display: inline;
  margin-right: 3px;
}

.profile-compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.world-clock-add-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary-strong);
  background: transparent;
  color: var(--accent-primary);
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.world-clock-add-btn:hover {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary);
}

.profile-compare-item {
  position: relative;
}

.world-clock-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--color-error-muted);
  color: var(--color-error);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-compare-item:hover .world-clock-remove-btn {
  opacity: 1;
}

.world-clock-remove-btn:hover {
  background: var(--color-error-muted);
}

/* World Clock Add Modal */
.world-clock-add-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.world-clock-add-content {
  background: var(--surface-base);
  border-radius: 12px;
  padding: 20px;
  min-width: 280px;
  max-width: 400px;
  box-shadow: 0 8px 32px var(--surface-scrim);
}

.world-clock-add-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.world-clock-add-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1em;
}

.world-clock-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.world-clock-add-form label {
  color: rgba(255,255,255,0.7);
  font-size: 0.9em;
  margin-bottom: -6px;
}

.world-clock-add-form select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-size: 1em;
}

.world-clock-add-form .btn {
  margin-top: 8px;
}

/* Old astro-times styles removed - now styled in .day-detail-header */

.feast-basis {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--surface-sunken);
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feast-basis strong {
  color: var(--accent-gold);
}

.feast-basis.virgo-rule-basis {
  margin-top: 12px;
  background: var(--color-purple-muted);
  border: 1px solid var(--color-purple-muted);
}

/* Uncertainty warning for ancient dates */
.uncertainty-warning {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-strong);
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-gold-hover);
  line-height: 1.4;
}

.uncertainty-warning .warning-icon {
  margin-right: 6px;
}

/* Date uncertainty - gold colored Gregorian date text only */
.day-cell.date-uncertain .gregorian,
.new-moon-box.date-uncertain .gregorian {
  color: var(--accent-gold-hover);
  font-weight: bold;
}

.day-detail-sabbath {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-gold);
  font-weight: bold;
  margin-bottom: 8px;
}

/* Priestly Course Display - subtle inline display under Gregorian date */
.day-detail-priestly-course {
  display: block;
  width: 100%;
  margin-top: 2px;
}

.priestly-course-subtle {
  color: var(--text-secondary);
  font-size: 0.8em;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.priestly-nav-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.85em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.priestly-nav-btn:hover {
  opacity: 1;
}

.day-detail-no-feast {
  color: var(--text-secondary);
  font-style: italic;
  padding: 10px 0;
}

/* Bible Events Section */
.bible-events-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.bible-events-header {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.bible-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bible-event-item {
  padding: 12px 14px;
  background: var(--accent-gold-muted);
  border-radius: 8px;
  border-left: 3px solid var(--accent-gold);
}

.bible-event-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.bible-event-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1em;
  flex: 1;
}

.bible-event-timeline-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 1.1em;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.bible-event-timeline-link:hover {
  opacity: 1;
  text-decoration: none;
}

.bible-event-description {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 8px;
}

.bible-event-verse {
  color: var(--accent-gold);
  font-size: 0.85em;
  font-style: italic;
}

.bible-event-verse::before {
  content: "📖 ";
}

/* Clickable scripture links in bible events */
.bible-event-verse .bible-citation-link {
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.bible-event-verse .bible-citation-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* Conditional event styling (Sabbath/Jubilee year events) */
.bible-event-item.conditional-event {
  border-left-color: var(--color-success);
  background: var(--color-success-muted);
}

.bible-event-item.conditional-event.jubilee-event {
  border-left-color: var(--accent-gold-hover);
  background: var(--accent-gold-subtle);
}

/* Condition badges */
.event-condition-badge {
  display: inline-block;
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.sabbath-year-badge {
  background: rgba(144, 238, 144, 0.2);
  color: var(--color-success);
  border: 1px solid var(--color-success-muted);
}

.jubilee-year-badge {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold-hover);
  border: 1px solid var(--accent-gold-strong);
}

.historical-event-badge {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary-strong);
}

.event-year-calendar-link {
  text-decoration: none;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-block;
}

.event-year-calendar-link:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Historical event styling */
.bible-event-item.historical-event {
  border-left-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

/* Anniversary event styling */
.bible-event-item.anniversary-event {
  border-left-color: var(--color-purple);
  background: var(--color-purple-subtle);
}

.anniversary-event-badge {
  background: rgba(201, 160, 220, 0.2);
  color: var(--color-purple);
  border: 1px solid rgba(201, 160, 220, 0.4);
}

/* Priestly cycle anchor event styling */
.bible-event-item.priestly-anchor-event {
  border-left-color: var(--accent-gold-hover);
  background: rgba(255, 215, 0, 0.15);
}

.bible-event-item.priestly-anchor-event .event-condition-badge {
  background: rgba(255, 215, 0, 0.25);
  color: var(--accent-gold-hover);
  border: 1px solid var(--accent-gold-strong);
}

/* Moon phase event styling */
.bible-event-item.moonphase-event {
  border-left-color: var(--accent-gold-hover);
  background: rgba(240, 230, 140, 0.1);
}

.moonphase-event-badge {
  background: rgba(240, 230, 140, 0.2);
  border: 1px solid rgba(240, 230, 140, 0.4);
}

.moonphase-event-badge.moonphase-match {
  background: var(--color-success-muted);
  border-color: rgba(100, 200, 100, 0.5);
}

.moonphase-event-badge.moonphase-other {
  background: rgba(150, 150, 150, 0.15);
  border-color: var(--border-default);
  opacity: 0.8;
}

/* Scripture quote in bible events */
.bible-event-quote {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--accent-gold-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.95em;
}

/* Bible event image */
.bible-event-image {
  margin: 12px 0;
  text-align: center;
}

.bible-event-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  border: 1px solid var(--border-accent);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.bible-event-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px var(--border-accent);
}

/* Book chapter link */
.bible-event-book-link {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.bible-event-book-link a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.bible-event-book-link a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* Expandable details section for bible events */
.bible-event-details {
  margin: 12px 0;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: rgba(126, 200, 227, 0.05);
  overflow: hidden;
}

.bible-event-details-toggle {
  display: block;
  padding: 10px 14px;
  color: var(--accent-primary);
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s;
  list-style: none;
}

.bible-event-details-toggle::-webkit-details-marker {
  display: none;
}

.bible-event-details[open] .bible-event-details-toggle {
  border-bottom: 1px solid var(--accent-primary-muted);
  background: var(--accent-primary-subtle);
}

.bible-event-details-toggle:hover {
  background: var(--accent-primary-muted);
  color: var(--accent-primary-hover);
}

.bible-event-details[open] .bible-event-details-toggle::before {
  content: "▾ ";
}

.bible-event-details:not([open]) .bible-event-details-toggle::before {
  content: "▸ ";
}

/* Remove the hardcoded arrow from the summary text */
.bible-event-details-toggle {
  /* Arrow added via ::before pseudo-element */
}

.bible-event-details-content {
  padding: 12px 14px;
}

.bible-event-detail-item {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--surface-hover);
}

.bible-event-detail-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.bible-event-detail-heading {
  color: var(--accent-gold);
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 6px;
}

.bible-event-detail-text {
  color: var(--text-secondary);
  font-size: 0.85em;
  line-height: 1.5;
}

.bible-event-detail-text .bible-citation-link,
.bible-event-description .bible-citation-link,
.bible-event-quote .bible-citation-link {
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.bible-event-detail-text .bible-citation-link:hover,
.bible-event-description .bible-citation-link:hover,
.bible-event-quote .bible-citation-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* Torah Portion Section */
.torah-portion-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.torah-portion-header {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.torah-info-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.9em;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  padding: 0;
}

.torah-info-btn:hover {
  opacity: 1;
}

.torah-portion-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.torah-portion-item {
  padding: 14px 16px;
  background: rgba(43, 90, 139, 0.25);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

.torah-portion-item.torah-holiday-replacement {
  background: rgba(139, 43, 90, 0.25);
  border-left-color: #e37ec8;
}

.torah-portion-item.torah-maftir-addition {
  background: rgba(90, 139, 43, 0.2);
  border-left-color: #a5c87e;
}

.torah-portion-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 1.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.torah-portion-hebrew {
  color: var(--accent-primary);
  font-size: 1.1em;
}

.torah-portion-meaning {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.9em;
}

.torah-portion-citation {
  color: var(--accent-primary);
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--accent-primary-subtle);
  border-radius: 4px;
  display: inline-block;
}

.torah-portion-summary {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.6;
}

.torah-portion-note {
  color: #e37ec8;
  font-size: 0.85em;
  font-style: italic;
  margin-top: 8px;
}

.maftir-label {
  font-size: 0.8em;
  color: #a5c87e;
  font-weight: 400;
}

.torah-portion-item.torah-double-portion {
  background: var(--accent-gold-subtle);
  border-left-color: var(--accent-gold);
}

.torah-portion-summary-item {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.torah-portion-summary-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.torah-portion-summary-item strong {
  color: var(--accent-primary);
}

/* Bible Citation Links */
.bible-citation-link {
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.bible-citation-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* Make the entire citation area clickable */
.torah-portion-citation {
  cursor: pointer;
}

/* Bible Reader Modal */
.bible-reader-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  z-index: 10001; /* Higher than other modals so it appears on top when opened from within another modal */
  overflow: hidden;
}

.bible-reader-modal.open {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

body.bible-reader-open {
  overflow: hidden;
}

.bible-reader-container {
  background: var(--surface-raised);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px var(--surface-scrim);
  border: 1px solid var(--accent-primary-muted);
}

.bible-reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sunken);
  border-radius: 16px 16px 0 0;
}

.bible-reader-header h2 {
  margin: 0;
  font-size: 1.3em;
  color: var(--accent-primary);
  font-weight: 600;
}

.bible-reader-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.bible-reader-close:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.bible-reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Bible Reader Content Styles */
.bible-reader-content {
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.8;
  color: var(--text-primary);
}

.bible-reader-title {
  font-size: 1.4em;
  color: var(--accent-primary);
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}

.bible-reader-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
  font-style: italic;
}

.bible-book-section {
  margin-bottom: 32px;
}

.bible-book-name {
  font-size: 1.5em;
  color: var(--accent-gold);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-gold-muted);
  font-weight: 600;
}

.bible-chapter-section {
  margin-bottom: 24px;
}

.bible-chapter-header {
  font-size: 1.15em;
  color: var(--accent-primary);
  margin-bottom: 12px;
  font-weight: 600;
}

.bible-chapter-link {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.bible-chapter-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.bible-chapter-text {
  text-align: justify;
  font-size: 1.05em;
}

.bible-verse {
  /* Verses flow inline */
}

.bible-verse-num {
  font-size: 0.7em;
  color: var(--accent-primary);
  vertical-align: super;
  margin-right: 2px;
  font-family: sans-serif;
  font-weight: 600;
}

.bible-verse-num a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.bible-verse-num a:hover {
  color: var(--accent-primary-hover);
}

.bible-chapter-separator {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary-strong), transparent);
  margin: 32px 0;
}

/* Multi-verse view (reader) */
.bible-multiverse .bible-explorer-chapter-header .chapter-subtitle {
  font-size: 0.95rem;
  font-weight: normal;
  color: var(--color-text-muted);
  word-break: break-word;
}
.bible-multiverse-section {
  margin-bottom: 1.5rem;
}
.bible-multiverse-section-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}
.bible-multiverse-verses {
  padding-left: 0.25rem;
}

/* Mobile adjustments for Bible Reader */
@media (max-width: 600px) {
  .bible-reader-modal.open {
    padding: 10px;
  }
  
  .bible-reader-container {
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }
  
  .bible-reader-header {
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
  }
  
  .bible-reader-header h2 {
    font-size: 1.1em;
  }
  
  .bible-reader-body {
    padding: 16px;
  }
  
  .bible-chapter-text {
    font-size: 1em;
    text-align: left;
  }
  
  .bible-book-name {
    font-size: 1.3em;
  }
}

/* Torah Portion Info Modal */
.torah-info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  z-index: 10000;
  overflow: hidden;
}

.torah-info-modal.open {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

body.torah-info-open {
  overflow: hidden;
}

.torah-info-container {
  background: var(--surface-raised);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px var(--surface-scrim);
  border: 1px solid var(--accent-primary-muted);
}

.torah-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sunken);
  border-radius: 16px 16px 0 0;
}

.torah-info-header h2 {
  margin: 0;
  font-size: 1.2em;
  color: var(--accent-primary);
  font-weight: 600;
}

.torah-info-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.torah-info-close:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.torah-info-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.torah-info-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.torah-info-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.torah-info-section h3 {
  color: var(--accent-gold);
  font-size: 1.1em;
  margin: 0 0 12px 0;
}

.torah-info-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 12px 0;
  font-size: 0.95em;
}

.torah-info-section p:last-child {
  margin-bottom: 0;
}

.torah-info-section ul {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 12px 0;
  padding-left: 20px;
  font-size: 0.95em;
}

.torah-info-section li {
  margin-bottom: 6px;
}

.torah-info-section em {
  color: var(--accent-primary);
  font-style: italic;
}

.torah-info-section strong {
  color: var(--text-primary);
}

/* Torah Info Comparison Table */
.torah-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.9em;
}

.torah-info-table th,
.torah-info-table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border-subtle);
}

.torah-info-table th {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-weight: 600;
}

.torah-info-table td {
  color: var(--text-secondary);
}

.torah-info-table tr:nth-child(even) td {
  background: var(--calendar-day-bg);
}

/* Torah Portions Full Table */
.torah-portions-list-container {
  margin-top: 12px;
}

.torah-portions-full-table {
  margin-top: 0;
  font-size: 0.85em;
}

.torah-portions-full-table th:first-child,
.torah-portions-full-table td:first-child {
  width: 40px;
  text-align: center;
}

.torah-portions-full-table td:nth-child(2) {
  font-weight: 600;
  color: var(--accent-primary);
}

.torah-portions-full-table td:nth-child(3) {
  color: var(--text-secondary);
  font-style: italic;
}

.torah-portions-full-table th:last-child,
.torah-portions-full-table td:last-child {
  width: 50px;
  text-align: center;
}

.torah-book-divider td {
  background: var(--accent-gold-muted) !important;
  color: var(--accent-gold) !important;
  font-weight: 600;
  text-align: center !important;
  font-style: italic;
}

/* Expandable Torah Portion Row */
.torah-expand-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 0.9em;
  padding: 4px 8px;
  transition: transform 0.2s ease;
}

.torah-expand-btn:hover {
  color: var(--accent-primary-hover);
}

.torah-expand-btn.expanded {
  transform: rotate(180deg);
}

.torah-portion-row.expanded {
  background: var(--accent-primary-subtle) !important;
}

.torah-summary-row {
  display: none;
}

.torah-summary-row.visible {
  display: table-row;
}

.torah-summary-row td {
  padding: 12px 16px !important;
  background: var(--surface-sunken) !important;
  border-top: none !important;
}

.torah-summary-content {
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.6;
  font-style: normal;
  text-align: justify;
}

/* Mobile adjustments for Torah Info Modal */
@media (max-width: 600px) {
  .torah-info-modal.open {
    padding: 10px;
  }
  
  .torah-info-container {
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }
  
  .torah-info-header {
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
  }
  
  .torah-info-header h2 {
    font-size: 1em;
  }
  
  .torah-info-body {
    padding: 16px;
  }
  
  .torah-info-section h3 {
    font-size: 1em;
  }
  
  .torah-info-section p,
  .torah-info-section ul {
    font-size: 0.9em;
  }
  
  .torah-info-table {
    font-size: 0.8em;
  }
  
  .torah-info-table th,
  .torah-info-table td {
    padding: 8px;
  }
}

/* Feast Table */
.feast-list {
  margin-top: 30px;
  padding: 0 10px;
}

.feast-list h3 {
  color: var(--surface-base);
  margin-bottom: 15px;
}

.feast-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 8px var(--surface-scrim);
  border-radius: 8px;
  overflow: hidden;
}

.feast-table th {
  background: var(--surface-base);
  color: var(--text-primary);
  padding: 12px;
  text-align: left;
}

.feast-table td {
  padding: 12px;
  border-bottom: 1px solid var(--text-primary);
}

.feast-table tr:hover {
  background: #f8f9fa;
}

.feast-table .feast-jump {
  cursor: pointer;
}

.feast-table .feast-jump:hover {
  text-decoration: underline !important;
}

.feast-table td a {
  display: block;
}

.info-box {
  background: #e7f3ff;
  border-left: 4px solid var(--surface-base);
  padding: 15px;
  margin: 20px 0;
  font-size: 0.95em;
  border-radius: 0 8px 8px 0;
}

@media (max-width: 768px) {
  .calendar-app {
    max-width: 100%;
    padding: 0;
  }
  
  .month-calendar,
  .settings-page {
    border-radius: 0;
  }
  
  .settings-dialog,
  .dropdown-picker,
  .month-picker,
  .year-picker,
  .time-picker-dropdown,
  .date-jump-popup {
    width: calc(100% - 16px);
    max-width: none;
    left: 8px !important;
    right: 8px !important;
    transform: none !important;
  }
  
  .settings-page-header {
    padding: 12px 15px;
  }
  
  .settings-section {
    padding: 15px;
  }
  
  .settings-option-btn {
    padding: 12px 15px;
  }
  
  .settings-option-btn .option-icon {
    font-size: 2em;
  }
  
  .settings-option-btn[data-phase] .option-icon {
    font-size: 2.8em;
  }
  
  .calendar-controls {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  
  .control-group {
    width: 100%;
  }
  
  .control-group input,
  .control-group select {
    width: 100%;
    min-height: 44px; /* Touch-friendly */
  }
  
  .btn {
    min-height: 44px;
    font-size: 1em;
    flex: 1;
  }
  
  .control-group div[style*="display: flex"] {
    width: 100%;
  }
  
  
  .month-buttons {
    gap: 3px;
  }
  
  .month-btn {
    min-height: 36px;
    padding: 6px 2px;
    font-size: 0.85em;
  }
  
  .month-btn.month-13:not(.has-13) {
    display: none; /* Hide 13th month button on mobile unless year has 13 months */
  }
  
  .calendar-header {
    grid-template-columns: 1fr minmax(55px, calc(100vw / 7));
    gap: 0;
    padding: 0;
  }
  
  .header-row-1 {
    padding: 4px 10px 2px;
  }
  
  .jubilee-indicator {
    font-size: 1.1em;
    padding: 2px 6px;
  }
  
  .header-row-2 {
    padding: 2px 10px 6px;
    gap: 4px;
  }
  
  .header-dropdown {
    padding: 2px 4px;
    font-size: 0.95em !important;
  }
  
  .top-nav-profile {
    font-size: 0.95em;
    padding: 3px 8px;
  }
  
  .header-separator {
    font-size: 0.7em;
  }
  
  .new-moon-box {
    min-height: 60px;
    padding: 3px;
    width: calc(100vw / 7);
    min-width: 55px;
    flex-shrink: 0;
  }
  
  .new-moon-box .gregorian {
    font-size: 0.75em;
  }
  
  .new-moon-box .lunar-day {
    font-size: 1.1em;
  }
  
  .new-moon-box .feast-icons,
  .new-moon-box .day-icons-right {
    font-size: 0.7em;
  }
  
  .day-cell .day-event-icon,
  .day-cell .day-icons-left {
    font-size: 0.7em;
  }
  
  .day-cell .day-icons-right {
    font-size: 0.75em;
  }
  
  .week-header {
    font-size: 0.65em;
    gap: 2px;
  }
  
  .week-header > div {
    padding: 5px 2px;
  }
  
  .day-cell {
    min-height: 55px;
    padding: 3px;
  }
  
  .day-cell .lunar-day {
    font-size: 1.2em;
  }
  
  .day-cell .gregorian {
    font-size: 0.85em;
    color: var(--text-primary);
  }
  
  .day-cell .gregorian .day-year {
    font-size: 0.9em;
    color: var(--accent-gold-hover);
    font-weight: bold;
  }
  
  .day-cell .moon-phase {
    font-size: 0.65em;
  }
  
  .feast-icons {
    font-size: 0.85em !important;
  }
  
  .scripture-quote {
    font-size: 0.75em;
    padding: 8px;
  }
  
  .month-nav-cell .nav-arrow {
    font-size: 1.1em;
    padding: 4px 6px;
    min-width: 28px;
    min-height: 28px;
  }
  
  .month-nav-cell.nav-group {
    gap: 4px;
  }
  
  .month-nav-cell .nav-arrow.year-nav {
    font-size: 1.1em;
  }
  
  /* Feast table responsive */
  .feast-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .feast-table {
    font-size: 0.85em;
    min-width: 400px;
  }
  
  .feast-table th,
  .feast-table td {
    padding: 8px 6px;
  }
  
  /* Day detail panel mobile */
  .day-detail-panel {
    padding: 12px 15px;
  }
  
  .day-detail-lunar {
    font-size: 1.2em;
  }
  
  .day-detail-gregorian {
    font-size: 0.9em;
  }
  
  .day-detail-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .day-detail-header .day-detail-astro-times {
    width: 100%;
    font-size: 0.8em;
    padding: 8px 10px;
  }
  
  .day-detail-header .astro-times-row {
    justify-content: space-between;
  }
  
  /* Top nav mobile */
  .top-nav-inner {
    padding: 8px 12px;
  }
  
  .top-nav-title {
    font-size: 1.1em;
  }
  
  .top-nav-tagline {
    font-size: 0.65em;
  }
  
  .hamburger-btn {
    font-size: 24px;
    padding: 6px;
  }
}

@media (max-width: 480px) {
  /* Shrink top nav for small screens */
  .top-nav-title {
    font-size: 0.95em;
  }
  
  .top-nav-tagline {
    font-size: 0.55em;
  }
  
  .top-nav-icon {
    font-size: 1.4em;
  }
  
  .top-nav-brand {
    gap: 6px;
  }
  
  .today-btn {
    font-size: 0.85em;
    padding: 4px 8px;
  }
  
  .day-cell {
    min-height: 48px;
    padding: 2px;
  }
  
  .day-cell .lunar-day {
    font-size: 1em;
  }
  
  .day-cell .gregorian {
    font-size: 0.6em;
    color: var(--text-primary);
  }
  
  .day-cell .gregorian .day-year {
    display: none;
  }
  
  .day-cell .moon-phase {
    font-size: 0.4em;
  }
  
  .new-moon-box {
    min-height: 50px;
    padding: 2px;
    width: calc(100vw / 7);
  }
  
  .new-moon-box .gregorian {
    font-size: 0.55em;
  }
  
  .new-moon-box .gregorian .day-year {
    display: none;
  }
  
  .new-moon-box .lunar-day {
    font-size: 1em;
  }
  
  .new-moon-box .feast-icons,
  .new-moon-box .day-icons-right {
    font-size: 0.6em;
  }
  
  .feast-icons {
    font-size: 0.7em !important;
  }
  
  .day-cell .day-icons-left,
  .day-cell .day-icons-right,
  .new-moon-box .day-icons-left,
  .new-moon-box .day-icons-right {
    font-size: 0.55em;
  }
  
  .week-header {
    font-size: 0.55em;
  }
  
  .month-btn {
    min-height: 32px;
    padding: 4px 1px;
    font-size: 0.75em;
  }

  .header-row-1 {
    padding: 3px 8px 1px;
  }
  
  .jubilee-indicator {
    font-size: 0.95em;
    gap: 4px;
    padding: 2px 4px;
  }
  
  .header-row-2 {
    padding: 2px 8px 4px;
    gap: 2px;
  }
  
  .header-dropdown {
    padding: 2px 3px;
    font-size: 0.85em !important;
  }
  
  .header-dropdown .dropdown-arrow {
    font-size: 0.6em;
  }
  
  .top-nav-profile {
    font-size: 0.85em;
    padding: 2px 6px;
    gap: 4px;
  }
  
  .top-nav-profile-moon {
    font-size: 1em;
  }
  
  .header-separator {
    font-size: 0.55em;
  }

  .scripture-quote {
    font-size: 0.6em;
    padding: 3px;
  }
  
  .month-nav-cell .nav-arrow {
    font-size: 0.95em;
    padding: 3px 5px;
    min-width: 24px;
    min-height: 24px;
  }
  
  .month-nav-cell.nav-group {
    gap: 2px;
  }
  
  .month-nav-cell .nav-arrow.year-nav {
    font-size: 0.95em;
  }
  
  .full-moon-info .moon-icon {
    font-size: 42px;
  }
  
  .moon-gear-badge {
    font-size: 14px;
    bottom: -2px;
    right: 0px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  /* Further shrink top nav */
  .top-nav-title {
    font-size: 0.85em;
  }
  
  .top-nav-tagline {
    display: none;  /* Hide tagline on very small screens */
  }
  
  .top-nav-icon {
    font-size: 1.2em;
  }
  
  .top-nav-brand {
    gap: 4px;
  }
  
  .today-btn {
    font-size: 0.8em;
    padding: 3px 6px;
  }
  
  .top-nav-profile-name {
    font-size: 0.85em;
  }
  
  .day-cell .gregorian {
    font-size: 0.5em;
  }
  
  .new-moon-box .gregorian {
    font-size: 0.45em;
  }
  
  .day-cell .lunar-day {
    font-size: 0.9em;
  }
  
  .day-cell .moon-phase {
    display: none;
  }
  
  .week-header {
    font-size: 0.5em;
  }
  
  .header-dropdown {
    padding: 1px 2px;
    font-size: 0.75em !important;
  }
  
  .header-separator {
    font-size: 0.45em;
  }
  
  .jubilee-indicator {
    font-size: 0.8em;
    gap: 3px;
    padding: 1px 3px;
  }
  
  .jubilee-info-link {
    font-size: 0.8em;
  }
  
  .top-nav-profile {
    font-size: 0.75em;
    padding: 2px 4px;
    gap: 3px;
  }
  
  .top-nav-profile-moon {
    font-size: 0.9em;
  }
}

@media print {
  .calendar-controls, .month-nav button, .info-box {
    display: none;
  }
  
  .month-calendar {
    break-inside: avoid;
  }
}

/* Sabbath Tester Page Styles */
#sabbath-tester-page {
  position: fixed;
  top: 55px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.sabbath-tester-header {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 50%);
  z-index: 10;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.sabbath-tester-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sabbath-tester-header h2 {
  margin: 0;
  font-size: 1.3em;
  color: var(--accent-primary);
  flex: 1;
}

.sabbath-tester-header-inner .close-btn {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.2em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sabbath-tester-header-inner .close-btn:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.sabbath-tester-content {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.sabbath-test-card {
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--accent-primary-muted);
}

.sabbath-test-title {
  font-size: 1.2em;
  color: var(--accent-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sabbath-test-date {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sabbath-test-scripture {
  display: inline-block;
  background: var(--accent-primary-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.sabbath-test-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 0.95em;
}

/* Test Evidence Accordion */
.test-evidence-accordion {
  margin-bottom: 16px;
  background: var(--accent-primary-subtle);
  border-radius: 8px;
  border: 1px solid var(--accent-primary-muted);
}

.test-evidence-accordion summary {
  cursor: pointer;
  color: var(--accent-primary);
  font-weight: 500;
  padding: 12px 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-evidence-accordion summary::-webkit-details-marker {
  display: none;
}

.test-evidence-accordion summary::before {
  content: '▶';
  font-size: 0.7em;
  transition: transform 0.2s;
}

.test-evidence-accordion[open] summary::before {
  transform: rotate(90deg);
}

.test-evidence-accordion summary:hover {
  color: var(--accent-primary-hover);
  background: rgba(126, 200, 227, 0.05);
}

.test-evidence-content {
  padding: 0 14px 14px 14px;
  animation: accordionOpen 0.2s ease-out;
}

.test-evidence-content p {
  margin: 0 0 12px 0;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
}

.test-evidence-content ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
  color: var(--text-primary);
}

.test-evidence-content li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.test-evidence-content li strong {
  color: var(--accent-primary);
}

.test-evidence-content a {
  color: var(--accent-primary);
  text-decoration: none;
}

.test-evidence-content a:hover {
  text-decoration: underline;
}

.test-interpretation {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--accent-gold-subtle);
  border-left: 3px solid var(--accent-gold-hover);
  border-radius: 0 8px 8px 0;
}

.test-interpretation p {
  margin: 0 0 10px 0;
  color: rgba(255,255,255,0.9);
}

.test-interpretation ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-primary);
}

.test-interpretation li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.test-interpretation li strong {
  color: var(--accent-gold-hover);
}

.sabbath-test-expected {
  background: var(--accent-primary-subtle);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  color: var(--accent-primary);
  font-weight: 500;
}

.sabbath-test-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.sabbath-test-results-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-sunken);
  color: var(--accent-primary);
  border-bottom: 1px solid var(--border-accent);
}

.sabbath-test-results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.sabbath-test-results-table tr:last-child td {
  border-bottom: none;
}

.sabbath-test-results-table .result-pass {
  color: var(--color-success);
  font-weight: 600;
}

.sabbath-test-results-table .result-fail {
  color: var(--color-error);
  font-weight: 600;
}

.sabbath-test-results-table .result-uncertain {
  color: var(--color-warning);
  font-weight: 600;
}

.sabbath-test-date-link {
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
}

.sabbath-test-date-link:hover {
  text-decoration: underline;
}

.year-uncertainty-icon {
  color: var(--color-warning);
  font-size: 0.85em;
  cursor: help;
  white-space: nowrap;
}

/* Summary Scoreboard */
.sabbath-scoreboard {
  background: var(--shadow-lg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-accent);
}

.sabbath-scoreboard-title {
  font-size: 1.1em;
  color: var(--accent-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sabbath-scoreboard-intro {
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text-primary);
  font-size: 0.95em;
}

.sabbath-scoreboard-intro p {
  margin: 0 0 12px 0;
}

.scoreboard-conclusion {
  background: var(--accent-primary-subtle);
  border-left: 3px solid var(--accent-primary);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin-top: 12px;
}

.scoreboard-conclusion p {
  margin: 0 0 8px 0;
}

.scoreboard-conclusion p:last-child {
  margin-bottom: 0;
}

.sabbath-scoreboard-table {
  width: 100%;
  border-collapse: collapse;
}

.sabbath-scoreboard-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-weight: 600;
}

.sabbath-scoreboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.sabbath-scoreboard-table tr:last-child td {
  border-bottom: none;
}

.sabbath-scoreboard-table .score-perfect {
  color: var(--color-success);
  font-weight: 600;
}

.sabbath-scoreboard-table .score-good {
  color: var(--color-success);
  font-weight: 600;
}

.sabbath-scoreboard-table .score-medium {
  color: var(--color-warning);
  font-weight: 600;
}

.sabbath-scoreboard-table .score-poor {
  color: var(--color-error);
  font-weight: 600;
}

.scoreboard-expandable {
  cursor: pointer;
  transition: background 0.2s;
}

.scoreboard-expandable:hover {
  background: var(--accent-primary-subtle);
}

.scoreboard-expandable .expand-arrow {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.7em;
  margin-right: 6px;
}

.scoreboard-expandable.expanded .expand-arrow {
  transform: rotate(90deg);
}

.scoreboard-details td {
  background: var(--surface-sunken);
  padding: 12px 16px !important;
}

.score-breakdown {
  font-size: 0.9em;
  line-height: 1.6;
}

.breakdown-section {
  margin-bottom: 6px;
}

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

.breakdown-label {
  font-weight: 600;
}

/* Alt Score expandable in test tables */
.alt-score-details {
  cursor: pointer;
}

.alt-score-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.alt-score-details summary::-webkit-details-marker {
  display: none;
}

.alt-score-details summary::before {
  content: '▶';
  font-size: 0.6em;
  transition: transform 0.2s;
}

.alt-score-details[open] summary::before {
  transform: rotate(90deg);
}

.alt-score-breakdown {
  margin-top: 8px;
  font-size: 0.85em;
  line-height: 1.5;
  padding: 8px;
  background: var(--surface-sunken);
  border-radius: 4px;
}

.alt-score-breakdown .breakdown-section {
  margin-bottom: 4px;
}

.sabbath-test-loading {
  text-align: center;
  padding: 40px;
  color: var(--accent-primary);
}

@media (max-width: 600px) {
  .sabbath-test-results-table th,
  .sabbath-test-results-table td {
    padding: 8px 6px;
    font-size: 0.85em;
  }
  
  .sabbath-scoreboard-table th,
  .sabbath-scoreboard-table td {
    padding: 8px 6px;
    font-size: 0.85em;
  }
}

/* About Modal */
.about-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 20px;
  box-sizing: border-box;
}

.about-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.about-modal {
  background: linear-gradient(145deg, var(--surface-raised) 0%, var(--surface-sunken) 50%, var(--surface-raised) 100%);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 25px 80px var(--surface-scrim), 0 0 60px var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-muted);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease-out;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.about-modal::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.about-modal-overlay.visible .about-modal {
  transform: scale(1) translateY(0);
}

.about-modal-header {
  text-align: center;
  padding: 30px 30px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.about-modal-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.about-modal-logo .moon-phase {
  font-size: 2.5em;
  opacity: 0.6;
  transition: transform 0.3s, opacity 0.3s;
}

.about-modal-logo .moon-phase.primary {
  font-size: 3.5em;
  opacity: 1;
}

.about-modal-title {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 0 0 8px 0;
  letter-spacing: 1px;
}

.about-modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.95em;
  margin: 0;
}

.about-modal-content {
  padding: 25px 30px;
}

.about-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.about-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-hover);
  color: var(--text-primary);
  font-size: 0.95em;
  line-height: 1.4;
}

.about-features li:last-child {
  border-bottom: none;
}

.about-features .feature-icon {
  font-size: 1.3em;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.about-features .feature-text {
  flex: 1;
}

.about-features .feature-text strong {
  color: var(--text-primary);
}

.about-features .feature-img {
  width: 1.3em;
  height: 1.3em;
  object-fit: contain;
}

.about-start-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold) 100%);
  color: var(--text-primary);
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 1.05em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  margin-bottom: 16px;
}

.about-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-gold-muted);
}

.about-start-btn:active {
  transform: translateY(0);
}

.about-cta {
  background: var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-muted);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.about-cta p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.9em;
}

/* iOS Install Instructions Modal */
.ios-install-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 20px;
  box-sizing: border-box;
}

.ios-install-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.ios-install-modal {
  background: linear-gradient(145deg, var(--surface-raised) 0%, var(--surface-sunken) 50%, var(--surface-raised) 100%);
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 60px var(--surface-scrim);
  border: 1px solid var(--border-subtle);
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease-out;
}

.ios-install-overlay.visible .ios-install-modal {
  transform: scale(1) translateY(0);
}

.ios-install-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ios-install-close:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.ios-install-header {
  text-align: center;
  margin-bottom: 16px;
}

.ios-install-icon {
  font-size: 2.5em;
  display: block;
  margin-bottom: 8px;
}

.ios-install-header h3 {
  margin: 0;
  color: var(--accent-gold);
  font-size: 1.4em;
}

.ios-install-intro {
  text-align: center;
  color: var(--text-primary);
  font-size: 0.95em;
  margin: 0 0 20px 0;
  line-height: 1.4;
}

.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.ios-install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface-hover);
  padding: 12px;
  border-radius: 10px;
}

.step-number {
  background: var(--accent-gold);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9em;
  flex-shrink: 0;
}

.step-content p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95em;
  line-height: 1.4;
}

.ios-share-icon {
  display: inline-block;
  background: rgba(0, 122, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 1.1em;
}

.ios-install-done-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold) 100%);
  color: var(--text-primary);
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1.05em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ios-install-done-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-gold-muted);
}

@media (max-width: 480px) {
  .about-modal {
    border-radius: 16px;
  }
  
  .about-modal-header {
    padding: 24px 20px 16px;
  }
  
  .about-modal-title {
    font-size: 1.5em;
  }
  
  .about-modal-content {
    padding: 20px;
  }
}

/* ============================================================================
   JUBILEE INFO MODAL
   ============================================================================ */

.jubilee-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 20px;
  box-sizing: border-box;
}

.jubilee-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.jubilee-modal {
  background: linear-gradient(145deg, #1a2a3a 0%, var(--surface-raised) 50%, #0a1628 100%);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px var(--surface-scrim), 0 0 0 1px rgba(201, 162, 39, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease-out;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.jubilee-modal::-webkit-scrollbar {
  display: none;
}

.jubilee-modal-overlay.visible .jubilee-modal {
  transform: scale(1) translateY(0);
}

.jubilee-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  background: var(--surface-sunken);
  position: sticky;
  top: 0;
  z-index: 1;
}

.jubilee-modal-header h2 {
  margin: 0;
  font-size: 1.4em;
  color: var(--accent-gold-hover);
  font-weight: 600;
}

.jubilee-modal-close {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.5em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.jubilee-modal-close:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.jubilee-modal-content {
  padding: 24px;
  color: var(--text-primary);
  line-height: 1.6;
}

.jubilee-section {
  margin-bottom: 28px;
}

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

.jubilee-section h3 {
  color: var(--accent-gold-hover);
  font-size: 1.2em;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.jubilee-section h4 {
  color: var(--accent-primary);
  font-size: 1em;
  margin: 16px 0 8px 0;
  font-weight: 600;
}

.jubilee-section p {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
}

.jubilee-section ul {
  margin: 0 0 12px 0;
  padding-left: 24px;
}

.jubilee-section li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.jubilee-section blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(201, 162, 39, 0.1);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.jubilee-section blockquote strong {
  color: var(--accent-gold-hover);
  font-style: normal;
}

.scripture-refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.ref-group h4 {
  margin-top: 0;
}

.ref-group ul {
  padding-left: 20px;
}

.ref-group a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.ref-group a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .jubilee-modal {
    border-radius: 12px;
    max-height: 90vh;
  }
  
  .jubilee-modal-header {
    padding: 16px 20px;
  }
  
  .jubilee-modal-header h2 {
    font-size: 1.2em;
  }
  
  .jubilee-modal-content {
    padding: 20px;
  }
  
  .jubilee-section h3 {
    font-size: 1.1em;
  }
  
  .scripture-refs {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Historical Events Page
   ========================================== */

body.events-open {
  overflow: hidden !important;
}

body.biblical-timeline-open {
  overflow: hidden !important;
}

/* Full-width nav when timeline is open */
body.biblical-timeline-open .top-nav-inner {
  max-width: 100%;
}

.events-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.events-header {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 50%);
  z-index: 10;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.events-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.events-header h2 {
  margin: 0;
  font-size: 1.3em;
  color: var(--accent-primary);
  flex: 1;
}

.events-header .close-btn {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.2em;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.events-header .close-btn:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.events-page-content {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.events-intro {
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.events-intro p {
  color: var(--text-secondary);
  margin: 0 0 15px 0;
  line-height: 1.6;
}

.events-profile-context {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.events-profile-label {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.events-profile-value {
  color: var(--accent-primary);
  font-weight: bold;
}

.events-profile-change-btn {
  background: var(--accent-primary-muted);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
}

.events-profile-change-btn:hover {
  background: var(--border-accent);
}

.events-controls {
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
}

.events-filter-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.events-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.events-filter-group label {
  color: var(--text-secondary);
  font-size: 0.9em;
  white-space: nowrap;
}

.events-filter-group select,
.events-filter-group input {
  background: var(--border-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
}

.events-filter-group select:focus,
.events-filter-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.events-filter-group input::placeholder {
  color: var(--text-tertiary);
}

.events-timeline-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
}

.events-view-btn {
  background: var(--border-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.95em;
}

.events-view-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.events-view-btn:last-child {
  border-radius: 0 8px 8px 0;
  border-left: none;
}

.events-view-btn.active {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary-strong);
  color: var(--accent-primary);
}

.events-view-btn:hover:not(.active) {
  background: var(--border-default);
}

/* Events List Container */
.events-list-container {
  min-height: 200px;
}

.events-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.events-era-group {
  margin-bottom: 24px;
}

.events-era-header {
  color: var(--accent-primary);
  font-size: 1.1em;
  font-weight: bold;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--accent-primary-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.events-era-count {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: normal;
}

.event-card {
  background: var(--surface-sunken);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.event-card:hover {
  background: var(--surface-sunken);
  border-color: var(--border-accent);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.event-card-title {
  color: var(--text-primary);
  font-size: 1.05em;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.event-card-type {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-size: 0.75em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: capitalize;
  white-space: nowrap;
}

.event-card-dates {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.event-date-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-date-label {
  color: var(--text-tertiary);
  font-size: 0.8em;
}

.event-date-value {
  color: var(--accent-gold);
  font-size: 0.9em;
}

.event-card-desc {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.event-tag {
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 4px;
}

.event-validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 10px;
}

.event-validation-badge.valid {
  background: rgba(76, 175, 80, 0.2);
  color: var(--color-success);
}

.event-validation-badge.invalid {
  background: rgba(244, 67, 54, 0.2);
  color: var(--color-error);
}

/* Event Detail Modal */
.event-detail-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.event-detail-overlay.visible {
  display: flex;
}

.event-detail-modal {
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--accent-primary-muted);
}

.event-detail-header {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.event-detail-header h3 {
  margin: 0;
  color: var(--accent-primary);
  font-size: 1.3em;
  flex: 1;
}

.event-detail-close {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.2em;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-detail-close:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.event-detail-content {
  padding: 20px;
}

.event-detail-dates {
  background: var(--surface-sunken);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
}

.event-detail-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-hover);
}

.event-detail-date-row:last-child {
  border-bottom: none;
}

.event-detail-dates .date-label {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.event-detail-dates .date-value {
  color: var(--accent-gold);
  font-weight: 500;
}

.event-detail-description {
  margin-bottom: 20px;
}

.event-detail-description p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.event-detail-sources {
  margin-bottom: 20px;
}

.event-detail-sources h4 {
  color: var(--accent-primary);
  font-size: 0.95em;
  margin: 0 0 10px 0;
}

.event-detail-sources ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-detail-sources li {
  color: var(--text-secondary);
  font-size: 0.9em;
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}

.event-detail-sources li::before {
  content: '📖';
  position: absolute;
  left: 0;
  font-size: 0.8em;
}

.event-detail-sources li.historical::before {
  content: '📜';
}

.event-detail-sources li.astronomical::before {
  content: '🔭';
}

.event-detail-sources .scripture-link {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.event-detail-sources .scripture-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.event-detail-sources .source-quote {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-top: 4px;
  padding-left: 10px;
  border-left: 2px solid var(--border-accent);
}

.event-detail-validation {
  background: var(--surface-sunken);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
}

.event-detail-validation h4 {
  color: var(--accent-primary);
  font-size: 0.95em;
  margin: 0 0 10px 0;
}

.event-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.event-detail-article-btn,
.event-detail-calendar-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.95em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.event-detail-article-btn {
  background: var(--accent-primary-muted);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
}

.event-detail-article-btn:hover {
  background: var(--border-accent);
}

.event-detail-calendar-btn {
  background: var(--accent-gold-muted);
  border: 1px solid var(--accent-gold-muted);
  color: var(--accent-gold);
}

.event-detail-calendar-btn:hover {
  background: var(--accent-gold-muted);
}

/* Timeline View */
.events-timeline-container {
  min-height: 400px;
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 20px;
  position: relative;
}

.events-timeline-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.events-no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .events-page-content {
    padding: 15px;
  }
  
  .events-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .events-filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .events-filter-group label {
    margin-bottom: 4px;
  }
  
  .event-card-dates {
    flex-direction: column;
    gap: 6px;
  }
  
  .event-card-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .event-detail-modal {
    max-height: 90vh;
  }
  
  .event-detail-actions {
    flex-direction: column;
  }
  
  .event-detail-article-btn,
  .event-detail-calendar-btn {
    min-width: auto;
  }
}

/* Biblical Timeline Page - positioned below main nav */
.biblical-timeline-page {
  position: fixed;
  top: var(--top-nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(180deg, var(--surface-base) 0%, var(--surface-raised) 100%);
  overflow: hidden;
  z-index: 1000; /* Higher z-index to ensure it covers everything */
  display: flex;
  flex-direction: column;
}

/* Hide the biblical timeline's own header - main nav is visible */
.biblical-timeline-header {
  display: none;
}

.biblical-timeline-header h2 {
  margin: 0;
  font-size: 1.1em;
  color: var(--accent-primary);
  font-weight: 500;
}

.biblical-timeline-header .close-btn {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1em;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.biblical-timeline-header .close-btn:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.biblical-timeline-vis-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important for flex children to shrink */
  height: 100%; /* Ensure it takes parent height */
}

/* Timeline Controls - stays at top */
.timeline-controls {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-sunken);
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--accent-primary-muted);
}

/* Controls panel - fixed bottom left with zoom and filters */
.timeline-controls-panel {
  position: fixed;
  bottom: 20px;
  left: 2px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  z-index: 8000;
}

/* Zoom controls - stacked vertically */
.timeline-zoom-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface-overlay);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--accent-primary-muted);
}

/* Filter controls - horizontal row next to zoom */
.timeline-filter-controls {
  display: flex;
  flex-direction: row;
  gap: 4px;
  background: var(--surface-overlay);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--accent-primary-muted);
}

.timeline-zoom-btn {
  background: var(--accent-primary-muted);
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.timeline-zoom-btn:hover {
  background: var(--border-accent);
  border-color: var(--accent-primary-strong);
  transform: scale(1.05);
}

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

/* Ruler-style Timeline - Events stacked on right, connected by lines */
.ruler-timeline-container {
  width: 100%;
  position: relative;
  overflow-y: scroll;
  overflow-x: hidden;
  /* Height is set dynamically via inline style */
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.ruler-timeline-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.ruler-timeline-wrapper {
  position: relative;
  width: 100%;
  /* Height is set dynamically via inline style */
}

.timeline-zoom-info {
  color: var(--accent-primary);
  font-size: 0.9em;
  margin-left: 10px;
  font-weight: 500;
}

/* Timeline Filter Buttons */
.timeline-filter-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--border-subtle);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-filter-btn:hover {
  background: var(--border-default);
  opacity: 0.8;
}

.timeline-filter-btn.active {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary-strong);
  opacity: 1;
}

/* Timeline Ruler (left side with year labels) */
.timeline-ruler {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 35px;
  z-index: 10;
  pointer-events: none;
  overflow: visible;
}

.ruler-tick {
  position: absolute;
  left: 2px;
  right: 0;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
}

.ruler-tick-line {
  height: 2px;
  background: var(--accent-primary-strong);
  margin-left: auto;
  flex-shrink: 0;
}

/* Major tick lines (labeled intervals) */
.ruler-tick-line.major {
  width: 8px;
  height: 2px;
  background: var(--accent-primary);
}

/* Medium tick lines (50-year intervals) */
.ruler-tick-line.medium {
  width: 6px;
  height: 2px;
  background: var(--accent-primary);
}

/* Minor tick lines (10-year intervals) */
.ruler-tick-line.minor {
  width: 4px;
  height: 1px;
  background: var(--accent-primary-strong);
}

/* Yearly tick lines (1-year intervals) */
.ruler-tick-line.yearly {
  width: 2px;
  height: 1px;
  background: var(--accent-primary-strong);
}

/* Monthly tick lines */
.ruler-tick-line.month {
  width: 4px;
  height: 1px;
  background: var(--accent-gold);
}

/* Weekly tick lines */
.ruler-tick-line.week {
  width: 3px;
  height: 1px;
  background: var(--accent-gold-strong);
}

/* Daily tick lines */
.ruler-tick-line.day {
  width: 2px;
  height: 1px;
  background: var(--accent-gold-muted);
}

/* Lunar calendar bars - after axis line */
.lunar-bars-container {
  position: absolute;
  left: 35px; /* After axis (33) + axis width (2) */
  top: 0;
  width: 10px; /* 5px lunar years + 5px lunar months */
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  background: transparent !important;
}

/* Lunar year bar */
.lunar-year-bar {
  position: absolute;
  left: 0;
  width: 5px;
}

.lunar-year-bar.odd {
  background: var(--color-success);
}

.lunar-year-bar.even {
  background: var(--color-purple-muted);
}

/* Lunar month bar - 5px strip after lunar year bar */
.lunar-month-bar {
  position: absolute;
  left: 5px; /* After 5px lunar year bar */
  width: 5px;
}

.lunar-month-bar.odd {
  background: var(--accent-gold-strong);
}

.lunar-month-bar.even {
  background: var(--accent-gold-strong);
}

/* Canvas for event connecting lines */
.event-lines-canvas {
  background: none !important;
  background-color: transparent !important;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
}

/* Duration event bars */
.duration-bars-container {
  position: absolute;
  /* left position set dynamically via inline style */
  top: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  background: transparent !important;
}

.duration-event-bar {
  position: absolute;
  width: 10px;
  border-radius: 2px;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--shadow-lg);
  box-sizing: border-box;
}

.duration-event-bar:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 6px var(--text-tertiary);
}

.duration-event-bar.selected {
  background-color: var(--accent-gold-hover) !important;
  border: 2px solid var(--text-primary) !important;
  box-shadow: 0 0 12px rgba(240, 192, 64, 0.8), 0 0 20px var(--text-tertiary);
  z-index: 100;
}

.duration-event-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 0.7em;
  font-weight: 500;
  color: var(--text-primary);
  text-shadow: 0 0 3px var(--surface-scrim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  padding: 4px 2px;
  max-height: calc(100% - 8px);
}

/* Vertical year label - number on top, era below */
.ruler-tick-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--accent-primary);
  font-size: 0.7em;
  font-weight: 500;
  line-height: 1.1;
  padding-right: 4px;
  white-space: nowrap;
}

.ruler-tick-label .year-num {
  font-size: 1.2em;
  font-weight: 500;
}

.ruler-tick-label .year-era {
  font-size: 0.95em;
  opacity: 0.85;
}

/* Timeline axis line - slightly inside ruler */
.timeline-axis-line {
  position: absolute;
  left: 33px; /* 2px inside ruler edge - JS overrides */
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-primary);
  z-index: 2;
}

/* Drag cursor for timeline */
.ruler-timeline-container {
  cursor: grab;
}
.ruler-timeline-container:active {
  cursor: grabbing;
}

/* Duration events as vertical lines on timeline */
/* Old duration lines - replaced by duration-bars-container */

.duration-vertical-line:hover {
  opacity: 1;
  width: 6px;
  z-index: 5;
}

/* Events stacked on the right */
.timeline-events-stack {
  position: absolute;
  /* Left position set dynamically based on duration bars width */
  top: 0;
  right: 10px;
  z-index: 3;
}

.stacked-event {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  background: var(--surface-overlay);
  border-left: 3px solid;
  border-radius: 4px;
  cursor: pointer;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.85em;
  transition: background 0.15s, box-shadow 0.15s;
}

.stacked-event:hover {
  background: var(--surface-overlay);
  box-shadow: 0 2px 8px var(--surface-scrim);
}

.stacked-event-icon {
  font-size: 1em;
  flex-shrink: 0;
}

.stacked-event-title {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* Cluster badge - end cap on the right side of the event */
.cluster-badge {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-size: 0.75em;
  font-weight: 600;
  padding: 0 8px;
  margin-left: auto;
  margin-right: -12px;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--accent-primary-muted);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.cluster-badge:hover {
  background: var(--accent-primary-strong);
}

/* Removed - date now in tooltip only */

/* Duration parallel line (unused, keeping for reference) */
.duration-parallel-line {
  position: absolute;
  width: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 2px;
}

.duration-line-label {
  position: absolute;
  left: 10px;
  top: 0;
  padding: 4px 8px;
  background: var(--surface-sunken);
  color: var(--text-primary);
  font-size: 0.8em;
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.duration-parallel-line:hover .duration-line-label {
  opacity: 1;
}

/* Point events with callout boxes */
.timeline-point-events {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 5;
}

.point-event-callout {
  position: absolute;
  transform: translateY(-50%);
}

.point-event-callout.left {
  left: 150px;
}

.point-event-callout.right {
  right: 0;
}

.callout-line {
  position: absolute;
  top: 50%;
  width: 100px;
  height: 2px;
  transform: translateY(-50%);
}

.point-event-callout.left .callout-line {
  left: 0;
}

.point-event-callout.right .callout-line {
  right: 0;
}

.callout-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface-scrim);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 6;
}

.point-event-callout.left .callout-marker {
  left: 100px;
}

.point-event-callout.right .callout-marker {
  right: 100px;
  transform: translate(50%, -50%);
}

.callout-marker:hover {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 10px currentColor;
}

.point-event-callout.right .callout-marker:hover {
  transform: translate(50%, -50%) scale(1.5);
}

.callout-box {
  position: absolute;
  top: 50%;
  padding: 10px 12px;
  border: 2px solid;
  border-radius: 6px;
  cursor: pointer;
  min-width: 200px;
  max-width: 250px;
  transform: translateY(-50%);
  transition: all 0.2s ease;
  z-index: 5;
}

.point-event-callout.left .callout-box {
  left: 120px;
}

.point-event-callout.right .callout-box {
  right: 120px;
}

.callout-box:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px var(--surface-scrim);
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.callout-icon {
  font-size: 1.1em;
  flex-shrink: 0;
}

.callout-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95em;
  line-height: 1.3;
}

.callout-date {
  color: var(--accent-gold);
  font-size: 0.85em;
  font-weight: 500;
}

.biblical-timeline-loading,
.biblical-timeline-error,
.biblical-timeline-no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 1.1em;
}

/* Timeline Progress Bar - shown during first-time calculation */
.timeline-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.timeline-loading-text {
  color: var(--accent-primary);
  font-size: 1.3em;
  font-weight: 600;
}

.timeline-progress-bar {
  width: 280px;
  max-width: 80%;
  height: 8px;
  background: var(--accent-primary-muted);
  border-radius: 4px;
  overflow: hidden;
}

.timeline-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
  border-radius: 4px;
  /* No transition - immediate updates prevent visual jumping */
}

.timeline-loading-subtext {
  color: var(--text-secondary);
  font-size: 0.9em;
  font-style: italic;
}

/* Override vis.js timeline styles to match our theme */
.biblical-timeline-vis-container .vis-timeline {
  border-color: var(--border-accent);
  background: var(--surface-sunken);
}

.biblical-timeline-vis-container .vis-time-axis {
  background: var(--surface-sunken);
}

.biblical-timeline-vis-container .vis-time-axis .vis-text {
  color: var(--text-secondary);
}

.biblical-timeline-vis-container .vis-time-axis .vis-grid.vis-vertical {
  border-color: var(--accent-primary-muted);
}

.biblical-timeline-vis-container .vis-labelset .vis-label {
  background: var(--surface-sunken);
  border-color: var(--border-accent);
  color: var(--accent-primary);
  font-weight: 500;
}

.biblical-timeline-vis-container .vis-item {
  border-radius: 4px;
  font-size: 0.85em;
  padding: 2px 6px;
}

.biblical-timeline-vis-container .vis-item.vis-point {
  /* Point events are small dots - no text, just icon */
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.biblical-timeline-vis-container .vis-item.vis-point .vis-item-content {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.biblical-timeline-vis-container .vis-item.vis-selected {
  box-shadow: 0 0 10px var(--accent-primary-strong);
}

.biblical-timeline-vis-container .vis-item.vis-point.vis-selected {
  box-shadow: 0 0 10px var(--accent-primary-strong);
  transform: scale(1.2);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .biblical-timeline-page {
    top: 48px; /* Smaller nav on mobile */
  }
}

/* ============================================================================
   KJV BIBLE EXPLORER
   ============================================================================ */

/* Bible Loading Dialog */
.bible-loading-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-sunken);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.bible-loading-dialog.visible {
  display: flex;
}

.bible-loading-content {
  background: linear-gradient(135deg, var(--surface-raised) 0%, var(--surface-sunken) 100%);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 32px 48px;
  text-align: center;
  box-shadow: 0 8px 32px var(--shadow-lg);
}

.bible-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--accent-primary-muted);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: bible-spin 1s linear infinite;
}

@keyframes bible-spin {
  to { transform: rotate(360deg); }
}

.bible-loading-text {
  font-size: 1.2em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.bible-loading-subtext {
  font-size: 0.9em;
  color: var(--text-secondary);
}

.bible-explorer-page {
  /* Do not use position:fixed + top/bottom: nav is in flow, so that would make content fill viewport and create a nav-sized gap at bottom. Use relative + flex so height comes from parent. */
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--surface-raised);
  z-index: 100;
}

.bible-explorer-header {
  background: var(--gradient-nav);
  border-bottom: 1px solid var(--border-default);
  padding: 16px 16px 12px 16px;
  flex-shrink: 0;
  overflow: visible;
  display: flex;          /* Flex row: selectors (left) + research badge (right) */
  align-items: center;
}

.bible-explorer-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  row-gap: 10px;
  flex: 1;
  min-width: 0;
  margin: 0 auto;
}

.bible-home-link {
  font-size: 1.5em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}

.bible-home-link:hover {
  transform: scale(1.1);
}

.bible-explorer-select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95em;
  cursor: pointer;
  min-width: 140px;
}

.bible-explorer-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bible-explorer-select:focus {
  outline: none;
  border-color: var(--accent-primary-strong);
}

.bible-explorer-select option {
  background: var(--surface-raised);
  color: var(--text-primary);
}

#bible-chapter-select {
  min-width: 70px;
}

.bible-translation-select {
  min-width: 70px !important;
  width: auto;
  font-weight: 600;
}

/* (reader-content-select removed — content type switching via hamburger menu) */

.reader-selector-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* Inline symbol content styling */
.reader-symbol-content-inline {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.reader-symbol-content-inline .symbol-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.reader-symbol-content-inline .symbol-header h1 {
  font-size: 1.6rem;
  color: var(--accent-primary);
  margin: 0 0 12px;
}

.reader-symbol-content-inline .symbol-words,
.reader-symbol-content-inline .symbol-strongs-list {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.reader-symbol-content-inline .reader-symbol-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Word Study Styles */
.reader-word-study-content {
  padding: var(--spacing-lg);
  max-width: 900px;
  margin: 0 auto;
}

.word-study-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-subtle);
}

.word-study-header h1 {
  font-size: 1.8rem;
  color: var(--color-accent);
  margin: 0 0 var(--spacing-sm);
}

.word-study-meta {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.word-study-translit {
  font-style: italic;
  color: var(--color-accent-gold);
  margin-right: var(--spacing-sm);
}

.word-study-pron {
  color: var(--color-text-muted);
}

.word-study-summary-box {
  background: var(--accent-primary-subtle);
  border-left: 3px solid var(--color-accent);
  padding: var(--spacing-md);
  border-radius: 4px;
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

.word-study-root-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--surface-sunken);
  border-radius: 6px;
}

.word-study-label {
  color: var(--color-accent);
  font-weight: 600;
}

.word-study-root-btn {
  background: var(--accent-gold-muted);
  border: 1px solid var(--accent-gold-muted);
  color: var(--color-accent-gold);
  padding: 4px var(--spacing-sm);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all var(--transition-fast);
}

.word-study-root-btn:hover {
  background: rgba(212, 160, 23, 0.35);
  border-color: var(--color-accent-gold);
}

.word-study-root-def {
  color: var(--color-text-muted);
  font-style: italic;
}

.word-study-book-link {
  margin: var(--spacing-lg) 0;
}

.word-study-chapter-btn {
  display: inline-block;
  background: var(--accent-primary-muted);
  border: 1px solid var(--accent-primary-strong);
  color: var(--color-accent);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.word-study-chapter-btn:hover {
  background: var(--accent-primary-muted);
  border-color: var(--color-accent);
}

.word-study-markdown-content {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.word-study-loading {
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.word-study-error {
  color: rgba(255, 200, 100, 0.8);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Word Study Index */
.reader-word-study-index {
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.word-study-index-header {
  text-align: center;
  margin-bottom: 24px;
}

.word-study-index-header h1 {
  font-size: 1.6rem;
  color: var(--accent-primary);
  margin: 0 0 8px;
}

.word-study-index-header p {
  color: var(--text-secondary);
}

.word-study-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.word-study-index-item {
  background: var(--accent-primary-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.word-study-index-item:hover {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary-strong);
}

.word-study-index-strongs {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 4px;
}

.word-study-index-lemma {
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  color: var(--accent-gold);
  font-size: 1.5em;
  direction: rtl;
  margin-bottom: 4px;
}

.word-study-index-translit {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.95em;
}

/* Time Tested index styling */
.reader-ttt-index {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

/* Background for timetested landing page */
.bible-explorer-text:has(.reader-ttt-index) {
  background-image: url('../img/BookBackground.jpg');
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0;
}

.ttt-index-header {
  text-align: center;
  margin-bottom: 32px;
}

.ttt-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.ttt-hero-card {
  flex-direction: row;
  align-items: flex-start;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

.ttt-hero-info {
  flex: 1;
  min-width: 0;
}

.ttt-hero-book-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.ttt-hero-subtitle {
  font-size: 0.95rem;
  color: var(--accent-primary);
  font-weight: 500;
  margin: 0 0 6px;
}

.ttt-hero-author {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin: 0 0 10px;
}

.ttt-hero-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 14px;
}

.ttt-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .ttt-hero-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .ttt-hero-actions {
    justify-content: center;
  }
}

.ttt-hero-cover {
  max-width: 160px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 32px var(--surface-scrim);
  flex-shrink: 0;
}

.ttt-hero-card .ttt-hero-cover {
  max-width: 160px;
}

.ttt-hero-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.ttt-hero-download:hover {
  background: var(--accent-primary-subtle, rgba(26, 107, 122, 0.08));
  border-color: var(--accent-primary-hover, var(--accent-primary));
  color: var(--accent-primary-hover, var(--accent-primary));
  transform: translateY(-1px);
}

.ttt-hero-buy {
  background: var(--accent-primary);
  border-color: var(--accent-primary-strong);
  color: #fff;
}

.ttt-hero-buy:hover {
  background: var(--accent-primary-hover, var(--accent-primary));
  border-color: var(--accent-primary-hover, var(--accent-primary));
  color: #fff;
  transform: translateY(-1px);
}

.ttt-hero-download .icon {
  font-size: 1.1em;
}

.ttt-index-header h1 {
  font-size: 1.6rem;
  color: var(--accent-primary);
  margin: 0 0 8px;
}

.ttt-index-header p {
  color: var(--text-primary);
}

.ttt-index-section-header {
  font-size: 1.3rem;
  color: var(--accent-primary);
  margin: 32px 0 16px;
  padding: 12px 16px;
  background: var(--surface-sunken);
  border-radius: 8px;
  border-bottom: none;
}

.ttt-index-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ttt-index-item {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ttt-index-item:hover {
  background: var(--accent-primary-subtle);
  border-color: var(--accent-primary);
  transform: translateX(4px);
  box-shadow: 0 2px 12px var(--accent-primary-muted);
}

.ttt-index-item-header {
  display: flex;
  align-items: center;
}

.ttt-chapter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.ttt-chapter-summary {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-top: 4px;
}

/* Time Tested chapter content */
.ttt-chapter-content {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Main chapter heading that scrolls with content */
.ttt-chapter-heading {
  color: var(--accent-gold);
  font-size: 1.4em;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent-primary-muted);
  font-weight: 600;
}

.ttt-chapter-content h1 {
  font-size: 1.6rem;
  color: var(--accent-primary);
  margin: 0 0 16px;
}

.ttt-chapter-content h2 {
  font-size: 1.3rem;
  color: var(--accent-primary);
  margin: 24px 0 12px;
}

.ttt-chapter-content h3 {
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin: 20px 0 10px;
}

.ttt-chapter-content blockquote {
  border-left: 3px solid var(--color-accent-gold);
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  color: var(--text-primary);
  font-style: italic;
}

/* Citation line (— Book ref) right-justified below the quote */
.ttt-chapter-content blockquote cite,
.ttt-chapter-body blockquote cite {
  display: block;
  text-align: right;
  font-style: normal;
  color: var(--color-accent-gold, var(--accent-gold));
  margin-top: 0.5em;
  font-size: 0.9em;
}

/* Time Tested chapter navigation */
.ttt-chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  margin-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--accent-primary-muted);
}

.ttt-chapter-nav-bottom {
  margin-top: var(--spacing-xl);
  margin-bottom: 0;
  border-bottom: none;
  border-top: 1px solid var(--accent-primary-muted);
  padding-top: var(--spacing-lg);
}

.ttt-nav-btn {
  background: var(--accent-primary-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-accent);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ttt-nav-btn:hover {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary-strong);
}

.ttt-nav-home {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: var(--spacing-sm) var(--spacing-md);
}

.ttt-nav-home:hover {
  color: var(--color-accent);
}

/* Time Tested chapter body - now uses unified base styles from reader.css */
/* Additional specific styles */
.ttt-chapter-body {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Scripture reference links */
.scripture-ref {
  color: var(--accent-gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-gold-strong);
  cursor: pointer;
}

.scripture-ref:hover {
  color: var(--accent-gold-hover);
  border-bottom-color: var(--accent-gold-hover);
}

/* Responsive adjustments for Time-Tested content */
@media (max-width: 768px) {
  .symbol-study-body,
  .word-study-body,
  .number-study-body {
    padding: var(--spacing-md);
  }
  /* Time-tested chapter: minimal padding on mobile (override reader.css padding) */
  .ttt-chapter-content {
    padding: 5px;
  }
  body.view-reader .ttt-chapter-body {
    padding: 5px !important;
  }
  
  .symbol-study-body blockquote,
  .word-study-body blockquote,
  .number-study-body blockquote {
    margin-left: calc(var(--spacing-xl) * 0.5);
    margin-right: calc(var(--spacing-xl) * 0.5);
    padding: var(--spacing-md) calc(var(--spacing-lg) * 0.5);
  }
  .ttt-chapter-body blockquote {
    margin-left: calc(var(--spacing-md) * 0.5);
    margin-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
    padding-right: calc(var(--spacing-md) * 0.5);
  }
  
  .ttt-chapter-nav {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
  
  .ttt-nav-btn {
    max-width: none;
    font-size: 0.8rem;
    padding: 6px var(--spacing-sm);
  }
}

/* Symbol Study Content */
.symbol-study-content {
  margin-top: 0;
}

.symbol-study-loading {
  color: var(--color-text-muted);
  padding: var(--spacing-lg);
  text-align: center;
}

/* Symbol study body styles are now unified in reader.css */
/* This section kept for backward compatibility but styles moved to unified base */

.symbol-study-body .md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95em;
  table-layout: auto;
}

.symbol-study-body .md-table th,
.symbol-study-body .md-table td {
  padding: 10px 14px;
  border: 1px solid var(--accent-primary-muted);
  vertical-align: top;
  text-align: left;
}

.symbol-study-body .md-table th {
  background: var(--accent-primary-strong);
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}

.symbol-study-body .md-table tbody tr:nth-child(even) {
  background: var(--accent-primary-subtle);
}

.symbol-study-body .md-table tbody tr:hover {
  background: var(--accent-primary-muted);
}

.symbol-study-body .scripture-ref {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-primary-strong);
  transition: all 0.2s;
}

.symbol-study-body .scripture-ref:hover {
  color: var(--accent-primary-hover);
  border-bottom-color: var(--accent-primary-hover);
}

/* Strong's number references */
.strongs-ref {
  color: var(--color-purple);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-purple-muted);
  cursor: pointer;
  font-family: monospace;
  font-size: 0.95em;
  transition: all 0.2s;
}

.strongs-ref:hover {
  color: var(--color-purple-light);
  border-bottom-color: var(--color-purple-light);
}

.symbol-study-body .strongs-ref,
.word-study-body .strongs-ref,
.ttt-chapter-body .strongs-ref {
  color: var(--color-purple);
}

.symbol-study-body .strongs-ref:hover,
.word-study-body .strongs-ref:hover,
.ttt-chapter-body .strongs-ref:hover {
  color: var(--color-purple-light);
  border-bottom-color: var(--color-purple-light);
}

.symbol-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.symbol-fallback {
  margin-top: 16px;
}

.bible-explorer-search-inline {
  display: flex;
  gap: 6px;
  flex: 1;
  max-width: 280px;
  margin-left: auto;
}

.bible-explorer-search-inline input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95em;
  min-width: 100px;
}

.bible-explorer-search-inline input:focus {
  outline: none;
  border-color: var(--accent-primary-strong);
}

.bible-explorer-search-inline .bible-explorer-search-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold) 100%);
  border: none;
  color: var(--surface-raised);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.bible-explorer-search-inline .bible-explorer-search-btn:hover {
  background: linear-gradient(135deg, #e8b517 0%, var(--accent-gold) 100%);
}

.bible-explorer-header .close-btn {
  background: var(--border-subtle);
  border: none;
  color: var(--text-secondary);
  font-size: 1.3em;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s;
  margin-left: 8px;
}

.bible-explorer-header .close-btn:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

/* Legacy search styles - kept for compatibility */
.bible-explorer-search {
  display: flex;
  gap: 8px;
}

.bible-explorer-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 1em;
}

.bible-explorer-search input::placeholder {
  color: var(--text-tertiary);
}

.bible-explorer-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--border-accent);
}

.bible-explorer-search-btn {
  padding: 10px 20px;
  background: var(--accent-primary);
  color: var(--text-primary);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.bible-explorer-search-btn:hover {
  background: var(--accent-primary-hover);
}

.bible-explorer-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar Navigation - DEPRECATED (now using header dropdowns) */
.bible-explorer-sidebar {
  display: none; /* Hidden - using dropdowns now */
  width: 280px;
  background: var(--surface-raised);
  border-right: 1px solid var(--accent-primary-subtle);
  flex-direction: column;
  flex-shrink: 0;
}

.bible-explorer-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--accent-primary-subtle);
}

.bible-nav-tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s;
}

.bible-nav-tab:hover {
  color: var(--text-secondary);
  background: rgba(126, 200, 227, 0.05);
}

.bible-nav-tab.active {
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  border-bottom: 2px solid var(--accent-primary);
}

.bible-nav-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.bible-nav-panel.active {
  display: flex;
}

/* Testament Sections */
.bible-testament-section {
  border-bottom: 1px solid var(--surface-hover);
}

.bible-testament-header {
  padding: 12px 16px;
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: background 0.2s;
}

.bible-testament-header:hover {
  background: var(--accent-gold-subtle);
}

.bible-testament-toggle {
  font-size: 0.8em;
  transition: transform 0.2s;
}

.bible-testament-section.collapsed .bible-testament-toggle {
  transform: rotate(-90deg);
}

.bible-testament-section.collapsed .bible-books-list {
  display: none;
}

.bible-books-list {
  display: flex;
  flex-direction: column;
}

.bible-book-item {
  padding: 10px 16px 10px 24px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--calendar-day-bg);
  transition: all 0.2s;
  font-size: 0.9em;
}

.bible-book-item:hover {
  background: var(--accent-primary-subtle);
  color: var(--text-primary);
}

.bible-book-item.active {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-weight: 500;
}

/* Chapters Panel */
.bible-chapters-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--accent-primary-subtle);
}

.bible-back-btn {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s;
}

.bible-back-btn:hover {
  background: var(--accent-primary-subtle);
}

#bible-current-book-name {
  color: var(--accent-gold);
  font-weight: 600;
}

.bible-chapters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
}

.bible-chapter-btn {
  aspect-ratio: 1;
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-muted);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bible-chapter-btn:hover {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.bible-chapter-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  font-weight: 600;
}

/* Main Content Area */
.bible-explorer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bible-chapter-nav {
  background: var(--surface-sunken);
  border-top: 1px solid var(--accent-primary-subtle);
  flex-shrink: 0;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.bible-chapter-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
}

/* Bible history back/forward buttons */
.bible-history-buttons {
  display: flex;
  gap: 4px;
  margin-right: 12px;
}

.bible-history-btn {
  background: var(--accent-primary-subtle);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s;
}

.bible-history-btn:hover:not(:disabled) {
  background: var(--accent-primary-muted);
  color: var(--accent-primary-hover);
}

.bible-history-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bible-chapter-nav-btn {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
}

.bible-chapter-nav-btn:hover:not(:disabled) {
  background: var(--accent-primary-subtle);
}

.bible-chapter-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bible-chapter-title {
  color: var(--accent-gold);
  font-size: 1.2em;
  font-weight: 600;
}

.bible-explorer-text {
  flex: 1;
  min-height: 0;
  padding: 20px 30px;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 1.1em;
  color: var(--text-primary);
}

/* Welcome Screen */
.bible-explorer-welcome {
  text-align: center;
  padding: 20px 16px;
  max-width: 700px;
  margin: 0 auto;
}

.bible-welcome-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.bible-explorer-welcome h3 {
  color: var(--accent-gold);
  font-size: 1.5em;
  margin-bottom: 12px;
}

.bible-explorer-welcome p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* HG "About this translation" page at /reader/bible/hg */
.bible-explorer-welcome.hg-about-page {
  text-align: left;
  max-width: 820px;
  margin: 0 auto;
}
.hg-about-page .hg-about-header h2 {
  color: var(--accent-gold);
  font-size: 1.5em;
  margin-bottom: 8px;
}
.hg-about-page .hg-about-lead {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}
.hg-about-page .hg-about-section {
  margin-bottom: 28px;
}
.hg-about-page .hg-about-section h3 {
  color: var(--accent-primary);
  font-size: 1.2em;
  margin-bottom: 8px;
}
.hg-about-page .hg-about-section h4.hg-about-sub {
  color: var(--text-secondary);
  font-size: 1em;
  margin: 12px 0 8px 0;
}
.hg-about-page .hg-about-list {
  margin: 8px 0 12px 1.2em;
  color: var(--text-secondary);
  line-height: 1.5;
}
.hg-about-page .hg-about-list li {
  margin-bottom: 6px;
}

/* Translation Cards — one row on desktop when space available */
.bible-translation-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.bible-translation-card {
  background: var(--surface-raised);
  border: 1px solid var(--accent-primary-muted);
  border-radius: 12px;
  padding: 16px 18px;
  flex: 1 1 260px;
  max-width: 340px;
  min-width: 240px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.bible-translation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bible-translation-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold-strong);
  box-shadow: 0 8px 25px var(--shadow-lg);
}

.bible-translation-card:hover::before {
  opacity: 1;
}

.translation-card-icon {
  font-size: 2.5em;
  margin-bottom: 12px;
}

.translation-card-content h4 {
  color: var(--text-primary);
  font-size: 1.1em;
  margin: 0 0 4px 0;
}

.translation-card-year {
  display: inline-block;
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.translation-card-content p {
  color: var(--text-secondary);
  font-size: 0.85em;
  line-height: 1.5;
  margin: 0 0 12px 0;
  text-align: left;
}

.translation-card-traits {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.translation-card-traits .trait {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  font-size: 0.7em;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive translation cards */
@media (max-width: 540px) {
  .bible-translation-cards {
    gap: 10px;
  }

  .bible-translation-card {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOOK INDEX PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.bible-book-index {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0 40px;
}

.book-index-header {
  text-align: center;
  margin-bottom: 24px;
}

.book-index-header h2 {
  color: var(--text-primary);
  font-size: 1.4em;
  margin: 0 0 4px;
}

.book-index-header p {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin: 0;
}

.book-index-section {
  margin-bottom: 28px;
}

.book-index-section-title {
  color: var(--accent-gold);
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent-gold-muted);
}

.book-index-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bible-book-card {
  flex: 1 1 220px;
  max-width: 300px;
  min-width: 180px;
  background: var(--surface-hover);
  border: 1px solid var(--surface-hover);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.bible-book-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent-gold-muted);
  transform: translateY(-2px);
}

.book-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.book-card-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95em;
}

.book-card-chapters {
  color: var(--accent-primary);
  font-size: 0.7em;
  flex-shrink: 0;
}

.book-card-category {
  display: inline-block;
  font-size: 0.65em;
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  padding: 1px 6px;
  border-radius: 8px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.book-card-desc {
  color: var(--text-secondary);
  font-size: 0.78em;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile: single column */
@media (max-width: 480px) {
  .bible-book-card {
    flex: 1 1 100%;
    max-width: none;
  }

  .book-card-desc {
    -webkit-line-clamp: 2;
  }
}

/* Chapter Text Display */
.bible-explorer-chapter {
  max-width: 800px;
  margin: 0 auto;
}

/* Simple chapter heading that scrolls with content */
.bible-chapter-heading {
  color: var(--accent-gold);
  font-size: 1.4em;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent-primary-muted);
  font-weight: 600;
}

.bible-explorer-verse {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  scroll-margin-top: 80px;
}

/* Desktop: meta (book, link, verse#) inline before text */
.verse-meta {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-shrink: 0;
}

.bible-explorer-verse .verse-meta .verse-book-ref,
.bible-explorer-verse .verse-meta .verse-book-ref-spacer,
.bible-explorer-verse .verse-meta .verse-cross-ref,
.bible-explorer-verse .verse-meta .verse-cross-ref-spacer,
.bible-explorer-verse .verse-meta .verse-study-ref,
.bible-explorer-verse .verse-meta .verse-timeline-ref,
.bible-explorer-verse .verse-meta .verse-timeline-ref-spacer,
.bible-explorer-verse .verse-meta .verse-interlinear-ref,
.bible-explorer-verse .verse-meta .bible-verse-number {
  flex-shrink: 0;
}

.bible-explorer-verse .bible-verse-text {
  flex: 1;
  min-width: 0;
}

/* Mobile: verse number + icons stacked on left (number on top), text on right — number next to first word */
@media (max-width: 768px) {
  .bible-explorer-verse {
    flex-direction: row;
    align-items: flex-start;
  }
  .bible-explorer-verse .verse-meta {
    order: 1;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
    margin-right: 6px;
  }
  .bible-explorer-verse .verse-meta .bible-verse-number {
    order: 1;
  }
  .bible-explorer-verse .verse-meta .verse-book-ref,
  .bible-explorer-verse .verse-meta .verse-book-ref-spacer {
    order: 2;
  }
  .bible-explorer-verse .verse-meta .verse-cross-ref,
  .bible-explorer-verse .verse-meta .verse-cross-ref-spacer {
    order: 3;
  }
  .bible-explorer-verse .verse-meta .verse-timeline-ref,
  .bible-explorer-verse .verse-meta .verse-timeline-ref-spacer {
    order: 4;
  }
  .bible-explorer-verse .verse-meta .verse-interlinear-ref {
    order: 5;
  }
  .bible-explorer-verse .verse-meta .verse-book-ref-spacer,
  .bible-explorer-verse .verse-meta .verse-cross-ref-spacer,
  .bible-explorer-verse .verse-meta .verse-timeline-ref-spacer {
    display: none;
  }
  .bible-explorer-verse .bible-verse-text {
    order: 2;
    flex: 1;
    min-width: 0;
    padding-left: 0;
  }
}

.bible-explorer-verse.highlighted {
  background: var(--accent-gold-subtle);
  padding: 8px 12px;
  margin: 4px -12px 8px -12px;
  border-radius: 4px;
  border-left: 3px solid var(--accent-gold);
}

.bible-verse-number {
  color: var(--accent-primary);
  font-size: 0.75em;
  font-weight: 600;
  vertical-align: super;
  margin-right: 4px;
  cursor: pointer;
  user-select: none;
}

.bible-verse-number:hover {
  color: var(--accent-primary-hover);
}

.bible-verse-text {
  color: var(--text-primary);
}

/* Hebrew Annotations */
.hebrew-annotation {
  cursor: pointer;
  margin-left: 2px;
  font-size: 0.9em;
  vertical-align: middle;
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.2s;
}

.hebrew-annotation:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Above main-layout when body.research-panel-open (10100) */
.hebrew-tooltip {
  position: absolute;
  z-index: 10200;
  max-width: 350px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--surface-raised) 0%, var(--surface-sunken) 100%);
  border: 1px solid var(--accent-gold-strong);
  border-radius: 8px;
  box-shadow: 0 8px 32px var(--surface-scrim);
  color: var(--text-primary);
  font-size: 0.9em;
  line-height: 1.5;
}

.hebrew-tooltip::before {
  content: '📜 ';
}

.hebrew-tooltip-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--accent-gold-muted);
}

.hebrew-tooltip-btn {
  background: var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-muted);
  color: var(--accent-gold);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s;
}

.hebrew-tooltip-btn:hover {
  background: var(--accent-gold-muted);
  border-color: var(--accent-gold);
}

/* Hebrew clickable verse numbers */
.bible-verse-number.clickable-hebrew {
  cursor: pointer;
  transition: all 0.2s;
}

.bible-verse-number.clickable-hebrew:hover {
  color: var(--accent-gold);
  transform: scale(1.2);
}

.bible-explorer-verse.interlinear-expanded {
  display: block; /* Override flex to prevent verse text squishing */
  background: rgba(126, 200, 227, 0.03);
  border-radius: 8px;
  margin: 4px -8px;
  padding: 8px;
}

/* Keep verse meta and text inline when expanded */
.bible-explorer-verse.interlinear-expanded > .verse-meta {
  display: inline-block;
  margin-right: 4px;
  vertical-align: top;
}

.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-book-ref,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-book-ref-spacer,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-cross-ref,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-cross-ref-spacer,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-study-ref,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-timeline-ref,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-timeline-ref-spacer,
.bible-explorer-verse.interlinear-expanded > .verse-meta .verse-interlinear-ref,
.bible-explorer-verse.interlinear-expanded > .verse-meta .bible-verse-number {
  display: inline;
  margin-right: 4px;
}

.bible-explorer-verse.interlinear-expanded > .bible-verse-text {
  display: inline;
}

/* Interlinear Display - Simple two-line format */
.interlinear-display {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  margin-top: 0;
  padding: 0;
}

.interlinear-display.expanded {
  max-height: none;
  opacity: 1;
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--surface-sunken);
  border-radius: 8px;
  border-left: 3px solid var(--accent-gold-muted);
  overflow-y: auto;
}

/* Hebrew line */
.interlinear-hebrew-line {
  font-size: 1.4em;
  line-height: 1.8;
  color: var(--text-primary);
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  margin-bottom: 10px;
}

/* Greek line */
.interlinear-greek-line {
  font-size: 1.3em;
  line-height: 1.8;
  color: var(--text-primary);
  font-family: 'SBL Greek', 'Gentium', 'Times New Roman', serif;
  margin-bottom: 10px;
}

/* Clickable interlinear words */
.il-word.il-clickable {
  cursor: pointer;
  transition: all 0.15s;
}
.il-word.il-clickable:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* English line */
.interlinear-english-line {
  font-size: 1.05em;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Individual hoverable words */
.il-word {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.15s ease;
  display: inline-block;
}

/* Interlinear word-for-word display */
.interlinear-words-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--accent-primary-muted);
  margin-bottom: 10px;
}

.interlinear-words-container.il-hebrew {
  direction: rtl;
}

.il-word-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 40px;
  min-width: 50px;
}

.il-word-block:hover {
  background: var(--accent-gold-muted);
}

.il-original {
  font-size: 1.3em;
  color: var(--accent-primary);
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
}

.il-hebrew .il-original {
  direction: rtl;
}

.il-strongs {
  font-size: 0.7em;
  color: var(--text-secondary);
  margin: 2px 0;
}

.il-gloss {
  font-size: 0.85em;
  color: var(--accent-gold);
  text-align: center;
}

.il-prefix {
  color: var(--accent-primary);
  font-size: 0.85em;
  opacity: 0.8;
}

.il-hebrew-prefix {
  color: var(--accent-primary);
}

/* ── Interlinear Tab Layout ── */

.il-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--accent-primary-subtle);
  margin-bottom: 8px;
}

.il-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-tertiary);
  font-size: 0.85em;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.il-tab:first-child {
  border-radius: 0;
}

.il-tab:hover {
  color: var(--text-secondary);
}

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

.il-vowel-toggle-inline {
  font-size: 0.75em;
  color: var(--text-tertiary);
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.il-vowel-toggle-inline input {
  margin-right: 3px;
}

.il-tab-pane {
  display: none;
}

.il-tab-pane.active {
  display: block;
}

/* ── Hebrew Gospels Study Notes ── */
.hg-verse-notes {
  padding: 4px 0;
}

.hg-notes-section {
  margin-bottom: 12px;
}

.hg-notes-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-gold-strong);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--separator-color, rgba(255,255,255,0.08));
}

.hg-note-item {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  padding: 4px 0 4px 8px;
  border-left: 2px solid var(--separator-color, rgba(255,255,255,0.08));
  margin-bottom: 4px;
}

.hg-note-deviation {
  border-left-color: var(--accent-gold-strong);
}

.hg-note-oneway {
  border-left-color: #4caf50;
}

.hg-note-contradiction {
  border-left-color: #ef5350;
}

/* ── Hebrew Gospels Chapter Study Notes ── */
.hg-chapter-notes {
  padding: 8px 0;
}

.hg-chapter-notes-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-gold-strong);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--separator-color, rgba(255,255,255,0.1));
}

.hg-chapter-notes-summary {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Selected word highlight in interlinear */
.il-word-block.il-word-active {
  background: var(--accent-gold-muted);
  box-shadow: 0 0 0 2px var(--accent-gold-strong);
  border-radius: 4px;
}

.il-vowel-toggle-bar {
  display: flex;
  justify-content: flex-end;
  padding: 2px 4px 4px;
}

/* Legacy single-line styles */
.il-word:hover,
.il-word.il-highlight {
  background: var(--accent-gold-muted);
  color: var(--text-primary);
}

.interlinear-loading,
.interlinear-error {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 12px;
}

/* Translation comparison rows */
.interlinear-translations {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.interlinear-trans-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-hover);
}

.interlinear-trans-row:last-child {
  border-bottom: none;
}

.interlinear-trans-label {
  flex-shrink: 0;
  min-width: 40px;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 4px 8px;
  background: var(--accent-primary-muted);
  border-radius: 4px;
  text-align: center;
}

.interlinear-trans-text {
  flex: 1;
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--text-secondary);
}

.interlinear-trans-greek .interlinear-trans-text {
  font-family: 'SBL Greek', 'Gentium', 'Times New Roman', serif;
  color: var(--text-secondary);
}

/* "More translations" expandable section */
.interlinear-more-section,
.interlinear-original-section {
  margin-top: 6px;
}

.interlinear-more-btn,
.interlinear-original-btn {
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-muted);
  border-radius: 6px;
  color: var(--accent-primary);
  font-size: 0.8em;
  padding: 5px 12px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.2s;
}

.interlinear-more-btn:hover,
.interlinear-original-btn:hover {
  background: var(--accent-primary-muted);
}

.interlinear-more-content,
.interlinear-original-content {
  display: none;
  margin-top: 6px;
}

.interlinear-more-section.expanded .interlinear-more-content,
.interlinear-original-section.expanded .interlinear-original-content {
  display: block;
}

.interlinear-load-btn {
  background: var(--accent-gold-subtle);
  border: 1px solid var(--accent-gold-muted);
  border-radius: 4px;
  color: var(--accent-gold);
  font-size: 0.85em;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.interlinear-load-btn:hover {
  background: var(--accent-gold-muted);
}

.interlinear-trans-unloaded .interlinear-trans-label {
  opacity: 0.6;
}

.interlinear-no-data {
  color: var(--text-tertiary);
  font-size: 0.85em;
  padding: 8px 0;
  font-style: italic;
}

/* Source text (WLC / Greek NT) in interlinear panel */
.interlinear-source-text {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border-radius: 6px;
  border: 1px solid var(--accent-primary-subtle);
}

.il-source-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.il-source-label {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.il-vowel-toggle {
  font-size: 0.75em;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.il-vowel-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-gold);
}

.il-source-text-content {
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  font-size: 1.3em;
  line-height: 1.8;
  color: var(--accent-gold);
  word-spacing: 4px;
}

/* Mobile Interlinear */
@media (max-width: 600px) {
  .interlinear-hebrew-line {
    font-size: 1.2em;
  }
  
  .interlinear-english-line {
    font-size: 0.95em;
  }
  
  .interlinear-display.expanded {
    padding: 10px 12px;
  }
  
  .il-word-block {
    padding: 3px 6px;
    min-width: 32px;
  }
  
  .il-original {
    font-size: 1.1em;
  }
  
  .il-gloss {
    font-size: 0.75em;
  }
  
  .interlinear-trans-label {
    width: 32px;
    font-size: 0.7em;
  }
  
  .interlinear-trans-text {
    font-size: 0.9em;
  }
}

/* Strong's Clickable Words in KJV Text */
.strongs-word {
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.strongs-word:hover {
  background: var(--accent-gold-muted);
  color: var(--accent-gold);
}

/* Symbol Words - subtle underline to indicate symbolic meaning available */
.symbol-word {
  cursor: pointer;
  border-bottom: 1px dotted var(--accent-primary-strong);
  transition: all 0.15s ease;
}

.symbol-word:hover {
  background: var(--accent-primary-muted);
  border-bottom-color: var(--accent-primary);
}

/* Word with both Strong's and Symbol data */
.strongs-word.symbol-word {
  border-bottom: 1px dotted var(--accent-primary-strong);
}

.strongs-word.symbol-word:hover {
  background: linear-gradient(135deg, var(--accent-gold-muted), var(--accent-primary-muted));
}

/* Word Hover Tooltip - fixed so it stays in viewport; above main-layout when Strong's closed.
   pointer-events: auto so clicking the tooltip opens Strong's (same as clicking the word). */
.word-hover-tooltip {
  position: fixed;
  z-index: 10200;
  max-width: 280px;
  padding: 8px 12px;
  background: var(--surface-overlay);
  border: 1px solid var(--accent-primary-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px var(--surface-scrim);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: auto;
  cursor: pointer;
}

.word-tooltip-def {
  color: var(--accent-gold);
  font-size: 0.9em;
  line-height: 1.4;
}

.word-tooltip-symbol {
  color: var(--accent-primary);
  font-size: 0.9em;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--accent-primary-muted);
}

/* Name substitution: original name display in tooltip */
.word-tooltip-original {
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.word-tooltip-original strong {
  color: var(--text-primary);
}

.word-tooltip-settings {
  cursor: pointer;
  opacity: 0.6;
  margin-left: 6px;
  font-size: 1.1em;
  transition: opacity 0.15s;
}

.word-tooltip-settings:hover {
  opacity: 1;
}

/* Name substitution indicator on words */
.name-sub {
  border-bottom: 1px dotted rgba(212, 160, 23, 0.45);
  cursor: help;
  transition: border-color 0.15s;
  unicode-bidi: isolate;
}

.name-sub:hover {
  border-bottom-color: var(--accent-gold);
}

/* Name-sub inside Strong's words: inherit the strongs-word cursor */
.strongs-word.name-sub {
  cursor: pointer;
}

/* Symbol Panel - floating popup */
.symbol-panel {
  position: absolute;
  width: 300px;
  background: var(--gradient-nav);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--surface-scrim);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.symbol-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.symbol-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: var(--accent-primary-subtle);
  border-bottom: 1px solid var(--accent-primary-muted);
  border-radius: 8px 8px 0 0;
}

.symbol-panel-name {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--accent-primary);
  font-family: 'Georgia', serif;
}

.symbol-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4em;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.symbol-panel-close:hover {
  color: var(--text-primary);
}

.symbol-panel-content {
  padding: 15px;
  color: var(--text-primary);
  font-size: 0.95em;
  line-height: 1.5;
}

.symbol-meaning-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.symbol-label {
  color: var(--accent-primary);
  font-weight: bold;
  min-width: 45px;
}

.symbol-value {
  color: var(--accent-gold);
  font-weight: 500;
}

.symbol-sentence {
  margin: 12px 0;
  padding: 10px;
  background: var(--surface-sunken);
  border-radius: 4px;
  font-style: italic;
  border-left: 3px solid var(--accent-primary);
}

.symbol-opposite {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.symbol-study-link {
  display: inline-block;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9em;
  margin-top: 5px;
}

.symbol-study-link:hover {
  text-decoration: underline;
}

/* Mobile Symbol Panel */
@media (max-width: 600px) {
  .symbol-panel {
    width: calc(100% - 20px);
    left: 10px !important;
    right: 10px;
  }
}

/* Symbol Info in Strong's Sidebar */
.strongs-symbol-info {
  margin: 16px 0;
  padding: 12px;
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-muted);
  border-radius: 6px;
  color: var(--text-primary);
}

.strongs-symbol-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--accent-primary-muted);
}

.strongs-symbol-icon {
  font-size: 1.1em;
}

.strongs-symbol-title {
  font-weight: bold;
  color: var(--accent-primary);
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.strongs-symbol-meaning {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.95em;
  color: var(--text-primary);
}

.strongs-symbol-label {
  color: var(--accent-primary);
  font-weight: bold;
  min-width: 75px;
  flex-shrink: 0;
  white-space: nowrap;
}

.strongs-symbol-value {
  color: var(--accent-gold);
  font-weight: 500;
}

.strongs-symbol-sentence {
  margin: 10px 0;
  padding: 8px;
  background: var(--surface-sunken);
  border-radius: 4px;
  font-style: italic;
  font-size: 0.9em;
  line-height: 1.4;
  border-left: 3px solid var(--accent-primary);
  color: var(--text-primary);
}

.strongs-symbol-link {
  display: inline-block;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.85em;
  margin-top: 5px;
}

.strongs-symbol-link:hover {
  text-decoration: underline;
}

/* Book Reference Icon (verse references in "A Time Tested Tradition") */
.verse-book-ref {
  display: inline-block;
  width: 20px;
  text-align: center;
  cursor: pointer;
  font-size: 0.75em;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  vertical-align: baseline;
  margin-right: 2px;
}

.verse-book-ref:hover {
  opacity: 1;
}

/* Spacer for verses without book references (keeps alignment) */
.verse-book-ref-spacer {
  display: inline-block;
  width: 20px;
  margin-right: 2px;
}

/* Portal for Bible tooltips and popups - ensures they paint above main content; pointer-events: none so content under stays clickable */
.bible-tooltip-portal {
  position: fixed;
  inset: 0;
  z-index: 10200;
  pointer-events: none;
}

/* Book Reference Popup - in portal so it paints on top; needs pointer-events: auto for clicks */
.book-ref-popup {
  position: fixed;
  pointer-events: auto;
  width: 280px;
  background: var(--gradient-nav);
  border: 1px solid var(--accent-gold-muted);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--surface-scrim);
  z-index: 10200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.book-ref-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.book-ref-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--accent-gold-subtle);
  border-bottom: 1px solid var(--accent-gold-muted);
  border-radius: 8px 8px 0 0;
  font-size: 0.9em;
  color: var(--accent-gold);
  font-weight: bold;
}

.book-ref-popup-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3em;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.book-ref-popup-close:hover {
  color: var(--text-primary);
}

.book-ref-popup-content {
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.book-ref-link {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s ease;
  margin-bottom: 4px;
}

.book-ref-link:hover {
  background: var(--accent-gold-subtle);
}

.book-ref-link:last-child {
  margin-bottom: 0;
}

.book-ref-chapter {
  display: block;
  color: var(--accent-gold);
  font-size: 0.85em;
  font-weight: bold;
}

.book-ref-title {
  display: block;
  color: var(--text-primary);
  font-size: 0.9em;
  margin-top: 2px;
}

/* Mobile Book Reference Popup */
@media (max-width: 600px) {
  .book-ref-popup {
    width: calc(100% - 20px);
    left: 10px !important;
    right: 10px;
  }
}

/* Cross Reference Icon */
.verse-study-ref {
  display: inline-block;
  width: 24px;
  min-height: 24px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85em;
  opacity: 0.7;
  transition: opacity 0.15s ease;
  vertical-align: baseline;
  margin-right: 2px;
}
.verse-study-ref:hover,
.verse-study-ref:active {
  opacity: 1;
}

.verse-cross-ref {
  display: inline-block;
  width: 24px;
  min-height: 24px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85em;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  vertical-align: baseline;
  margin-right: 2px;
  -webkit-tap-highlight-color: var(--border-accent);
}

.verse-cross-ref:hover,
.verse-cross-ref:active {
  opacity: 1;
}

/* Spacer for verses without cross-references (keeps alignment) */
.verse-cross-ref-spacer {
  display: inline-block;
  width: 24px;
  margin-right: 2px;
}

/* Timeline Event Icon with CSS Tooltip */
.verse-timeline-ref {
  display: inline-block;
  position: relative;
  width: 18px;
  text-align: center;
  cursor: pointer;
  opacity: 0.5;
  vertical-align: baseline;
  margin-right: 4px;
  -webkit-tap-highlight-color: var(--border-accent);
}

.verse-timeline-ref:hover,
.verse-timeline-ref:active,
.verse-timeline-ref.tip-visible {
  opacity: 1;
}

.verse-timeline-icon {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

/* CSS tooltip via data-tip attribute */
.verse-timeline-ref[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-accent);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 100;
}

/* Show on hover (desktop) — instant */
.verse-timeline-ref[data-tip]:hover::after,
.verse-timeline-ref[data-tip].tip-visible::after {
  opacity: 1;
}

/* Spacer for verses without timeline events (keeps alignment) */
.verse-timeline-ref-spacer {
  display: inline-block;
  width: 18px;
  margin-right: 4px;
}

/* Hamburger: comparative verse / interlinear in multiverse (and chapter view if added there) */
.verse-interlinear-ref {
  display: inline-block;
  width: 20px;
  margin-right: 2px;
  text-align: center;
  cursor: pointer;
  opacity: 0.7;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.2;
  user-select: none;
}
.verse-interlinear-ref:hover,
.verse-interlinear-ref:active {
  opacity: 1;
  color: var(--color-accent);
}

/* Cross Reference Panel (shown in Strong's panel area) */
.cross-ref-panel {
  padding: 0;
}

.cross-ref-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-primary-subtle);
  border-bottom: 1px solid var(--accent-primary-muted);
}

.cross-ref-icon {
  font-size: 1.2em;
}

.cross-ref-title {
  font-weight: bold;
  color: var(--accent-primary);
  font-size: 1.1em;
}

.cross-ref-source {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-subtle);
}

.cross-ref-verse {
  color: var(--accent-gold);
  font-weight: bold;
}

.cross-ref-count {
  color: var(--text-secondary);
  font-size: 0.85em;
}

.cross-ref-list {
  padding: 8px;
  /* No max-height/overflow here - parent sidebar handles scrolling */
}

.cross-ref-item {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  border-radius: 6px;
  background: var(--surface-hover);
  transition: background 0.15s ease;
  cursor: pointer;
  min-height: 44px; /* Minimum touch target size */
  -webkit-tap-highlight-color: var(--border-accent);
  border-left: 3px solid var(--border-accent);
}

.cross-ref-item:hover {
  background: var(--accent-primary-muted);
  border-left-color: var(--accent-primary-strong);
}

.cross-ref-item:active {
  background: var(--border-accent);
  border-left-color: var(--accent-primary);
}

.cross-ref-ref {
  color: var(--accent-primary);
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 4px;
}

.cross-ref-text {
  color: var(--text-secondary);
  font-size: 0.85em;
  line-height: 1.4;
  font-style: italic;
}

/* No verse text available */
.cross-ref-item:not(:has(.cross-ref-text)) .cross-ref-ref {
  margin-bottom: 0;
}

.cross-ref-more {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85em;
  padding: 8px;
  font-style: italic;
}

.cross-ref-attribution {
  padding: 8px 12px;
  text-align: center;
  font-size: 0.75em;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.cross-ref-attribution a {
  color: var(--accent-primary);
  text-decoration: none;
}

.cross-ref-attribution a:hover {
  text-decoration: underline;
}

.strongs-word.word-highlight {
  background: var(--accent-gold-muted);
  color: var(--text-primary);
  box-shadow: 0 0 4px var(--accent-gold-strong);
}

/* Bible content wrapper - flex container for text */
.bible-content-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.bible-content-wrapper .bible-explorer-text {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════
   RESEARCH PANEL — always-visible on desktop, resizable
   ═══════════════════════════════════════════════════════════════ */

/* Hide research panel + controls for non-Bible content types (no clickable words to study) */
/* Exception: blog posts have clickable Strong's numbers */
.bible-explorer-page:not([data-content-type="bible"]):not([data-content-type="multiverse"]):not([data-content-type="blog"]):not([data-content-type="symbols"]) .research-panel,
.bible-explorer-page:not([data-content-type="bible"]):not([data-content-type="multiverse"]):not([data-content-type="blog"]):not([data-content-type="symbols"]) .research-panel-thumb,
.bible-explorer-page:not([data-content-type="bible"]):not([data-content-type="multiverse"]):not([data-content-type="blog"]):not([data-content-type="symbols"]) .research-panel-collapse-btn {
  display: none !important;
}

/* Desktop: Research panel collapses to 0 width by default.
   Opens to saved width (or 380px) when a Strong's number is clicked.
   Toggle controls live on bible-content-wrapper side. */
.research-panel {
  position: relative;
  width: 0;
  min-width: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-raised);
  border-left: none;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, min-width 0.25s ease;
}

/* Expanded state — width set via inline style from JS (saved or 380px default) */
.research-panel.open {
  min-width: 200px;
  border-left: 1px solid var(--accent-gold-muted);
}

/* Disable transitions and min-width during drag so resize follows cursor toward collapse */
.research-panel.resizing {
  transition: none !important;
  min-width: 0 !important;
}

/* Hide content + resize handle when panel is collapsed */
.research-panel:not(.open) .research-panel-content {
  visibility: hidden;
  opacity: 0;
}

.research-panel:not(.open) .research-panel-resize {
  display: none;
}

/* ═══ Research panel toggle controls — on bible-content-wrapper right edge ═══ */

/* ─── Expand thumb — visible when panel is collapsed ─── */
.research-panel-thumb {
  position: absolute;
  right: 14px;  /* clear the scrollbar */
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  opacity: 0.35;
  font-size: 0.65em;
  background: var(--surface-raised);
  border: 1px solid var(--accent-gold-muted);
  border-radius: 4px;
  z-index: 6;
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
  user-select: none;
  transition: opacity 0.2s, color 0.2s;
}

.research-panel-thumb:hover {
  opacity: 1;
  color: var(--accent-gold);
}

/* Hide thumb when panel is expanded */
body.research-panel-open .research-panel-thumb {
  display: none;
}

/* ─── Collapse button — visible when panel is expanded ─── */
.research-panel-collapse-btn {
  display: none;
  position: absolute;
  right: 14px;  /* clear the scrollbar */
  top: 8px;
  padding: 4px 5px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  opacity: 0.4;
  font-size: 0.7em;
  background: var(--surface-raised);
  border: 1px solid var(--accent-gold-muted);
  border-radius: 4px;
  z-index: 10;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
  user-select: none;
}

.research-panel-collapse-btn:hover {
  opacity: 1;
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

/* Show collapse button when panel is expanded */
body.research-panel-open .research-panel-collapse-btn {
  display: flex;
}

/* Resize handle on left edge */
.research-panel-resize {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 5;
}

.research-panel-resize:hover {
  background: var(--accent-gold-muted);
}

/* ─── Inline header badge (removed — Strong's ID now shown inside research panel) ─── */
.research-header-inline {
  display: none !important;
}

.research-id-badge {
  display: none;
}

/* ─── Strong's ID label inside research panel ─── */
.research-id-mobile {
  display: block;
  font-family: monospace;
  font-size: 0.8em;
  color: var(--text-secondary);
  opacity: 0.5;
  padding: 8px 20px 0;
}

/* ─── Welcome / default state ─── */
.research-panel-welcome {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
  opacity: 0.6;
}

.research-panel-studies {
  padding: 16px 12px 8px;
}
.research-panel-studies-header {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 4px;
}
.research-panel-study-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--card-bg, rgba(128,128,128,0.08));
  border: 1px solid var(--border-color, rgba(128,128,128,0.15));
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
  color: inherit;
}
.research-panel-study-card:hover {
  background: var(--card-bg-hover, rgba(128,128,128,0.14));
  border-color: var(--accent-primary, #4a90d9);
}
.study-card-ref {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--accent-primary, #4a90d9);
  margin-bottom: 2px;
}
.study-card-title {
  font-size: 0.95em;
  font-weight: 600;
  margin-bottom: 3px;
}
.study-card-desc {
  font-size: 0.82em;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Close button ─── */
.research-panel-close-btn {
  position: sticky;
  top: 0;
  float: right;
  background: var(--bg-secondary, #1a2332);
  border: 1px solid var(--border-color, #2a3a4a);
  color: var(--text-secondary);
  font-size: 1.1em;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 4px 4px 0 0;
  transition: color 0.2s, border-color 0.2s;
}
.research-panel-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}


/* Mobile: full-height content + research panel becomes full-width body content */
@media (max-width: 768px) {
  /* Mobile: body scroll approach — inner containers flow naturally.
     Sticky header + overflow:visible so iOS extends behind bottom bar. */
  body.view-bible .main-layout,
  body.view-reader:not(.reader-landing) .main-layout {
    overflow: visible !important;
    height: auto !important;
  }

  #bible-explorer-page {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    position: relative !important;
    top: 0 !important; /* Override any legacy top offset */
  }

  .bible-explorer-body {
    overflow: visible !important;
    height: auto !important;
    display: block !important;
  }

  .bible-content-wrapper {
    overflow: visible !important;
    height: auto !important;
  }

  .bible-content-wrapper .bible-explorer-text {
    overflow: visible !important;
    height: auto !important;
  }

  /* ─── Mobile: Research panel hidden by default, full-screen when open ─── */
  .research-panel {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    border-left: none !important;
  }

  /* When research panel is open on mobile: hide bible text and chapter selectors */
  body.research-panel-open .bible-content-wrapper {
    display: none !important;
  }
  body.research-panel-open #sub-nav-bar {
    display: none !important;
  }

  /* Research panel becomes full-width body-scroll content */
  .research-panel.open {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: calc(100vh - var(--top-nav-height, 56px));
    overflow: visible !important;
    border-left: none !important;
    border-top: none;
    z-index: auto;
    transition: none !important;
  }

  /* Let the content flow; body scrolls it */
  .research-panel.open .research-panel-content {
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    flex: none;
  }

  /* Hide resize handle, collapse thumb, and collapse button on mobile */
  .research-panel-resize,
  .research-panel-thumb,
  .research-panel-collapse-btn {
    display: none !important;
  }

  /* Strong's ID label — already visible via base styles, adjust padding for mobile */
  .research-id-mobile {
    padding: 8px 16px 0;
  }
}

/* (research-panel-header, title, close removed — header badge is inline in bible-explorer-header) */

/* Clickable Strong's references in definitions */
.strongs-link {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-primary-strong);
  transition: all 0.2s;
}

.strongs-link:hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold-strong);
}

.research-panel-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.strongs-word-english {
  font-size: 1.2em;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-style: italic;
}

.strongs-lemma {
  font-size: 2.2em;
  color: var(--accent-gold);
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  direction: rtl;
  text-align: center;
  margin-bottom: 12px;
}

.strongs-transliteration {
  font-size: 1.1em;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

.strongs-pronunciation {
  color: var(--text-secondary);
  font-style: italic;
}

.strongs-definition {
  font-size: 1.05em;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(126, 200, 227, 0.05);
  border-radius: 6px;
  border-left: 3px solid var(--border-accent);
}

.strongs-kjv-usage {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.strongs-kjv-usage strong {
  color: var(--accent-primary);
}

.strongs-derivation {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.5;
}

.strongs-derivation strong {
  color: var(--text-secondary);
}

.strongs-gloss {
  font-size: 1.1em;
  color: var(--text-secondary);
  font-style: italic;
}

/* Strong's Verse Search */
/* Person/Place info section */
.strongs-person-info {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-primary-subtle);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}
.person-info-header {
  font-size: 0.85em;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.person-info-brief {
  font-size: 1.1em;
  color: var(--accent-gold);
  margin-bottom: 8px;
}
.person-info-desc {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-style: italic;
}
.person-info-summary {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.5;
}
.person-info-extra {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--accent-primary-subtle);
}
.person-info-meaning {
  font-size: 0.9em;
  color: var(--accent-gold);
  margin-bottom: 10px;
  line-height: 1.5;
}
.person-info-meaning strong {
  color: var(--accent-gold);
}
.person-info-significance {
  font-size: 0.9em;
  color: var(--color-success);
  margin-bottom: 10px;
  line-height: 1.5;
}
.person-info-significance strong {
  color: var(--color-success);
}

/* Links in person info */
.strongs-person-info .scripture-link {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-primary-strong);
  transition: all 0.2s;
}
.strongs-person-info .scripture-link:hover {
  color: var(--accent-primary-hover);
  border-bottom-color: var(--accent-primary-hover);
}
.strongs-person-info .person-name-link {
  color: var(--accent-gold);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.strongs-person-info .person-name-link:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

/* Symbol Info Section in Strong's Panel */
.strongs-symbol-info {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-gold-subtle);
  border-radius: 8px;
  border-left: 3px solid var(--accent-gold);
}

.strongs-symbol-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.strongs-symbol-icon {
  font-size: 1.1em;
}

.strongs-symbol-title {
  font-size: 0.85em;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.strongs-symbol-meaning {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.95em;
}

.strongs-symbol-label {
  color: var(--accent-gold);
  font-weight: 600;
  min-width: 75px;
  flex-shrink: 0;
  white-space: nowrap;
}

.strongs-symbol-value {
  color: var(--text-primary);
}

.strongs-symbol-sentence {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 10px 0;
  font-style: italic;
}

.strongs-symbol-link {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--accent-gold-muted);
  color: var(--accent-gold);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
}

.strongs-symbol-link:hover {
  background: var(--accent-gold-subtle);
  border-color: var(--accent-gold);
  color: var(--accent-gold-hover);
}

/* Word Study Section in Strong's Panel */
.strongs-word-study-info {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-primary-subtle);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

.strongs-word-study-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.strongs-word-study-icon {
  font-size: 1.1em;
}

.strongs-word-study-title {
  font-size: 0.85em;
  color: var(--accent-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.strongs-word-study-summary {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.strongs-word-study-root {
  font-size: 0.9em;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.word-study-label {
  color: var(--accent-primary);
  font-weight: 600;
}

.word-study-root-lemma {
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  color: var(--accent-gold);
  font-size: 1.2em;
  direction: rtl;
}

.word-study-root-meaning {
  color: var(--text-secondary);
  font-style: italic;
}

.strongs-word-study-verse {
  margin: 10px 0;
  padding: 10px;
  background: var(--surface-sunken);
  border-radius: 4px;
}

.word-study-verse-ref {
  color: var(--accent-primary);
  font-weight: 500;
}

.word-study-verse-text {
  font-size: 0.9em;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
  margin-top: 6px;
}

.strongs-word-study-chapter {
  margin: 12px 0 8px;
}

.word-study-chapter-link {
  display: inline-block;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9em;
  padding: 8px 12px;
  background: var(--accent-primary-subtle);
  border-radius: 4px;
  transition: all 0.2s;
}

.word-study-chapter-link:hover {
  background: var(--accent-primary-muted);
  text-decoration: none;
}

.strongs-word-study-link {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
}

.strongs-word-study-link:hover {
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary);
  color: var(--accent-primary-hover);
}

.strongs-verse-search {
  margin-top: 20px;
  border-top: 1px solid var(--accent-primary-muted);
  padding-top: 16px;
}

.strongs-find-verses-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--accent-primary-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--accent-primary);
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s;
}

.strongs-find-verses-btn:hover {
  background: var(--accent-primary-muted);
  color: var(--text-primary);
}

.strongs-verse-results {
  margin-top: 12px;
}

.verse-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85em;
}

.verse-search-count {
  color: var(--accent-gold);
  font-weight: 500;
}

.verse-search-loading {
  color: var(--text-secondary);
  font-style: italic;
}

.verse-search-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verse-search-item {
  padding: 8px 10px;
  background: var(--surface-sunken);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
}

.verse-search-item:hover {
  background: var(--accent-primary-subtle);
  border-left-color: var(--accent-primary-strong);
}

.verse-search-ref {
  color: var(--accent-primary);
  font-weight: 600;
  margin-right: 6px;
}

.verse-search-item .strongs-match {
  color: var(--accent-gold-hover);
  background: none;
  padding: 0;
}

.verse-search-more {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.8em;
}

/* Mobile Strong's Panel */
@media (max-width: 600px) {
  .strongs-panel {
    width: 100%;
    right: -100%;
  }
  
  .strongs-lemma {
    font-size: 1.8em;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .bible-explorer-body {
    flex-direction: column;
  }
  
  .bible-explorer-header-inner {
    gap: 8px;
    row-gap: 10px;
  }
  
  .bible-home-link {
    font-size: 1.3em;
  }
  
  .bible-explorer-select {
    min-width: 110px;
    padding: 6px 8px;
    font-size: 0.9em;
  }
  
  #bible-chapter-select {
    min-width: 60px;
  }
  
  .bible-explorer-search-inline {
    max-width: 200px;
  }
  
  .bible-explorer-sidebar {
    display: none; /* Keep hidden */
  }
  
  .bible-chapters-grid {
    grid-template-columns: repeat(7, 1fr);
  }
  
  .bible-explorer-text {
    padding: 16px;
  }
  
  .bible-chapter-nav {
    padding: 10px 16px;
  }
  
  .bible-chapter-title {
    font-size: 1em;
  }
}

@media (max-width: 600px) {
  /* Make selectors and search share space evenly */
  .bible-explorer-header-inner {
    flex-wrap: nowrap;
  }
  
  .bible-explorer-select {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .reader-content-select {
    flex: 0 0 auto;
    min-width: 100px !important;
    max-width: 140px;
  }
  
  .bible-translation-select {
    min-width: 60px !important;
    flex: 0 0 auto;
    max-width: none;
  }
  
  #bible-book-select {
    flex: 1 1 auto;
    min-width: 60px;
    max-width: 100px;
  }
  
  #bible-chapter-select {
    min-width: 45px;
    max-width: 55px;
    flex: 0 0 auto;
  }
  
  /* Symbol and TimeTested selectors */
  #symbol-select,
  #timetested-chapter-select {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: 160px;
  }
  
  .reader-selector-group {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  .bible-explorer-search-inline {
    flex: 0 0 auto;
    max-width: 140px;
    margin-left: auto;
  }
  
  .bible-explorer-search-inline input {
    min-width: 60px;
    padding: 6px 8px;
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .bible-explorer-page {
    top: 0; /* Was 48px for old absolute layout — now relative, so must be 0 */
  }
  
  .bible-explorer-header {
    padding: 6px 10px;
  }
  
  .bible-explorer-header-inner {
    gap: 6px;
    row-gap: 8px;
    flex-wrap: nowrap;
  }
  
  .bible-home-link {
    font-size: 1.2em;
    flex: 0 0 auto;
  }
  
  .bible-explorer-select {
    min-width: 0;
    padding: 5px 6px;
    font-size: 0.8em;
  }
  
  .reader-content-select {
    min-width: 90px !important;
    max-width: 120px;
  }
  
  .bible-translation-select {
    min-width: 55px !important;
    flex: 0 0 auto;
    max-width: none;
  }
  
  #bible-book-select {
    min-width: 50px;
    max-width: 80px;
  }
  
  #bible-chapter-select {
    min-width: 40px;
    max-width: 50px;
  }
  
  /* Symbol and TimeTested selectors */
  #symbol-select,
  #timetested-chapter-select {
    min-width: 60px;
    max-width: 120px;
  }
  
  /* Collapsible search on very small screens */
  .bible-explorer-search-inline {
    flex: 0 0 auto;
    max-width: none;
    margin-left: auto;
  }
  
  .bible-explorer-search-inline input {
    width: 0;
    padding: 6px 0;
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 0;
    border: none;
  }
  
  .bible-explorer-search-inline.expanded input {
    width: 120px;
    padding: 6px 10px;
    opacity: 1;
    border: 1px solid var(--border-accent);
  }
  
  .bible-explorer-search-inline .bible-explorer-search-btn {
    padding: 6px 12px;
    font-size: 0.9em;
  }
  
  .bible-chapters-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 12px;
  }
}

@media (max-width: 360px) {
  /* Ultra-small screens - minimal widths */
  .bible-explorer-header-inner {
    gap: 4px;
  }
  
  .bible-home-link {
    font-size: 1.1em;
  }
  
  .bible-explorer-select {
    padding: 4px 5px;
    font-size: 0.75em;
  }
  
  .reader-content-select {
    min-width: 80px !important;
    max-width: 100px;
  }
  
  .bible-translation-select {
    min-width: 50px !important;
    flex: 0 0 auto;
    max-width: none;
  }
  
  #bible-book-select {
    max-width: 65px;
  }
  
  #bible-chapter-select {
    min-width: 35px;
  }
  
  /* Symbol and TimeTested selectors */
  #symbol-select,
  #timetested-chapter-select {
    min-width: 50px;
    max-width: 90px;
  }
  
  .bible-explorer-search-inline .bible-explorer-search-btn {
    padding: 5px 10px;
    font-size: 0.85em;
  }
  
  .bible-explorer-search-inline.expanded input {
    width: 90px;
  }
}

/* ============================================================================
   CONCEPT SEARCH - Search by English word, find all Strong's numbers
   ============================================================================ */

.concept-search-results {
  background: var(--surface-raised);
  border-bottom: none;
  padding: 16px 20px;
  height: 40vh;
  min-height: 100px;
  max-height: calc(100% - 150px);
  overflow-y: auto;
  flex-shrink: 0;
}

/* Draggable divider between search results and scripture */
.search-divider {
  height: 8px;
  background: var(--surface-sunken);
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-top: 1px solid var(--accent-gold-muted);
  border-bottom: 1px solid var(--accent-gold-muted);
  transition: background 0.2s;
}

.search-divider:hover {
  background: var(--accent-gold-muted);
}

.search-divider:active {
  background: var(--accent-gold-muted);
}

.search-divider-handle {
  width: 50px;
  height: 4px;
  background: var(--accent-gold-muted);
  border-radius: 2px;
}

.search-divider:hover .search-divider-handle {
  background: var(--accent-gold);
}

.concept-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent-gold);
  margin-bottom: 12px;
  font-size: 0.95em;
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  padding: 8px 0;
  margin: -16px -20px 12px -20px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--accent-gold-muted);
  z-index: 10;
}

.concept-search-close {
  background: var(--accent-gold-muted);
  border: 1px solid var(--accent-gold-muted);
  color: var(--accent-gold);
  font-size: 1.2em;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.concept-search-close:hover {
  background: var(--accent-gold-muted);
  color: var(--text-primary);
}

.concept-search-loading,
.concept-search-empty {
  color: var(--text-secondary);
  padding: 20px;
  text-align: center;
}

.concept-strongs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.concept-strongs-controls {
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.concept-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85em;
  cursor: pointer;
}

.concept-select-all:hover {
  color: var(--text-secondary);
}

.concept-strongs-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-hover);
  border-radius: 6px;
  transition: background 0.2s;
}

.concept-strongs-item:hover {
  background: var(--accent-gold-subtle);
}

.concept-strongs-checkbox {
  display: flex;
  align-items: center;
}

.concept-strongs-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-gold);
}

.concept-strongs-num {
  color: var(--accent-gold);
  font-weight: 600;
  min-width: 60px;
  cursor: pointer;
}

.concept-strongs-num:hover {
  text-decoration: underline;
}

.concept-strongs-lemma {
  font-size: 1.2em;
  color: var(--accent-primary);
}

.concept-strongs-def {
  color: var(--text-secondary);
  font-size: 0.9em;
  flex: 1;
}

.concept-find-all-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-gold-muted) 0%, rgba(180, 130, 20, 0.2) 100%);
  border: 1px solid var(--accent-gold-muted);
  border-radius: 6px;
  color: var(--accent-gold);
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.concept-find-all-btn:hover {
  background: linear-gradient(135deg, var(--accent-gold-muted) 0%, rgba(180, 130, 20, 0.3) 100%);
}

.concept-verse-results {
  margin-top: 12px;
}

.concept-verse-count {
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-bottom: 12px;
}

.concept-only-note {
  color: var(--accent-gold);
  font-style: italic;
}

.concept-strongs-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.concept-strongs-summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9em;
  padding: 8px 0;
  list-style: none;
}

.concept-strongs-summary::-webkit-details-marker {
  display: none;
}

.concept-strongs-summary:hover {
  color: var(--accent-gold);
}

.concept-expand-icon {
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.2s;
}

details.concept-strongs-section[open] .concept-expand-icon {
  transform: rotate(90deg);
}

.concept-verse-item.from-concept-only {
  opacity: 0.8;
  border-left: 2px solid rgba(100, 149, 237, 0.4);
  padding-left: 8px;
  margin-left: -8px;
}

.concept-verse-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-hover);
}

.concept-verse-ref {
  color: var(--accent-gold);
  font-weight: 600;
  min-width: 70px;
  text-decoration: none;
}

.concept-verse-ref:hover {
  text-decoration: underline;
}

.concept-verse-text {
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
}

.concept-verse-text mark {
  background: var(--accent-gold-muted);
  color: var(--text-primary);
  padding: 1px 3px;
  border-radius: 2px;
}

.concept-verse-strongs {
  color: var(--text-tertiary);
  font-size: 0.8em;
  min-width: 50px;
  text-align: right;
}

.concept-verse-strongs .text-match-only {
  color: var(--text-secondary);
  font-style: italic;
  cursor: help;
}

.concept-verse-item.from-text-search {
  border-left: 2px solid var(--accent-gold-muted);
  padding-left: 8px;
  margin-left: -8px;
}

.concept-load-more-sentinel {
  height: 1px;
  visibility: hidden;
}

.concept-load-more-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
}

.concept-load-more-btn:hover {
  background: var(--border-subtle);
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .concept-strongs-item {
    flex-direction: column;
    gap: 4px;
  }
  
  .concept-strongs-def {
    width: 100%;
  }
}

/* ===========================================
   DESKTOP LAYOUT - Fixed Sidebar Navigation
   =========================================== */

/* Profile selector as menu item (desktop only - hidden on mobile) */
.nav-menu-profile-item {
  display: none; /* Hidden on mobile - profile is in top nav */
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
}

/* Show profile in menu on desktop (where top nav profile is hidden) */
@media (min-width: 1200px) {
  .nav-menu-profile-item {
    display: flex;
  }
}

.nav-menu-profile-item:hover {
  background: var(--border-subtle);
}

.nav-menu-profile-item .profile-moon {
  font-size: 1.3em;
  width: 30px;
}

.nav-menu-profile-item .profile-name {
  color: var(--accent-gold);
  font-weight: 600;
  flex: 1;
}

.nav-menu-profile-item .profile-arrow {
  color: var(--accent-primary);
  font-size: 0.8em;
}

/* Desktop: Center content areas (no fixed right sidebar) */
@media (min-width: 900px) {
  .calendar-app {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .events-page-content,
  .priestly-page-content,
  .sabbath-tester-content {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================
   GEMATRIA SECTION STYLES
   ============================================ */

.strongs-gematria-section {
  margin: 16px 0;
  padding: 12px;
  background: var(--color-purple-subtle);
  border: 1px solid var(--color-purple-muted);
  border-radius: 6px;
}

.strongs-gematria-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.strongs-gematria-clickable {
  cursor: pointer;
}

.strongs-gematria-clickable:hover {
  background: var(--color-purple-muted);
  border-radius: 4px;
  margin: -4px -4px;
  padding: 8px 4px;
}

.strongs-gematria-icon {
  font-size: 1.1em;
}

.strongs-gematria-title {
  font-weight: bold;
  color: var(--color-purple);
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.strongs-gematria-value {
  background: var(--color-purple-muted);
  color: var(--color-purple-light);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9em;
  margin-left: auto;
}

.strongs-gematria-expand {
  color: var(--color-purple);
  font-size: 0.8em;
  transition: transform 0.2s;
}

.strongs-gematria-related {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-purple-muted);
}

.strongs-gematria-group {
  margin-bottom: 12px;
}

.strongs-gematria-group:last-child {
  margin-bottom: 0;
}

.strongs-gematria-group-title {
  font-size: 0.85em;
  color: var(--color-purple);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-purple-muted);
}

.strongs-gematria-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  line-height: 1.8;
}

.strongs-gematria-word {
  display: inline;
  padding: 3px 0;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9em;
  color: var(--color-purple-light);
  text-decoration: underline;
  text-decoration-color: rgba(168, 85, 247, 0.4);
  text-underline-offset: 2px;
  white-space: nowrap;
}

.strongs-gematria-word:hover {
  color: var(--text-primary);
  text-decoration-color: var(--color-purple);
}

.strongs-gematria-word::after {
  content: " · ";
  color: var(--color-purple-muted);
  text-decoration: none;
}

.strongs-gematria-word:last-child::after {
  content: "";
}

/* ════════════════════════════════════════════════════════════════════
   MORPHHB HOVER TOOLTIP
   ════════════════════════════════════════════════════════════════════ */

.morph-hover-tooltip {
  position: absolute;
  z-index: 10200;
  max-width: 340px;
  background: var(--surface-overlay);
  border: 1px solid var(--accent-gold-strong);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.85em;
  line-height: 1.5;
  pointer-events: auto;
  box-shadow: 0 4px 16px var(--surface-scrim);
  cursor: pointer;
}

.morph-tip-strongs {
  color: var(--accent-gold);
  font-weight: 600;
  margin-bottom: 4px;
}

.morph-tip-def {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-bottom: 4px;
  line-height: 1.4;
}

.morph-tip-kjv {
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-bottom: 4px;
}

.morph-tip-desc {
  color: var(--accent-primary);
  font-size: 0.88em;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--accent-primary-muted);
}

.morph-tip-symbol {
  color: var(--accent-gold);
  font-size: 0.88em;
  margin-top: 4px;
}

.morph-tip-hint {
  color: var(--text-tertiary);
  font-size: 0.8em;
  margin-top: 6px;
  text-align: center;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════
   HEBREW PARSING SECTION (Strong's sidebar)
   ════════════════════════════════════════════════════════════════════ */

.strongs-morph-parsing {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--accent-primary-strong);
  border-radius: 8px;
}

.morph-parsing-header {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent-primary-subtle);
}

.morph-parsing-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
}

.morph-label {
  color: var(--accent-primary);
  font-size: 0.82em;
  flex-shrink: 0;
  margin-right: 12px;
}

.morph-value {
  color: var(--text-primary);
  text-align: right;
}

.morph-hebrew {
  font-size: 1.4em;
  direction: rtl;
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
}

.morph-parsing-part {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--accent-primary-subtle);
}

.morph-parsing-part:first-of-type {
  border-top: none;
}

.morph-part-hebrew {
  font-size: 1.15em;
  direction: rtl;
  color: var(--accent-gold);
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
}

.morph-part-role {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.morph-role-prefix .morph-part-role {
  color: var(--accent-primary);
  background: var(--accent-primary-muted);
}

.morph-role-root .morph-part-role {
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.morph-role-suffix .morph-part-role {
  color: var(--color-purple-light);
  background: var(--color-purple-muted);
}

.morph-part-detail {
  color: var(--text-secondary);
  font-size: 0.88em;
  line-height: 1.4;
}

.morph-part-help {
  width: 100%;
  padding: 3px 0 2px 30px;
  font-size: 0.82em;
  color: var(--text-tertiary);
  font-style: italic;
  line-height: 1.4;
}

.morph-tip-help {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 0.9em;
}

/* ════════════════════════════════════════════════════════════════════
   CONSONANTAL ROOT CONNECTIONS (Strong's sidebar)
   ════════════════════════════════════════════════════════════════════ */

.strongs-root-connections {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--accent-primary-subtle);
  border-radius: 8px;
}

.root-connections-header {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent-primary-subtle);
}

.root-connections-consonants {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.root-consonants-hebrew {
  font-size: 1.3em;
  direction: rtl;
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  color: var(--accent-gold);
}

.root-connections-note {
  font-size: 0.8em;
  color: var(--text-tertiary);
  font-style: italic;
}

.root-connections-subtitle {
  font-size: 0.82em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.root-connections-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.root-connection-entry {
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: background 0.15s;
  padding: 5px 6px;
  gap: 8px;
}

.root-connection-entry:hover {
  background: var(--accent-primary-subtle);
}

.root-connection-current {
  background: var(--accent-primary-subtle);
  border-left: 2px solid var(--accent-primary);
}

.root-connection-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

/* Strong's number: right-justified, hidden on mobile (visible on hover via title attr) */
.root-connection-num {
  font-size: 0.72em;
  color: var(--accent-primary-strong);
  font-weight: 500;
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

.root-connection-link:hover .root-connection-num {
  color: var(--accent-primary);
}

.root-connection-lemma {
  font-size: 1.15em;
  direction: rtl;
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  color: var(--text-primary);
  flex-shrink: 0;
  min-width: 40px;
  text-align: center;
}

.root-connection-gloss {
  font-size: 0.82em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Tap to expand overflowed gloss text */
.root-connection-gloss.expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.root-connection-marker {
  font-size: 0.7em;
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Mobile: hide Strong's numbers and [current] marker in root connections (available via title tooltip) */
@media (max-width: 768px) {
  .root-connection-num,
  .root-connection-marker {
    display: none;
  }
}

.root-connections-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--accent-primary-subtle);
  font-size: 0.75em;
  color: var(--text-tertiary);
  line-height: 1.4;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════
   BDB LEXICON SECTION (Strong's sidebar — structured AI data)
   ════════════════════════════════════════════════════════════════════ */

.strongs-bdb-section {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--accent-primary-subtle);
  border-radius: 8px;
}

.bdb-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent-primary-subtle);
}

.bdb-header {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.bdb-view-toggle {
  font-size: 0.76em;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.bdb-view-toggle:hover {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary-hover);
}

/* Original BDB formatted content */
.bdb-original-content {
  font-size: 0.88em;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bdb-original-intro {
  margin-bottom: 10px;
  padding: 6px 8px;
  background: var(--accent-primary-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-style: italic;
}

.bdb-original-section {
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--accent-primary-subtle);
}

.bdb-original-section-label {
  margin-bottom: 4px;
}

.bdb-original-section-text {
  margin-bottom: 6px;
  line-height: 1.65;
}

.bdb-original-refs {
  margin-top: 4px;
  font-size: 0.9em;
}

.bdb-original-empty {
  color: var(--text-tertiary);
  font-size: 0.88em;
  padding: 8px 0;
}

.bdb-content-raw {
  font-size: 0.88em;
  color: var(--text-secondary);
  line-height: 1.5;
  word-wrap: break-word;
}

.bdb-sub-header {
  font-size: 0.78em;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 6px;
}

.bdb-sense {
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--accent-primary-strong);
}

.bdb-sense-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.bdb-sense-num {
  color: var(--accent-gold);
  font-weight: 700;
}

.bdb-sense-meaning {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92em;
}

.bdb-sense-detail {
  color: var(--text-secondary);
  font-size: 0.88em;
  margin-top: 3px;
  line-height: 1.5;
}

/* Ref chips */
.bdb-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.bdb-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-sunken);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8em;
}

.bdb-verse-ref {
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
}

.bdb-verse-ref:hover {
  text-decoration-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  border-radius: 2px;
}

/* Verse hover tooltip (scripture reference preview) */
.verse-hover-tooltip {
  position: fixed;
  z-index: 10200;
  max-width: 360px;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--surface-overlay);
  border: 1px solid var(--accent-primary-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px var(--surface-scrim);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: auto;
  cursor: pointer;
}

.verse-tooltip-ref {
  color: var(--accent-primary);
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 4px;
}

.verse-tooltip-text {
  color: var(--text-primary);
  font-size: 0.88em;
  line-height: 1.5;
}

.verse-tooltip-unavailable {
  color: var(--text-tertiary);
  font-style: italic;
}

@media (max-width: 768px) {
  .verse-hover-tooltip {
    max-width: calc(100vw - 20px);
  }
}

.bdb-stem-badge {
  background: var(--accent-gold-muted);
  color: var(--accent-gold);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: 600;
}

.bdb-trans-word {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.92em;
}

.bdb-strongs-link {
  color: var(--accent-primary);
  font-size: 0.85em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent-primary-strong);
}

.bdb-strongs-link:hover {
  text-decoration-color: var(--accent-primary);
}

/* Callout boxes */
.bdb-callout {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88em;
  line-height: 1.5;
}

.bdb-callout-distinction {
  background: var(--accent-gold-subtle);
  border-left: 3px solid var(--accent-gold);
}

.bdb-callout-translation {
  background: var(--accent-primary-subtle);
  border-left: 3px solid var(--accent-primary);
  color: var(--text-secondary);
}

.bdb-callout-insight {
  background: var(--color-purple-subtle);
  border-left: 3px solid var(--color-purple);
  color: var(--text-secondary);
}

.bdb-callout-root {
  background: var(--color-success-muted);
  border-left: 3px solid var(--color-success);
  color: var(--text-secondary);
}

.bdb-callout-label {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  opacity: 0.6;
}

/* Evidence section */
.bdb-evidence-btn {
  display: block;
  margin-top: 10px;
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-strong);
  color: var(--accent-primary);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.84em;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.2s;
}

.bdb-evidence-btn:hover {
  background: var(--accent-primary-muted);
}

.bdb-evidence {
  display: none;
  margin-top: 8px;
}

.bdb-evidence.open {
  display: block;
}

.bdb-evidence-point {
  padding: 8px 10px;
  background: var(--surface-sunken);
  border-radius: 6px;
  margin-bottom: 6px;
}

.bdb-evidence-text {
  color: var(--text-secondary);
  font-size: 0.88em;
  line-height: 1.6;
}

/* Key verses */
.bdb-key-verses {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--accent-primary-subtle);
}

.bdb-kv-label {
  font-size: 0.72em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.bdb-kv-item {
  margin-bottom: 3px;
  font-size: 0.88em;
}

.bdb-kv-note {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Active stem highlight */
.bdb-sense-active {
  border-left-color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

/* "See all stems" toggle */
.bdb-other-stems-toggle {
  padding: 6px 10px;
  color: var(--accent-primary);
  font-size: 0.84em;
  cursor: pointer;
  user-select: none;
}

.bdb-other-stems-toggle:hover {
  color: var(--accent-primary);
}

.bdb-chevron {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 1.1em;
}

.bdb-other-stems-toggle.open .bdb-chevron {
  transform: rotate(90deg);
}

.bdb-other-stems {
  display: none;
}

.bdb-other-stems.open {
  display: block;
}

.bdb-form-label {
  color: var(--accent-primary);
  font-weight: 500;
}

/* Raw BDB source view */
.bdb-raw-btn {
  display: block;
  margin-top: 10px;
  background: none;
  border: 1px solid var(--accent-primary-subtle);
  color: var(--text-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78em;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.bdb-raw-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary-strong);
}

.bdb-raw-content {
  display: none;
  margin-top: 8px;
  padding: 10px;
  background: var(--surface-sunken);
  border-radius: 6px;
  font-size: 0.82em;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
  word-wrap: break-word;
}

.bdb-raw-content.open {
  display: block;
}

/* Attribution */
.bdb-attribution {
  margin-top: 10px;
  font-size: 0.7em;
  color: var(--text-tertiary);
  text-align: center;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   TRANSLATION PATCHES — Three visual states
   ═══════════════════════════════════════════════════════════════ */

/* State 1: Proposed — dotted orange underline on original text */
/* ═══════════════════════════════════════════════════════════════
   Translation Patch System — Phrase-level highlighting
   
   Two states for patched regions:
   - Pending (orange): replacement shown, user hasn't reviewed
   - Accepted (blue): user accepted the patch
   
   Pending regions override inner Strong's tooltips via pointer-events.
   Accepted regions let Strong's tooltips work normally.
   ═══════════════════════════════════════════════════════════════ */

/* ── Pending patch region: solid orange text only (no underline) ── */
.patch-region-pending {
  color: var(--color-warning);
  cursor: pointer;
  transition: color 0.2s;
}
.patch-region-pending:hover {
  color: var(--color-warning);
  filter: brightness(1.2);
}

/* Pending: override inner Strong's/symbol interactivity — patch tooltip takes priority */
/* For nested case (plain text path: patch span wraps strongs/symbol spans) */
.patch-region-pending .strongs-word,
.patch-region-pending .symbol-word {
  pointer-events: none;
  color: inherit;
}
.patch-region-pending .symbol-word {
  background: none;
  text-decoration: none;
}
/* For same-element case (Strong's path: strongs-word also has patch class) */
.strongs-word.patch-region-pending {
  color: var(--color-warning);
  cursor: pointer;
}
.strongs-word.patch-region-pending:hover {
  color: var(--color-warning);
  filter: brightness(1.2);
}
.strongs-word.patch-region-accepted {
  color: var(--accent-primary);
}

/* ── Accepted patch region: subtle muted blue — settled, not distracting ── */
.patch-region-accepted {
  color: var(--accent-primary);
  transition: color 0.2s;
}

/* ── Rejected patch region: very subtle hint that a patch is available ── */
.patch-region-rejected {
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s;
}
.patch-region-rejected:hover {
  color: var(--accent-gold);
}
.strongs-word.patch-region-rejected {
  color: var(--text-tertiary);
  cursor: pointer;
}
.strongs-word.patch-region-rejected:hover {
  color: var(--accent-gold);
}
/* Don't override children — Strong's/symbol interactivity is active */

/* ── Tooltip container ── */
.patch-tooltip-container {
  animation: patchTooltipFadeIn 0.15s ease-out;
}
@keyframes patchTooltipFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Tooltip panel ── */
.patch-tooltip {
  background: var(--surface-overlay);
  border: 1px solid var(--accent-primary-strong);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 380px;
  min-width: 260px;
  font-size: 0.85em;
  line-height: 1.5;
  color: var(--text-secondary);
  box-shadow: 0 8px 24px var(--shadow-lg);
}

.patch-tooltip-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.95em;
}

.patch-tooltip-group {
  color: var(--color-warning);
  font-size: 0.85em;
  margin-bottom: 8px;
}

.patch-tooltip-original {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 0.9em;
  margin-bottom: 8px;
}

.patch-tooltip-body {
  margin-bottom: 10px;
}
.patch-tooltip-body p {
  margin: 0 0 8px 0;
}
.patch-tooltip-body p:last-child {
  margin-bottom: 0;
}

.patch-tooltip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--accent-primary-subtle);
}

.patch-tooltip-btn {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid var(--accent-primary-strong);
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.15s;
}
.patch-tooltip-btn:hover {
  background: var(--border-subtle);
  border-color: var(--accent-primary);
}

.patch-tooltip-study {
  color: var(--accent-primary);
  border-color: var(--accent-primary-strong);
}
.patch-tooltip-study:hover {
  background: var(--accent-primary-subtle);
}

.patch-tooltip-accept {
  color: var(--accent-primary);
  border-color: var(--accent-primary-strong);
  font-weight: 600;
}
.patch-tooltip-accept:hover {
  background: var(--accent-primary-muted);
}

.patch-tooltip-reject {
  color: var(--color-warning);
  border-color: var(--color-warning-muted);
}
.patch-tooltip-reject:hover {
  background: var(--color-warning-muted);
}

/* ── Comparison translation highlighting ── */
.patch-comparison-highlight {
  color: var(--color-warning);
}

/* ── Interlinear patch note (above tabs) ── */
.patch-interlinear-note {
  margin: 4px 0 8px 0;
  padding: 10px 14px;
  background: var(--color-warning-muted);
  border: 1px solid var(--color-warning-muted);
  border-radius: 6px;
  font-size: 0.85em;
  line-height: 1.5;
}
.patch-note-header {
  font-weight: 600;
  color: var(--color-warning);
  margin-bottom: 4px;
  font-size: 0.95em;
}
.patch-note-header-accepted {
  color: var(--accent-primary);
}
.patch-note-header-available {
  color: var(--text-tertiary);
}
.patch-note-group {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-bottom: 6px;
}
.patch-note-comparison {
  margin: 6px 0;
  padding: 6px 10px;
  background: var(--calendar-day-bg);
  border-radius: 4px;
  font-size: 0.9em;
  line-height: 1.6;
}
.patch-note-original {
  color: var(--text-tertiary);
}
.patch-note-original del {
  text-decoration: line-through;
  text-decoration-color: var(--color-warning-muted);
}
.patch-note-replacement {
  color: var(--color-warning);
  margin-top: 2px;
}
.patch-note-replacement em {
  font-style: normal;
  color: var(--color-warning);
}
.patch-note-body {
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.patch-note-body p {
  margin: 0 0 6px 0;
}
.patch-note-body p:last-child {
  margin-bottom: 0;
}
.patch-note-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-warning-muted);
}

/* ── Vowel toggle container inside Hebrew pane ── */
.il-vowel-toggle-container {
  text-align: right;
  margin-bottom: 6px;
}
