:root {
  --ink: #12221c;
  --muted: #687a72;
  --paper: #f2f7f4;
  --panel: #fbfefc;
  --line: #d5e2dc;
  --green: #17845d;
  --green-dark: #0b6344;
  --yellow: #ffb84d;
  --red: #e25f55;
  --blue: #347bd1;
  --glow: #68e0ae;
  --shadow: 0 20px 60px rgba(13, 45, 32, .15);
  --left-panel-width: 290px;
  --right-panel-width: 330px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { height: 100%; display: grid; grid-template-rows: 72px 1fr; }
.topbar {
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 249, .96);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: white; background: var(--green); border-radius: 11px;
  font-family: Georgia, serif; font-weight: 800; font-style: italic;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.brand-logo {
  width: 38px; height: 38px; object-fit: cover; border-radius: 11px;
  box-shadow: 0 0 22px rgba(45, 218, 149, .3), inset 0 0 0 1px rgba(255,255,255,.24);
}
.brand strong { display: block; font: 700 18px/1 Georgia, serif; letter-spacing: -.2px; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: 1.9px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; margin-right: 18px; }
.topbar-actions a {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 13px;
  color: #cceee0; border: 1px solid rgba(91,215,164,.24); border-radius: 11px;
  background: rgba(12,48,35,.72); text-decoration: none; font-size: 11px; font-weight: 800;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.topbar-actions a:hover {
  color: white; border-color: rgba(99,239,181,.68); transform: translateY(-2px);
  filter: brightness(1.2); box-shadow: 0 0 24px rgba(55,221,154,.2);
}
.topbar-actions a.unconfigured {
  opacity: .52; cursor: not-allowed; filter: saturate(.45);
}
.topbar-actions a.unconfigured:hover {
  border-color: rgba(122,156,141,.28); transform: none;
  filter: saturate(.45); box-shadow: none;
}
.topbar-actions .discord-link {
  border-color: rgba(115,132,255,.34);
  background: linear-gradient(135deg, rgba(70,86,190,.72), rgba(38,43,111,.82));
}
.product-link-icon, .discord-link-icon {
  display: block; width: 22px; height: 22px; border-radius: 7px; object-fit: cover;
  box-shadow: 0 0 14px rgba(73,222,159,.18);
}
.discord-link-icon { border-radius: 50%; box-shadow: 0 0 14px rgba(105,119,255,.28); }
.status-pill {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 12px;
}
.status-pill i { width: 7px; height: 7px; background: var(--yellow); border-radius: 50%; }
.status-pill.online i { background: #38a86f; box-shadow: 0 0 0 4px rgba(56,168,111,.12); }
.status-pill.offline i { background: var(--red); }

.workspace { min-height: 0; display: grid; grid-template-columns: var(--left-panel-width) 1fr; }
.control-panel {
  z-index: 900; overflow-y: auto; padding: 34px 24px 28px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(23,132,93,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,132,93,.025) 1px, transparent 1px),
    var(--panel);
  background-size: 24px 24px;
}
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 2px; }
h1 { margin: 13px 0 14px; font: 500 36px/1.08 Georgia, "Noto Serif SC", serif; letter-spacing: -1px; }
h1 em { color: var(--green); font-weight: inherit; }
.intro { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.control-group { margin-top: 31px; }
.label-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; }
.label-row strong { color: var(--green); font-size: 12px; }
input[type="range"] { width: 100%; margin: 16px 0 4px; accent-color: var(--green); }
.range-labels { display: flex; justify-content: space-between; color: #96a19b; font-size: 10px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.group-title { display: block; font-size: 13px; font-weight: 700; }
.result-limit { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 750; }
.result-limit select {
  padding: 5px 24px 5px 8px; color: var(--green-dark); border: 1px solid #9ccab5;
  border-radius: 8px; outline: none; background: #effaf4; font-size: 11px; font-weight: 850;
}
.result-limit select:hover, .result-limit select:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,132,93,.12);
}
.layer-grid { display: grid; gap: 8px; }
.layer-card {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px;
  min-height: 58px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fafbf8; opacity: .55; transition: .18s ease;
}
.layer-card.active { opacity: 1; box-shadow: 0 7px 20px rgba(28,51,39,.08); }
.layer-card.pokemon.active { color: #075a3b; border-color: #68c69d; background: linear-gradient(110deg, #dff8eb, #f7fffb); }
.layer-card.raid.active { color: #963b34; border-color: #ee9f98; background: linear-gradient(110deg, #ffe7e3, #fff9f8); }
.layer-card.quest.active { color: #225ca5; border-color: #8bb9ee; background: linear-gradient(110deg, #e6f1ff, #f8fbff); }
.layer-card.active:hover { border-color: #8ec5ad; box-shadow: 0 7px 22px rgba(23,132,93,.11); transform: translateX(2px); }
.layer-card input { position: absolute; opacity: 0; pointer-events: none; }
.layer-icon { display: grid; place-items: center; width: 34px; height: 34px; color: white; border-radius: 10px; font-weight: 900; }
.layer-card.pokemon .layer-icon { background: var(--green); }
.layer-card.raid .layer-icon { background: var(--red); }
.layer-card.quest .layer-icon { background: var(--blue); }
.layer-card b, .layer-card small { display: block; }
.layer-card b { font-size: 12px; }
.layer-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.layer-card > strong { min-width: 25px; text-align: right; font-size: 13px; }
.primary-button, .secondary-button { width: 100%; border: 0; border-radius: 12px; font-weight: 750; }
.primary-button {
  display: flex; justify-content: space-between; align-items: center; margin-top: 28px;
  padding: 14px 16px; color: white; background: var(--green);
  box-shadow: 0 9px 22px rgba(46,125,90,.23);
}
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .7; }
.primary-button kbd { padding: 2px 7px; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.25); border-radius: 5px; font-size: 11px; }
.secondary-button { margin-top: 8px; padding: 12px; color: var(--green); background: #edf4ef; }
.hotspot-button {
  width: 100%; margin-top: 8px; padding: 11px; color: #76551d;
  border: 1px solid #ead8ae; border-radius: 12px; background: #fff8e8; font-weight: 750;
}
.hotspot-button.active {
  color: white; border-color: #d39428; background: linear-gradient(135deg, #f0aa31, #c87913);
  box-shadow: 0 8px 22px rgba(200,121,19,.28);
}
.selection-card { margin-top: 22px; padding: 15px; border: 1px dashed #cbd8cf; border-radius: 12px; }
.selection-card span, .selection-card small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .4px; }
.selection-card strong { display: block; margin: 6px 0 5px; font: 600 14px/1.2 ui-monospace, SFMono-Regular, monospace; }

.map-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#map { width: 100%; height: 100%; background: #dfe9df; }
.map-tip, .loading-card, .error-card, .result-drawer {
  z-index: 700; position: absolute; background: rgba(255,254,249,.95); backdrop-filter: blur(12px);
  border: 1px solid rgba(203,216,207,.9); box-shadow: var(--shadow);
}
.map-tip { top: 18px; left: 50%; transform: translateX(-50%); padding: 9px 14px; border-radius: 999px; color: var(--muted); font-size: 11px; }
.recenter-button {
  z-index: 710; position: absolute; top: 158px; right: 10px; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; color: #d8fff0;
  border: 1px solid rgba(91,235,175,.55); border-radius: 10px;
  background: rgba(6,35,25,.92); box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 0 18px rgba(49,213,143,.15);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.recenter-button:hover, .recenter-button:focus-visible {
  color: white; border-color: #62f0b5; outline: none;
  background: linear-gradient(145deg, #1aa973, #08744e);
  box-shadow: 0 0 26px rgba(69,229,163,.4);
}
.center-marker-focus { animation: center-focus .9s ease-out; }
@keyframes center-focus {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(80,255,180,0)); }
  45% { filter: drop-shadow(0 0 13px #50ffb4); transform: scale(1.6); }
}
.loading-card {
  top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center;
  gap: 13px; padding: 17px 20px; border-radius: 14px;
}
.loading-card[hidden], .error-card[hidden] { display: none; }
.loading-card strong, .loading-card small { display: block; }
.loading-card strong { font-size: 12px; }
.loading-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.spinner { width: 25px; height: 25px; border: 3px solid #dbe7dd; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-card { top: 20px; right: 20px; max-width: 350px; padding: 13px 15px; color: #8d3028; border-color: #efc1ba; border-radius: 11px; font-size: 12px; }
.result-drawer {
  right: 20px; bottom: 20px; left: 20px; display: flex; align-items: center;
  justify-content: space-between; padding: 15px 18px; border-radius: 14px;
}
.result-drawer strong { display: block; margin-top: 5px; font: 500 17px/1.2 Georgia, serif; }
.legend { display: flex; gap: 15px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.pokemon { background: var(--green); }
.dot.raid { background: var(--red); }
.dot.quest { background: var(--blue); }

.map-marker { position: relative; display: grid; place-items: center; width: 46px; height: 46px; }
.map-marker::after {
  content: ""; position: absolute; inset: 5px; border: 3px solid white; border-radius: 50%;
  box-shadow: 0 3px 9px rgba(20,38,29,.3);
}
.map-marker img {
  z-index: 2; width: 35px; height: 35px; object-fit: cover; border-radius: 50%;
  opacity: 0; transform: scale(.82); transition: opacity .18s ease, transform .18s ease;
}
.map-marker img.loaded { opacity: 1; transform: scale(1); }
.map-marker img.loaded + .fallback { display: none; }
.map-marker .fallback { z-index: 1; color: white; font-size: 11px; font-weight: 900; }
.map-marker.pokemon { background: var(--green); border-radius: 50%; }
.map-marker.raid { background: var(--red); border-radius: 50%; }
.map-marker.quest { background: var(--blue); border-radius: 50%; }
.center-marker { width: 18px; height: 18px; background: #3177d6; border: 4px solid white; border-radius: 50%; box-shadow: 0 2px 10px rgba(24,64,115,.55); }
.leaflet-popup-content-wrapper { border-radius: 13px; box-shadow: 0 10px 32px rgba(20,38,29,.18); }
.leaflet-popup-content { margin: 14px 16px; }
.popup-title { margin: 0 0 7px; font-size: 14px; }
.popup-hero { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.popup-hero img { width: 48px; height: 48px; object-fit: contain; border-radius: 12px; background: #eef6f1; }
.popup-hero small { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.popup-hero .popup-title { margin: 3px 0 0; }
.popup-egg, .popup-quest {
  display: grid; place-items: center; width: 44px; height: 44px; color: white;
  border-radius: 13px; background: var(--red); font-size: 10px; font-weight: 900;
}
.popup-quest { background: var(--blue); font-size: 16px; }
.popup-place { margin: 9px 0; color: var(--muted); font-size: 10px; }
.popup-location-photo {
  display: block; width: 100%; height: 104px; margin: 8px 0 10px;
  object-fit: cover; border: 1px solid rgba(81,187,143,.2); border-radius: 11px;
  background: #eaf2ed;
}
.popup-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; min-width: 185px; font-size: 11px; }
.popup-meta span:nth-child(odd) { color: var(--muted); }
.popup-coordinates {
  margin-top: 11px; padding: 8px 9px; color: #315447; border: 1px dashed #b9cec3;
  border-radius: 8px; background: #f6faf7; font: 600 10px/1 ui-monospace, SFMono-Regular, monospace;
}
.popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.popup-actions button, .popup-actions a {
  padding: 8px; border-radius: 8px; font-size: 9px; font-weight: 850; text-align: center; text-decoration: none;
}
.popup-actions button { color: var(--green); border: 1px solid #bad2c5; background: white; }
.popup-actions a { color: white; border: 1px solid var(--green); background: var(--green); }
.scan-location-popup .leaflet-popup-content { margin: 15px; }
.scan-location-popup .leaflet-popup-content-wrapper { overflow: hidden; }
.scan-popup { width: 330px; max-width: 100%; box-sizing: border-box; }
.scan-popup > small { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: 1.4px; }
.scan-popup h3 { margin: 7px 0 12px; font: 600 21px/1.15 Georgia, serif; }
.scan-popup-coordinates {
  padding: 11px 12px; color: #315447; border: 1px dashed #b9cec3; border-radius: 10px;
  background: #f6faf7; font: 600 12px/1 ui-monospace, SFMono-Regular, monospace;
}
.scan-layer-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.scan-layer-option {
  padding: 12px 7px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 10px; background: white; font-size: 11px; font-weight: 850;
}
.scan-layer-option.pokemon.selected,
.scan-layer-option.spawns.selected {
  color: white; border-color: #08734e; background: linear-gradient(135deg, #20a875, #08734e);
  box-shadow: 0 5px 13px rgba(8,115,78,.23);
}
.scan-layer-option.raids.selected {
  color: white; border-color: #be4038; background: linear-gradient(135deg, #ee756b, #be4038);
  box-shadow: 0 5px 13px rgba(190,64,56,.23);
}
.scan-layer-option.quests.selected {
  color: white; border-color: #286dc1; background: linear-gradient(135deg, #599de8, #286dc1);
  box-shadow: 0 5px 13px rgba(40,109,193,.23);
}
.scan-popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.scan-popup-actions button {
  padding: 12px 8px; border-radius: 10px; font-size: 11px; font-weight: 850;
}
.scan-popup-actions button:first-child { color: var(--green); border: 1px solid #bad2c5; background: white; }
.scan-popup-actions button:last-child { color: white; border: 1px solid #163f31; background: #163f31; }
.toast {
  position: fixed; z-index: 3000; right: 24px; bottom: 24px; padding: 12px 16px;
  color: white; border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
  background: rgba(12,45,32,.94); box-shadow: var(--shadow); font-size: 11px; font-weight: 750;
}
.toast[hidden] { display: none; }

.hotspot-panel[hidden] { display: none; }
.hotspot-panel {
  position: fixed; z-index: 1200; top: 72px; right: 0; bottom: 0;
  width: var(--right-panel-width); pointer-events: none;
}
.hotspot-sheet {
  position: absolute; inset: 0; overflow: auto; padding: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(104,224,174,.12), transparent 34%),
    rgba(251,254,252,.98);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(13,30,21,.12); pointer-events: auto;
}
.map-stage { transition: margin-right .22s ease; }
body.hotspots-open .map-stage { margin-right: var(--right-panel-width); }
.hotspot-sheet header { display: flex; justify-content: space-between; gap: 20px; }
.hotspot-sheet h2 { margin: 7px 0 5px; font: 500 29px/1.1 Georgia, serif; }
.hotspot-sheet header p { margin: 0; color: var(--muted); font-size: 11px; }
.close-button {
  flex: 0 0 auto; width: 34px; height: 34px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 21px;
}
.hotspot-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 23px 0 18px; padding: 4px; background: #eef2ec; border-radius: 12px; }
.hotspot-tabs button { padding: 9px; color: var(--muted); border: 0; border-radius: 9px; background: transparent; font-size: 11px; font-weight: 800; }
.hotspot-tabs button.active {
  color: white; background: linear-gradient(135deg, #119b6a, #08734e);
  box-shadow: 0 5px 16px rgba(23,132,93,.28);
}
.hotspot-tabs button[data-hotspot-layer="raids"].active {
  background: linear-gradient(135deg, #ef756b, #c7443c);
  box-shadow: 0 5px 16px rgba(199,68,60,.28);
}
.hotspot-tabs button[data-hotspot-layer="quests"].active {
  background: linear-gradient(135deg, #599de8, #286dc1);
  box-shadow: 0 5px 16px rgba(40,109,193,.28);
}
.hotspot-mode-tabs { display: flex; gap: 18px; margin: -7px 2px 15px; border-bottom: 1px solid var(--line); }
.hotspot-mode-tabs button {
  padding: 9px 1px; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
  background: transparent; font-size: 11px; font-weight: 800;
}
.hotspot-mode-tabs button.active {
  color: #08734e; border-bottom-color: #19a46f; background: linear-gradient(180deg, transparent, rgba(25,164,111,.09));
}
.hotspot-loading, .hotspot-error { padding: 25px; color: var(--muted); text-align: center; font-size: 12px; }
.hotspot-error { color: #8d3028; }
.country-list { display: grid; gap: 12px; }
.country-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.country-card:hover { border-color: #a9cabb; box-shadow: 0 8px 22px rgba(23,132,93,.08); }
.country-card.open { border-color: #5fbe94; box-shadow: 0 10px 28px rgba(23,132,93,.12); }
.country-card.open .country-head { color: #075a3b; background: linear-gradient(110deg, #ddf7e9, #f4fff9); }
.country-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 15px;
  color: var(--ink); border: 0; background: white; text-align: left;
}
.country-head span { display: flex; align-items: center; gap: 10px; }
.country-head b { font-size: 13px; }
.country-head small { color: var(--muted); font-size: 10px; }
.country-spots { display: none; padding: 0 9px 9px; }
.country-card.open .country-spots { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.spot-button {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 11px;
  color: var(--ink); border: 1px solid #e7ece5; border-radius: 10px; background: #f9fbf8; text-align: left;
}
.spot-button:hover { border-color: #aac6b4; background: #f1f7f2; }
.spot-button.selected {
  color: white; border-color: #08734e; background: linear-gradient(135deg, #159b6c, #086747);
  box-shadow: 0 7px 18px rgba(8,103,71,.25);
}
.spot-button.selected strong, .spot-button.selected small { color: white; }
.spot-button b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.spot-button strong { grid-row: span 2; align-self: center; color: var(--green); font-size: 13px; }
.spot-button small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.trending-intro { display: flex; align-items: center; justify-content: space-between; margin: 2px 1px 10px; }
.trending-intro span { color: var(--muted); font-size: 10px; }
.trend-list { display: grid; gap: 8px; }
.trend-card {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px; color: var(--ink); border: 1px solid var(--line);
  border-radius: 13px; background: white; text-align: left;
}
.trend-card:hover { border-color: #aac6b4; transform: translateX(-2px); }
.trend-card:focus, .trend-card:active {
  color: #063c29; border-color: #34ac7b; outline: 3px solid rgba(52,172,123,.16);
  background: #e4f8ed;
}
.trend-rank {
  display: grid; place-items: center; width: 34px; height: 34px; color: var(--green);
  background: #edf4ef; border-radius: 10px; font: 700 13px/1 Georgia, serif;
}
.trend-card img { width: 38px; height: 38px; object-fit: contain; }
.trend-card b, .trend-card small { display: block; }
.trend-card b { font-size: 12px; }
.trend-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.trend-card strong { color: var(--green); font-size: 14px; }
.trend-back {
  margin-bottom: 12px; padding: 8px 11px; color: var(--green); border: 1px solid #cbd8cf;
  border-radius: 9px; background: #f4f8f4; font-size: 10px; font-weight: 800;
}

@media (max-width: 760px) {
  .app-shell { grid-template-rows: 58px 1fr; }
  .topbar { padding: 0 15px; }
  .brand span { display: none; }
  .topbar-actions { gap: 5px; margin: 0 6px; }
  .topbar-actions a { min-height: 34px; padding: 0 8px; font-size: 9px; }
  .topbar-actions a > span:last-child { display: none; }
  .status-pill { padding: 8px; }
  .status-pill span { display: none; }
  .workspace { display: block; position: relative; height: 100%; }
  .map-stage { position: absolute; inset: 0; height: 100%; }
  .control-panel {
    position: absolute; z-index: 1000; right: 10px; bottom: 10px; left: 10px;
    max-height: 43%; padding: 18px; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow);
  }
  h1 { display: none; }
  .intro, .selection-card { display: none; }
  .control-group { margin-top: 14px; }
  .layer-grid { grid-template-columns: repeat(3, 1fr); }
  .layer-card { grid-template-columns: 28px 1fr; min-height: 48px; padding: 7px; }
  .layer-card > strong, .layer-card small { display: none; }
  .layer-icon { width: 28px; height: 28px; border-radius: 8px; }
  .primary-button, .secondary-button { width: calc(50% - 4px); display: inline-flex; justify-content: center; }
  .secondary-button { margin-left: 4px; }
  .hotspot-button { display: none; }
  .primary-button kbd { display: none; }
  .result-drawer { right: 10px; bottom: calc(43% + 20px); left: 10px; }
  .legend { display: none; }
  .hotspot-panel { z-index: 2100; top: 0; width: 100%; }
  .hotspot-sheet { width: 100%; padding: 20px; border-left: 0; }
  body.hotspots-open .map-stage { margin-right: 0; }
  .country-card.open .country-spots { grid-template-columns: 1fr; }
}

body {
  background: #06100d;
}
.topbar {
  color: #eafff6;
  border-bottom: 1px solid rgba(93, 255, 188, .28);
  background:
    linear-gradient(90deg, rgba(29, 200, 133, .12), transparent 28%),
    rgba(5, 17, 13, .96);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25), inset 0 -1px rgba(103, 255, 193, .08);
}
.brand-mark {
  background: linear-gradient(145deg, #24bb7f, #08724d);
  box-shadow: 0 0 24px rgba(45, 218, 149, .32), inset 0 0 0 1px rgba(255,255,255,.25);
}
.brand small { color: #78a895; }
.status-pill {
  color: #a8c9bc; border-color: rgba(104, 218, 170, .25);
  background: rgba(12, 38, 29, .75); box-shadow: inset 0 0 18px rgba(39,173,117,.06);
}
.status-pill.online { color: #c7f8e3; border-color: rgba(76, 221, 154, .38); }

.control-panel {
  color: #dff8ed;
  border-right: 1px solid rgba(89, 235, 174, .28);
  background:
    linear-gradient(rgba(74, 202, 148, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 202, 148, .045) 1px, transparent 1px),
    radial-gradient(circle at 0 0, rgba(32, 176, 115, .16), transparent 34%),
    #081712;
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: 12px 0 35px rgba(1, 12, 8, .32), inset -1px 0 rgba(137,255,205,.06);
}
.control-panel::before {
  content: ""; display: block; height: 2px; margin: -20px 0 25px;
  background: linear-gradient(90deg, #35df9b, transparent);
  box-shadow: 0 0 14px rgba(53,223,155,.5);
}
.eyebrow { color: #53e5a8; text-shadow: 0 0 14px rgba(83,229,168,.28); }
h1 { color: #effff8; }
h1 em { color: #54e4a8; text-shadow: 0 0 24px rgba(84,228,168,.2); }
.intro, .range-labels, .selection-card span, .selection-card small { color: #82a294; }
.label-row strong { color: #53e5a8; }
input[type="range"] { accent-color: #37da96; }
.control-group + .control-group {
  padding-top: 23px; border-top: 1px solid rgba(130, 196, 168, .15);
}
.layer-card {
  border-color: rgba(148, 193, 173, .16); background: rgba(17, 42, 32, .72);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.layer-card b { color: #eafff6; }
.layer-card small { color: #759889; }
.layer-card.pokemon.active {
  color: #caffea; border-color: #2fc987;
  background: linear-gradient(110deg, rgba(25,144,95,.62), rgba(12,58,42,.88));
  box-shadow: 0 0 22px rgba(47,201,135,.16), inset 3px 0 #51e3a7;
}
.layer-card.raid.active {
  color: #ffe9e6; border-color: #ee7066;
  background: linear-gradient(110deg, rgba(159,58,53,.66), rgba(68,28,27,.9));
  box-shadow: 0 0 22px rgba(238,112,102,.15), inset 3px 0 #ff8d84;
}
.layer-card.quest.active {
  color: #eaf4ff; border-color: #5a9fe9;
  background: linear-gradient(110deg, rgba(42,101,173,.67), rgba(20,45,78,.9));
  box-shadow: 0 0 22px rgba(90,159,233,.16), inset 3px 0 #7eb9fa;
}
.layer-card.active:hover {
  transform: translateX(5px); filter: brightness(1.18);
  box-shadow: 0 0 26px rgba(71,224,160,.22);
}
.primary-button {
  border: 1px solid rgba(103,255,193,.25);
  background: linear-gradient(135deg, #20a66f, #08704c);
  box-shadow: 0 10px 25px rgba(0,0,0,.25), 0 0 22px rgba(32,166,111,.16);
}
.primary-button:hover { background: linear-gradient(135deg, #36d895, #07915e); box-shadow: 0 0 28px rgba(54,216,149,.28); }
.secondary-button {
  color: #9de5c5; border: 1px solid rgba(90,199,153,.14); background: rgba(21,57,43,.65);
}
.secondary-button:hover { color: white; border-color: #49d79a; background: rgba(32,130,89,.65); }
.hotspot-button {
  color: #ffd990; border-color: rgba(255,189,67,.38); background: rgba(91,62,17,.35);
}
.hotspot-button:hover { color: white; background: linear-gradient(135deg, #efad39, #bb6e0d); box-shadow: 0 0 24px rgba(239,173,57,.2); }
.selection-card {
  border-color: rgba(102,191,153,.25); background: rgba(6,24,17,.52);
  box-shadow: inset 0 0 24px rgba(50,176,120,.035);
}
.selection-card strong { color: #d9f9eb; }

.map-tip {
  color: #bfe3d3; border-color: rgba(95,221,167,.27);
  background: rgba(5,22,15,.88); box-shadow: 0 8px 28px rgba(0,0,0,.24), 0 0 18px rgba(43,194,130,.1);
}
.result-drawer {
  color: #eafff6; border-color: rgba(84,224,164,.3);
  background:
    linear-gradient(90deg, rgba(27,155,103,.17), transparent 36%),
    rgba(5,20,14,.92);
  box-shadow: 0 16px 45px rgba(0,0,0,.3), inset 0 1px rgba(115,255,198,.08);
}
.result-drawer strong { color: #f0fff8; }
.legend { color: #96b5a7; }

.hotspot-sheet {
  color: #def8eb;
  border-left: 1px solid rgba(82, 231, 169, .32);
  background:
    linear-gradient(rgba(72,200,146,.035) 1px, transparent 1px),
    radial-gradient(circle at 100% 0, rgba(39,211,139,.16), transparent 36%),
    #081712;
  background-size: 22px 22px, auto, auto;
  box-shadow: -18px 0 50px rgba(0,0,0,.4), inset 1px 0 rgba(113,255,196,.08);
}
.hotspot-sheet h2 { color: #f1fff8; }
.hotspot-sheet header p, .trending-intro span { color: #7fa092; }
.hotspot-meta {
  margin-top: 10px; color: #65dfaa; font-size: 9px; font-weight: 750;
  letter-spacing: .2px; text-shadow: 0 0 14px rgba(83,229,168,.2);
}
.close-button {
  color: #9cc7b4; border-color: rgba(131,205,174,.25); background: rgba(9,31,22,.8);
}
.close-button:hover { color: white; border-color: #55e1a5; background: #176d4d; box-shadow: 0 0 18px rgba(85,225,165,.2); }
.hotspot-tabs { background: rgba(4,21,14,.72); border: 1px solid rgba(104,184,151,.13); }
.hotspot-tabs button { color: #749588; }
.hotspot-mode-tabs { border-bottom-color: rgba(126,190,164,.18); }
.hotspot-mode-tabs button { color: #739486; }
.hotspot-mode-tabs button:hover { color: #c8f8e3; background: rgba(42,177,119,.1); }
.hotspot-mode-tabs button.active { color: #5ce3aa; background: linear-gradient(180deg, transparent, rgba(38,193,128,.13)); }
.country-card, .trend-card {
  color: #dff8ed; border-color: rgba(123,187,160,.18); background: rgba(13,39,29,.82);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.country-card:hover, .trend-card:hover {
  border-color: #45d596; background: rgba(19,66,46,.9);
  box-shadow: 0 0 25px rgba(69,213,150,.14); transform: translateX(-3px);
}
.country-head { color: #dcf7eb; background: transparent; }
.country-head small, .trend-card small { color: #749687; }
.country-card.open { border-color: #49dc9e; box-shadow: 0 0 28px rgba(73,220,158,.15); }
.country-card.open .country-head {
  color: white; background: linear-gradient(110deg, rgba(27,150,99,.65), rgba(9,61,42,.82));
}
.country-spots { border-top: 1px solid rgba(126,190,164,.13); }
.spot-button {
  color: #d9f3e7; border-color: rgba(121,182,157,.15); background: rgba(5,25,17,.62);
}
.spot-button:hover { color: white; border-color: #42d091; background: rgba(23,104,70,.68); }
.spot-button small { color: #729486; }
.spot-button.selected {
  border-color: #63efb3; background: linear-gradient(135deg, #20aa72, #076044);
  box-shadow: 0 0 25px rgba(55,225,156,.27), inset 0 0 16px rgba(255,255,255,.05);
}
.trend-rank { color: #62e5ad; background: rgba(26,114,77,.48); }
.trend-card strong, .spot-button strong { color: #62e5ad; }
.trend-back { color: #75ebb8; border-color: rgba(86,222,165,.32); background: rgba(19,77,54,.55); }
.trend-back:hover { color: white; border-color: #62e5ad; background: rgba(29,128,86,.72); }

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  color: #ddf8eb; background: rgba(6,25,17,.96);
}
.leaflet-popup-content-wrapper {
  border: 1px solid rgba(88,225,168,.34);
  box-shadow: 0 18px 50px rgba(0,0,0,.38), 0 0 25px rgba(57,209,146,.12);
}
.leaflet-container a.leaflet-popup-close-button { color: #8db7a5; }
.leaflet-container a.leaflet-popup-close-button:hover { color: #61e6ad; }
.popup-title, .scan-popup h3 { color: #f0fff8; }
.popup-place, .popup-meta span:nth-child(odd) { color: #82a496; }
.popup-coordinates, .scan-popup-coordinates {
  color: #bdf2da; border-color: rgba(102,211,165,.3); background: rgba(12,52,37,.55);
}
.popup-actions button, .scan-popup-actions button:first-child {
  color: #7de8ba; border-color: rgba(91,220,166,.38); background: rgba(12,48,34,.7);
}
.popup-actions button:hover, .scan-popup-actions button:first-child:hover {
  color: white; border-color: #62e5ad; background: #176d4d; box-shadow: 0 0 16px rgba(98,229,173,.2);
}
.popup-actions a, .scan-popup-actions button:last-child {
  background: linear-gradient(135deg, #22b779, #08704c); border-color: #35cd8e;
}
.popup-actions a:hover, .scan-popup-actions button:last-child:hover { filter: brightness(1.2); box-shadow: 0 0 18px rgba(53,205,142,.28); }
.scan-layer-option { color: #78988a; border-color: rgba(119,182,155,.2); background: rgba(6,27,18,.76); }
.scan-layer-option:hover { color: white; border-color: #4ed99e; background: rgba(20,82,57,.72); transform: translateY(-1px); }

.toast {
  border-color: rgba(102,239,181,.32);
  background: linear-gradient(135deg, rgba(16,91,62,.97), rgba(5,38,26,.97));
  box-shadow: 0 16px 40px rgba(0,0,0,.36), 0 0 22px rgba(56,218,151,.15);
}

* { scrollbar-color: #277a58 #081a12; scrollbar-width: thin; }

.workspace { transition: grid-template-columns .22s ease; }
.control-panel { transition: transform .22s ease, opacity .18s ease; }
body.left-panel-collapsed .workspace { grid-template-columns: 0 1fr; }
body.left-panel-collapsed .control-panel { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.panel-toggle {
  position: fixed; z-index: 1300; display: grid; place-items: center;
  width: 34px; height: 54px; color: #eafff6; border: 1px solid rgba(89,235,174,.55);
  background: linear-gradient(145deg, rgba(24,146,96,.96), rgba(7,59,41,.98));
  box-shadow: 0 0 24px rgba(45,218,149,.24), 0 10px 26px rgba(0,0,0,.3);
  font: 800 24px/1 system-ui; transition: left .22s ease, right .22s ease, filter .15s ease;
}
.panel-toggle:hover { filter: brightness(1.35); box-shadow: 0 0 30px rgba(74,239,173,.38); }
.left-panel-toggle { top: 92px; left: calc(var(--left-panel-width) - 17px); border-radius: 0 13px 13px 0; }
body.left-panel-collapsed .left-panel-toggle { left: 0; }
.right-panel-toggle { top: 176px; right: 0; border-radius: 13px 0 0 13px; }
body.hotspots-open .right-panel-toggle { display: none; }

.panel-resizer {
  position: fixed; z-index: 1290; top: 72px; bottom: 0;
  width: 10px; border: 0; outline: none; pointer-events: auto;
  cursor: col-resize; touch-action: none;
}
.panel-resizer::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px;
  background: rgba(91,235,174,.12);
  transition: width .15s ease, left .15s ease, background .15s ease, box-shadow .15s ease;
}
.panel-resizer:hover::before,
.panel-resizer:focus-visible::before,
body.panel-resizing .panel-resizer.active::before {
  left: 2px; width: 6px; background: rgba(91,235,174,.62);
  box-shadow: 0 0 18px rgba(91,235,174,.62);
}
.left-panel-resizer { left: calc(var(--left-panel-width) - 5px); }
.right-panel-resizer { right: calc(var(--right-panel-width) - 5px); }
body.left-panel-collapsed .left-panel-resizer,
body:not(.hotspots-open) .right-panel-resizer { display: none; }
body.panel-resizing {
  cursor: col-resize;
  user-select: none;
}
body.panel-resizing .workspace,
body.panel-resizing .control-panel,
body.panel-resizing .map-stage,
body.panel-resizing .panel-toggle {
  transition: none;
}

.gpx-panel {
  margin-top: 12px; padding: 13px; border: 1px solid rgba(61,216,151,.34); border-radius: 14px;
  background: linear-gradient(145deg, rgba(18,63,45,.96), rgba(5,31,21,.96));
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 0 24px rgba(38,201,134,.1);
}
.gpx-panel[hidden] { display: none; }
.gpx-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gpx-heading span, .gpx-heading b, .gpx-heading small { display: block; }
.gpx-heading b { color: #5ce3aa; font-size: 9px; letter-spacing: 1.5px; }
.gpx-heading small { margin-top: 3px; color: #739687; font-size: 8px; }
.gpx-heading i {
  padding: 5px 7px; color: #bff5dd; border: 1px solid rgba(89,225,169,.35);
  border-radius: 7px; background: rgba(24,112,76,.48); font: 800 8px/1 system-ui;
}
.gpx-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gpx-actions button {
  display: grid; gap: 4px; padding: 9px 5px; color: #dff8ed;
  border: 1px solid rgba(112,200,163,.24); border-radius: 9px; background: rgba(4,23,15,.72);
  font-size: 9px; font-weight: 800;
}
.gpx-actions button strong { color: #5ce3aa; font-size: 12px; }
.gpx-actions button:hover:not(:disabled) {
  color: white; border-color: #55e1a5; background: linear-gradient(145deg, #19895f, #0a5a3e);
  transform: translateY(-2px); box-shadow: 0 0 18px rgba(85,225,165,.2);
}
.gpx-actions button:disabled { opacity: .35; cursor: not-allowed; }

.gpx-confirm-dialog {
  width: min(480px, calc(100vw - 32px)); padding: 0; color: #eafff6;
  border: 1px solid rgba(91,232,173,.52); border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(11,48,34,.99), rgba(3,24,16,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.58), 0 0 40px rgba(54,224,155,.18);
}
.gpx-confirm-dialog::backdrop {
  background: rgba(1,12,8,.72); backdrop-filter: blur(7px);
}
.gpx-confirm-dialog form { position: relative; padding: 28px; }
.gpx-confirm-dialog .gpx-confirm-icon {
  position: absolute; top: 24px; right: 24px; padding: 8px 10px;
  color: #bff8df; border: 1px solid rgba(94,232,176,.42); border-radius: 9px;
  background: rgba(31,139,94,.38); font: 900 10px/1 system-ui;
  letter-spacing: 1px; box-shadow: 0 0 20px rgba(77,226,166,.12);
}
.gpx-confirm-dialog h2 {
  margin: 8px 0 10px; color: white; font: 700 25px/1.15 Georgia, serif;
}
.gpx-confirm-dialog p { margin: 0; color: #9cc5b3; font-size: 13px; line-height: 1.6; }
.gpx-confirm-file {
  margin: 18px 0; padding: 13px 14px; border: 1px dashed rgba(92,227,171,.36);
  border-radius: 11px; background: rgba(4,25,17,.68);
}
.gpx-confirm-file small {
  display: block; margin-bottom: 6px; color: #5ce3aa; font-size: 8px;
  font-weight: 900; letter-spacing: 1.5px;
}
.gpx-confirm-file strong {
  display: block; overflow-wrap: anywhere; color: #dff9ed;
  font: 700 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.gpx-confirm-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.gpx-confirm-actions button {
  min-height: 44px; border-radius: 10px; font-size: 11px; font-weight: 900;
}
.gpx-cancel-button {
  color: #a7cbbb; border: 1px solid rgba(126,188,162,.3);
  background: rgba(5,29,19,.7);
}
.gpx-cancel-button:hover { color: white; border-color: #6cd9aa; background: #164e39; }
.gpx-download-button {
  color: white; border: 1px solid #4bdda1;
  background: linear-gradient(135deg, #2ab77d, #08704c);
  box-shadow: 0 0 22px rgba(56,217,151,.18);
}
.gpx-download-button:hover {
  filter: brightness(1.18); box-shadow: 0 0 30px rgba(68,231,164,.3);
}

@media (max-width: 760px) {
  .left-panel-toggle { top: auto; right: auto; bottom: calc(43% + 18px); left: 10px; border-radius: 10px; }
  body.left-panel-collapsed .left-panel-toggle { bottom: 12px; left: 10px; }
  .right-panel-toggle { top: 70px; }
  body.left-panel-collapsed .control-panel { transform: translateY(115%); }
  .scan-location-popup { max-width: calc(100vw - 34px); }
  .scan-popup { width: min(310px, calc(100vw - 90px)); }
  .gpx-confirm-dialog form { padding: 22px; }
  .gpx-confirm-actions { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html, body, .app-shell { overflow: hidden; }
  .control-panel {
    position: absolute; right: 0; bottom: 0; left: 0;
    max-height: min(44dvh, 440px); padding: 20px 16px 16px;
    border-width: 1px 0 0; border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 46px rgba(1,14,9,.45);
  }
  .control-panel::before {
    width: 46px; height: 4px; margin: -10px auto 15px;
    border-radius: 999px; background: rgba(113,224,177,.58);
    box-shadow: 0 0 14px rgba(82,225,166,.25);
  }
  .hotspot-panel {
    position: fixed; z-index: 2100; top: auto; right: 0; bottom: 0; left: 0;
    width: 100%; height: min(44dvh, 440px);
  }
  .hotspot-sheet {
    inset: 0; width: 100%; padding: 20px 14px 18px;
    border: 1px solid rgba(89,235,174,.34); border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 56px rgba(1,14,9,.52);
    overscroll-behavior: contain;
  }
  .hotspot-sheet::before {
    content: ""; display: block; width: 46px; height: 4px; margin: -10px auto 14px;
    border-radius: 999px; background: rgba(113,224,177,.58);
    box-shadow: 0 0 14px rgba(82,225,166,.25);
  }
  .hotspot-sheet h2 { font-size: 24px; }
  .hotspot-tabs { margin: 15px 0 13px; }
  .country-card.open .country-spots { grid-template-columns: 1fr 1fr; }
  .result-drawer {
    top: 70px; right: 10px; bottom: auto; left: 10px;
    padding: 10px 13px; border-radius: 13px;
  }
  .result-drawer .eyebrow { display: none; }
  .result-drawer strong { font-size: 11px; }
  .left-panel-toggle {
    top: auto; bottom: calc(min(44dvh, 440px) + 8px); left: 10px;
    width: 38px; height: 38px; border-radius: 11px;
  }
  body.left-panel-collapsed .left-panel-toggle { bottom: 12px; }
  .right-panel-toggle {
    top: auto; right: 12px; bottom: 12px;
    width: 42px; height: 42px; border-radius: 12px;
  }
  body.hotspots-open .map-stage { margin-right: 0; }
  body.left-panel-collapsed .control-panel { transform: translateY(110%); }
  .panel-resizer { display: none; }
}
