.historical-timeline {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  z-index: 8;
  transform: translateY(-50%);
  border: 1px solid rgba(93, 105, 122, 0.92);
  border-radius: 14px;
  background: rgba(10, 14, 21, 0.95);
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  touch-action: none;
  cursor: default;
  transition: top 0.08s linear, border-color 0.18s ease, box-shadow 0.18s ease;
}

.historical-timeline.is-docked-top,
.historical-timeline.is-docked-bottom {
  border-color: rgba(239, 124, 53, 0.72);
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.76), 0 0 0 1px rgba(239, 124, 53, 0.13) inset;
}

.historical-timeline.is-scrubbing {
  border-color: #ef7c35;
  cursor: ew-resize;
}

.timeline-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 8px 7px 13px;
  border-bottom: 1px solid rgba(48, 57, 71, 0.92);
  background: linear-gradient(90deg, rgba(27, 34, 45, 0.98), rgba(13, 18, 26, 0.98));
  border-radius: 13px 13px 0 0;
}

.timeline-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.timeline-heading > span {
  color: #ef7c35;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-heading > strong {
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.timeline-heading > small {
  min-width: 0;
  overflow: hidden;
  color: #9aa6b7;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.timeline-actions button {
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #3c4655;
  border-radius: 8px;
  background: #202733;
  color: #e7ebf2;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.timeline-actions button:hover,
.timeline-actions button:focus {
  border-color: #ef7c35;
  background: #30231c;
  outline: none;
}

#timelineClear {
  border-color: #75472e;
  background: #2b1b13;
  color: #ffd6ba;
}

#timelineCollapse {
  width: 32px;
  padding: 0;
  font-size: 17px;
}

.timeline-body {
  padding: 5px 13px 7px;
}

.timeline-body[hidden] {
  display: none;
}

.timeline-track {
  position: relative;
  height: 91px;
  margin: 0 15px;
  outline: none;
  cursor: ew-resize;
  -webkit-tap-highlight-color: transparent;
}

.timeline-track:focus-visible {
  border-radius: 8px;
  box-shadow: 0 0 0 2px #ef7c35;
}

.timeline-track::before {
  content: '';
  position: absolute;
  left: -28px;
  right: -28px;
  top: 42px;
  height: 10px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(239, 124, 53, 0.12) 4%, rgba(239, 124, 53, 0.12) 96%, transparent);
  pointer-events: none;
}

.timeline-track::after {
  content: '';
  position: absolute;
  left: -15px;
  right: -15px;
  top: 41px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #758169, #a2a982 18%, #718264 52%, #a09269 75%, #72836a);
  box-shadow: 0 0 0 1px rgba(7, 10, 14, 0.86), 0 0 16px rgba(137, 151, 108, 0.28);
  pointer-events: none;
}

.timeline-density {
  position: absolute;
  inset: 20px 0 19px;
  width: 100%;
  height: 29px;
  pointer-events: none;
}

.timeline-era-layer,
.timeline-ticks,
.timeline-milestones,
.timeline-roots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.timeline-era {
  position: absolute;
  top: 1px;
  height: 15px;
  min-width: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(0, 0, 0, 0.34);
  border-radius: 3px;
  background: rgba(114, 131, 106, 0.16);
}

.timeline-era:nth-child(even) {
  background: rgba(239, 124, 53, 0.09);
}

.timeline-era span {
  position: absolute;
  left: 4px;
  top: 2px;
  max-width: calc(100% - 8px);
  overflow: hidden;
  color: #8f9a88;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-range {
  position: absolute;
  top: 37px;
  z-index: 2;
  min-width: 5px;
  height: 11px;
  border: 1px solid #ffae75;
  border-radius: 999px;
  background: rgba(239, 124, 53, 0.58);
  box-shadow: 0 0 16px rgba(239, 124, 53, 0.52);
  pointer-events: none;
}

.timeline-range[hidden] {
  display: none;
}

.timeline-tick {
  position: absolute;
  top: 37px;
  width: 1px;
  height: 28px;
  transform: translateX(-50%);
}

.timeline-tick i {
  display: block;
  width: 1px;
  height: 10px;
  background: rgba(211, 220, 230, 0.68);
}

.timeline-tick b {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  color: #aeb8c6;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.timeline-milestones {
  z-index: 4;
}

.timeline-roots {
  z-index: 4;
}

.timeline-root-marker {
  position: absolute;
  top: calc(63px + var(--root-row) * 10px);
  width: 18px;
  height: 18px;
  padding: 0;
  transform: translateX(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.timeline-root-marker span {
  position: absolute;
  inset: 4px;
  border: 1px solid #9ba58e;
  border-radius: 50%;
  background: #53604f;
  box-shadow: 0 0 0 2px #10151d;
}

.timeline-root-marker b {
  position: absolute;
  left: 12px;
  top: -2px;
  display: grid;
  place-items: center;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border: 1px solid #3f4a58;
  border-radius: 999px;
  background: #171d26;
  color: #cfd6df;
  font-size: 7px;
  line-height: 1;
}

.timeline-root-marker.is-in-range span,
.timeline-root-marker:hover span,
.timeline-root-marker:focus span,
.timeline-root-marker.is-active span {
  border-color: #ffc39b;
  background: #ef7c35;
  box-shadow: 0 0 0 2px #2a170e, 0 0 13px rgba(239, 124, 53, 0.74);
}

.timeline-root-marker:hover,
.timeline-root-marker:focus {
  outline: none;
  z-index: 6;
}

.timeline-milestone {
  position: absolute;
  top: 29px;
  width: 24px;
  height: 25px;
  padding: 0;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.timeline-milestone span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border: 2px solid #111722;
  border-radius: 50%;
  background: #d4d9c4;
  box-shadow: 0 0 0 1px #7d886f;
}

.timeline-milestone.importance-3 span {
  width: 11px;
  height: 11px;
  border-color: #2a160d;
  background: #ef7c35;
  box-shadow: 0 0 0 1px #ffba88, 0 0 13px rgba(239, 124, 53, 0.62);
}

.timeline-milestone b {
  position: absolute;
  left: 50%;
  bottom: 21px;
  transform: translateX(-50%);
  padding: 2px 4px;
  border-radius: 4px;
  background: #121821;
  color: #cbd2dc;
  font-size: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.timeline-milestone:hover b,
.timeline-milestone:focus b,
.timeline-milestone.is-active b {
  transform: translate(-50%, -2px);
  opacity: 1;
}

.timeline-milestone:focus {
  outline: none;
}

.timeline-milestone:focus span,
.timeline-milestone.is-active span {
  box-shadow: 0 0 0 3px rgba(239, 124, 53, 0.28), 0 0 18px rgba(239, 124, 53, 0.76);
}

.timeline-scrubber {
  position: absolute;
  top: 22px;
  bottom: 3px;
  z-index: 5;
  width: 1px;
  transform: translateX(-50%);
  border-left: 2px solid #ff8a43;
  pointer-events: none;
}

.timeline-scrubber > span {
  position: absolute;
  left: -7px;
  top: 13px;
  width: 14px;
  height: 14px;
  border: 3px solid #1a0f09;
  border-radius: 50%;
  background: #ff8a43;
  box-shadow: 0 0 0 2px #ffbb8e, 0 0 18px rgba(239, 124, 53, 0.82);
}

.timeline-scrubber > strong {
  position: absolute;
  left: 0;
  top: -5px;
  transform: translateX(-50%);
  padding: 4px 6px;
  border: 1px solid #8b5433;
  border-radius: 6px;
  background: #26170f;
  color: #ffe0ca;
  font-size: 9px;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
}

.timeline-tenures {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin: 1px 15px 0;
  padding-top: 4px;
  border-top: 1px solid rgba(52, 62, 76, 0.76);
}

.timeline-tenures[hidden] {
  display: none;
}

.timeline-tenure-heading {
  min-width: 0;
}

.timeline-tenure-heading span,
.timeline-tenure-heading small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-tenure-heading span {
  color: #f0f3f7;
  font-size: 10px;
  font-weight: 850;
}

.timeline-tenure-heading small {
  margin-top: 2px;
  color: #7f8b9d;
  font-size: 7px;
  text-transform: uppercase;
}

.timeline-tenure-track {
  position: relative;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

.timeline-tenure-track::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 1px;
  background: #414b58;
  pointer-events: none;
}

.timeline-tenure {
  position: absolute;
  top: calc(2px + var(--tenure-row) * 13px);
  z-index: 1;
  min-width: 8px;
  height: 11px;
  overflow: hidden;
  padding: 0 4px;
  border: 1px solid #b86b3e;
  border-radius: 999px;
  background: #56311f;
  color: #ffe0ca;
  cursor: pointer;
  font-size: 7px;
  font-weight: 800;
  line-height: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-tenure:hover,
.timeline-tenure:focus {
  border-color: #ffad75;
  background: #784127;
  outline: none;
  z-index: 3;
}

.timeline-note {
  margin: 2px 15px 0;
  color: #6f7a8a;
  font-size: 7px;
  text-align: right;
}

.timeline-milestone-card,
.timeline-root-card {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 22;
  width: min(390px, calc(100vw - 34px));
  padding: 14px 42px 14px 15px;
  transform: translateX(-50%);
  border: 1px solid #68503e;
  border-left: 4px solid #ef7c35;
  border-radius: 12px;
  background: #121821;
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.84);
}

.historical-timeline.is-docked-top .timeline-milestone-card {
  top: calc(100% + 8px);
  bottom: auto;
}

.historical-timeline.is-docked-top .timeline-root-card {
  top: calc(100% + 8px);
  bottom: auto;
}

.timeline-milestone-card[hidden],
.timeline-root-card[hidden] {
  display: none;
}

.timeline-milestone-card > button:first-child {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #252d38;
  color: #cbd2dc;
  cursor: pointer;
  font-size: 20px;
}

.timeline-milestone-card > span {
  display: block;
  margin-bottom: 4px;
  color: #ef7c35;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-milestone-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}

.timeline-milestone-card p {
  margin: 7px 0 0;
  color: #c8d0dc;
  font-size: 11px;
  line-height: 1.45;
}

.timeline-milestone-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.timeline-milestone-card > div button,
.timeline-milestone-card > div a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid #75472e;
  border-radius: 7px;
  background: #342117;
  color: #ffd7bc;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.timeline-root-card > button:first-child {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #252d38;
  color: #cbd2dc;
  cursor: pointer;
  font-size: 20px;
}

.timeline-root-card > span {
  display: block;
  margin-bottom: 3px;
  color: #ef7c35;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-root-card h2 {
  margin: 0;
  font-size: 20px;
}

.timeline-root-card > p {
  margin: 4px 0 9px;
  color: #9ca8b8;
  font-size: 9px;
  line-height: 1.4;
}

.timeline-root-list {
  display: grid;
  gap: 5px;
  max-height: min(250px, 42vh);
  overflow: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.timeline-root-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid #303a48;
  border-radius: 8px;
  background: #181f28;
  overflow: hidden;
}

.timeline-root-list button {
  min-width: 0;
  min-height: 35px;
  padding: 0 9px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #f1f4f8;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-root-list a {
  display: grid;
  place-items: center;
  min-height: 35px;
  padding: 0 9px;
  border-left: 1px solid #303a48;
  color: #e69a69;
  font-size: 8px;
  font-weight: 750;
  text-decoration: none;
}

.timeline-root-list button:hover,
.timeline-root-list button:focus,
.timeline-root-list a:hover,
.timeline-root-list a:focus {
  background: #252e3a;
  outline: none;
}

.timeline-root-apply {
  min-height: 33px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid #75472e;
  border-radius: 7px;
  background: #342117;
  color: #ffd7bc;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.timeline-milestone-card > div a {
  border-color: #3c4654;
  background: #202731;
  color: #d9dfe7;
}

.historical-timeline.is-collapsed {
  left: 50%;
  right: auto;
  width: min(620px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
}

.historical-timeline.is-collapsed .timeline-header {
  border-bottom: 0;
  border-radius: 13px;
}

@media (max-width: 900px) {
  .timeline-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .timeline-heading > small {
    display: none;
  }

  .timeline-heading > strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .timeline-era span {
    display: none;
  }
}

@media (max-width: 720px) {
  .historical-timeline {
    left: 6px;
    right: 6px;
    border-radius: 12px;
  }

  .timeline-header {
    min-height: 44px;
    gap: 7px;
    padding: 6px 6px 6px 10px;
    border-radius: 11px 11px 0 0;
  }

  .timeline-heading {
    display: block;
  }

  .timeline-heading > span {
    display: block;
    max-width: 150px;
    overflow: hidden;
    font-size: 7px;
    text-overflow: ellipsis;
  }

  .timeline-heading > strong {
    display: block;
    margin-top: 2px;
    font-size: 14px;
  }

  .timeline-actions {
    gap: 3px;
  }

  .timeline-actions button {
    min-width: 36px;
    height: 36px;
    padding: 0 7px;
    font-size: 9px;
  }

  #timelineClear {
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timeline-body {
    padding: 3px 6px 6px;
  }

  .timeline-track {
    height: 85px;
    margin: 0 18px;
  }

  .timeline-track::before {
    left: -24px;
    right: -24px;
  }

  .timeline-milestone b,
  .timeline-note {
    display: none;
  }

  .timeline-tenures {
    grid-template-columns: 92px minmax(0, 1fr);
    margin: 0 12px;
  }

  .timeline-tenure-heading span {
    font-size: 9px;
  }

  .timeline-milestone-card,
  .timeline-root-card {
    width: calc(100vw - 16px);
    padding: 13px 40px 13px 13px;
  }

  .historical-timeline.is-collapsed {
    width: calc(100vw - 12px);
  }

  .has-coach-explorer .historical-timeline {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .historical-timeline,
  .timeline-milestone b {
    transition: none;
  }
}
