:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #888888);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f0f0f0);
  --jam: #e53935;
  --free: #43a047;
  --stale: #9e9e9e;
}

* { box-sizing: border-box; }

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

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

#topbar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(128,128,128,0.2);
  flex-shrink: 0;
}

#topbar h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}

#status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--free);
  display: inline-block;
  margin-right: 6px;
}

#legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--hint);
}
#legend span { display: flex; align-items: center; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.jam { background: var(--jam); }
.dot.free { background: var(--free); }
.dot.stale { background: var(--stale); }

#map {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

#sheet {
  flex-shrink: 0;
  max-height: 34vh;
  overflow-y: auto;
  border-top: 1px solid rgba(128,128,128,0.2);
  background: var(--bg);
}

#sheet-handle {
  padding: 8px 14px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  position: sticky;
  top: 0;
  background: var(--bg);
}

.street-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(128,128,128,0.08);
}

.street-item .name {
  flex: 1;
  font-size: 14px;
}

.street-item .meta {
  font-size: 11px;
  color: var(--hint);
}

.empty {
  padding: 16px 14px;
  color: var(--hint);
  font-size: 13px;
}

.leaflet-popup-content { font-size: 13px; min-width: 140px; }
.popup-status { font-weight: 600; }
.popup-status.jam { color: var(--jam); }
.popup-status.free { color: var(--free); }
.popup-status.stale { color: var(--stale); }
.popup-meta { color: #777; font-size: 11px; margin-top: 4px; }
