:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  --accent: #0f766e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100dvh;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 16px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar h1 {
  margin: 0;
  font-size: 1.2rem;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  position: relative;
}

#map {
  height: calc(100dvh - 84px);
  width: 100%;
}

.bottom-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 800;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(209, 213, 219, 0.95);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  max-height: 42dvh;
  overflow: auto;
}

.sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

label,
select,
button {
  font: inherit;
}

select,
button {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 12px;
}

button {
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

#statusText {
  margin: 12px 0 8px;
  color: var(--muted);
}

.parking-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.parking-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.parking-item h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.parking-meta {
  margin: 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.leaflet-popup-content {
  font-size: 0.95rem;
}

@media (min-width: 900px) {
  .topbar {
    padding-left: 24px;
    padding-right: 24px;
  }

  .bottom-sheet {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 390px;
    max-height: 70dvh;
  }
}
