:root {
  color-scheme: dark;
  --on-accent: #0e1626;
  --map-ocean: #0a1120;
  --map-land: #243652;
  --map-stroke: #44607e;
  --paper: #0e1626;
  --ink: #edf1fc;
  --muted: #a0aec9;
  --line: #2d3c57;
  --accent: #b9b4ff;
  --blue: #83c6d7;
  --dark: #0a1120;
  --white: #162139;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --font-serif: var(--serif);
  --font-sans: var(--sans);
  --green: #9bcebb;
  --amber: #e1c38c;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
main, .masthead, main + footer { width: 100%; max-width: 1600px; margin: 0 auto; padding-left: 4.5%; padding-right: 4.5%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
a { color: var(--blue); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img, svg { max-width: 100%; }
button, label, input, select, textarea, td, th { min-width: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.15; }
h2 { margin: 0; font-size: clamp(29px, 3vw, 39px); letter-spacing: -.035em; }
h3 { margin: 0 0 13px; font-size: 27px; letter-spacing: -.025em; }
p { margin: 0 0 15px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 12px; left: 4.5%; z-index: 20; padding: 10px 15px; color: var(--white); background: var(--dark); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .15em; line-height: 1.5; text-transform: uppercase; }
.dot { display: inline-block; width: 5px; height: 5px; margin-right: 8px; vertical-align: 2px; border-radius: 50%; background: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--ink); font: 12px/1.45 var(--sans); text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.button:hover:not(:disabled) { background: var(--white); border-color: var(--blue); }
.button.primary { border-color: var(--dark); background: var(--dark); color: var(--white); }
.button.primary:hover:not(:disabled) { border-color: var(--blue); background: var(--blue); }
.text-button { appearance: none; border: 0; padding: 0; background: transparent; color: var(--blue); font: 12px/1.5 var(--sans); text-align: left; text-decoration: none; }
.text-button:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.tag, .chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 2px; padding: 4px 8px; color: var(--muted); background: transparent; font: 10px/1.4 var(--sans); }
.chip button { padding: 0 2px; border: 0; background: transparent; color: var(--blue); font-size: 16px; line-height: 1; }

/* The masthead and collection register establish a quiet editorial hierarchy. */
.masthead { display: flex; align-items: center; gap: 25px; min-height: 88px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.brand .compass { color: var(--accent); font: 39px/1 var(--serif); }
.brand > span:last-child { font: 12px/1.4 var(--sans); letter-spacing: .16em; }
.brand b { font-weight: 700; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: .16em; }
.masthead nav { display: flex; justify-content: center; gap: 25px; margin-left: auto; }
.nav-link { padding: 10px 0; border: 0; background: transparent; font-size: 12px; }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.saved-nav { padding: 8px 0 8px 24px; border: 0; border-left: 1px solid var(--line); background: transparent; font-size: 12px; white-space: nowrap; }
.saved-nav span, .view-tabs button span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 5px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 9px; }
.account-link { font-size: 11px; text-decoration: none; white-space: nowrap; }
.hero { display: grid; grid-template-columns: 1.04fr 1fr; align-items: center; gap: clamp(40px, 8vw, 110px); padding: 58px 0 51px; }
.hero h1 { margin: 0 0 22px; font-size: clamp(49px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -.05em; }
.hero h1 em, .context-section h2 em { color: var(--accent); font-weight: 400; }
.hero-description { max-width: 420px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-cta { display: inline-flex; align-items: center; gap: 32px; margin-top: 13px; padding-bottom: 5px; border-bottom: 1px solid var(--accent); color: var(--ink); font-size: 12px; text-decoration: none; }
.hero-cta span { color: var(--accent); font-size: 22px; line-height: 1; }
.hero-register { padding-top: 14px; }
.register-title { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.register-title span { color: var(--accent); }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; padding: 35px 0; }
.hero-stats strong { display: block; color: var(--blue); font: clamp(34px, 3.3vw, 48px)/1.1 var(--serif); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-stats span { display: block; max-width: 110px; margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.register-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.register-bottom > span:first-child { max-width: 260px; font: 15px/1.6 var(--serif); color: var(--ink); }
.register-seal { display: grid; flex: 0 0 52px; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font: 13px var(--serif); }
.collection-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.research-strip { display: flex; align-items: center; gap: 22px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.research-strip > span { flex: 0 0 auto; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.research-strip i { display: inline-block; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: var(--accent); }
.research-strip p { flex: 1; margin: 0; color: var(--muted); font-size: 11px; }
.research-strip .text-button { flex: 0 0 auto; font-size: 11px; }

.explore { padding-top: 43px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 27px; }
.section-title .eyebrow { margin-bottom: 11px; }
.section-title > p { max-width: 270px; margin: 0 0 3px; color: var(--muted); font-size: 12px; line-height: 1.65; text-align: right; }
.view-tabs { display: flex; gap: 25px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 25px; overflow-x: auto; scrollbar-width: thin; }
.view-tabs button { flex: 0 0 auto; min-height: 46px; padding: 10px 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.view-tabs button.active, .view-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.view-tabs button:hover { color: var(--accent); }

/* Controls remain paper surfaces; the map is the visual focal point. */
.filter-bar { display: flex; align-items: end; gap: 13px; padding: 0 0 17px; }
.filter-bar > label { flex: 0 1 160px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.filter-bar select, .filter-bar input, .archive-actions select { width: 100%; height: 40px; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--ink); font: 12px var(--sans); letter-spacing: normal; text-transform: none; }
.filter-bar .search-field { position: relative; flex: 1 1 250px; }
.search-field > span[aria-hidden] { position: absolute; top: 15px; left: 13px; color: var(--blue); font: 23px/1 var(--serif); pointer-events: none; }
.search-field input { padding-left: 38px; font-size: 13px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
.reset-button { flex: 0 0 auto; min-height: 40px; padding: 8px 0 8px 10px; border: 0; background: transparent; color: var(--blue); font-size: 11px; }
.time-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0 18px; border-top: 1px solid var(--line); }
.time-mode { display: flex; gap: 4px; }
.time-mode button { min-height: 33px; padding: 6px 12px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--muted); font-size: 11px; }
.time-mode button.active { border-color: var(--line); background: var(--white); color: var(--ink); }
.time-info { display: flex; gap: 18px; align-items: center; color: var(--muted); font-size: 11px; }
.time-info .text-button { font-size: 11px; }
.atlas-grid { display: grid; grid-template-columns: minmax(0, 1.94fr) minmax(285px, 1fr); align-items: start; gap: 25px; }
.map-column { min-width: 0; }
.map-panel { overflow: hidden; border: 1px solid var(--dark); background: var(--dark); color: #c5d1e7; }
.map-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px 9px; font-size: 9px; letter-spacing: .1em; }
.map-header > span:first-child { display: flex; align-items: center; gap: 7px; letter-spacing: normal; }
.map-header i { width: 5px; height: 5px; border-radius: 50%; background: #b9b4ff; }
.map-header strong { font-size: 11px; font-weight: 400; }
.map-header > span:last-child { font-size: 8px; color: #a0aec9; }
.map-wrap { position: relative; width: 100%; min-height: 300px; aspect-ratio: 1000/550; overflow: hidden; isolation: isolate; }
#worldMap { display: block; width: 100%; height: 100%; min-height: inherit; position: absolute; inset: 0; touch-action: none; cursor: grab; }
#worldMap:active { cursor: grabbing; }
.map-country { fill: #243652; stroke: #44607e; stroke-width: .45; vector-effect: non-scaling-stroke; }
.map-country:hover { fill: #304566; }
.map-graticule { fill: none; stroke: #44607e; stroke-width: .45; stroke-opacity: .17; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-territory { stroke-width: 1; fill-opacity: .2; stroke-opacity: .7; vector-effect: non-scaling-stroke; }
.map-marker { stroke: #d7d8ef; stroke-width: .65; fill-opacity: .95; cursor: pointer; vector-effect: non-scaling-stroke; }
.map-marker:hover, .map-marker:focus { stroke: #fff; stroke-width: 2; fill-opacity: 1; }
.map-marker-text { fill: var(--white); font: 11px var(--sans); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.selected-pin { stroke: var(--white); stroke-width: 2.4; filter: drop-shadow(0 1px 3px #0005); vector-effect: non-scaling-stroke; pointer-events: none; }
.map-tooltip { position: absolute; z-index: 5; max-width: 235px; padding: 12px 14px; border: 1px solid var(--line); background: var(--white); color: var(--ink); box-shadow: 0 5px 18px #08151d35; pointer-events: none; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.map-tooltip strong { display: block; margin-bottom: 4px; font: 17px/1.3 var(--serif); }
.map-tooltip span, .map-tooltip small { display: block; color: var(--muted); font-size: 10px; }
.map-controls { position: absolute; right: 15px; bottom: 13px; z-index: 4; display: flex; flex-direction: column; gap: 5px; }
.map-controls button { display: grid; place-items: center; width: 33px; height: 33px; padding: 0; border: 1px solid #44607e; border-radius: 2px; background: #162139; color: var(--white); font-size: 21px; line-height: 1; }
.map-controls button:hover { background: #243652; border-color: #b9b4ff; }
.ocean-label { position: absolute; z-index: -1; color: #a0aec9; opacity: .32; pointer-events: none; text-align: center; font: italic 10px/1.7 var(--serif); letter-spacing: .14em; }
.ocean-west { left: 8%; top: 49%; }
.ocean-east { left: 42%; top: 44%; }
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; padding: 7px 20px 12px; color: #a0aec9; font-size: 9px; line-height: 1.5; }
.map-legend > span, .map-legend > button { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.map-legend button { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; }
.map-note { margin: 0; padding: 12px 20px; border-top: 1px solid #2d3c57; color: #a0aec9; font-size: 10px; line-height: 1.65; }
.map-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 11px 20px 14px; border-top: 1px solid #2d3c57; font-size: 10px; }
.map-layers label { display: inline-flex; align-items: center; gap: 8px; }
.map-layers input { width: 13px; height: 13px; margin: 0; accent-color: #b9b4ff; }
.map-layers select { max-width: 185px; height: 30px; padding: 0 7px; border: 1px solid #44607e; border-radius: 2px; background: #162139; color: #edf1fc; font-size: 10px; }
.map-layers > span { color: #a0aec9; font-size: 9px; }
.territory-legend { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 0 20px 14px; font-size: 10px; }
.territory-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.territory-legend i { display: inline-block; width: 10px; height: 10px; }

.timeline-panel { padding: 20px 0 0; }
.timeline-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 15px; }
.timeline-heading > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.timeline-heading > div { display: flex; align-items: center; gap: 15px; }
.timeline-heading .text-button { font-size: 11px; }
.timeline-heading input { width: 115px; height: 30px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--blue); font-size: 11px; text-align: right; }
.timeline-chart { display: flex; align-items: end; gap: 2px; width: 100%; height: 38px; border-bottom: 1px solid var(--line); overflow: hidden; }
.timeline-bar { flex: 1 1 0; min-width: 1px; background: var(--blue); opacity: .44; border-radius: 1px 1px 0 0; }
.timeline-bar.active, .timeline-bar:hover { background: var(--accent); opacity: .9; }
#yearSlider { display: block; width: 100%; height: 18px; margin: 4px 0 3px; accent-color: var(--accent); cursor: ew-resize; }
.timeline-ticks { display: flex; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 8px; }
.era-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.era-buttons button { min-height: 29px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--muted); font-size: 10px; }
.era-buttons button:hover, .era-buttons button.active { border-color: var(--accent); color: var(--accent); }
.timeline-panel > p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }

/* A record is a reading surface, with its evidence kept close to the narrative. */
.detail-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); background: var(--white); }
.detail-panel > p { color: var(--muted); font-size: 13px; }
.record-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; }
.record-header .eyebrow { margin: 0; }
.record-number { color: var(--muted); font: 11px var(--serif); }
.record-category { display: inline-block; color: var(--accent); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; line-height: 1.6; }
.record-date { margin: 11px 0 13px; color: var(--blue); font: 17px/1.5 var(--serif); }
.detail-panel h2, .detail-panel h3, .record-dialog h2, .record-dialog h3 { overflow-wrap: anywhere; }
.detail-panel h2, .detail-panel h3 { font-size: clamp(26px, 2.4vw, 33px); line-height: 1.15; margin: 0 0 15px; }
.record-location { padding-bottom: 16px; margin-bottom: 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.record-description { margin: 0 0 19px; color: var(--ink); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.record-significance { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.record-section { padding-top: 18px; margin-top: 19px; border-top: 1px solid var(--line); }
.record-section h3, .record-section h4 { margin: 0 0 11px; color: var(--ink); font: 20px/1.3 var(--serif); }
.record-section > p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.record-actions, .record-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 19px; }
.record-actions .button, .record-buttons .button { font-size: 11px; }
.record-actions .text-button, .record-buttons .text-button { font-size: 11px; }
.source-list { padding-left: 17px; margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.source-list li { margin-bottom: 12px; padding-left: 3px; overflow-wrap: anywhere; }
.source-list a { color: var(--blue); }
.source-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.source-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #35544e; border-radius: 2px; background: #182c2b; color: var(--green); font: 9px/1.5 var(--sans); white-space: normal; }
.source-badge::before { content: ""; width: 4px; height: 4px; flex: 0 0 4px; border-radius: 50%; background: currentColor; }
.source-badge.needed, .source-badge.missing, .source-badge.unsourced, .source-badge.needs-review, .source-badge[data-state="unsourced"] { border-color: #5f5139; background: #30291f; color: var(--amber); }
.quality-list, .review-issues { padding-left: 16px; margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.75; overflow-wrap: anywhere; }
.quality-list li, .review-issues li { margin-bottom: 7px; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li, .related-list > button { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.6; }
.related-list button { width: 100%; padding: 0; border: 0; background: transparent; color: var(--blue); font: 15px/1.5 var(--serif); text-align: left; }
.related-list button:hover { color: var(--accent); }
.related-list small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.record-details details { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 11px; }
.record-details summary { color: var(--blue); cursor: pointer; font-size: 11px; }
.record-details details[open] summary { margin-bottom: 11px; }
.record-details pre { max-height: 260px; overflow: auto; padding: 13px; border: 1px solid var(--line); background: var(--paper); font: 10px/1.7 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.active-filters:empty { margin: 0; }
.archive-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin: 43px 0 15px; }
.archive-heading h2 { font-size: 33px; }
.archive-heading .eyebrow { margin-bottom: 9px; }
.count-badge { display: inline-block; margin-left: 8px; color: var(--muted); font: 12px var(--sans); letter-spacing: normal; vertical-align: middle; }
.archive-actions { display: flex; align-items: center; gap: 8px; }
.archive-actions select { width: 125px; height: 38px; margin: 0; font-size: 11px; }
.archive-actions .button { font-size: 11px; }
.results-summary { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.table-wrap { width: 100%; border-top: 1px solid var(--ink); }
.event-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.event-table th { padding: 15px 14px 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-align: left; }
.event-table th:nth-child(1) { width: 15%; }
.event-table th:nth-child(2) { width: 43%; }
.event-table th:nth-child(3) { width: 22%; }
.event-table th:nth-child(4) { width: 15%; }
.event-table th:nth-child(5) { width: 5%; }
.event-table td { padding: 22px 20px 21px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.event-table td:first-child { color: var(--blue); font: 14px/1.5 var(--serif); }
.event-table td:last-child { padding-right: 0; }
.event-table tr:hover td, .event-table tr.selected td { background: #24365280; }
.event-title { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font: 21px/1.25 var(--serif); letter-spacing: -.015em; text-align: left; text-decoration: none; overflow-wrap: anywhere; }
.event-title:hover { color: var(--accent); }
.event-summary { display: block; max-width: 540px; margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.event-category { display: block; margin: 0 0 8px; color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.event-location { color: var(--muted); font-size: 11px; line-height: 1.7; }
.event-location small, .event-table td:first-child small { display: block; margin-top: 5px; color: var(--muted); font: 9px/1.5 var(--sans); }
.row-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-tools button { display: grid; place-items: center; width: 28px; min-height: 28px; padding: 3px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--blue); font-size: 14px; }
.row-tools button:hover, .row-tools button.active, .row-tools button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--white); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 21px; color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 9px; }
.pagination .button { font-size: 11px; }
.pagination .text-button { margin-left: 12px; font-size: 11px; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); font-size: 29px; }
.empty-state p { font-size: 13px; }

/* The research desk uses the same typography and rules as the archive. */
#researchView { padding: 24px 0 12px; }
.research-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 24px 0; }
.research-metrics > div { padding: 22px 22px 22px 0; border-right: 1px solid var(--line); }
.research-metrics > div + div { padding-left: 22px; }
.research-metrics > div:last-child { border-right: 0; }
.research-metrics strong { display: block; color: var(--blue); font: 35px/1.2 var(--serif); }
.research-metrics span, .research-metrics small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.research-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 25px 0 17px; }
.research-toolbar label { flex: 1 1 150px; color: var(--muted); font-size: 10px; }
.research-toolbar input, .research-toolbar select { width: 100%; height: 40px; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); font-size: 12px; }
.research-toolbar .button { flex: 0 0 auto; }
.research-table { width: 100%; border-collapse: collapse; table-layout: fixed; border-top: 1px solid var(--ink); }
.research-table th { padding: 13px 15px 13px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .1em; font-weight: 700; text-align: left; }
.research-table td { padding: 20px 18px 20px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.7; }
.research-table th:last-child, .research-table td:last-child { padding-right: 0; }
.research-table .button { font-size: 10px; }
.review-title { display: block; border: 0; padding: 0; margin-bottom: 8px; background: transparent; color: var(--ink); font: 19px/1.3 var(--serif); text-align: left; }
.review-title:hover { color: var(--accent); }
.review-issues { font-size: 10px; }
.research-note { max-width: 920px; margin: 17px 0 25px; padding: 17px 21px; border-left: 2px solid var(--accent); background: var(--white); color: var(--muted); font-size: 12px; line-height: 1.8; }
.research-note h3 { color: var(--ink); font-size: 22px; }
.research-note p:last-child { margin-bottom: 0; }

.context-section { display: grid; grid-template-columns: .95fr 1fr; gap: 12%; padding: 56px 0 62px; margin-top: 60px; border-top: 1px solid var(--line); }
.context-section h2 { font-size: clamp(36px, 4vw, 53px); line-height: 1.14; }
.context-section > div:last-child { align-self: center; }
.context-section > div:last-child p { max-width: 520px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.context-section .text-button { margin-top: 12px; }
main + footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 94px; border-top: 1px solid var(--line); color: var(--muted); }
main + footer .brand .compass { font-size: 30px; }
main + footer .brand > span:last-child { font-size: 10px; }
main + footer > span, main + footer > a:last-child { font-size: 9px; }
main + footer > a:last-child { color: var(--muted); text-decoration: none; }

dialog { width: min(780px, calc(100vw - 40px)); max-height: 85vh; max-height: 85dvh; padding: 30px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 20px 80px #101d3250; }
dialog::backdrop { background: #060b16d9; backdrop-filter: blur(2px); }
.small-dialog { width: min(610px, calc(100vw - 40px)); }
.record-dialog { width: min(860px, calc(100vw - 40px)); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 21px; }
.dialog-header .eyebrow { margin: 0; }
.close-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 23px; line-height: 1; }
.close-button:hover { border-color: var(--accent); color: var(--accent); }
dialog h2 { margin-bottom: 20px; font-size: 37px; }
dialog > h3 { margin-top: 26px; font-size: 23px; }
dialog > p { color: var(--muted); font-size: 13px; line-height: 1.85; }
dialog .record-date { font-size: 20px; }
dialog .record-description { font-size: 14px; }
dialog form > label, .form-grid > label { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
dialog form > label { margin: 18px 0; }
dialog input:not([type="checkbox"]):not([type="hidden"]), dialog select, dialog textarea { display: block; width: 100%; min-height: 41px; margin-top: 7px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font-size: 13px; line-height: 1.55; }
dialog textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; margin: 18px 0; }
.form-note { margin: 16px 0 23px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.check-label { display: flex !important; align-items: center; gap: 9px; }
.check-label input { margin: 0; width: 14px; height: 14px; accent-color: var(--accent); }
.citation-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 17px; margin-top: 25px; border-top: 1px solid var(--line); }
.citation-heading h3 { margin: 0; font-size: 23px; }
.citation-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.citation-row label { color: var(--muted); }
.citation-row .text-button { padding-bottom: 11px; }
.file-label { display: block; margin: 22px 0 13px; color: var(--muted); font-size: 11px; }
#importPreview { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
#importPreview:empty { display: none; }
#importPreview table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
#importPreview th, #importPreview td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
#importPreview ul { padding-left: 18px; color: var(--muted); }
#dateError, #editError, #importError { color: var(--amber); font-size: 12px; line-height: 1.6; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 30; max-width: min(540px, calc(100vw - 36px)); padding: 13px 19px; border: 1px solid #44607e; border-radius: 2px; background: var(--dark); color: var(--white); box-shadow: 0 5px 24px #0a112040; transform: translateX(-50%); font-size: 12px; line-height: 1.6; text-align: center; }

@media (min-width: 1500px) {
  .hero { padding-top: 67px; padding-bottom: 61px; }
  .detail-panel { padding: 30px; }
}
@media (max-width: 1100px) {
  .masthead { gap: 18px; }
  .masthead nav { gap: 18px; }
  .saved-nav { padding-left: 17px; }
  .hero { gap: 45px; }
  .hero-stats { gap: 12px; }
  .atlas-grid { grid-template-columns: minmax(0,1.75fr) minmax(270px,1fr); gap: 18px; }
  .detail-panel { padding: 21px; }
  .filter-bar { gap: 10px; flex-wrap: wrap; }
  .filter-bar .search-field { flex-basis: 100%; }
  .filter-bar > label:not(.search-field) { flex: 1; }
  .time-info { gap: 10px; }
  .archive-heading { gap: 15px; }
  .archive-heading h2 { font-size: 30px; }
  .event-table td { padding-right: 15px; }
  .event-title { font-size: 19px; }
  .account-link { font-size: 10px; }
}
@media (max-width: 900px) {
  .masthead { flex-wrap: wrap; row-gap: 8px; padding-top: 17px; padding-bottom: 12px; }
  .masthead nav { order: 4; width: 100%; margin: 0; justify-content: flex-start; gap: 27px; }
  .masthead .saved-nav { margin-left: auto; }
  .hero { gap: 34px; padding-top: 43px; padding-bottom: 40px; }
  .hero-stats { grid-template-columns: repeat(3,minmax(0,1fr)); padding: 26px 0; }
  .hero-stats strong { font-size: 34px; }
  .research-strip { gap: 14px; flex-wrap: wrap; }
  .research-strip p { flex-basis: 65%; }
  .research-strip .text-button { margin-left: auto; }
  .atlas-grid { grid-template-columns: 1fr; gap: 24px; }
  .map-wrap { min-height: 300px; max-height: 430px; }
  .detail-panel { padding: 26px; }
  .detail-panel h2, .detail-panel h3 { max-width: 620px; font-size: 31px; }
  .detail-panel .record-description, .detail-panel .record-significance { max-width: 720px; }
  .archive-heading { align-items: flex-start; flex-wrap: wrap; }
  .archive-actions { margin-top: 8px; }
  .context-section { gap: 9%; }
}
@media (max-width: 650px) {
  main, .masthead, main + footer { padding-left: 5%; padding-right: 5%; }
  .masthead { gap: 13px; }
  .brand { gap: 8px; }
  .brand .compass { font-size: 33px; }
  .brand > span:last-child { font-size: 10px; letter-spacing: .12em; }
  .brand small { font-size: 7px; margin-top: 4px; }
  .saved-nav { padding-left: 12px; font-size: 11px; }
  .account-link { font-size: 9px; }
  .masthead nav { gap: 26px; }
  .nav-link { min-height: 38px; font-size: 11px; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 39px; padding-bottom: 31px; }
  .hero h1 { font-size: clamp(48px, 11vw, 66px); margin-bottom: 20px; }
  .hero-description { max-width: 390px; font-size: 14px; }
  .hero-cta { margin-top: 7px; }
  .hero-register { padding-top: 0; }
  .hero-stats { padding: 22px 0; gap: 20px; }
  .hero-stats strong { font-size: 39px; }
  .hero-stats span { font-size: 10px; }
  .register-bottom { padding: 12px 0; }
  .register-bottom > span:first-child { max-width: 270px; font-size: 14px; }
  .register-seal { width: 44px; height: 44px; flex-basis: 44px; font-size: 12px; }
  .research-strip { gap: 9px 12px; padding: 13px 0; }
  .research-strip > span { font-size: 8px; }
  .research-strip p { flex-basis: calc(100% - 130px); font-size: 10px; }
  .research-strip .text-button { margin-left: 0; font-size: 10px; }
  .explore { padding-top: 32px; }
  .section-title { display: block; margin-bottom: 19px; }
  .section-title h2 { font-size: 30px; }
  .section-title > p { max-width: none; margin-top: 12px; font-size: 11px; text-align: left; }
  .view-tabs { gap: 22px; margin-bottom: 20px; }
  .view-tabs button { min-height: 44px; font-size: 11px; }
  .filter-bar { gap: 11px; }
  .filter-bar > label { font-size: 8px; }
  .filter-bar > label:not(.search-field) { flex-basis: calc(50% - 10px); }
  .filter-bar > label:nth-child(4) { flex-basis: calc(100% - 65px); }
  .filter-bar select, .filter-bar input { height: 44px; font-size: 12px; }
  .filter-bar .search-field { flex-basis: 100%; }
  .search-field > span[aria-hidden] { top: 18px; }
  .reset-button { min-height: 44px; padding-left: 0; }
  .time-toolbar { display: block; padding: 14px 0 18px; }
  .time-mode { justify-content: flex-start; gap: 3px; }
  .time-mode button { min-height: 38px; padding: 6px 10px; font-size: 10px; }
  .time-info { justify-content: space-between; margin-top: 12px; font-size: 10px; }
  .time-info .text-button { font-size: 10px; }
  .map-header { padding: 15px 14px 6px; gap: 10px; }
  .map-header strong { font-size: 10px; }
  .map-header > span:last-child { font-size: 7px; }
  .map-wrap { min-height: 230px; max-height: none; }
  .map-controls { right: 10px; bottom: 10px; gap: 5px; }
  .map-controls button { width: 44px; height: 44px; }
  .map-legend { padding: 9px 14px 12px; gap: 8px 12px; font-size: 8px; }
  .map-note { padding: 12px 14px; font-size: 9px; }
  .map-layers { padding: 12px 14px; gap: 10px; }
  .map-layers label { flex-basis: 100%; font-size: 10px; min-height: 28px; }
  .map-layers input { width: 16px; height: 16px; }
  .map-layers select { height: 38px; max-width: 65%; font-size: 10px; }
  .territory-legend { padding: 0 14px 12px; font-size: 9px; }
  .ocean-label { font-size: 8px; }
  .timeline-heading { gap: 10px; }
  .timeline-heading > span { font-size: 8px; }
  .timeline-heading > div { gap: 10px; }
  .timeline-heading input { width: 106px; height: 36px; font-size: 11px; }
  .timeline-heading .text-button { font-size: 10px; }
  .timeline-ticks { font-size: 7px; gap: 5px; }
  .era-buttons { gap: 6px; }
  .era-buttons button { min-height: 35px; font-size: 9px; }
  .detail-panel { padding: 24px 21px; }
  .detail-panel h2, .detail-panel h3 { font-size: 30px; }
  .record-description { font-size: 13px; }
  .record-header { margin-bottom: 15px; }
  .record-actions .button, .record-buttons .button { min-height: 42px; }
  .archive-heading { margin-top: 33px; }
  .archive-heading h2 { font-size: 29px; }
  .archive-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .archive-actions select { flex: 1; min-width: 110px; }
  .archive-actions .button { font-size: 10px; padding: 8px 10px; }
  .event-table { display: block; }
  .event-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .event-table tbody { display: block; }
  .event-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px 15px; padding: 23px 0; border-bottom: 1px solid var(--line); }
  .event-table td { display: block; width: auto; padding: 0; border: 0; }
  .event-table tr:hover td, .event-table tr.selected td { background: transparent; }
  .event-table tr.selected { background: #24365299; }
  .event-table td:first-child { grid-column: 1; grid-row: 1; font-size: 15px; }
  .event-table td:nth-child(2) { grid-column: 1/-1; grid-row: 2; }
  .event-table td:nth-child(3) { grid-column: 1/-1; grid-row: 3; }
  .event-table td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; max-width: 125px; }
  .event-table td:nth-child(5) { grid-column: 1/-1; grid-row: 4; }
  .event-title { font-size: 23px; }
  .event-category { margin-bottom: 8px; font-size: 8px; }
  .event-summary { font-size: 12px; line-height: 1.8; margin-top: 11px; }
  .event-location { font-size: 11px; }
  .source-badge { font-size: 8px; }
  .row-tools { justify-content: flex-start; gap: 8px; }
  .row-tools button { width: 42px; min-height: 42px; font-size: 16px; }
  .pagination { display: block; padding-top: 20px; }
  .pagination > div { flex-wrap: wrap; margin-top: 13px; gap: 8px; }
  .pagination .button { min-height: 42px; }
  .pagination .text-button { margin: 8px 0 0; flex-basis: 100%; }
  .research-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .research-metrics > div { padding: 20px 15px 20px 0; }
  .research-metrics > div + div { padding-left: 15px; }
  .research-metrics > div:nth-child(2) { border-right: 0; }
  .research-metrics > div:nth-child(3) { padding-left: 0; border-top: 1px solid var(--line); }
  .research-metrics > div:nth-child(4) { border-top: 1px solid var(--line); }
  .research-metrics strong { font-size: 31px; }
  .research-toolbar { gap: 10px; }
  .research-toolbar label { flex-basis: calc(50% - 5px); }
  .research-toolbar label:first-child { flex-basis: 100%; }
  .research-table th { font-size: 8px; padding-right: 10px; }
  .research-table td { font-size: 10px; padding-right: 10px; }
  .research-table .review-title { font-size: 16px; }
  .research-note { padding: 16px 17px; font-size: 11px; }
  .context-section { grid-template-columns: 1fr; gap: 25px; padding: 38px 0 43px; margin-top: 44px; }
  .context-section h2 { font-size: 40px; }
  .context-section > div:last-child p { font-size: 12px; line-height: 1.9; }
  main + footer { flex-wrap: wrap; gap: 15px; padding-top: 22px; padding-bottom: 22px; }
  main + footer > span { flex-basis: calc(100% - 200px); text-align: right; }
  main + footer > a:last-child { flex-basis: 100%; }
  dialog { max-height: 85dvh; padding: 24px 20px; width: calc(100vw - 24px); }
  .small-dialog, .edit-dialog, .record-dialog { width: calc(100vw - 24px); }
  dialog h2 { font-size: 31px; }
  .close-button { width: 40px; height: 40px; }
  .form-grid { gap: 13px; }
  dialog input:not([type="checkbox"]):not([type="hidden"]), dialog select, dialog textarea { min-height: 44px; }
  .citation-row { grid-template-columns: 1fr auto; gap: 9px; }
  .citation-row label { grid-column: 1; }
  .citation-row .text-button { grid-column: 2; grid-row: 1/3; padding-bottom: 12px; }
}
@media (max-width: 380px) {
  .masthead { gap: 9px; }
  .brand > span:last-child { font-size: 9px; }
  .brand small { font-size: 6px; }
  .saved-nav { padding-left: 9px; font-size: 10px; }
  .account-link { max-width: 55px; white-space: normal; font-size: 9px; line-height: 1.5; }
  .hero h1 { font-size: 48px; }
  .hero-stats { gap: 15px; }
  .hero-stats strong { font-size: 34px; }
  .hero-stats span { font-size: 9px; }
  .time-mode button { padding: 6px 8px; }
  .form-grid { grid-template-columns: 1fr; }
  main + footer > span { flex-basis: 100%; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  body { background: white; }
  .masthead nav, .account-link, .saved-nav, .map-controls, .filter-bar, .time-toolbar, .view-tabs, .archive-actions, .row-tools, .pagination, .record-actions, .record-buttons, .hero-cta, .toast { display: none !important; }
  main, .masthead, main + footer { max-width: none; padding-left: 0; padding-right: 0; }
  .atlas-grid { grid-template-columns: 1.5fr 1fr; }
  .map-panel { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .event-table tr, .detail-panel, .record-section { break-inside: avoid; }
}

.daily-discovery{display:flex;gap:12px;align-items:center;border-top:1px solid var(--line);padding-top:15px;font-size:11px;flex-wrap:wrap}.daily-discovery>span{font-size:9px;text-transform:uppercase;letter-spacing:1px;color:var(--muted)}.record-media{display:grid;gap:14px}.record-media figure{margin:0}.record-media img{max-width:100%;width:100%;height:auto;max-height:360px;object-fit:contain}.record-media figcaption{font-size:11px;color:var(--muted);line-height:1.6;padding-top:6px}

.archive-loading{font-size:12px;color:var(--muted);padding:18px 0;border-bottom:1px solid var(--line)}.map-marker-text{fill:#0e1626;font-weight:600}

.timeline-bar{height:var(--bar-height);min-height:2px;border:0;padding:0;cursor:pointer}.map-marker-leader{stroke:#a0aec9;stroke-width:.65;stroke-opacity:.55;vector-effect:non-scaling-stroke}.selected-pin{fill:none;stroke:#b9b4ff;stroke-width:2.3}.record-details{font-size:12px;line-height:1.7;padding-top:12px;margin-top:12px;border-top:1px solid var(--line)}

/* Midnight Observatory: bright actions on deep navy; light surfaces are panels. */
.button.primary, :root .tc-primary-action { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover:not(:disabled), :root .tc-primary-action:hover { background: #d0ccff; border-color: #d0ccff; color: var(--on-accent); }
.map-panel { background: var(--map-ocean); border-color: var(--line); }
.map-country { fill: var(--map-land); stroke: var(--map-stroke); }
.map-controls button { color: var(--ink); }
.selected-pin { stroke: var(--accent); }
.skip-link, .toast { color: var(--ink); }
.record-date { color: var(--blue); }
::selection { background: #b9b4ff; color: #0e1626; }
