/* ===== JustSimple.online - Premium Dark Theme ===== */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-hover: rgba(255, 255, 255, 0.95);
  --border-glass: rgba(99, 102, 241, 0.2);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.2);
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --success: #059669;
  --error: #dc2626;
  --warning: #d97706;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ===== Map ===== */
#map {
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;
  z-index: 1;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-glass) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  transition: var(--transition);
}

.leaflet-control-zoom a:hover {
  background: var(--bg-glass-hover) !important;
  color: var(--accent-light) !important;
}

.leaflet-control-zoom-in {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  border-top: none !important;
}

/* ===== Search Bar ===== */
#search-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 520px;
}

#search-bar {
  display: flex;
  align-items: center;
  background: #1a1d27;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #2e3347;
  border-radius: var(--radius-xl);
  padding: 6px 8px 6px 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: var(--transition);
  gap: 4px;
}

#search-bar:focus-within {
  border-color: #4caf50;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 3px rgba(76,175,80,0.15);
}

#search-logo {
  color: #4caf50;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 6px;
}

#search-prefix {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  color: #4caf50;
  user-select: none;
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e8eaf0;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  min-width: 0;
}

#search-input::placeholder {
  color: #7c829a;
  font-weight: 400;
}

#search-btn,
#clear-btn {
  background: none;
  border: none;
  color: #7c829a;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

#search-btn:hover,
#clear-btn:hover {
  color: #e8eaf0;
  background: rgba(255,255,255,0.07);
}

/* ===== Search Results ===== */
.search-results {
  margin-top: 8px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  animation: slide-down 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-results.hidden {
  display: none;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

.result-icon {
  color: var(--accent-light);
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.result-address {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* ===== Control Buttons ===== */
#locate-btn,
#recent-btn {
  position: fixed;
  z-index: 1000;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #1a1d27;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #2e3347;
  color: #7c829a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: var(--transition);
}

#locate-btn {
  bottom: 100px;
}

#recent-btn {
  bottom: 152px;
}

#locate-btn:hover,
#recent-btn:hover {
  color: #4caf50;
  border-color: #4caf50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 3px rgba(76,175,80,0.15);
  transform: scale(1.05);
}

#locate-btn.locating {
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: var(--shadow-md);
  }

  50% {
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
  }
}

/* ===== Panels ===== */
.panel {
  position: fixed;
  z-index: 1001;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 380px;
  animation: panel-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.panel.hidden {
  display: none;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#mark-panel {
  bottom: 24px;
  left: 16px;
  background: #1a1d27;
  border-color: #2e3347;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#mark-panel .panel-header {
  border-bottom-color: #2e3347;
}

#mark-panel .panel-header h3 {
  color: #e8eaf0;
}

#mark-panel .panel-close {
  color: #7c829a;
}

#mark-panel .panel-close:hover {
  color: #e8eaf0;
  background: rgba(255,255,255,0.07);
}

#mark-coords {
  color: #7c829a;
  background: rgba(255,255,255,0.05);
  border: 1px solid #2e3347;
}

#mark-panel .word-input-group {
  background: rgba(255,255,255,0.05);
  border-color: #2e3347;
}

#mark-panel .word-input-group:focus-within {
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}

#mark-panel .word-prefix {
  color: #4caf50;
}

#mark-panel .word-input {
  color: #e8eaf0;
}

#mark-panel .word-input::placeholder {
  color: #7c829a;
}

#mark-panel .word-dot {
  color: #4caf50;
}

#mark-panel .btn-primary {
  background: #4caf50;
  background-image: none;
}

#mark-panel .btn-primary:hover {
  background: #43a047;
  box-shadow: 0 0 20px rgba(76,175,80,0.3);
}

#info-panel {
  bottom: 24px;
}

#recent-panel {
  bottom: 24px;
  right: 16px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: #1a1d27;
  border-color: #2e3347;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#recent-panel .panel-header {
  border-bottom-color: #2e3347;
}

#recent-panel .panel-header h3 {
  color: #e8eaf0;
}

#recent-panel .panel-close {
  color: #7c829a;
}

#recent-panel .panel-close:hover {
  color: #e8eaf0;
  background: rgba(255,255,255,0.07);
}

#recent-panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  line-height: 1;
}

.panel-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.panel-body {
  padding: 16px 20px 20px;
}

/* ===== Mark Panel ===== */
#mark-coords {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
}

.word-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: var(--transition);
}

.word-input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.word-prefix {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  color: var(--accent-light);
  user-select: none;
}

.word-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  width: 70px;
  text-align: center;
  letter-spacing: 0.3px;
}

.word-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.word-dot {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  user-select: none;
}

.error-msg {
  font-size: 13px;
  color: var(--error);
  margin-bottom: 12px;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-msg:empty {
  display: none;
}

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 10px 16px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-light);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
}

/* ===== Info Panel ===== */
/* ===== Info Pill (Modern Design) ===== */
.info-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  width: auto;
  min-width: 320px;
  max-width: 90%;
  background: #1a1d27;
  border: 1px solid #2e3347;
  border-radius: 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  animation: pill-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.info-pill.hidden {
  display: none;
}

@keyframes pill-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(30px) scale(0.9);
  }
}

.info-pill-content {
  padding: 12px 16px;
}

.info-pill-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #2e3347;
  margin-bottom: 12px;
}

.info-pill-prefix {
  color: #4caf50;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -1px;
}

.info-pill-address {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  color: #e8eaf0;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-pill-views {
  font-size: 12px;
  font-family: var(--font-mono);
  color: #7c829a;
  white-space: nowrap;
  user-select: none;
}

.info-pill-copy {
  background: none;
  border: none;
  color: #7c829a;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.info-pill-copy:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #e8eaf0;
}

.info-pill-close {
  background: none;
  border: none;
  color: #7c829a;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: var(--transition);
}

.info-pill-close:hover {
  color: #e8eaf0;
}

.info-pill-bottom {
  display: flex;
  gap: 10px;
  padding: 0 4px 8px;
}

.pill-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 24px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn.share {
  background-color: #22263a;
  color: #4caf50;
  border: 1px solid #2e3347;
}

.pill-btn.share:hover {
  background-color: #2d6e30;
  color: #fff;
  border-color: #4caf50;
  transform: translateY(-1px);
}

.pill-btn.nav {
  background-color: #1e3a5f;
  color: #60aaf0;
  border: 1px solid #2a4a70;
}

.pill-btn.nav:hover {
  background-color: #1e88e5;
  color: #fff;
  border-color: #1e88e5;
  transform: translateY(-1px);
}

.pill-btn.save {
  background-color: #22263a;
  color: #f9a825;
  border: 1px solid #2e3347;
}

.pill-btn.save:hover {
  background-color: #7a5c00;
  color: #fff;
  border-color: #f9a825;
  transform: translateY(-1px);
}

.pill-btn svg {
  opacity: 0.9;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .info-pill {
    width: calc(100% - 32px);
    bottom: 16px;
    min-width: 0;
  }

  .info-pill-address {
    font-size: 16px;
  }

  .info-pill-prefix {
    font-size: 17px;
  }

  .info-pill-bottom {
    gap: 8px;
  }

  .pill-btn {
    flex-direction: column;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .pill-btn svg {
    width: 20px;
    height: 20px;
  }

  .pill-btn span {
    display: block;
  }
}

/* ===== Recent Panel ===== */
#recent-list {
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass) transparent;
}

#recent-list::-webkit-scrollbar {
  width: 4px;
}

#recent-list::-webkit-scrollbar-thumb {
  background: #2e3347;
  border-radius: 2px;
}

.recent-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.recent-item:hover {
  background: rgba(76,175,80,0.08);
  border-color: #2e3347;
}

.recent-item-address {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #4caf50;
  margin-bottom: 4px;
}

.recent-item-coords {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7c829a;
}

.recent-item-time {
  font-size: 11px;
  color: #7c829a;
  margin-top: 2px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
}

/* ===== Spinner ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-glass-hover);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.hidden {
  display: none;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

/* ===== Custom Marker ===== */
.custom-marker {
  position: relative;
}

.marker-pin {
  width: 32px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin::after {
  content: '';
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transform: rotate(45deg);
}

.click-marker-icon {
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  animation: click-pulse 1.5s ease-out infinite;
}

@keyframes click-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
  }

  100% {
    box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
  }
}

/* ===== Leaflet Popup Override ===== */
.leaflet-popup-content-wrapper {
  background: var(--bg-glass-hover) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text-primary) !important;
}

.leaflet-popup-tip {
  background: var(--bg-glass-hover) !important;
  border: none !important;
  box-shadow: none !important;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
}

.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

.popup-address {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-light);
  cursor: pointer;
}

.popup-address:hover {
  text-decoration: underline;
}

/* ===== Attribution ===== */
.leaflet-control-attribution {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(10px) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  border: none !important;
}

.leaflet-control-attribution a {
  color: var(--accent-light) !important;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 640px) {
  #search-container {
    width: 94%;
    top: 12px;
  }

  .panel {
    width: calc(100% - 24px);
    max-width: none;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
  }

  #locate-btn,
  #recent-btn {
    right: 12px;
  }

  #locate-btn {
    bottom: 80px;
  }

  #recent-btn {
    bottom: 132px;
  }

  .word-input {
    width: 55px;
    font-size: 14px;
  }

  .info-address {
    font-size: 17px;
  }
}

/* ===== Click Instruction Overlay ===== */
#click-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 10px 24px;
  font-size: 13px;
  color: var(--text-secondary);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  animation: fade-in 0.5s ease 1s both;
  pointer-events: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

#click-hint.hidden {
  display: none;
}

/* ===== Menu Button ===== */
#menu-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #1a1d27;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #2e3347;
  color: #7c829a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: var(--transition);
}

#menu-btn:hover {
  color: #4caf50;
  border-color: #4caf50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 3px rgba(76,175,80,0.15);
}

/* ===== Nav Overlay ===== */
#nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1100;
  backdrop-filter: blur(2px);
}

#nav-overlay.hidden {
  display: none;
}

/* ===== Nav Drawer ===== */
#nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 280px;
  max-width: 85vw;
  background: #1a1d27;
  border-left: 1px solid #2e3347;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  animation: drawer-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#nav-drawer.hidden {
  display: none;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

#nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #2e3347;
}

#nav-brand {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: #4caf50;
  letter-spacing: -0.5px;
}

#nav-close {
  background: none;
  border: none;
  font-size: 26px;
  color: #7c829a;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

#nav-close:hover {
  color: #e8eaf0;
  background: rgba(255,255,255,0.07);
}

#nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: #e8eaf0;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.nav-link svg {
  color: #4caf50;
  flex-shrink: 0;
}

.nav-link:hover {
  background: rgba(76,175,80,0.1);
  color: #4caf50;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7c829a;
  padding: 12px 16px 4px;
}

/* ===== Explore pin cards ===== */
.explore-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  gap: 12px;
}

.explore-item:last-child { border-bottom: none; }

.explore-addr {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.explore-coords {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.explore-fly {
  flex-shrink: 0;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.explore-fly:hover { opacity: 0.85; }

.explore-load-more {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: rgba(99,102,241,0.08);
  color: var(--accent);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.explore-load-more:hover { background: rgba(99,102,241,0.15); }
.explore-load-more:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Stat cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.stat-card {
  background: rgba(99,102,241,0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Page Modal ===== */
#page-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

#page-modal.hidden {
  display: none;
}

#page-modal-inner {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#page-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  flex-shrink: 0;
}

#page-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

#page-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

#page-modal-close:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

#page-modal-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
}

#page-modal-body h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 24px 0 10px;
}

#page-modal-body h3:first-child {
  margin-top: 0;
}

#page-modal-body p {
  margin-bottom: 12px;
}

#page-modal-body ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

#page-modal-body ul li {
  margin-bottom: 8px;
}

#page-modal-body .step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

#page-modal-body .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

#page-modal-body .step-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 2px;
}

#page-modal-body .highlight {
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 14px;
}

@media (max-width: 640px) {
  #page-modal-body {
    padding: 16px 18px 24px;
    font-size: 14px;
  }
  #page-modal-inner {
    max-height: 90vh;
  }
}