* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0a0a1a;
  color: #e0e0e0;
  height: 100%;
  overflow: hidden;
}

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  background: transparent;
  pointer-events: none;
}
#topbar > * {
  pointer-events: auto;
}

.topbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(10, 10, 26, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.topbar-btn:hover {
  background: rgba(26, 26, 58, 0.7);
}

.topbar-spacer {
  flex: 1;
  pointer-events: none;
}

.city-search {
  position: relative;
}
.city-search input {
  background: rgba(10, 10, 26, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e0e0;
  padding: 9px 14px;
  padding-right: 36px;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  width: 250px;
}
.city-search input::placeholder {
  color: #667;
}
.city-search input:focus {
  border-color: rgba(90, 154, 255, 0.4);
}

.city-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.city-clear svg {
  width: 14px;
  height: 14px;
  stroke: #888;
  stroke-width: 2;
  fill: none;
}
.city-clear:hover svg {
  stroke: #ccc;
}
.city-clear.visible {
  display: flex;
}

.city-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  margin-top: 4px;
  background: rgba(18, 18, 42, 0.9333333333);
  backdrop-filter: blur(16px);
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  max-height: 340px;
  overflow-y: auto;
  display: none;
  z-index: 400;
}
.city-dropdown.open {
  display: block;
}
.city-dropdown .dropdown-section {
  padding: 6px 12px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #556;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.city-dropdown .dropdown-section:first-child {
  border-top: none;
}
.city-dropdown .city-opt {
  padding: 8px 12px;
  font-size: 14px;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.city-dropdown .city-opt:hover {
  background: rgba(90, 154, 255, 0.15);
  color: #fff;
}
.city-dropdown .city-opt .city-name {
  flex: 1;
}
.city-dropdown .city-opt .city-sub {
  font-size: 11px;
  color: #667;
}
.city-dropdown .city-opt .city-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: #667;
  stroke-width: 1.5;
}
.city-dropdown .city-loading {
  padding: 10px 12px;
  font-size: 13px;
  color: #556;
  text-align: center;
}

#globeBtn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #aaa;
  stroke-width: 1.5;
}
#globeBtn.active svg {
  stroke: #5a9aff;
}

#menuBtn {
  flex-direction: column;
  gap: 5px;
}
#menuBtn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #aaa;
  border-radius: 1px;
  transition: all 0.3s;
}
#menuBtn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#menuBtn.open span:nth-child(2) {
  opacity: 0;
}
#menuBtn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  z-index: 200;
  background: rgba(13, 13, 32, 0.9411764706);
  backdrop-filter: blur(20px);
  border-left: 1px solid #2a2a4a;
  padding: 60px 20px 20px;
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#panel.open {
  right: 0;
}
#panel .section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #556;
  margin-bottom: 4px;
}

.info-bar {
  font-size: 12px;
  color: #888;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-bar span {
  white-space: nowrap;
}

.legend {
  display: flex;
  gap: 8px 14px;
  font-size: 11px;
  color: #888;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-swatch {
  width: 16px;
  height: 9px;
  border-radius: 2px;
}

#calendar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#calendar {
  cursor: crosshair;
  display: block;
  flex: 1;
  width: 100%;
}

#month-axis {
  width: 100%;
  height: 24px;
  flex-shrink: 0;
  display: block;
}

#globe-container {
  position: fixed;
  left: 12px;
  bottom: 36px;
  z-index: 50;
  cursor: grab;
  display: none;
  width: 220px;
  height: 220px;
}
#globe-container.visible {
  display: block;
}
#globe-container svg {
  filter: drop-shadow(0 0 15px rgba(30, 60, 120, 0.5));
}

.globe-ocean {
  fill: #0a1a2e;
}

.globe-land {
  fill: rgba(60, 120, 60, 0.45);
  stroke: rgba(80, 160, 80, 0.5);
  stroke-width: 0.4;
}

.globe-grid {
  fill: none;
  stroke: rgba(100, 150, 200, 0.2);
  stroke-width: 0.3;
}

.globe-border {
  fill: none;
  stroke: rgba(100, 150, 200, 0.4);
  stroke-width: 1;
}

.globe-pin {
  fill: #ff4444;
  stroke: #fff;
  stroke-width: 1.5;
}

#tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.8666666667);
  color: #eee;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  white-space: pre-line;
  z-index: 200;
  display: none;
  line-height: 1.5;
  border: 1px solid #333;
}

#overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  transition: opacity 0.35s;
}
#overlay.visible {
  opacity: 0.4;
  pointer-events: auto;
}
