/* Energy showcase: mobile first, settings above a square-ish map; side by side from 900 px. */
.energy {
  margin: 0;
}

.layout {
  display: grid;
  grid-template-areas: "map" "controls";
}

.controls {
  grid-area: controls;
  padding: 12px 16px 24px;
}

.intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.map-wrap {
  grid-area: map;
  position: relative;
  height: 62vh;
  min-height: 340px;
}

.map {
  position: absolute;
  inset: 0;
}



/* A segmented control from native radios: keyboard and screen readers keep working. */







.legend {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px 12px;
  font-size: 14px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  flex: none;
  width: 26px;
  height: 5px;
  border-radius: 3px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--petrol-dark);
}

.places {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.places .button {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 14px;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.source {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.source a {
  color: var(--petrol-dark);
}

.card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 28px;
  max-height: calc(100% - 56px);
  overflow: auto;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgb(0 0 40 / 20%);
}

.card h2 {
  margin: 0 32px 8px 0;
  font-size: 18px;
}

.card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 14px;
}

.card dt {
  color: var(--muted);
}

.card dd {
  margin: 0;
}

.card-source {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.card-close:focus-visible {
  outline: 2px solid var(--petrol);
}

@media (min-width: 900px) {
  .energy {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .layout {
    flex: 1;
    min-height: 0;
    grid-template-columns: 360px 1fr;
    grid-template-areas: "controls map";
  }

  .controls {
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }

  .legend {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    height: auto;
    min-height: 0;
  }

  .card {
    left: auto;
    right: 16px;
    top: 16px;
    bottom: auto;
    width: 320px;
  }
}

.assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.assets legend,
.legend-title {
  margin: 0 0 4px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.legend-title {
  margin-top: 12px;
}

.legend {
  margin-top: 4px;
}

.swatch.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 7px;
}

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