/* Delhi Atlas — map screen */

html, body { height: 100%; overflow: hidden; }

#map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--paper-warm);
}
/* Warm the tiles toward paper without touching markers or controls. The
   basemap is deliberately sparse; this only tints it, it does not mute detail. */
.leaflet-tile-pane {
  filter: var(--tile-filter, sepia(0.3) saturate(0.9) contrast(1.1));
}
.leaflet-container {
  font-family: var(--sans);
  background: var(--paper-warm);
}
.leaflet-control-attribution {
  background: rgba(251, 247, 238, 0.86) !important;
  color: var(--ink-3) !important;
  font-size: 10px !important;
  border-top-left-radius: var(--r-sm);
  padding: 2px 8px !important;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }

/* the map takes on the colour of whatever era is on screen */
.era-wash {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--era, transparent);
  opacity: 0;
  transition: background-color 1.1s ease, opacity 1.1s ease;
}
body.reigns-mode .era-wash { opacity: 0.16; }

/* ---------- header ---------- */

.atlas-header {
  position: fixed;
  top: 16px;
  left: 14px;
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  background: rgba(251, 247, 238, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  max-width: calc(100vw - 28px);
}
/* nine centuries of colour, oldest at the left */
.ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 760;
  display: flex;
}
.ribbon i { flex: 1; }

.atlas-header__count {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

/* ---------- desktop panel ---------- */

.panel {
  position: fixed;
  z-index: 650;
  top: calc(14px + var(--header-h) + 12px);
  left: 14px;
  width: var(--panel-w);
  max-height: calc(100vh - 14px - var(--header-h) - 12px - 76px);
  display: flex;
  flex-direction: column;
  background: rgba(251, 247, 238, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__head { display: none; }

/* ---------- panel tabs & panes ---------- */

.panel__tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.ptab {
  appearance: none;
  cursor: pointer;
  flex: 1;
  min-height: 40px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 10px 9px;
  transition: color .15s ease, border-color .15s ease;
}
.ptab:hover { color: var(--ink-2); }
.ptab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--cat, var(--teal));
}

.panel__pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.panel__pane[hidden] { display: none; }

.pane__note {
  margin: 0;
  padding: 14px 16px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft);
}
.pane__foot {
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  font-style: italic;
  flex: none;
}

.pane__link {
  display: inline-block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--teal-deep);
}

.city-row .place-row__dot {
  border-color: var(--city);
  background: color-mix(in srgb, var(--city) 45%, var(--panel));
}
.city-row[aria-current="true"] { background: color-mix(in srgb, var(--city) 11%, var(--panel)); }
.city-row[aria-current="true"] .place-row__name { color: var(--city); }
.city-row[aria-current="true"] .place-row__dot { background: var(--city); }

.city-row__years {
  font-size: 11.5px;
  color: color-mix(in srgb, var(--city) 72%, var(--ink-3));
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  display: block;
  margin-top: 2px;
}
.place-row__count {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: none;
  padding-top: 4px;
}

.panel__search {
  position: relative;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.panel__search svg {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 1px;
  color: var(--ink-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px 10px 36px;
}
.search-input::placeholder { color: var(--ink-3); }
.search-input:focus {
  outline: none;
  border-color: rgba(14, 95, 90, 0.5);
  background: #FFFDF8;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.chip {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: var(--panel-2); }
.chip__swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat);
  margin-right: 7px;
  flex: none;
}
.chip[aria-pressed="true"] {
  background: var(--cat, var(--teal));
  border-color: var(--cat, var(--teal));
  color: #FCFAF5;
}
.chip[aria-pressed="true"] .chip__swatch { background: rgba(255, 255, 255, 0.85); }
.chip--cat {
  background: color-mix(in srgb, var(--cat) 9%, transparent);
  border-color: color-mix(in srgb, var(--cat) 26%, transparent);
  color: var(--cat);
}
.chip--cat:hover { background: color-mix(in srgb, var(--cat) 18%, transparent); }
.chip--unesco {
  color: var(--unesco-deep);
  border-color: rgba(180, 85, 42, 0.38);
}
.chip--unesco:hover { background: var(--unesco-tint); }
.chip--unesco[aria-pressed="true"] {
  background: var(--unesco);
  border-color: var(--unesco);
  color: #FCFAF5;
}

.list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}
.list__empty {
  padding: 22px 16px 26px;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}

.place-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink);
  transition: background-color .12s ease;
}
.place-row:hover { background: var(--panel-2); }
.place-row[aria-current="true"] { background: color-mix(in srgb, var(--cat) 11%, var(--panel)); }
.place-row[aria-current="true"] .place-row__name { color: var(--cat); }
.place-row[aria-current="true"] .place-row__dot { background: var(--cat); }
.place-row--unesco .place-row__dot {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--unesco) 34%, transparent);
}
.place-row__body { flex: 1; min-width: 0; }
.place-row__name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  display: block;
}
.place-row__meta {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-top: 2px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-row__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--cat);
  flex: none;
  margin-top: 6px;
}
.place-row[aria-current="true"] .place-row__dot { background: var(--teal); }

/* ---------- detail card ---------- */

/* On desktop the card takes the panel's place; closing it brings the list back. */
@media (min-width: 861px) {
  body.has-card .panel { display: none; }
}

.card {
  position: fixed;
  z-index: 680;
  top: calc(14px + var(--header-h) + 12px);
  left: 14px;
  width: var(--panel-w);
  max-height: calc(100vh - 14px - var(--header-h) - 12px - 76px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card[hidden] { display: none; }
.card {
  border-top: 3px solid var(--cat);
}
.card__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 6px;
}
.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card__kicker {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cat);
}
.card__name {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.14;
  margin: 6px 0 0;
  letter-spacing: -0.005em;
}
.card__aka {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
  margin: 3px 0 0;
}
.card__rule {
  height: 1px;
  background: var(--line);
  margin: 14px 0 12px;
}
.card__summary {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.card__meta {
  margin: -4px 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}
.card__scroll { overflow-x: hidden; }
.card__label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 16px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.card__label[hidden] { display: none; }

.minilist { list-style: none; margin: 0 0 8px; padding: 0; }
.minilist button {
  appearance: none;
  cursor: pointer;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 9px 8px;
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--ink);
  transition: background-color .12s ease;
}
.minilist button:hover { background: var(--panel-2); }
.minilist em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: auto;
  text-align: right;
}
.minilist__empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  padding: 4px 0 10px;
}

.card__actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}
.card__actions .btn { flex: 1; }

.icon-btn {
  appearance: none;
  cursor: pointer;
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }

/* ---------- zoom controls ---------- */

.zoomer {
  position: fixed;
  z-index: 700;
  right: 14px;
  bottom: 34px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zoomer__group {
  display: flex;
  flex-direction: column;
  background: rgba(251, 247, 238, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.zoom-btn {
  appearance: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  transition: background-color .15s ease;
}
.zoom-btn + .zoom-btn { border-top: 1px solid var(--line-soft); }
.zoom-btn:hover { background: var(--panel-2); }
.zoom-btn:disabled { color: var(--ink-3); cursor: default; background: transparent; }
.zoomer__group--single { border-radius: var(--r-md); }

/* ---------- map style picker ---------- */

.style-picker {
  position: fixed;
  z-index: 720;
  right: 68px;
  bottom: 34px;
  width: 246px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(251, 247, 238, 0.98);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
}
.style-picker[hidden] { display: none; }
.style-picker__label--second {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.style-picker__label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 4px 8px;
}
.style-picker__list { list-style: none; margin: 0; padding: 0; }
.style-opt {
  appearance: none;
  cursor: pointer;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 8px 8px;
  font-family: var(--sans);
  color: var(--ink);
  transition: background-color .12s ease;
}
.style-opt:hover { background: var(--panel-2); }
.style-opt[aria-pressed="true"] { background: var(--teal-tint); }
.style-opt__swatch {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--sw, var(--panel-2));
}
.style-opt__text { min-width: 0; }
.style-opt__name { display: block; font-size: 13px; font-weight: 500; }
.style-opt__note {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}
.style-opt[disabled] { opacity: 0.45; cursor: default; }
.style-picker__note {
  margin: 8px 4px 0;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.style-picker__note code {
  font-size: 10px;
  background: var(--panel-2);
  padding: 1px 3px;
  border-radius: 3px;
}

@media (max-width: 860px) {
  .style-picker {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 92px;
  }
  body.cities-mode .style-picker { bottom: 168px; }
  body.reigns-mode .style-picker { bottom: 210px; }
}

/* ---------- markers ---------- */

.pin {
  /* Leaflet positions the icon itself (position:absolute) — do not override it. */
  width: 26px;
  height: 26px;
  cursor: pointer;
}
.pin__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--cat);
  /* a paper halo keeps the pin legible over parks, water and arterial roads */
  box-shadow: 0 0 0 1.5px rgba(251, 247, 238, 0.9), 0 1px 4px rgba(27, 25, 21, 0.3);
  transition: transform .18s ease, background-color .18s ease;
}
.pin__ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--cat) 34%, transparent);
  opacity: 0;
  transition: opacity .18s ease;
}
.pin:hover .pin__dot { transform: scale(1.18); }
.pin:hover .pin__ring { opacity: 1; }
.pin--unesco::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--unesco);
  opacity: 0.75;
  pointer-events: none;
}
.pin--unesco.pin--active::after { inset: -4px; opacity: 1; }

.pin--active .pin__dot {
  background: var(--cat);
  border-color: var(--panel);
  transform: scale(1.5);
  box-shadow: 0 0 0 1.5px rgba(251, 247, 238, 0.95),
              0 2px 10px color-mix(in srgb, var(--cat) 45%, transparent);
}
.pin--active .pin__ring {
  opacity: 1;
  inset: -5px;
  border-color: color-mix(in srgb, var(--cat) 48%, transparent);
}
.pin__label {
  position: absolute;
  left: 50%;
  bottom: 26px;
  border-bottom: 2px solid var(--cat);
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(251, 247, 238, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px 9px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.pin--muted { opacity: 0.32; }

/* ---------- marker forms ---------- */

/* PIN — a teardrop that points at the site, anchored at its tip */
.pin--form-pin .pin__dot {
  width: 22px;
  height: 22px;
  margin: 0;
  left: 3px;
  top: 1px;
  border-width: 2.5px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--panel);
}
.pin--form-pin.pin--active .pin__dot {
  transform: rotate(-45deg) scale(1.18);
  background: var(--cat);
}
.pin--form-pin .pin__ring,
.pin--form-pin .pin__arc,
.pin--form-pin .pin__scaffold { inset: 1px 3px 13px 3px; }
.pin--form-pin::after { inset: 0 2px 12px 2px; }
.pin--form-pin .pin__label { bottom: 36px; }

/* GLYPH — a silhouette per category on a rounded plate */
.pin--form-glyph .pin__dot {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 8px;
  border-width: 1.5px;
  background: var(--panel);
  display: grid;
  place-items: center;
}
.pin__glyph {
  width: 17px;
  height: 17px;
  color: var(--cat);
  --mk-hole: var(--panel);
}
.pin--form-glyph.pin--active .pin__dot {
  background: var(--cat);
  transform: scale(1.16);
}
.pin--form-glyph.pin--active .pin__glyph {
  color: var(--panel);
  --mk-hole: var(--cat);
}
.pin--form-glyph .pin__label { bottom: 30px; }

/* SURVEY — a trig mark: fine crosshair, small centre */
.pin--form-survey .pin__dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-width: 1.5px;
  background: var(--cat);
}
.pin__cross {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--cat) 0 100%) center/100% 1px no-repeat,
    linear-gradient(to bottom, var(--cat) 0 100%) center/1px 100% no-repeat;
  opacity: 0.75;
  -webkit-mask: radial-gradient(closest-side, transparent 0 22%, #000 24%);
  mask: radial-gradient(closest-side, transparent 0 22%, #000 24%);
}
.pin--form-survey.pin--active .pin__dot { transform: scale(1.7); }
.pin--form-survey.pin--active .pin__cross { opacity: 1; }
.pin--form-survey .pin__label { bottom: 28px; }

/* PLAQUE — a small museum label turned on its corner */
.pin--form-plaque .pin__dot {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 3px;
  border-width: 2px;
  transform: rotate(45deg);
  background: var(--panel);
}
.pin--form-plaque.pin--active .pin__dot {
  background: var(--cat);
  transform: rotate(45deg) scale(1.3);
}
.pin--form-plaque .pin__label { bottom: 28px; }

/* the sample marks inside the picker sit still */
.pin--sample {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
}
.pin--sample.pin--form-pin { height: 30px; }
.style-opt__swatch--mark {
  background: var(--panel-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* ---------- monuments under construction ---------- */

/* --p runs 0 → 1 across the monument's real build years */
.pin--rising .pin__dot {
  background: color-mix(in srgb, var(--cat) calc(var(--p, 0) * 100%), var(--panel));
  border-style: dashed;
  transform: scale(calc(0.55 + 0.45 * var(--p, 0)));
  box-shadow: 0 0 0 1.5px rgba(251, 247, 238, 0.9);
}

/* the scaffold: a faint dashed ring that turns while work is under way */
.pin__scaffold {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--cat) 55%, transparent);
  animation: scaffold 9s linear infinite;
}

/* the progress arc: how much of it stands */
.pin__arc {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--cat) calc(var(--p, 0) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(closest-side, transparent 74%, #000 76%);
  mask: radial-gradient(closest-side, transparent 74%, #000 76%);
}

@keyframes scaffold { to { transform: rotate(360deg); } }

/* topped out: one quiet pulse, then it settles into the map */
.pin--just-built .pin__dot { animation: topped-out 1.2s cubic-bezier(.22,.9,.3,1); }
.pin--just-built::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--cat);
  animation: ripple 1.2s cubic-bezier(.22,.9,.3,1) forwards;
  pointer-events: none;
}
@keyframes topped-out {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.85); }
  100% { transform: scale(1); }
}
@keyframes ripple {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

.pin--focus .pin__dot { z-index: 2; }
.pin__label-note {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cat);
  margin-top: 2px;
}


@media (prefers-reduced-motion: reduce) {
  .pin__scaffold { animation: none; }
  .pin--just-built .pin__dot,
  .pin--just-built::before { animation: none; }
}
.pin--muted .pin__dot { box-shadow: none; }

/* ---------- the chronicle: what happens, as it happens ---------- */

.chronicle {
  list-style: none;
  margin: 0 0 6px;
  padding: 0 0 0 2px;
  position: relative;
}
.chron {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 14px;
  position: relative;
}
.chron[hidden] { display: none; }
.chron::before {           /* the spine */
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: -6px;
  width: 1px;
  background: var(--line-soft);
}
.chron:last-child::before { display: none; }
.chron__year {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  padding-left: 16px;
  position: relative;
  padding-top: 1px;
  white-space: nowrap;
}
.chron__year::before {     /* the bead on the spine */
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--panel);
  transition: background-color .3s ease, border-color .3s ease, transform .3s ease;
}
.chron__title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  display: block;
}
.chron__text {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.58;
  color: var(--ink-2);
}
.chron__bar {
  display: block;
  height: 2px;
  margin: 8px 0 2px;
  border-radius: 2px;
  background: var(--line-soft);
  overflow: hidden;
}
.chron__bar i {
  display: block;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--cat);
}

.chron.is-new { animation: chron-in .5s cubic-bezier(.25,.8,.3,1) both; }
@keyframes chron-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.chron { --cat: var(--kind, var(--teal)); }
.chron.is-now .chron__year { color: var(--kind, var(--cat)); font-weight: 600; }
.chron.is-now .chron__year::before {
  background: var(--kind, var(--cat));
  border-color: var(--kind, var(--cat));
  transform: scale(1.15);
}
.chron__year::before { border-color: color-mix(in srgb, var(--kind, var(--line)) 55%, transparent); }
.chron.is-past .chron__year::before {
  background: color-mix(in srgb, var(--kind, var(--cat)) 45%, var(--panel));
}
.chron__span {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--kind, var(--ink-3));
  margin-left: 8px;
  vertical-align: 1px;
}

.chron__kind {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kind, var(--ink-3));
  margin-left: 8px;
  vertical-align: 1px;
}
.chron.is-past .chron__title { color: var(--ink-2); }
.chron.is-past .chron__year::before { background: color-mix(in srgb, var(--cat) 40%, var(--panel)); }
.chron--built .chron__title::after {
  content: " ";
}

/* ---------- when Delhi's fate is decided somewhere else ---------- */

.elsewhere {
  position: fixed;
  inset: 0;
  z-index: 600;          /* under the panels, over the map */
  pointer-events: none;
  opacity: 0;
  transition: opacity .7s ease;
}
.elsewhere[hidden] { display: none; }
.elsewhere.is-on { opacity: 1; }

/* the city itself goes quiet and dark at the edges */
.elsewhere__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 65% at var(--vx, 50%) var(--vy, 50%),
      rgba(27, 25, 21, 0.18) 10%,
      rgba(27, 25, 21, 0.46) 55%,
      rgba(27, 25, 21, 0.7) 100%);
}

/* a dashed line running off the map toward wherever it is happening */
.elsewhere__ray {
  position: absolute;
  height: 0;
  border-top: 1px dashed rgba(251, 247, 238, 0.55);
  transform-origin: 0 50%;
  opacity: 0.9;
}

.elsewhere__marker {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  color: #FCFAF5;
  text-align: center;
  animation: drift 2.6s ease-in-out infinite;
}
.elsewhere__arrow { display: block; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)); }
.elsewhere__place {
  background: rgba(27, 25, 21, 0.82);
  border: 1px solid rgba(251, 247, 238, 0.28);
  border-radius: var(--r-sm);
  padding: 5px 10px 6px;
  backdrop-filter: blur(4px);
}
.elsewhere__name {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}
.elsewhere__dist {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 247, 238, 0.72);
  margin-top: 2px;
  white-space: nowrap;
}

@keyframes drift {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.06); }
}

.elsewhere__caption {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: min(430px, 74vw);
  text-align: center;
  color: #FCFAF5;
  text-shadow: 0 1px 8px rgba(27, 25, 21, 0.7);
}
.elsewhere__headline {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.elsewhere__note {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(251, 247, 238, 0.86);
}

@media (max-width: 860px) {
  .elsewhere__caption { max-width: 80vw; }
  .elsewhere__headline { font-size: 18px; }
  .elsewhere__note { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .elsewhere__marker { animation: none; }
}

/* ---------- the seal: who is on the throne ---------- */

/* Each house gets its own palette, so the seal changes colour with the dynasty
   as well as with the era. */
.seal--rajput {
  --seal-1: #A6321F;  /* vermilion */
  --seal-2: #C87A1B;  /* saffron   */
  --seal-3: #A8811A;  /* old gold  */
  --seal-wash: #FDF3E4;
  --seal-bg: #FBEEDC;
}
.seal--sultanate {
  --seal-1: #12645C;  /* deep teal */
  --seal-2: #2F4B90;  /* indigo    */
  --seal-3: #A8811A;
  --seal-wash: #E8F1EE;
  --seal-bg: #EAF2EF;
}
.seal--mughal {
  --seal-1: #1E6A49;  /* imperial green */
  --seal-2: #96272C;  /* crimson        */
  --seal-3: #AE8618;
  --seal-wash: #EEF4EA;
  --seal-bg: #EFF4EA;
}
.seal--british {
  --seal-1: #26406E;  /* navy    */
  --seal-2: #8B2436;  /* crimson */
  --seal-3: #96771D;
  --seal-wash: #ECEFF6;
  --seal-bg: #EDF0F6;
}
.seal--republic {
  --seal-1: #C4671A;  /* saffron */
  --seal-2: #17703F;  /* green   */
  --seal-3: #23408E;  /* blue    */
  --seal-wash: #F5F2E8;
  --seal-bg: #F4F1E6;
}

.seal {
  position: fixed;
  z-index: 700;
  right: 14px;
  top: calc(14px + var(--header-h) + 12px);
  width: 232px;
  padding: 0 0 13px;
  background: color-mix(in srgb, var(--seal-bg, var(--panel)) 82%, rgba(251, 247, 238, 0.96));
  backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--seal-1, var(--line)) 26%, transparent);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* a three-colour band along the top, in the house colours */
.seal::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg,
    var(--seal-1) 0 34%, var(--seal-2) 34% 67%, var(--seal-3) 67% 100%);
}
.seal[hidden] { display: none; }

.seal__label {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal-1);
  margin: 12px 16px 10px;
  opacity: 0.85;
}
.seal__body { display: flex; gap: 12px; align-items: flex-start; padding: 0 16px; }
.seal__plate {
  flex: none;
  position: relative;
  width: 46px;
  height: 46px;
}
.seal__device {
  width: 46px;
  height: 46px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(27, 25, 21, 0.14));
}
.seal__plate.has-portrait .seal__device { display: none; }

/* a portrait from life, where one exists */
.seal__portrait {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 50%;
  background: var(--seal-wash);
  box-shadow:
    0 0 0 2px var(--seal-1),
    0 0 0 3.5px var(--seal-wash),
    0 1px 3px rgba(27, 25, 21, 0.28);
}
.seal__portrait[hidden] { display: none; }

.seal__credit {
  margin: 8px 16px 0;
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.seal__credit[hidden] { display: none; }
.seal__text { min-width: 0; }
.seal__name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--seal-1, var(--ink));
}
.seal__title {
  font-size: 11px;
  color: color-mix(in srgb, var(--seal-1, var(--ink-3)) 62%, var(--ink-3));
  margin-top: 3px;
  line-height: 1.35;
}
.seal__years {
  display: inline-block;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: #FCFAF5;
  background: var(--seal-2);
  border-radius: 3px;
  padding: 2px 7px;
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.seal__note {
  color: color-mix(in srgb, var(--seal-1, var(--ink-2)) 40%, var(--ink-2));
  margin: 11px 16px 0;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--seal-1) 20%, transparent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* a new ruler arrives with a turn of the seal */
.seal.is-changing .seal__device { animation: seal-turn .55s cubic-bezier(.3,.8,.3,1); }
.seal.is-changing .seal__text,
.seal.is-changing .seal__note { animation: seal-in .45s ease both; }
@keyframes seal-turn {
  from { transform: rotate(-35deg) scale(0.82); opacity: 0.3; }
  to   { transform: rotate(0) scale(1); opacity: 0.9; }
}
@keyframes seal-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- transport ---------- */

/* the transport owns the bottom of the screen while the show is up */
body.reigns-mode .card {
  max-height: calc(100vh - 14px - var(--header-h) - 12px - 220px);
}
body.reigns-mode .panel,
body.reigns-mode .card,
body.reigns-mode .transport,
body.reigns-mode .seal,
body.reigns-mode .atlas-header {
  background: color-mix(in srgb, var(--era, transparent) 7%, rgba(251, 247, 238, 0.96));
  transition: background-color 1s ease;
}

.transport {
  position: fixed;
  z-index: 700;
  left: calc(var(--panel-w) + 28px);
  right: 76px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  background: rgba(251, 247, 238, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.transport[hidden] { display: none; }
body.has-card .transport { left: 14px; }

.transport__row { display: flex; align-items: center; gap: 8px; }

.transport__btn {
  appearance: none;
  cursor: pointer;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease;
}
.transport__btn:hover { background: var(--panel-2); }
#playBtn {
  background: var(--cat, var(--teal));
  border-color: var(--cat, var(--teal));
  color: #FCFAF5;
}
#playBtn:hover { filter: brightness(0.9); background: var(--cat, var(--teal)); }
#playBtn .icon-pause { display: none; }
#playBtn.is-playing .icon-play { display: none; }
#playBtn.is-playing .icon-pause { display: block; }

.transport__speed {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.transport__speed:hover { color: var(--ink); }

.transport__now {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.transport__year {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cat, var(--ink));
}
.transport__reign {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the chapter track: thirteen reigns, equal width, doubling as a progress bar */
.transport__track {
  display: flex;
  gap: 3px;
  align-items: stretch;
  height: 42px;
}
.rg {
  appearance: none;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  overflow: hidden;
}
.rg__bar {
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--rg) 22%, var(--line-soft));
  position: relative;
  overflow: hidden;
}
.rg__bar i {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--rg);
}
.rg--past .rg__bar i { transform: scaleX(1); }
.rg__name {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  transition: color .2s ease;
}
.rg[aria-current="true"] .rg__name { color: var(--rg); font-weight: 600; }
.rg:hover .rg__name { color: var(--ink); }

/* ---------- the year bar ---------- */

.yearbar { display: flex; align-items: stretch; gap: 6px; }

.yearbar__nudge {
  appearance: none;
  cursor: pointer;
  flex: none;
  width: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  transition: background-color .15s ease, color .15s ease;
}
.yearbar__nudge:hover { background: var(--panel-2); color: var(--ink); }

.yearbar__viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 62px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  cursor: grab;
  touch-action: pan-x;
}
.yearbar__viewport::-webkit-scrollbar { display: none; }
.yearbar__viewport.is-panning { cursor: grabbing; }
.yearbar__viewport:focus-visible { outline: 2px solid var(--cat, var(--teal)); outline-offset: 1px; }

.yearbar__strip { position: relative; height: 100%; }

/* the reigns, laid out in true proportion to their length */
.yearbar__bands { position: absolute; inset: 0 0 20px 0; }
.yearbar__band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--rg) 16%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--rg) 45%, transparent);
  cursor: pointer;
}
.yearbar__band:hover { background: color-mix(in srgb, var(--rg) 28%, transparent); }
.yearbar__band[aria-current="true"] { background: color-mix(in srgb, var(--rg) 34%, transparent); }
.yearbar__band span {
  position: absolute;
  left: 5px;
  top: 3px;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rg);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.9;
}

/* every event and every build, on the same scale */
.yearbar__marks { position: absolute; left: 0; right: 0; bottom: 20px; height: 26px; }
.yb-event {
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: var(--mk);
}
.yb-build {
  position: absolute;
  bottom: 15px;
  height: 5px;
  min-width: 4px;
  border-radius: 3px;
  background: var(--mk);
  opacity: 0.9;
}

/* centuries */
.yearbar__ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; }
.yb-tick {
  position: absolute;
  bottom: 0;
  border-left: 1px solid var(--line);
  height: 7px;
}
.yb-tick span {
  position: absolute;
  left: 3px;
  bottom: 7px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}

.yearbar__head {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--cat, var(--teal));
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(251, 247, 238, 0.7);
}
.yearbar__head::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat, var(--teal));
}

/* ---------- timeline ---------- */

.timeline {
  position: fixed;
  z-index: 700;
  left: calc(var(--panel-w) + 28px);
  right: 76px;
  bottom: 20px;
  background: rgba(251, 247, 238, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.timeline[hidden] { display: none; }
.timeline::-webkit-scrollbar { display: none; }
body.has-card .timeline { left: 14px; }

.timeline__rail {
  display: flex;
  align-items: stretch;
  min-width: max-content;
  padding: 0 6px;
}
.tl {
  appearance: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  flex: 1 0 auto;
  min-width: 92px;
  min-height: 56px;
  padding: 10px 12px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  color: var(--ink-3);
  position: relative;
  transition: color .15s ease;
}
.tl:hover { color: var(--ink); }
.tl::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}
.tl:first-child::before { left: 50%; }
.tl:last-child::before { right: 50%; }
.tl__tick {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--city, var(--ink-3));
  background: var(--panel);
  position: relative;
  z-index: 1;
  margin-top: 8px;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.tl__name {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.tl__year {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tl__tick { background: color-mix(in srgb, var(--city, var(--ink-3)) 55%, var(--panel)); }
.tl:hover .tl__tick { background: color-mix(in srgb, var(--city) 45%, var(--panel)); }
.tl[aria-current="true"] .tl__tick {
  background: var(--city, var(--teal));
  border-color: var(--city, var(--teal));
  transform: scale(1.4);
}
.tl[aria-current="true"] .tl__name { color: var(--city, var(--teal-deep)); }
.tl[aria-current="true"] .tl__year { color: var(--city, var(--teal)); }

/* ---------- loading / status ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity .5s ease;
}
.veil[hidden] { display: none; }
.veil.is-gone { opacity: 0; pointer-events: none; }
.veil__inner { text-align: center; }
.veil__name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.veil__tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 8px;
}
.veil__bar {
  width: 132px;
  height: 2px;
  margin: 22px auto 0;
  background: var(--line-soft);
  overflow: hidden;
  border-radius: 2px;
}
.veil__bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--teal);
  animation: sweep 1.25s ease-in-out infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.notice {
  position: fixed;
  z-index: 720;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 28px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 11px 15px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.notice[hidden] { display: none; }

/* ---------- mobile ---------- */

.sheet-bar { display: none; }
.scrim { display: none; }

@media (max-width: 860px) {
  :root { --header-h: 54px; }

  .atlas-header {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 9px 14px;
    gap: 10px;
    border-radius: var(--r-md);
  }
  /* nine centuries of colour, oldest at the left */
.ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 760;
  display: flex;
}
.ribbon i { flex: 1; }

.atlas-header__count { display: none; }
  .wordmark__name { font-size: 17px; }
  .wordmark__tag { font-size: 10px; letter-spacing: 0.12em; }

  .zoomer { right: 10px; bottom: 92px; }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 690;
    background: rgba(27, 25, 21, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .scrim.is-open { opacity: 1; pointer-events: auto; }

  .sheet-bar {
    display: flex;
    position: fixed;
    z-index: 700;
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(251, 247, 238, 0.97);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
    appearance: none;
  }
  .sheet-bar__hint {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    font-weight: 400;
  }

  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 76vh;
    height: 76vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    transform: translateY(102%);
    transition: transform .26s cubic-bezier(.32,.72,.28,1);
    z-index: 700;
  }
  .panel.is-open { transform: translateY(0); }

  .panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px 10px 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  .panel__head-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-2);
  }

  body.sheet-open .sheet-bar,
  body.sheet-open .zoomer { display: none; }

  /* the card owns the bottom of the phone, so the seal sits under the header */
  .seal {
    top: calc(10px + var(--header-h) + 8px);
    bottom: auto;
    right: 10px;
    left: auto;
    width: auto;
    max-width: 68vw;
    padding: 8px 12px;
    border-radius: var(--r-md);
    border-top-width: 2px;
  }
  .seal__label, .seal__note, .seal__credit { display: none; }
  .seal { padding: 0 0 8px; }
  .seal::before { height: 3px; }
  .seal__body { align-items: center; gap: 9px; padding: 8px 12px 0; }
  .seal__plate, .seal__device, .seal__portrait { width: 28px; height: 28px; }
  .seal__portrait { box-shadow: 0 0 0 1.5px var(--seal-1), 0 0 0 2.5px var(--seal-wash); }
  .seal__name { font-size: 14px; }
  .seal__title { display: none; }
  .seal__years { margin-top: 1px; font-size: 10.5px; }
  body.sheet-open .seal { display: none; }

  .transport {
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: var(--r-md);
    padding: 8px 10px 10px;
    gap: 6px;
    z-index: 715;
  }
  body.reigns-mode .card {
    bottom: 168px;
    max-height: min(42vh, 340px);
  }
  .transport__track { height: 22px; }
  .rg__name { display: none; }
  .yearbar__viewport { height: 50px; }
  .yearbar__band span { display: none; }
  .transport__reign { display: none; }
  .transport__year { font-size: 17px; }
  body.sheet-open .transport { display: none; }
  body.reigns-mode .zoomer { bottom: 248px; }
  body.reigns-mode.has-card .zoomer { display: none; }
  .transport__btn { width: 40px; height: 40px; }
  .transport__speed {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.transport__speed:hover { color: var(--ink); }

.transport__year { font-size: 15px; min-width: 3.6em; }

  /* comfortable touch targets; one scrolling row keeps the list in view */
  .chip { min-height: 44px; padding: 0 14px; flex: none; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .icon-btn { width: 44px; height: 44px; }
  .panel::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    margin: 9px auto 3px;
    flex: none;
  }
  .list { padding-bottom: 24px; }

  body.has-card .sheet-bar { display: none; }

  .timeline {
    left: 10px;
    right: 10px;
    bottom: 72px;
    border-radius: var(--r-md);
  }
  /* lift the zoom controls clear of the timeline strip */
  body.cities-mode .zoomer { bottom: 168px; }
  body.has-card .timeline { display: none; }
  body.sheet-open .timeline { display: none; }
  .tl { min-width: 84px; }

  .card {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: min(62vh, 460px);
    z-index: 710;
  }
  .card__scroll { padding: 14px 16px 4px; }
  .card__name { font-size: 22px; }
  .card__label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 16px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.card__label[hidden] { display: none; }

.minilist { list-style: none; margin: 0 0 8px; padding: 0; }
.minilist button {
  appearance: none;
  cursor: pointer;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 9px 8px;
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--ink);
  transition: background-color .12s ease;
}
.minilist button:hover { background: var(--panel-2); }
.minilist em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: auto;
  text-align: right;
}
.minilist__empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  padding: 4px 0 10px;
}

.card__actions { padding: 10px 16px 14px; }

  .notice { bottom: 74px; }
}

@media (max-width: 400px) {
  .wordmark__rule { display: none; }
  .wordmark__tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
