:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(8, 17, 31, 0.92);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #9fb0c9;
  --primary: #60a5fa;
  --primary-strong: #2563eb;
  --accent: #f97316;
  --ok: #22c55e;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.38);
  font-family: Inter, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 0 28%),
    linear-gradient(135deg, #020617, var(--bg));
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  z-index: 2;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.5rem;
  font-size: 1.9rem;
}

h2 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.intro {
  color: var(--muted);
  line-height: 1.55;
}

.panel {
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.68);
}

.panel-small {
  margin-top: auto;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

.chip.muted {
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.style-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.style-button,
.btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.style-button:hover,
.style-button:focus-visible,
.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.7);
}

.style-button.active {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.95);
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-strong), #3b82f6);
  border-color: rgba(96, 165, 250, 0.95);
}

.country-card {
  margin-bottom: 0.8rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.4);
}

.country-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.country-meta div {
  min-width: 0;
}

.country-meta dt {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.country-meta dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.summary {
  margin-bottom: 0;
  color: #dbeafe;
  line-height: 1.45;
}

.status {
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  line-height: 1.45;
}

.status.success {
  border-left-color: var(--ok);
  background: rgba(34, 197, 94, 0.12);
}

.status.warn {
  border-left-color: var(--warn);
  background: rgba(251, 191, 36, 0.12);
}

.status.error {
  border-left-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.notes {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.5;
}

.map-wrapper {
  position: relative;
  min-width: 0;
}

.map-toolbar,
.map-footer {
  position: absolute;
  left: 1rem;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(8px);
}

.map-toolbar {
  top: 1rem;
  right: 4.5rem;
}

.map-footer {
  right: 1rem;
  bottom: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#map {
  width: 100%;
  height: 100vh;
  background: #94b8ff;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #94b8ff;
  font: inherit;
}

.leaflet-top.leaflet-right {
  top: 1rem;
  right: 1rem;
}

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

.leaflet-control-zoom a {
  background: rgba(15, 23, 42, 0.92) !important;
  color: var(--text) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(37, 99, 235, 0.32) !important;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
  }

  #map {
    height: 65vh;
  }

  .map-toolbar,
  .map-footer {
    position: static;
    margin: 0.75rem;
  }
}

@media (max-width: 640px) {
  .actions,
  .country-meta {
    grid-template-columns: 1fr;
  }

  .map-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
