:root {
  color-scheme: dark;
  --bg: #14171c;
  --bg-elevated: #1c2027;
  --border: #2c313a;
  --text: #eef1f5;
  --text-muted: #9aa3b0;
  --accent: #5fb3ff;
  --accent-text: #051622;
  --chip-bg: #232833;
  --chip-border: #343b47;
  --focus-ring: #7fc4ff;
}

* {
  box-sizing: border-box;
}

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

.page-header {
  padding: 2rem 1.25rem 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.controls {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 0.75rem 0 1rem;
  z-index: 1;
}

.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.search-input {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.search-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.export-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.export-btn:hover {
  border-color: var(--accent);
}

.export-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

@media (max-width: 420px) {
  .search-row {
    flex-wrap: wrap;
  }

  .export-btn {
    flex: 1 1 100%;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

.chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.result-count {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.street-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.street-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 40px;
}

.street-name {
  font-size: 0.98rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-muted);
}

.badge-plz {
  background: transparent;
  border-style: dashed;
  opacity: 0.75;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.page-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
  .page-header h1 {
    font-size: 1.9rem;
  }
}
