/* Home charger planner (#home-planner). Mobile first, 390px phone is the
   main target. Colors and buttons follow ios27.css and drev-buttons.css. */
#home-planner {
  --hp-card: rgba(14, 24, 40, 0.72);
  --hp-line: rgba(255, 255, 255, 0.10);
  --hp-soft: rgba(255, 255, 255, 0.05);
  --hp-text: #eef4ff;
  --hp-muted: rgba(220, 232, 248, 0.66);
  --hp-cyan: #00d4ff;
  --hp-amber: #ffb84d;
  --hp-r: 22px;
  color: var(--hp-text);
  padding: 18px 16px 20px;
  border: 1px solid var(--hp-line);
  border-radius: var(--r-panel, 28px);
  background: var(--hp-card);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  scroll-margin-top: 12px;
}
#home-planner *, #home-planner *::before, #home-planner *::after { box-sizing: border-box; }
#home-planner svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Head */
.hp-head { margin-bottom: 14px; }
.hp-kicker { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; color: var(--hp-cyan); }
#home-planner .hp-head h3 { margin: 6px 0 6px; font-size: 24px; line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: 0; }
#home-planner .hp-head p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--hp-muted); max-width: 60ch; }

/* Step bar */
.hp-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; }
.hp-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 52px; padding: 6px 2px;
  border: 1px solid var(--hp-line); border-radius: 14px; background: var(--hp-soft); color: var(--hp-muted);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.hp-step b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; background: rgba(255,255,255,.08); color: #fff; }
.hp-step.is-active { border-color: var(--hp-cyan); background: rgba(0, 212, 255, 0.12); color: #fff; }
.hp-step.is-active b { background: linear-gradient(135deg, #0052cc, #00d4ff); }
.hp-step.is-done b { background: rgba(0, 212, 255, 0.35); }
.hp-step:disabled { opacity: .45; cursor: default; }

/* Panels */
.hp-panel[hidden] { display: none !important; }
#home-planner .hp-q { margin: 0 0 12px; font-size: 19px; font-weight: 800; color: #fff; }
#home-planner .hp-sub { margin: -6px 0 12px; font-size: 14px; color: var(--hp-muted); }
#home-planner .hp-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--hp-muted); }
#home-planner .hp-fine { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--hp-muted); }

/* Type tiles */
.hp-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hp-types > button {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  min-height: 72px; padding: 12px; text-align: left; border: 1px solid var(--hp-line); border-radius: 18px;
  background: var(--hp-soft); color: var(--hp-text); font: inherit; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.hp-types > button svg { grid-row: 1 / span 2; width: 30px; height: 30px; color: var(--hp-cyan); }
.hp-types > button b { font-size: 15px; font-weight: 800; line-height: 1.2; }
.hp-types > button small { font-size: 12px; color: var(--hp-muted); line-height: 1.25; }
.hp-types > button:hover { border-color: rgba(0, 212, 255, 0.4); }
.hp-types > button[aria-checked="true"] { border-color: var(--hp-cyan); background: rgba(0, 212, 255, 0.13); box-shadow: 0 0 0 1px var(--hp-cyan) inset; }

/* Guide */
.hp-guide { margin-top: 14px; padding: 14px; border-radius: 18px; border: 1px solid rgba(0, 212, 255, 0.22); background: rgba(0, 40, 70, 0.35); }
#home-planner .hp-guide h5 { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: #fff; }
.hp-guide ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; }
.hp-guide li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--hp-text); }
.hp-guide li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--hp-cyan); }
.hp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hp-chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hp-line);
  background: rgba(255, 255, 255, 0.06); color: var(--hp-text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.hp-chip[aria-pressed="true"] { border-color: var(--hp-cyan); background: rgba(0, 212, 255, 0.18); color: #fff; }

/* Buttons (round 7 style: pills sized to the label) */
#home-planner .hp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; max-width: 100%;
  min-height: 46px; padding: 0 22px; border-radius: var(--r-pill, 9999px); font: inherit; font-size: 15px; font-weight: 750;
  cursor: pointer; white-space: nowrap; transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}
#home-planner .hp-btn svg { width: 18px; height: 18px; }
#home-planner .hp-btn-primary { border: 0; color: #fff; background: linear-gradient(135deg, #0052cc, #00d4ff); box-shadow: 0 6px 24px rgba(0, 150, 255, 0.35); }
#home-planner .hp-btn-primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); }
#home-planner .hp-btn-ghost { border: 1px solid rgba(255, 255, 255, 0.18); color: #eaf6ff; background: rgba(255, 255, 255, 0.07); }
#home-planner .hp-btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
#home-planner .hp-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.hp-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.hp-nav .hp-btn-primary { margin-left: auto; }

/* Search */
.hp-search { margin: 0 0 12px; }
.hp-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
#home-planner .hp-search input {
  flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 14px; font: inherit; font-size: 16px;
  color: #fff; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); outline: none;
}
#home-planner .hp-search input:focus { border-color: var(--hp-cyan); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25); }
#home-planner .hp-search-row .hp-btn { padding: 0 18px; }
.hp-status { margin: 10px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--hp-muted); }
.hp-status[data-state="error"] { color: #ff9b9b; }
.hp-status[data-state="ready"] { color: #8ff0c6; }
.hp-status[data-state="loading"] { color: #9fe8ff; }

/* Map */
.hp-map-wrap {
  position: relative; width: 100%; aspect-ratio: 4 / 3.4; min-height: 280px; overflow: hidden;
  border-radius: var(--hp-r); border: 1px solid var(--hp-line); background: #08111d;
}
#home-planner .hp-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.hp-map-static { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.hp-static-hit { position: absolute; inset: 0; display: none; }
.hp-map-wrap:has(.hp-map-static:not([hidden])) .hp-static-hit { display: block; }
.hp-static-pins { position: absolute; inset: 0; }
.hp-static-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hp-static-lines line { stroke-width: 3; stroke-dasharray: 6 5; }
.hp-map-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px;
  text-align: center; color: var(--hp-muted); font-size: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(0, 212, 255, 0.10), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 32px), #08111d;
}
.hp-map-empty[hidden] { display: none; }
.hp-map-empty svg { width: 34px; height: 34px; color: var(--hp-cyan); }
#home-planner .mapboxgl-ctrl-attrib { font-size: 10px; }
.hp-panel[data-step="3"] .hp-map-wrap { cursor: crosshair; }

/* Pins */
.hp-pins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.hp-pins > button {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--hp-line); background: rgba(255, 255, 255, 0.06);
  color: var(--hp-text); font: inherit; font-size: 14px; font-weight: 750; cursor: pointer;
}
.hp-pins > button[aria-pressed="true"] { border-color: var(--hp-cyan); background: rgba(0, 212, 255, 0.16); color: #fff; }
.hp-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.hp-dot-charger { background: var(--hp-cyan); }
.hp-dot-car { background: #fff; }
.hp-dot-power { background: var(--hp-amber); }
.hp-pin {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); cursor: grab;
}
.hp-pin svg { width: 18px; height: 18px; transform: rotate(45deg); stroke-width: 2.2; }
.hp-pin-charger { background: #0089c9; color: #fff; }
.hp-pin-car { background: #f4f7fb; color: #0b1626; border-color: #0b1626; }
.hp-pin-power { background: #d98a1c; color: #fff; }
.hp-pin-static { position: absolute; margin: -34px 0 0 0; transform-origin: 0 100%; pointer-events: none; }

/* Readout */
.hp-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.hp-readout > div { padding: 12px; border-radius: 16px; border: 1px solid var(--hp-line); background: var(--hp-soft); }
.hp-readout span { display: block; font-size: 12px; color: var(--hp-muted); }
.hp-readout b { display: block; margin-top: 4px; font-size: 20px; font-weight: 800; color: #fff; }
.hp-readout p { grid-column: 1 / -1; margin: 0; }
#hp-verdict { padding: 10px 12px; border-radius: 14px; font-size: 14px; font-weight: 700; background: var(--hp-soft); color: var(--hp-muted); }
#hp-verdict[data-level="ok"] { background: rgba(48, 209, 88, 0.14); color: #8ff0b0; }
#hp-verdict[data-level="tight"] { background: rgba(255, 184, 77, 0.14); color: #ffd28f; }
#hp-verdict[data-level="far"] { background: rgba(255, 90, 90, 0.14); color: #ffaaaa; }

/* AR */
.hp-ar {
  position: relative; width: 100%; height: 360px; overflow: hidden; border-radius: var(--hp-r);
  border: 1px solid var(--hp-line);
  background: radial-gradient(circle at 50% 35%, rgba(120, 170, 230, 0.20), transparent 65%), linear-gradient(180deg, #1a2433, #0b121c);
}
.hp-ar model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.hp-ar-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--hp-muted); font-size: 14px; }
#home-planner .hp-ar-btn { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); }
.hp-ar-note { margin: 10px 0 0; font-size: 14px; color: var(--hp-text); }
.hp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.hp-facts li { padding: 10px; border-radius: 14px; border: 1px solid var(--hp-line); background: var(--hp-soft); }
.hp-facts b { display: block; font-size: 14px; color: #fff; }
.hp-facts span { font-size: 12px; color: var(--hp-muted); }

/* Summary */
.hp-summary { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 0; padding: 14px; border-radius: 18px; border: 1px solid var(--hp-line); background: var(--hp-soft); }
.hp-summary dt { font-size: 13px; color: var(--hp-muted); }
.hp-summary dd { margin: 0; font-size: 14.5px; font-weight: 700; color: #fff; overflow-wrap: anywhere; }

/* Desktop: map or AR beside the controls */
@media (min-width: 900px) {
  #home-planner { padding: 26px 28px 28px; }
  #home-planner .hp-head h3 { font-size: 30px; }
  .hp-steps { max-width: 620px; }
  .hp-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hp-panel[data-step="2"], .hp-panel[data-step="3"], .hp-panel[data-step="4"] {
    display: grid; grid-template-columns: minmax(300px, 0.85fr) 1.15fr; column-gap: 24px; align-items: start;
  }
  .hp-panel[data-step="2"] > *, .hp-panel[data-step="3"] > *, .hp-panel[data-step="4"] > * { grid-column: 1; }
  .hp-panel[data-step="2"] > .hp-map-slot, .hp-panel[data-step="3"] > .hp-map-slot, .hp-panel[data-step="4"] > .hp-ar { grid-column: 2; grid-row: 1 / span 8; }
  .hp-map-wrap { aspect-ratio: 4 / 3; min-height: 380px; }
  .hp-ar { height: 440px; }
}
@media (max-width: 360px) {
  .hp-types { grid-template-columns: 1fr; }
  .hp-step span { font-size: 11px; }
}

/* Goals (residential offerings) */
#home-planner .hp-q-goals { margin-top: 18px; }
.hp-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hp-goals > button {
  display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  min-height: 60px; padding: 10px; text-align: left; border: 1px solid var(--hp-line); border-radius: 16px;
  background: var(--hp-soft); color: var(--hp-text); font: inherit; cursor: pointer;
}
.hp-goals > button svg { grid-row: 1 / span 2; width: 24px; height: 24px; color: var(--hp-cyan); }
.hp-goals > button b { font-size: 14px; font-weight: 800; line-height: 1.2; }
.hp-goals > button small { font-size: 11.5px; color: var(--hp-muted); line-height: 1.25; }
.hp-goals > button[aria-pressed="true"] { border-color: var(--hp-cyan); background: rgba(0, 212, 255, 0.13); box-shadow: 0 0 0 1px var(--hp-cyan) inset; }
.hp-fit { margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; color: #ffd28f; background: rgba(255, 184, 77, 0.10); border: 1px solid rgba(255, 184, 77, 0.25); }
.hp-fit[hidden] { display: none; }

/* What we check next */
#home-planner .hp-check-title { margin: 16px 0 8px; font-size: 15px; font-weight: 800; color: #fff; }
.hp-check { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hp-check li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--hp-line); background: var(--hp-soft); font-size: 13.5px; }
.hp-check b { color: #fff; }
.hp-check span { color: var(--hp-muted); line-height: 1.4; }
@media (min-width: 900px) {
  .hp-goals { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hp-goals > button { grid-template-columns: 1fr; grid-template-rows: auto auto auto; text-align: center; justify-items: center; row-gap: 4px; }
  .hp-goals > button svg { grid-row: auto; }
  .hp-check { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
