.tool-tabs {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--color-ink);
}

.tool-tab {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 3.5rem;
  padding: var(--space-xs) var(--space-2xs);
  place-content: center;
  justify-items: center;
  gap: var(--space-2xs);
  border-inline-end: 1px solid var(--color-rule);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.68rem;
}

.tool-tab:last-child {
  border-inline-end: 0;
}

.tool-tab::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: transparent;
  content: '';
}

.tool-tab svg {
  width: 1.15rem;
  height: 1.15rem;
}

.tool-tab.is-active {
  color: var(--color-accent);
  font-weight: 650;
}

.tool-tab.is-active::after {
  background: var(--color-accent);
}

@media (hover: hover) {
  .tool-tab:hover,
  .mobile-action:hover {
    background: var(--color-accent-wash);
    color: var(--color-accent);
  }
}

.tab-badge {
  position: absolute;
  inset: var(--space-2xs) var(--space-2xs) auto auto;
  min-width: 1.1rem;
  padding-inline: 0.2rem;
  border-radius: 1rem;
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1rem;
}

.result-list {
  min-height: 10rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.catalogue-skeleton,
.panel-skeleton {
  display: grid;
}

.catalogue-skeleton span {
  display: block;
  height: 5rem;
  border-bottom: 1px solid var(--color-rule);
  background: linear-gradient(100deg, transparent 20%, oklch(100% 0 0 / 72%) 50%, transparent 80%) var(--color-canvas);
  background-size: 220% 100%;
  animation: skeleton-shift 1.5s linear infinite;
}

.panel-skeleton {
  gap: var(--space-sm);
  padding: var(--space-md);
}

.panel-skeleton span {
  height: 2.75rem;
  border: 1px solid var(--color-rule);
  background: var(--color-surface);
}

@keyframes skeleton-shift {
  to { background-position-x: -220%; }
}

.empty-state {
  max-width: 32rem;
  padding: var(--space-xl) var(--space-md);
}

.empty-state h3 {
  margin-bottom: var(--space-xs);
  font-family: var(--font-editorial);
  font-size: var(--text-subheading);
  font-weight: 400;
}

.empty-state p,
.panel-intro,
.search-summary {
  color: var(--color-muted);
  font-size: var(--text-secondary);
}

.panel-intro,
.search-summary {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
}

.search-form {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-rule);
}

.search-form label {
  font-size: var(--text-secondary);
  font-weight: 650;
}

.search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--color-ink);
  background: var(--color-surface);
}

.search-field:focus-within {
  box-shadow: var(--focus-ring);
}

.search-field > svg {
  width: 1.15rem;
  height: 1.15rem;
  margin-inline-start: var(--space-sm);
}

.search-field input {
  min-width: 0;
  min-height: var(--control-size);
  padding: var(--space-xs) var(--space-sm);
  border: 0;
  outline: 0;
  background: transparent;
}

.search-field input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.clear-search {
  width: var(--control-size);
  height: var(--control-size);
  background: transparent;
  font-size: 1.5rem;
}

.filter-chips,
.active-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-rule);
}

.active-filter-summary:empty,
.filter-chips:empty {
  display: none;
}

.filter-chip {
  display: inline-flex;
  min-width: 0;
  min-height: 2rem;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem var(--space-xs) 0.25rem var(--space-sm);
  border: 1px solid var(--color-rule-strong);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--text-caption);
  line-height: 1.25;
  text-align: start;
}

.filter-chip span {
  color: var(--color-accent);
  font-size: 1rem;
  line-height: 1;
}

.catalogue-item {
  border-bottom: 1px solid var(--color-rule);
}

.catalogue-row {
  display: grid;
  width: 100%;
  min-height: 5rem;
  grid-template-columns: 0.9rem minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  color: var(--color-ink);
  text-align: start;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.catalogue-row.is-selected {
  background: var(--color-accent-wash);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

@media (hover: hover) {
  .catalogue-row:hover {
    background: var(--color-surface);
  }

  .catalogue-row.is-selected:hover {
    background: var(--color-accent-wash);
  }
}

.catalogue-symbol {
  display: block;
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.36rem;
  justify-self: center;
  background: currentColor;
}

.catalogue-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.catalogue-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-editorial);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.catalogue-match {
  padding: 0;
  background: var(--color-accent-wash);
  color: inherit;
  box-shadow: inset 0 -1px 0 var(--color-accent);
}

.catalogue-ancient {
  color: var(--color-muted);
  font-family: var(--font-editorial);
  font-size: var(--text-caption);
  font-style: italic;
  line-height: 1.25;
}

.catalogue-classification {
  margin-top: 0.08rem;
  color: var(--color-accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.3;
  text-transform: uppercase;
}

.catalogue-metadata {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0 var(--space-xs);
  color: var(--color-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.catalogue-metadata span:not(:empty) + span:not(:empty)::before {
  margin-inline-end: var(--space-xs);
  content: '·';
}

.catalogue-uncertainty {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.18rem;
  color: var(--color-muted);
  font-size: 0.66rem;
  line-height: 1.25;
}

.catalogue-uncertainty::before {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px dashed currentColor;
  border-radius: 50%;
  content: '';
}

.catalogue-arrow {
  align-self: center;
  color: var(--color-rule-strong);
  font-size: 1rem;
  transition: color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.catalogue-row:hover .catalogue-arrow,
.catalogue-row:focus-visible .catalogue-arrow,
.catalogue-row.is-selected .catalogue-arrow {
  color: var(--color-accent);
  transform: translateX(0.12rem);
}

.facet-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--color-ink);
}

.facet-tab {
  min-width: 0;
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-sm);
  border-inline-end: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  background: transparent;
  color: var(--color-muted);
  font-size: var(--text-caption);
  line-height: 1.25;
  text-align: start;
}

.facet-tab:nth-child(2n) {
  border-inline-end: 0;
}

.facet-tab:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.facet-tab.is-active {
  background: var(--color-accent-wash);
  color: var(--color-accent);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.facet-body {
  border-bottom: 1px solid var(--color-ink);
}

.facet-search {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-rule);
}

.facet-search input {
  width: 100%;
  min-height: var(--control-size);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-rule-strong);
  border-radius: 0;
  background: var(--color-surface);
}

.facet-options {
  display: grid;
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.facet-option {
  display: grid;
  min-height: var(--control-size);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--color-rule);
  background: transparent;
  font-size: var(--text-secondary);
}

.facet-option:last-child {
  border-bottom: 0;
}

.facet-option.is-selected {
  background: var(--color-accent-wash);
}

.facet-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--color-accent);
}

.facet-option-count {
  min-width: 2ch;
  color: var(--color-muted);
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.chronology-filter {
  min-width: 0;
  padding: var(--space-md);
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
}

.chronology-filter legend {
  padding: 0;
  margin-bottom: var(--space-sm);
  font-family: var(--font-editorial);
  font-size: 1rem;
}

.chronology-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: var(--space-xs);
}

.chronology-inputs label {
  display: grid;
  min-width: 0;
  gap: var(--space-2xs);
  color: var(--color-muted);
  font-size: var(--text-caption);
}

.chronology-inputs input {
  width: 100%;
  min-height: var(--control-size);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-rule-strong);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.chronology-readable {
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.search-results {
  padding: 0;
  margin: 0;
  list-style: none;
}

.statistics-content {
  padding-bottom: var(--space-lg);
}

.statistics-group {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-rule);
}

.statistics-group h3 {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-weight: 400;
}

.statistics-bars {
  display: grid;
  gap: var(--space-xs);
}

.statistic-bar {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 2.5rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  overflow: hidden;
  border: 1px solid var(--color-rule);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--text-caption);
  text-align: start;
}

.statistic-fill {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: var(--bar-size);
  background: var(--color-accent-wash);
  border-inline-end: 1px solid var(--color-accent);
  pointer-events: none;
}

.statistic-label,
.statistic-count,
.statistic-percent {
  position: relative;
  z-index: 1;
}

.statistic-label {
  overflow-wrap: anywhere;
}

.statistic-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.statistic-percent {
  min-width: 3.5ch;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

@media (hover: hover) {
  .filter-chip:hover,
  .facet-tab:hover,
  .facet-option:hover,
  .statistic-bar:hover {
    border-color: var(--color-accent);
    background-color: var(--color-accent-wash);
  }
}

.map-message {
  position: absolute;
  z-index: var(--z-map-control);
  inset: 50% auto auto 50%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: calc(100% - 2rem);
  padding: var(--space-sm) var(--space-md);
  transform: translate(-50%, -50%);
  border: 1px solid var(--color-ink);
  background: var(--color-surface);
  font-size: var(--text-secondary);
}

.map-loading-mark {
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  animation: map-pulse 1.1s var(--ease-out) infinite alternate;
}

@keyframes map-pulse {
  to { background: var(--color-accent); transform: scale(1.18); }
}

.map-error {
  border-color: var(--color-error);
  background: var(--color-error-wash);
}

.map-legend {
  position: absolute;
  z-index: var(--z-map-control);
  inset: var(--space-sm) var(--space-sm) auto auto;
  width: min(14rem, calc(100% - 2rem));
  border: 1px solid var(--color-ink);
  background: var(--color-surface);
}

.legend-heading {
  display: flex;
  width: 100%;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  font-size: var(--text-secondary);
  font-weight: 650;
}

.legend-heading svg {
  width: 1rem;
  height: 1rem;
}

.legend-heading[aria-expanded='false'] svg {
  transform: rotate(180deg);
}

.legend-content {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm) var(--space-sm);
  border-top: 1px solid var(--color-rule);
}

.legend-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-caption);
}

.legend-row b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.legend-symbol {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  justify-self: center;
  background: currentColor;
}

.marker-settlement {
  border-radius: 50%;
  color: var(--color-settlement);
}

.marker-sanctuary {
  color: var(--color-sanctuary);
  transform: rotate(45deg) scale(0.82);
}

.marker-polity {
  color: var(--color-polity);
}

.legend-cluster {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  color: var(--color-ink);
  font-size: 0.62rem;
  font-style: normal;
}

.legend-note {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  align-items: start;
  gap: var(--space-xs);
  margin-top: var(--space-2xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-rule);
  color: var(--color-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.legend-uncertain {
  display: block;
  width: 0.75rem;
  height: 0.75rem;
  margin: 0.15rem auto 0;
  border: 1px dashed var(--color-ink);
  border-radius: 50%;
}

.map-status {
  position: absolute;
  z-index: var(--z-map-control);
  inset: auto 0 0;
  display: flex;
  min-height: 2rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-2xs) var(--space-sm);
  border-top: 1px solid var(--color-ink);
  background: var(--color-canvas);
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
}

.leaflet-control-zoom a,
.leaflet-control-layers {
  border-radius: 0 !important;
}

.atlas-marker-anchor {
  border: 0 !important;
  background: transparent !important;
}

.atlas-marker {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--color-settlement);
  filter: drop-shadow(0 2px 2px oklch(12% 0.01 145 / 24%));
  transition: transform var(--duration-fast) var(--ease-out);
}

.atlas-marker.marker-sanctuary {
  color: var(--color-sanctuary);
  transform: none;
}

.atlas-marker.marker-polity {
  color: var(--color-polity);
}

.atlas-marker-core {
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--color-surface);
  background: currentColor;
  box-shadow: 0 0 0 1px currentColor;
}

.atlas-marker.marker-settlement .atlas-marker-core {
  border-radius: 50%;
}

.atlas-marker.marker-sanctuary .atlas-marker-core {
  transform: rotate(45deg) scale(0.88);
}

.atlas-marker.is-proxy::after,
.atlas-marker.is-representative::after {
  position: absolute;
  width: 21px;
  height: 21px;
  border: 1px dashed currentColor;
  content: '';
}

.atlas-marker.is-proxy::after {
  border-radius: 50%;
}

.atlas-marker.is-representative::after {
  box-shadow: inset 0 0 0 2px var(--color-surface);
}

.atlas-marker.is-selected {
  transform: scale(1.22);
  filter: drop-shadow(0 2px 3px oklch(12% 0.01 145 / 36%));
}

.atlas-marker.marker-sanctuary.is-selected {
  transform: scale(1.22);
}

.atlas-marker.is-selected .atlas-marker-core {
  box-shadow: 0 0 0 1px currentColor, 0 0 0 4px var(--color-surface), 0 0 0 6px var(--color-ink);
}

.atlas-cluster {
  display: grid !important;
  place-items: center;
  border: 1px solid var(--color-ink);
  border-radius: 50%;
  background: oklch(100% 0 0 / 92%);
  box-shadow: 0 2px 8px oklch(12% 0.01 145 / 20%);
  color: var(--color-ink);
}

.atlas-cluster::before {
  position: absolute;
  inset: 4px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  content: '';
}

.atlas-cluster-small {
  width: 36px !important;
  height: 36px !important;
  margin: -18px 0 0 -18px !important;
}

.atlas-cluster-medium {
  width: 44px !important;
  height: 44px !important;
  margin: -22px 0 0 -22px !important;
}

.atlas-cluster-large {
  width: 52px !important;
  height: 52px !important;
  margin: -26px 0 0 -26px !important;
}

.atlas-cluster-count {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 2ch;
  min-height: 2ch;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.leaflet-popup.atlas-preview-popup {
  margin-bottom: 12px;
}

.atlas-preview-popup .leaflet-popup-content-wrapper,
.atlas-preview-popup .leaflet-popup-tip {
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 0 0 1px var(--color-ink), var(--shadow-overlay);
}

.atlas-preview-popup .leaflet-popup-content {
  width: auto !important;
  margin: 0;
}

.atlas-preview-popup .leaflet-popup-close-button {
  top: var(--space-xs) !important;
  right: var(--space-xs) !important;
  width: 2rem !important;
  height: 2rem !important;
  color: var(--color-ink) !important;
  font: 1.4rem/2rem var(--font-ui) !important;
}

.map-preview {
  min-width: 15rem;
  max-width: 20rem;
  padding: var(--space-md);
}

.map-preview-title {
  padding-inline-end: 2rem;
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.15;
}

.map-preview-ancient {
  margin: 0.18rem 0 0;
  color: var(--color-muted);
  font-family: var(--font-editorial);
  font-size: var(--text-secondary);
  font-style: italic;
}

.map-preview-classification {
  margin: var(--space-xs) 0 0;
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-transform: uppercase;
}

.map-preview-place,
.map-preview-date,
.map-preview-uncertainty {
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font-size: var(--text-caption);
  line-height: 1.4;
}

.map-preview-uncertainty {
  padding-top: var(--space-xs);
  border-top: 1px dashed var(--color-rule-strong);
}

.map-preview-action {
  width: 100%;
  min-height: 2.5rem;
  padding: var(--space-xs) var(--space-sm);
  margin-top: var(--space-sm);
  border: 1px solid var(--color-accent);
  border-radius: 0;
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: var(--text-secondary);
  font-weight: 700;
}

.leaflet-control a,
.leaflet-control-layers-toggle {
  color: var(--color-ink) !important;
}

.leaflet-control-zoom,
.leaflet-control-layers {
  border: 1px solid var(--color-ink) !important;
  box-shadow: none !important;
}

.leaflet-control-zoom a {
  border-bottom-color: var(--color-rule) !important;
}

/* The status bar covers the lower edge of the map; the basemap credit sits above it. */
.map-stage .leaflet-bottom.leaflet-right {
  right: auto;
  bottom: 2rem;
  left: 0;
}

.record-lede {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  align-items: start;
  gap: var(--space-sm);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-ink);
}

.record-symbol {
  display: block;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.35rem;
  background: currentColor;
}

.record-symbol.marker-settlement {
  border-radius: 50%;
}

.record-symbol.marker-sanctuary {
  transform: rotate(45deg) scale(0.84);
}

.record-lede-copy {
  min-width: 0;
}

.record-media {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--color-ink);
}

.media-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
}

.media-track:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.media-slide {
  display: grid;
  min-width: 100%;
  margin: 0;
  background: var(--color-ink);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.media-image {
  display: block;
  width: 100%;
  height: min(52vh, 30rem);
  min-height: 20rem;
  background: var(--color-ink);
  object-fit: contain;
}

.media-caption {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(12rem, 1.2fr);
  gap: var(--space-sm) var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  color: var(--color-ink);
}

.media-caption-text,
.media-attribution {
  margin: 0;
  font-size: var(--text-caption);
  line-height: 1.45;
}

.media-caption-text {
  font-family: var(--font-editorial);
  font-size: var(--text-secondary);
}

.media-attribution {
  color: var(--color-muted);
  text-align: end;
}

.media-attribution a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.media-controls {
  display: grid;
  grid-template-columns: var(--control-size) minmax(0, 1fr) var(--control-size);
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.media-arrow,
.media-thumbnail {
  min-width: var(--control-size);
  min-height: var(--control-size);
  border: 1px solid var(--color-rule-strong);
  border-radius: 0;
  background-color: var(--color-surface);
  color: var(--color-ink);
}

.media-arrow {
  font-family: var(--font-ui);
  font-size: 1.25rem;
}

.media-thumbnails {
  display: flex;
  min-width: 0;
  justify-content: center;
  gap: var(--space-xs);
  overflow-x: auto;
}

.media-thumbnail {
  position: relative;
  flex: 0 0 4.25rem;
  overflow: hidden;
  color: var(--color-surface);
  font-size: var(--text-caption);
  font-weight: 750;
  text-shadow: 0 1px 3px var(--color-ink);
}

.media-thumbnail::after {
  position: absolute;
  inset: 0;
  background: oklch(12% 0.01 145 / 16%);
  content: '';
}

.media-thumbnail-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumbnail span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border: 1px solid oklch(100% 0 0 / 80%);
  border-radius: 50%;
  background: oklch(12% 0.01 145 / 72%);
}

.record-ancient {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-editorial);
  font-size: 1.1rem;
  font-style: italic;
}

.record-classification {
  margin: var(--space-xs) 0 0;
  color: var(--color-accent);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.record-aliases {
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font-size: var(--text-caption);
}

.record-section {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}

.record-section:last-child {
  border-bottom: 0;
}

.record-section > h3 {
  margin: 0 0 var(--space-md);
  font-family: var(--font-editorial);
  font-size: 1.25rem;
  font-weight: 400;
}

.record-description {
  max-width: 68ch;
  margin: 0;
  line-height: 1.7;
}

.chronology-list,
.relationship-list,
.source-list,
.identifier-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.chronology-entry {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-rule);
}

.chronology-entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.chronology-entry:last-child {
  padding-bottom: 0;
}

.chronology-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
}

.chronology-heading strong {
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-weight: 400;
}

.chronology-heading span {
  color: var(--color-accent);
  font-size: var(--text-caption);
}

.chronology-entry > p,
.spatial-note {
  max-width: 68ch;
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font-size: var(--text-secondary);
}

.record-definitions {
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.7fr) minmax(0, 1.3fr);
  margin: var(--space-md) 0 0;
  border-top: 1px solid var(--color-rule);
}

.record-definitions dt,
.record-definitions dd {
  padding: var(--space-xs) 0;
  margin: 0;
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--text-secondary);
  overflow-wrap: anywhere;
}

.record-definitions dt {
  padding-inline-end: var(--space-md);
  color: var(--color-muted);
}

.record-definitions dd {
  font-weight: 550;
}

.coordinate-copy {
  display: flex;
  width: 100%;
  min-height: var(--control-size);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-ink);
  background: var(--color-surface);
  font-variant-numeric: tabular-nums;
  text-align: start;
}

.coordinate-copy-label {
  color: var(--color-accent);
  font-size: var(--text-caption);
  font-variant-numeric: normal;
  font-weight: 700;
  text-align: end;
}

.relationship-list {
  border-top: 1px solid var(--color-rule);
}

.relationship-list li {
  display: grid;
  min-height: var(--control-size);
  grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-rule);
}

.relationship-predicate,
.relationship-certainty {
  color: var(--color-muted);
  font-size: var(--text-caption);
}

.relationship-target {
  min-height: 2.25rem;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  font-family: var(--font-editorial);
  text-align: start;
}

.relationship-target-text {
  font-family: var(--font-editorial);
}

.source-list {
  counter-reset: sources;
}

.source-entry {
  position: relative;
  padding: var(--space-md) 0 var(--space-md) 2rem;
  border-top: 1px solid var(--color-rule);
  counter-increment: sources;
}

.source-entry::before {
  position: absolute;
  inset: var(--space-md) auto auto 0;
  color: var(--color-muted);
  content: counter(sources, decimal-leading-zero);
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
}

.source-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs) var(--space-sm);
}

.source-heading a,
.source-heading strong {
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-weight: 400;
}

.source-primary {
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-publisher,
.source-citation,
.source-scopes {
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font-size: var(--text-caption);
  line-height: 1.45;
}

.source-scopes strong {
  color: var(--color-ink);
  font-weight: 650;
}

.identifier-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.identifier-list a,
.identifier-list span {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-rule-strong);
  background: var(--color-surface);
  font-size: var(--text-secondary);
}

.record-empty {
  margin: 0;
  color: var(--color-muted);
  font-style: italic;
}

@media (hover: hover) {
  .coordinate-copy:hover,
  .relationship-target:hover,
  .identifier-list a:hover,
  .media-arrow:hover,
  .media-thumbnail:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-wash);
  }

  .media-thumbnail:hover::after {
    background: oklch(42.57% 0.0791 164.27 / 24%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
