#map {
  --map-reference: #c6a9ff;
  --map-edit: #ff9ba7;
  --map-resolution: #cef77b;
  --map-video: #74e0ff;
}
.timeline {
  --map-bg: #111225;
  --map-ink: #f4f0ff;
  --map-muted: #b0b4d5;
  --map-line: #343859;
  border: 1px solid #343658;
  border-radius: 16px;
  color: var(--map-ink);
  background:
    radial-gradient(ellipse at 96% 0%, #2b2452 0%, transparent 53%),
    radial-gradient(ellipse at 0% 95%, #18243b 0%, transparent 56%),
    var(--map-bg);
}
.map-mobile { display: none; }
.chart {
  padding: 12px 18px 14px;
}
.chart-row {
  display: grid;
  grid-template-columns: 162px minmax(0, 1fr);
  min-height: 43px;
  border-bottom: 1px solid var(--map-line);
}
.chart-row:last-child { border-bottom: 0; }
.chart-label {
  display: grid;
  align-content: center;
  align-items: center;
  gap: 5px;
  border-right: 1px solid var(--map-line);
  padding: 8px 12px 8px 4px;
  font-size: .86rem;
  font-weight: 650;
}
.chart-label span:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chart-label span:first-child::before {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--axis, #737797);
}
.chart-label small {
  padding-left: 15px;
  color: var(--map-muted);
  font-size: .72rem;
  font-weight: 400;
}
.chart-row.empty .chart-label { color: var(--map-muted); font-weight: 500; }
.chart-head .chart-label { color: var(--map-muted); font-size: .74rem; }
.chart-head .chart-label span:first-child::before { display: none; }
.timeline .ref, .map-axis-key .ref { --axis: var(--map-reference); }
.timeline .edit, .map-axis-key .edit { --axis: var(--map-edit); }
.timeline .res, .map-axis-key .res { --axis: var(--map-resolution); }
.timeline .vid, .map-axis-key .vid { --axis: var(--map-video); }
.lane, .scale {
  position: relative;
  isolation: isolate;
  margin-inline: 10px 7px;
}
.chart .scale { min-height: 58px; color: var(--map-muted); }
.map-year-band {
  position: absolute;
  z-index: -3;
  inset: 0 auto 0 var(--left);
  width: var(--span);
  border-inline-start: 1px solid #4f527a;
  background: #7394f00d;
  pointer-events: none;
}
.map-year-band.later { background: #b395ff16; }
.map-year-label {
  position: absolute;
  top: 2px;
  left: calc(var(--left) + 7px);
  color: #f2eaff;
  font: 600 .93rem/1.3 "Segoe UI", Arial, sans-serif;
  letter-spacing: .04em;
}
.tick {
  position: absolute;
  z-index: -2;
  inset: 0 auto 0 var(--x);
  border-left: 1px solid #45496b;
  pointer-events: none;
}
.tick-text {
  position: absolute;
  top: 34px;
  left: var(--x);
  transform: translateX(-50%);
  white-space: nowrap;
}
.lane::before {
  content: "";
  position: absolute;
  inset: 16px 3% auto 3%;
  border-top: 1px solid #65698b;
  pointer-events: none;
}
.chart-row.empty .lane::before { border-top-style: dashed; opacity: .55; top: 50%; }
.mark {
  position: absolute;
  z-index: 1;
  top: var(--y);
  left: var(--x);
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--axis);
  background: transparent;
}
.mark::before {
  content: "";
  width: 11px;
  height: 11px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #1b1d35;
}
.mark.with-example::before {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.mark.documentation::before, .map-mobile-dot.documentation {
  border-radius: 1px;
  transform: rotate(45deg);
}
.mark:hover, .mark[aria-pressed="true"] {
  border-color: currentColor;
  background: #101126;
  box-shadow: 0 0 13px color-mix(in srgb, var(--axis) 48%, transparent);
}
.map-stem {
  position: absolute;
  left: var(--x);
  inset-block: var(--from) auto;
  height: var(--length);
  border-left: 1px solid var(--axis);
  opacity: .62;
  pointer-events: none;
}
.map-feature {
  position: absolute;
  top: var(--top);
  left: clamp(2px, calc(var(--x) - 68px), calc(100% - min(235px, 44%) - 4px));
  width: min(235px, 44%);
  min-height: 50px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border: 1px solid color-mix(in srgb, var(--axis) 45%, #222440);
  border-radius: 8px;
  text-align: left;
  background: #17192c;
  color: var(--map-ink);
}
.map-feature:hover, .map-feature.is-current { border-color: var(--axis); background: #242642; }
.map-feature :is(img, video, .mj-preview-placeholder) {
  display: block;
  width: 70px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
}
.map-feature .mj-thumb-play, .map-mobile-thumbnail .mj-thumb-play {
  inset: auto auto 2px 2px;
  transform: none;
}
.map-feature .mj-thumb-expand, .map-mobile-thumbnail .mj-thumb-expand {
  inset: 2px 2px auto auto;
}
.timeline :is(.map-feature, .map-mobile-thumbnail) .mj-preview-trigger {
  display: grid;
  place-items: center;
  width: 23px;
  height: 22px;
  padding: 0;
  color: #20211e;
  line-height: 1;
}
.timeline :is(.map-feature, .map-mobile-thumbnail) .mj-inline-trigger {
  border-color: #4f5272;
  background: #202239;
  color: #fffef9;
}
.map-feature-copy { display: grid; gap: 3px; min-width: 0; }
.map-feature-copy time {
  color: var(--axis);
  font: 600 .64rem/1.15 ui-monospace, Consolas, monospace;
  white-space: nowrap;
}
.map-feature-copy strong { font-size: .73rem; line-height: 1.16; }
.timeline button:focus-visible, .timeline > .map-desktop:focus-visible {
  outline: 2px solid #f5eaff;
  outline-offset: 2px;
}
.map-axis-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 12px;
  color: var(--sub);
  font-size: .8rem;
}
.map-axis-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.map-axis-key span::before {
  content: "";
  width: 8px;
  height: 8px;
  box-sizing: content-box;
  flex: 0 0 auto;
  border: 3px solid #24233d;
  border-radius: 50%;
  background: var(--axis);
}
@container archive (max-width: 844px) {
  #map .map-desktop { display: none; }
  .map-mobile { display: block; padding: clamp(10px, 3.4cqi, 22px); }
  .map-mobile-years {
    display: flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 13px;
    border: 1px solid #494969;
    border-radius: 10px;
    background: #111225;
  }
  .map-mobile-years button {
    flex: 1 1 0;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #d3d4ed;
    font-weight: 650;
  }
  .map-mobile-years button:hover { background: #2d2c4a; }
  .map-mobile-years button[aria-pressed="true"] {
    border-color: #cbc0fa;
    background: #e8e0ff;
    color: #241c3d;
  }
  .map-mobile-period { display: grid; gap: 9px; }
  .map-mobile-cluster {
    display: grid;
    margin: 0;
    padding: 2px 0;
    border: 1px solid #464765;
    border-radius: 9px;
    background: #191b30;
  }
  .map-mobile-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0 5px;
    padding: 3px 6px;
  }
  .map-mobile-row + .map-mobile-row { border-top: 1px solid #343752; }
  .map-mobile-row:not(:only-child)::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 1px;
    background: #555877;
    pointer-events: none;
  }
  .map-mobile-row:first-child::before { top: 30px; }
  .map-mobile-row:last-child::before { bottom: auto; height: 30px; }
  .map-mobile-trigger {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px;
    min-width: 0;
    min-height: 54px;
    padding: 8px 6px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--map-ink);
    text-align: left;
  }
  .map-mobile-trigger:hover, .map-mobile-trigger[aria-expanded="true"] {
    border-color: #575675;
    background: #262841;
  }
  .map-mobile-trigger::after {
    content: "";
    width: 6px;
    height: 6px;
    margin: 13px 2px 0 0;
    border: solid #c4c1dc;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }
  .map-mobile-trigger[aria-expanded="true"]::after { transform: rotate(225deg); }
  .map-mobile-dot {
    justify-self: center;
    width: 12px;
    height: 12px;
    margin-top: 12px;
    border: 2px solid var(--axis);
    border-radius: 50%;
    background: #191b30;
  }
  .map-mobile-dot.with-example {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--axis);
    transform: rotate(45deg);
  }
  .map-mobile-copy { display: grid; gap: 3px; overflow-wrap: anywhere; }
  .map-mobile-copy strong { font-size: .91rem; font-weight: 650; line-height: 1.28; }
  .map-mobile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    color: var(--map-muted);
    font-size: .73rem;
    line-height: 1.25;
  }
  .map-mobile-meta time { color: var(--axis); font-weight: 750; white-space: nowrap; }
  .map-mobile-thumbnail {
    position: relative;
    width: clamp(48px, 16cqi, 80px);
    height: 46px;
    margin: 5px 0;
    padding: 2px;
    border: 1px solid #646482;
    border-radius: 6px;
    background: #292c45;
  }
  .map-mobile-thumbnail .mj-preview-thumb { height: 100%; }
  .map-mobile-thumbnail :is(img, video, .mj-preview-placeholder) {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: cover;
  }
  #map .map-mobile-detail {
    z-index: 1;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    padding: 12px;
    margin: 4px 0 7px 6px;
    border-color: #494969;
    border-radius: 7px;
    color: var(--ink);
  }
  .map-mobile-detail .no-media { display: none; }
  .map-mobile-detail .actions a, .map-mobile-detail .quiet-button { min-height: 44px; }
  .map-mobile-detail .event-meta, .map-mobile-detail h3 { display: none; }
  .map-mobile-detail button:focus-visible { outline-color: #245e9e; }
}
@media (prefers-reduced-motion: no-preference) {
  .mark, .map-feature { transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
}
