@font-face {
  font-family: Newsreader;
  src: url("assets/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Atkinson;
  src: url("assets/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --navy: #061621;
  --surface: #0a202d;
  --raised: #0d2836;
  --ivory: #f1eee5;
  --muted: #c7d0cf;
  --copper: #e59062;
  --rule: rgba(207, 221, 218, 0.22);
  --focus: #ffcf62;
  color-scheme: dark;
  font-family: Atkinson, Arial, sans-serif;
  color: var(--ivory);
  background: var(--navy);
  font-size: 17px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
select {
  min-height: 44px;
}
button {
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 8px 15px;
  border-radius: 2px;
  transition:
    background 0.18s,
    border-color 0.18s;
}
button:hover {
  border-color: var(--copper);
  background: rgba(229, 144, 98, 0.09);
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
a {
  color: var(--copper);
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
select {
  background: var(--surface);
  color: var(--ivory);
  border: 1px solid var(--rule);
  padding: 8px 28px 8px 10px;
  max-width: 100%;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 450;
}
h1 {
  font-size: clamp(3.7rem, 7vw, 6.6rem);
  line-height: 1;
  margin-bottom: 18px;
  letter-spacing: -0.045em;
}
h2 {
  font-size: 2.4rem;
}
h3 {
  font-size: 1.6rem;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--copper);
  margin-bottom: 18px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: var(--navy);
  padding: 15px;
}
.skip:focus {
  top: 5px;
}
.masthead {
  max-width: 1440px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 48px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-family: Newsreader, Georgia, serif;
  font-size: 2rem;
  text-decoration: none;
  color: var(--ivory);
}
.brand span {
  font-family: Atkinson, sans-serif;
  font-size: 0.9rem;
  margin-left: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--rule);
}
.private-label {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
main {
  max-width: 1440px;
  padding: 0 48px;
  margin: auto;
}
.intro {
  padding: 56px 0 35px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.standfirst {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 0;
}
.intro-aside {
  max-width: 330px;
  line-height: 1.6;
  color: var(--muted);
  padding-bottom: 5px;
}
.intro-aside p {
  font-size: 0.9rem;
}
.primary {
  background: var(--copper);
  color: var(--navy);
  border-color: var(--copper);
  font-weight: 600;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.primary:hover {
  background: #f0ac87;
  color: var(--navy);
}
.explorer {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--surface);
  isolation: isolate;
  overflow: hidden;
  scroll-margin: 15px;
}
.toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 15px 22px;
  border-bottom: 1px solid var(--rule);
}
.explorer-title {
  font-family: Newsreader, serif;
  font-size: 1.3rem;
  flex: 1;
}
.explorer-title span {
  color: var(--muted);
  font-family: Atkinson, sans-serif;
  font-size: 0.85rem;
  margin-left: 8px;
}
.mode-switch {
  display: flex;
  gap: 0;
}
.mode-switch button {
  min-width: 52px;
  border-right: 0;
}
.mode-switch button:last-child {
  border-right: 1px solid var(--rule);
}
.mode-switch button[aria-pressed="true"] {
  color: var(--copper);
  background: rgba(229, 144, 98, 0.13);
  border-color: var(--copper);
}
.exit {
  display: none;
}
.filters {
  display: flex;
  gap: 8px;
  padding: 14px 22px 5px;
  align-items: center;
}
.search-label {
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 160px;
}
.search-label > span:not(.sr-only) {
  color: var(--copper);
  font-size: 1.5rem;
}
.search-label input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--ivory);
  padding: 9px 0;
  min-height: 44px;
  font-size: 0.9rem;
}
.search-label input::placeholder {
  color: #aebcbd;
}
.filters select,
.filters button {
  font-size: 0.83rem;
}
.scene-meta {
  display: flex;
  justify-content: space-between;
  padding: 15px 24px 0;
  letter-spacing: 0.11em;
  font-size: 0.68rem;
  color: var(--muted);
  gap: 12px;
}
.scene-meta #chapter {
  color: var(--copper);
}
.stage {
  position: relative;
  height: 390px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  perspective: 950px;
}
.stage.dragging {
  cursor: grabbing;
}
.scene-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 75%, #17465a88, transparent 67%);
  pointer-events: none;
}
.floor {
  position: absolute;
  left: -80%;
  right: -80%;
  height: 200%;
  top: 35%;
  transform: rotateX(73deg);
  transform-origin: center 10%;
  background-image:
    linear-gradient(#799da41a 1px, transparent 1px),
    linear-gradient(90deg, #799da41a 1px, transparent 1px);
  background-size: 72px 55px;
  mask-image: linear-gradient(transparent, #000 25%, #000 50%, transparent);
  pointer-events: none;
}
.cards {
  position: absolute;
  inset: 0;
  transform: translateX(var(--camera, 0px));
  transition: transform 0.2s ease-out;
}
.event {
  position: absolute;
  top: 0;
  left: 50%;
  width: 214px;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  transform-origin: 50% 100%;
  will-change: transform;
  min-height: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  pointer-events: auto;
}
.event:hover {
  background: transparent;
  border: 0;
}
.event-surface {
  background: var(--ivory);
  color: var(--navy);
  border: 2px solid #f1eee5;
  box-shadow: 0 8px 24px #0005;
  transition:
    transform 0.18s,
    border-color 0.18s;
  transform-origin: 50% 100%;
  overflow: hidden;
  border-radius: 3px;
}
.event.active .event-surface {
  border-color: var(--copper);
  box-shadow:
    0 0 0 1px #e5906233,
    0 8px 32px #0006;
}
.event:hover .event-surface,
.event:focus-visible .event-surface {
  transform: scale(1.035);
  border-color: var(--copper);
}
.event img {
  width: 100%;
  height: 107px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.event-copy {
  padding: 9px 11px 11px;
  display: block;
}
.event-date {
  font-size: 0.7rem;
  display: block;
  line-height: 1.2;
  margin-bottom: 5px;
  color: #6c3a23;
}
.event-title {
  font-family: Newsreader, serif;
  font-size: 1.11rem;
  line-height: 1.04;
  display: block;
}
.event-location {
  font-size: 0.6rem;
  margin-top: 7px;
  display: block;
  color: #4e6266;
}
.stem {
  display: block;
  width: 1px;
  height: var(--stem, 32px);
  background: #8ba9b6;
  margin: auto;
  position: relative;
}
.stem:after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 0 9px #e5906260;
}
.active .stem {
  background: var(--copper);
}
.active .stem:after {
  background: var(--copper);
  box-shadow: 0 0 16px #e59062;
}
.graphic {
  height: 107px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #164153, #082431);
  position: relative;
  color: #d3ded6;
  overflow: hidden;
}
.graphic svg {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}
.graphic span {
  position: relative;
  font-family: Newsreader, serif;
  font-size: 1.85rem;
  text-align: center;
  padding: 12px;
  z-index: 1;
}
.graphic small {
  position: absolute;
  bottom: 7px;
  right: 9px;
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  color: #d3ded6;
}
.scene-label {
  position: absolute;
  bottom: 12px;
  left: 24px;
  pointer-events: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#scene-year {
  font-family: Newsreader, serif;
  font-size: 2.4rem;
  color: #f1eee5cc;
}
#scale-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: #c7d0cf99;
}
.rail {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c7d0cf88, transparent);
}
.ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tick {
  position: absolute;
  top: 304px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
}
.tick:before {
  content: "";
  display: block;
  height: 9px;
  width: 1px;
  background: var(--rule);
  margin: 0 auto 5px;
}
.explorer[data-mode="2d"] .floor {
  opacity: 0.25;
}
.explorer[data-mode="2d"] .rail {
  display: block;
}
.empty {
  position: absolute;
  inset: 50px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.empty p {
  color: var(--muted);
}
.gesture {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 23px 10px;
  gap: 15px;
  font-size: 0.75rem;
  color: var(--muted);
}
.zoom-control {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}
.zoom-control input {
  width: 85px;
}
.population {
  padding: 14px 22px 3px;
  border-top: 1px solid var(--rule);
  background: #06162180;
}
.population-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.population-heading > div {
  display: flex;
  align-items: baseline;
  gap: 13px;
  flex-wrap: wrap;
}
.population .eyebrow {
  margin: 0;
  font-size: 0.65rem;
  color: var(--muted);
}
.population strong {
  font-weight: 500;
  font-size: 1.04rem;
}
.population small {
  color: #a8bcbc;
  font-size: 0.72rem;
}
.text-button {
  border: 0;
  font-size: 0.7rem;
  min-height: 28px;
  padding: 0;
  white-space: nowrap;
  color: var(--copper);
}
.population-chart {
  height: 75px;
  overflow: hidden;
}
.population-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.population-chart .curve {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.population-chart text {
  font-family: Atkinson, sans-serif;
  font-size: 10px;
  fill: #aabec4;
}
.population-chart .area {
  fill: #e590620c;
}
.population-chart .point {
  fill: var(--copper);
  stroke: var(--navy);
  stroke-width: 1.5;
}
.population-chart .cursor {
  stroke: var(--ivory);
  stroke-dasharray: 3 4;
  opacity: 0.7;
}
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 9px 22px 14px;
}
.transport button {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 0.85rem;
  white-space: nowrap;
}
.transport-centre {
  flex: 1;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--muted);
}
input[type="range"] {
  accent-color: var(--copper);
  cursor: pointer;
  height: 22px;
}
.preview-controls {
  padding: 9px 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: #aabbbf;
  gap: 10px;
}
.preview-controls select {
  font-size: 0.7rem;
  min-height: 34px;
  padding: 4px 25px 4px 8px;
  margin-left: 6px;
}
.below {
  text-align: center;
  padding: 68px 10px 54px;
  max-width: 760px;
  margin: auto;
}
.below h2 {
  margin-bottom: 15px;
}
.below > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}
.topic-line {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--copper);
  margin-top: 27px;
}
.page-footer {
  border-top: 1px solid var(--rule);
  padding: 25px 48px;
  display: flex;
  justify-content: space-between;
  color: #aabbbf;
  font-size: 0.75rem;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #020e19bf;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.story-dialog {
  width: min(940px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #88a1aa;
  background: #0a202d;
  box-shadow: 0 15px 60px #0008;
  overflow: hidden;
}
.dialog-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  color: var(--copper);
  font-size: 0.93rem;
}
.dialog-header button {
  border: 0;
}
.story-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 25px;
  display: grid;
  grid-template-columns: 0.95fr 1.1fr;
  gap: 30px;
  min-height: 0;
  line-height: 1.55;
}
.story-body figure {
  margin: 0;
}
.story-body figure img {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  background: #051621;
  display: block;
}
.story-body figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 8px;
}
.story-body .graphic {
  height: 235px;
}
.story-body .graphic span {
  font-size: 3rem;
}
.story-body h2 {
  font-size: 2.4rem;
  line-height: 1.05;
  margin: 8px 0 18px;
}
.story-body p {
  font-size: 1rem;
  line-height: 1.6;
}
.story-body .eyebrow {
  font-size: 0.7rem;
  line-height: 1.4;
}
.story-body .story-link {
  display: inline-block;
  margin: 6px 0 15px;
  font-weight: 600;
}
.story-pending {
  color: var(--muted);
  font-size: 0.78rem !important;
}
.story-body details {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}
.story-body summary {
  cursor: pointer;
  min-height: 35px;
}
.story-body li {
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  gap: 12px;
}
.dialog-footer button {
  font-size: 0.84rem;
}
.dialog-footer span {
  color: var(--muted);
  font-size: 0.72rem;
}
.story-body.about {
  display: block;
}
.story-body.about table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.story-body.about td,
.story-body.about th {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid var(--rule);
}
.reading-list {
  height: 390px;
  overflow: auto;
  padding: 14px 23px;
  overscroll-behavior: contain;
}
.list-event {
  display: flex;
  width: 100%;
  text-align: left;
  gap: 20px;
  padding: 16px 8px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.list-event .list-date {
  width: 135px;
  flex-shrink: 0;
  color: var(--copper);
  font-size: 0.85rem;
}
.list-event strong {
  font-family: Newsreader, serif;
  font-size: 1.3rem;
  font-weight: 450;
}
.list-event small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
}
.explorer.expanded {
  position: fixed;
  inset: 0;
  z-index: 80;
  border: 0;
  height: var(--explorer-height, 100dvh);
  max-width: none;
  overflow: hidden;
}
.expanded .base {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.expanded .stage,
.expanded .reading-list {
  flex: 1;
  min-height: 200px;
  height: auto;
}
.expanded .exit {
  display: block;
}
.expanded .toolbar {
  padding-top: max(10px, env(safe-area-inset-top));
}
.expanded .preview-controls {
  padding-bottom: max(9px, env(safe-area-inset-bottom));
}
.locked {
  overflow: hidden;
}
@media (min-width: 1500px) {
  .stage {
    height: 430px;
  }
}
@media (max-width: 1050px) {
  main {
    padding: 0 25px;
  }
  .masthead {
    padding: 22px 25px;
  }
  .filters {
    flex-wrap: wrap;
  }
  .search-label {
    flex-basis: 100%;
  }
  .filters select {
    min-width: 120px;
  }
  .intro-aside {
    max-width: 270px;
  }
  .stage {
    height: 375px;
  }
  .story-body {
    gap: 20px;
  }
  .story-body h2 {
    font-size: 2rem;
  }
}
@media (max-width: 680px) {
  :root {
    font-size: 17px;
  }
  .masthead {
    padding: 20px;
  }
  .brand {
    font-size: 1.8rem;
  }
  .brand span {
    font-size: 0.75rem;
    margin-left: 8px;
    padding-left: 12px;
  }
  .private-label {
    font-size: 0.5rem;
    max-width: 65px;
    text-align: right;
    line-height: 1.5;
  }
  main {
    padding: 0 20px;
  }
  .intro {
    display: block;
    padding: 43px 0 32px;
  }
  .intro .eyebrow {
    font-size: 0.65rem;
  }
  h1 {
    font-size: 4.5rem;
  }
  .standfirst {
    font-size: 1.05rem;
  }
  .intro-aside {
    max-width: none;
    margin-top: 24px;
  }
  .intro-aside p {
    display: none;
  }
  .primary {
    min-height: 52px;
  }
  .explorer:not(.expanded) {
    height: 365px;
    pointer-events: none;
  }
  .explorer:not(.expanded):after {
    content: "Explore the timeline above ↗";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    background: linear-gradient(transparent, #061621 30%);
    padding: 45px 10px 20px;
    color: var(--copper);
    font-size: 0.85rem;
    z-index: 20;
  }
  .explorer:not(.expanded) .filters,
  .explorer:not(.expanded) .population,
  .explorer:not(.expanded) .transport,
  .explorer:not(.expanded) .preview-controls,
  .explorer:not(.expanded) .gesture {
    display: none;
  }
  .toolbar {
    padding: 10px 12px;
    gap: 8px;
  }
  .explorer-title {
    font-size: 1.05rem;
  }
  .explorer-title span {
    display: none;
  }
  .mode-switch button {
    padding: 5px 10px;
    min-width: 44px;
    font-size: 0.83rem;
  }
  .exit {
    padding: 5px 10px;
    font-size: 0.85rem;
  }
  .filters {
    padding: 8px 12px 0;
    gap: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
  }
  .search-label {
    grid-column: 1/-1;
  }
  .filters select {
    font-size: 0.73rem;
    min-width: 0;
    width: 100%;
    padding-left: 6px;
    padding-right: 17px;
  }
  .filters button {
    font-size: 0.7rem;
    padding: 6px;
  }
  .scene-meta {
    padding: 10px 13px 0;
    font-size: 0.57rem;
  }
  .stage {
    height: 340px;
  }
  .expanded .stage {
    min-height: 185px;
  }
  .event {
    width: 172px;
  }
  .event img,
  .graphic {
    height: 86px;
  }
  .event-copy {
    padding: 7px 9px;
  }
  .event-title {
    font-size: 1rem;
  }
  .event-location {
    font-size: 0.55rem;
  }
  .event-date {
    font-size: 0.62rem;
  }
  .scene-label {
    bottom: 4px;
    left: 13px;
    gap: 6px;
  }
  #scene-year {
    font-size: 1.6rem;
  }
  #scale-label {
    font-size: 0.5rem;
  }
  .gesture {
    padding: 4px 12px 8px;
    font-size: 0.62rem;
    gap: 8px;
  }
  .zoom-control {
    gap: 4px;
    font-size: 0.62rem;
  }
  .zoom-control input {
    width: 54px;
  }
  .population {
    padding: 10px 12px 0;
  }
  .population-heading {
    gap: 6px;
  }
  .population-heading > div {
    gap: 3px 9px;
  }
  .population .eyebrow {
    font-size: 0.56rem;
    flex-basis: 100%;
  }
  .population strong {
    font-size: 0.8rem;
  }
  .population small {
    font-size: 0.6rem;
  }
  .population .text-button {
    font-size: 0.61rem;
    max-width: 72px;
    white-space: normal;
    min-height: 40px;
    text-align: right;
  }
  .population-chart {
    height: 55px;
  }
  .transport {
    padding: 7px 12px 9px;
    gap: 12px;
  }
  .transport button {
    padding: 5px 9px;
    gap: 5px;
    font-size: 0.7rem;
  }
  .transport-centre {
    font-size: 0.6rem;
    min-width: 70px;
  }
  .transport-centre > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 130px;
    margin: auto;
  }
  .preview-controls {
    padding: 5px 12px;
    font-size: 0.6rem;
  }
  .preview-controls > span {
    max-width: 120px;
    text-align: right;
  }
  .preview-controls select {
    font-size: 0.65rem;
    min-height: 35px;
    margin-left: 2px;
  }
  .below {
    padding: 45px 0 35px;
  }
  .below h2 {
    font-size: 2rem;
  }
  .topic-line {
    gap: 14px;
  }
  .page-footer {
    padding: 20px;
    gap: 20px;
    font-size: 0.65rem;
  }
  .overlay {
    padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .story-dialog {
    height: auto;
    max-height: 100%;
  }
  .dialog-header {
    padding: 7px 12px;
    gap: 5px;
    font-size: 0.85rem;
  }
  .dialog-header button {
    padding: 5px 9px;
  }
  .story-body {
    display: block;
    padding: 15px;
    max-height: none;
  }
  .story-body figure {
    margin-bottom: 22px;
  }
  .story-body figure img {
    max-height: 210px;
    width: 100%;
    object-fit: cover;
  }
  .story-body .graphic {
    height: 140px;
  }
  .story-body h2 {
    font-size: 2.1rem;
  }
  .story-body figcaption {
    font-size: 0.68rem;
  }
  .story-body p {
    font-size: 1rem;
  }
  .dialog-footer {
    padding: 9px;
    gap: 6px;
  }
  .dialog-footer button {
    font-size: 0.73rem;
    padding: 7px;
  }
  .dialog-footer span {
    font-size: 0.6rem;
  }
  .reading-list {
    padding: 8px 12px;
  }
  .list-event {
    gap: 13px;
  }
  .list-event .list-date {
    width: 87px;
    font-size: 0.75rem;
  }
  .list-event strong {
    font-size: 1.15rem;
  }
  .story-body.about td,
  .story-body.about th {
    padding: 8px 3px;
    font-size: 0.68rem;
  }
}
@media (max-height: 590px) and (orientation: landscape) {
  .expanded .filters {
    display: flex;
    flex-wrap: nowrap;
    padding: 2px 12px;
  }
  .expanded .search-label {
    flex-basis: auto;
    min-width: 150px;
  }
  .expanded .scene-meta {
    padding-top: 3px;
  }
  .expanded .stage {
    min-height: 105px;
  }
  .expanded .population {
    padding-top: 3px;
  }
  .expanded .population-chart {
    height: 38px;
  }
  .expanded .population-heading .eyebrow {
    flex-basis: auto;
  }
  .expanded .gesture {
    padding-bottom: 2px;
  }
  .expanded .toolbar {
    padding-bottom: 3px;
  }
  .expanded .preview-controls {
    display: none;
  }
  .expanded .transport {
    padding: 3px 12px;
  }
  .expanded .event {
    width: 150px;
  }
  .expanded .event img,
  .expanded .graphic {
    height: 65px;
  }
  .expanded .event-copy {
    padding: 5px;
  }
  .expanded .event-title {
    font-size: 0.85rem;
  }
  .expanded .event-location {
    display: none;
  }
  .expanded .story-body {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
  }
  .expanded .story-body figure img {
    max-height: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.event-surface {
  display: block;
}
.cards {
  perspective: 950px;
  transform-style: preserve-3d;
}
.event {
  transform-origin: 50% 0%;
}
#filter-toggle {
  display: none;
}
@media (max-width: 680px) {
  #filter-toggle {
    display: block;
    grid-column: 4;
    grid-row: 1;
    font-size: 14px;
    padding: 5px 8px;
  }
  .filters .search-label {
    grid-column: 1/4;
    grid-row: 1;
  }
  .filters .search-label input {
    font-size: 16px;
  }
  .filters > label:not(.search-label),
  .filters > #reset {
    display: none;
  }
  .filters-open .filters > label:not(.search-label),
  .filters-open .filters > #reset {
    display: block;
  }
  .filters select {
    font-size: 16px;
  }
  .preview-controls > span {
    display: none;
  }
  .preview-controls select {
    font-size: 14px;
  }
  .preview-controls {
    font-size: 12px;
  }
  .population-chart svg text {
    font-size: 24px;
  }
  .event {
    transform-origin: 50% 0%;
  }
  .transport button {
    font-size: 13px;
  }
  .gesture {
    font-size: 12px;
  }
  .population strong {
    font-size: 15px;
  }
  .population small {
    font-size: 12px;
  }
  .population-heading > div {
    display: block;
  }
  .population-heading .eyebrow {
    display: block;
    margin-bottom: 3px;
  }
  .population-heading small {
    display: block;
  }
  .population-chart {
    height: 52px;
  }
  .population .text-button {
    font-size: 12px;
  }
  .population-heading {
    min-height: 48px;
  }
  .expanded .stage {
    min-height: 100px;
  }
  .scene-meta {
    font-size: 11px;
  }
  .scene-label #scale-label {
    display: none;
  }
  .filters-open.expanded .base {
    overflow-y: auto;
  }
  .filters-open.expanded .stage {
    flex-shrink: 0;
    min-height: 150px;
  }
  .expanded .transport,
  .expanded .population,
  .expanded .preview-controls,
  .expanded .toolbar,
  .expanded .gesture,
  .expanded .filters,
  .expanded .scene-meta {
    flex-shrink: 0;
  }
}
@media (max-width: 680px) and (max-height: 680px) {
  .expanded .toolbar {
    padding: 5px 10px;
  }
  .expanded .stage {
    min-height: 90px;
  }
  .expanded .gesture {
    font-size: 10px;
    padding: 2px 10px;
  }
  .expanded .population {
    padding-top: 5px;
  }
  .expanded .population-chart {
    height: 40px;
  }
  .expanded .transport {
    padding: 5px 10px;
  }
  .expanded .transport-centre > span {
    display: none;
  }
  .expanded .scene-label {
    bottom: 1px;
  }
  .expanded #scene-year {
    font-size: 1.25rem;
  }
  .expanded .population-heading {
    min-height: 48px;
  }
  .expanded .preview-controls {
    padding: 3px 10px;
  }
  .expanded .preview-controls select {
    min-height: 32px;
  }
}
@media (max-height: 590px) and (orientation: landscape) {
  .expanded .stage {
    min-height: 90px;
  }
  .expanded .filters {
    max-height: 48px;
  }
  .expanded .search-label {
    flex-basis: auto;
  }
  .expanded .population-heading > div {
    display: flex;
  }
  .expanded .population-heading {
    min-height: 25px;
  }
  .expanded .population small {
    display: inline;
  }
  .expanded .population .text-button {
    min-height: 24px;
  }
}
@media (max-width: 680px) {
  .population-chart svg text {
    font-size: 12px;
  }
}
.expanded .base {
  overflow-y: auto;
}
@media (max-height: 590px) and (orientation: landscape) {
  .expanded .event img,
  .expanded .event .graphic {
    height: 38px;
  }
  .expanded .event .graphic span {
    font-size: 1rem;
  }
  .expanded .event .graphic small {
    display: none;
  }
  .expanded .event .stem {
    height: 12px;
  }
}
/* Three fixed lanes share one perspective projection with every card footpoint. */
#track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.track-divider {
  fill: none;
  stroke: #9fb9c2;
  stroke-width: 1;
  stroke-opacity: 0.45;
}
.track-crossbar {
  fill: none;
  stroke: #a7bfc6;
  stroke-width: 1;
}
.track-date {
  fill: #c7d0cf;
  font:
    14px Atkinson,
    sans-serif;
}
.explorer[data-mode="3d"] .stage {
  height: 490px;
  perspective: none;
}
.explorer[data-mode="3d"] .cards {
  perspective: none;
  transform: none;
  transform-style: flat;
  transition: none;
}
.explorer[data-mode="3d"] .floor {
  display: none;
}
.explorer[data-mode="3d"] .scene-glow {
  background: radial-gradient(ellipse at 50% 12%, #1e526866, transparent 56%);
}
.explorer[data-mode="3d"] .event {
  transition: none;
  will-change: transform, opacity;
}
.explorer[data-mode="3d"] .event-surface {
  box-shadow: 0 10px 24px #0005;
}
.explorer[data-mode="3d"] .stem {
  background: #bdd0d9;
}
.explorer[data-mode="3d"] .stem:before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--ivory);
}
.explorer[data-mode="3d"] .event.active .stem:before {
  border-top-color: var(--copper);
}
.explorer.expanded[data-mode="3d"] .stage {
  height: auto;
}
@media (max-width: 680px) {
  .explorer[data-mode="3d"] .stage {
    height: 340px;
  }
  .explorer.expanded[data-mode="3d"] .stage {
    height: auto;
  }
  .track-date {
    font-size: 11px;
  }
}
@media (max-width: 680px) {
  .explorer[data-mode="3d"] .event {
    width: clamp(130px, 40vw, 172px);
  }
}

/* Contain all depth layers below the story overlay, including focused cards. */
.base {
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.stage {
  isolation: isolate;
  overscroll-behavior: none;
}
.overlay {
  z-index: 2;
  overscroll-behavior: contain;
}
#track {
  mask-image: linear-gradient(to bottom, transparent 10%, #000 25%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 10%, #000 25%);
}
.explorer[data-mode="3d"] .scene-glow {
  background:
    radial-gradient(ellipse 32% 15% at 50% 13%, #6198a426, transparent),
    radial-gradient(ellipse at 50% 12%, #1e526866, transparent 56%);
}
.direction-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}
.direction-control select {
  min-height: 36px;
  font-size: 13px;
  padding: 5px 25px 5px 8px;
}
@media (max-width: 680px) {
  .scene-meta {
    flex-wrap: wrap;
    gap: 5px;
  }
  .direction-control {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .direction-control select {
    min-height: 32px;
    font-size: 14px;
  }
}
@media (max-height: 590px) and (orientation: landscape) {
  .scene-meta #chapter {
    display: none;
  }
  .direction-control {
    order: 0;
    width: auto;
  }
}

/* Stable lower panel: changing captions and totals never move the controls. */
.population-heading {
  height: 4.4rem;
  min-height: 4.4rem;
  align-items: center;
}
.population-heading > div {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  grid-template-rows: 1.8rem 2.2rem;
  gap: 0 12px;
  min-width: 0;
  flex: 1;
  align-items: center;
}
.population-heading .eyebrow {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}
.population-heading strong {
  grid-column: 2;
  grid-row: 1;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.population-heading small {
  grid-column: 1/-1;
  grid-row: 2;
  line-height: 1.3;
  max-height: 100%;
  overflow: auto;
}
.transport-centre {
  min-width: 0;
}
.transport-centre > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  height: 1.3em;
  line-height: 1.3;
}
.event-media {
  display: block;
  position: relative;
  overflow: hidden;
  background: #e8e1d1;
}
.event-media img {
  margin: 0;
}
.image-badge {
  position: absolute;
  left: 5px;
  top: 5px;
  background: #061621e6;
  color: #f1eee5;
  padding: 3px 5px;
  font:
    9px Atkinson,
    sans-serif;
  letter-spacing: 0.04em;
  border: 1px solid #e5906299;
  border-radius: 2px;
}
.story-body .event-media {
  background: #051621;
}
.story-body .event-media img {
  height: auto;
  object-fit: contain !important;
  object-position: center !important;
}
.story-body .image-badge {
  font-size: 11px;
  left: 8px;
  top: 8px;
}
.story-body figcaption a {
  display: inline-block;
  margin-top: 5px;
}
@media (max-width: 680px) {
  .population-heading {
    height: 5.6rem;
    min-height: 5.6rem;
    align-items: flex-start;
  }
  .population-heading > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1rem 2rem 2.4rem;
    gap: 0;
  }
  .population-heading .eyebrow {
    grid-column: 1;
    grid-row: 1;
  }
  .population-heading strong {
    grid-column: 1;
    grid-row: 2;
  }
  .population-heading small {
    grid-column: 1;
    grid-row: 3;
    display: block !important;
  }
  .population .text-button {
    flex-shrink: 0;
  }
  .transport-centre > span {
    max-width: 130px;
  }
  .image-badge {
    font-size: 8px;
    padding: 2px 4px;
  }
}
@media (max-height: 590px) and (orientation: landscape) {
  .expanded .population-heading {
    height: 3.4rem;
    min-height: 3.4rem;
  }
  .expanded .population-heading > div {
    display: grid !important;
    grid-template-columns: 155px minmax(0, 1fr);
    grid-template-rows: 1.4rem 1.8rem;
  }
  .expanded .population-heading .eyebrow {
    grid-column: 1;
    grid-row: 1;
  }
  .expanded .population-heading strong {
    grid-column: 2;
    grid-row: 1;
  }
  .expanded .population-heading small {
    grid-column: 1/-1;
    grid-row: 2;
  }
}

@media (max-height: 590px) and (orientation: landscape) {
  .expanded .population-heading {
    height: 1.8rem;
    min-height: 1.8rem;
  }
  .expanded .population-heading > div {
    grid-template-columns: 140px 180px minmax(0, 1fr);
    grid-template-rows: 1.8rem;
    gap: 0 8px;
  }
  .expanded .population-heading small {
    grid-column: 3;
    grid-row: 1;
    font-size: 11px;
    line-height: 13px;
  }
  .expanded .stage {
    min-height: 75px;
  }
  .expanded .population strong {
    font-size: 14px;
  }
}

/* Frame the retained engraving without modifying the original book scan. */
.event-media.image-crop {
  height: auto !important;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.event-media.image-crop img {
  position: absolute !important;
  max-width: none !important;
  max-height: none !important;
  width: var(--crop-width) !important;
  height: var(--crop-height) !important;
  left: var(--crop-left);
  top: var(--crop-top);
  object-fit: fill !important;
  margin: 0;
}

/* Period navigation follows the current event, with equal-width chapter stops. */
.scene-meta {
  align-items: center;
  padding-top: 10px;
  padding-bottom: 5px;
  letter-spacing: 0;
  gap: 14px;
}
.scene-meta #count {
  white-space: nowrap;
  font-size: 11px;
}
.era-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  height: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 0 3px;
  gap: 4px;
}
.era-strip::-webkit-scrollbar {
  display: none;
}
.era-strip button {
  position: relative;
  flex: 1;
  min-width: 78px;
  border: 0;
  border-radius: 0;
  padding: 6px 5px 8px;
  font-size: 12px;
  white-space: nowrap;
  color: #a7b8bf;
  min-height: 44px;
}
.era-strip button > span {
  position: relative;
  z-index: 1;
}
.era-strip button i {
  display: block;
  position: absolute;
  bottom: 5px;
  left: 7px;
  right: 7px;
  height: 2px;
  background: #8ba9b630;
}
.era-strip button i b {
  display: block;
  width: calc(var(--era-progress, 0) * 100%);
  height: 100%;
  background: var(--copper);
}
.era-strip button[aria-current] {
  color: var(--ivory);
  background: #e5906214;
}
.era-strip button[aria-current] i:after {
  content: "";
  position: absolute;
  left: calc(var(--era-progress, 0) * 100%);
  top: -2px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 7px #e5906270;
}
.era-strip button:focus-visible {
  outline-offset: -3px;
}
.era-strip button:disabled {
  opacity: 0.3;
}
.expanded .scene-meta {
  flex-shrink: 0;
}
@media (max-width: 680px) {
  .scene-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 3px 10px 0;
  }
  .scene-meta .direction-control {
    grid-column: 1;
    grid-row: 1;
  }
  .scene-meta #count {
    grid-column: 2;
    grid-row: 1;
  }
  .era-strip {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
    height: 44px;
  }
  .era-strip button {
    min-width: 86px;
  }
  .expanded .scene-meta {
    padding-top: 0;
  }
}
@media (max-height: 590px) and (orientation: landscape) {
  .expanded .scene-meta {
    display: flex;
    padding: 0 12px;
    gap: 9px;
  }
  .expanded .era-strip {
    height: 44px;
  }
  .expanded .era-strip button {
    min-width: 64px;
    font-size: 10px;
  }
  .expanded .direction-control {
    gap: 4px;
  }
  .expanded .direction-control select {
    font-size: 12px;
  }
  .expanded .scene-meta #count {
    font-size: 10px;
  }
}

/* Isolated page pictures fit the normal card thumbnail, regardless of source shape.
   The popup keeps the complete isolated figure at its natural aspect ratio. */
.event .thumbnail-frame {
  --thumbnail-height: 107px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--thumbnail-height);
  width: 100%;
  overflow: hidden;
  background: #e8e1d1;
}
.event .thumbnail-frame .image-crop {
  flex: none;
  width: min(
    100%,
    calc(var(--thumbnail-height) * var(--crop-aspect))
  ) !important;
}
@media (max-width: 680px) {
  .event .thumbnail-frame {
    --thumbnail-height: 86px;
  }
}
@media (max-height: 590px) and (orientation: landscape) {
  .expanded .event .thumbnail-frame {
    --thumbnail-height: 38px;
  }
}

/* Wider history shares track depth, but never intercepts a pointer or covers a popup. */
#context-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.cards {
  z-index: 1;
  pointer-events: none;
}
.context-moment {
  position: absolute;
  width: 145px;
  text-align: center;
  color: #c2d4d7;
  transform-origin: 50% 100%;
  pointer-events: none;
  will-change: transform, opacity;
}
.context-moment svg {
  width: 112px;
  height: 91px;
  display: block;
  margin: 0 auto 5px;
  opacity: 0.68;
}
.context-moment strong {
  display: block;
  font:
    400 19px/1.1 Newsreader,
    Georgia,
    serif;
  text-wrap: balance;
}
.context-year {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.025em;
  margin-bottom: 5px;
}
.context-moment i {
  display: block;
  width: 1px;
  height: 42px;
  margin: 7px auto 0;
  background: currentColor;
  opacity: 0.5;
}
.context-control {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
}
.context-control input {
  accent-color: var(--copper);
  width: 17px;
  height: 17px;
  margin: 0;
}
.preview-controls {
  flex-wrap: wrap;
}
.context-sources {
  text-align: left;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
}
.context-sources summary {
  cursor: pointer;
  min-height: 28px;
  color: var(--ivory);
}
.context-sources p {
  margin: 12px 0;
}
.context-sources li {
  margin: 12px 0;
}
.context-sources li > span {
  font-size: 0.75rem;
}
.dated-marker .track-crossbar {
  stroke-opacity: 0.28;
}
@media (max-width: 680px) {
  .context-moment {
    width: 108px;
  }
  .context-moment svg {
    width: 76px;
    height: 64px;
  }
  .context-moment strong {
    font-size: 16px;
  }
  .context-year {
    font-size: 10px;
  }
  .context-control {
    font-size: 12px;
  }
  .preview-controls > span {
    width: 100%;
  }
}

/* Wider-history markers follow fixed perspective lanes and remain interactive. */
.context-moment {
  width: 180px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  color: #cbdcdf;
  min-height: 44px;
}
.context-moment svg {
  width: 136px;
  height: 112px;
}
.context-moment strong {
  font-size: 24px;
  line-height: 1.15;
}
.context-year {
  font-size: 15px;
  line-height: 1.3;
}
.context-moment:hover,
.context-moment:focus-visible {
  color: var(--ivory);
  background: transparent;
  filter: none !important;
}
.context-moment:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 5px;
}
.context-moment[hidden] {
  display: none;
}
.context-story {
  display: block !important;
  padding: clamp(24px, 4vw, 54px);
  overflow-y: auto;
}
.context-story article {
  max-width: 760px;
  margin: 0 auto;
}
.context-story .context-reference {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 28px;
}
.context-source-list button,
#context-source-list button {
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--copper);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
  font: inherit;
}
@media (max-width: 680px) {
  .context-moment {
    width: 136px;
  }
  .context-moment svg {
    width: 100px;
    height: 84px;
  }
  .context-moment strong {
    font-size: 21px;
  }
  .context-year {
    font-size: 13px;
  }
  .context-story {
    padding: 24px 20px;
  }
}

/* Dates sit at the footpoint, separated from the drawing and story title. */
.context-year {
  display: table;
  margin: 0 auto;
  padding: 4px 9px;
  color: #f4ba92;
  background: #09202ded;
  border: 1px solid #e5906280;
  border-radius: 3px;
  font:
    600 27px/1.15 Atkinson,
    Arial,
    sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.context-scope {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #d2e2e5;
  line-height: 1.2;
}
.context-moment i {
  height: 22px;
  margin: 8px auto 0;
}
@media (max-width: 680px) {
  .context-year {
    font-size: 23px;
    padding: 4px 7px;
  }
  .context-scope {
    font-size: 11px;
  }
  .context-moment i {
    height: 17px;
    margin-top: 6px;
  }
}
#context-layer {
  z-index: 2;
}
.context-moment {
  pointer-events: none;
}
.context-moment svg,
.context-moment strong,
.context-moment .context-year,
.context-moment .context-scope {
  pointer-events: auto;
}
.context-moment strong,
.context-scope {
  text-shadow:
    0 1px 3px #061621,
    0 0 7px #061621;
}

.context-moment[data-interactive="false"] * {
  pointer-events: none;
}

/* Preserve thin drawings in perspective; full cards and 2D milestones use separate bands. */
.context-moment svg {
  opacity: 1;
  stroke-width: var(--context-stroke, 1.5);
}
.explorer[data-mode="2d"] .context-moment {
  width: 200px;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 9px;
  row-gap: 4px;
  text-align: left;
  transform-origin: 50% 0%;
  min-height: 0;
}
.explorer[data-mode="2d"] .context-moment svg {
  width: 42px;
  height: 38px;
  grid-row: 1/3;
  margin: 0;
}
.explorer[data-mode="2d"] .context-moment strong {
  font-size: 18px;
  line-height: 1.15;
  text-wrap: balance;
}
.explorer[data-mode="2d"] .context-moment .context-year {
  grid-column: 2;
  font-size: 17px;
  margin: 0;
  justify-self: start;
  padding: 2px 6px;
}
.explorer[data-mode="2d"] .context-moment i,
.explorer[data-mode="2d"] .context-scope {
  display: none;
}
.explorer[data-mode="2d"] .scene-label {
  top: 3px;
  bottom: auto;
  left: 16px;
  z-index: 3;
}
.explorer[data-mode="2d"] #scene-year {
  font-size: 20px;
}
.explorer[data-mode="2d"] #scale-label {
  font-size: 9px;
}
.explorer[data-mode="2d"] .stem {
  height: var(--stem);
}
.explorer[data-mode="2d"] .floor {
  display: none;
}
@media (max-width: 680px) {
  .explorer[data-mode="2d"] .context-moment {
    width: 154px;
    grid-template-columns: 28px 1fr;
    column-gap: 6px;
  }
  .explorer[data-mode="2d"] .context-moment svg {
    width: 28px;
    height: 28px;
  }
  .explorer[data-mode="2d"] .context-moment strong {
    font-size: 15px;
  }
  .explorer[data-mode="2d"] .context-moment .context-year {
    font-size: 15px;
  }
}
/* Shared three-lane cards: wider history has its own dated stop and the same dimensions. */
.explorer[data-mode="3d"] .cards,
.explorer[data-mode="3d"] #context-layer {
  display: contents;
  transform: none;
}
.explorer[data-mode="3d"] .event,
.explorer[data-mode="3d"] .context-moment.event {
  width: 214px;
  padding: 0;
  border: 0;
  min-height: 0;
  text-align: left;
  color: var(--navy);
  pointer-events: auto;
}
.explorer[data-mode="3d"] .event-surface {
  height: 270px;
  display: block;
  box-sizing: border-box;
}
.explorer[data-mode="3d"] .event .event-copy {
  display: block;
  padding: 12px;
}
.explorer[data-mode="3d"] .event .event-title {
  display: block;
  font:
    400 18px/1.12 Newsreader,
    Georgia,
    serif;
  text-shadow: none;
}
.explorer[data-mode="3d"] .event .event-date {
  display: block;
  font:
    400 13px/1.2 Atkinson,
    Arial,
    sans-serif;
  letter-spacing: 0;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  background: none;
  color: #a6562f;
}
.explorer[data-mode="3d"] .event .event-location {
  display: block;
  font:
    400 12px/1.2 Atkinson,
    Arial,
    sans-serif;
  margin-top: 9px;
}
.explorer[data-mode="3d"] .event img,
.explorer[data-mode="3d"] .event .graphic,
.explorer[data-mode="3d"] .world-drawing {
  height: 112px;
}
.explorer[data-mode="3d"] .event .thumbnail-frame {
  --thumbnail-height: 112px;
}
.explorer[data-mode="3d"] .world-surface {
  background: #12313f;
  color: var(--ivory);
  border-color: #87a9af;
}
.explorer[data-mode="3d"] .world-drawing {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b2633;
}
.explorer[data-mode="3d"] .world-drawing svg {
  display: block;
  width: 104px;
  height: 86px;
  margin: 0;
  opacity: 1;
  stroke-width: 1.5;
  color: #cedde0;
}
.explorer[data-mode="3d"] .world-event .event-date {
  color: #f4ba92;
}
.explorer[data-mode="3d"] .context-moment:hover {
  background: none;
  filter: inherit;
}
.explorer[data-mode="3d"] .event .stem {
  height: 22px;
}
.explorer[data-mode="3d"] .context-moment[data-interactive="false"] {
  pointer-events: none;
}
@media (max-width: 680px) {
  .explorer[data-mode="3d"] .event,
  .explorer[data-mode="3d"] .context-moment.event {
    width: 172px;
  }
  .explorer[data-mode="3d"] .event-surface {
    height: 238px;
  }
  .explorer[data-mode="3d"] .event .event-title {
    font-size: 16px;
  }
  .explorer[data-mode="3d"] .event .event-copy {
    padding: 10px;
  }
  .explorer[data-mode="3d"] .event img,
  .explorer[data-mode="3d"] .event .graphic,
  .explorer[data-mode="3d"] .world-drawing {
    height: 86px;
  }
  .explorer[data-mode="3d"] .event .thumbnail-frame {
    --thumbnail-height: 86px;
  }
  .explorer[data-mode="3d"] .world-drawing svg {
    width: 84px;
    height: 70px;
  }
}
/* A fixed reading position in the flat view. */
.midpoint {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  z-index: 4;
  pointer-events: none;
  background: none;
}
.explorer[data-mode="2d"] .midpoint {
  display: block;
}
.midpoint i {
  position: absolute;
  top: var(--flat-rail);
  left: -6px;
  width: 13px;
  height: 13px;
  transform: translateY(-50%) rotate(45deg);
  border: 2px solid #ffcba9;
  background: var(--navy);
  box-shadow: 0 0 16px #e5906280;
}
/* Expanded controls give the scene priority; additional filters are a floating tray. */
.expanded .base {
  position: relative;
  overflow-y: auto;
}
.expanded .toolbar {
  padding: 7px 14px;
  min-height: 58px;
}
.expanded .filters {
  display: flex;
  flex-wrap: nowrap;
  padding: 3px 14px;
  min-height: 48px;
  position: relative;
  max-height: none;
}
.expanded #filter-toggle {
  display: block;
  order: 2;
  font-size: 14px;
  padding: 5px 10px;
}
.expanded .search-label {
  flex: 1;
  min-width: 0;
  flex-basis: auto;
}
.expanded .filters > label:not(.search-label),
.expanded .filters > #reset {
  display: none;
}
.expanded.filters-open .filters > label:not(.search-label),
.expanded.filters-open .filters > #reset {
  display: block;
  position: absolute;
  top: 48px;
  z-index: 25;
  background: var(--surface);
  box-shadow: 0 6px 16px #0009;
  width: 23%;
}
.expanded.filters-open .filters > label:nth-of-type(2) {
  left: 2%;
}
.expanded.filters-open .filters > label:nth-of-type(3) {
  left: 26%;
}
.expanded.filters-open .filters > label:nth-of-type(4) {
  left: 50%;
}
.expanded.filters-open .filters > #reset {
  left: 74%;
  width: 24%;
}
.expanded .filters select {
  width: 100%;
  min-width: 0;
}
.expanded .scene-meta {
  padding: 0 14px;
  min-height: 46px;
}
.expanded .population {
  padding: 5px 14px 0;
}
.expanded .population-heading {
  height: 3.5rem;
  min-height: 3.5rem;
}
.expanded .population-heading > div {
  grid-template-rows: 1.5rem 1.8rem;
}
.expanded .population-chart {
  height: 44px;
}
.expanded .transport {
  padding: 5px 14px;
}
.expanded .gesture {
  padding: 5px 14px;
}
.expanded .stage,
.expanded.filters-open .stage {
  min-height: 0;
  flex: 1 1 0;
  touch-action: none;
}
.expanded .toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
}
@media (max-width: 680px) {
  .expanded .toolbar {
    padding: 5px 10px;
    min-height: 54px;
  }
  .expanded .population-heading {
    height: 4.6rem;
    min-height: 4.6rem;
  }
  .expanded .population-heading > div {
    grid-template-rows: 1rem 1.7rem 1.8rem;
  }
  .expanded .population-chart {
    height: 40px;
  }
  .expanded .preview-controls {
    padding: 3px 10px;
  }
  .expanded .scene-meta {
    padding: 0 10px;
  }
  .expanded .filters {
    padding: 2px 10px;
  }
  .expanded .stage,
  .expanded.filters-open .stage {
    min-height: 260px;
    flex-basis: 260px;
  }
}
/* Short wide screens use a side panel instead of reducing the track to a letterbox. */
@media (min-width: 700px) and (max-height: 820px) {
  .expanded .base {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    grid-template-rows: auto auto minmax(110px, 1fr) auto auto auto;
    gap: 0;
  }
  .expanded .toolbar {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .expanded .scene-meta {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  .expanded .filters {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 2px 8px;
  }
  .expanded .filters .search-label input {
    font-size: 13px;
  }
  .expanded .stage,
  .expanded.filters-open .stage,
  .expanded .reading-list {
    grid-column: 1;
    grid-row: 3/5;
    min-height: 240px;
    height: 100%;
    align-self: stretch;
    min-width: 0;
  }
  .expanded .population {
    grid-column: 2;
    grid-row: 3;
    padding: 10px;
    border-left: 1px solid var(--rule);
    min-width: 0;
  }
  .expanded .population-heading {
    height: 112px;
    min-height: 112px;
    display: block;
  }
  .expanded .population-heading > div {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: 18px 30px 40px;
  }
  .expanded .population-heading .eyebrow {
    grid-column: 1;
    grid-row: 1;
  }
  .expanded .population-heading strong {
    grid-column: 1;
    grid-row: 2;
    font-size: 15px;
  }
  .expanded .population-heading small {
    grid-column: 1;
    grid-row: 3;
    font-size: 12px;
  }
  .expanded .population .text-button {
    min-height: 24px;
    font-size: 12px;
    padding: 0;
  }
  .expanded .population-chart {
    height: 55px;
  }
  .expanded .preview-controls {
    grid-column: 2;
    grid-row: 4/6;
    display: flex;
    align-content: start;
    padding: 10px;
    gap: 12px;
    border-left: 1px solid var(--rule);
  }
  .expanded .preview-controls > span {
    display: none;
  }
  .expanded .gesture {
    grid-column: 1;
    grid-row: 5;
  }
  .expanded .transport {
    grid-column: 1/-1;
    grid-row: 6;
  }
  .expanded .direction-control {
    font-size: 10px;
  }
  .expanded .direction-control select {
    font-size: 12px;
    min-height: 36px;
    padding: 3px;
  }
  .expanded .era-strip {
    min-width: 0;
  }
  .expanded .scene-meta #count {
    display: none;
  }
  .expanded.filters-open .filters > label:not(.search-label),
  .expanded.filters-open .filters > #reset {
    left: 0;
    width: 100%;
    top: 48px;
  }
  .expanded.filters-open .filters > label:nth-of-type(3) {
    top: 92px;
  }
  .expanded.filters-open .filters > label:nth-of-type(4) {
    top: 136px;
  }
  .expanded.filters-open .filters > #reset {
    top: 180px;
  }
}

.explorer[data-mode="3d"] .world-event .event-location {
  color: #c7d0cf;
}
/* Reserve real grid space for the track and side controls, even in landscape. */
@media (min-width: 700px) and (max-height: 820px) {
  .expanded .base {
    grid-template-rows: auto auto minmax(0, 1fr) 0 auto auto;
  }
  .expanded .stage,
  .expanded.filters-open .stage,
  .expanded .reading-list {
    min-height: 0;
  }
  .expanded .population {
    grid-row: 3 / 5;
  }
  .expanded .population-heading {
    height: 94px;
    min-height: 94px;
  }
  .expanded .population-heading > div {
    grid-template-rows: 16px 24px 30px;
  }
  .expanded .population-chart {
    height: 44px;
  }
  .expanded .preview-controls {
    grid-row: 5;
    gap: 7px;
    padding: 3px 10px;
  }
}

/* Chart text uses physical pixels, including compact and sidebar layouts. */
.population-chart svg text {
  font-size: 13px;
}

/* Mobile reading sizes: let the explorer scroll vertically instead of shrinking type. */
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .expanded[data-mode="3d"] .stage,
  .expanded[data-mode="3d"].filters-open .stage {
    min-height: 400px;
    flex-basis: 400px;
  }
  .expanded[data-mode="2d"] .stage,
  .expanded[data-mode="2d"].filters-open .stage {
    min-height: 580px;
    flex-basis: 580px;
  }
  .expanded .preview-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
  }
  .expanded .preview-controls select {
    font-size: 14px;
    min-height: 44px;
    max-width: 100%;
  }
  .expanded .context-control {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .expanded .transport button,
  .expanded .mode-switch button,
  .expanded .exit,
  .expanded #filter-toggle {
    min-height: 44px;
  }
  .expanded .transport {
    gap: 8px;
  }
  .expanded .transport-centre {
    min-width: 44px;
  }
  .expanded .gesture {
    font-size: 12px;
  }
  .expanded .population-heading {
    height: 6.4rem;
    min-height: 6.4rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }
  .expanded .population-heading > div {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 1rem 3rem 2.4rem !important;
  }
  .expanded .population-heading .eyebrow {
    grid-column: 1;
    grid-row: 1;
  }
  .expanded .population-heading strong {
    grid-column: 1;
    grid-row: 2;
    font-size: 15px;
    overflow-wrap: anywhere;
  }
  .expanded .population-heading small {
    grid-column: 1;
    grid-row: 3;
    font-size: 12px;
  }
  .expanded .population .text-button {
    font-size: 12px;
    max-width: 80px;
    min-height: 44px;
    white-space: normal;
    text-align: right;
  }
  .explorer[data-mode="3d"] .event .event-title {
    font-size: 18px;
    line-height: 1.15;
  }
  .explorer[data-mode="3d"] .event .event-date {
    font-size: 14px;
  }
  .explorer[data-mode="3d"] .event-surface {
    height: 280px;
  }
  .explorer[data-mode="2d"] .event {
    width: 220px;
  }
  .explorer[data-mode="2d"] .event-surface {
    height: 260px;
  }
  .explorer[data-mode="2d"] .event .thumbnail-frame {
    --thumbnail-height: 86px;
  }
  .explorer[data-mode="2d"] .event img,
  .explorer[data-mode="2d"] .event .graphic {
    height: 86px;
  }
  .explorer[data-mode="2d"] .event-copy {
    padding: 10px;
  }
  .explorer[data-mode="2d"] .event-title {
    font-size: 18px;
    line-height: 1.15;
  }
  .explorer[data-mode="2d"] .event-date {
    font-size: 14px;
    line-height: 1.2;
  }
  .explorer[data-mode="2d"] .event-location {
    font-size: 12px;
    line-height: 1.2;
  }
  .expanded .overlay {
    padding: max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .dialog-header,
  .dialog-footer {
    flex-shrink: 0;
  }
  .dialog-header {
    padding: 6px 10px;
    gap: 8px;
    min-width: 0;
    font-size: 14px;
  }
  .dialog-header > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .dialog-header button {
    flex-shrink: 0;
    min-height: 44px;
    font-size: 14px;
  }
  .dialog-footer {
    gap: 6px;
    padding: 8px;
  }
  .dialog-footer button {
    min-height: 44px;
    font-size: 13px;
    padding: 7px 5px;
    min-width: 0;
    flex: 1;
  }
  .dialog-footer span {
    font-size: 12px;
    flex-shrink: 0;
  }
  .story-body {
    padding: 16px;
    gap: 20px;
    overflow-wrap: anywhere;
  }
  .story-body > * {
    min-width: 0;
  }
  .story-body h2 {
    font-size: 2rem;
  }
  .story-body p {
    font-size: 1rem;
  }
  .story-body figcaption {
    font-size: 13px;
  }
  .story-body details,
  .story-body .eyebrow {
    font-size: 14px;
  }
  .story-body summary {
    min-height: 44px;
  }
  .story-body.about td,
  .story-body.about th {
    font-size: 13px;
    overflow-wrap: anywhere;
  }
  .expanded.filters-open .filters > label:not(.search-label),
  .expanded.filters-open .filters > #reset {
    left: 8px;
    right: 8px;
    width: auto;
    top: 48px;
  }
  .expanded.filters-open .filters > label:nth-of-type(3) {
    top: 94px;
  }
  .expanded.filters-open .filters > label:nth-of-type(4) {
    top: 140px;
  }
  .expanded.filters-open .filters > #reset {
    top: 186px;
  }
  .expanded .filters select {
    font-size: 16px;
    min-height: 44px;
  }
}
@media (max-width: 680px) {
  .explorer[data-mode="3d"] .event,
  .explorer[data-mode="3d"] .context-moment.event {
    width: 178px;
  }
  .explorer[data-mode="3d"] .event-surface {
    height: 264px;
  }
  .expanded .toolbar {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
}
/* Narrow-screen cards use a compact thumbnail beside the text in flat view. */
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .expanded .base {
    scroll-padding-top: 62px;
  }
  .expanded[data-mode="2d"] .stage,
  .expanded[data-mode="2d"].filters-open .stage {
    min-height: 480px;
    flex-basis: 480px;
    scroll-margin-top: 62px;
  }
  .explorer[data-mode="2d"] .event {
    width: 280px;
  }
  .explorer[data-mode="2d"] .event-surface {
    height: 200px;
    position: relative;
  }
  .explorer[data-mode="2d"] .event .event-media,
  .explorer[data-mode="2d"] .event .graphic {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 100%;
    overflow: hidden;
  }
  .explorer[data-mode="2d"] .event .thumbnail-frame {
    height: 100%;
    --thumbnail-height: 100%;
  }
  .explorer[data-mode="2d"] .event img {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
  .explorer[data-mode="2d"] .event-copy {
    margin-left: 70px;
    padding: 10px;
  }
  .explorer[data-mode="2d"] .event-title {
    font-size: 18px;
  }
  .expanded .toolbar {
    flex-wrap: wrap;
  }
  .expanded .explorer-title {
    min-width: 0;
    font-size: 18px;
  }
  .expanded .mode-switch button,
  .expanded .exit {
    font-size: 14px;
  }
  h1 {
    overflow-wrap: anywhere;
  }
  .masthead .brand {
    min-width: 0;
  }
  .masthead .private-label {
    flex-shrink: 0;
  }
}
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .explorer[data-mode="2d"] .event .thumbnail-frame {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 100%;
    --thumbnail-height: 200px;
  }
  .explorer[data-mode="2d"] .event .thumbnail-frame .event-media.image-crop {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 100% !important;
  }
}
/* Give the larger touch cards their own grid rows in phone landscape. */
@media (min-width: 700px) and (max-width: 950px) and (max-height: 820px) and (pointer: coarse) {
  .expanded .base {
    grid-template-rows: auto auto minmax(300px, 1fr) 100px auto auto;
  }
  .expanded[data-mode="2d"] .base {
    grid-template-rows: auto auto minmax(380px, 1fr) 100px auto auto;
  }
}
/* v22: screen-sized mobile explorer, with settings outside the browsing layout. */
.options-panel {
  display: contents;
}
.options-header,
.mobile-options-toggle,
.preview-open {
  display: none;
}
.explorer:not(.expanded) .stage {
  height: clamp(500px, 65vh, 740px);
}
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .explorer:not(.expanded) {
    height: clamp(440px, 72svh, 620px);
    pointer-events: auto;
  }
  .explorer:not(.expanded):after {
    display: none;
  }
  .explorer:not(.expanded) .stage {
    height: calc(clamp(440px, 72svh, 620px) - 54px);
  }
  .explorer:not(.expanded) .options-panel,
  .explorer:not(.expanded) .population,
  .explorer:not(.expanded) .transport,
  .explorer:not(.expanded) .gesture {
    display: none;
  }
  .explorer:not(.expanded) .preview-open {
    display: flex;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    align-items: flex-end;
    justify-content: center;
    padding: 0 12px 20px;
    z-index: 40;
    color: var(--ivory);
    font-size: 17px;
    background: linear-gradient(transparent 78%, #061621 96%);
    border: 0;
    gap: 14px;
  }
  .expanded {
    overscroll-behavior: none;
  }
  .expanded .base {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr) 20px 112px 52px;
    height: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
    overflow: hidden;
    scroll-padding: 0;
  }
  .expanded .toolbar {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    top: auto;
    min-height: 0;
    height: 48px;
    flex-wrap: nowrap;
    padding: 2px 8px;
    gap: 6px;
    z-index: 45;
  }
  .expanded .explorer-title {
    display: none;
  }
  .expanded .mode-switch {
    margin-right: auto;
  }
  .expanded .toolbar button {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
    padding: 5px 10px;
  }
  .expanded .mode-switch button {
    min-width: 44px;
  }
  .expanded .mobile-options-toggle {
    display: block;
  }
  .expanded .exit {
    min-width: 52px;
  }
  .expanded .options-panel {
    display: none;
  }
  .expanded.filters-open .options-panel {
    display: block;
    position: absolute;
    inset: calc(48px + env(safe-area-inset-top)) 0 0;
    z-index: 44;
    background: var(--surface);
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
  }
  .expanded .options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 17px;
  }
  .options-header button {
    font-size: 15px;
    min-height: 44px;
  }
  .expanded .filters,
  .expanded.filters-open .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    gap: 10px;
    min-height: 0;
    max-height: none;
    position: static;
  }
  .expanded #filter-toggle {
    display: none;
  }
  .expanded .filters .search-label {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
    width: 100%;
  }
  .expanded .filters .search-label input {
    font-size: 16px;
  }
  .expanded.filters-open .filters > label:not(.search-label),
  .expanded.filters-open .filters > #reset {
    display: block;
    position: static;
    width: 100%;
    box-shadow: none;
    grid-column: 1;
  }
  .expanded .filters select {
    font-size: 16px;
    min-height: 44px;
    width: 100%;
  }
  .expanded .scene-meta {
    display: flex;
    flex-wrap: wrap;
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    padding: 16px 0;
    gap: 12px;
    letter-spacing: 0;
  }
  .expanded .direction-control {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  .expanded .direction-control select {
    font-size: 16px;
    min-height: 44px;
  }
  .expanded .era-strip {
    width: 100%;
    flex-basis: 100%;
    margin: 0;
  }
  .expanded .era-strip button {
    font-size: 14px;
    min-height: 44px;
  }
  .expanded .scene-meta #count {
    display: block;
    font-size: 13px;
  }
  .expanded .preview-controls {
    display: flex;
    position: static;
    grid-column: auto;
    grid-row: auto;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 0;
    border: 0;
    gap: 12px;
    font-size: 14px;
  }
  .expanded .preview-controls select {
    font-size: 16px;
    max-width: 100%;
  }
  .expanded .preview-controls > span {
    display: none;
  }
  .expanded .stage,
  .expanded[data-mode="3d"] .stage,
  .expanded[data-mode="2d"] .stage,
  .expanded.filters-open .stage,
  .expanded .reading-list {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    min-height: 0 !important;
    max-height: none;
    min-width: 0;
    flex-basis: auto;
    scroll-margin: 0;
    align-self: stretch;
  }
  .expanded .stage {
    touch-action: none;
  }
  .expanded .reading-list {
    overflow: auto;
  }
  .expanded .gesture {
    grid-column: 1;
    grid-row: 3;
    padding: 1px 8px;
    font-size: 11px;
    line-height: 18px;
    min-width: 0;
    overflow: hidden;
  }
  .expanded .zoom-control {
    display: none;
  }
  .expanded .population {
    grid-column: 1;
    grid-row: 4;
    padding: 3px 10px 0;
    border-left: 0;
    min-width: 0;
    height: 112px;
    overflow: hidden;
  }
  .expanded .population-heading {
    display: flex;
    height: 69px;
    min-height: 69px;
    gap: 6px;
    align-items: flex-start;
  }
  .expanded .population-heading > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 12px 30px 26px !important;
    min-width: 0;
    gap: 0;
    flex: 1;
  }
  .expanded .population-heading .eyebrow {
    grid-column: 1;
    grid-row: 1;
    font-size: 10px;
    line-height: 12px;
  }
  .expanded .population-heading strong {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px;
    line-height: 15px;
    align-self: center;
    overflow-wrap: normal;
  }
  .expanded .population-heading small {
    grid-column: 1;
    grid-row: 3;
    font-size: 11px;
    line-height: 13px;
    overflow: hidden;
    align-self: start;
  }
  .expanded .population .text-button {
    font-size: 11px;
    line-height: 14px;
    max-width: 55px;
    min-width: 44px;
    min-height: 44px;
    padding: 1px;
    text-align: right;
    white-space: normal;
  }
  .expanded .population-chart {
    height: 40px;
  }
  .expanded .transport {
    grid-column: 1;
    grid-row: 5;
    padding: 4px 8px;
    gap: 8px;
    min-width: 0;
    height: 52px;
    align-items: center;
  }
  .expanded .transport button {
    padding: 5px 7px;
    min-height: 44px;
    font-size: 13px;
  }
  .expanded .transport button span:not([aria-hidden]) {
    display: none;
  }
  .expanded .transport button {
    min-width: 44px;
  }
  .expanded .transport-centre {
    min-width: 0;
    flex: 1;
    gap: 0;
    font-size: 12px;
  }
  .expanded .transport-centre > span {
    max-width: 100%;
    height: 16px;
    line-height: 16px;
    display: block;
  }
  .expanded #time-slider {
    height: 24px;
    margin: 0;
  }
  .explorer[data-mode="3d"] .event,
  .explorer[data-mode="3d"] .context-moment.event {
    width: 200px;
  }
  .explorer[data-mode="3d"] .event-surface {
    height: 210px;
  }
  .explorer[data-mode="3d"] .event img,
  .explorer[data-mode="3d"] .event .graphic,
  .explorer[data-mode="3d"] .world-drawing {
    height: 54px;
  }
  .explorer[data-mode="3d"] .event .thumbnail-frame {
    --thumbnail-height: 54px;
  }
  .explorer[data-mode="3d"] .world-drawing svg {
    height: 46px;
    width: 70px;
  }
  .explorer[data-mode="3d"] .event .event-copy {
    padding: 8px;
  }
  .explorer[data-mode="3d"] .event .event-title {
    font-size: 17px;
    line-height: 1.12;
  }
  .explorer[data-mode="3d"] .event .event-date {
    font-size: 14px;
    margin-bottom: 5px;
  }
  .explorer[data-mode="3d"] .event .event-location {
    font-size: 12px;
    margin-top: 5px;
  }
  .explorer[data-mode="2d"] .event {
    width: 280px;
  }
  .explorer[data-mode="2d"] .event-surface {
    height: 160px;
  }
  .explorer[data-mode="2d"] .event .event-copy {
    padding: 8px;
    margin-left: 60px;
  }
  .explorer[data-mode="2d"] .event .event-title {
    font-size: 17px;
    line-height: 1.12;
  }
  .explorer[data-mode="2d"] .event-date {
    font-size: 14px;
  }
  .explorer[data-mode="2d"] .event-location {
    font-size: 12px;
    margin-top: 5px;
  }
  .explorer[data-mode="2d"] .event .event-media,
  .explorer[data-mode="2d"] .event .graphic,
  .explorer[data-mode="2d"] .event .thumbnail-frame {
    width: 60px;
  }
  .explorer[data-mode="2d"] .event .thumbnail-frame {
    --thumbnail-height: 160px;
  }
  .explorer[data-mode="2d"] .scene-label {
    display: none;
  }
  .explorer[data-mode="2d"] .context-moment {
    width: 246px;
    min-height: 44px;
    height: 54px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 4px 7px;
    border: 1px solid var(--rule);
    background: #0b2633;
  }
  .explorer[data-mode="2d"] .context-moment svg {
    grid-column: 1;
    grid-row: 1;
    width: 28px;
    height: 28px;
  }
  .explorer[data-mode="2d"] .context-moment strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 14px;
    line-height: 1.12;
    text-wrap: balance;
  }
  .explorer[data-mode="2d"] .context-moment .context-year {
    grid-column: 3;
    grid-row: 1;
    font-size: 13px;
    white-space: normal;
    padding: 2px 4px;
    max-width: 66px;
  }
  .expanded .overlay {
    position: absolute;
    inset: 0;
    z-index: 60;
  }
  .expanded .story-dialog {
    height: auto;
    max-height: 100%;
  }
}
@media (orientation: landscape) and (max-height: 540px) and (max-width: 680px),
  (orientation: landscape) and (max-height: 540px) and (max-width: 950px) and (pointer: coarse) {
  .expanded .base,
  .expanded[data-mode="2d"] .base {
    grid-template-columns: minmax(0, 1fr) 210px;
    grid-template-rows: 48px minmax(0, 1fr) 20px;
  }
  .expanded .toolbar {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .expanded .stage,
  .expanded[data-mode="3d"] .stage,
  .expanded[data-mode="2d"] .stage,
  .expanded .reading-list {
    grid-column: 1;
    grid-row: 2;
    min-height: 0 !important;
  }
  .expanded .gesture {
    grid-column: 1;
    grid-row: 3;
  }
  .expanded .population {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    border-left: 1px solid var(--rule);
    padding: 5px 8px;
    height: 125px;
  }
  .expanded .population-heading {
    height: 80px;
    min-height: 80px;
  }
  .expanded .population-heading > div {
    grid-template-rows: 12px 34px 30px !important;
  }
  .expanded .transport {
    grid-column: 2;
    grid-row: 2/4;
    align-self: end;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    grid-template-rows: 40px 44px;
    height: 96px;
    border-left: 1px solid var(--rule);
    padding: 4px 8px 8px;
  }
  .expanded .transport-centre {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .expanded #previous {
    grid-column: 1;
    grid-row: 2;
  }
  .expanded #next {
    grid-column: 3;
    grid-row: 2;
  }
}

/* Wider history stays identifiable in the accessible reading sequence. */
.list-event.list-world {
  border-left: 2px solid var(--copper);
  padding-left: 12px;
  background: #16314066;
}
.list-event.list-world .list-date {
  color: var(--ivory);
}

.empty {
  max-height: 100%;
  overflow: auto;
}
.empty > button {
  display: block;
  max-width: 100%;
  margin: 8px auto;
  font-size: 16px;
}

/* v24 symbolic story covers: deliberate motifs where no photograph is selected. */
.symbolic-graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  background: radial-gradient(ellipse at 60% 10%, #284b58, #0b2532);
  color: var(--ivory);
  padding: 12px;
  overflow: hidden;
}
.symbolic-graphic > svg {
  position: static;
  width: 80px;
  height: 66px;
  flex: 0 1 auto;
  opacity: 0.8;
  color: var(--copper);
}
.symbolic-graphic > span {
  position: static;
  font:
    500 12px/1.2 Atkinson,
    Arial,
    sans-serif;
  letter-spacing: 0.05em;
  text-align: center;
}
.story-body .symbolic-graphic {
  min-height: 200px;
  aspect-ratio: 3/2;
  padding: 24px;
}
.story-body .symbolic-graphic > svg {
  width: 140px;
  height: 120px;
}
.story-body .symbolic-graphic > span {
  font-size: 16px;
}
@media (max-width: 680px) {
  .explorer[data-mode="2d"] .symbolic-graphic {
    padding: 5px;
  }
  .explorer[data-mode="2d"] .symbolic-graphic > svg {
    width: 50px;
    height: 52px;
  }
  .explorer[data-mode="2d"] .symbolic-graphic > span {
    display: none;
  }
  .symbolic-graphic > svg {
    height: 40px;
    width: 50px;
  }
  .symbolic-graphic > span {
    font-size: 11px;
  }
  .story-body .symbolic-graphic {
    min-height: 130px;
    max-height: 230px;
  }
}

/* Display a sideways archive plate upright without changing retained pixels. */
.event-media.image-crop.rotate-scan img {
  transform-origin: top left;
  transform: rotate(-90deg) translateX(-100%);
}

/* v31: distinct, consistent wider-history artwork in cards and popups. */
.icon-accent {
  stroke: #e7a576;
  stroke-width: 2;
}
.context-story-art {
  width: 112px;
  height: 96px;
  margin: 0 0 18px;
  color: #cedde0;
}
.context-story-art svg {
  width: 100%;
  height: 100%;
  display: block;
}
.explorer[data-mode="3d"] .world-drawing svg {
  stroke-width: 1.7;
}
@media (max-width: 680px) {
  .context-story-art {
    width: 86px;
    height: 74px;
    margin-bottom: 14px;
  }
}
/* Detailed book-style vignettes, with original alpha preserved. */
.journeys-launch {
  margin-top: 12px;
  width: 100%;
  color: var(--copper);
}
.journeys-toggle {
  white-space: nowrap;
}
.journey-picker {
  display: block !important;
  padding: 28px !important;
  overflow: auto;
}
.journey-intro {
  max-width: 740px;
  margin: 0 0 24px;
}
.journey-intro h2 {
  font:
    38px/1.1 Newsreader,
    Georgia,
    serif;
  margin: 10px 0;
}
.journey-intro p {
  font-size: 17px;
  line-height: 1.5;
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.journey-choice {
  border: 1px solid var(--rule);
  background: #102e3b;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.journey-choice > .event-media,
.journey-choice > .thumbnail-frame {
  display: block;
  height: 150px;
  width: 100%;
  overflow: hidden;
  aspect-ratio: auto !important;
}
.journey-choice > .event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.journey-choice > div {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.journey-choice .eyebrow {
  font-size: 12px;
  margin: 0 0 10px;
}
.journey-choice h3 {
  font:
    28px/1.12 Newsreader,
    Georgia,
    serif;
  margin: 0 0 10px;
}
.journey-choice p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.journey-choice details {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px;
}
.journey-choice summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--copper);
}
.journey-choice summary:before {
  content: "▸";
  margin-right: 8px;
}
.journey-choice details[open] summary:before {
  content: "▾";
}
.journey-choice ol {
  padding-left: 22px;
}
.journey-choice li {
  padding: 5px 0;
}
.journey-choice li span {
  color: var(--muted);
  display: block;
}
.journey-choice .primary {
  margin-top: auto;
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .expanded .toolbar {
    gap: 3px;
    padding-inline: 4px;
  }
  .expanded .toolbar button {
    padding: 4px 5px;
    font-size: 12px;
    min-width: 44px;
  }
  .expanded .mode-switch button {
    padding: 4px;
    min-width: 36px;
  }
  .expanded .toolbar .explorer-title {
    display: none;
  }
  .expanded .mode-switch {
    margin-right: auto;
  }
  .expanded .toolbar .exit {
    min-width: 44px;
  }
  .journey-picker {
    padding: 16px !important;
  }
  .journey-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .journey-intro h2 {
    font-size: 30px;
  }
  .journey-choice h3 {
    font-size: 25px;
  }
  .journey-choice > div {
    padding: 16px;
  }
}
.context-ink {
  display: block;
  object-fit: contain;
  object-position: center;
  pointer-events: auto;
}
.explorer[data-mode="3d"] .world-drawing .context-ink {
  width: calc(100% - 16px);
  height: calc(100% - 8px);
  margin: 4px 8px;
  object-fit: contain;
}
.explorer[data-mode="2d"] .context-moment {
  grid-template-columns: 56px minmax(0, 1fr);
}
.explorer[data-mode="2d"] .context-moment .context-ink {
  grid-column: 1;
  grid-row: 1/3;
  width: 56px;
  height: 50px;
  align-self: center;
  margin: 0;
}
.context-story-art {
  width: 220px;
  height: auto;
  margin: 0 0 20px;
}
.context-story-art .context-ink {
  width: 100%;
  height: 165px;
  object-fit: contain;
}
.context-story-art figcaption {
  font-size: 11px;
  line-height: 1.3;
  margin-top: 4px;
  color: var(--muted);
}
@media (max-width: 680px) {
  .context-story-art {
    width: 160px;
    height: auto;
    margin-bottom: 14px;
  }
  .context-story-art .context-ink {
    height: 120px;
  }
  .explorer[data-mode="3d"] .world-event .world-surface {
    height: 242px;
  }
  .explorer[data-mode="3d"] .world-drawing {
    height: 86px;
  }
  .explorer[data-mode="2d"] .context-moment {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }
  .explorer[data-mode="2d"] .context-moment .context-ink {
    grid-column: 1;
    grid-row: 1;
    width: 38px;
    height: 42px;
  }
}
.journey-choice > .journey-cover {
  display: block;
  width: 100%;
  height: 150px;
  max-height: none;
  object-fit: cover;
  flex: none;
}
.journey-choice > .thumbnail-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #e8e1d1;
}
.journey-choice > .thumbnail-frame .image-crop {
  flex: none;
  width: min(100%, calc(150px * var(--crop-aspect))) !important;
}

/* Journey context remains inside the reading popup, leaving the track clear. */
.journey-story-note {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--copper);
  background: #153442;
  border-radius: 0 4px 4px 0;
}
.journey-story-note p {
  font-size: 17px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.journey-story-note p:last-child {
  margin-bottom: 0;
}
.journey-story-note .eyebrow {
  font-size: 12px;
  line-height: 1.5;
  color: var(--copper);
}
.journey-next-preview {
  color: var(--muted);
}
.journey-next-preview strong {
  color: var(--ivory);
}
.journey-recommendation {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--rule);
  background: #153442;
}
.journey-recommendation button {
  white-space: normal;
  min-height: 44px;
  max-width: 100%;
}
@media (max-width: 680px) {
  .journey-story-note {
    padding: 12px;
    margin: 20px 0;
  }
  .journey-story-note p {
    font-size: 16px;
  }
  .journey-recommendation {
    padding: 12px;
  }
}

.leave-journey {
  color: var(--copper);
  border-color: var(--copper);
  white-space: nowrap;
}
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .expanded.guided .toolbar {
    gap: 2px;
    padding-inline: 4px;
  }
  .expanded.guided .toolbar .mode-switch {
    flex: 0 0 auto;
    margin-right: auto;
  }
  .expanded.guided .mode-switch button {
    min-width: 32px;
    padding-inline: 3px;
  }
  .expanded.guided .toolbar #journeys-toggle {
    min-width: 50px;
    padding-inline: 3px;
  }
  .expanded.guided .toolbar #leave-journey {
    white-space: normal;
    width: 58px;
    min-width: 58px;
    padding: 3px;
    line-height: 1.15;
  }
  .expanded.guided .toolbar #mobile-options-toggle {
    min-width: 44px;
    padding-inline: 3px;
  }
  .expanded.guided .toolbar #exit {
    min-width: 40px;
    padding-inline: 3px;
  }
}

.related-stories {
  border-top: 1px solid #4a6068;
  margin-top: 1.5rem;
  padding-top: 1rem;
}
.related-stories:has(h3:only-child) {
  display: none;
}
.related-stories h3 {
  font-size: 1rem;
}
.related-stories button {
  display: block;
  text-align: left;
  width: 100%;
  padding: 0.7rem 0;
  line-height: 1.45;
}
.related-stories button span {
  display: block;
  color: var(--muted, #b5c6ca);
  font-size: 0.8em;
}
.related-back {
  display: block;
  text-align: left;
  margin-top: 1rem;
}

.timeline-site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.timeline-site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.environment-banner {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 4px 10px;
  background: #e59062;
  color: #061621;
  z-index: 100;
  font-size: 0.7rem;
}
.page-footer {
  padding-bottom: 40px;
}
@media (max-width: 680px) {
  .masthead {
    flex-wrap: wrap;
    gap: 10px;
  }
  .timeline-site-nav {
    gap: 15px;
  }
  .timeline-site-nav a {
    font-size: 0.8rem;
  }
}

/* Owner-requested launch emphasis: open the full experience. */
.intro h1 {
  font-size: clamp(3rem, 5.8vw, 5.5rem);
  max-width: 11ch;
}
.intro-aside {
  flex: 0 0 340px;
  max-width: 340px;
}
#launch {
  min-height: 78px;
  padding: 18px 20px;
  font-size: 1.1rem;
  line-height: 1.25;
  text-align: left;
  gap: 18px;
  border: 2px solid #f0ac87;
  box-shadow: 0 8px 28px #0005;
}
#launch > span {
  font-size: 1.7rem;
}
.intro-aside .launch-hint {
  display: block;
  margin: 12px 0 4px;
  color: var(--ivory);
  font-size: 0.82rem;
  line-height: 1.4;
}
.explorer:not(.expanded) .preview-open > span {
  background: var(--copper);
  color: var(--navy);
  padding: 15px 18px;
  border: 2px solid #f0ac87;
  font-weight: 600;
  border-radius: 2px;
}
@media (max-width: 680px) {
  .intro-aside {
    max-width: none;
  }
  #launch {
    width: 100%;
    min-height: 76px;
  }
}

/* Direct return remains available in the expanded timeline. */
.toolbar .history-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--copper);
  color: var(--copper);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  flex-shrink: 0;
}
.toolbar .history-return:hover {
  background: rgba(229, 144, 98, 0.13);
}
.toolbar .history-return:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 2px;
}
@media (max-width: 680px), (pointer: coarse) and (max-width: 950px) {
  .toolbar .history-return {
    padding: 4px 6px;
    font-size: 12px;
  }
  .history-return-long {
    display: none;
  }
}

/* Keep navigation in view; the scene takes the space left by the controls. */
.expanded .base > :not(.stage):not(.reading-list) {
  flex-shrink: 0;
}
.expanded .transport {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
