:root {
  --bg: #f2f0e9;
  --ink: #171a17;
  --muted: #6e736c;
  --line: #c9cec5;
  --line-strong: #929a90;
  --card: #fbfaf6;
  --accent: #2e5639;
  --accent-soft: #dce6dc;
  --shadow: none;
  --dock-height: 150px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: 'Frutiger', Arial, Helvetica, sans-serif;
  background: var(--bg);
}

button,
input { font: inherit; }

.timeline-page {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 calc(var(--dock-height) + 70px);
}

.timeline-page > .portal-back {
  margin-bottom: 12px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.header-title { min-width: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}

.eyebrow,
.section-kicker,
.term-kicker,
.jurisdiction-type,
.year-control label,
.placeholder-kicker {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow { margin: 0 0 9px; }

h1 {
  margin: 0;
  font-size: clamp(3.1rem, 6vw, 5rem);
  line-height: .88;
  letter-spacing: -.058em;
}

.header-note {
  max-width: 430px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
  text-align: left;
}

.leader-search {
  width: min(430px, 38vw);
  min-width: 320px;
  align-self: flex-end;
}

.leader-search > label {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.leader-search-controls {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
}

.leader-search-controls input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  font-size: .78rem;
  outline: none;
}

.leader-search-controls input:focus {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.leader-search-controls input::placeholder { color: var(--muted); }

.leader-search-arrow {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.leader-search-arrow:first-child { border-radius: 5px 0 0 5px; }
.leader-search-arrow:last-child { border-radius: 0 5px 5px 0; }
.leader-search-arrow:hover:not(:disabled) { background: var(--accent-soft); }
.leader-search-arrow:focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.leader-search-arrow:disabled {
  color: var(--line-strong);
  cursor: default;
  opacity: .48;
}

.leader-search-status {
  min-height: 1.2em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .63rem;
  font-weight: 600;
  line-height: 1.2;
}

.diagram-shell {
  padding: 34px 0 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.government-view {
  min-width: 1480px;
}

.loading-panel,
.error-panel,
.pre-federation-panel {
  min-height: 330px;
  display: grid;
  place-items: center;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(251, 250, 246, .92);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.pre-federation-panel {
  place-items: stretch;
  align-content: center;
  text-align: center;
}

.pre-federation-panel .pre-year {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: clamp(4.5rem, 9vw, 8rem);
  font-weight: 700;
  line-height: .85;
  letter-spacing: -.07em;
}

.pre-federation-panel h2 {
  margin: 12px 0 8px;
  font-size: 1.8rem;
  letter-spacing: -.04em;
}

.pre-federation-panel p {
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.55;
}

.federal-system {
  position: relative;
  padding-bottom: 46px;
}

.federal-flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.federal-panel {
  --party-colour: var(--accent);
  flex: 1 1 0;
  max-width: 720px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-top: 7px solid var(--party-colour);
  border-radius: 6px;
  background: rgba(251, 250, 246, .94);
  box-shadow: var(--shadow);
}

.federal-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.federal-heading h2 {
  margin: 3px 0 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.045em;
}

.year-badge {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.05em;
}

.term-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
}

.term-top {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 154px;
}

.pm-photo-link {
  display: block;
  min-height: 154px;
  overflow: hidden;
  background: var(--accent-soft);
}

.pm-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 154px;
  object-fit: cover;
  object-position: 50% 22%;
  filter: saturate(.86) contrast(.98);
}

.term-summary {
  padding: 16px 17px 14px;
}

.term-kicker {
  margin-bottom: 5px;
  color: var(--party-colour);
}

.term-summary h3 {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.party-name {
  margin: 0 0 13px;
  color: var(--party-colour);
  font-size: .82rem;
  font-weight: 700;
}

.term-dates {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.term-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 17px;
  padding: 16px 17px 18px;
  border-top: 1px solid var(--line);
}

.term-content h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.term-content p,
.achievement-list {
  margin: 0;
  font-size: .84rem;
  line-height: 1.48;
}

.achievement-list {
  padding-left: 18px;
}

.achievement-list li + li { margin-top: 5px; }

.no-achievements { color: var(--muted); }

.transition-connector {
  position: relative;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 80px;
}

.transition-connector::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-strong);
}

.transition-date {
  position: relative;
  z-index: 1;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.federal-system::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 46px;
  background: var(--line-strong);
}

.jurisdictions {
  position: relative;
  padding-top: 82px;
}

.jurisdictions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 82px;
  background: var(--line-strong);
}

.jurisdictions-header {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

.jurisdictions-header h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -.035em;
}

.jurisdictions-header p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.states-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  gap: 12px;
  padding-top: 28px;
}

.states-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(6.25%);
  right: calc(6.25%);
  height: 1px;
  background: var(--line-strong);
}

.state-branch {
  position: relative;
  min-width: 0;
}

.state-branch::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 50%;
  width: 1px;
  height: 28px;
  background: var(--line-strong);
}

.jurisdiction-card {
  min-height: 106px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(251, 250, 246, .94);
  box-shadow: none;
}

.jurisdiction-card h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.jurisdiction-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
}

.local-connector {
  width: 1px;
  height: 26px;
  margin: 0 auto;
  background: var(--line-strong);
}

.local-placeholder {
  min-height: 90px;
  border-color: rgba(46, 86, 57, .5);
  background: var(--accent-soft);
}

.local-placeholder .jurisdiction-type { color: var(--accent); }

.timeline-dock {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--dock-height);
  border-top: 1px solid var(--line-strong);
  background: rgba(242, 240, 233, .96);
  box-shadow: none;
}

.timeline-dock-inner {
  width: min(1600px, calc(100% - 48px));
  min-height: var(--dock-height);
  display: grid;
  grid-template-columns: auto 98px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 0 auto;
  padding: 18px 0 21px;
}

.present-button {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  text-transform: uppercase;
}

.present-button:hover,
.present-button:focus-visible {
  background: #24472f;
  outline: none;
}

.year-control {
  display: grid;
  gap: 4px;
}

.year-control label { font-size: .62rem; }

.year-control input {
  width: 98px;
  padding: 3px 0 2px;
  border: 0;
  border-bottom: 2px solid var(--accent);
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  -moz-appearance: textfield;
}

.year-control input::-webkit-outer-spin-button,
.year-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.range-wrap {
  position: relative;
  padding-top: 2px;
}

.year-slider {
  width: 100%;
  height: 32px;
  margin: 0;
  cursor: ew-resize;
  accent-color: var(--accent);
}

.year-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
}

.year-slider::-webkit-slider-thumb {
  width: 23px;
  height: 23px;
  margin-top: -9px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  -webkit-appearance: none;
}

.year-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
}

.year-slider::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.range-labels {
  position: relative;
  height: 32px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
}

.range-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.range-labels span:first-child {
  left: 0;
  transform: none;
}

.range-labels span:last-child {
  right: 0;
  transform: none;
  text-align: right;
}

.range-labels small {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 500;
}

.federation-label { left: var(--federation-position, 48.7%); }

@media (max-width: 950px) {
  :root { --dock-height: 188px; }

  .timeline-page,
  .timeline-dock-inner { width: min(100% - 28px, 1600px); }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .header-note { text-align: left; }

  .timeline-dock-inner {
    grid-template-columns: auto 98px;
    grid-template-areas:
      'present year'
      'range range';
    gap: 12px 18px;
  }

  .present-button { grid-area: present; }
  .year-control { grid-area: year; }
  .range-wrap { grid-area: range; }
}

@media (max-width: 640px) {
  :root { --dock-height: 198px; }
  .timeline-page { padding-top: 24px; }
  h1 { font-size: 3.2rem; }
  .diagram-shell { margin-right: -14px; }
}

/* Jurisdiction history --------------------------------------------------- */
:root {
  --status-state: #2e5639;
  --status-self-territory: #3d6970;
  --status-commonwealth-territory: #94652f;
  --status-colony: #725844;
  --status-dependent: #7d837b;
  --status-unformed: #b4b8b2;
}

.pre-federation-context {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 27px 30px 25px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(251, 250, 246, .92);
  box-shadow: var(--shadow);
}

.pre-federation-context h2 {
  margin: 4px 0 7px;
  font-size: 2rem;
  letter-spacing: -.045em;
}

.pre-federation-context p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.pre-federation-context .pre-year {
  flex: 0 0 auto;
  margin: 0;
  color: var(--accent);
  font-size: clamp(4rem, 7vw, 7rem);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.07em;
}

.jurisdictions-header {
  align-items: flex-start;
}

.jurisdictions-header > div:first-child {
  max-width: 660px;
}

.jurisdictions-header p {
  max-width: 650px;
  margin-top: 5px;
  line-height: 1.42;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
  max-width: 650px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 600;
  white-space: nowrap;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: var(--card);
}

.legend-state { color: var(--status-state); }
.legend-self_governing_territory { color: var(--status-self-territory); }
.legend-commonwealth_territory { color: var(--status-commonwealth-territory); }
.legend-colony { color: var(--status-colony); }
.legend-part_of_other { color: var(--status-dependent); }
.legend-not_established { color: var(--status-unformed); }
.legend-part_of_other i { border-style: dashed; }
.legend-not_established i { border-style: dotted; opacity: .65; }

.jurisdiction-card {
  position: relative;
  min-height: 215px;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  border-top-width: 5px;
}

.jurisdiction-state { border-top-color: var(--status-state); }
.jurisdiction-self_governing_territory { border-top-color: var(--status-self-territory); }
.jurisdiction-commonwealth_territory { border-top-color: var(--status-commonwealth-territory); }
.jurisdiction-colony { border-top-color: var(--status-colony); }

.jurisdiction-part_of_other {
  border-top-color: var(--status-dependent);
  border-style: dashed;
  background: rgba(251, 250, 246, .65);
  box-shadow: none;
}

.jurisdiction-not_established {
  border-top-color: var(--status-unformed);
  border-style: dotted;
  background: rgba(251, 250, 246, .34);
  box-shadow: none;
  opacity: .64;
}

.jurisdiction-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px 10px;
  border-bottom: 1px solid var(--line);
}

.jurisdiction-card-heading h3 {
  margin: 0;
  font-size: 1rem;
  text-align: right;
}

.jurisdiction-code {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.jurisdiction-leader-surname { display: none; }

.status-sequence {
  display: grid;
  align-content: start;
  flex: 1;
  padding: 11px 12px 13px;
}

.status-entry {
  padding-left: 9px;
  border-left: 3px solid var(--line-strong);
}

.status-entry.status-state { border-left-color: var(--status-state); }
.status-entry.status-self_governing_territory { border-left-color: var(--status-self-territory); }
.status-entry.status-commonwealth_territory { border-left-color: var(--status-commonwealth-territory); }
.status-entry.status-colony { border-left-color: var(--status-colony); }
.status-entry.status-part_of_other { border-left-color: var(--status-dependent); border-left-style: dashed; }
.status-entry.status-not_established { border-left-color: var(--status-unformed); border-left-style: dotted; }

.status-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .59rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.status-state .status-label { color: var(--status-state); }
.status-self_governing_territory .status-label { color: var(--status-self-territory); }
.status-commonwealth_territory .status-label { color: var(--status-commonwealth-territory); }
.status-colony .status-label { color: var(--status-colony); }

.status-entry h4 {
  margin: 0 0 6px;
  font-size: .82rem;
  line-height: 1.18;
  letter-spacing: -.015em;
}

.status-entry p {
  margin: 0;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.38;
}

.parent-chip {
  display: inline-block;
  margin: 0 0 7px;
  padding: 3px 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: .59rem;
  font-weight: 700;
}

.jurisdiction-transition {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 9px 0;
  color: var(--accent);
  font-size: .59rem;
  font-weight: 700;
  text-transform: uppercase;
}

.jurisdiction-transition::before {
  content: '';
  height: 1px;
  background: var(--line);
}

.jurisdiction-transition span {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  padding: 2px 5px;
  background: var(--card);
}

.jurisdiction-transition b {
  display: none;
}

.has-status-transition {
  min-height: 310px;
}

.local-placeholder {
  min-height: 86px;
  padding: 13px;
  border-top: 1px solid rgba(46, 86, 57, .5);
  border-style: solid;
  opacity: 1;
}

.local-placeholder h3 {
  margin: 4px 0 0;
}

.local-placeholder p {
  margin-top: 8px;
}

.jurisdiction-footnote {
  max-width: 900px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.45;
}

.pre-federation-jurisdictions {
  padding-top: 94px;
}

.pre-federation-jurisdictions::before,
.pre-federation-jurisdictions .states-row::before,
.pre-federation-jurisdictions .state-branch::before {
  display: none;
}

.pre-federation-jurisdictions .states-row {
  padding-top: 0;
}

@media (max-width: 950px) {
  .pre-federation-context {
    align-items: flex-start;
  }

  .jurisdictions-header {
    gap: 10px;
  }

  .status-legend {
    max-width: 520px;
  }
}

/* Extra vertical room for the jurisdiction heading + status legend. */
.jurisdictions { padding-top: 135px; }
.jurisdictions::before { height: 135px; }
.pre-federation-jurisdictions { padding-top: 118px; }

/* Compact timeline layout ------------------------------------------------ */
:root { --dock-height: 126px; }

.timeline-page {
  width: min(1760px, calc(100% - 40px));
  padding-top: 22px;
  padding-bottom: calc(var(--dock-height) + 34px);
}

.page-header {
  gap: 32px;
  padding-bottom: 14px;
}

.back-link { margin-bottom: 12px; }
.eyebrow { margin-bottom: 6px; }

h1 {
  font-size: clamp(2.7rem, 4.8vw, 4.25rem);
  line-height: .9;
}

.header-note {
  max-width: 400px;
  font-size: .82rem;
  line-height: 1.45;
}

.diagram-shell { padding-top: 17px; }

/* A deliberate page-level zoom: the diagram is dense and designed to show
   the state layer without requiring a second screen-height of scrolling. */
.government-view {
  min-width: 1460px;
  zoom: .84;
}

/* Federal area keeps one stable height for every post-1901 year. */
.federal-system {
  height: 404px;
  padding-bottom: 34px;
}

.federal-flow {
  height: 370px;
  align-items: stretch;
}

.federal-panel {
  height: 370px;
  padding: 14px;
  border-top-width: 6px;
}

.federal-heading {
  min-height: 47px;
  margin-bottom: 10px;
  padding-bottom: 9px;
}

.federal-heading h2 { font-size: 1.55rem; }
.year-badge { font-size: 1.55rem; }

.term-card {
  height: 293px;
  display: grid;
  grid-template-rows: 102px minmax(0, 1fr);
}

.term-top {
  grid-template-columns: 84px minmax(0, 1fr);
  min-height: 102px;
}

.pm-photo-link,
.pm-photo {
  min-height: 102px;
  height: 102px;
}

.term-summary { padding: 11px 13px 9px; }
.term-summary h3 { font-size: clamp(1.15rem, 1.55vw, 1.55rem); }
.party-name { margin-bottom: 8px; font-size: .74rem; }
.term-dates { font-size: .68rem; }

.term-content {
  gap: 13px;
  padding: 10px 13px 12px;
  overflow: hidden;
}

.term-content h4 { margin-bottom: 4px; font-size: .61rem; }
.term-content p,
.achievement-list { font-size: .72rem; line-height: 1.34; }
.achievement-list { padding-left: 16px; }
.achievement-list li + li { margin-top: 3px; }

.transition-connector { flex-basis: 50px; }
.federal-system::after { height: 34px; }

/* Jurisdiction layer ----------------------------------------------------- */
.jurisdictions {
  padding-top: 92px;
}

.jurisdictions::before { height: 92px; }

.jurisdictions-header {
  top: 13px;
  gap: 14px;
}

.jurisdictions-header h2 { font-size: 1.35rem; }
.jurisdictions-header p { font-size: .69rem; }

.status-legend {
  gap: 5px 10px;
  max-width: 620px;
}

.legend-item { font-size: .59rem; }

.states-row {
  grid-template-columns: repeat(var(--jurisdiction-count, 8), minmax(112px, 1fr));
  gap: 11px;
  padding-top: 23px;
}

.states-row::before {
  left: var(--branch-edge, 6.25%);
  right: var(--branch-edge, 6.25%);
}

.state-branch::before {
  top: -23px;
  height: 23px;
}

.jurisdiction-card {
  min-height: 116px;
  border-top-width: 4px;
}


.jurisdiction-card-heading {
  padding: 9px 10px 7px;
}

.jurisdiction-card-heading h3 { font-size: .9rem; }
.jurisdiction-code { font-size: .61rem; }

.status-sequence { padding: 9px 10px 10px; }
.status-entry { padding-left: 8px; }

.status-label {
  margin-bottom: 3px;
  font-size: .54rem;
}

.status-entry h4 {
  margin: 0;
  font-size: .76rem;
  line-height: 1.15;
}

/* Paragraphs and parent chips were intentionally removed from jurisdiction
   cards; the timeline now communicates status without explanatory clutter. */
.status-entry p,
.parent-chip { display: none; }

.jurisdiction-transition {
  margin: 7px 0;
  font-size: .54rem;
}

.has-status-transition { min-height: 154px; }

.local-connector { height: 18px; }
.local-placeholder {
  min-height: 58px;
  padding: 9px 10px;
}
.local-placeholder h3 { font-size: .88rem; }
.local-placeholder p { display: none; }

.jurisdiction-footnote {
  margin-top: 10px;
  font-size: .58rem;
}

.pre-federation-context {
  min-height: 114px;
  padding: 18px 22px;
}

.pre-federation-context h2 { font-size: 1.55rem; }
.pre-federation-context p { font-size: .76rem; }
.pre-federation-context .pre-year { font-size: clamp(3.5rem, 6vw, 5.7rem); }

.pre-federation-jurisdictions { padding-top: 80px; }
.pre-federation-jurisdictions .states-row {
  width: 100%;
  padding-top: 0;
}

/* Timeline step controls ------------------------------------------------- */
.timeline-dock-inner {
  width: min(1760px, calc(100% - 40px));
  min-height: var(--dock-height);
  grid-template-columns: auto 92px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 0 14px;
}

.present-button { height: 38px; }
.year-control input { width: 92px; font-size: 1.8rem; }

.timeline-stepper {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.year-step-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--card);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.year-step-button:hover,
.year-step-button:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.year-step-button:disabled {
  border-color: var(--line);
  color: var(--line-strong);
  background: transparent;
  cursor: default;
  opacity: .55;
}

@media (max-width: 950px) {
  :root { --dock-height: 164px; }

  .timeline-page,
  .timeline-dock-inner { width: min(100% - 24px, 1760px); }

  .timeline-dock-inner {
    grid-template-columns: auto 92px;
    grid-template-areas:
      'present year'
      'range range';
  }

  .timeline-stepper { grid-area: range; }
  .timeline-stepper .range-wrap { grid-area: auto; }
  .government-view { zoom: .78; }
}

@media (max-width: 640px) {
  :root { --dock-height: 174px; }
  .timeline-stepper { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 7px; }
  .year-step-button { width: 38px; height: 38px; }
}

/* Persistent jurisdiction + local-government timeline ------------------- */
/* Present-day jurisdiction columns stay fixed in place. Before a political
   entity exists, its card remains as a very faint orientation marker. */
.state-branch.is-jurisdiction-inactive > .jurisdiction-card:first-of-type {
  opacity: .14;
  filter: grayscale(1);
  border-style: dotted;
  box-shadow: none;
}

.state-branch.is-jurisdiction-inactive::before {
  opacity: .12;
}

.jurisdiction-not_established {
  border-top-color: var(--status-unformed);
  background: rgba(251, 250, 246, .26);
}

.jurisdiction-not_established .status-sequence {
  opacity: .75;
}

/* One generic local-government layer per present-day jurisdiction, except
   the ACT. The tile is always present for orientation but only becomes
   visually active from that jurisdiction's first local civic government. */
.local-government-card {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(46, 86, 57, .48);
  border-top: 4px solid var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  box-shadow: none;
}

.local-government-card .jurisdiction-type {
  color: var(--accent);
  font-size: .54rem;
}

.local-government-card h3 {
  margin: 3px 0 0;
  font-size: .82rem;
}

.local-government-card .local-since {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .58rem;
  line-height: 1;
}

.local-government-card.is-inactive {
  opacity: .13;
  filter: grayscale(1);
  border-style: dotted;
  background: rgba(220, 230, 220, .3);
}

.local-connector.is-active {
  opacity: 1;
}

.local-connector.is-inactive {
  opacity: .12;
}

/* State and territory governing-party banners --------------------------- */
/* The banner represents the party supplying the head of government, not
   every party in a governing coalition. Transition years are divided into
   equal visual segments regardless of how many days each party governed. */
.jurisdiction-card {
  height: 158px;
  min-height: 158px;
}

.state-party-banner {
  --state-party-background: #969b93;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  background: var(--state-party-background);
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .42);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .01em;
}

.state-party-banner span {
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.state-party-banner.has-party-transition {
  font-size: .53rem;
}

.state-party-banner.is-neutral {
  color: #252925;
  text-shadow: none;
}

.state-party-banner + .status-sequence {
  padding-top: 8px;
}

/* Keep all political jurisdiction cards aligned even in years containing
   multiple government changes. Local-government cards remain below them. */
.has-status-transition {
  height: 158px;
  min-height: 158px;
}


/* Federal term jukebox --------------------------------------------------- */
.federal-jukebox {
  height: 370px;
  display: grid;
  grid-template-columns: 310px minmax(560px, 720px) 310px;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.federal-jukebox > .federal-panel {
  width: 100%;
  max-width: 720px;
}

.federal-preview-stack {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.previous-terms { justify-content: flex-end; }
.next-terms { justify-content: flex-start; }

.federal-term-preview {
  --party-colour: var(--accent);
  flex: 0 0 142px;
  height: 166px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 14px 13px 13px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-top: 12px solid var(--party-colour);
  border-radius: 12px;
  background: color-mix(in srgb, var(--party-colour) 14%, var(--card));
  box-shadow: 0 7px 20px rgba(20, 30, 20, .055);
}

.federal-term-preview.preview-far {
  flex-basis: 126px;
  height: 142px;
  opacity: .68;
}

.federal-term-preview strong {
  color: var(--party-colour);
  font-size: .82rem;
  line-height: 1.08;
}

.preview-prime-minister {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.025em;
}

.preview-term-number {
  margin-bottom: auto;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.preview-term-dates {
  color: var(--muted);
  font-size: .61rem;
  font-weight: 600;
  line-height: 1.25;
}

.term-duration {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: .84em;
  white-space: nowrap;
}

.term-dates {
  white-space: nowrap;
}

.federal-term-preview.is-empty {
  visibility: hidden;
}

/* The old multi-panel flow is retained elsewhere in the stylesheet, but the
   federal display now uses a fixed five-position term jukebox. */
.federal-system .federal-flow { display: none; }

@media (max-width: 950px) {
  .federal-jukebox {
    grid-template-columns: 278px minmax(540px, 700px) 278px;
    gap: 18px;
  }

  .federal-term-preview { flex-basis: 128px; }
  .federal-term-preview.preview-far { flex-basis: 112px; }
}


/* Federal timeline interaction + containment ----------------------------- */
.federal-jukebox > .federal-panel {
  display: flex;
  flex-direction: column;
}

.federal-jukebox > .federal-panel .term-card {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.federal-term-preview {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.federal-term-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 30, 20, .09);
}

.federal-term-preview:focus-visible,
.timeline-year-link:focus-visible {
  outline: 2px solid var(--party-colour, var(--accent));
  outline-offset: 3px;
}

.timeline-year-link {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .12em;
  cursor: pointer;
}

.year-badge.timeline-year-link {
  color: var(--accent);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.05em;
}


/* State Premier layer ---------------------------------------------------- */
/* Premier data comes from /data/australian_state_premier_terms.json.
   In transition years every overlapping premiership is listed. Victorian
   records also display the supplied portrait when one or two Premiers occur
   in the selected year. */
.jurisdiction-card {
  height: 216px;
  min-height: 216px;
}

.has-status-transition {
  height: 216px;
  min-height: 216px;
}

.state-premier-summary {
  min-height: 58px;
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 6px 7px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, .76);
}

.state-premier-photo {
  flex: 0 0 34px;
  width: 34px;
  height: 46px;
  align-self: center;
  border-radius: 4px;
  object-fit: cover;
  object-position: 50% 22%;
  background: var(--accent-soft);
  filter: saturate(.86) contrast(.98);
}

.state-premier-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.state-premier-label {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .49rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.state-premier-list {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.state-premier-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-premier-summary.premier-count-3 .state-premier-name,
.state-premier-summary.premier-count-4 .state-premier-name,
.state-premier-summary.premier-count-5 .state-premier-name {
  font-size: .51rem;
  line-height: 1.02;
}

.state-premier-summary + .status-sequence {
  padding-top: 7px;
}

.state-branch.is-jurisdiction-inactive .state-premier-summary {
  display: none;
}

/* Compact header + corrected timeline control alignment ------------------ */
.page-header h1 {
  white-space: nowrap;
}

.timeline-dock-inner {
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
}

.present-button {
  justify-self: end;
  white-space: nowrap;
}

.year-slider {
  display: block;
  height: 42px;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.year-slider::-webkit-slider-runnable-track {
  height: 4px;
}

.year-slider::-webkit-slider-thumb {
  margin-top: -9.5px;
  -webkit-appearance: none;
}

.year-slider::-moz-range-track {
  height: 4px;
}

.year-slider::-moz-range-thumb {
  margin: 0;
}

.year-step-button {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.year-step-button > span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

/* The status legend was removed from the markup; reclaim its vertical room. */
.jurisdictions {
  padding-top: 74px;
}

.jurisdictions::before {
  height: 74px;
}

.jurisdictions-header {
  top: 11px;
}

/* Local government is a secondary layer, so keep these cards deliberately compact. */
.jurisdiction-card.local-government-card {
  height: 62px;
  min-height: 62px;
  padding: 8px 10px;
}

.local-government-card .jurisdiction-type {
  font-size: .5rem;
}

.local-government-card h3 {
  margin-top: 2px;
  font-size: .78rem;
  line-height: 1.05;
}

.local-government-card .local-since {
  margin-top: 3px;
  font-size: .55rem;
}

.local-connector {
  height: 12px;
}

@media (max-width: 950px) {
  .timeline-dock-inner {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    grid-template-areas: none;
  }

  .timeline-stepper,
  .present-button,
  .year-control {
    grid-area: auto;
  }
}

@media (max-width: 640px) {
  .page-header h1 {
    white-space: normal;
  }

  .timeline-dock-inner {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-areas:
      'year present'
      'range range';
  }

  .year-control { grid-area: year; }
  .present-button { grid-area: present; }
  .timeline-stepper { grid-area: range; }
}

/* Expandable state and territory term carousel -------------------------- */
.state-select-card {
  width: 100%;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.state-select-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.state-select-card:focus-visible,
.state-select-card.is-state-selected {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.state-carousel-section {
  position: relative;
  height: 294px;
  padding: 24px 0 26px;
}

.state-carousel-section::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line-strong);
}

.state-jukebox {
  height: 244px;
  display: grid;
  grid-template-columns: 270px minmax(520px, 640px) 270px;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.state-carousel-panel {
  --party-colour: var(--accent);
  width: 100%;
  max-width: 640px;
  height: 244px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-top: 6px solid var(--party-colour);
  border-radius: 6px;
  background: rgba(251, 250, 246, .98);
}

/* Researched state terms share the federal card and its mobile layout. */
.state-carousel-panel.has-details .pm-photo-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.state-carousel-panel.has-details .term-legacy .section-source {
  margin-top: 7px;
  font-size: .55rem;
}

@media (min-width: 951px) {
  .state-carousel-section.has-details { height: 460px; }
  .state-carousel-section.has-details .state-jukebox {
    height: 410px;
    grid-template-columns: 270px minmax(600px, 760px) 270px;
  }
  .state-carousel-panel.has-details {
    max-width: 760px;
    height: 410px;
  }
  .state-carousel-panel.has-details .term-legacy { overflow-y: auto; }
}

.state-carousel-heading {
  min-height: 45px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.state-carousel-heading h2 {
  margin: 2px 0 0;
  font-size: 1.38rem;
  line-height: 1;
  letter-spacing: -.04em;
}

.state-carousel-heading .year-badge {
  font-size: 1.38rem;
}

.state-term-card {
  height: 160px;
  display: grid;
  grid-template-columns: 92px minmax(230px, 1fr) minmax(150px, .72fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
}

.state-carousel-photo-link {
  min-height: 158px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--accent-soft);
  text-decoration: none;
}

.state-carousel-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 158px;
  object-fit: cover;
  object-position: 50% 22%;
  filter: saturate(.86) contrast(.98);
}

.state-carousel-photo-placeholder {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.state-carousel-summary {
  min-width: 0;
  padding: 13px 14px 11px;
}

.state-carousel-summary h3 {
  margin: 0 0 4px;
  font-size: clamp(1.15rem, 1.5vw, 1.48rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.state-carousel-summary .party-name {
  margin-bottom: 9px;
  font-size: .72rem;
}

.state-carousel-summary .term-dates {
  font-size: .66rem;
}

.state-term-overview {
  min-width: 0;
  padding: 13px 14px;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--party-colour) 4%, var(--card));
}

.state-term-overview h4 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .59rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.state-term-overview p {
  margin: 0;
  font-size: .72rem;
  line-height: 1.35;
}

.state-empty-card {
  height: 160px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
  color: var(--muted);
  font-size: .78rem;
}

.state-preview-stack {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.state-term-preview {
  --party-colour: var(--accent);
  flex: 0 0 122px;
  height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px 11px 11px;
  overflow: hidden;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-top: 10px solid var(--party-colour);
  border-radius: 10px;
  background: color-mix(in srgb, var(--party-colour) 12%, var(--card));
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.state-term-preview.preview-far {
  flex-basis: 108px;
  height: 124px;
  opacity: .68;
}

.state-term-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(20, 30, 20, .08);
}

.state-term-preview:focus-visible {
  outline: 2px solid var(--party-colour);
  outline-offset: 3px;
}

.state-term-preview strong {
  color: var(--party-colour);
  font-size: .75rem;
  line-height: 1.08;
}

.state-term-preview .preview-prime-minister {
  font-size: .9rem;
}

.state-term-preview .preview-term-number {
  font-size: .57rem;
}

.state-term-preview .preview-term-dates {
  font-size: .56rem;
}

.state-term-preview.is-empty {
  visibility: hidden;
}

@media (max-width: 950px) {
  .state-jukebox {
    grid-template-columns: 246px minmax(500px, 610px) 246px;
    gap: 16px;
  }

  .state-term-preview { flex-basis: 112px; }
  .state-term-preview.preview-far { flex-basis: 100px; }
}

/* Federal policy/outcome comparison + national context ------------------ */
.federal-system {
  height: 444px;
}

.federal-jukebox {
  height: 410px;
  grid-template-columns: 310px minmax(600px, 760px) 310px;
}

.federal-jukebox > .federal-panel {
  max-width: 760px;
  height: 410px;
}

.term-card {
  grid-template-rows: 118px minmax(0, 1fr);
}

.term-top {
  grid-template-columns: 84px minmax(220px, .92fr) minmax(0, 1.28fr);
  min-height: 118px;
}

.pm-photo-link,
.pm-photo {
  min-height: 118px;
  height: 118px;
}

.term-legacy {
  min-width: 0;
  padding: 11px 13px 10px;
  background: color-mix(in srgb, var(--party-colour) 4%, var(--card));
}

.term-legacy h4,
.term-content h4 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .61rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.term-legacy p {
  margin: 0;
  font-size: .69rem;
  line-height: 1.35;
}

.term-content {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.term-content > div {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: start;
  padding: 11px 13px 12px;
  overflow-y: auto;
}

.term-content > div + div {
  border-left: 1px solid var(--line);
}

.fact-list {
  margin: 0;
  padding-left: 16px;
  font-size: .69rem;
  line-height: 1.36;
}

.fact-list li + li {
  margin-top: 5px;
}

.no-facts {
  margin: 0;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.4;
}

.major-event-row {
  position: relative;
  min-height: 106px;
  display: grid;
  place-items: center;
  padding: 12px 0 18px;
}

.major-event-row.is-empty {
  min-height: 106px;
}

.major-event-card {
  width: min(760px, 100%);
  min-height: 76px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(251, 250, 246, .94);
  box-shadow: var(--shadow);
}

.event-year {
  height: 100%;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.04em;
}

.major-event-copy {
  min-height: 75px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px 9px;
}

.major-event-copy h2 {
  margin: 2px 0 3px;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.event-source {
  margin: 0;
  color: var(--muted);
  font-size: .5rem;
  line-height: 1.2;
}

.event-source a {
  color: inherit;
  text-underline-offset: 2px;
}

.term-content .section-source {
  align-self: end;
  margin: 0;
  padding-top: 9px;
  font-size: .5rem;
  line-height: 1.2;
}

/* The explanatory jurisdiction heading was removed; retain only the
   connector and the existing cards. */
.jurisdictions {
  padding-top: 28px;
}

.jurisdictions::before {
  height: 28px;
}

.jurisdictions-header {
  display: none;
}

.pre-federation-jurisdictions {
  padding-top: 20px;
}

@media (max-width: 950px) {
  .federal-jukebox {
    grid-template-columns: 278px minmax(590px, 730px) 278px;
  }
}

/* Slim timeline dock ----------------------------------------------------- */
:root {
  --dock-height: 64px;
}

.timeline-dock,
.timeline-dock-inner {
  min-height: var(--dock-height);
}

.timeline-dock-inner {
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 5px 0 6px;
}

.year-control {
  gap: 1px;
}

.year-control label {
  font-size: .52rem;
}

.year-control input {
  width: 78px;
  font-size: 1.38rem;
}

.timeline-stepper {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 8px;
}

.year-step-button {
  width: 32px;
  height: 32px;
  font-size: 1.05rem;
}

.present-button {
  height: 32px;
  padding: 0 12px;
  font-size: .66rem;
}

.range-wrap {
  padding-top: 0;
}

.year-slider {
  height: 21px;
}

.year-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-width: 3px;
}

.year-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-width: 3px;
}

.range-labels {
  height: 19px;
  font-size: .54rem;
  line-height: 1.05;
}

.range-labels small {
  font-size: .48rem;
}

@media (max-width: 950px) {
  :root {
    --dock-height: 64px;
  }

  .timeline-dock-inner {
    grid-template-columns: 78px minmax(0, 1fr) auto;
    grid-template-areas: none;
  }
}

@media (max-width: 640px) {
  :root {
    --dock-height: 92px;
  }

  .timeline-dock-inner {
    grid-template-columns: 74px minmax(0, 1fr);
    grid-template-areas:
      'year present'
      'range range';
    gap: 3px 10px;
    padding: 5px 0 6px;
  }

  .year-control { grid-area: year; }
  .present-button { grid-area: present; }
  .timeline-stepper { grid-area: range; }
}
