.timeline-panel {
  margin-top: 14px;
  padding: 34px 30px 30px;
  background: rgba(10, 20, 36, 0.82);
  box-shadow: 0 28px 90px rgba(5, 12, 24, 0.34);
  animation: rise-in 980ms ease-out both;
}

.timeline-panel h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.timeline-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.timeline-shell {
  margin-top: 0;
  padding: 40px 14px 34px;
}

.timeline-track {
  position: relative;
  min-height: 180px;
  border-radius: 999px;
  background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.12)),
      var(--timeline-gradient),
      rgba(255, 246, 221, 0.12);
  overflow: visible;
  isolation: isolate;
}

.timeline-track::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 999px;
  background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
      var(--timeline-gradient);
  opacity: 0.9;
}

.timeline-fill {
  position: absolute;
  inset: 50% auto auto 0;
  height: 12px;
  width: 0;
  transform: translateY(-50%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.02)),
    var(--timeline-gradient);
  box-shadow: 0 0 22px rgba(255, 198, 108, 0.4);
  transition: width 800ms linear;
}

.timeline-fill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 244, 212, 0.55);
  border-radius: 50%;
  background: rgba(11, 22, 38, 0.55);
  transform: translate(-35%, -50%);
  box-shadow: 0 0 16px rgba(255, 210, 122, 0.12);
}

.timeline-needle {
  position: absolute;
  inset: 22px auto 22px 0;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, var(--accent) 14%, var(--accent) 86%, transparent 100%);
  box-shadow: 0 0 18px rgba(255, 210, 122, 0.65);
  transition: left 800ms linear;
}

.timeline-civil-time {
  position: absolute;
  left: 50%;
  top: -10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 244, 212, 0.2);
  border-radius: 12px;
  background: rgba(8, 18, 30, 0.88);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(5, 12, 24, 0.28);
}

.timeline-civil-date {
  position: absolute;
  left: 50%;
  bottom: -10px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 244, 212, 0.05);
  border-radius: 12px;
  background: rgba(8, 18, 30, 0.46);
  color: rgba(247, 242, 232, 0.44);
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 10px rgba(5, 12, 24, 0.1);
}

.timeline-needle.edge-left .timeline-civil-time {
  left: 0;
  transform: translate(0, -100%);
}

.timeline-needle.edge-left .timeline-civil-date {
  left: 0;
  transform: translate(0, 100%);
}

.timeline-needle.edge-right .timeline-civil-time {
  left: 0;
  transform: translate(-100%, -100%);
}

.timeline-needle.edge-right .timeline-civil-date {
  left: 0;
  transform: translate(-100%, 100%);
}

.timeline-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #fff4d3;
  border-radius: 50%;
  background: var(--accent-strong);
  transform: translate(-50%, -50%);
}

.timeline-markers {
  position: absolute;
  inset: 0;
}

.timeline-loop-return {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

.timeline-loop-return::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255, 244, 212, 0.58);
  border-radius: 50%;
  background: rgba(17, 35, 59, 0.18);
  box-shadow:
    0 0 0 6px rgba(255, 210, 122, 0.04),
    0 0 12px rgba(255, 210, 122, 0.06);
}

.timeline-loop-return::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid rgba(255, 244, 212, 0.42);
  transform: translateY(-50%);
  filter: drop-shadow(0 0 6px rgba(255, 210, 122, 0.12));
}

.timeline-midnight {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 44%;
  background: linear-gradient(180deg, transparent 0%, rgba(198, 220, 255, 0.72) 20%, rgba(214, 230, 255, 0.78) 80%, transparent 100%);
  box-shadow: 0 0 10px rgba(186, 210, 255, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.timeline-threshold {
  position: absolute;
  top: 50%;
  height: 76%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(156, 193, 255, 0.06) 0%, rgba(197, 220, 255, 0.22) 22%, rgba(255, 236, 175, 0.26) 82%, rgba(255, 236, 175, 0.18) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 28px rgba(163, 198, 255, 0.18);
  transform: translateY(-50%);
  pointer-events: none;
}

.timeline-threshold::before {
  content: "";
  position: absolute;
  inset: 5% auto 5% 0;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(218, 234, 255, 0.92) 20%, rgba(255, 244, 212, 0.95) 80%, transparent 100%);
  box-shadow: 0 0 18px rgba(205, 228, 255, 0.45);
}

.timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0;
}

.timeline-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 244, 212, 0.95);
  border-radius: 50%;
  background: #173048;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 6px rgba(255, 210, 122, 0.09);
}

.timeline-marker.current::before {
  background: var(--accent-strong);
}

.timeline-marker.start-marker::before {
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255, 244, 212, 0.98);
  background: rgba(17, 35, 59, 0.92);
  box-shadow:
    0 0 0 6px rgba(255, 210, 122, 0.12),
    0 0 18px rgba(255, 210, 122, 0.14);
}

.timeline-marker.start-marker.current::before {
  background: var(--accent-strong);
}

.timeline-marker.end-marker::before {
  width: 10px;
  height: 10px;
  border-color: rgba(255, 234, 201, 0.72);
  background: rgba(64, 52, 58, 0.82);
  box-shadow: 0 0 0 5px rgba(255, 210, 122, 0.05);
}

.timeline-marker.end-marker .marker-label {
  background: rgba(7, 16, 29, 0.26);
  border-color: rgba(255, 255, 255, 0.06);
}

.timeline-marker.end-marker .marker-name {
  color: rgba(255, 244, 220, 0.74);
}

.timeline-marker.end-marker .marker-time {
  color: rgba(255, 244, 220, 0.62);
}

.timeline-marker.annotation-marker::before {
  width: 8px;
  height: 8px;
  border-color: rgba(255, 244, 212, 0.56);
  background: rgba(31, 55, 86, 0.52);
  box-shadow: 0 0 0 3px rgba(255, 244, 212, 0.03);
}

.timeline-marker.annotation-marker .marker-label {
  background: rgba(7, 16, 29, 0.16);
  border-color: rgba(255, 255, 255, 0.035);
  box-shadow: 0 6px 14px rgba(5, 12, 24, 0.1);
}

.timeline-marker.annotation-marker .marker-name {
  color: rgba(255, 244, 220, 0.68);
  font-size: 0.86rem;
}

.timeline-marker.annotation-marker .marker-time {
  color: rgba(255, 244, 220, 0.56);
  font-size: 0.76rem;
}

.timeline-marker.threshold-point::before {
  width: 10px;
  height: 10px;
  border-color: rgba(235, 244, 255, 0.98);
  background: #406390;
  box-shadow:
    0 0 0 8px rgba(193, 222, 255, 0.12),
    0 0 18px rgba(214, 232, 255, 0.16);
}

.marker-label {
  position: absolute;
  left: 50%;
  display: grid;
  gap: 3px;
  min-width: 94px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(7, 16, 29, 0.42);
  box-shadow: 0 10px 24px rgba(5, 12, 24, 0.18);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
  text-align: center;
}

.timeline-marker.above .marker-label {
  bottom: 18px;
}

.timeline-marker.below .marker-label {
  top: 18px;
}

.marker-name {
  color: #fff8ea;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.marker-time {
  color: rgba(255, 244, 220, 0.92);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (max-width: 980px) {
  .timeline-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .timeline-shell {
    overflow-x: auto;
    overflow-y: visible;
    padding: 40px 28px 34px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 210, 122, 0.4) rgba(8, 18, 30, 0.28);
    -webkit-overflow-scrolling: touch;
    touch-action: auto;
  }

  .timeline-track {
    min-height: 190px;
    min-width: 760px;
  }

  .timeline-shell::-webkit-scrollbar {
    height: 12px;
  }

  .timeline-shell::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(8, 18, 30, 0.26);
  }

  .timeline-shell::-webkit-scrollbar-thumb {
    border: 2px solid rgba(8, 18, 30, 0.18);
    border-radius: 999px;
    background: rgba(255, 210, 122, 0.38);
  }

  .timeline-civil-time {
    font-size: 0.74rem;
    padding: 6px 8px;
  }

  .timeline-civil-date {
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .marker-label {
    min-width: 76px;
    padding: 7px 8px;
  }

  .marker-name {
    font-size: 0.8rem;
  }

  .marker-time {
    font-size: 0.74rem;
  }
}
