:root {
  color-scheme: dark;
  --background: #0e1117;
  --surface: #161b22;
  --accent: #ff4d6d;
  --text-primary: #f5f7fb;
  --text-secondary: #c9d1d9;
  --header-height: clamp(3.6rem, 7vw, 5rem);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: absolute;
  top: clamp(1rem, 4vw, 2.2rem);
  right: clamp(1rem, 4vw, 2.6rem);
  left: auto;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem clamp(1rem, 4vw, 1.9rem);
  max-width: min(420px, 38vw);
  background: linear-gradient(135deg, rgba(14, 17, 23, 0.92), rgba(32, 38, 46, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.4rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
  pointer-events: none;
}

.app-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
}

.app-subtitle {
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.app-main {
  flex: 1;
  position: relative;
  --viewport-gap: 0;
  isolation: isolate;
}

#map {
  width: 100%;
  height: 100%;
}

.map-viewport {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  box-shadow: none;
}

.leaflet-container {
  background: var(--surface);
}

.map-error {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 77, 109, 0.12), rgba(14, 17, 23, 0.95));
  color: var(--text-secondary);
  padding: 2rem;
  text-align: center;
  font-size: 0.95rem;
}

.map-error__message {
  max-width: 40ch;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .app-main {
    --viewport-gap: 0;
    --header-height: clamp(3.2rem, 12vw, 4.2rem);
  }
}

@media (max-width: 900px) {
  .app-header {
    max-width: min(480px, 60vw);
  }
}

@media (max-width: 600px) {
  .app-header {
    top: clamp(0.75rem, 6vw, 1.35rem);
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(92vw, 480px);
    padding: 0.9rem clamp(1rem, 6vw, 1.6rem);
    text-align: center;
  }

  .app-title {
    font-size: clamp(1.45rem, 6vw, 2.05rem);
  }

  .app-subtitle {
    font-size: clamp(0.85rem, 4.5vw, 1rem);
  }
}
