:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --panel2: #243044;
  --text: #e8eef7;
  --muted: #9aadc2;
  --accent: #f0a500;
  --accent2: #3dbbff;
  --border: #2e3d52;
  --ok: #3dd68c;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent2); }
a:hover { color: #8fd4ff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  align-items: flex-end; padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #152033, var(--bg));
}
.brand h1 { margin: 0; font-size: 1.55rem; letter-spacing: .02em; }
.brand h1 a {
  color: inherit;
  text-decoration: none;
}
.brand h1 a:hover {
  color: var(--accent2);
}
.sub { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.meta { color: var(--muted); font-size: .88rem; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 16px 20px 48px; }

.search-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.search-row { display: flex; gap: 10px; }
#q {
  flex: 1; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: #0c1118; color: var(--text);
  outline: none;
}
#q:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(61,187,255,.2); }
#btnSearch {
  padding: 0 18px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #1a1200; font-weight: 700;
}
#btnSearch:hover { filter: brightness(1.08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .85rem;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 165, 0, 0.12);
}
.status { margin: 10px 0 0; color: var(--muted); font-size: .9rem; min-height: 1.2em; }

.page-explorer .browse-map-detail {
  margin-top: 14px;
}
.page-explorer #map {
  pointer-events: auto;
}
.page-explorer.explorer-landing .map-panel,
.page-explorer.explorer-landing .browse-map-detail,
.page-explorer.explorer-landing .results {
  display: none;
}
.page-explorer:not(.explorer-landing) .explorer-cloud-panel {
  display: none;
}

.explorer-cloud-panel {
  margin-top: 18px;
  padding: 22px 24px 28px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(240, 165, 0, 0.12), transparent 42%),
    radial-gradient(ellipse at 88% 12%, rgba(61, 187, 255, 0.12), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(61, 214, 140, 0.08), transparent 45%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.explorer-cloud-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  letter-spacing: .01em;
  text-align: center;
}
.explorer-cloud-lead {
  margin: 0 0 18px;
  color: var(--muted);
  text-align: center;
  font-size: .95rem;
}
.explorer-cloud-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  max-width: 1100px;
  margin: 0 auto;
}
.explorer-cloud-tag {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--accent2)) 50%, var(--border));
  color: var(--tag-color, var(--accent2));
  background: color-mix(in srgb, var(--tag-color, var(--accent2)) 16%, #122033);
  transition: transform .12s ease, filter .12s ease;
}
.explorer-cloud-tag:hover,
.explorer-cloud-tag:focus-visible {
  transform: scale(1.07);
  filter: brightness(1.14);
  outline: none;
}
.explorer-cloud-tag.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.tag-search {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
}
button.tag-search:hover {
  border-color: var(--accent2);
  color: #d7e8f8;
}

.map-panel {
  margin-top: 14px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
#map { height: 320px; background: #0c1118; }

.results {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px;
}
.col.wide { grid-column: 1 / -1; }
.col h2 {
  margin: 0 0 10px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px;
}
.count {
  background: var(--panel2); color: var(--muted); font-size: .78rem;
  padding: 2px 8px; border-radius: 999px; font-weight: 600;
}

.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.place-card {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.place-card:hover {
  border-color: rgba(61, 187, 255, 0.45);
}
.place-card.is-selected {
  outline: 2px solid rgba(61, 187, 255, 0.55);
  border-color: rgba(61, 187, 255, 0.55);
}
.place-card:focus-visible {
  outline: 2px solid rgba(240, 165, 0, 0.75);
}
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.card .meta-line { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.card .body { font-size: .92rem; line-height: 1.45; white-space: pre-wrap; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: .72rem; background: #1e2c40; color: #b8c9dc;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
}
.kind {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #1a1200; background: var(--accent);
  padding: 2px 7px; border-radius: 6px; margin-right: 6px;
}
.sources { margin-top: 10px; font-size: .8rem; }
.sources summary { cursor: pointer; color: var(--muted); }
.sources ul { margin: 6px 0 0; padding-left: 18px; }
.sources a { word-break: break-all; }
.gps { color: var(--ok); font-family: ui-monospace, monospace; font-size: .82rem; }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.photo-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.photo-card img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #0c1118; cursor: zoom-in;
  display: block;
}
.photo-card .info { padding: 8px 10px 10px; font-size: .8rem; }
.photo-card .info .cap { color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.empty {
  color: var(--muted); font-size: .9rem; padding: 16px; border: 1px dashed var(--border);
  border-radius: var(--radius); text-align: center;
}

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: min(96vw, 1100px); max-height: 80vh; object-fit: contain; border-radius: 8px; }
.lb-cap { color: #ddd; margin-top: 12px; max-width: 80ch; text-align: center; font-size: .9rem; }
.lb-close {
  position: absolute; top: 16px; right: 20px; font-size: 2rem; background: transparent;
  border: none; color: #fff; cursor: pointer; line-height: 1;
}

@media (max-width: 860px) {
  .results { grid-template-columns: 1fr; }
  #map { height: 240px; }
}

.site-foot {
  max-width: 1280px; margin: 0 auto; padding: 8px 20px 40px;
  color: var(--muted); font-size: .82rem; border-top: 1px solid var(--border);
}

/* === site nav (hamburger) + crawl sources === */
.top {
  align-items: center;
  position: relative;
  gap: 12px 16px;
}
.site-nav {
  margin-left: auto;
  position: relative;
  flex: 0 0 auto;
}
.nav-toggle {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-toggle:hover {
  border-color: var(--accent2);
  background: var(--panel2);
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  position: relative;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.site-nav.is-open .nav-toggle-bars {
  background: transparent;
}
.site-nav.is-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}
.site-nav.is-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}
.site-nav.is-open .site-nav-panel {
  display: block;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .95rem;
}
.site-nav a:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--panel2);
}
.site-nav a[aria-current="page"] {
  color: #1a1200;
  background: var(--accent);
  border-color: var(--accent);
}
.site-nav a[aria-current="page"]:hover {
  color: #1a1200;
  filter: brightness(1.05);
}

.card-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.sources-wrap { padding-top: 18px; }
.sources-intro p { margin: 0 0 10px; line-height: 1.45; }
.sources-intro .muted,
.muted { color: var(--muted); }
.note-persist { font-size: .88rem; }
.note-persist code {
  font-size: .82em;
  background: #0c1118;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.sources-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-top: 12px;
}
.filter-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .8rem;
  color: var(--muted);
}
.filter-label input,
.filter-label select {
  font-size: .95rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0c1118;
  color: var(--text);
  min-width: 220px;
}

.sources-table-wrap {
  overflow-x: auto;
  padding: 0;
}
.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.sources-table th,
.sources-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.sources-table th {
  position: sticky;
  top: 0;
  background: var(--panel2);
  color: var(--text);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  z-index: 1;
}
.sources-table tbody tr:hover {
  background: rgba(61, 187, 255, 0.06);
}
.sources-table .col-crawled {
  width: 72px;
  text-align: center;
  vertical-align: middle;
}
.sources-table th.col-crawled { text-align: center; }
.sources-table .col-name {
  font-weight: 650;
  min-width: 160px;
  max-width: 240px;
}
.sources-table .col-summary {
  min-width: 220px;
  color: var(--text);
  line-height: 1.4;
}
.sources-table .col-url {
  min-width: 180px;
  max-width: 320px;
  word-break: break-all;
  font-size: .82rem;
}
.crawl-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.crawl-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--ok);
  cursor: pointer;
}

@media (max-width: 860px) {
  .top { align-items: flex-start; }
  .site-nav { justify-content: flex-start; width: 100%; }
  .filter-label input,
  .filter-label select { min-width: 0; width: 100%; }
  .sources-toolbar { flex-direction: column; align-items: stretch; }
  .sources-table .col-url { max-width: 200px; }
}

/* === Videos page — YouTube-style results + sticky player === */
.page-videos .videos-wrap {
  max-width: 1400px;
  padding-top: 18px;
}
.videos-search { margin-bottom: 18px; }
.videos-search #videoQ {
  flex: 1; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: #0c1118; color: var(--text);
  outline: none;
}
.videos-search #videoQ:focus {
  border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(61,187,255,.2);
}
.videos-search #btnVideoSearch {
  padding: 0 18px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #1a1200; font-weight: 700;
}
.videos-search #btnVideoSearch:hover { filter: brightness(1.08); }

.videos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(280px, 32%);
  gap: 16px;
  align-items: start;
}
.videos-tag-cloud {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px 14px 16px;
  align-self: start;
}
.videos-tag-cloud-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 650;
}
.video-tag-cloud-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.video-cloud-tag.is-active,
.video-activity-chip.is-active {
  outline: 2px solid var(--accent2);
  outline-offset: 1px;
}
.video-thumb iframe {
  pointer-events: none; /* default; JS sets auto when pinned */
}
.video-thumb.is-pinned iframe {
  pointer-events: auto;
}
.videos-list-panel {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
}
.videos-list-head {
  padding: 4px 4px 12px;
  border-bottom: none;
  flex: 0 0 auto;
}
.videos-list-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.videos-list {
  overflow: visible;
  flex: 1 1 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* YouTube-style result row */
.video-row {
  display: flex;
  gap: 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px;
  color: var(--text);
  font: inherit;
  align-items: stretch;
  transition: background .15s ease, border-color .15s ease;
}
.video-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
}
.video-row:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.video-row.is-selected {
  background: rgba(61, 187, 255, 0.08);
  border-color: rgba(61, 187, 255, 0.35);
}

.video-thumb {
  flex: 0 0 auto;
  align-self: flex-start;
  width: min(320px, 38%);
  max-width: 320px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0c1118;
  position: relative;
}
.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-thumb.is-playing {
  box-shadow: 0 0 0 2px rgba(61, 187, 255, 0.45);
}
.video-thumb.is-pinned {
  width: min(720px, 100%);
  max-width: 100%;
  box-shadow: 0 0 0 2px rgba(255, 196, 61, 0.7);
}


.video-meta {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.video-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  /* ~2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .88rem;
}
.video-channel-avatar {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.video-channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-snippet {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-activity-chips {
  margin-top: 12px;
  margin-bottom: 4px;
}
.video-activity-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 165, 0, 0.12);
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.video-tag {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font: inherit;
  font-size: .72rem;
  line-height: 1.2;
  color: #b8c9dc;
  background: #1e2c40;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.video-tag:hover,
a.video-tag:hover {
  border-color: var(--accent2);
  color: #d7e8f8;
}
.video-tag-gps {
  color: #1a1200;
  background: rgba(240, 165, 0, 0.88);
  border-color: rgba(240, 165, 0, 0.95);
  font-weight: 650;
}
a.video-tag-gps:hover {
  color: #1a1200;
  filter: brightness(1.08);
  border-color: var(--accent);
}

/* Sticky player column */
.videos-player-panel {
  display: none; /* playback lives in left thumbs */
}
.player-sticky {
  position: static;
}
.player-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0c1118;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.player-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.player-meta { margin-top: 12px; }
.player-meta h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  line-height: 1.3;
}
.player-channel,
.player-purpose {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .9rem;
}
.player-purpose { color: var(--accent); font-weight: 600; }
.player-notes {
  margin: 8px 0;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 28vh;
  overflow-y: auto;
}
.player-link { margin: 8px 0 0; font-size: .85rem; }

@media (max-width: 1100px) {
  .videos-player-panel {
    flex-basis: 360px;
    width: 360px;
  }
  .video-thumb {
    width: min(280px, 40%);
  }
}

@media (max-width: 900px) {
  .videos-layout {
    flex-direction: column;
  }
  .videos-list-panel {
    order: 1;
    width: 100%;
  }
  .videos-player-panel {
    order: 2;
    position: static;
    width: 100%;
    flex-basis: auto;
  }
  .video-row {
    gap: 12px;
  }
  .video-thumb {
    width: 168px;
    max-width: 42%;
    border-radius: 10px;
  }
  .video-title {
    font-size: 1rem;
  }
  .video-snippet {
    -webkit-line-clamp: 2;
  }
}


/* === narrative story card (Facts column) === */
.narrative-card {
  padding: 16px 18px 18px;
}
.narrative-card h3 {
  font-size: 1.12rem;
  letter-spacing: .01em;
  margin-bottom: 4px;
}
.narrative-body {
  margin-top: 10px;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--text);
}
.narrative-body p {
  margin: 0 0 0.95em;
}
.narrative-body p:last-child {
  margin-bottom: 0;
}
.narrative-sources {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* .video-unmute removed — was covering captions */

.gps-panel {
  margin-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.65rem;
}
.gps-panel > summary {
  cursor: pointer;
  font-weight: 600;
  color: #d7e0ea;
}
.gps-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.gps-item {
  background: rgba(12, 17, 24, 0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.gps-name {
  font-weight: 650;
  color: #f3f6fa;
}
.gps-locality {
  display: block;
  font-size: 0.82rem;
  color: #9aabbc;
  margin-top: 0.1rem;
}
.gps-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.35rem;
}
.gps-coord {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #7ec8ff;
}
.gps-fly {
  border: 0;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  background: rgba(61, 187, 255, 0.18);
  color: #d7efff;
  font: 600 0.78rem/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.gps-fly:hover {
  background: rgba(61, 187, 255, 0.28);
}
.leaflet-popup-content .popup-meta {
  color: #445;
  font-size: 0.9em;
}
.empty-inline {
  opacity: 0.8;
  font-style: italic;
}

.loc-wrap { max-width: 1440px; }
.loc-wrap .search-row { flex-wrap: wrap; }
.loc-wrap .loc-partof-col {
  width: 100%;
  min-width: 0;
  margin-top: 1rem;
}
.loc-wrap .loc-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.loc-list-col,
.loc-edit-col {
  width: 100%;
  min-width: 0;
}
.loc-list-col h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.loc-browse-all {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
}
.loc-wrap.is-loc-focus .loc-list-col .cards,
.loc-wrap.is-loc-focus .loc-list-col .loc-card {
  max-width: none;
  width: 100%;
}
@media (max-width: 960px) {
  .loc-wrap .loc-grid { flex-direction: column; }
}
.loc-form {
  display: grid;
  gap: 0.55rem;
  background: rgba(12,17,24,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1rem;
}
.loc-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #b7c4d2;
}
.loc-form input, .loc-form select, .loc-form textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0c1118;
  color: #e8eef5;
  padding: 0.45rem 0.55rem;
  font: inherit;
}
.loc-flags { display: flex; gap: 1rem; }
.loc-flags .chk { display: flex; align-items: center; gap: 0.35rem; }
.loc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }
.loc-actions .primary {
  background: #3dbbff;
  color: #0c1118;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.loc-actions .danger {
  background: rgba(255,80,80,0.2);
  color: #ffb4b4;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
.form-hint { font-size: 0.8rem; color: #8a9aab; margin: 0.35rem 0 0; }
.loc-edit-col {
  position: static;
  align-self: stretch;
}
.loc-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}
.loc-panel-head {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}
.loc-panel-head::-webkit-details-marker { display: none; }
.loc-panel-head::after {
  content: "▸";
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform .15s ease;
}
.loc-panel[open] > .loc-panel-head::after {
  transform: rotate(90deg);
}
.loc-panel[open] > .loc-panel-head {
  border-bottom: 1px solid var(--border);
}
.loc-add-panel .loc-form {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.loc-add-panel[open] .loc-form {
  max-height: min(52vh, 34rem);
  overflow: auto;
}

.partof-mount { margin: 0; }
.partof-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.partof-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.partof-head::after {
  content: "▸";
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform .15s ease;
}
.partof-widget:not(.is-collapsed) > .partof-head::after {
  transform: rotate(90deg);
}
.partof-widget:not(.is-collapsed) > .partof-head {
  border-bottom: 1px solid var(--border);
}
.partof-head-meta {
  margin-left: auto;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.partof-body { padding: 8px 10px 12px; }
.partof-empty, .partof-none {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.partof-map {
  position: relative;
  min-height: 28rem;
  max-height: min(72vh, 46rem);
  overflow-x: auto;
  overflow-y: hidden;
}
.partof-links {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.partof-link {
  fill: none;
  stroke: #8aa0b8;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.partof-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0 6px;
  align-items: stretch;
  min-height: 26rem;
  height: min(68vh, 44rem);
  min-width: 52rem;
  padding: 6px 4px 8px;
}
.partof-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.partof-side-left { padding-right: 8px; }
.partof-side-right { padding-left: 8px; }
.partof-side-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 18px;
  flex: 1;
  min-height: 0;
}
.partof-col {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.partof-col-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: none;
}
.partof-col-scroll::-webkit-scrollbar { display: none; }
.partof-col-scroll.is-dragging { cursor: grabbing; user-select: none; }
.partof-col-scroll.is-overflowing { justify-content: flex-start; }
.partof-side-left .partof-col-scroll { align-items: flex-end; }
.partof-side-right .partof-col-scroll { align-items: flex-start; }
.partof-col-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .15s ease;
}
.partof-col-fade-top {
  top: 0;
  background: linear-gradient(to bottom, var(--panel), transparent);
}
.partof-col-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--panel), transparent);
}
.partof-col.has-more-up .partof-col-fade-top { opacity: 1; }
.partof-col.has-more-down .partof-col-fade-bottom { opacity: 1; }
.partof-col-label {
  font-size: 0.68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 2px;
  text-align: center;
  flex: 0 0 auto;
}
.partof-node, .partof-none-pill, .partof-current {
  display: block;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}
.partof-node {
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 3px 9px;
}
.partof-node:hover {
  border-color: var(--accent2);
  color: inherit;
}
.partof-node.is-missing { opacity: 0.75; border-style: dashed; }
.partof-none-pill {
  background: transparent;
  border: 1px dashed var(--border);
  padding: 3px 9px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}
.partof-node-name, .partof-current-name {
  display: block;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.partof-node-type, .partof-current-type {
  display: block;
  margin-top: 1px;
  font-size: 0.6rem;
  color: var(--muted);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.partof-node-more { color: var(--accent2); font-weight: 700; }
.partof-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  z-index: 2;
  padding: 0 8px;
}
.partof-current {
  background: rgba(61,187,255,0.14);
  border: 1px solid rgba(61,187,255,0.5);
  padding: 7px 14px;
  text-align: center;
  min-width: 8.5rem;
  max-width: 14rem;
}
.partof-current-name { font-size: 0.86rem; }
@media (max-width: 960px) {
  .loc-edit-col { position: static; }
}

.loc-card.is-selected {
  outline: 2px solid rgba(61,187,255,0.7);
  border-color: rgba(61,187,255,0.55);
  box-shadow: 0 0 0 1px rgba(61,187,255,0.25), var(--shadow);
}

.loc-card h3 { margin: 0 0 6px; }
.loc-explore-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(61,187,255,0.35);
}
.loc-explore-link:hover {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
}

.tag-ok { background: rgba(61,214,140,0.2); }
.tag-warn { background: rgba(255,196,61,0.2); }
.tag-recrawl { background: rgba(61,187,255,0.22); }
.search-panel select {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0c1118;
  color: #e8eef5;
  padding: 0.45rem 0.55rem;
}


/* === History / graph growth === */
.history-wrap { padding-top: 18px; }
.history-summary-line {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.history-summary-note { margin: 8px 0 0; font-size: .9rem; }
.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 10px;
  font-size: .88rem;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-item i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.legend-places { color: var(--accent); }
.legend-facts { color: var(--accent2); }
.legend-photos { color: var(--ok); }
.history-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 260px;
}
#growthChart {
  display: block;
  width: 100%;
  height: auto;
  background: #0c1118;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.chart-grid line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.chart-axis {
  fill: #d7e3f2 !important;
  color: #d7e3f2;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.chart-grid-line {
  stroke: rgba(215, 227, 242, 0.22);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.history-chart-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
}
.legend-sources { color: #c084fc; }
.legend-videos { color: #fb7185; }
.legend-localities { color: #38bdf8; }
.history-chart-panel + .history-chart-panel {
  margin-top: 16px;
}
.history-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: #152033;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .82rem;
  line-height: 1.35;
  box-shadow: var(--shadow);
  max-width: min(280px, 90vw);
  color: var(--text);
}
.history-tooltip.hidden { display: none; }
.history-tooltip .tip-places { color: var(--accent); font-weight: 600; }
.history-tooltip .tip-facts { color: var(--accent2); font-weight: 600; }
.history-tooltip .tip-photos { color: var(--ok); font-weight: 600; }
.history-tooltip code {
  font-size: .78em;
  background: #0c1118;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.history-table-panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.history-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.history-table th,
.history-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.history-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.history-table td.num {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.history-table code {
  font-size: .82em;
  background: #0c1118;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .history-summary-line { font-size: 1.1rem; }
  .history-legend { gap: 8px 12px; font-size: .82rem; }
}

.site-foot .foot-note { color: var(--muted); }
.site-foot .foot-sep { margin: 0 0.15em; color: var(--muted); }


/* browse-by-map */
.page-browse-map .top { margin-bottom: 0; }
.browse-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.browse-map-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #0c1118;
}
.browse-map-canvas {
  width: 100%;
  height: min(72vh, 820px);
  min-height: 420px;
  background: #0c1118;
}
.browse-map-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 500;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(12, 17, 24, 0.82);
  color: var(--muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.browse-map-detail {
  margin: 0;
}
.browse-map-detail-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.browse-map-detail-empty { color: var(--muted); margin: 0; }
.browse-map-detail-body .browse-map-detail-head h3 { margin: 6px 0 4px; }

/* Shared 50/50 pin-meta | campfire split (Map Browser; reusable by Explorer) */
.pin-detail-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.pin-detail-split > * {
  min-width: 0;
}
.pin-detail-split .narrative-body {
  max-width: none;
}

.browse-map-narrative {
  margin-top: 0;
  background: var(--panel2);
}
.browse-map-narrative h4,
.browse-map-facts h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.browse-map-facts { margin-top: 12px; }
.browse-map-facts ul { margin: 0; padding-left: 18px; }
.browse-map-facts li { margin-bottom: 4px; font-size: 0.9rem; }
.narrative-body { white-space: pre-wrap; line-height: 1.5; }
.browse-map-links { margin-top: 10px; }
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(240, 193, 75, 0.35);
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(240, 193, 75, 0.85);
  color: #1a1200;
  font-weight: 700;
}
@media (max-width: 860px) {
  .pin-detail-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .browse-map-canvas { min-height: 320px; height: 58vh; }
  .browse-map-wrap { padding: 0 8px 20px; }
}


/* crawl sources — read-only crawled + recrawl */
.sources-table .col-crawled { width: 4.5rem; text-align: center; }
.sources-table .col-recrawl { width: 6.5rem; text-align: center; vertical-align: middle; }
.sources-table input.fully-crawled:disabled {
  opacity: 0.85;
  cursor: default;
}
.btn-recrawl {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-recrawl:not(:disabled) {
  cursor: pointer;
  color: #1a1200;
  background: var(--accent);
  border-color: transparent;
}
.btn-recrawl:not(:disabled):hover { filter: brightness(1.05); }

.loc-region-fs {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0.5rem 0 1rem;
}
.loc-region-fs legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

.browse-map-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
.browse-map-photo {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,.25);
}
.browse-map-photo img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}
.browse-map-photo figcaption {
  font-size: 0.75rem;
  padding: 4px 6px;
  color: var(--muted);
}
a.gps-link {
  color: var(--accent, #6eb5ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === Photo Browser — videos-style layout + gallery + viewer === */
.page-photos .photos-wrap {
  max-width: 1400px;
  padding-top: 18px;
}
.photos-search { margin-bottom: 18px; }
.photos-search #photoQ {
  flex: 1; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: #0c1118; color: var(--text);
  outline: none;
}
.photos-search #photoQ:focus {
  border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(61,187,255,.2);
}
.photos-search #btnPhotoSearch {
  padding: 0 18px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #1a1200; font-weight: 700;
}
.photos-search #btnPhotoSearch:hover { filter: brightness(1.08); }

.photos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(280px, 32%);
  gap: 16px;
  align-items: start;
}
.photos-tag-cloud {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px 14px 16px;
  align-self: start;
}
.photos-tag-cloud-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 650;
}
.photo-tag-cloud-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.photo-featured-chips { margin-top: 4px; margin-bottom: 4px; }
.photo-featured-chip.is-active,
.photo-cloud-tag.is-active {
  outline: 2px solid var(--accent2);
  outline-offset: 1px;
}
.photo-featured-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 165, 0, 0.12);
}

.photos-list-panel {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
}
.photos-list-head {
  padding: 4px 4px 12px;
}
.photos-list-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
  justify-content: start;
  gap: 14px;
}
.photos-sentinel { height: 1px; }
.photos-more { margin: 12px 4px 0; }

.pb-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 220px;
  width: 100%;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.pb-card:hover { border-color: rgba(61, 187, 255, 0.45); }
.pb-card:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.pb-card-media {
  position: relative;
  width: 100%;
  height: 165px;
  max-height: 165px;
  overflow: hidden;
  background: #0c1118;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  /* Native right-click Save Image stays enabled — do not disable context menu */
}
.pb-card-info { padding: 10px 12px 12px; font-size: .82rem; }
.pb-card-cap {
  color: var(--text);
  font-weight: 650;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pb-card-place { color: var(--muted); margin-bottom: 4px; }
.pb-card-source {
  margin: 2px 0 4px;
  max-width: 100%;
  overflow: hidden;
}
.pb-card-source-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
  line-height: 1.3;
  color: var(--accent2);
  text-decoration: none;
}
.pb-card-source-link:hover { text-decoration: underline; color: #8fd4ff; }
.pb-card-gps { margin: 4px 0 6px; font-family: ui-monospace, monospace; font-size: .78rem; }

.photo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.photo-tag {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font: inherit;
  font-size: .72rem;
  line-height: 1.2;
  color: #b8c9dc;
  background: #1e2c40;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.photo-tag:hover {
  border-color: var(--accent2);
  color: #d7e8f8;
}

body.photo-viewer-open { overflow: hidden; }
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(380px, 38%);
  width: 100vw;
  height: 100vh;
  background: rgba(6, 10, 16, 0.94);
}
.photo-viewer.hidden { display: none; }
.photo-viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 16px;
  background: #05080c;
}
.photo-viewer-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 56px;
  height: 80px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(6, 10, 16, 0.62);
  color: #f4f8fc;
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.pv-nav span { display: block; margin-top: -4px; }
.pv-nav:hover:not(:disabled) {
  background: rgba(6, 10, 16, 0.86);
  border-color: rgba(141, 212, 255, 0.7);
  color: #fff;
}
.pv-nav:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}
.pv-nav:disabled {
  opacity: 0.28;
  cursor: default;
  box-shadow: none;
}
.pv-prev { left: 14px; }
.pv-next { right: 14px; }
.photo-viewer-panel {
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 18px 18px 28px;
}
.pv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pv-btn {
  appearance: none;
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.pv-btn:hover { border-color: var(--accent2); color: #d7e8f8; }
.pv-download {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent);
}
.pv-download:hover { color: #1a1200; filter: brightness(1.08); }
.pv-caption {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.35;
}
.pv-body p { margin: 0 0 8px; font-size: .9rem; line-height: 1.45; }
.pv-notes, .pv-alt { color: var(--muted); white-space: pre-wrap; }
.pv-credits { margin-top: 16px; }
.pv-credits h3 {
  margin: 0 0 8px;
  font-size: .92rem;
}
.pv-credits ul { margin: 0; padding-left: 18px; }
.pv-credits li { margin: 0 0 8px; }
.pv-retrieved { color: var(--muted); font-size: .78rem; }

@media (max-width: 900px) {
  .photos-layout { grid-template-columns: 1fr; }
  .photos-tag-cloud {
    position: static;
    max-height: none;
    order: -1;
  }
  .photo-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(40vh, 55vh) 1fr;
    height: 100vh;
  }
  .photo-viewer-panel { border-left: none; border-top: 1px solid var(--border); }
  .photo-viewer-stage { height: 55vh; }
  .photo-viewer-stage img { max-height: 100%; }
  .pv-nav { width: 44px; height: 64px; font-size: 2.4rem; }
  .pv-prev { left: 8px; }
  .pv-next { right: 8px; }
}
