/* Golden Hour — sunset-glass dark UI */
:root {
  --bg: #0b1026;
  --panel: rgba(16, 20, 46, 0.88);
  --panel-solid: #121736;
  --line: rgba(255, 255, 255, 0.09);
  --txt: #eef0fb;
  --muted: #9aa3c7;
  --accent: #ff8a50;
  --accent2: #ffd666;
  --grad: linear-gradient(135deg, #ff7e5f, #feb47b);
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: 'Pretendard Variable', Pretendard, -apple-system, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  overflow: hidden;
}
body.light {
  --bg: #f2f4fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --line: rgba(20, 30, 80, 0.10);
  --txt: #1a2040;
  --muted: #5b6488;
  --shadow: 0 10px 36px rgba(30, 40, 90, 0.18);
}
#map { position: fixed; inset: 0; z-index: 0; background: #0a0e20; }
body.light #map { background: #dfe6f2; }
#map.add-mode { cursor: crosshair; }

/* mode-driven map mood: warm dusk for sunset, cool-gold dawn for sunrise */
body.mode-sunset .leaflet-tile-pane { filter: sepia(0.26) saturate(1.25) hue-rotate(-14deg) brightness(0.9) contrast(1.03); }
body.mode-sunrise .leaflet-tile-pane { filter: saturate(1.1) hue-rotate(8deg) brightness(1.04); }
#map::after {
  content: ''; position: absolute; inset: 0;
  pointer-events: none; z-index: 450;
  transition: background 0.6s;
}
body.mode-sunset #map::after {
  background: linear-gradient(180deg, rgba(40, 28, 90, 0.16), rgba(190, 70, 90, 0.08) 55%, rgba(255, 130, 60, 0.16));
}
body.mode-sunrise #map::after {
  background: linear-gradient(180deg, rgba(120, 170, 255, 0.10), rgba(255, 215, 130, 0.14));
}

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; white-space: nowrap; }
.brand-ico { font-size: 22px; filter: drop-shadow(0 0 8px rgba(255, 138, 80, 0.7)); }
.brand-txt { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.search-box { position: relative; flex: 1; min-width: 120px; max-width: 420px; }
#search-input {
  width: 100%; padding: 9px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line); border-radius: 12px;
  outline: none; color: var(--txt);
}
body.light #search-input { background: rgba(20, 30, 80, 0.05); }
#search-input:focus { border-color: var(--accent); }
#search-results {
  position: absolute; top: 110%; left: 0; right: 0; z-index: 40;
  background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  display: none; overflow: hidden;
}
#search-results.show { display: block; }
.sr-item { padding: 10px 14px; cursor: pointer; font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; }
.sr-item span { color: var(--muted); font-size: 12px; }
.sr-item:hover { background: rgba(255, 138, 80, 0.12); }
.sr-geo { border-top: 1px solid var(--line); color: var(--accent2); }

#mode-toggle {
  display: flex; background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px;
}
#mode-toggle button {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px; color: var(--muted);
  font-weight: 700; font-size: 13.5px; transition: all 0.2s;
}
#mode-toggle button em { font-style: normal; }
#mode-toggle button.active { background: var(--grad); color: #2b1500; box-shadow: 0 2px 12px rgba(255, 126, 95, 0.45); }

#lang-select {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 6px; color: var(--txt); outline: none;
}
#lang-select option { color: #111; }

/* ---------- controls row ---------- */
#controls {
  position: fixed; top: 72px; left: 12px; right: 12px; z-index: 25;
  display: flex; justify-content: space-between; gap: 10px; pointer-events: none;
  flex-wrap: wrap;
}
#filters, #tools { display: flex; gap: 6px; pointer-events: auto; flex-wrap: wrap; }
.chip, .tool {
  padding: 7px 13px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: all 0.15s;
}
.chip.active { background: var(--grad); color: #2b1500; border-color: transparent; }
.chip:hover, .tool:hover { color: var(--txt); border-color: var(--accent); }
.tool { color: var(--txt); }
.tool.primary { background: var(--grad); color: #2b1500; font-weight: 800; border-color: transparent; }
.tool:disabled { opacity: 0.5; }

/* ---------- ticker ---------- */
#ticker {
  position: fixed; top: 122px; left: 12px; z-index: 24;
  display: none; align-items: center; gap: 6px; max-width: min(92vw, 760px);
  overflow-x: auto; scrollbar-width: none; padding: 4px;
}
#ticker.show { display: flex; }
#ticker::-webkit-scrollbar { display: none; }
.tk-label { font-size: 12px; font-weight: 800; color: var(--accent2); white-space: nowrap; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.tk-chip {
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 214, 102, 0.14); border: 1px solid rgba(255, 214, 102, 0.35);
  color: var(--txt); font-size: 12.5px; font-weight: 600; backdrop-filter: blur(8px);
}
.tk-chip:hover { background: rgba(255, 214, 102, 0.3); }

/* ---------- date bar ---------- */
#datebar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 25; width: min(92vw, 620px);
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 16px 12px;
}
#date-label { text-align: center; font-weight: 800; font-size: 14px; margin-bottom: 6px; color: var(--accent2); }
#date-slider {
  width: 100%; appearance: none; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #4a5fc1, #ff7e5f 45%, #feb47b 55%, #4a5fc1);
  outline: none;
}
#date-slider::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d8, #ffb347);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.9); cursor: grab; border: none;
}
#date-quick { display: flex; justify-content: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
#date-quick button {
  padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
#date-quick button:hover { color: var(--txt); border-color: var(--accent); }

/* ---------- markers ---------- */
.gh-pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  background: var(--panel-solid); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  position: relative; transform: rotate(-8deg);
  transition: transform 0.15s;
}
.gh-pin:hover { transform: rotate(-8deg) scale(1.15); }
.gh-pin.fame3 { border-color: var(--accent2); box-shadow: 0 0 14px rgba(255, 214, 102, 0.55); }
.gh-pin.user { border-color: #7dd3fc; }
.gh-pin.osm { border-color: #a3a3a3; opacity: 0.85; }
.gh-pin.temp, .gh-pin.adding { border-color: #f43f5e; font-size: 18px; }
.gh-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 17px; height: 17px; border-radius: 9px;
  font-size: 10.5px; font-weight: 900; line-height: 17px; text-align: center;
  color: #201000; background: var(--accent2); padding: 0 3px;
}
.gh-pin.grade-S { border-color: #ffd666; box-shadow: 0 0 16px rgba(255, 214, 102, 0.8); }
.gh-pin.grade-A { border-color: #ff9a5c; }
.gh-pin.grade-B { border-color: #c9a0ff; }
.gh-pin.grade-C .gh-badge, .gh-pin.grade-D .gh-badge { background: #8b93b8; color: #10142e; }
.gh-pin.grade-C, .gh-pin.grade-D { border-color: #5b6488; }
.gh-cluster {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffb347, #ff7043);
  color: #2b1500; font-weight: 900; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 5px rgba(255, 138, 80, 0.25), 0 4px 14px rgba(0, 0, 0, 0.45);
}
.gh-sunend { font-size: 22px; filter: drop-shadow(0 0 10px rgba(255, 170, 60, 0.9)); }
.gh-locate a { display: flex !important; align-items: center; justify-content: center; color: #333; }
.gh-locate.locating a svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gh-userdot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #4c9ffe; border: 2.5px solid #fff;
  box-shadow: 0 0 0 0 rgba(76, 159, 254, 0.55);
  animation: userpulse 2.2s ease-out infinite;
}
@keyframes userpulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 159, 254, 0.55); }
  70% { box-shadow: 0 0 0 16px rgba(76, 159, 254, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 159, 254, 0); }
}
.pop-analyze {
  background: var(--grad); color: #2b1500; font-weight: 800;
  padding: 8px 14px; border-radius: 10px; font-size: 13px;
}
.leaflet-popup-content-wrapper { background: var(--panel-solid); color: var(--txt); border-radius: 12px; }
.leaflet-popup-tip { background: var(--panel-solid); }

/* collapsed attribution: small (i) chip, expands on tap */
.gh-attr {
  position: relative; overflow: hidden; cursor: pointer;
  width: 24px; height: 24px; border-radius: 12px;
  padding: 0 !important; opacity: 0.7;
  background: var(--panel) !important; color: transparent !important;
  white-space: nowrap; transition: width 0.25s, color 0.2s;
}
.gh-attr::before {
  content: 'ⓘ'; position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; line-height: 24px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.gh-attr.open {
  width: auto; max-width: 88vw; height: auto; min-height: 24px;
  padding: 3px 10px 3px 24px !important; border-radius: 12px;
  color: var(--muted) !important;
}
.gh-attr a { color: var(--muted); }
.gh-attr:not(.open) a { pointer-events: none; }

/* ---------- detail panel ---------- */
#panel {
  position: fixed; top: 72px; right: 12px; bottom: 18px; z-index: 28;
  width: min(430px, calc(100vw - 24px));
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(calc(100% + 24px)); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1);
}
#panel.open { transform: none; }
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

.p-grab { display: none; }
.p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.p-title h2 { font-size: 21px; font-weight: 900; line-height: 1.25; }
.p-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.p-close {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 14px;
}
.p-close:hover { color: var(--txt); background: rgba(255, 255, 255, 0.14); }
.p-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.p-badges .chip { font-size: 11.5px; padding: 4px 10px; cursor: default; }
.p-badges .chip.best-sunset { border-color: rgba(255, 138, 80, 0.6); color: #ffb38a; }
.p-badges .chip.best-sunrise { border-color: rgba(255, 214, 102, 0.6); color: var(--accent2); }
.p-badges .chip.fame { color: var(--accent2); }
.p-badges .chip.user { color: #7dd3fc; border-color: rgba(125, 211, 252, 0.5); }
.warn-banner {
  margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px;
  background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.4); color: #fda4af;
}
.p-desc { margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--txt); opacity: 0.92; }
.p-countdown { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--accent2); min-height: 18px; }

.p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.act {
  display: flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 8px; border-radius: 11px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  color: var(--txt); text-decoration: none; text-align: center;
}
.act:hover { border-color: var(--accent); }
.act span { font-size: 15px; }
.act.disabled { opacity: 0.4; pointer-events: none; cursor: default; }

.p-sec { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.sec-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.sec-head h3 { font-size: 14.5px; font-weight: 800; }

.times-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tcell { background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; }
.tlabel { font-size: 11px; color: var(--muted); font-weight: 600; }
.tval { font-size: 16.5px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.textra { font-size: 11px; color: var(--accent2); margin-top: 2px; }
.tz-note { margin-top: 7px; font-size: 11px; color: var(--muted); }
.polar { padding: 12px; text-align: center; font-weight: 700; color: var(--accent2); }

/* analysis */
.ana-progress .bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 8px; }
.ana-progress .fill { height: 100%; background: var(--grad); border-radius: 4px; transition: width 0.25s; }
.score-wrap { display: flex; gap: 14px; align-items: center; }
.score-ring {
  flex: none; width: 92px; height: 92px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(closest-side, var(--panel-solid) 74%, transparent 75% 100%),
    conic-gradient(#ff8a50 calc(var(--pct) * 1%), rgba(255, 255, 255, 0.09) 0);
}
.score-ring.grade-S { background: radial-gradient(closest-side, var(--panel-solid) 74%, transparent 75% 100%), conic-gradient(#ffd666 calc(var(--pct) * 1%), rgba(255, 255, 255, 0.09) 0); }
.score-num { font-size: 26px; font-weight: 900; line-height: 1; }
.score-grade { font-size: 12px; font-weight: 800; color: var(--accent2); margin-top: 2px; }
.score-facts { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.grade-label { font-weight: 800; font-size: 14px; }
.fact { font-size: 12.5px; color: var(--muted); }
.fact b { color: var(--txt); }
.fact.good { color: #86efac; }
.fact.lost { color: #fda4af; }
.months { margin-top: 12px; }
.months-label { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.months-row { display: flex; gap: 3px; flex-wrap: wrap; }
.month {
  padding: 3.5px 8px; border-radius: 7px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.05); color: var(--muted); border: 1px solid transparent;
}
.month.open { background: rgba(255, 179, 71, 0.16); color: var(--accent2); border-color: rgba(255, 179, 71, 0.4); }
.month.closed { opacity: 0.55; text-decoration: line-through; }

.mini-btn {
  margin-top: 12px; padding: 8px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); color: var(--txt);
  display: inline-flex; align-items: center; gap: 6px;
}
.mini-btn:hover { border-color: var(--accent); }
.mini-btn.primary { background: var(--grad); color: #2b1500; border: none; }

/* panorama */
.pano-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0a0d20; }
.pano-canvas { width: 100%; height: 215px; display: block; }
.pano-btns { display: flex; gap: 6px; }
.pano-btns .mini-btn { margin-top: 8px; }
.pano-hint { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.45; }

/* weather */
.wx-score { display: flex; align-items: center; gap: 12px; }
.wx-num { font-size: 34px; font-weight: 900; }
.wx-num.q-epic { color: #ff7e5f; } .wx-num.q-great { color: var(--accent2); }
.wx-num.q-good { color: #93c5fd; } .wx-num.q-meh { color: var(--muted); } .wx-num.q-poor { color: #64748b; }
.wx-label { font-weight: 800; font-size: 14px; }
.wx-details { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* votes */
.vote-row { display: flex; gap: 8px; margin-top: 18px; }
.vote-btn {
  flex: 1; padding: 11px; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--txt);
}
.vote-btn b { margin-left: 4px; }
.vote-btn.up.active { background: rgba(134, 239, 172, 0.15); border-color: #86efac; }
.vote-btn.down.active { background: rgba(244, 63, 94, 0.14); border-color: #fda4af; }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.photo-add { cursor: pointer; }

/* comments */
.cm-list { display: flex; flex-direction: column; gap: 10px; }
.cm-item { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.cm-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.cm-meta b { color: var(--accent2); }
.cm-body { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.cm-translate { margin-top: 6px; font-size: 11px; color: #93c5fd; }
.cm-translated { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.cm-form { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.cm-nick, .cm-text {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; outline: none; color: var(--txt); resize: vertical;
}
.cm-nick:focus, .cm-text:focus { border-color: var(--accent); }
.cm-form .mini-btn { margin-top: 2px; align-self: flex-end; }

/* ---------- add form ---------- */
#addform {
  position: fixed; top: 130px; left: 12px; z-index: 29;
  width: min(320px, calc(100vw - 24px));
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: none; flex-direction: column; gap: 8px;
}
#addform.show { display: flex; }
#addform h3 { font-size: 15px; }
#addform input, #addform textarea, #addform select {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; outline: none; color: var(--txt); width: 100%;
}
#addform .row { display: flex; gap: 8px; align-items: flex-end; }
#addform label { flex: 1; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
#addform .mini-btn { margin-top: 4px; flex: 1; justify-content: center; }

/* ---------- hero ---------- */
#hero {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% 110%, rgba(255, 126, 95, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(6, 8, 24, 0.94), rgba(10, 14, 34, 0.96));
  backdrop-filter: blur(6px);
}
#hero.show { display: flex; }
.hero-inner { max-width: 640px; padding: 32px; text-align: center; }
.hero-logo { font-size: 64px; filter: drop-shadow(0 0 30px rgba(255, 138, 80, 0.8)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero-inner h1 {
  font-size: clamp(24px, 4.5vw, 38px); font-weight: 900; line-height: 1.3; margin-top: 14px;
  background: linear-gradient(120deg, #fff, #ffd666 55%, #ff8a50); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-inner p { color: #b8c0e0; margin-top: 14px; font-size: 15px; line-height: 1.6; }
.hero-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.feat {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; padding: 14px 10px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: #b8c0e0;
}
.feat b { font-size: 13px; color: #fff; }
#hero-cta {
  margin-top: 28px; padding: 14px 42px; border-radius: 999px;
  background: var(--grad); color: #2b1500; font-size: 16px; font-weight: 900;
  box-shadow: 0 8px 30px rgba(255, 126, 95, 0.5); transition: transform 0.15s;
}
#hero-cta:hover { transform: scale(1.05); }

/* ---------- lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  background: rgba(4, 6, 18, 0.92); backdrop-filter: blur(6px);
  cursor: zoom-out;
}
#lightbox.show { display: flex; }
#lightbox img {
  max-width: 94vw; max-height: 92vh;
  border-radius: 12px; box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
}
#lightbox .lb-close {
  position: absolute; top: 16px; right: 18px;
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 17px;
}

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: all 0.3s; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  #topbar { flex-wrap: wrap; padding: 8px 10px; gap: 7px; }
  .brand-txt { display: none; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; }
  #controls { top: 124px; flex-direction: column; align-items: flex-start; gap: 8px; }
  #controls #tools .tool span { display: none; }
  #ticker { top: 208px; }
  /* lift bottom map controls to sit ~15px above the date bar */
  .leaflet-bottom.leaflet-right { margin-bottom: 106px; }
  .leaflet-bottom.leaflet-left { margin-bottom: 116px; }
  #panel {
    top: auto; left: 8px; right: 8px; bottom: 0; width: auto;
    max-height: 62vh; border-radius: 18px 18px 0 0;
    transform: translateY(105%);
    padding-top: 8px;
  }
  #panel.open { transform: none; }
  .p-grab {
    display: block; width: 44px; height: 5px; border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 auto 10px;
  }
  body.light .p-grab { background: rgba(20, 30, 80, 0.25); }
  #datebar { bottom: 8px; width: calc(100vw - 16px); padding: 8px 12px 10px; }
  .hero-feats { grid-template-columns: 1fr; }
  .p-actions { grid-template-columns: 1fr 1fr; }
}
