:root {
  color-scheme: dark;
  --night: #070f1b;
  --panel: #0e2231;
  --ink: #f0f6f8;
  --muted: #b7cad3;
  --line: #47616f;
  --light: #8cebc0;
  --amber: #ffca77;
  font: 16px/1.5 "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--night);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, a { color: inherit; }
button { font: inherit; cursor: pointer; }
a { text-underline-offset: .24em; }
:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }

.atlas, .map, .globe { position: absolute; inset: 0; }
.atlas { overflow: hidden; }
.map {
  background: radial-gradient(ellipse at 50% 44%, #172d41, var(--night) 70%);
}
.map::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .7;
  background:
    radial-gradient(1px 1px at 12px 21px, #a4bac8 70%, transparent) 0 0 / 137px 101px,
    radial-gradient(1px 1px at 29px 73px, #637b96 70%, transparent) 42px 3px / 211px 173px,
    radial-gradient(1px 1px at 19px 38px, #8192ac 70%, transparent) 7px 29px / 331px 149px;
}
.globe { cursor: grab; touch-action: none; user-select: none; }
.globe.dragging { cursor: grabbing; }
.globe:focus-visible { outline-offset: -3px; }
.globe > svg, .globe > canvas, #markers { position: absolute; inset: 0; width: 100%; height: 100%; }
#detail-map { position: absolute; inset: 0; background: #0b121a; }
#detail-map:not([data-ready]) { visibility: hidden; }
#detail-map .maplibregl-ctrl-bottom-left { bottom: 47px; }
#detail-map .maplibregl-ctrl-attrib { background: #091827e8; color: var(--muted); }
#detail-map .maplibregl-ctrl-attrib a { color: var(--ink); }
#detail-map .maplibregl-ctrl-scale { color: var(--ink); border-color: var(--muted); background: #091827c9; }
#markers { pointer-events: none; z-index: 2; }
.orbit, .limb { fill: none; stroke: #a3c8c9; stroke-opacity: .45; }
.orbit { stroke-dasharray: 1 6; }
#land { fill: #a7c4b5; stroke: #d4e3cb; stroke-width: .45; }
.globe[data-theme="natural"] #land { fill: #96aa7b; stroke: #c6d3ae; }
.globe[data-theme="natural"] #sea stop:first-child { stop-color: #538fbb; }
.globe[data-theme="natural"] #sea stop:last-child { stop-color: #22547f; }
#graticule { fill: none; stroke: #dfefea; stroke-opacity: .2; stroke-width: .65; }
.marker, .street-pin { position: absolute; transform: translate(-50%, -50%); }
.marker { pointer-events: auto; width: 34px; height: 34px; padding: 0; border: 0; background: none; color: var(--amber); }
.marker::before { content: ""; display: block; width: 10px; height: 10px; margin: auto; border: 2px solid #0b2639; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 1px currentColor; }
.marker[data-kind="photo"], .kind[data-kind="photo"] { color: var(--light); }
.marker[data-kind="snapshot"], .kind[data-kind="snapshot"] { color: #c0eaff; }
.marker[data-kind="link"], .kind[data-kind="link"] { color: #f7b5a8; }
.marker[data-kind="road"], .kind[data-kind="road"] { color: #a6c6ff; }
.marker[aria-pressed="true"]::before { box-shadow: 0 0 0 2px currentColor, 0 0 0 6px #ffffff42; }
.marker:hover, .marker:focus-visible, .marker[aria-pressed="true"] { z-index: 2; }
.marker .pin-label { display: none; position: absolute; left: 50%; bottom: 95%; transform: translateX(-50%); padding: 4px 8px; border-radius: 4px; background: #091827; color: white; white-space: nowrap; font-size: .75rem; pointer-events: none; }
.marker:hover .pin-label, .marker:focus-visible .pin-label, .marker[aria-pressed="true"] .pin-label { display: block; }
.marker .pin-count { display: none; }
.marker.cluster::before { display: none; }
.marker.cluster .pin-count { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #a1c9e5; border-radius: 50%; background: #142c43; color: white; font-size: .73rem; font-variant-numeric: tabular-nums; }
.street-pin { z-index: 3; width: 15px; height: 15px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 3px #123a50; }

.masthead { position: absolute; z-index: 5; top: 0; left: 0; right: 0; min-height: 65px; display: grid; grid-template-columns: auto minmax(140px, 360px) auto 1fr; align-items: center; gap: 10px; padding: 9px 20px; background: linear-gradient(#07101ef5, #07101e15); pointer-events: none; }
.masthead > * { pointer-events: auto; }
.brand { display: flex; justify-self: start; align-items: center; gap: 9px; text-decoration: none; }
.brand h1 { font-size: 1.15rem; letter-spacing: .04em; }
.brand small { margin-left: 5px; color: var(--muted); font: 14px Georgia, serif; }
.layers { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 24px; padding: 3px; background: #091827; }
.layers button, #catalog-toggle, .globe-controls button { min-height: 44px; padding: 0 13px; border: 0; border-radius: 22px; background: transparent; color: var(--ink); font-size: .84rem; }
.layers button[aria-pressed="true"] { background: #b6deed; color: #0b2132; font-weight: 700; }
.layers button:hover:not([aria-pressed="true"]), .globe-controls button:hover { background: #28445b; }
#catalog-toggle { justify-self: end; border: 1px solid var(--line); background: #091827; }
#total-count { margin-left: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-footer { position: absolute; inset: auto 14px 14px; display: flex; align-items: end; justify-content: space-between; gap: 10px; pointer-events: none; }
.map-caption { color: var(--muted); font-size: .76rem; text-shadow: 0 1px 3px #000; }
.map-caption p { color: var(--ink); font-size: .83rem; margin-bottom: 2px; }
.map-caption span { margin-right: 8px; }
.map-credit { pointer-events: auto; }
.site-registration { pointer-events: auto; display: inline-block; margin-right: 8px; font-size: .72rem; }
.globe-controls { display: grid; grid-template-columns: repeat(7, 44px); padding: 3px; border-radius: 25px; border: 1px solid var(--line); background: #091827; pointer-events: auto; }
.globe-controls button { padding: 0; font-size: 1.12rem; }
.map-message { position: absolute; bottom: 75px; left: 16px; color: var(--amber); font-size: .8rem; pointer-events: none; }
.map-footer, .map-message { z-index: 3; }
.map-layers { position: absolute; z-index: 3; top: 74px; left: 14px; width: max-content; max-width: calc(100% - 28px); background: #091827; border: 1px solid var(--line); border-radius: 7px; }
.map-layers summary { padding: 7px 12px; cursor: pointer; font-size: .84rem; }
.layer-menu { display: grid; gap: 4px; padding: 0 10px 9px; font-size: .82rem; }
.layer-mode { display: flex; gap: 4px; margin-bottom: 5px; }
.layer-mode button { min-height: 36px; background: #142b3b; border: 1px solid var(--line); border-radius: 4px; }
.layer-mode button[aria-pressed="true"] { border-color: var(--light); color: var(--light); }

.viewer, .destinations { position: absolute; z-index: 4; top: 74px; bottom: auto; max-height: calc(100% - 148px); width: min(382px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: auto; box-shadow: 0 14px 45px #0007; }
.viewer { right: 14px; }
.destinations { left: 14px; padding: 10px 13px 14px; }
.viewer-top, .destinations-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.viewer-top { padding: 1px 9px 1px 14px; color: var(--muted); font-size: .8rem; }
.viewer-top button, .destinations-heading button { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; border-radius: 6px; font-size: 1.35rem; }
.viewer-top button:hover, .destinations-heading button:hover { background: #28445b; }
.media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; isolation: isolate; background: #081622; }
.media iframe, .media img { position: absolute; inset: 0; border: 0; width: 100%; height: 100%; }
.street-panorama { position: absolute; inset: 0; }
.media img { object-fit: contain; }
.media-placeholder { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 9px; color: var(--muted); font-size: .85rem; }
.load-button { min-height: 44px; padding: 0 13px; border: 0; border-radius: 4px; color: #1a3740; background: var(--amber); font-weight: 700; }
.viewer-info { padding: 12px 14px 0; }
.location { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; }
.kind { padding: 2px 6px; border: 1px solid currentColor; border-radius: 3px; color: var(--amber); font-size: .72rem; }
.kind[data-kind="street"] { color: #d0e7fc; }
.viewer h2 { margin-top: 6px; font-size: 1.3rem; line-height: 1.3; }
#camera-description { margin-top: 6px; color: var(--muted); font-size: .83rem; }
#camera-coordinates { color: var(--muted); margin-top: 4px; font-size: .75rem; }
.viewer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.viewer-actions a, .viewer-actions button { display: inline-flex; align-items: center; min-height: 44px; font-size: .8rem; }
.viewer-actions button, #clear-cluster { border: 0; padding: 0; background: none; text-decoration: underline; text-underline-offset: .24em; }
#camera-status, #nearby-results { margin: 0 14px 12px; color: var(--muted); font-size: .76rem; }
.street-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 14px 12px; color: var(--muted); font-size: .78rem; }
.street-controls button, #address-search, #street-google button { min-height: 40px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: #122b3c; }
.street-controls button:disabled { opacity: .45; cursor: default; }
#street-google { margin: 0 14px 12px; color: var(--muted); font-size: .76rem; }
#street-google summary { cursor: pointer; padding: 3px 0; }
#street-google form { display: grid; gap: 4px; padding-top: 7px; }
#street-google form div { display: flex; gap: 4px; }
#street-google input { flex: 1; min-width: 0; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; background: #091827; font: inherit; }
#nearby-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
#nearby-list button { display: grid; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--night); font-size: .72rem; }
#nearby-list img { width: 100%; aspect-ratio: 1.5; object-fit: cover; }
.destinations-heading h2 { font-size: 1.15rem; }
.catalog-coverage { margin: 2px 0 10px; color: var(--light); font-size: .85rem; font-variant-numeric: tabular-nums; }
.country-filter { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; }
.country-filter select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #091827; color: var(--ink); font: inherit; cursor: pointer; }
.country-filter optgroup { font-weight: 700; }
.catalog-coverage-note { margin-top: 7px; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.catalog-search { display: grid; gap: 3px; color: var(--muted); font-size: .78rem; }
.catalog-search input { width: 100%; min-height: 44px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #091827; font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#places-title { margin: 2px 0 6px; font-size: .9rem; }
#places-list { display: grid; gap: 3px; }
#address-search { display: inline-block; margin: 6px 0; font-size: .78rem; }
#address-status { color: var(--muted); font-size: .75rem; }
#address-results { display: grid; gap: 3px; margin: 4px 0 9px; }
.roads-toggle { min-height: 44px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.catalog-meta, #catalog-empty { margin-bottom: 7px; color: var(--muted); font-size: .8rem; }
.camera-list { display: grid; gap: 3px; }
.destination, #catalog-more { min-height: 47px; text-align: left; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: #122b3c; }
.destination:hover, #catalog-more:hover { background: #24455b; }
.destination[aria-pressed="true"] { border-color: var(--light); }
.destination strong { display: block; font-size: .87rem; }
.destination small { display: block; color: var(--muted); font-size: .73rem; }
#catalog-more { width: 100%; margin-top: 6px; text-align: center; }
@media (max-width: 700px) {
  .masthead { grid-template-columns: auto 1fr auto; padding: 7px 8px; gap: 4px; }
  .top-search { grid-row: 2; grid-column: 1 / -1; }
  .map-layers, .destinations { top: 108px; }
  #detail-map .maplibregl-ctrl-bottom-left { bottom: 111px; }
  .brand h1 { font-size: .95rem; }
  .brand small { display: none; }
  .brand svg { width: 23px; }
  .layers { justify-self: center; }
  #total-count { display: none; }
  .layers button, #catalog-toggle { padding-inline: 9px; }
  .map-footer { flex-direction: column-reverse; align-items: center; text-align: center; inset: auto 8px 8px; }
  .globe-controls { grid-template-columns: repeat(7, min(44px, 12vw)); }
  .map-caption .coordinates { display: none; }
  .viewer, .destinations { right: 8px; left: 8px; width: auto; }
  .viewer { top: auto; bottom: 74px; max-height: 56%; }
  .destinations { max-height: calc(100% - 152px); }
}
