.explorer {
  --ink: #181b22;
  --muted: #505c63;
  --line: #dce2dd;
  --wash: #f3f5f2;
  --blue: #1f3fa0;
  --fit: #176947;
  --tight: #8b510b;
  --over: #982e31;
  --close: #674d91;
  margin: 0;
  font: 15px/1.5 system-ui, sans-serif;
}

.explorer *, .explorer *::before, .explorer *::after { box-sizing: border-box; }
.explorer [hidden] { display: none !important; }
.explorer main { width: min(100%, 1200px); margin: auto; padding: 16px 24px 40px; }
.explorer h1, .explorer h2, .explorer h3, .explorer p { margin: 0; }
.explorer h1, .explorer h2 { font-family: Georgia, serif; font-weight: 400; line-height: 1.12; }
.explorer h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.04em; }
.explorer h2 { font-size: 28px; }
.explorer h3 { font-size: 17px; }
.explorer a { color: var(--blue); }
.explorer button, .explorer input, .explorer select { font: inherit; }
.explorer button, .explorer .button, .explorer summary {
  cursor: pointer;
  color: var(--ink);
}
.explorer button, .explorer .button {
  min-height: 36px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  text-decoration: none;
}
.explorer button:hover, .explorer .button:hover { background: var(--wash); }
.explorer button:disabled { opacity: .6; cursor: default; }
.explorer :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.explorer .primary { border-color: var(--blue); color: white; background: var(--blue); font-weight: 650; }
.explorer .primary:hover { background: #142e7d; }
.explorer input:not([type=range]), .explorer select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 8px;
  background: white;
  border: 1px solid #9aa59f;
  border-radius: 6px;
  color: var(--ink);
  font-size: 16px;
}
.explorer > header .wordmark a {
  color: var(--ink);
  font: 600 17px/1.5 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -.025em;
  text-decoration: none;
}
.explore-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.explorer .explore-lede { margin: 5px 0 14px; }
#keyDetails { position: relative; }
#keyDetails summary { font-weight: 600; white-space: nowrap; }
#keyDetails .access-key {
  width: min(360px, calc(100vw - 24px));
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1100;
  box-shadow: 0 6px 28px #181b2222;
}
.explorer .access-key-controls { align-items: stretch; }
.explorer .access-key-controls input { flex: 1 1 130px; }
.explorer .access-key-controls button[type=submit] { background: var(--blue); color: white; }

.input-bar {
  display: grid;
  grid-template-columns: minmax(235px, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--wash);
  padding: 12px 14px;
}
.location-fields, .chips, .actions, .map-tools, .legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.location-fields { flex-wrap: nowrap; }
.input-bar label, .input-bar legend { display: block; padding: 0; margin-bottom: 4px; font-weight: 650; font-size: 13px; }
.input-bar fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.plan { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; min-width: 0; }
.chips button { border-radius: 18px; min-height: 32px; padding: 3px 9px; font-size: 13px; white-space: nowrap; }
.chips [aria-pressed=true], .map-tools [aria-pressed=true] { color: var(--blue); border-color: #9aa9d8; background: #eaf0fd; }
.size-field { flex: 1 0 100%; }
.input-bar .status { grid-column: 1 / -1; }
.status, .muted { color: var(--muted); font-size: 13px; }
.status:empty { display: none; }

#map { height: 55vh; isolation: isolate; background: #e4ece8; }
.map-section { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
.map-tools { padding: 9px 13px 5px; gap: 8px; }
.map-tools label { white-space: nowrap; }
.map-tools input#inputRadius { width: 65px; }
.map-tools button { font-size: 13px; }
.legend { padding: 6px 13px; gap: 5px 14px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { height: 9px; width: 9px; border-radius: 50%; }
.explorer .sample-banner { padding: 5px 13px 9px; color: var(--muted); font-size: 13px; }
.pin-icon { background: none; border: none; }
.pin-icon span {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #24373980;
}
.pin-icon.substation span { border-radius: 3px; }
.pin-icon.selected span { box-shadow: 0 0 0 2px #181b22; }

.shortlist, .detail-panel, .next-steps { margin-top: 23px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-heading p { margin-top: 4px; }
#emptySampleActions { margin-top: 10px; }
.ranking summary { color: var(--blue); }
#weightsPanel { display: grid; gap: 4px; margin-top: 8px; }
#weightsPanel label { display: grid; grid-template-columns: 1fr 95px 3ch; align-items: center; gap: 8px; font-size: 13px; }
.explorer .mixed-levels { margin: 8px 0; color: var(--muted); }
.result-group { margin-top: 12px; }
.result-group ol { margin: 5px 0 8px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.explorer .result-row {
  display: grid;
  grid-template-columns: minmax(155px, 1fr) minmax(180px, 1fr) minmax(100px, auto) minmax(135px, auto);
  align-items: center;
  gap: 5px 14px;
  width: 100%;
  padding: 9px;
  text-align: left;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}
.explorer .result-row[aria-current=true] { background: var(--wash); }
.result-name { overflow-wrap: anywhere; }
.result-name strong { display: block; }
.level { display: inline-block; font-size: 12px; font-weight: 650; border: 1px solid var(--line); border-radius: 12px; padding: 0 7px; }
.verdict { display: inline-block; font-weight: 650; }
.verdict.fit { color: var(--fit); }
.verdict.tight { color: var(--tight); }
.verdict.over { color: var(--over); }
.verdict.close { color: var(--close); }
.verdict-note { color: var(--muted); font-size: 12px; margin-inline-start: 6px; white-space: nowrap; }
.detail-panel { padding: 18px; border: 1px solid var(--line); border-radius: 8px; scroll-margin-top: 12px; }
#detailBody > p { margin-top: 8px; }
.answer-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px 15px; margin: 12px 0; }
.answer-fields dt { font-size: 13px; color: var(--muted); }
.answer-fields dd { margin: 1px 0 0; font-weight: 650; }
.history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.history p, .history table { margin-top: 5px; }
.history table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history th, .history td { text-align: left; padding: 4px; border-bottom: 1px solid var(--line); }
.history .superseded { color: var(--muted); }
.next-steps .actions { margin-top: 10px; }
.next-steps .status, .next-steps .muted { margin-top: 6px; }
.explorer #watchPercent { width: 69px; margin-inline: 3px; }
#watchThreshold { display: block; }
.explorer .key-unlock { color: inherit; background: #f4effa; border-color: #dacbe8; }
#jsonQuery { margin-top: 10px; }
#queryText { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--wash); padding: 10px; }
.explorer > .tool-footer {
  width: calc(100% - 48px);
  max-width: 912px;
  margin: 32px auto 0;
  padding: 32px 0 64px;
  font: 400 12.5px/1.5 "DM Mono", "SF Mono", ui-monospace, monospace;
}
.explorer > .tool-footer a { color: inherit; text-decoration-color: #2f5d3a; text-underline-offset: 3px; }

@media (max-width: 850px) {
  .input-bar { grid-template-columns: minmax(0, 1fr); }
  .plan { justify-content: space-between; }
}
@media (max-width: 560px) {
  .explorer main { padding: 10px 10px 24px; }
  .explorer > header { gap: 6px; padding: 6px 10px; }
  .explorer > header > nav { margin-left: 0; gap: 4px; }
  .explorer > header > nav > a { height: 30px; padding: 4px 9px; font-size: 13px; }
  .explorer .explore-lede { margin-bottom: 8px; font-size: 13px; }
  .input-bar { padding: 8px; gap: 7px; }
  .plan { align-items: start; }
  .chips { gap: 4px; }
  .chips button { min-height: 30px; padding: 3px 7px; font-size: 12px; }
  #map { height: 45vh; }
  .explorer .result-row { grid-template-columns: minmax(0, 1fr) auto; }
  .result-verdict { grid-column: 1 / -1; grid-row: 2; }
  .result-changed { grid-column: 1 / -1; }
  .detail-panel { padding: 12px; }
}

.plan-fields { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: end; }
.plan-fields label { margin: 0; }
.plan-fields label input, .plan-fields label select { display: block; width: 112px; }
.plan-fields label[data-input=chargers] input, .plan-fields label[data-input=miles] input { width: 135px; }
.plan-fields label[data-input=unit] select { width: 75px; }
.plan-fields .times { padding-bottom: 7px; }
.size-field .muted { margin-top: 4px; }
.directions { display: grid; gap: 8px; margin: 8px 0 0; }
@media (max-width: 560px) {
  .plan { gap: 6px; }
  .chips button { white-space: normal; text-align: left; }
}
