:root { color-scheme: dark; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0c1018;
  color: #f3efe6;
  font-family: "Outfit", "Avenir Next", sans-serif;
  font-weight: 300;
}

header {
  display: flex;
  gap: 16px;
  align-items: end;
  flex: none;
  width: calc(100% - 32px);
  margin: 0 auto;
  padding: 14px 0 8px;
}

.kicker {
  margin: 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  color: #9be7ff;
}

.kicker a { color: inherit; }

h1 {
  margin: 4px 0 0;
  font-family: "Instrument Serif", Palatino, serif;
  font-weight: 400;
  font-size: 40px;
  line-height: 0.95;
}

header > button { margin-left: auto; }

.map-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

#query {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: end;
}

#query label { flex: 1; min-width: 0; }

#query .street { flex: 1.6; position: relative; }

#query button { flex: none; }

#vorschlaege {
  position: absolute;
  z-index: 1000;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(280px, 42dvh);
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(186, 214, 255, 0.28);
  background: #141b28;
}

#vorschlaege button {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  background: transparent;
  color: #f3efe6;
  padding: 8px 10px;
}

#vorschlaege button strong { display: block; font-weight: 500; }

#vorschlaege button span {
  display: block;
  color: rgba(243, 239, 230, 0.55);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

#vorschlaege button.is-active,
#vorschlaege button:hover { background: rgba(155, 231, 255, 0.12); }

.house dt {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(243, 239, 230, 0.62);
}

.house dd { margin: 0 0 8px; }

.house dd.heat { font-size: 22px; }

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 239, 230, 0.62);
}

input, button {
  font: inherit;
  color: inherit;
}

input {
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(186, 214, 255, 0.28);
  background: rgba(8, 12, 20, 0.8);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #d7ecff;
  color: #102033;
  font-weight: 500;
  cursor: pointer;
}

button.is-on { background: #f0c7a2; }

#export { margin: 4px 0 14px; }

#status {
  flex: none;
  width: calc(100% - 32px);
  margin: 0 auto 8px;
  min-height: 1.3em;
  color: rgba(243, 239, 230, 0.72);
}

.progress-track {
  display: block;
  height: 6px;
  margin: 2px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  background: #9be7ff;
}

.progress-log {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.45;
}

.progress-log li:last-child { color: #f3efe6; }

.stage {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  flex: 1;
  min-height: 0;
  width: calc(100% - 32px);
  margin: 0 auto 12px;
}

#plan {
  flex: 1;
  min-height: 0;
  height: auto;
  border-radius: 16px;
  overflow: hidden;
  background: #151b27;
}

aside {
  padding: 8px 4px 8px 8px;
  min-height: 0;
  overflow: auto;
}

aside h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.hint, .area-note, .popup small {
  color: rgba(243, 239, 230, 0.66);
  line-height: 1.45;
}

.error {
  margin: 0 0 12px;
  color: #e09a7a;
}

.stats {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.stats div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.stats strong {
  display: block;
  font-size: 22px;
  font-weight: 500;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 3px;
  vertical-align: -1px;
}

.swatch.low { background: #7eb6d6; }
.swatch.mid { background: #e6c07b; }
.swatch.high { background: #e09a7a; }
.swatch.none { background: #5c6b7a; }

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #161d2b;
  color: #f3efe6;
}

.leaflet-popup-content {
  margin: 12px 14px;
  overflow: auto;
  font-size: 14px;
}

.popup h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.popup dl {
  margin: 0;
}

.popup dt {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(243, 239, 230, 0.62);
}

.popup dd {
  margin: 0 0 8px;
}

.popup dd.heat {
  color: #f3efe6;
  font-size: 18px;
}

.leaflet-container { background: #151b27; font: inherit; }

#plan .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.92) saturate(0.35);
}

.lasso-stroke {
  stroke: #9be7ff;
  stroke-width: 2;
  fill: rgba(155, 231, 255, 0.12);
}

@media (max-width: 860px) {
  body { height: auto; min-height: 100dvh; overflow: auto; }
  header, #query { display: grid; }
  header > button, #query button { margin-left: 0; }
  .stage { display: flex; flex-direction: column; flex: none; }
  .map-col { height: calc(100dvh - 220px); min-height: 420px; }
  aside { max-height: none; }
}
