/* ── Timeline Panel ── */
#timeline-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
#timeline-trigger:hover {
  background: var(--surface2);
  color: var(--gold);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#timeline-trigger.active {
  background: var(--surface2);
  color: var(--gold);
  border-color: var(--gold-dark);
}

#timeline-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.5);
  display: none;
}
#timeline-overlay.visible { display: block; }

#timeline-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
#timeline-panel.open { transform: translateY(0); }

.tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tl-title {
  font-family: var(--font);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}
.tl-close:hover { color: var(--text); }

.tl-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px 20px;
}
.tl-body::-webkit-scrollbar { width: 4px; }
.tl-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.tl-section { margin-bottom: 28px; }
.tl-section:last-child { margin-bottom: 0; }

.tl-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tl-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.tl-badge-paul { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }
.tl-badge-bible { background: rgba(51,85,170,0.15); color: #8899cc; border: 1px solid rgba(51,85,170,0.3); }
.tl-section-note { font-size: 0.72rem; color: var(--text-dim); font-style: italic; font-family: var(--font); }

/* Paul's journeys — horizontal scroll axis */
.tl-axis-wrap {
  position: relative;
  overflow-x: auto;
  padding-bottom: 48px;
  margin-bottom: 4px;
}
.tl-axis-wrap::-webkit-scrollbar { height: 3px; }
.tl-axis-wrap::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.tl-axis {
  height: 1px;
  background: linear-gradient(to right, transparent 0%, var(--border2) 10%, var(--border2) 90%, transparent 100%);
  position: relative;
  min-width: 600px;
}

/* Journey bands */
.tl-journey-band {
  position: absolute;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: visible;
  margin-top: 8px;
  cursor: default;
}
.tl-journey-j1 { background: rgba(201,168,76,0.18); border-top: 2px solid rgba(201,168,76,0.6); top: 0; }
.tl-journey-j2 { background: rgba(80,160,80,0.15); border-top: 2px solid rgba(80,160,80,0.55); top: 36px; }
.tl-journey-j3 { background: rgba(140,80,200,0.15); border-top: 2px solid rgba(140,80,200,0.55); top: 72px; }

.tl-journey-label {
  font-size: 0.65rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding: 0 8px;
  color: var(--text-dim);
}
.tl-journey-j1 .tl-journey-label { color: rgba(201,168,76,0.8); }
.tl-journey-j2 .tl-journey-label { color: rgba(80,160,80,0.8); }
.tl-journey-j3 .tl-journey-label { color: rgba(140,80,200,0.8); }

/* City markers */
.tl-city {
  position: absolute;
  top: -18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  cursor: default;
}
.tl-city-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.tl-city-name {
  font-size: 0.6rem;
  color: var(--text-dim);
  white-space: nowrap;
  margin-top: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-city.tight .tl-city-dot { background: rgba(204,85,85,0.7); }
.tl-city.tight .tl-city-name { color: rgba(204,85,85,0.7); }

/* Distance labels between cities */
.tl-dist {
  position: absolute;
  top: -12px;
  font-size: 0.58rem;
  color: var(--text-dim);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  opacity: 0.7;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Debate flag */
.tl-debate-flag {
  position: absolute;
  top: -32px;
  font-size: 0.62rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: rgba(204,85,85,0.85);
  white-space: nowrap;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}
.tl-debate-flag::before { content: '\u26A0'; }

/* Year tick marks on axis */
.tl-year-tick {
  position: absolute;
  top: -8px;
  font-size: 0.58rem;
  color: var(--text-dim);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transform: translateX(-50%);
  opacity: 0.6;
}

.tl-journey-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.tl-legend-dot {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tl-legend-dot::before { content: ''; display: block; width: 8px; height: 8px; border-radius: 50%; }
.tl-legend-paul::before { background: rgba(201,168,76,0.6); }
.tl-legend-j2::before { background: rgba(80,160,80,0.6); }
.tl-legend-j3::before { background: rgba(140,80,200,0.6); }
.tl-legend-tight::before { background: rgba(204,85,85,0.7); }

.tl-source-note {
  font-size: 0.67rem;
  color: var(--text-dim);
  font-style: italic;
  font-family: var(--font);
  margin-top: 4px;
  opacity: 0.8;
}

/* Bible timeline list */
.tl-date-toggle {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-family: var(--font);
  padding: 2px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.03em;
}
.tl-date-toggle:hover { border-color: var(--gold-dark); color: var(--gold); }

.tl-bible-list { display: flex; flex-direction: column; gap: 0; }

.tl-event {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 0.78rem;
  font-family: var(--font);
}
.tl-event:last-child { border-bottom: none; }

.tl-event-year { color: var(--gold-dark); font-style: italic; padding-right: 16px; text-align: right; flex-shrink: 0; }
.tl-event-text { color: var(--text-dim); line-height: 1.4; }
.tl-event-text strong { color: var(--text); font-weight: 500; }

.tl-swipe-hint {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  padding: 6px 0 8px;
  font-style: italic;
  opacity: 0.6;
  display: none;
}

@media (max-width: 768px) {
  .tl-swipe-hint { display: block; }
  #timeline-panel { max-height: 75vh; }
  .tl-body { padding: 12px 16px 16px; }
  .tl-header { padding: 14px 16px 10px; }
}