/*
 * Cerulean theme, layered on Bootstrap 5.3.
 * Bootstrap docs (CSS variables): https://getbootstrap.com/docs/5.3/customize/css-variables/
 *
 * Palette ("river and silt"): ink, cerulean, cool paper, silt sand for tags.
 * Type: IBM Plex Sans Condensed for headlines, IBM Plex Serif for article text.
 */

/* ---------- Fonts (self-hosted, SIL Open Font License; see vendor/plex/LICENSE.txt) ---------- */
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/plex/IBMPlexSansCondensed-Medium.a2b8f7579f37.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/plex/IBMPlexSansCondensed-SemiBold.7291775918ac.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/plex/IBMPlexSerif-Regular.ff8d479bebd8.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("../vendor/plex/IBMPlexSerif-Italic.7175fae05d35.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/plex/IBMPlexSerif-SemiBold.5afc89b4b496.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root,
[data-bs-theme="light"] {
  --ink: #15242f;
  --ink-soft: #4a5c69;
  --cerulean: #1c7daf;
  --cerulean-strong: #145f86;
  --paper: #f3f6f8;
  --surface: #ffffff;
  --rule: #d3dce2;
  --silt-bg: #ede4cc;
  --silt-fg: #6a5627;
  --nav-bg: #15242f;
  --gold: #a28a0c;         /* accent lines only (3.4:1 on white): never body text */

  --font-head: "IBM Plex Sans Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-read: "IBM Plex Serif", Georgia, "Times New Roman", serif;

  /* Point Bootstrap at the palette */
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--ink-soft);
  --bs-border-color: var(--rule);
  --bs-link-color: var(--cerulean-strong);
  --bs-link-color-rgb: 20, 95, 134;
  --bs-link-hover-color: var(--cerulean);
  --bs-link-hover-color-rgb: 28, 125, 175;
  --bs-primary: var(--cerulean);
  --bs-primary-rgb: 28, 125, 175;
  --bs-focus-ring-color: rgba(28, 125, 175, 0.35);
  --bs-tertiary-bg: var(--surface);
}

[data-bs-theme="dark"] {
  --ink: #dce6ec;
  --ink-soft: #9fb2be;
  --cerulean: #5bb4e3;
  --cerulean-strong: #86c9ec;
  --paper: #0e1b23;
  --surface: #142631;
  --rule: #263c4c;
  --silt-bg: #3b3322;
  --silt-fg: #e5d5a8;
  --nav-bg: #04090d;
  --gold: #d9be3c;

  --bs-link-color-rgb: 134, 201, 236;
  --bs-link-hover-color-rgb: 91, 180, 227;
  --bs-primary-rgb: 91, 180, 227;
  --bs-focus-ring-color: rgba(91, 180, 227, 0.4);
}

/* ---------- Base ---------- */
body { background: var(--paper); color: var(--ink); }

:focus-visible { outline: 2px solid var(--cerulean); outline-offset: 2px; }

.skip-link { position: absolute; left: 1rem; top: 0.5rem; z-index: 2000; padding: 0.5rem 0.75rem;
  background: var(--surface); color: var(--ink); border: 2px solid var(--cerulean); }

h1, h2, h3, h4, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.005em; }

.display-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.4rem);
  line-height: 1.1; margin-bottom: 0.25rem; }

.page-header { padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }

/* Bootstrap component colours */
.btn-primary {
  --bs-btn-bg: var(--cerulean); --bs-btn-border-color: var(--cerulean);
  --bs-btn-hover-bg: var(--cerulean-strong); --bs-btn-hover-border-color: var(--cerulean-strong);
  --bs-btn-active-bg: var(--cerulean-strong); --bs-btn-active-border-color: var(--cerulean-strong);
  --bs-btn-disabled-bg: var(--cerulean); --bs-btn-disabled-border-color: var(--cerulean);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #08151c; --bs-btn-hover-color: #08151c; --bs-btn-active-color: #08151c; }
.btn-outline-primary {
  --bs-btn-color: var(--cerulean-strong); --bs-btn-border-color: var(--cerulean);
  --bs-btn-hover-bg: var(--cerulean); --bs-btn-hover-border-color: var(--cerulean);
  --bs-btn-active-bg: var(--cerulean-strong); --bs-btn-active-border-color: var(--cerulean-strong);
}
.form-control:focus, .form-select:focus { border-color: var(--cerulean); box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color); }
.form-control, .form-select, .form-control:focus, .form-select:focus { background-color: var(--surface); }
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--rule); border-radius: 4px; }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-active-bg: var(--ink);
  --bs-list-group-active-border-color: var(--ink); --bs-list-group-active-color: var(--paper); }
.pagination { --bs-pagination-color: var(--cerulean-strong); --bs-pagination-bg: var(--surface);
  --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink);
  --bs-pagination-active-color: var(--paper); --bs-pagination-focus-box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--cerulean); }
.breadcrumb { --bs-breadcrumb-divider-color: var(--ink-soft); --bs-breadcrumb-item-active-color: var(--ink-soft); }

/* ---------- Navbar (two rows: brand + tools, then sections) ---------- */
.site-nav { background: var(--nav-bg); flex-direction: column; align-items: stretch; padding: 0; }
/* Dark mode: menu text the same white as the brand (Bootstrap's default is 55% white). */
[data-bs-theme="dark"] .site-nav { --bs-navbar-color: #fff; --bs-navbar-hover-color: #fff; --bs-navbar-active-color: #fff; }
.site-nav > .site-nav-top { flex-wrap: nowrap; padding-top: 0.65rem; padding-bottom: 0.65rem; }
.site-nav .navbar-brand { font-family: var(--font-head); font-weight: 600; font-size: 1.65rem; letter-spacing: 0.01em;
  padding: 0; margin-right: 1rem; }
/* Logo ridge lines (img/brand/cerulean-mark.png, pre-coloured #5bb4e3 for the always-dark navbar). */
.brand-mark { display: block; height: 2rem; width: auto; }
@media (max-width: 575.98px) {
  .site-nav .navbar-brand { font-size: 1.35rem; margin-right: 0.5rem; }
  .brand-mark { height: 1.6rem; }
}
.site-nav .nav-link { font-family: var(--font-head); font-weight: 500; font-size: 1rem; white-space: nowrap; }
.site-nav-tools { flex-direction: row; align-items: center; gap: 0.25rem; }
.site-nav-tools .nav-link { padding: 0.375rem 0.5rem; }
.site-nav-tools .dropdown-menu { position: absolute; }   /* stay a pop-up on small screens too */

.site-nav-sections { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.site-nav-sections .nav-link { font-size: 1.15rem; }
.site-nav-sections .nav-link:hover, .site-nav-sections .nav-link.show,
.site-nav-sections .nav-link.active { box-shadow: inset 0 -3px 0 var(--gold); }
.site-nav-sections .nav-link.active { color: #fff; }
@media (min-width: 1200px) {
  .site-nav-sections .navbar-nav .nav-link { padding: 0.6rem 0.9rem; }
  .site-nav-sections .navbar-nav .nav-item:first-child .nav-link { padding-left: 0; }
}

.nav-search { width: 16rem; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.nav-search::placeholder { color: rgba(255, 255, 255, 0.6); }
.nav-search:focus { background: rgba(255, 255, 255, 0.14); color: #fff; }
@media (max-width: 1199.98px) {
  .nav-search { width: 100%; }
  .site-nav-sections { border-top: 0; }
  .site-nav-sections .navbar-collapse { padding-bottom: 0.5rem; }
  .site-nav-sections .nav-link:hover, .site-nav-sections .nav-link.show,
  .site-nav-sections .nav-link.active { box-shadow: inset 3px 0 0 var(--gold); padding-left: 0.6rem; }
}

/* ---------- Story blocks (article lists) ---------- */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); column-gap: 2rem; }
.story-grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }

.story { position: relative; padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--rule); }
.story-title { font-size: 1.15rem; line-height: 1.22; margin: 0.35rem 0 0.4rem; }
.story-title a { color: var(--ink); text-decoration: none; }
.story-title a:hover, .story-title a:focus-visible { text-decoration: underline; text-decoration-color: var(--cerulean);
  text-decoration-thickness: 2px; text-underline-offset: 3px; }
.story-excerpt { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.5rem;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; }

.tag { display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: 0.78rem; line-height: 1.5;
  padding: 0 0.45rem; border-radius: 2px; background: var(--silt-bg); color: var(--silt-fg); text-decoration: none; }
.tag:hover { color: var(--silt-fg); text-decoration: underline; }

/* Place names: the one bold element. Every story shows where it happened. */
.places { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.85rem; padding: 0; margin: 0.6rem 0 0;
  font-family: var(--font-head); font-weight: 500; font-size: 0.85rem; color: var(--cerulean-strong); }
.places li { display: inline-flex; align-items: center; gap: 0.25rem; }
.places .bi { font-size: 0.75em; }
.places-more { color: var(--ink-soft); }

/* ---------- Home: section index ---------- */
.index-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 0 1.25rem; }
.index-section { padding: 1rem 0; }
.index-section + .index-section { border-top: 1px solid var(--rule); }
.index-title { font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.index-title .bi { color: var(--cerulean); }
.index-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.92rem; }
.index-links a { text-decoration: none; }
.index-links a:hover { text-decoration: underline; }

/* ---------- Category page ---------- */
.category-header { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; }
.category-search { width: min(100%, 22rem); }

/* Day dividers between groups of stories (category pages) */
.day-group + .day-group { margin-top: 2.25rem; }
.day-divider { font-size: 1.4rem; margin: 0; padding-bottom: 0.4rem; border-bottom: 3px solid var(--ink); }

/* ---------- Article page ---------- */
/* Full-width header, then the text beside a sticky column holding the map and the places list. */
.article-header { padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--ink); }
.article-title { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem); line-height: 1.08; margin-bottom: 0.9rem; }
.article-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 0; }
.article-facts dt { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.article-facts dd { margin: 0; font-variant-numeric: tabular-nums; }

.article-layout { display: grid; gap: 2rem; }
.article-body p { font-family: var(--font-read); font-size: 1.05rem; line-height: 1.65; margin-bottom: 1em; }
@media (min-width: 992px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 22rem; gap: 2.5rem; }
  /* Clears the two-row sticky navbar. */
  .article-aside { position: sticky; top: 8rem; align-self: start; }
}
@media (min-width: 1200px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 32rem; }
  .article-places { display: grid; grid-template-columns: minmax(0, 1fr) 10.5rem; gap: 1rem; align-items: start; }
  .article-places .location-list { max-height: 22rem; overflow-y: auto; margin-top: 0; }
  .article-places .article-map { height: 22rem; }
}

.aside-title { font-size: 1.05rem; margin-bottom: 0.75rem; }
.article-map { height: 20rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
@media (max-width: 575.98px) { .article-map { height: 16rem; } }
.location-list { list-style: none; padding: 0; margin: 0.75rem 0 0; border-top: 1px solid var(--rule); }
.location-button { width: 100%; display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.25rem;
  background: none; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-align: left; }
.location-button .bi { font-size: 0.75em; color: var(--cerulean-strong); }
.location-button:hover, .location-button[aria-pressed="true"] { color: var(--cerulean-strong); background: var(--surface); }
.location-name { font-family: var(--font-head); font-weight: 500; }
.leaflet-container { font: inherit; }
/* Darken the (light) map tiles in dark mode so the map doesn't glare. */
[data-bs-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(190deg) brightness(0.85) contrast(0.9) saturate(0.4); }

/* ---------- Geo overview (/geo/) ---------- */
/* Full-height page: navbar, ticker, then the map fills the rest. Slide-outs start below the ticker (--geo-top set by JS). */
.geo-page { height: 100vh; height: 100dvh; overflow: hidden; }
.geo-main { flex: 1 1 auto; min-height: 0; display: flex; }
.geo-shell { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; }

.geo-ticker { display: flex; align-items: stretch; height: 2.5rem; flex: none; background: var(--surface); border-bottom: 1px solid var(--rule); }
.geo-ticker-label { display: flex; align-items: center; padding: 0 0.85rem; background: var(--nav-bg); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  box-shadow: inset 0 -3px 0 var(--gold); }
.geo-ticker-viewport { flex: 1 1 auto; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent); }
/* Two copies of the list; moving by exactly half loops seamlessly (so items use padding, not gap). */
.geo-ticker-track { display: flex; width: max-content; list-style: none; margin: 0; padding: 0 0 0 1rem; }
.geo-ticker-track.is-scrolling { animation: geo-ticker var(--ticker-duration, 60s) linear infinite; }
@keyframes geo-ticker { to { transform: translateX(-50%); } }
.geo-ticker.is-paused .geo-ticker-track,
.geo-ticker-viewport:hover .geo-ticker-track,
.geo-ticker-viewport:focus-within .geo-ticker-track { animation-play-state: paused; }
.geo-ticker-item { display: flex; align-items: center; gap: 0.45rem; height: 2.5rem; padding: 0 1.75rem 0 0; background: none;
  border: 0; color: var(--ink); white-space: nowrap; font-size: 0.9rem; }
.geo-ticker-item:hover .geo-ticker-title, .geo-ticker-item:focus-visible .geo-ticker-title {
  text-decoration: underline; text-decoration-color: var(--cerulean); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.geo-ticker-time { color: var(--ink-soft); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.geo-ticker-title { font-family: var(--font-head); font-weight: 500; }
.geo-ticker-empty { padding-right: 1rem; color: var(--ink-soft); font-size: 0.9rem; line-height: 2.5rem; white-space: nowrap; }
.geo-ticker-toggle { flex: none; width: 2.5rem; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--ink-soft); }
.geo-ticker-toggle:hover { color: var(--cerulean-strong); }
@media (prefers-reduced-motion: reduce) {
  .geo-ticker-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .geo-ticker-track { animation: none !important; }
  .geo-ticker-toggle { display: none; }
}

.geo-stage { position: relative; flex: 1 1 auto; min-height: 0; }
/* Two classes: maplibre-gl.css (loaded later) sets .maplibregl-map { position: relative }. */
.geo-stage > .geo-map { position: absolute; inset: 0; background: var(--paper); }
.maplibregl-map { font: inherit; }

/* Floating chrome on the map */
.geo-status, .geo-legend, .geo-tab { position: absolute; z-index: 2; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 4px; box-shadow: 0 1px 4px rgba(21, 36, 47, 0.12); }
.geo-status { top: 0.75rem; left: 0.75rem; max-width: calc(100% - 9.5rem); margin: 0; padding: 0.3rem 0.65rem;
  font-size: 0.82rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.geo-status.is-error { color: var(--bs-danger-text-emphasis); border-color: var(--bs-danger-border-subtle); }
.geo-tab { top: 0.75rem; right: 0; display: flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.8rem; border-right: 0;
  border-radius: 4px 0 0 4px; color: var(--ink); font-family: var(--font-head); font-weight: 600; }
.geo-tab:hover { color: var(--cerulean-strong); }
.geo-legend { left: 0.75rem; bottom: 2.6rem; padding: 0.5rem 0.7rem; font-size: 0.8rem; max-height: 40%; overflow-y: auto; }
.geo-legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.geo-legend-list li { display: flex; align-items: center; gap: 0.45rem; }
.geo-legend-title { display: block; font-weight: 600; }
.geo-legend-ramp { display: block; width: 9rem; height: 0.5rem; margin: 0.35rem 0 0.15rem; border-radius: 2px;
  background: linear-gradient(to right, #b7d3f6, #6da7ec, #2a78d6, #1c5cab, #0d366b); }
[data-bs-theme="dark"] .geo-legend-ramp { background: linear-gradient(to right, #184f95, #256abf, #3987e5, #86b6ef, #cde2fb); }
.geo-legend-scale { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 0.72rem; }

/* Category colour dot: the 2px ring keeps it readable on any map colour. */
.geo-swatch { display: inline-block; flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #6b7a86;
  box-shadow: 0 0 0 2px var(--surface); }

/* Slide-outs: no backdrop, start below the ticker. */
.geo-page .geo-panel { top: var(--geo-top, 0); height: auto; bottom: 0; --bs-offcanvas-width: 26rem;
  --bs-offcanvas-bg: var(--surface); --bs-offcanvas-border-color: var(--rule); box-shadow: 0 0 12px rgba(21, 36, 47, 0.15); }
@media (max-width: 575.98px) { .geo-page .geo-panel { --bs-offcanvas-width: 100vw; } .geo-tab span { display: none; } }
.geo-panel-title { font-size: 1.05rem; }

.geo-fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.geo-fieldset legend { float: none; font-family: var(--font-head); font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }
.geo-range-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.geo-range-custom { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.6rem; align-items: center; margin-top: 0.75rem; }
.geo-range-custom[hidden] { display: none; }
.geo-range-custom .form-label { margin: 0; }
.geo-range-custom .btn, .geo-range-custom .form-text { grid-column: 1 / -1; justify-self: start; margin: 0; }
.geo-cat-actions { display: flex; gap: 1rem; margin-bottom: 0.25rem; }
.geo-cat-section { margin: 0.75rem 0 0.25rem; font-family: var(--font-head); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.geo-cat .form-check-label { display: flex; align-items: center; gap: 0.45rem; width: 100%; }
.geo-cat-count { margin-left: auto; color: var(--ink-soft); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* Detail panel contents (geo/panel.html) */
.geo-detail-meta, .geo-pop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; color: var(--ink-soft);
  font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.geo-detail-title { font-size: 1.35rem; line-height: 1.15; margin: 0.55rem 0 0.5rem; }
.geo-detail-summary { font-family: var(--font-read); font-style: italic; color: var(--ink-soft); }
.geo-detail-places { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; padding: 0; margin: 0.75rem 0; }
.geo-place { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; background: none;
  border: 1px solid var(--rule); border-radius: 2px; color: var(--cerulean-strong); font-family: var(--font-head);
  font-weight: 500; font-size: 0.85rem; }
.geo-place .bi { font-size: 0.75em; }
.geo-place:hover { background: var(--paper); }
.geo-detail-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.geo-detail-body p { font-family: var(--font-read); font-size: 0.98rem; line-height: 1.6; }

.geo-list { list-style: none; margin: 0; padding: 0; }
.geo-list-item { width: 100%; padding: 0.65rem 0; background: none; border: 0; border-bottom: 1px solid var(--rule);
  color: var(--ink); text-align: left; }
.geo-list-title { display: block; margin-top: 0.2rem; font-family: var(--font-head); font-weight: 500; line-height: 1.25; }
.geo-list-item:hover .geo-list-title, .geo-list-item:focus-visible .geo-list-title { text-decoration: underline;
  text-decoration-color: var(--cerulean); }

/* Hover card on pins */
.geo-popup .maplibregl-popup-content { padding: 0.65rem 0.8rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 2px 10px rgba(21, 36, 47, 0.18); font-size: 0.85rem; }
.geo-popup[class*="anchor-bottom"] .maplibregl-popup-tip { border-top-color: var(--surface); }
.geo-popup[class*="anchor-top"] .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.geo-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.geo-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.geo-popup .maplibregl-popup-close-button { color: var(--ink-soft); font-size: 1.1rem; padding: 0 0.35rem; }
.geo-pop-meta { margin-bottom: 0.25rem; font-size: 0.75rem; }
.geo-pop-title { display: block; font-family: var(--font-head); font-weight: 600; font-size: 0.98rem; line-height: 1.2; }
.geo-pop-summary { margin: 0.35rem 0 0; color: var(--ink-soft); line-height: 1.4; }
.geo-pop-place { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.4rem; color: var(--cerulean-strong);
  font-family: var(--font-head); font-weight: 500; }
.geo-pop-place .bi { font-size: 0.75em; }
.geo-pop-more { margin-top: 0.25rem; color: var(--ink-soft); font-size: 0.75rem; }

/* MapLibre's own controls in dark mode */
[data-bs-theme="dark"] .maplibregl-ctrl-group { background: var(--surface); }
[data-bs-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: var(--rule); }
[data-bs-theme="dark"] .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1); }
[data-bs-theme="dark"] .maplibregl-ctrl.maplibregl-ctrl-attrib,
[data-bs-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(14, 27, 35, 0.85); color: var(--ink); }
[data-bs-theme="dark"] .maplibregl-ctrl-attrib a { color: var(--ink-soft); }
[data-bs-theme="dark"] .maplibregl-ctrl-scale { background: rgba(14, 27, 35, 0.75); color: var(--ink); border-color: var(--ink-soft); }

/* ---------- Social media page ---------- */
.handles-table { --bs-table-bg: var(--surface); }
.handles-table thead th { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.handles-table select { min-width: 9rem; }
.handle-link { font-weight: 600; text-decoration: none; }
.handle-link:hover { text-decoration: underline; }
.add-handles .mb-3 { margin-bottom: 0.75rem !important; }

/* ---------- Empty states, auth, footer ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--rule); border-radius: 4px; color: var(--ink-soft); }
.empty-state .bi { display: block; font-size: 2rem; margin-bottom: 0.5rem; color: var(--cerulean); }

.auth-page { display: flex; align-items: center; justify-content: center; padding: 8vh 1rem; }
.auth-card { width: min(100%, 26rem); }
.auth-brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); font-weight: 600; font-size: 1.6rem; }
.auth-brand .bi { color: var(--cerulean); }

.site-footer { border-top: 1px solid var(--rule); color: var(--ink-soft); }

.form-text ul { padding-left: 1.1rem; margin: 0.25rem 0 0; }
