.energy-map-body header nav {
  max-width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

.energy-page {
  max-width: none;
  padding: 0;
  background: #f1f4f7;
  color: #172b3a;
  font-family: inherit;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.energy-workspace {
  padding: 10px 16px;
  width: 100%;
  max-width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.energy-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.energy-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #537482;
  font-weight: 700;
}

.energy-heading h1 {
  font-size: 24px;
  font-weight: 750;
  margin: 4px 0;
}

.energy-heading p,
.energy-detail p {
  font-size: 13px;
  color: #607584;
  line-height: 1.6;
}

.energy-filters {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.energy-filters label,
.energy-search {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.energy-workspace input:not([type=checkbox]):not([type=range]),
.energy-workspace select {
  background: white;
  border: 1px solid #d0dbe3;
  border-radius: 6px;
  padding: 8px;
  min-width: 0;
  color: #172b3a;
}

.energy-workspace button,
.energy-map-toolbar a {
  cursor: pointer;
}

.energy-workspace input[type=checkbox] {
  accent-color: #146d68;
  width: 15px;
  height: 15px;
}

.energy-filters button,
.energy-map-toolbar > * {
  padding: 8px 12px;
  border: 1px solid #d0dbe3;
  border-radius: 6px;
  background: white;
  font-size: 12px;
}

.energy-notice {
  font-size: 12px;
  color: #506679;
  margin-bottom: 8px;
  min-height: 18px;
  flex-shrink: 0;
}

.energy-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.energy-kpis > div {
  background: white;
  border: 1px solid #dde5eb;
  border-radius: 8px;
  padding: 10px 14px;
  display: grid;
  gap: 4px;
}

.energy-kpis span {
  font-size: 11px;
  color: #526e80;
}

.energy-kpis strong {
  font-size: 20px;
  letter-spacing: -0.5px;
}

.energy-kpis small {
  font-size: 11px;
  color: #667d8c;
}

.energy-grid {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  background: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.energy-toc {
  display: none;
}

.energy-toc.is-open {
  display: block;
  position: absolute;
  z-index: 30;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 280px;
  overflow-y: auto;
  background: #fffffff8;
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 24px #172b3a1f;
}

.energy-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.energy-section-heading h2 {
  font-size: 15px;
  font-weight: 700;
}

.energy-section-heading button {
  font-size: 11px;
  color: #537482;
}

.energy-search {
  margin: 14px 0;
}

.energy-toc fieldset {
  margin: 16px 0;
  border: 0;
  padding: 0;
  min-width: 0;
}

.energy-toc legend {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.energy-toc label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.energy-toc .energy-search {
  display: grid;
}

.energy-layer {
  margin: 10px 0 10px 12px;
}

.energy-layer label {
  font-size: 12px;
  flex-wrap: wrap;
}

.energy-layer small {
  margin-left: auto;
  font-size: 10px;
  color: #718698;
}

.energy-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.energy-layer input[type=range] {
  width: calc(100% - 26px);
  margin: 8px 0 0 24px;
  accent-color: #608b93;
  height: 3px;
}

.energy-setting {
  font-size: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.energy-help,
.energy-source-note {
  font-size: 11px;
  line-height: 1.7;
  color: #6b7e8d;
  margin-top: 16px;
}

.energy-source-note {
  border-top: 1px solid #e3e9ee;
  padding-top: 12px;
}

.energy-map-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  background: #e8eef0;
}

.energy-map-canvas {
  position: absolute;
  inset: 0;
}

.energy-map-toolbar {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.energy-map-toolbar > * {
  box-shadow: 0 2px 8px #172b3a12;
}

.energy-map-caption {
  position: absolute;
  bottom: 24px;
  left: 10px;
  font-size: 10px;
  color: #496070;
  background: #fffffff0;
  padding: 5px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

.energy-map-message {
  position: absolute;
  top: 56px;
  left: 12px;
  right: 12px;
  background: #fffcf0;
  border: 1px solid #e5d9ab;
  padding: 12px;
  font-size: 12px;
  border-radius: 6px;
  z-index: 10;
}

.energy-detail {
  display: none;
}

.energy-detail.is-open {
  display: block;
  position: absolute;
  z-index: 30;
  right: 12px;
  top: 12px;
  bottom: 12px;
  width: 320px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  background: #fffffff8;
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 24px #172b3a1f;
}

.energy-detail h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 10px 0;
}

.energy-detail dl {
  margin: 16px 0;
}

.energy-detail dt {
  font-size: 11px;
  color: #768998;
  margin-top: 12px;
}

.energy-detail dd {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  margin-top: 4px;
}

.energy-evidence {
  background: #f4f7f8;
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px;
  font-size: 12px;
}

.energy-evidence p {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.energy-detail-link {
  font-size: 12px;
  color: #146d68;
  display: block;
  margin-top: 14px;
}

.energy-results {
  background: white;
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  margin-top: 12px;
  padding: 14px 16px;
}

.energy-results label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.energy-results h2 span {
  color: #6a7d8d;
  font-size: 12px;
  margin-left: 8px;
}

.energy-table-scroll {
  max-height: 240px;
  overflow: auto;
  margin-top: 12px;
}

.energy-results table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}

.energy-results th {
  color: #6b7e8d;
  font-size: 11px;
  background: #f5f8fa;
  position: sticky;
  top: 0;
}

.energy-results td,
.energy-results th {
  padding: 10px 12px;
  border-bottom: 1px solid #e7edf1;
  white-space: nowrap;
}

.energy-results td button {
  font-weight: 650;
  color: #1d5b76;
  text-align: left;
}

.energy-results td small {
  display: block;
  color: #82919c;
  margin-top: 4px;
}

.energy-results tr.is-selected {
  background: #eef8f6;
}

.energy-drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid #d0dbe3;
  border-radius: 6px;
  background: white;
  font-size: 16px;
  line-height: 1;
  color: #4c6273;
  cursor: pointer;
}

.energy-drawer-close:hover {
  border-color: #146d68;
  color: #0f5e59;
}

.energy-section-heading > div {
  display: flex;
  gap: 6px;
  align-items: center;
}

.energy-marker-label {
  background: #fffffff2;
  border: 1px solid #d7e2e6;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 6px #0001;
  white-space: nowrap;
  cursor: pointer;
}

/* 라벨이 겹치는 곳에서는 마우스(또는 키보드 포커스)가 닿은 라벨만 맨 앞으로 온다 —
   maplibre 마커 요소는 position:absolute 라 z-index 가 형제들 위로 유효하다. */
.maplibregl-marker {
  z-index: 1;
}

.energy-marker-label:hover,
.energy-marker-label:focus-visible {
  z-index: 9999;
  border-color: #146d68;
  box-shadow: 0 4px 14px #172b3a33;
}

.energy-chart h3 {
  font-size: 13px;
  font-weight: 600;
}

.energy-chart small {
  font-size: 10px;
  color: #7b8b9a;
}

.energy-chart svg {
  width: 100%;
  margin-top: 8px;
}

.energy-chart svg text {
  font-size: 9px;
  fill: #718096;
}

.energy-chart p {
  color: #138477;
  font-size: 10px;
}

.energy-chart p span {
  color: #8796b4;
}

.energy-empty {
  padding: 12px;
  background: #f5f7f9;
  border-radius: 8px;
}

.energy-workspace :focus-visible {
  outline: 3px solid #1b8580;
  outline-offset: 3px;
}

@media (max-width: 1150px) {
  .energy-heading {
    align-items: start;
    flex-direction: column;
  }
  .energy-detail dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: baseline;
    gap: 5px;
  }
  .energy-detail dt {
    margin-top: 5px;
  }
}

@media (max-width: 650px) {
  .energy-workspace {
    padding: 8px;
  }
  .energy-heading h1 {
    font-size: 20px;
  }
  .energy-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 6px;
  }
  .energy-kpis > div {
    padding: 8px 10px;
  }
  .energy-kpis strong {
    font-size: 18px;
  }
  .energy-toc.is-open {
    width: min(280px, 85%);
  }
  .energy-detail.is-open {
    width: min(320px, 90%);
  }
  .energy-map-toolbar {
    flex-wrap: wrap;
    right: 50px;
  }
  .energy-results {
    padding: 12px 10px;
  }
  .energy-results .energy-section-heading {
    align-items: start;
    flex-direction: column;
  }
  .energy-filters {
    gap: 8px;
  }
  .energy-detail {
    padding: 16px;
  }
  .energy-toc fieldset {
    display: inline-block;
    vertical-align: top;
    width: 100%;
    margin: 8px 0;
  }
  .energy-help,
  .energy-source-note {
    margin-top: 10px;
  }
}
