* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  padding: 0.75rem 1rem;
  background: #1b2a3a;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
  white-space: nowrap;
}

#tagline {
  margin: 0;
  font-size: 0.72rem;
  color: #9ec5ff;
  white-space: nowrap;
}

#search-bar {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 240px;
}

#address-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
}

#search-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: #2e7d32;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

#search-button:hover {
  background: #266029;
}

#header-links {
  display: flex;
  gap: 0.9rem;
}

#header-links a {
  color: #9ec5ff;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

#header-links a:hover {
  text-decoration: underline;
}

main {
  flex: 1;
  display: flex;
  min-height: 0;
}

#map {
  flex: 2;
  min-height: 300px;
}

#results {
  flex: 1;
  min-width: 260px;
  max-width: 380px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  border-left: 1px solid #ddd;
}

#results-status {
  font-size: 0.9rem;
  color: #555;
}

#results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#results-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

/* Collapsible coverage / how-to-read note -- sets honest expectations for
   first-time users without shouting. */
#coverage-note {
  border: 1px solid #dbe4ee;
  background: #f5f9ff;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.82rem;
  color: #40505f;
}

#coverage-note summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b2a3a;
}

#coverage-note p {
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

#coverage-note .coverage-warn {
  color: #8a4b00;
  font-weight: 600;
}

/* Colour swatch used in the filter/legend and the coverage note. */
.sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: none;
  vertical-align: -2px;
}
.sw-free { background: #2e7d32; }
.sw-ftl { background: #1565c0; }
.sw-paid { background: #c62828; }
.sw-permit { background: #6a1b9a; }
.sw-nopark { background: #263238; }
/* Faint fill + dashed edge signals "unverified guess", matching the map. */
.sw-presumed { background: #66bb6a; border: 1px dashed #2e7d32; }
.sw-unknown { background: #757575; }

#condition-filters {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem 0.75rem 0.6rem;
  margin: 0 0 0.75rem;
  display: flex;
  flex-flow: row wrap;
  gap: 0.35rem 0.9rem;
}

#condition-filters legend {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  padding: 0 0.25rem;
}

#condition-filters label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
}

#report-toggle {
  margin: 0.5rem 0;
  padding: 0.4rem 0.75rem;
  border: 1px dashed #888;
  border-radius: 4px;
  background: none;
  color: #333;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

#report-toggle:hover {
  background: #f2f2f2;
}

#report-form {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* The ID selector above beats the UA stylesheet's [hidden] rule (an ID
   always outranks an attribute selector), so without this, `reportForm.hidden
   = true` in main.js has no visible effect and the form never actually hides. */
#report-form[hidden] {
  display: none;
}

.report-hint {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
}

#report-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #333;
}

#report-form select,
#report-form input,
#report-form textarea {
  padding: 0.4rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}

.report-actions {
  display: flex;
  gap: 0.5rem;
}

.report-actions button {
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

.report-actions button[type="submit"] {
  background: #1565c0;
  color: white;
}

.report-actions button#report-cancel {
  background: #ddd;
}

#report-status {
  font-size: 0.8rem;
  margin: 0;
}

@media (max-width: 700px) {
  main {
    flex-direction: column;
  }
  #map {
    flex: none;
    height: 55vh;
  }
  #results {
    max-width: none;
    border-left: none;
    border-top: 1px solid #ddd;
  }
  /* Full-width search on its own line, so the box is comfortably tappable. */
  #search-bar {
    order: 3;
    flex-basis: 100%;
  }
  #header-links {
    order: 2;
    margin-left: auto;
  }
  /* Roomier tap targets for the filter chips on touch screens. */
  #condition-filters {
    gap: 0.6rem 1.1rem;
  }
  #condition-filters label {
    font-size: 0.9rem;
  }
  #condition-filters input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}
