/* ═══════════════════════════════════════════════════════════
   Online Bible — Fine Art Gallery Style
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&family=Noto+Sans+Hebrew:wght@300;400;500;600;700&family=Noto+Sans+Greek:wght@300;400;500;600;700&family=Lato:wght@300;400&display=swap');

:root {
  --bg: #0f0f12;
  --bg-elevated: #18181c;
  --bg-card: #1e1e24;
  --bg-card-hover: #252530;
  --bg-sidebar: #0a0a0e;
  --bg-overlay: rgba(0,0,0,0.85);
  --text: #e8e6e1;
  --text-muted: #8a8780;
  --text-faint: #5a5750;
  --gold: #4eb8c9;
  --gold-light: #8de8f0;
  --gold-dark: #2a7a85;
  --gold-glow: rgba(78,184,201,0.15);
  --accent-blue: #5b8fb9;
  --accent-blue-dim: #3a5f7f;
  --accent-purple: #9b7cb8;
  --accent-green: #6db87e;
  --accent-red: #c96b6b;
  --accent-teal: #5bb8b0;
  --accent-orange: #d4a056;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --rightpanel-w: 320px;
  --topbar-h: 56px;
  /* Fine art gallery tones */
  --dark-red: #6b1f2c;
  --dark-red-dim: #4a141e;
  --pink: #c76b8a;
  --pink-light: #e8a0b8;
  --pink-dim: #8a4558;
  --cyan: #4eb8c9;
  --cyan-light: #8de8f0;
  --cyan-dim: #2a7a85;
  --cobalt: #3a5f9f;
  --cobalt-light: #6b8fc9;
  --cobalt-dim: #223a5f;

  /* Imported Theme Tones from style.html */
  --palo-dark-red: #6B1C23;
  --palo-deep-red: #8B2230;
  --palo-muted-red: #A03040;
  --palo-dark-blue: #1A2744;
  --palo-deep-blue: #243456;
  --palo-muted-blue: #2E4070;
  --palo-gold: #C9A84C;
  --palo-gold-light: #E0C872;
  --palo-cream: #F5F0E8;
  --palo-cream-dark: #E8E0D0;
  --palo-bg-dark: #0F0F14;
  --palo-bg-card: #16161E;
  --palo-text-primary: #F5F0E8;
  --palo-text-secondary: #B0A89A;
}

/* Light theme */
body.light {
  --bg: #f5f3ee;
  --bg-elevated: #ede9e0;
  --bg-card: #ffffff;
  --bg-card-hover: #f0ece4;
  --bg-sidebar: #eae5d8;
  --bg-overlay: rgba(0,0,0,0.5);
  --text: #2a2520;
  --text-muted: #6b6560;
  --text-faint: #9a9590;
  --gold: #2a7a85;
  --gold-light: #4eb8c9;
  --gold-dark: #1a5a65;
  --gold-glow: rgba(42,122,133,0.08);
  --accent-blue: #3a6f8f;
  --accent-blue-dim: #2a5068;
  --accent-purple: #7a5c98;
  --accent-green: #4a8f5a;
  --accent-red: #a05050;
  --accent-teal: #3a8f88;
  --accent-orange: #b08030;
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.15);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* Subtle background gradient from style.html */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(107, 28, 35, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(26, 39, 68, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══ Header Elements from style.html ═══ */
header.palo-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 20px 20px;
  width: 100%;
}

header.palo-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 2.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--palo-cream);
  margin-bottom: 8px;
}

header.palo-header h1 span {
  color: var(--palo-gold);
  font-style: italic;
  font-weight: 400;
}

.subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--palo-text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.ornament {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--palo-gold), transparent);
  margin: 0 auto 24px;
  position: relative;
}
.ornament::before {
  content: '◆';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--palo-gold);
  font-size: 10px;
  background: var(--palo-bg-dark);
  padding: 0 8px;
}

/* ═══ Progress Bar from style.html ═══ */
.progress-bar-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: 16px auto 8px;
  padding: 0 20px;
}

.progress-bar-bg {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--palo-dark-red), var(--palo-gold));
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
}

.progress-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--palo-text-secondary);
  margin-top: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ═══ Card Stage Area from style.html ═══ */
.card-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.card-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 3px;
  background: linear-gradient(135deg, var(--palo-gold) 0%, var(--palo-dark-red) 40%, var(--palo-dark-blue) 60%, var(--palo-gold-light) 100%);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  animation: cardEnter 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-inner {
  background: var(--palo-bg-card);
  border-radius: 2px;
  padding: 50px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-inner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.card-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--palo-gold);
  margin-bottom: 30px;
  opacity: 0.7;
}

.card-prompt {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--palo-cream);
  position: relative;
  z-index: 1;
}

.card-prompt::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--palo-muted-red), transparent);
  margin: 30px auto 0;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 20px;
  opacity: 0.6;
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.06), transparent);
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* All viewed state */
.all-viewed {
  text-align: center;
  padding: 40px 30px;
}

.all-viewed h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 1.8rem;
  color: var(--palo-gold);
  margin-bottom: 16px;
}

.all-viewed p {
  color: var(--palo-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 30px;
}

/* Buttons from style.html */
.btn-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 10px 20px 30px;
  flex-wrap: wrap;
}

.btn-palo {
  font-family: 'Lato', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 32px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-palo-primary {
  background: linear-gradient(135deg, var(--palo-dark-red), var(--palo-deep-red));
  color: var(--palo-cream);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.btn-palo-primary:hover {
  background: linear-gradient(135deg, var(--palo-deep-red), var(--palo-muted-red));
  border-color: rgba(201, 168, 76, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 34, 48, 0.3);
}

.btn-palo-secondary {
  background: transparent;
  color: var(--palo-text-secondary);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-palo-secondary:hover {
  color: var(--palo-cream);
  border-color: rgba(201, 168, 76, 0.4);
  transform: translateY(-2px);
}

.btn-palo-reset {
  background: transparent;
  color: var(--palo-muted-red);
  border: 1px solid rgba(160, 48, 64, 0.3);
  font-size: 0.7rem;
  padding: 10px 24px;
}

.btn-palo-reset:hover {
  color: var(--palo-deep-red);
  border-color: rgba(160, 48, 64, 0.6);
  background: rgba(160, 48, 64, 0.08);
  transform: translateY(-2px);
}

/* Footer from style.html */
footer.palo-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  width: 100%;
}

footer.palo-footer .ornament {
  margin-bottom: 16px;
}

.copyright {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  color: rgba(176, 168, 154, 0.4);
  letter-spacing: 0.1em;
}

/* ═══ Top Bar ═══ */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-sizing: border-box;
  overflow: hidden;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}

.btn-gold {
  background: var(--gold);
  color: var(--bg);
  border: none;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--gold-glow); }

/* Book nav */
.book-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.book-nav select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  min-width: 120px;
}
.book-nav select:focus { outline: none; border-color: var(--gold); }

/* ═══ Layout ═══ */
#mainLayout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  overflow-x: hidden;
}

/* ═══ Sidebar ═══ */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  z-index: 90;
  transition: transform 0.3s ease;
  padding: 16px 0;
}

#sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-section { margin-bottom: 16px; }
.sidebar-section h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 8px 16px 4px;
}

.book-list { list-style: none; }
.book-list li a {
  display: block;
  padding: 5px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.book-list li a:hover {
  color: var(--gold);
  background: var(--gold-glow);
  border-left-color: var(--gold);
}
.book-list li a.active {
  color: var(--gold);
  background: var(--gold-glow);
  border-left-color: var(--gold);
  font-weight: 500;
}

.sidebar-tools {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.sidebar-tools .book-list li a {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
}

/* ═══ Main Reader ═══ */
#reader {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-right: var(--rightpanel-w);
  padding: 32px 40px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin 0.3s;
  overflow-x: hidden;
  min-width: 0;
}

body.sidebar-collapsed #reader { margin-left: 0; }
body.sidebar-collapsed #sidebar { transform: translateX(-100%); }

/* Views */
.view { display: none; }
.view.active { display: block; }

/* ═══ Gallery View ═══ */
.gallery-hero {
  text-align: center;
  padding: 48px 20px 36px;
  background: radial-gradient(ellipse at 50% 0%, rgba(199,107,138,0.06) 0%, rgba(58,95,159,0.04) 40%, transparent 70%);
  overflow-x: hidden;
}
.gallery-hero h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem;
  font-weight: 300;
  background: linear-gradient(135deg, var(--pink-light), var(--cyan-light), var(--cobalt-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.gallery-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 16px 0 40px;
  width: 100%;
  box-sizing: border-box;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.gallery-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}
.gallery-card:hover::before { opacity: 1; }

.gallery-card .card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: block;
}
.gallery-card .card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.gallery-card .card-chapters {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Testament dividers in gallery */
.gallery-testament-label {
  grid-column: 1 / -1;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  padding: 24px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}

/* ═══ Chapter View ═══ */
.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.chapter-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--gold);
}

.chapter-nav {
  display: flex;
  gap: 8px;
}
.btn-nav {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-nav:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-glow);
}
.chapter-nav.bottom {
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Verses */
.verses-container {
  max-width: 720px;
}

.verse {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.verse:hover {
  background: var(--bg-card);
}
.verse.selected {
  background: var(--gold-glow);
  border-left: 3px solid var(--gold);
}

.verse-num {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 28px;
  text-align: right;
  padding-top: 4px;
  flex-shrink: 0;
}

.verse-text {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text);
}

.verse.has-crossrefs .verse-num::after {
  content: ' 🔗';
  font-size: 0.55rem;
  opacity: 0.6;
}

/* ═══ Right Panel ═══ */
#rightPanel {
  width: var(--rightpanel-w);
  min-width: var(--rightpanel-w);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  z-index: 80;
  padding: 20px 16px;
  transition: transform 0.3s;
}

.panel-placeholder {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-faint);
  font-size: 0.88rem;
  line-height: 1.6;
}

.panel-section {
  margin-bottom: 20px;
}
.panel-section h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Cross-refs */
.crossref-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.crossref-item:hover {
  border-color: var(--accent-blue);
  background: rgba(91,143,185,0.08);
}
.crossref-ref {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 2px;
}
.crossref-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.crossref-text {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 4px;
  font-style: italic;
}

/* Word study */
.word-study-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.word-study-headword {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: capitalize;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.word-study-lang-block {
  padding: 8px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-bottom: 4px;
}
.word-study-lang-block.lang-greek {
  border-left-color: var(--accent-purple);
}
.word-study-lang-block.lang-hebrew {
  border-left-color: var(--accent-green);
}
.word-study-lang-block + .word-study-lang-block {
  margin-top: 4px;
}
.word-study-word {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 2px;
}
.word-study-lang {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.word-study-meaning {
  font-size: 0.88rem;
  color: var(--text);
}
.word-study-strongs {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--text-faint);
  margin-top: 4px;
}

/* Course connection */
.course-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  cursor: pointer;
}
.course-link:hover {
  border-color: var(--accent-green);
  background: rgba(109,184,126,0.08);
}
.course-link-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.course-link-info {
  flex: 1;
}
.course-link-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-green);
}
.course-link-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══ Search ═══ */
.search-header {
  margin-bottom: 24px;
}
.search-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 16px;
}
.search-box {
  display: flex;
  gap: 8px;
  max-width: 500px;
}
.search-box input {
  flex: 1;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
}
.search-box input:focus {
  outline: none;
  border-color: var(--gold);
}
.search-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.search-results {
  max-width: 720px;
}
.search-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.search-result:hover {
  border-color: var(--gold);
}
.search-result-ref {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}
.search-result-text {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
}
.search-result-text mark {
  background: var(--gold-glow);
  color: var(--gold-light);
  padding: 0 2px;
  border-radius: 2px;
}

/* ═══ Tooltip ═══ */
.tooltip {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-width: 320px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  line-height: 1.5;
  pointer-events: none;
}

/* ═══ Overlay ═══ */
#overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 85;
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
  #rightPanel {
    position: fixed;
    right: 0;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
  }
  #rightPanel.open {
    transform: translateX(0);
  }
  #reader {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  #reader {
    margin-left: 0;
    margin-right: 0;
    padding: 20px 16px;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .gallery-hero h2 {
    font-size: 2rem;
  }
  .chapter-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .book-nav {
    flex-wrap: wrap;
  }
  .book-nav select {
    min-width: 100px;
  }
  .gallery-nav {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 8px;
  }
  .gallery-nav-card {
    padding: 16px 18px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .gallery-nav-card::before {
    top: 0; left: 0; bottom: 0;
    width: 4px; height: auto;
  }
  .gallery-nav-card::after {
    background: radial-gradient(ellipse at 0% 50%, var(--card-accent, var(--gold-glow)) 0%, transparent 60%);
  }
  .gallery-nav-icon {
    font-size: 2rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .gallery-nav-card h3 {
    font-size: 1.1rem;
    margin-bottom: 2px;
  }
  .gallery-nav-card p {
    font-size: 0.78rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #reader {
    padding: 24px 20px;
    margin-right: 0;
  }
  .gallery-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Responsive updates for style.html imports */
@media (max-width: 520px) {
  header.palo-header h1 { font-size: 2rem; letter-spacing: 0.1em; }
  .card-inner { padding: 36px 24px; }
  .card-prompt { font-size: 1.4rem; }
  .btn-palo { padding: 12px 24px; font-size: 0.75rem; }
}

/* ═══ Small phone adjustments (max-width: 480px) ═══ */
@media (max-width: 480px) {
  /* Tighter hero area */
  .gallery-hero {
    padding: 28px 12px 20px;
  }
  .gallery-hero h2 {
    font-size: 1.6rem;
  }
  .gallery-subtitle {
    font-size: 0.75rem;
  }

  /* Single column nav cards, compact */
  .gallery-nav {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 4px;
  }
  .gallery-nav-card {
    padding: 14px 14px;
    gap: 12px;
    /* Ensure touch target height >= 44px */
    min-height: 56px;
    align-items: center;
  }
  .gallery-nav-icon {
    font-size: 1.6rem;
  }
  .gallery-nav-card h3 {
    font-size: 1rem;
    margin-bottom: 0;
  }
  .gallery-nav-card p {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  /* Quiz banner stacks vertically */
  .quiz-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }
  .quiz-banner-btn {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.85rem;
    /* Touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Welcome features stack */
  .welcome-features {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }
  .welcome-feature {
    padding: 16px 14px;
  }
  .welcome-feature-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
  }
  .welcome-feature h3 {
    font-size: 1rem;
    margin-bottom: 4px;
  }
  .welcome-feature p {
    font-size: 0.78rem;
  }

  /* Gallery book grid: 2 columns on small phones */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .gallery-card {
    padding: 14px 10px;
  }
  .gallery-card .card-icon {
    font-size: 1.4rem;
  }
  .gallery-card .card-name {
    font-size: 0.9rem;
  }

  /* Reader padding */
  #reader {
    padding: 16px 10px;
    margin-right: 0;
  }

  /* Verse text */
  .verse-text {
    font-size: 1rem;
    line-height: 1.75;
  }

  /* Buttons in nav need touch sizing */
  .btn-nav {
    padding: 8px 12px;
    font-size: 0.82rem;
    min-height: 44px;
  }

  /* Icon buttons in topbar */
  .icon-btn {
    width: 40px;
    height: 40px;
  }

  /* Chapter header */
  .chapter-header h2 {
    font-size: 1.4rem;
  }

  /* Search box */
  .search-box input {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  /* Annotations view */
  #annotationsView {
    padding: 12px;
  }
  .annotations-controls {
    flex-direction: column;
  }
  .annotations-controls input {
    min-width: auto;
  }
}

/* ═══ Animations ═══ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.view.active .gallery-card,
.view.active .verse,
.view.active .search-result {
  animation: fadeIn 0.3s ease both;
}

/* Stagger gallery cards */
.gallery-card:nth-child(1) { animation-delay: 0.02s; }
.gallery-card:nth-child(2) { animation-delay: 0.04s; }
.gallery-card:nth-child(3) { animation-delay: 0.06s; }
.gallery-card:nth-child(4) { animation-delay: 0.08s; }
.gallery-card:nth-child(5) { animation-delay: 0.1s; }
.gallery-card:nth-child(6) { animation-delay: 0.12s; }

/* ═══ Quiz Banner ═══ */
.quiz-banner {
  background: linear-gradient(135deg, var(--gold-glow), rgba(155,124,184,0.1));
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  max-width: 100%;
}
.quiz-banner-text h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 2px;
}
.quiz-banner-text p {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.quiz-banner-btn {
  background: var(--gold);
  color: var(--bg);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.quiz-banner-btn:hover { background: var(--gold-light); }

/* ═══ Welcome Features ═══ */
.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}
.welcome-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.welcome-feature::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.3s;
}
.welcome-feature:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}
.welcome-feature:hover::before { opacity: 1; }
.welcome-feature-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 12px;
}
.welcome-feature h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}
.welcome-feature p {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.welcome-link {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-blue-dim);
  transition: color 0.2s, border-color 0.2s;
}
.welcome-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ═══ Gallery Nav Cards (Home screen links) ═══ */
.gallery-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 40px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}
.gallery-nav-card {
  display: block;
  text-decoration: none;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.gallery-nav-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-accent, var(--gold));
  opacity: 0.7;
  transition: opacity 0.3s;
}
.gallery-nav-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--card-accent, var(--gold-glow)) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}
.gallery-nav-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent, var(--gold));
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px color-mix(in srgb, var(--card-accent, var(--gold)) 20%, transparent);
}
.gallery-nav-card:hover::before { opacity: 1; }
.gallery-nav-card:hover::after { opacity: 0.08; }
.gallery-nav-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.gallery-nav-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--card-accent, var(--gold));
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.gallery-nav-card p {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Translation selector */
#translationSelect {
  background: var(--bg-card);
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  width: 80px;
  max-width: 80px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}
#translationSelect:focus { outline: none; border-color: var(--gold); }

/* Loading indicator */
.translation-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}
.translation-loading .spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Translation error */
.translation-error {
  padding: 12px 16px;
  background: rgba(201,107,107,0.1);
  border: 1px solid rgba(201,107,107,0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* ═══ Verse highlight colors for word study ═══ */
.highlight-greek { background: rgba(155,124,184,0.2); border-bottom: 2px solid var(--accent-purple); }
.highlight-hebrew { background: rgba(91,184,176,0.2); border-bottom: 2px solid var(--accent-teal); }

/* ═══ Quiz Modal ═══ */
#quizOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-overlay);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#quizOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

#quizModal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#quizModal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.quiz-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.quiz-modal-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}
.quiz-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.quiz-close-btn:hover { color: var(--text); }

.quiz-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Start screen */
.quiz-start-screen {
  text-align: center;
  padding: 20px 0;
}
.quiz-start-icon { font-size: 3rem; margin-bottom: 12px; }
.quiz-start-screen h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 8px;
}
.quiz-start-screen p {
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Quiz area */
.quiz-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.quiz-type-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.quiz-score-display {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.quiz-progress {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.quiz-question-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Choices */
.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.quiz-choice {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.quiz-choice:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-dark);
}
.quiz-choice:active { transform: scale(0.98); }
.quiz-choice.correct {
  background: rgba(109,184,126,0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}
.quiz-choice.wrong {
  background: rgba(201,107,107,0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Feedback */
.quiz-feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}
.quiz-feedback.correct { display: block; background: rgba(109,184,126,0.1); border: 1px solid rgba(109,184,126,0.3); }
.quiz-feedback.wrong { display: block; background: rgba(201,107,107,0.1); border: 1px solid rgba(201,107,107,0.3); }
.quiz-feedback .quiz-ref {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

/* Result area */
.quiz-result-area {
  text-align: center;
  padding: 20px 0;
}
.quiz-final-score {
  margin-bottom: 24px;
}
.final-score-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
}
.final-score-pct {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.final-score-msg {
  display: block;
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--text);
}

/* Large button */
.btn-large {
  padding: 12px 32px;
  font-size: 1.05rem;
}

/* ═══ Verse Annotation Indicator ═══ */
.verse.has-annotation {
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}

.annotation-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ═══ Annotation Panel Section ═══ */
.annotation-section {
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 8px;
  padding: 14px;
}

.annotation-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.annotation-empty {
  font-size: 0.82rem;
  color: var(--text-faint);
  font-style: italic;
  margin-bottom: 8px;
}

.annotation-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.btn-annotation {
  padding: 6px 14px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-annotation:hover {
  background: var(--bg-hover);
  border-color: var(--gold);
}

.btn-annotation-save {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  font-weight: 600;
}

.btn-annotation-save:hover {
  background: #4eb8c9;
}

.btn-annotation-delete {
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.3);
}

.btn-annotation-delete:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: #e74c3c;
}

.annotation-editor textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 8px;
}

.annotation-editor textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.annotation-editor-actions {
  display: flex;
  gap: 8px;
}

.annotation-meta {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.annotation-storage-note {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.annotation-storage-note.synced {
  color: #27ae60;
}

.annotation-storage-note a {
  color: var(--gold);
  text-decoration: underline;
}

/* ═══ Annotations View ═══ */
#annotationsView {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.annotations-header {
  margin-bottom: 24px;
}

.annotations-header h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--gold);
}

.annotations-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.annotations-controls input {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.annotations-controls input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.annotations-controls select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.annotations-count {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.annotations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.annotations-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 0.95rem;
}

.annotation-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.annotation-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.1);
}

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

.annotation-card-ref {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
}

.annotation-card-date {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.annotation-card-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.annotation-card-actions {
  display: flex;
  gap: 8px;
}

/* ═══ Topbar annotations button badge ═══ */
#annotationsBtn {
  position: relative;
}

#annotationsBtn.has-annotations::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

/* ═══ Rotating Ads ═══ */
#verseAd .ad-link:hover {
    border-color: var(--gold) !important;
    background: var(--bg-tertiary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#verseAd .ad-link {
    cursor: pointer;
}

/* ═══ About Modal ═══ */
#aboutOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
}
#aboutModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1001;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ═══ Clickable words in Bible text ═══ */
.bword {
  cursor: pointer;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.bword:hover {
  border-bottom-color: var(--gold);
  color: var(--gold-light);
}

/* ═══ Concordance Modal ═══ */
#concordanceOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
}
#concordanceModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1001;
  width: 580px;
  max-width: 92vw;
  max-height: 82vh;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.conc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.conc-header h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.6rem;
  color: var(--gold);
  margin: 0;
  line-height: 1.2;
}
.conc-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.conc-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.conc-close:hover { color: var(--text); }
.conc-list {
  overflow-y: auto;
  padding: 6px 8px 12px;
}
.conc-entry {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.conc-entry:hover { background: var(--bg-card-hover); }
.conc-ref {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 3px;
}
.conc-text {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}
.conc-mark {
  background: var(--gold-glow);
  color: var(--gold-light);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
}
.conc-more {
  padding: 12px 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}
.conc-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-faint);
}

/* ── Word Study popup (lexicon) ───────────────────────────── */
.ws-entry {
  padding: 18px 4px 20px;
  border-bottom: 1px solid var(--border);
}
.ws-entry:last-of-type { border-bottom: none; }
.ws-lang {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.ws-original {
  font-family: "Ezra SIL", "SBL Hebrew", "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--gold);
  direction: rtl;
  margin: 2px 0 8px;
}
.ws-line {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}
.ws-label {
  display: inline-block;
  min-width: 110px;
  font-weight: 600;
  color: var(--text-muted);
}
.ws-meaning {
  font-size: 1rem;
  font-style: italic;
  color: var(--text);
  margin: 8px 0 6px;
}
.ws-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 4px;
}
.ws-occ-link {
  text-align: center;
  padding: 14px 0 4px;
}
.ws-occ-link a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}
.ws-occ-link a:hover { text-decoration: underline; }

/* ── Right-panel word study extras ────────────────────────── */
.word-study-translit {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.word-study-pron {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--gold);
  margin-top: 1px;
}
