/* ============================================================
   ATLAS —a quiet atlas for the places you have been
   ============================================================ */

@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/manrope-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/cormorant-garamond-latin-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #070b12;
  --ink: #f2eee6;
  --ink-soft: rgba(242, 238, 230, 0.74);
  --muted: rgba(233, 228, 218, 0.52);
  --faint: rgba(233, 228, 218, 0.32);
  --gold: #d8b878;
  --gold-soft: #e8d4a6;
  --gold-deep: #b08d50;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --glass: linear-gradient(155deg, rgba(31, 38, 49, 0.72) 0%, rgba(13, 18, 25, 0.58) 100%);
  --glass-deep: rgba(15, 20, 28, 0.86);
  --blur: blur(22px) saturate(138%);
  --shadow: 0 32px 80px -34px rgba(0, 0, 0, 0.9), 0 2px 10px rgba(0, 0, 0, 0.18);
  --radius: 26px;
  --left-w: 306px;
  --right-w: 386px;
  --edge: 24px;
  --font: "Manrope", "Avenir Next", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --serif: "Cormorant Garamond", "Times New Roman", "Songti SC", "SimSun", serif;
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(216, 184, 120, 0.32); color: #fff; }

:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 3px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.eyebrow-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(216, 184, 120, 0.7);
}

/* ------------------------------------------------------------
   Scene
   ------------------------------------------------------------ */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 62% at 50% 112%, rgba(29, 76, 96, 0.34), transparent 64%),
    radial-gradient(ellipse 50% 48% at 50% 44%, rgba(34, 54, 74, 0.38), transparent 70%),
    linear-gradient(180deg, #060a11 0%, #0a1018 52%, #05080d 100%);
}
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}
.orb-a {
  width: 58vw;
  height: 58vw;
  left: -16vw;
  top: 22vh;
  background: rgba(20, 97, 124, 0.2);
}
.orb-b {
  width: 42vw;
  height: 42vw;
  right: -10vw;
  top: -18vh;
  background: rgba(114, 82, 44, 0.16);
}
.orb-c {
  width: 40vw;
  height: 40vw;
  left: 36vw;
  bottom: -26vh;
  background: rgba(31, 74, 118, 0.16);
}

.globe-wrap {
  position: absolute;
  inset: 0;
}
#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#globe-canvas.is-dragging { cursor: grabbing; }
.globe-glow {
  position: absolute;
  left: 50%;
  top: 51%;
  width: min(78vw, 980px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(74, 145, 185, 0.16) 0%, rgba(47, 96, 145, 0.06) 42%, transparent 64%);
  filter: blur(26px);
  pointer-events: none;
}
.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 72% 78% at 50% 48%, transparent 52%, rgba(3, 6, 10, 0.46) 100%),
    linear-gradient(180deg, rgba(3, 6, 10, 0.38) 0%, transparent 16%, transparent 82%, rgba(3, 6, 10, 0.5) 100%);
  pointer-events: none;
  z-index: 2;
}
.grain {
  position: absolute;
  inset: 0;
  background-image: url("../assets/textures/noise.png");
  background-size: 128px 128px;
  opacity: 0.035;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 3;
}

/* markers live above the canvas, below the UI */
.markers {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}
.marker {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.marker .mk {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.country-marker .mk {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(12, 17, 24, 0.62);
  border: 1px solid rgba(242, 238, 230, 0.38);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.28s var(--ease), border-color 0.28s ease, box-shadow 0.28s ease;
}
.country-marker .mk:hover,
.country-marker .mk:focus-visible {
  transform: translate(-50%, -50%) scale(1.12);
  border-color: rgba(232, 212, 166, 0.9);
}
.country-marker.is-selected .mk {
  transform: translate(-50%, -50%) scale(1.16);
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 4px rgba(216, 184, 120, 0.13), 0 6px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.country-marker.is-context { pointer-events: none; }
.country-marker.is-context .mk {
  pointer-events: none;
  opacity: 0.42;
  transform: translate(-50%, -50%) scale(0.76);
}
.country-marker.is-context .mk-label { display: none; }
.country-marker.is-unvisited .mk {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  border-color: rgba(216, 184, 120, 0.42);
  background: rgba(216, 184, 120, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}
.country-marker.is-unvisited .mk::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 7px rgba(216, 184, 120, 0.65);
}
.country-marker.is-unvisited .mk:hover,
.country-marker.is-unvisited .mk:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.35);
  border-color: rgba(232, 212, 166, 0.82);
}
.country-marker.is-unvisited .mk::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}
.country-marker.is-unvisited .mk-flag { display: none; }
.country-marker.is-unvisited .mk-pulse { display: none; }
.country-marker.is-unvisited .mk-label em { color: var(--gold-soft); }
.country-marker.is-unvisited.is-selected .mk {
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 1;
  border-color: var(--gold-soft);
  background: rgba(12, 17, 24, 0.55);
  box-shadow: 0 0 0 3px rgba(216, 184, 120, 0.12), 0 6px 22px rgba(0, 0, 0, 0.42);
}
.country-marker.is-unvisited.is-selected .mk::before { display: none; }
.country-marker.is-unvisited.is-selected .mk-flag {
  display: block;
  width: 16px;
  height: 11px;
  filter: saturate(0.8);
}
.mk-flag {
  width: 21px;
  height: 15px;
  border-radius: 2.5px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.mk-flag img { width: 100%; height: 100%; object-fit: cover; }
.mk-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 1px solid rgba(216, 184, 120, 0.44);
  opacity: 0;
  animation: markerPulse 3.6s var(--ease) infinite;
  pointer-events: none;
}
.country-marker.is-selected .mk-pulse { animation-duration: 2.4s; }

.mk-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translate(-4px, -50%);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(10, 15, 22, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s var(--ease), visibility 0.2s;
  pointer-events: none;
}
.mk-label b {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mk-label em {
  color: var(--faint);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.country-marker .mk:hover .mk-label,
.country-marker .mk:focus-visible .mk-label,
.country-marker.is-selected .mk-label {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}
.marker.align-left .mk-label {
  left: auto;
  right: calc(100% + 10px);
  transform: translate(4px, -50%);
}
.marker.align-left .mk:hover .mk-label,
.marker.align-left .mk:focus-visible .mk-label,
.marker.align-left.is-selected .mk-label {
  transform: translate(0, -50%);
}
.pin-marker { z-index: 7; }
.pin-marker .pin-mk {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 240, 200, 0.82);
  border-radius: 50% 50% 50% 5px;
  background: linear-gradient(145deg, #f0dcae, #c8a364);
  color: #241b10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(-45deg);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.pin-marker .pin-mk .icon {
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
}
.pin-marker .pin-mk:hover,
.pin-marker .pin-mk:focus-visible {
  box-shadow: 0 0 0 4px rgba(216, 184, 120, 0.18), 0 6px 18px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%) rotate(-45deg) scale(1.1);
}
.pin-marker .pin-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  padding: 4px 8px;
  border: 1px solid rgba(216, 184, 120, 0.28);
  border-radius: 6px;
  background: rgba(9, 13, 18, 0.78);
  color: var(--gold-soft);
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(0, -50%);
  opacity: 0.9;
  visibility: visible;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pin-marker:hover .pin-label { opacity: 1; }
.marker.align-left .pin-label {
  right: calc(100% + 12px);
  left: auto;
}
html[data-theme="day"] .pin-label {
  border-color: rgba(122, 92, 46, 0.25);
  background: rgba(255, 252, 244, 0.9);
  color: #775a2c;
}

/* city markers */
.city-marker .mk {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  padding: 0;
}
.city-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(216, 184, 120, 0.18), 0 0 16px rgba(232, 212, 166, 0.8);
  transition: transform 0.24s var(--ease);
}
.city-marker .mk::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(216, 184, 120, 0.32);
  animation: markerPulse 3.2s var(--ease) infinite;
}
.city-marker .mk:hover .city-dot,
.city-marker.is-selected .city-dot { transform: scale(1.45); }
.city-marker .mk-label {
  left: calc(100% + 4px);
  padding: 4px 8px;
  border-radius: 7px;
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  background: rgba(9, 13, 19, 0.76);
}
.city-marker .mk-label b { font-size: 10.5px; font-weight: 500; }
.city-marker.is-selected .mk-label {
  border-color: rgba(216, 184, 120, 0.4);
  color: var(--gold-soft);
}

/* many cities in one country: keep labels out of the way until needed */
#markers.is-dense .city-marker .mk-label {
  opacity: 0;
  visibility: hidden;
}
#markers.is-dense .city-marker:hover .mk-label,
#markers.is-dense .city-marker:focus-visible .mk-label,
#markers.is-dense .city-marker.is-selected .mk-label {
  opacity: 1;
  visibility: visible;
}

@keyframes markerPulse {
  0% { transform: scale(0.48); opacity: 0; }
  24% { opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* scene overlays */
.canvas-caption {
  position: absolute;
  left: 50%;
  bottom: 106px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(233, 228, 218, 0.36);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.caption-rule {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 228, 218, 0.28));
}
.caption-rule:last-child { transform: rotate(180deg); }

.dock {
  position: absolute;
  left: calc(50% - 34px);
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 23, 32, 0.58);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.dock-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.22s ease, background 0.22s ease;
}
.dock-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.dock-btn.is-on { color: var(--gold-soft); background: rgba(216, 184, 120, 0.1); }
.dock-divider { width: 1px; height: 16px; background: var(--line); }
.dock-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(9, 13, 19, 0.9);
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
  pointer-events: none;
}
.dock-btn:hover .dock-tip,
.dock-btn:focus-visible .dock-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.gesture-hint {
  position: absolute;
  left: calc(50% - 34px);
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 6;
  color: rgba(233, 228, 218, 0.25);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Left panel
   ------------------------------------------------------------ */
.panel {
  position: fixed;
  z-index: 20;
  contain: layout;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  transition: opacity 0.55s var(--ease), transform 0.62s var(--ease), visibility 0.55s;
}
body:not(.is-ready) .panel { opacity: 0; transform: translateY(16px); }

.panel-edge-btn {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  place-items: center;
  width: 27px;
  height: 54px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--muted);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.72);
  transition: color 0.22s, background 0.22s, border-color 0.22s;
}
.panel-edge-btn:hover { color: var(--gold); background: rgba(255, 255, 255, 0.06); }
.panel-edge-btn .icon { width: 13px; height: 13px; color: var(--gold-soft); }
.panel-edge-left {
  right: -14px;
  border-left: 0;
  border-radius: 0 9px 9px 0;
}
.panel-edge-right {
  left: -14px;
  border-right: 0;
  border-radius: 9px 0 0 9px;
}

.side-reopen {
  position: fixed;
  z-index: 38;
  top: 50%;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 35px;
  padding: 12px 0 11px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--muted);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.8);
  transition: color 0.22s, background 0.22s;
}
.side-reopen:hover { color: var(--gold); background: rgba(255, 255, 255, 0.07); }
.side-reopen .icon { width: 14px; height: 14px; color: var(--gold-soft); }
.side-reopen span {
  writing-mode: vertical-rl;
  color: var(--ink-soft);
  font-size: 9.5px;
  letter-spacing: 0.2em;
}
.side-reopen-left { left: 0; border-left: 0; border-radius: 0 12px 12px 0; }
.side-reopen-right { right: 0; border-right: 0; border-radius: 12px 0 0 12px; }

@media (min-width: 901px) {
  body.is-left-collapsed .panel-left {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(-100% - var(--edge) - 12px));
  }
  body.is-right-collapsed .panel-right {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(100% + var(--edge) + 12px));
  }
  body.is-left-collapsed .side-reopen-left,
  body.is-right-collapsed .side-reopen-right { display: flex; }
}

.panel-left {
  top: var(--edge);
  left: var(--edge);
  bottom: var(--edge);
  width: var(--left-w);
  display: flex;
  flex-direction: column;
  padding: 21px 16px 13px;
}
.panel-left::after,
.panel-right::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 26%);
  opacity: 0.5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 4px 18px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  color: rgba(216, 184, 120, 0.82);
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-copy { min-width: 0; flex: 1; }
.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--ink);
}
.brand-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
}
.icon-btn.panel-close { display: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.icon-btn .icon { width: 16px; height: 16px; }

.summary {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 0 4px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--line);
}
.summary-main, .summary-side { display: flex; align-items: baseline; gap: 6px; }
.summary-number {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.summary-side .summary-number { font-size: 22px; color: var(--ink-soft); }
.summary-label { color: var(--muted); font-size: 9.5px; letter-spacing: 0.08em; white-space: nowrap; }
.summary-line { width: 1px; height: 25px; margin-left: auto; background: var(--line); }

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 8px 9px;
}
.list-heading h2 {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.list-heading span {
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.country-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.country-list-wrap::-webkit-scrollbar { width: 0; height: 0; }
.country-list { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 6px; }

.country-item {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: 16px;
  transition: opacity 0.18s;
}
.country-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 82px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.062);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.016) 58%, rgba(216, 184, 120, 0.03)),
    rgba(9, 13, 22, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 8px 18px rgba(2, 5, 12, 0.12);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s var(--ease);
}
.country-main:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025) 58%, rgba(216, 184, 120, 0.045)),
    rgba(9, 13, 22, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.075), 0 12px 24px rgba(2, 5, 12, 0.2);
}
.country-item.is-selected .country-main {
  border-color: rgba(216, 184, 120, 0.34);
  background:
    linear-gradient(135deg, rgba(216, 184, 120, 0.15), rgba(216, 184, 120, 0.04) 55%, rgba(255, 255, 255, 0.03)),
    rgba(12, 16, 25, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 205, 0.12),
    0 12px 28px rgba(2, 5, 12, 0.28),
    0 0 0 1px rgba(216, 184, 120, 0.05);
}

.country-card-media {
  position: relative;
  width: 76px;
  height: 66px;
  flex: none;
  overflow: hidden;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
}
.country-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 16, 0.02) 32%, rgba(4, 8, 16, 0.55));
  pointer-events: none;
}
.country-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04) brightness(0.92);
  transition: transform 0.45s var(--ease), filter 0.3s;
}
.country-main:hover .country-thumb { transform: scale(1.06); filter: saturate(1) contrast(1.04) brightness(1); }
.country-item.is-selected .country-thumb { filter: saturate(1.02) contrast(1.05) brightness(1.02); }

.country-card-index {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(6, 10, 18, 0.55);
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.country-card-media .flag-box {
  position: absolute;
  z-index: 2;
  left: 5px;
  bottom: 5px;
  width: 24px;
  height: 17px;
}

.flag-box {
  width: 30px;
  height: 22px;
  flex: none;
  border-radius: 3.5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}
.flag-box img { width: 100%; height: 100%; object-fit: cover; }
.country-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.country-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.country-name strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.country-name em {
  overflow: hidden;
  color: var(--faint);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.09em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.country-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-cities {
  display: block;
  margin-top: 2px;
  color: rgba(228, 217, 197, 0.46);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-arrow {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--faint);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: 0.22s var(--ease);
}
.country-main:hover .country-arrow,
.country-item.is-selected .country-arrow { opacity: 1; transform: translate(0, 0); color: var(--gold); }

.drag-handle, .delete-btn { display: none; flex: none; }
.drag-handle {
  width: 22px;
  height: 30px;
  display: none;
  place-items: center;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle .icon { width: 15px; height: 15px; }
.delete-btn {
  display: none;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.delete-btn:hover { color: #e6a29a; background: rgba(205, 105, 94, 0.12); }
.delete-btn .icon { width: 14px; height: 14px; }

body.is-editing .panel-left .drag-handle,
body.is-editing .panel-left .delete-btn { display: grid; }
body.is-editing .country-main { padding-right: 4px; cursor: default; }
body.is-editing .country-arrow { display: none; }
body.is-editing .country-item[draggable="true"] { cursor: grab; }
.country-item.is-dragging { opacity: 0.32; }
.country-item.drop-before::after,
.country-item.drop-after::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(216, 184, 120, 0.6);
}
.country-item.drop-before::after { top: -4px; }
.country-item.drop-after::after { bottom: -4px; }

.list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  padding: 20px;
  text-align: center;
}
.list-empty-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
}
.list-empty p { color: var(--ink-soft); font-size: 12.5px; }
.list-empty span { margin-top: 5px; color: var(--faint); font-size: 10px; line-height: 1.7; }

.edit-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 0;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.edit-tools[hidden] { display: none; }
.edit-tools button {
  border-bottom: 1px solid rgba(216, 184, 120, 0.35);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  transition: color 0.2s;
}
.edit-tools button:hover { color: var(--gold-soft); }

.left-footer {
  display: flex;
  gap: 7px;
  padding-top: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn .icon { width: 15px; height: 15px; }
.btn-primary {
  flex: 1.35;
  background: linear-gradient(135deg, #e7d2a4 0%, #cba86c 100%);
  color: #19140d;
  box-shadow: 0 8px 24px -10px rgba(216, 184, 120, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover { background: linear-gradient(135deg, #f0dfb7, #d7b678); }
.btn-ghost {
  flex: 1;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.btn-ghost.is-active {
  border-color: rgba(216, 184, 120, 0.45);
  background: rgba(216, 184, 120, 0.1);
  color: var(--gold-soft);
}
.btn-gold {
  width: 100%;
  background: var(--gold-soft);
  color: #18130c;
}
.btn-gold:hover { background: #f3e3bd; }
.panel-footnote {
  padding: 10px 4px 0;
  color: rgba(233, 228, 218, 0.22);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-align: center;
}
.panel-footnote a {
  color: rgba(216, 184, 120, 0.6);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 184, 120, 0.2);
}
.panel-footnote a:hover { color: var(--gold); border-color: rgba(216, 184, 120, 0.6); }

.mobile-list-btn { display: none; }

/* ------------------------------------------------------------
   Right panel
   ------------------------------------------------------------ */
.panel-right {
  top: var(--edge);
  right: var(--edge);
  bottom: var(--edge);
  width: var(--right-w);
  overflow: visible;
}
.detail-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
}

/* default archive */
.detail-default {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 27px 24px 20px;
  scrollbar-width: none;
}
.detail-default::-webkit-scrollbar { width: 0; }
.default-head .eyebrow { margin-bottom: 13px; }
.default-head h2 {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0.01em;
}
.default-head h2 em {
  color: var(--gold-soft);
  font-style: italic;
  font-weight: 400;
}
.default-intro {
  max-width: 290px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}
.passport-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 25px 0 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.passport-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.passport-stats > div:first-child { padding-left: 0; border-left: 0; }
.passport-stats strong {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.passport-stats span {
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.12em;
}
.postcard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 82px;
  gap: 7px;
}
.postcard {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
}
.postcard:first-child { grid-column: span 2; grid-row: span 1; }
.postcard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.55s ease, transform 0.7s var(--ease);
}
.postcard img.is-loaded { opacity: 1; }
.postcard:hover img { transform: scale(1.055); }
.postcard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 32%, rgba(5, 8, 12, 0.74));
  pointer-events: none;
}
.postcard span {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.92);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.postcard em {
  position: absolute;
  right: 9px;
  top: 8px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.62);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.default-tip {
  display: flex;
  gap: 10px;
  margin-top: 19px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.default-tip .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--gold); }
.default-tip p { color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.default-actions { margin-top: auto; padding-top: 18px; }
.default-actions .btn { min-height: 44px; }
.default-foot {
  margin-top: 13px;
  color: rgba(233, 228, 218, 0.22);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  text-align: center;
}
.pin-section {
  margin: 20px 0 16px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.pin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pin-section-head .eyebrow { margin-bottom: 5px; }
.pin-section-head h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.03em;
}
.pin-total {
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
.pin-mode-btn {
  width: 100%;
  min-height: 40px;
  margin-top: 11px;
  justify-content: flex-start;
  border-style: dashed;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10.5px;
}
.pin-mode-btn:hover { color: var(--gold-soft); border-color: rgba(216, 184, 120, 0.4); }
.pin-mode-btn.is-active {
  border-style: solid;
  border-color: rgba(216, 184, 120, 0.46);
  background: rgba(216, 184, 120, 0.09);
  color: var(--gold-soft);
}
.pin-mode-btn .icon { width: 14px; height: 14px; }
.pin-form {
  margin-top: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}
.pin-coord {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-soft);
  font-size: 9px;
  letter-spacing: 0.05em;
}
.pin-coord .icon { width: 12px; height: 12px; }
.pin-field { display: block; margin-top: 10px; }
.pin-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.13em;
}
.pin-field input {
  width: 100%;
  height: 35px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: rgba(5, 8, 12, 0.35);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}
.pin-field input::placeholder { color: var(--faint); }
.pin-field input:focus { border-color: rgba(216, 184, 120, 0.58); box-shadow: 0 0 0 3px rgba(216, 184, 120, 0.08); }
.pin-form-actions { display: flex; gap: 7px; margin-top: 10px; }
.pin-form-actions .btn { flex: 1; min-height: 34px; padding: 0 9px; font-size: 10px; }
.pin-list { display: flex; flex-direction: column; gap: 5px; margin-top: 11px; }
.pin-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 39px;
  padding: 5px 5px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pin-item:hover { border-color: rgba(216, 184, 120, 0.3); background: rgba(216, 184, 120, 0.045); }
.pin-place {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.pin-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pin-coords {
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pin-remove {
  flex: none;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}
.pin-remove:hover { background: rgba(212, 116, 104, 0.12); color: #d98e84; }
.pin-remove .icon { width: 11px; height: 11px; }
.pin-empty {
  margin-top: 10px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}
body.is-pin-mode #globe-canvas { cursor: crosshair; }
body.is-pin-mode #markers .mk { pointer-events: none; }

/* shared detail bar */
.detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  height: 54px;
  padding: 0 13px 0 18px;
  border-bottom: 1px solid var(--line);
}
.detail-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
}
.detail-close { display: none; flex: none; width: 30px; height: 30px; }
.detail-bar-label .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(216, 184, 120, 0.7);
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: -5px;
  padding: 6px 8px 6px 3px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  transition: color 0.2s, background 0.2s;
}
.back-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.back-btn .icon { width: 15px; height: 15px; }

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  padding-bottom: 16px;
}
.detail-scroll::-webkit-scrollbar { width: 4px; }
.detail-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }
.detail-scroll::-webkit-scrollbar-track { background: transparent; }

.cover {
  position: relative;
  height: 208px;
  margin: 10px 10px 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #182330, #0b1017);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 0.7s ease, transform 1.2s var(--ease);
}
.cover img.is-loaded { opacity: 1; transform: scale(1); }
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 7, 11, 0.1) 0%, transparent 36%, rgba(4, 7, 11, 0.78) 100%);
  pointer-events: none;
}
.cover figcaption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 60px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.cover figcaption .icon { width: 12px; height: 12px; opacity: 0.7; }
.cover-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(232, 212, 166, 0.28);
  border-radius: 999px;
  background: rgba(9, 13, 19, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gold-soft);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.cover-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.cover-badge.is-preview {
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.82);
}
.cover-badge.is-preview::before { background: rgba(255, 255, 255, 0.62); }
.detail-add {
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  border-radius: 11px;
}
.cover-no {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.36);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.detail-body {
  padding: 17px 22px 2px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.flag-lg {
  width: 42px;
  height: 30px;
  flex: none;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.flag-lg img { width: 100%; height: 100%; object-fit: cover; }
.title-copy { min-width: 0; }
.title-row .eyebrow { font-size: 8px; margin-bottom: 4px; }
.title-row h2 {
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.015em;
}
.en-title {
  margin-top: 5px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.lead {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.9;
  letter-spacing: 0.01em;
}
.fact-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 8px;
  margin: 17px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fact span {
  display: block;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.1em;
}
.fact strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-section { margin-top: 20px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-head h3 {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.section-head span {
  color: var(--faint);
  font-size: 7px;
  letter-spacing: 0.14em;
}
.city-list { display: flex; flex-direction: column; gap: 7px; }
.city-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.22s, background 0.22s, transform 0.22s var(--ease);
}
.city-card:hover {
  border-color: rgba(216, 184, 120, 0.26);
  background: rgba(216, 184, 120, 0.055);
  transform: translateX(2px);
}
.city-thumb {
  width: 66px;
  height: 52px;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.city-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s var(--ease);
}
.city-thumb img.is-loaded { opacity: 1; }
.city-card:hover .city-thumb img { transform: scale(1.06); }
.city-copy { flex: 1; min-width: 0; }
.city-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.city-copy em {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--faint);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.city-sub {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.city-arrow { width: 14px; height: 14px; flex: none; color: var(--faint); margin-right: 3px; }
.city-card:hover .city-arrow { color: var(--gold); }

/* >=9 cities: compact two-column cards with every highlight visible */
.city-list.is-dense {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.city-list.is-dense .city-card {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 6px;
}
.city-list.is-dense .city-card:hover { transform: translateY(-1px); }
.city-list.is-dense .city-thumb {
  width: 100%;
  height: 70px;
  margin-bottom: 6px;
}
.city-list.is-dense .city-copy strong { font-size: 12px; }
.city-list.is-dense .city-sub {
  margin-top: 3px;
  font-size: 8.5px;
}
.city-list.is-dense .city-spots {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.city-list.is-dense .city-arrow { display: none; }
@media (max-width: 620px) {
  .city-list.is-dense { grid-template-columns: 1fr; }
  .city-list.is-dense .city-card { flex-direction: row; align-items: center; gap: 9px; }
  .city-list.is-dense .city-thumb { width: 64px; height: 52px; margin-bottom: 0; }
  .city-list.is-dense .city-spots { font-size: 10.5px; }
}
.detail-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: rgba(233, 228, 218, 0.25);
  font-size: 8px;
  letter-spacing: 0.05em;
}
.detail-note .icon { width: 12px; height: 12px; }

/* city view */
.city-hero-title { margin-top: 2px; }
.city-hero-title h2 {
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
  line-height: 1;
}
.city-hero-title .en-title { margin-top: 5px; }
.coord-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}
.coord-line .icon { width: 12px; height: 12px; color: var(--gold); }
.highlights { margin-top: 2px; border-top: 1px solid var(--line); }
.highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.highlights .num {
  flex: none;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.highlights .spot-thumb {
  flex: none;
  width: 88px;
  height: 64px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}
.highlights .spot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.highlights .spot-thumb img.is-loaded { opacity: 1; }
.highlights .spot-copy {
  flex: 1;
  line-height: 1.35;
}
.highlights li .icon { width: 12px; height: 12px; color: var(--faint); }

.spot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 3px;
}
.spot-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease);
}
.spot-card:hover,
.spot-card:focus-visible {
  border-color: rgba(216, 184, 120, 0.48);
  background: rgba(216, 184, 120, 0.055);
  transform: translateY(-1px);
}
.spot-card-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
}
.spot-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
}
.spot-card-photo img.is-loaded { opacity: 1; transform: none; }
.spot-card:hover .spot-card-photo img { transform: scale(1.035); }
.spot-card-no,
.spot-card-count {
  position: absolute;
  bottom: 8px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(7, 11, 18, 0.45);
  color: rgba(255, 248, 235, 0.85);
  font-size: 8px;
  letter-spacing: 0.12em;
  line-height: 1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.spot-card-no { left: 8px; }
.spot-card-count { right: 8px; letter-spacing: 0.06em; }
.spot-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px 11px;
}
.spot-card-body strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.spot-card-body span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.city-photo-note {
  margin-top: 11px;
  color: rgba(233, 228, 218, 0.25);
  font-size: 8px;
  letter-spacing: 0.04em;
}
.next-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 19px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.next-card:hover { border-color: rgba(216, 184, 120, 0.3); background: rgba(216, 184, 120, 0.05); }
.next-thumb {
  width: 48px;
  height: 42px;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.next-thumb img { width: 100%; height: 100%; object-fit: cover; }
.next-copy { flex: 1; min-width: 0; }
.next-copy span {
  display: block;
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.next-copy strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.next-card > .icon { width: 15px; height: 15px; color: var(--gold); margin-right: 4px; }

/* panel fresh content animation */
.detail-content.is-fresh > * { animation: contentIn 0.55s var(--ease) both; }
@keyframes contentIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   Add-country modal
   ------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.modal.is-open { visibility: visible; opacity: 1; }
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(530px, calc(100vw - 32px));
  max-height: min(730px, 84vh);
  padding: 25px 25px 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  background: linear-gradient(155deg, rgba(29, 36, 46, 0.94), rgba(12, 17, 24, 0.93));
  backdrop-filter: blur(30px) saturate(130%);
  -webkit-backdrop-filter: blur(30px) saturate(130%);
  box-shadow: 0 40px 100px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.4s var(--ease);
}
.modal.is-open .modal-card { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}
.modal-intro {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.75;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  margin-top: 18px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.17);
  transition: border-color 0.2s, background 0.2s;
}
.search-box:focus-within { border-color: rgba(216, 184, 120, 0.45); background: rgba(0, 0, 0, 0.25); }
.search-box .icon { width: 15px; height: 15px; color: var(--faint); }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.add-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 10px -6px 0;
  padding: 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.add-list::-webkit-scrollbar { width: 4px; }
.add-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }
.add-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
.add-row:hover { background: rgba(255, 255, 255, 0.045); border-radius: 10px; }
.add-row:focus-visible { outline: 1px solid var(--gold-soft); outline-offset: -1px; border-radius: 10px; }
.add-row .flag-box { width: 34px; height: 25px; border-radius: 4px; }
.add-copy { flex: 1; min-width: 0; }
.add-copy strong { display: block; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.add-copy em {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.add-meta {
  flex: none;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.03em;
}
.add-plus {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
}
.add-plus .icon { width: 13px; height: 13px; }
.add-row:hover .add-plus { border-color: var(--gold); color: #18130c; background: var(--gold-soft); }
.add-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
}
.add-empty[hidden] { display: none; }
.add-empty .icon { width: 22px; height: 22px; color: var(--gold); margin-bottom: 12px; }
.add-empty p { color: var(--ink-soft); font-size: 12.5px; }
.add-empty span { margin-top: 5px; color: var(--faint); font-size: 10px; }

/* ------------------------------------------------------------
   Spot detail modal
   ------------------------------------------------------------ */
.spot-modal { z-index: 75; padding: 20px; }
.spot-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  width: min(880px, calc(100vw - 40px));
  max-height: min(570px, 86vh);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(28, 35, 45, 0.97), rgba(10, 15, 22, 0.98));
  box-shadow: 0 42px 110px -22px rgba(0, 0, 0, 0.92), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.45s var(--ease);
}
.spot-modal.is-open .spot-dialog { transform: none; }
.spot-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  background: rgba(7, 11, 18, 0.62);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f2eee6;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
}
.spot-close .icon { width: 15px; height: 15px; }
.spot-photo {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 420px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080d14;
}
.spot-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spot-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 13, 0) 54%, rgba(4, 8, 13, 0.62) 100%);
  pointer-events: none;
}
.spot-photo-no {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(7, 11, 18, 0.44);
  color: rgba(255, 247, 232, 0.86);
  font-size: 9px;
  letter-spacing: 0.14em;
  line-height: 1;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.spot-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 34px 32px 22px;
  overflow: auto;
}
.spot-info .eyebrow { color: var(--gold); font-size: 8.5px; }
.spot-info h2 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.spot-modal-meta {
  margin-top: 9px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.spot-modal-text {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.95;
  letter-spacing: 0.01em;
}
.spot-modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.spot-count {
  color: var(--gold);
  font-size: 8.5px;
  letter-spacing: 0.16em;
}
.spot-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
.spot-step .icon { width: 11px; height: 11px; }
.spot-step:hover:not(:disabled) { border-color: var(--gold-soft); color: var(--gold); background: rgba(216, 184, 120, 0.07); }
.spot-step:disabled { opacity: 0.3; cursor: default; }
body.is-spot-open { overflow: hidden; }

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  max-width: calc(100vw - 32px);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(14, 19, 27, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.75);
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.28s ease, transform 0.28s var(--ease), visibility 0.28s;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; }
.toast-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(216, 184, 120, 0.8); }
#toast-action {
  margin-left: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(216, 184, 120, 0.12);
  color: var(--gold-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
#toast-action:hover { background: rgba(216, 184, 120, 0.22); }
#toast-action[hidden] { display: none; }

/* ------------------------------------------------------------
   Loader
   ------------------------------------------------------------ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 52% 50% at 50% 48%, rgba(45, 82, 107, 0.26), transparent 70%),
    #060a10;
  transition: opacity 0.75s ease, visibility 0.75s;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; }
.loader-orbit {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 27px;
}
.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(216, 184, 120, 0.22);
  transform: rotateX(68deg) rotateZ(-19deg);
}
.loader-ring.ring-2 {
  inset: 7px;
  border-color: rgba(216, 184, 120, 0.16);
  transform: rotateY(67deg) rotateZ(25deg);
}
.loader-sphere {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 29%, rgba(155, 206, 230, 0.85), transparent 38%),
    linear-gradient(135deg, #6e9cb5, #193447 60%, #0b151d);
  box-shadow: 0 0 28px rgba(112, 181, 212, 0.28), inset -4px -3px 9px rgba(0, 0, 0, 0.45);
  animation: loaderFloat 3.6s ease-in-out infinite;
}
.loader-orbit::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 8px var(--gold);
  animation: orbitStar 4.8s linear infinite;
}
.loader-brand {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
}
.loader-text {
  margin-top: 9px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.18em;
}
.loader-track {
  width: 142px;
  height: 1px;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.loader-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold));
  transition: width 0.35s ease;
}
.loader-pct {
  margin-top: 9px;
  color: rgba(233, 228, 218, 0.25);
  font-size: 8px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
@keyframes loaderFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes orbitStar {
  from { transform: rotate(0deg) translateX(37px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(37px) rotate(-360deg); }
}

/* fallbacks */
.noscript {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 110;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass-deep);
  color: var(--ink-soft);
  font-size: 12px;
}
.webgl-fallback {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 8;
  width: min(360px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass-deep);
  text-align: center;
}
.webgl-fallback p { font-size: 13px; }
.webgl-fallback span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.7; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
  :root { --left-w: 286px; --right-w: 354px; --edge: 18px; }
  .panel-left { padding: 19px 14px 12px; }
  .detail-body { padding-left: 18px; padding-right: 18px; }
  .default-head h2 { font-size: 34px; }
  .cover { height: 194px; }
  .detail-default { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 1080px) {
  :root { --left-w: 268px; --right-w: 330px; }
  .country-name strong { font-size: 12.5px; }
  .postcard-grid { grid-auto-rows: 72px; }
  .canvas-caption { display: none; }
  .title-row h2, .city-hero-title h2 { font-size: 30px; }
  .detail-body { padding-left: 16px; padding-right: 16px; }
}
@media (max-height: 760px) and (min-width: 901px) {
  :root { --edge: 14px; }
  .brand { padding-bottom: 12px; }
  .summary { padding-bottom: 12px; }
  .list-heading { padding-top: 12px; padding-bottom: 6px; }
  .country-main { min-height: 46px; padding-top: 5px; padding-bottom: 5px; }
  .panel-footnote { display: none; }
  .default-head h2 { font-size: 31px; }
  .passport-stats { margin: 16px 0 14px; padding: 10px 0; }
  .postcard-grid { grid-auto-rows: 65px; }
  .default-tip { margin-top: 12px; padding: 10px 12px; }
  .default-actions { padding-top: 12px; }
  .cover { height: 170px; }
  .detail-body { padding-top: 13px; }
  .lead { margin-top: 10px; line-height: 1.75; }
  .fact-row { margin-top: 12px; padding: 9px 0; }
  .detail-section { margin-top: 15px; }
  .default-foot { display: none; }
}

@media (max-width: 900px) {
  :root { --edge: 12px; --radius: 22px; }

  .panel-edge-btn,
  .side-reopen { display: none; }

  .panel-left {
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: min(330px, calc(100vw - 24px));
    z-index: 42;
    padding: 19px 16px 13px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(calc(-100% - 24px));
    transition: opacity 0.38s var(--ease), transform 0.45s var(--ease), visibility 0.4s;
  }
  body:not(.is-ready) .panel-left { transform: translateX(calc(-100% - 24px)); }
  .panel-left.is-open { opacity: 1; visibility: visible; transform: none; }
  .icon-btn.panel-close { display: grid; margin-left: auto; }

  .panel-right {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: min(73vh, 640px);
    z-index: 45;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(100% + 24px));
    transition: opacity 0.36s var(--ease), transform 0.46s var(--ease), visibility 0.42s;
  }
  body:not(.is-ready) .panel-right { transform: translateY(calc(100% + 24px)); }
  .panel-right.is-open { opacity: 1; visibility: visible; transform: none; }
  .detail-default { display: none; }
  .detail-close { display: grid; }

  .mobile-list-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(16, 22, 30, 0.68);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--ink-soft);
    font-size: 10px;
    letter-spacing: 0.06em;
  }
  .mobile-list-btn .icon { width: 15px; height: 15px; color: var(--gold); }
  .mobile-list-btn b {
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 1px;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(216, 184, 120, 0.14);
    color: var(--gold-soft);
    font-size: 9px;
    font-weight: 600;
  }

  .dock { bottom: 22px; left: 50%; }
  .gesture-hint { bottom: 7px; left: 50%; }
  .toast { bottom: 92px; }
  .cover { height: 190px; }
}

@media (max-width: 600px) {
  .panel-left { width: calc(100vw - 24px); top: 12px; }
  .brand { padding-bottom: 13px; }
  .summary { padding-bottom: 12px; }
  .summary-number { font-size: 32px; }
  .panel-right { height: min(76vh, 620px); }
  .detail-bar { height: 48px; padding-left: 13px; }
  .cover { height: 156px; margin: 8px 8px 0; border-radius: 15px; }
  .detail-body { padding: 13px 15px 2px; }
  .title-row h2, .city-hero-title h2 { font-size: 28px; }
  .flag-lg { width: 36px; height: 26px; }
  .lead { font-size: 11px; line-height: 1.8; }
  .fact-row { margin-top: 13px; padding: 9px 0; }
  .city-thumb { width: 58px; height: 46px; }
  .city-card { padding: 6px; }
  .canvas-caption, .gesture-hint { display: none; }
  html[data-theme="day"] #globe-canvas { filter: none; }
  .grain { display: none; }
  .dock { bottom: 18px; }
  .modal { padding: 10px; }
  .modal-card { padding: 21px 18px 13px; max-height: 88vh; }
  .modal-head h2 { font-size: 26px; }
  .spot-modal { padding: 8px; }
  .spot-dialog {
    grid-template-columns: 1fr;
    grid-template-rows: 204px minmax(0, 1fr);
    width: calc(100vw - 16px);
    max-height: 92vh;
    border-radius: 22px;
  }
  .spot-photo { min-height: 0; height: 204px; }
  .spot-close { top: 10px; right: 10px; }
  .spot-info { padding: 20px 18px 14px; }
  .spot-info h2 { font-size: 29px; }
  .spot-modal-text { margin-top: 14px; font-size: 12px; line-height: 1.88; }
  .spot-modal-nav { margin-top: 16px; padding-top: 13px; }
  .spot-grid { grid-template-columns: 1fr; gap: 8px; }
  .spot-card { flex-direction: row; align-items: stretch; }
  .spot-card-photo { flex: none; width: 112px; height: 84px; aspect-ratio: auto; }
  .spot-card-body { flex: 1; justify-content: center; padding: 9px 11px; gap: 3px; }
  .spot-card-body strong { font-size: 13px; white-space: normal; }
  .spot-card-body span { font-size: 9.5px; -webkit-line-clamp: 3; }
  .postcard-grid { grid-auto-rows: 76px; }
  .default-head h2 { font-size: 32px; }
  .default-actions { padding-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel { background: rgba(17, 23, 31, 0.94); }
  .dock, .modal-card, .toast, .mobile-list-btn { background: rgba(15, 20, 28, 0.95); }
}

/* ------------------------------------------------------------
   Theme button + daylight
   ------------------------------------------------------------ */
.theme-btn[data-mode="auto"]::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(216, 184, 120, 0.7);
}

html[data-theme="day"] {
  color-scheme: light;
  --bg: #e7e0d2;
  --ink: #1c2d34;
  --ink-soft: rgba(28, 45, 52, 0.79);
  --muted: rgba(28, 45, 52, 0.55);
  --faint: rgba(28, 45, 52, 0.37);
  --gold: #9c6d34;
  --gold-soft: #b07f42;
  --gold-deep: #7c5727;
  --line: rgba(27, 49, 58, 0.11);
  --line-strong: rgba(27, 49, 58, 0.18);
  --glass: linear-gradient(155deg, rgba(255, 255, 255, 0.86) 0%, rgba(251, 248, 239, 0.68) 100%);
  --glass-deep: rgba(253, 250, 242, 0.96);
  --shadow: 0 34px 80px -40px rgba(78, 63, 44, 0.36), 0 2px 12px rgba(78, 63, 44, 0.07);
}

html[data-theme="day"] body { background: #e7e0d2; }
html[data-theme="day"] ::selection { background: rgba(156, 109, 52, 0.2); color: #1c2d34; }

html[data-theme="day"] .ambient {
  background:
    radial-gradient(ellipse 48% 46% at 88% 4%, rgba(255, 228, 176, 0.96), transparent 64%),
    radial-gradient(ellipse 54% 56% at 2% 10%, rgba(126, 188, 205, 0.72), transparent 68%),
    radial-gradient(ellipse 56% 42% at 8% 96%, rgba(152, 187, 176, 0.38), transparent 70%),
    linear-gradient(118deg, #c5dfe5 0%, #e1e9e2 34%, #f3e4ce 68%, #eed1af 100%);
}
html[data-theme="day"] .ambient::before {
  content: "";
  position: absolute;
  inset: -8% -16%;
  background:
    linear-gradient(108deg, transparent 30%, rgba(255, 244, 211, 0.26) 44%, rgba(255, 237, 194, 0.12) 54%, transparent 66%),
    radial-gradient(ellipse 34% 10% at 27% 31%, rgba(255, 255, 255, 0.56), transparent 72%),
    radial-gradient(ellipse 27% 8% at 72% 23%, rgba(255, 255, 255, 0.38), transparent 74%),
    radial-gradient(ellipse 44% 9% at 52% 63%, rgba(255, 249, 235, 0.4), transparent 76%);
  opacity: 0.82;
  pointer-events: none;
}
html[data-theme="day"] .ambient::after {
  content: "";
  position: absolute;
  right: 5vw;
  top: -16vw;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 247, 219, 0.9) 0%, rgba(255, 220, 160, 0.25) 38%, transparent 68%);
  pointer-events: none;
}
html[data-theme="day"] .orb-a { background: rgba(115, 176, 198, 0.24); }
html[data-theme="day"] .orb-b { background: rgba(255, 208, 143, 0.26); }
html[data-theme="day"] .orb-c { background: rgba(176, 194, 169, 0.24); }
html[data-theme="day"] .vignette {
  background:
    radial-gradient(ellipse 76% 82% at 50% 46%, transparent 56%, rgba(123, 103, 74, 0.1) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 18%, transparent 82%, rgba(147, 120, 86, 0.09) 100%);
}
html[data-theme="day"] .grain { opacity: 0.024; mix-blend-mode: multiply; }

html[data-theme="day"] #globe-canvas { filter: brightness(1.18) saturate(1.12) contrast(1.03); }
html[data-theme="day"] .globe-glow {
  background: radial-gradient(circle, rgba(255, 240, 205, 0.36) 0%, rgba(153, 198, 211, 0.16) 42%, transparent 66%);
  opacity: 0.88;
}

html[data-theme="day"] .canvas-caption { color: rgba(40, 60, 67, 0.38); }
html[data-theme="day"] .caption-rule { background: linear-gradient(90deg, transparent, rgba(40, 60, 67, 0.26)); }
html[data-theme="day"] .gesture-hint { color: rgba(40, 60, 67, 0.34); }

html[data-theme="day"] .panel {
  border-color: rgba(27, 49, 58, 0.1);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.9) 0%, rgba(239, 247, 247, 0.76) 48%, rgba(252, 240, 222, 0.72) 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
html[data-theme="day"] .panel-left::after,
html[data-theme="day"] .panel-right::after {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.4), transparent 34%);
  opacity: 0.66;
}
html[data-theme="day"] .panel-edge-btn,
html[data-theme="day"] .side-reopen {
  border-color: rgba(27, 49, 58, 0.12);
  background: rgba(255, 255, 255, 0.64);
  color: rgba(28, 45, 52, 0.48);
  box-shadow: 0 8px 24px -16px rgba(57, 72, 68, 0.45);
}
html[data-theme="day"] .panel-edge-btn:hover,
html[data-theme="day"] .side-reopen:hover {
  color: #9c6d34;
  background: rgba(255, 255, 255, 0.86);
}
html[data-theme="day"] .brand-mark { color: #a3743c; }
html[data-theme="day"] .icon-btn:hover { background: rgba(31, 55, 64, 0.07); }
html[data-theme="day"] .panel-footnote { color: rgba(28, 45, 52, 0.29); }
html[data-theme="day"] .panel-footnote a { color: rgba(156, 109, 52, 0.28); border-color: rgba(156, 109, 52, 0.1); }

html[data-theme="day"] .country-main {
  border-color: rgba(27, 49, 58, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 253, 247, 0.62) 58%, rgba(176, 127, 66, 0.07)),
    rgba(255, 255, 255, 0.34);
  box-shadow: 0 8px 20px rgba(55, 82, 94, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
html[data-theme="day"] .country-main:hover {
  border-color: rgba(27, 49, 58, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 247, 0.78) 58%, rgba(176, 127, 66, 0.1)),
    rgba(255, 255, 255, 0.46);
  box-shadow: 0 13px 26px rgba(55, 82, 94, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="day"] .country-item.is-selected .country-main {
  border-color: rgba(156, 109, 52, 0.38);
  background:
    linear-gradient(135deg, rgba(217, 182, 125, 0.2), rgba(255, 253, 247, 0.72) 58%, rgba(255, 255, 255, 0.55)),
    rgba(255, 255, 255, 0.36);
  box-shadow: 0 12px 28px rgba(86, 97, 76, 0.1), 0 0 0 1px rgba(156, 109, 52, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="day"] .country-card-media { border-color: rgba(27, 49, 58, 0.12); background: rgba(255, 255, 255, 0.42); }
html[data-theme="day"] .country-thumb { filter: saturate(1.02) contrast(1.03) brightness(1.02); }
html[data-theme="day"] .country-main:hover .country-thumb { filter: saturate(1.05) contrast(1.03) brightness(1.06); }
html[data-theme="day"] .country-item.is-selected .country-thumb { filter: saturate(1.04) contrast(1.04) brightness(1.05); }
html[data-theme="day"] .country-cities { color: rgba(28, 45, 52, 0.42); }
html[data-theme="day"] .mk-label {
  border-color: rgba(27, 49, 58, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 9px 24px rgba(44, 69, 80, 0.18);
}
html[data-theme="day"] .mk-label b { color: #1c2d34; }
html[data-theme="day"] .mk-label em { color: rgba(28, 45, 52, 0.48); }
html[data-theme="day"] .country-card-index { background: rgba(18, 31, 36, 0.5); color: rgba(255, 255, 255, 0.82); }
html[data-theme="day"] .flag-box { border-color: rgba(255, 255, 255, 0.65); box-shadow: 0 2px 7px rgba(40, 60, 68, 0.2); }
html[data-theme="day"] .country-item.drop-before::after,
html[data-theme="day"] .country-item.drop-after::after { background: var(--gold); box-shadow: 0 0 8px rgba(156, 109, 52, 0.5); }
html[data-theme="day"] .drag-handle,
html[data-theme="day"] .delete-btn { color: var(--faint); }
html[data-theme="day"] .delete-btn:hover { color: #9c4f47; background: rgba(173, 83, 73, 0.1); }

html[data-theme="day"] .btn-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink-soft);
}
html[data-theme="day"] .btn-ghost:hover { border-color: rgba(156, 109, 52, 0.38); background: rgba(255, 255, 255, 0.7); color: var(--ink); }
html[data-theme="day"] .btn-gold { color: #241b10; }
html[data-theme="day"] .btn-gold:hover { background: #c79a5c; }

html[data-theme="day"] .dock {
  background: rgba(255, 255, 255, 0.63);
  border-color: rgba(27, 49, 58, 0.11);
  box-shadow: 0 16px 38px -16px rgba(53, 81, 92, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
html[data-theme="day"] .dock-btn:hover { background: rgba(29, 52, 61, 0.07); }
html[data-theme="day"] .dock-btn.is-on { background: rgba(156, 109, 52, 0.12); color: var(--gold); }
html[data-theme="day"] .dock-tip { background: rgba(252, 250, 244, 0.96); color: var(--ink-soft); box-shadow: 0 8px 22px rgba(53, 81, 92, 0.18); }
html[data-theme="day"] .theme-btn[data-mode="auto"]::after { background: var(--gold); box-shadow: none; }

html[data-theme="day"] .back-btn:hover { background: rgba(29, 52, 61, 0.06); }
html[data-theme="day"] .detail-scroll { scrollbar-color: rgba(27, 49, 58, 0.18) transparent; }
html[data-theme="day"] .detail-scroll::-webkit-scrollbar-thumb { background: rgba(27, 49, 58, 0.16); }
html[data-theme="day"] .cover { background: linear-gradient(135deg, #c8dce4, #e7edee); border-color: rgba(27, 49, 58, 0.1); }
html[data-theme="day"] .cover-badge { background: rgba(18, 30, 35, 0.56); border-color: rgba(255, 239, 205, 0.24); color: #f2dfbb; }
html[data-theme="day"] .cover-no { color: rgba(255, 255, 255, 0.5); }
html[data-theme="day"] .flag-lg { border-color: rgba(255, 255, 255, 0.62); box-shadow: 0 4px 12px rgba(40, 60, 68, 0.18); }
html[data-theme="day"] .postcard { border-color: rgba(27, 49, 58, 0.1); background: rgba(255, 255, 255, 0.3); }
html[data-theme="day"] .default-tip { background: rgba(255, 255, 255, 0.38); border-color: rgba(27, 49, 58, 0.09); }
html[data-theme="day"] .default-foot,
html[data-theme="day"] .detail-note,
html[data-theme="day"] .city-photo-note { color: rgba(28, 45, 52, 0.3); }
html[data-theme="day"] .pin-form { background: rgba(255, 255, 255, 0.5); }
html[data-theme="day"] .pin-mode-btn { background: rgba(255, 255, 255, 0.38); }
html[data-theme="day"] .pin-field input {
  border-color: rgba(27, 49, 58, 0.14);
  background: rgba(255, 255, 255, 0.66);
  color: #1b313a;
}
html[data-theme="day"] .pin-item { background: rgba(255, 255, 255, 0.36); }
html[data-theme="day"] .pin-name { color: #1b313a; }
html[data-theme="day"] .city-card { border-color: rgba(27, 49, 58, 0.075); background: rgba(255, 255, 255, 0.34); }
html[data-theme="day"] .city-card:hover { border-color: rgba(156, 109, 52, 0.25); background: rgba(255, 255, 255, 0.62); }
html[data-theme="day"] .city-thumb,
html[data-theme="day"] .next-thumb { background: rgba(255, 255, 255, 0.4); }
html[data-theme="day"] .highlights .spot-thumb { border-color: rgba(27, 49, 58, 0.12); background: rgba(255, 255, 255, 0.4); }
html[data-theme="day"] .next-card { border-color: rgba(27, 49, 58, 0.08); background: rgba(255, 255, 255, 0.38); }
html[data-theme="day"] .next-card:hover { border-color: rgba(156, 109, 52, 0.28); background: rgba(255, 255, 255, 0.64); }

html[data-theme="day"] .modal-scrim { background: rgba(73, 96, 106, 0.26); }
html[data-theme="day"] .modal-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 243, 0.94));
  border-color: rgba(27, 49, 58, 0.11);
  box-shadow: 0 40px 100px -28px rgba(39, 64, 76, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="day"] .spot-dialog {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 243, 0.97));
  border-color: rgba(27, 49, 58, 0.12);
  box-shadow: 0 42px 110px -28px rgba(39, 64, 76, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="day"] .spot-close {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(27, 49, 58, 0.14);
  color: var(--ink);
  box-shadow: 0 8px 24px -12px rgba(39, 64, 76, 0.35);
}
html[data-theme="day"] .spot-card {
  border-color: rgba(27, 49, 58, 0.09);
  background: rgba(255, 255, 255, 0.48);
}
html[data-theme="day"] .spot-card:hover,
html[data-theme="day"] .spot-card:focus-visible {
  border-color: rgba(156, 109, 52, 0.4);
  background: rgba(255, 255, 255, 0.8);
}
html[data-theme="day"] .spot-card-photo { background: rgba(27, 49, 58, 0.06); }
html[data-theme="day"] .search-box { background: rgba(255, 255, 255, 0.42); border-color: rgba(27, 49, 58, 0.1); }
html[data-theme="day"] .search-box:focus-within { background: rgba(255, 255, 255, 0.72); border-color: rgba(156, 109, 52, 0.42); }
html[data-theme="day"] .add-list { scrollbar-color: rgba(27, 49, 58, 0.18) transparent; }
html[data-theme="day"] .add-list::-webkit-scrollbar-thumb { background: rgba(27, 49, 58, 0.16); }
html[data-theme="day"] .add-row { border-bottom-color: rgba(27, 49, 58, 0.07); }
html[data-theme="day"] .add-row:hover { background: rgba(255, 255, 255, 0.55); }
html[data-theme="day"] .add-plus { border-color: rgba(27, 49, 58, 0.18); }
html[data-theme="day"] .add-row:hover .add-plus { border-color: var(--gold); color: #241b10; background: var(--gold-soft); }

html[data-theme="day"] .toast {
  background: rgba(253, 251, 245, 0.94);
  border-color: rgba(27, 49, 58, 0.1);
  box-shadow: 0 16px 40px -14px rgba(53, 81, 92, 0.33);
}
html[data-theme="day"] #toast-action { background: rgba(156, 109, 52, 0.12); color: var(--gold); }
html[data-theme="day"] #toast-action:hover { background: rgba(156, 109, 52, 0.2); }

html[data-theme="day"] .loader {
  background:
    radial-gradient(ellipse 52% 50% at 50% 48%, rgba(255, 244, 208, 0.56), transparent 70%),
    linear-gradient(180deg, #dfeaf0, #f2e9da);
}
html[data-theme="day"] .loader-sphere {
  background:
    radial-gradient(circle at 34% 29%, rgba(215, 239, 248, 0.95), transparent 38%),
    linear-gradient(135deg, #77aec4, #315e74 60%, #173442);
  box-shadow: 0 0 30px rgba(255, 232, 182, 0.4), inset -4px -3px 9px rgba(19, 48, 61, 0.4);
}
html[data-theme="day"] .loader-ring { border-color: rgba(156, 109, 52, 0.3); }
html[data-theme="day"] .loader-track { background: rgba(27, 49, 58, 0.12); }
html[data-theme="day"] .loader-pct { color: rgba(28, 45, 52, 0.38); }

html[data-theme="day"] .mobile-list-btn {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(27, 49, 58, 0.11);
  box-shadow: 0 12px 28px -16px rgba(53, 81, 92, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
}
html[data-theme="day"] .mobile-list-btn b { background: rgba(156, 109, 52, 0.13); color: var(--gold); }
html[data-theme="day"] .webgl-fallback,
html[data-theme="day"] .noscript { background: var(--glass-deep); border-color: var(--line); }


/* ------------------------------------------------------------
   Theme transition veil
   ------------------------------------------------------------ */
.theme-veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  background: #070b12;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.theme-veil.is-visible {
  opacity: 1;
  transition-duration: 0.2s;
  transition-timing-function: ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .theme-veil,
  .theme-veil.is-visible { transition-duration: 0.01ms; }
}
html.is-theme-fading .panel,
html.is-theme-fading .dock,
html.is-theme-fading #markers,
html.is-theme-fading .gesture-hint,
html.is-theme-fading .mobile-list-btn,
html.is-theme-fading .toast {
  opacity: 0 !important;
  transition: opacity 0.18s ease !important;
  pointer-events: none !important;
}
html.is-theme-fading-out .panel,
html.is-theme-fading-out .dock,
html.is-theme-fading-out #markers,
html.is-theme-fading-out .gesture-hint,
html.is-theme-fading-out .mobile-list-btn {
  transition: opacity 0.3s ease-out !important;
}
html.is-theme-fading .panel,
html.is-theme-fading .dock,
html.is-theme-fading-out .panel,
html.is-theme-fading-out .dock {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.is-theme-fading .panel,
html.is-theme-fading .dock,
html.is-theme-fading #markers,
html.is-theme-fading .gesture-hint,
html.is-theme-fading .mobile-list-btn,
html.is-theme-fading .toast {
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s !important;
}
html.is-theme-fading-out .toast { transition: opacity 0.3s ease-out !important; }
#globe-canvas { transition: opacity 0.18s ease; }
html.is-theme-fading #globe-canvas { opacity: 0.5; }
html.is-theme-fading-out #globe-canvas { opacity: 1; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.42s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
::view-transition-group(root) { animation-duration: 0.42s; }
::view-transition-image-pair(root) { isolation: auto; }
::view-transition-old(root) { animation-name: theme-view-old; }
::view-transition-new(root) { animation-name: theme-view-new; }
@keyframes theme-view-old { from { opacity: 1; } to { opacity: 0; } }
@keyframes theme-view-new { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.01ms; }
}

.city-picker {
  position: fixed;
  z-index: 80;
  min-width: 168px;
  max-width: 230px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.15s ease, transform 0.18s ease;
}
.city-picker.is-open { opacity: 1; transform: none; }
.city-picker-title {
  display: block;
  padding: 4px 8px 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
}
.city-picker button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.city-picker button:hover,
.city-picker button:focus-visible { background: var(--gold-soft); color: #18130c; outline: none; }
.city-picker button span { font-family: var(--serif); font-size: 14px; }
.city-picker button em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.12em;
}
.city-picker button:hover em,
.city-picker button:focus-visible em { color: rgba(24, 19, 12, 0.58); }

/* City gallery: cover entry + filmstrip inside the existing second-level sheet */
.cover-gallery {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(7, 11, 18, 0.58);
  color: #f2eee6;
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.8);
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.cover-gallery .icon { width: 12px; height: 12px; }
.cover-gallery em {
  color: var(--gold);
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.12em;
}
.cover-gallery:hover {
  border-color: rgba(216, 184, 120, 0.6);
  background: rgba(7, 11, 18, 0.76);
}
.spot-thumbs {
  display: flex;
  gap: 5px;
  margin-top: 18px;
  padding-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-soft) transparent;
}
.spot-thumbs[hidden] { display: none; }
.spot-thumb {
  position: relative;
  flex: 0 0 54px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d14;
  opacity: 0.52;
  cursor: pointer;
  transition: opacity 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.spot-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spot-thumb span {
  position: absolute;
  left: 5px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(5, 9, 14, 0.58);
  color: rgba(255, 247, 232, 0.9);
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1;
}
.spot-thumb.is-active {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(216, 184, 120, 0.24);
}
.spot-thumb:hover { opacity: 0.9; transform: translateY(-1px); }
html[data-theme="day"] .cover-gallery {
  border-color: rgba(27, 49, 58, 0.24);
  background: rgba(244, 247, 243, 0.78);
  color: #1c2d34;
}
html[data-theme="day"] .cover-gallery:hover { background: rgba(255, 255, 255, 0.9); }
html[data-theme="day"] .spot-thumb { border-color: rgba(27, 49, 58, 0.14); }
