:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #343c42; background: #fff; font-synthesis: none; --line: #e2e5e7;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, [role=button]:focus-visible { outline: 2px solid #527a98; outline-offset: 3px; }
.site-header { height: 54px; display: flex; align-items: center; gap: 13px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); font-size: 14px; }
.site-header > a:first-child { font-weight: 600; }
.divider { color: #a2a8ac; }
.site-header nav { display: flex; gap: 24px; margin-left: auto; font-size: 13px; color: #737b81; }
.site-header a:hover { color: #1f252a; }
main { height: calc(100dvh - 54px); min-height: 380px; position: relative; overflow: hidden; }
#map { position: absolute; inset: 0; z-index: 0; background: #fff; }
.leaflet-container { font-family: inherit; background: #fff; }
.leaflet-detail-pane { filter: grayscale(1); }
.leaflet-control-zoom { border: 1px solid var(--line) !important; box-shadow: none !important; }
.leaflet-control-zoom a { color: #647078 !important; font-weight: 400 !important; }
.leaflet-control-attribution { font-size: 9px !important; background: #ffffffdb !important; color: #92999e; }
.leaflet-control-attribution a { color: #7d878e; }
.leaflet-tooltip { font-family: inherit; font-size: 11px; border: 1px solid var(--line); box-shadow: none; border-radius: 3px; }
.country-shape { transition: stroke .15s; }
.visited-country, .tiny-country, .activity-route, .transport-route, .state-shape, .city-marker, .flight-route, .airport-marker { cursor: pointer; }
body[data-view=country] .country-shape { pointer-events: none; }
.map-toolbar { position: absolute; z-index: 500; top: 18px; left: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100% - 76px); }
.map-toolbar button, h1 { margin: 0; min-height: 36px; padding: 8px 11px; background: #fffffff2; border: 1px solid var(--line); border-radius: 4px; box-shadow: none; font-size: 12px; font-weight: 500; }
h1 { font-weight: 600; }
.map-toolbar button:hover { background: #f5f6f6; }
#back-world { display: flex; align-items: center; gap: 6px; }
.map-toolbar svg { width: 16px; height: 16px; flex-shrink: 0; }
.map-toolbar svg path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.map-toolbar svg circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
#toggle-flights[aria-pressed=true] { color: #71818d; }
#map-status { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 600; background: #fffffff0; border: 1px solid var(--line); padding: 9px 13px; font-size: 12px; border-radius: 4px; margin: 0; max-width: 85%; text-align: center; }
#map-status:empty { display: none; }
.city-label { padding: 1px 4px; border: 0; border-radius: 2px; background: #ffffffd9; box-shadow: none; font-size: 11px; font-weight: 500; color: #45535d; white-space: nowrap; opacity: var(--city-opacity, 1) !important; cursor: default; }
.city-label:before { display: none; }
.leaflet-tooltip-pane { pointer-events: none; }
.city-label.leaflet-interactive { pointer-events: auto; }
.city-marker i, .tiny-country i { display: block; width: 100%; height: 100%; border: 1.5px solid white; border-radius: 50%; }
.tiny-country i { background: #364c60; }
.background-label { pointer-events: none; color: #a1a7ab; font-size: 10px; white-space: nowrap; visibility: hidden; }
.background-label span { display: block; width: max-content; transform: translate(-50%, -50%); }
.background-country-label { color: #929ba1; font-size: 11px; letter-spacing: .04em; }
.background-state-label { color: #a3aaaf; font-size: 10px; }
.leaflet-popup-content-wrapper { border-radius: 5px; box-shadow: 0 3px 15px #23323d14; }
.leaflet-popup-content { font-family: inherit; margin: 13px 15px; font-size: 12px; line-height: 1.6; }
.route-popup > strong { font-size: 13px; font-weight: 600; display: block; }
.route-popup time, .route-mode { font-size: 11px; color: #8b9399; display: block; margin-top: 3px; }
.route-popup p { margin: 7px 0; }
.route-stats { display: flex; gap: 16px; margin-top: 12px; }
.route-stats b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; }
.route-stats span { font-size: 9px; color: #8b9399; display: block; margin-top: 2px; }
.activity-route, .transport-route, .flight-route, .airport-marker { vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.flight-history { list-style: none; padding: 0; margin: 10px 0; max-height: 220px; overflow-y: auto; }
.flight-history li { padding: 7px 0; border-top: 1px solid var(--line); }
.flight-history b, .flight-history span { display: block; margin-top: 2px; }
.flight-history b { font-weight: 500; }
.flight-history span { font-size: 11px; color: #7d878e; }
.state-popup strong { font-size: 13px; font-weight: 600; }
.state-popup h2 { font-size: 11px; color: #7d878e; font-weight: 500; margin: 12px 0 4px; }
.state-popup p { margin: 4px 0; }
#route-legend { position: absolute; bottom: 24px; left: 23px; z-index: 450; display: flex; flex-wrap: wrap; gap: 13px; align-items: center; background: #fffffff0; border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; font-size: 10px; color: #7d878e; pointer-events: none; max-width: calc(100% - 30px); }
#route-legend span { display: flex; gap: 5px; align-items: center; }
#route-legend i { width: 6px; height: 6px; border-radius: 50%; }
@media (max-width: 700px) {
  .site-header { height: 48px; padding: 0 16px; font-size: 13px; }
  .site-header nav { font-size: 12px; gap: 17px; }
  main { height: calc(100dvh - 48px); }
  .map-toolbar { top: 12px; left: 12px; gap: 6px; max-width: calc(100% - 60px); }
  .map-toolbar button, h1 { min-height: 36px; padding: 8px 9px; font-size: 11px; }
  h1 { max-width: 160px; }
  .city-label { font-size: 10px; padding: 1px 3px; }
  .background-country-label { font-size: 10px; }
  #route-legend { left: 15px; gap: 10px; }
  .leaflet-control-attribution { font-size: 7px !important; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { transition: none !important; } }

#route-legend{flex-wrap:wrap;max-width:calc(100% - 46px);row-gap:8px}.transport-route:focus-visible{outline:3px solid #376898;outline-offset:3px}
@media(max-width:700px){#route-legend{max-width:calc(100% - 30px)}}

/* Shared literary navigation; map controls retain their own compact UI. */
.site-header{font-family:Georgia,"Times New Roman",serif;background:#faf8f3;color:#272724;border-color:#dcd7cb}.site-header>a:first-child{font-weight:400;font-size:20px}.site-header nav{font-family:system-ui,-apple-system,sans-serif;gap:24px;color:#77756f}.site-header nav a[aria-current=page]{color:#272724;text-decoration:underline;text-underline-offset:5px}
@media(max-width:600px){.site-header{padding:0 12px;gap:9px}.site-header nav{gap:12px;font-size:11px}.site-header>a:first-child{font-size:17px}}

.site-logo{display:block;line-height:0;flex-shrink:0}.site-logo img{display:block;width:34px;height:34px}.site-footer{height:42px;padding:12px 16px;border-top:1px solid #dcd7cb;background:#faf8f3;color:#77756f;font:11px/17px system-ui,-apple-system,sans-serif;text-align:center}.site-footer a{text-decoration:underline;text-underline-offset:3px}main{height:calc(100dvh - 96px)}
@media(max-width:700px){main{height:calc(100dvh - 90px)}.site-logo img{width:30px;height:30px}}

/* A small print over the map; larger images load only after selection. */
.photo-pin { cursor: pointer; background: #fff; padding: 3px; border: 1px solid #fff; border-radius: 7px; box-shadow: 0 2px 9px #29362f30; }
.photo-pin:after { content: ''; position: absolute; left: 19px; bottom: -7px; width: 9px; height: 9px; transform: rotate(45deg); background: #fff; border-radius: 0 0 2px 0; box-shadow: 2px 2px 3px #29362f12; }
.photo-pin-image { display: block; width: 40px; height: 40px; border-radius: 4px; overflow: hidden; background: #eae7df; }
.photo-pin-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-pin:hover, .photo-pin:focus-visible { box-shadow: 0 3px 14px #29362f50; }
.photo-pin-count { position: absolute; right: -6px; top: -6px; min-width: 21px; height: 21px; padding: 0 4px; display: grid; place-items: center; background: #45584e; color: #fff; border: 2px solid #fff; border-radius: 12px; font-size: 10px; font-weight: 600; }
.photo-pin-fallback { display: grid; place-items: center; font-size: 24px; color: #6c776c; }
.photo-popup .leaflet-popup-content { margin: 5px; width: min(300px, 75vw) !important; }
.photo-popup .leaflet-popup-content-wrapper { border-radius: 9px; padding: 0; }
.photo-popup .leaflet-popup-close-button { z-index: 1; top: 9px; right: 9px; background: #ffffffe8; border-radius: 50%; color: #343c42; }
.photo-enlarge { display: block; width: 100%; padding: 0; border: 0; border-radius: 5px; background: #f0eee8; overflow: hidden; }
.photo-enlarge img { display: block; width: 100%; height: auto; max-height: min(300px, 38dvh); object-fit: contain; }
.photo-enlarge.photo-missing { padding: 45px 12px; }
.photo-preview-meta { padding: 10px 10px 8px; }
.photo-preview-meta strong { font-size: 14px; font-weight: 600; }
.photo-preview-meta p { margin: 4px 0 0; color: #7b817b; font-size: 11px; }
.photo-preview-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.photo-preview-actions button { background: #f6f5f1; border: 1px solid #e4e2da; border-radius: 4px; padding: 5px 9px; font-size: 11px; min-height: 32px; }
.photo-preview-pager { display: flex; align-items: center; gap: 6px; font-size: 10px; }
#photo-viewer { width: min(1240px, 94vw); max-width: 94vw; max-height: 94dvh; padding: 0; border: 1px solid #dedbd2; border-radius: 12px; background: #faf8f3; color: #343c42; box-shadow: 0 18px 90px #0003; }
#photo-viewer::backdrop { background: #1f2926b8; backdrop-filter: blur(4px); }
.photo-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.photo-viewer-header h2 { margin: 0; font: 21px Georgia, 'Times New Roman', serif; }
.photo-caption { margin: 5px 0 0; font-size: 12px; color: #77756f; }
.photo-close, .photo-navigation button { background: transparent; border: 1px solid #dedbd2; border-radius: 50%; width: 36px; height: 36px; flex-shrink: 0; font-size: 23px; line-height: 1; }
.photo-close:hover, .photo-navigation button:hover { background: #efede6; }
.photo-stage { position: relative; min-height: 120px; background: #ece9e1; }
.photo-stage img { display: block; width: 100%; height: auto; max-height: calc(94dvh - 165px); object-fit: contain; }
.photo-image-status { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); padding: 7px 10px; margin: 0; border-radius: 4px; background: #faf8f3ef; font-size: 12px; text-align: center; }
.photo-image-status:empty { display: none; }
.photo-viewer-footer { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 12px; padding: 10px 20px; font-size: 12px; }
.photo-navigation { display: flex; align-items: center; gap: 12px; }
.photo-navigation button { font-size: 18px; }
.photo-original { text-decoration: underline; text-underline-offset: 4px; padding: 8px 0; }
@media (max-width: 700px) {
  .photo-viewer-header { padding: 12px; }
  .photo-viewer-header h2 { font-size: 19px; }
  .photo-viewer-footer { padding: 10px 12px; }
  .photo-close, .photo-navigation button { width: 44px; height: 44px; }
  .photo-preview-actions button { min-height: 40px; }
}
