/* ─── HD Timeline Component ─── */
.hdt-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding: 12px 16px;
  background: var(--bg-surface, #12141a);
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border);
}
.hdt-zoom-controls {
  display: flex;
  gap: 4px;
}
.hdt-zoom-btn {
  padding: 6px 14px;
  background: var(--bg-primary, #0a0a0f);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary, #e8e8ec);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.hdt-zoom-btn:hover {
  border-color: var(--accent, #3b82f6);
}
.hdt-zoom-btn.hdt-active {
  background: var(--accent, #3b82f6);
  border-color: var(--accent, #3b82f6);
}
.hdt-detail-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.hdt-detail-label {
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  margin-right: 4px;
}
.hdt-detail-btn {
  padding: 6px 12px;
  background: var(--bg-primary, #0a0a0f);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary, #e8e8ec);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.hdt-detail-btn:hover {
  border-color: var(--accent, #3b82f6);
}
.hdt-detail-btn.hdt-active {
  background: var(--accent, #3b82f6);
  border-color: var(--accent, #3b82f6);
}
.hdt-detail-btn.hdt-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.hdt-center-btn {
  padding: 6px 16px;
  background: #ef4444;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hdt-center-btn:hover {
  filter: brightness(1.1);
}
.hdt-time-display {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted, #888);
}
.hdt-marker-datetime {
  color: var(--text-secondary, #aaa);
}
.hdt-time-display strong {
  color: var(--text-primary, #e8e8ec);
}
.hdt-timeline-container {
  background: var(--bg-surface, #12141a);
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--border);
  border-top: none;
  overflow: hidden;
  width: 100%;
  touch-action: pan-y pinch-zoom;
}
.hdt-time-axis {
  height: 40px;
  background: var(--bg-primary, #0a0a0f);
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding-left: 86px;  /* matches .hdt-planet-label width */
  overflow: hidden;
}
.hdt-time-tick {
  position: absolute;
  bottom: 0;
  font-size: 0.65rem;
  color: var(--text-muted, #888);
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}
.hdt-time-tick::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 1px;
  height: 8px;
  background: var(--border);
}
.hdt-time-tick.hdt-major::before {
  height: 14px;
  background: var(--text-muted, #888);
}
.hdt-tracks-container {
  position: relative;
}
.hdt-planet-track {
  display: flex;
  height: 36px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.hdt-planet-track:last-child {
  border-bottom: none;
}
.hdt-planet-label {
  /* Tighten the planet column: pull the glyph + name close to the left
     edge of the row, and shrink the column so the timeline strip gets
     more horizontal space. Eva 2026-05-12. */
  width: 86px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 6px;
  background: var(--bg-primary, #0a0a0f);
  border-right: 1px solid var(--border);
  font-size: 0.65rem;
}
.hdt-planet-symbol {
  font-size: 0.75rem;   /* was 1rem — glyphs sat much larger than the name */
  width: 14px;          /* was 22px — matches the new compact glyph size */
  text-align: center;
  flex-shrink: 0;
}
.hdt-planet-name {
  color: var(--text-muted, #888);
  font-size: 0.7rem;    /* explicit so it overrides the parent's 0.65rem default if any sub-rule bumps it */
  white-space: nowrap;
}
.hdt-track-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}
.hdt-track-area:active {
  cursor: grabbing;
}
.hdt-track-segments {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  will-change: transform;
}
.hdt-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  overflow: hidden;
  white-space: nowrap;
  border-right: 1px solid rgba(0,0,0,0.2);
  position: relative;
  box-sizing: border-box;
  border-bottom: 3px solid transparent;
  /* Soften the saturated circuit-palette fills so the timeline doesn't
     read as a wall of vibrant blocks. Hover restores full intensity so
     the user can still pop a segment they're focusing on. */
  opacity: 0.7;
  filter: saturate(0.85);
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.hdt-segment:hover {
  opacity: 1;
  filter: none;
}
/* Color value tinting (1-6) — applied via inline style or data attribute */
.hdt-segment[data-hd-color="1"] { border-left: 2px solid rgba(76, 175, 80, 0.7); }
.hdt-segment[data-hd-color="2"] { border-left: 2px solid rgba(229, 57, 53, 0.7); }
.hdt-segment[data-hd-color="3"] { border-left: 2px solid rgba(156, 39, 176, 0.7); }
.hdt-segment[data-hd-color="4"] { border-left: 2px solid rgba(255, 235, 59, 0.7); }
.hdt-segment[data-hd-color="5"] { border-left: 2px solid rgba(66, 165, 245, 0.7); }
.hdt-segment[data-hd-color="6"] { border-left: 2px solid rgba(156, 39, 176, 0.7); }
/* Yin/Yang bottom border for I Ching line representation */
.hdt-segment.hdt-line-yang {
  border-bottom: 3px solid rgba(255, 255, 255, 0.6);
}
.hdt-segment.hdt-line-yin {
  border-bottom: 3px dashed rgba(255, 255, 255, 0.4);
}
.hdt-segment:hover {
  filter: brightness(1.1);
}
.hdt-segment-label {
  padding: 0 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.hdt-center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 0 8px #ef4444;
}
.hdt-center-label {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 1;
}
.hdt-scrub-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent, #3b82f6);
  z-index: 90;
  pointer-events: none;
  display: none;
}
.hdt-info-panel {
  padding: 12px;
  background: var(--bg-primary, #0a0a0f);
  border-top: 1px solid var(--border);
}
.hdt-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.hdt-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-surface, #12141a);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.hdt-info-symbol {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}
.hdt-info-details {
  flex: 1;
}
.hdt-info-gate {
  font-weight: 600;
  font-size: 0.85rem;
}
.hdt-info-line {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}
.hdt-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-primary, #0a0a0f);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}
.hdt-legend-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.hdt-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted, #888);
}
.hdt-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.hdt-legend-section-title {
  font-weight: 600;
  color: var(--text-secondary, #9a9690);
  margin-right: 4px;
  white-space: nowrap;
}
.hdt-legend-divider {
  width: 1px;
  height: 16px;
  background: var(--border, #2a2a38);
  margin: 0 4px;
  align-self: center;
}
.hdt-base-overlay {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.hdt-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-muted, #888);
}
/* Tooltip */
.hdt-tooltip {
  position: fixed;
  background: var(--bg-surface, #12141a);
  border: 1px solid var(--border, #252830);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.75rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  color: var(--text-primary, #e8e8ec);
}
.hdt-tooltip.hdt-visible {
  opacity: 1;
}
.hdt-tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.hdt-tooltip-time {
  color: var(--text-muted, #888);
  font-size: 0.7rem;
}
/* Popover */
.hdt-popover {
  position: fixed;
  background: var(--bg-surface, #12141a);
  border: 1px solid var(--border, #252830);
  border-radius: 12px;
  z-index: 1100;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: none;
  color: var(--text-primary, #e8e8ec);
}
.hdt-popover.hdt-visible {
  display: block;
}
.hdt-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #252830);
  background: var(--bg-primary, #0a0a0f);
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
}
.hdt-popover-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.hdt-popover-close {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.hdt-popover-close:hover {
  background: var(--border, #252830);
  color: var(--text-primary, #e8e8ec);
}
.hdt-popover-body {
  padding: 14px;
}
.hdt-popover-section {
  margin-bottom: 14px;
}
.hdt-popover-section:last-child {
  margin-bottom: 0;
}
.hdt-popover-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #3b82f6);
  margin-bottom: 4px;
}
.hdt-popover-keynote {
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 6px;
}
.hdt-popover-description {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  line-height: 1.5;
}
.hdt-popover-meta {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}
.hdt-popover-meta strong {
  color: var(--text-primary, #e8e8ec);
}
