* {
  box-sizing: border-box;
}

:root {
  --gvl-blue: #3472b6;
  --gvl-blue-dark: #245a94;
  --gvl-ink: #22252a;
  --gvl-muted: #5c666a;
  --gvl-border: #d8dadd;
  --gvl-bg: #f3f5f7;
  --gvl-surface: #ffffff;
}

body {
  margin: 0;
  font-family: Frutiger, "Frutiger LT Std", "Helvetica Neue", Arial, sans-serif;
  background: var(--gvl-bg);
  color: var(--gvl-ink);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.app-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--gvl-border);
  color: var(--gvl-muted);
  font-size: 12px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

h1 {
  margin-top: 0;
  color: var(--gvl-blue);
}

form {
  background: var(--gvl-surface);
  border: 1px solid var(--gvl-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  display: grid;
  gap: 12px;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #a9afb8;
  border-radius: 6px;
  font-size: 15px;
}

.hint,
.status {
  margin: 0;
  font-size: 13px;
  color: var(--gvl-muted);
}

.status {
  font-weight: 700;
}

button {
  justify-self: start;
  background: var(--gvl-blue);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--gvl-blue-dark);
}

.municipality-panel {
  background: var(--gvl-surface);
  border: 1px solid var(--gvl-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.municipality-panel h2 {
  margin: 0 0 6px;
}

article h2 {
  margin: 0 0 6px;
  font-size: 1.5em;
}

.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "gwr oereb"
    "denkmal oereb";
  gap: 12px;
}

#results-section[hidden] {
  display: none !important;
}

#municipality-panel[hidden] {
  display: none !important;
}

.results-gwr {
  grid-area: gwr;
}

.results-denkmal {
  grid-area: denkmal;
}

.results-oereb {
  grid-area: oereb;
}

article {
  background: var(--gvl-surface);
  border: 1px solid var(--gvl-border);
  border-radius: 8px;
  padding: 10px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-size: 12px;
}

.gwr-result {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}

.gwr-main,
.gwr-address {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

.gwr-columns {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}

.gwr-main {
  flex: 1 1 60%;
}

.gwr-address {
  flex: 1 1 35%;
  justify-content: flex-end;
}

.gwr-row {
  margin: 0;
  white-space: nowrap;
}

.gwr-label {
  color: var(--gvl-muted);
}

.gwr-value-highlight {
  font-weight: 700;
  font-size: 14px;
  color: var(--gvl-blue);
  text-decoration: none;
}

.oereb-result {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.denkmal-result {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.oereb-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.oereb-row {
  margin: 0;
  white-space: normal;
}

.oereb-label {
  color: var(--gvl-muted);
}

.oereb-value-highlight {
  font-weight: 700;
  font-size: 14px;
  color: var(--gvl-blue);
  text-decoration: none;
}

.oereb-value-positive {
  color: #0a6b3f;
}

.oereb-value-negative {
  color: #9a2f2f;
}

.oereb-row-block {
  width: 100%;
}

.oereb-list {
  margin: 4px 0 0;
  padding-left: 16px;
}

.oereb-list li {
  margin: 0 0 2px;
  white-space: normal;
  word-break: break-word;
}

.naturgefahren-link-wrap {
  margin-top: 12px;
}

.naturgefahren-link-wrap a {
  display: block;
  margin-top: 2px;
  color: var(--gvl-blue);
  font-weight: 700;
  text-decoration: underline;
}

.gwr-subsection {
  width: 100%;
  margin-top: 6px;
}

.gwr-subtitle {
  font-weight: 700;
  margin-bottom: 4px;
}

.gwr-subgrid {
  display: block;
}

.gwr-device {
  margin-top: 6px;
}

.gwr-device-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.gwr-device-instance {
  display: block;
  margin-bottom: 8px;
}

.gwr-subgrid .gwr-row,
.gwr-device-instance .gwr-row {
  display: block;
  margin-bottom: 2px;
}

.gwr-device-instance .gwr-row {
  white-space: normal;
  overflow-wrap: anywhere;
}

.municipality-result {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}

.municipality-row {
  margin: 0;
  white-space: nowrap;
}

.municipality-label {
  color: var(--gvl-muted);
}

.municipality-value-highlight {
  font-weight: 700;
  color: var(--gvl-blue);
}

@media (max-width: 700px) {
  .container {
    padding: 14px;
  }

  .municipality-result {
    display: block;
  }

  .municipality-row {
    margin-bottom: 4px;
  }

  .gwr-result {
    display: block;
  }

  .gwr-main,
  .gwr-address {
    display: block;
  }

  .gwr-subgrid,
  .gwr-device-instance {
    display: block;
  }

  .gwr-address {
    margin-top: 4px;
  }

  .gwr-row {
    margin-bottom: 4px;
  }

  .oereb-summary {
    display: block;
  }

  .oereb-row {
    margin-bottom: 4px;
  }

  .results {
    grid-template-columns: 1fr;
    grid-template-areas:
      "gwr"
      "denkmal"
      "oereb";
  }
}
