:root {
  --bg: #f7f3ea;
  --surface: #ffffff;
  --surface-2: #fbf7ee;
  --border: #e5decc;
  --ink: #1e2420;
  --muted: #6c6455;
  --accent: #d98a2b;
  --accent-ink: #7a4409;
  --accent-tint: rgba(217, 138, 43, 0.12);
  --accent2: #1c6e5c;
  --accent2-tint: rgba(28, 110, 92, 0.12);
  --good: #1c7a5b;
  --good-tint: rgba(28, 122, 91, 0.14);
  --warn: #a86a0f;
  --warn-tint: rgba(168, 106, 15, 0.14);
  --bad: #ad3b3b;
  --bad-tint: rgba(173, 59, 59, 0.13);
  --shadow: 0 1px 2px rgba(35, 26, 8, 0.06), 0 8px 24px rgba(35, 26, 8, 0.07);

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Heebo has no Arabic glyphs and Cairo has no Hebrew glyphs, so this
   branches on language, not just direction — [dir="rtl"] alone would
   silently fall back to a system font for one of the two scripts. */
html[lang="he"] {
  --font-display: "Heebo", system-ui, sans-serif;
  --font-body: "Heebo", system-ui, sans-serif;
}

html[lang="ar"] {
  --font-display: "Cairo", system-ui, sans-serif;
  --font-body: "Cairo", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130e;
    --surface: #201b13;
    --surface-2: #251f16;
    --border: #3a3325;
    --ink: #f2ede0;
    --muted: #b6ac97;
    --accent: #f0aa4c;
    --accent-ink: #ffe0ac;
    --accent-tint: rgba(240, 170, 76, 0.16);
    --accent2: #4fd6b5;
    --accent2-tint: rgba(79, 214, 181, 0.16);
    --good: #4fd6b5;
    --good-tint: rgba(79, 214, 181, 0.16);
    --warn: #f0bb56;
    --warn-tint: rgba(240, 187, 86, 0.16);
    --bad: #ee8f8f;
    --bad-tint: rgba(238, 143, 143, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #16130e;
  --surface: #201b13;
  --surface-2: #251f16;
  --border: #3a3325;
  --ink: #f2ede0;
  --muted: #b6ac97;
  --accent: #f0aa4c;
  --accent-ink: #ffe0ac;
  --accent-tint: rgba(240, 170, 76, 0.16);
  --accent2: #4fd6b5;
  --accent2-tint: rgba(79, 214, 181, 0.16);
  --good: #4fd6b5;
  --good-tint: rgba(79, 214, 181, 0.16);
  --warn: #f0bb56;
  --warn-tint: rgba(240, 187, 86, 0.16);
  --bad: #ee8f8f;
  --bad-tint: rgba(238, 143, 143, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

/* Without this, an element's own class (e.g. .field-row{display:flex})
   beats the browser's default [hidden]{display:none} at equal
   specificity, since author styles win ties over the UA stylesheet —
   so a hidden form row would stay visible. Always toggle via el.hidden,
   never el.style.display. */
[hidden] {
  display: none !important;
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---- Header ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
}

.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mode-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.mode-btn.active {
  background: var(--ink);
  color: var(--bg);
}

/* ---- Global saved-quotes panel ---- */

.saved-quotes-wrap {
  position: relative;
}

/* Share: after the controls on wide screens; on phones, in the top
   corner beside the logo (the controls wrap onto the next line). */
.topbar-controls {
  margin-inline-start: auto;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.share-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .brand {
    flex: 1 1 0;
    min-width: 0;
  }
  .share-btn {
    order: 1;
  }
  .topbar-controls {
    order: 2;
    margin-inline-start: 0;
  }
}

.share-sheet {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  padding: 18px;
}

.share-sheet::backdrop {
  background: rgba(20, 16, 8, 0.45);
}

/* Phones: a sheet sliding up from the bottom edge. */
@media (max-width: 640px) {
  .share-sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-head h2 {
  margin: 0;
  font-size: 18px;
}

.share-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.share-sub {
  margin: 6px 0 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-row input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

.share-copy {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent2);
  color: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.share-opt {
  box-sizing: border-box;
  display: block;
  text-align: center;
  padding: 11px 10px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.share-opt.wa {
  background: #1fa855;
  color: #fff;
}

.share-opt.tg {
  background: #229ed9;
  color: #fff;
}

.share-opt.fb {
  background: #1877f2;
  color: #fff;
}

.share-opt.mail,
.share-opt.more {
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent2);
}

.share-opt[hidden] {
  display: none;
}

.saved-quotes-wrap .saved-toggle {
  margin: 0;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

/* Phones: just the folder icon, so the header controls fit in two rows
   and the page's own content starts higher. */
@media (max-width: 640px) {
  .saved-quotes-wrap .saved-label {
    display: none;
  }
  .saved-quotes-wrap .saved-toggle {
    padding: 8px 12px;
  }
}

.saved-panel {
  /* Positioned in JS (openSavedQuotesPanel), same clamped-to-viewport
     approach as .tip-popover — a wrap-relative absolute position would
     run off-screen on narrow viewports since the toggle button isn't
     pinned to the row's edge once the topbar wraps. */
  position: fixed;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 40;
}

.saved-panel h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ---- Page footer: what the figures are based on + feedback ---- */

.page-footer {
  margin-top: 22px;
}

.placeholder-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.placeholder-banner strong {
  color: var(--ink);
}

/* ---- Layout ---- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* While the homeowner wizard is still on an input step (1–3), the results
   column has nothing to show yet — collapse to one column so the form
   panel isn't left with an empty, unbalanced-looking neighbor. Step 4
   (results) and installer mode both use the normal two-column layout. */
body.wizard-collapsed .layout {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

.form-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 16px;
}

@media (max-width: 860px) {
  .results-panel {
    position: static;
  }
}

/* ---- Field groups ---- */

.field-group h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 10px;
}

.required-star {
  color: var(--bad);
  font-weight: 700;
}

/* ---- Installer mode: divide the single long page into clear sections ---- */

body.installer-mode .field-group,
body.installer-mode .advanced {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.field-row label,
.field-row legend {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-row select,
.field-row input[type="number"],
.field-row input[type="text"] {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
}

.info-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.info-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Card radios ---- */

.card-radio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-radio-row.three {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 520px) {
  .card-radio-row.three {
    grid-template-columns: 1fr 1fr;
  }
}

.card-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.card-radio-body {
  display: block;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.12s, background 0.12s;
}

.card-radio input:checked + .card-radio-body {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.card-radio input:focus-visible + .card-radio-body {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-radio-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
}

.card-radio-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* ---- Segmented control ---- */

.segmented {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

/* Each option is its own bordered, rounded button with a real gap
   between them — a shared outer pill with a 1px internal divider read
   as "one row of info text", not as separate clickable choices. */
.segment {
  flex: 1;
  text-align: center;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.12s, background 0.12s;
}

.segment input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Marks the more-precise options (real kWh / real bill) as visually
   distinct from a plain default like "household profile" — otherwise
   all segments read as equal-weight choices and the more accurate ones
   are easy to skip past without noticing they exist. */
.segment.segment-precise {
  background: var(--accent2-tint);
  color: var(--accent2);
  border-color: var(--accent2);
  font-weight: 700;
}

.segment:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ---- Toggles / checkboxes ---- */

.toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13.5px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  margin: 8px 0;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"]:not(.card-radio input, .segment input) {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ---- Full year grid ---- */

.full-year-grid {
  display: grid;
  /* minmax(0, …): inputs have a wide built-in minimum width that would
     otherwise push the columns past the screen edge on phones. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 520px) {
  .full-year-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.fy-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.fy-hint {
  margin: 8px 0 0;
}

.fy-field[hidden],
.fy-pair[hidden] {
  display: none;
}

.fy-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 7px;
  font-size: 13px;
  color: var(--ink);
}

/* ---- Advanced details ---- */

.advanced summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent2);
  padding: 4px 0;
}

.advanced[open] summary {
  margin-bottom: 6px;
}

fieldset.field-row {
  border: none;
  padding: 0;
  margin: 10px 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

/* Two independent label+input stacks side by side would leave the
   inputs at different heights whenever one label wraps to 2 lines and
   the other doesn't (exactly what happened live — "big AC" is a
   longer label than "small AC" in Hebrew). Explicit grid areas put
   both labels in row 1 and both inputs in row 2 of the SAME parent
   grid, so row 1 always stretches to the taller label and both inputs
   start at the same y regardless of label length; .ac-count-field
   becomes display:contents so its label/input children participate
   directly in that grid instead of forming their own nested box. */
.ac-count-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas: "label1 label2 label3" "input1 input2 input3" "watts1 watts2 watts3";
  gap: 4px 10px;
  margin-bottom: 10px;
}

.ac-count-field {
  display: contents;
}

.ac-count-field:nth-child(1) > label:first-child { grid-area: label1; }
.ac-count-field:nth-child(1) > input { grid-area: input1; }
.ac-count-field:nth-child(1) > .watts-box { grid-area: watts1; }
.ac-count-field:nth-child(2) > label:first-child { grid-area: label2; }
.ac-count-field:nth-child(2) > input { grid-area: input2; }
.ac-count-field:nth-child(2) > .watts-box { grid-area: watts2; }
.ac-count-field:nth-child(3) > label:first-child { grid-area: label3; }
.ac-count-field:nth-child(3) > input { grid-area: input3; }
.ac-count-field:nth-child(3) > .watts-box { grid-area: watts3; }

.ac-count-field > label:first-child {
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.ac-count-field > input {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* Optional "real wattage, if known" box next to an appliance. Empty by
   default; the placeholder shows the typical value that's used. */
.watts-box,
.field-row .watts-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: text;
}

.watts-box input[type="number"],
.field-row .watts-box input[type="number"] {
  width: 64px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12.5px;
  text-align: end;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.watts-box input[type="number"]::-webkit-outer-spin-button,
.watts-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field-row .watts-box input[type="number"]:focus,
.field-row .watts-box input[type="number"]:not(:placeholder-shown) {
  border-style: solid;
  border-color: var(--accent2);
}

.appliance-list {
  display: grid;
  gap: 0;
}

.appliance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.appliance-row:last-child {
  border-bottom: none;
}

.appliance-row .checkbox-row {
  flex: 1;
  margin: 7px 0;
}

.ev-details-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

/* ---- Buttons ---- */

.btn-primary {
  background: var(--accent);
  color: #1a1204;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--accent2);
  color: var(--accent2);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

/* ---- Results: confidence ---- */

.confidence-block {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.confidence-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.confidence-badge {
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.confidence-badge.low {
  background: var(--bad-tint);
  color: var(--bad);
}
.confidence-badge.med {
  background: var(--warn-tint);
  color: var(--warn);
}
.confidence-badge.high {
  background: var(--good-tint);
  color: var(--good);
}

.conf-item {
  margin: 8px 0;
}

.conf-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 34px;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

.conf-bar-missing {
  font-size: 10.5px;
  color: var(--muted);
  margin: 3px 0 0;
  padding-inline-start: 118px;
  line-height: 1.4;
}

.conf-bar-label {
  color: var(--muted);
}

.conf-bar-track {
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.conf-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent2);
  border-radius: 999px;
}

.conf-bar-pct {
  font-family: var(--font-mono);
  text-align: end;
  color: var(--muted);
}

/* ---- Results: cards ---- */

.result-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  .result-cards {
    grid-template-columns: 1fr;
  }
}

.result-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.result-value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ---- Cost ---- */

.cost-range {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--accent-ink);
}

.cost-dash {
  color: var(--muted);
  font-size: 18px;
}

.cost-currency {
  font-size: 14px;
  color: var(--muted);
}

.cost-accuracy-note {
  margin: 2px 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.cost-with-install {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 600;
}

.cost-with-install span {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Installation is the one cost component with no reliable market-wide
   price (see costRows.installHint) — kept visually separate from the
   read-only, well-grounded hardware breakdown below it, as its own
   always-visible editable field rather than a plain table row. */
.install-cost-row {
  margin: 4px 0 10px;
}

.install-cost-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0 12px;
}

.install-cost-currency {
  color: var(--muted);
  font-size: 14px;
}

.install-cost-input-wrap input {
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 15px;
  width: 100%;
  color: var(--ink);
}

.install-cost-input-wrap input:focus {
  outline: none;
}

.install-cost-input-wrap:focus-within {
  border-color: var(--accent);
}

.cost-breakdown summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--accent2);
  font-weight: 700;
  margin-top: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

table td, table th {
  padding: 7px 6px;
  text-align: start;
  border-bottom: 1px solid var(--border);
}

table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.buy-link {
  display: inline-block;
  margin-inline-start: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent2);
  text-decoration: none;
  white-space: nowrap;
}

.buy-link:hover {
  text-decoration: underline;
}

.cost-source {
  font-size: 11.5px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.45;
}

.rec-unavailable td {
  opacity: 0.55;
}

.print-shop {
  color: #666;
  font-size: 0.9em;
}

.total-row td {
  font-weight: 700;
  border-top: 1.5px solid var(--ink);
  border-bottom: none;
}

/* ---- Summary / tips ---- */

.plain-summary {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.callout {
  background: var(--warn-tint);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

/* Usage step: which part of the year sets the system's size. (Both
   classes, to beat the later .homeowner-only display: block.) */
.season-note.homeowner-only {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border-inline-start: 4px solid var(--accent);
  background: var(--accent-tint);
}

.season-icon {
  font-size: 22px;
  line-height: 1.3;
}

.season-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}

.season-text {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.accuracy-tips {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ---- Campervans ----
   The van is its own path through the same steps: home-only parts hide,
   van-only parts show (body.van-mode, set in updateConditionalVisibility). */

body.van-mode .home-only {
  display: none !important;
}

body:not(.van-mode) .van-only {
  display: none !important;
}

/* The van card sits full width under off-grid / grid-connected. */
.card-radio.wide {
  grid-column: 1 / -1;
}

.van-sub-title {
  margin-top: 14px;
}

.van-group {
  margin: 14px 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.van-typical {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.result-cards.van-cards {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 12px;
}

.van-cards .result-value {
  font-size: 18px;
}

.van-weight {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.van-weight strong {
  color: var(--ink);
}

.van-notes {
  margin: 10px 0 0;
  padding: 10px 14px 10px 30px;
  border-radius: 12px;
  background: var(--accent-tint);
  font-size: 14px;
  line-height: 1.5;
}

[dir="rtl"] .van-notes {
  padding: 10px 30px 10px 14px;
}

.van-notes li + li {
  margin-top: 6px;
}

.van-parts {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.van-parts td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.van-parts td:last-child {
  text-align: end;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
  padding-inline-start: 10px;
}

.van-parts .vp-spec {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.van-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  line-height: 1.5;
}

.van-checklist li {
  position: relative;
  padding-inline-start: 26px;
}

.van-checklist li + li {
  margin-top: 9px;
}

.van-checklist li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 2px;
  color: var(--accent2);
  font-weight: 800;
}

/* ---- Installer-only ---- */

.installer-only {
  display: none;
}

body.installer-mode .installer-only {
  display: block;
}

.homeowner-only {
  display: block;
}

body.installer-mode .homeowner-only {
  display: none;
}

.installer-only h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 18px 0 8px;
}

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

#profileEstimateHint {
  font-size: 12.5px;
  color: var(--accent2);
  font-weight: 600;
  margin: 10px 0 0;
}

/* Address field + its suggestions dropdown. */
.addr-wrap {
  position: relative;
}

.addr-suggest {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  max-height: 290px;
  overflow-y: auto;
}

.addr-suggest li {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.addr-suggest li.active,
.addr-suggest li[data-i]:hover {
  background: var(--accent2-tint);
}

.addr-suggest li.addr-none {
  color: var(--muted);
  font-size: 13.5px;
  cursor: default;
}

.geo-status {
  font-size: 12.5px;
  color: var(--accent2);
  font-weight: 600;
  margin: 8px 0 0;
}

.geo-status.geo-status-warn {
  color: var(--warn);
}

/* A pre-filled default nobody has tapped yet: faded text, turns solid
   on first tap (see DIMMABLE_IDS in app.js). The id selector outranks
   the per-field input styles that set the text color. */
#calcForm .is-default {
  color: var(--muted);
  color: color-mix(in srgb, var(--ink) 40%, transparent);
}

/* Step counter and reset button share the top line; the step name gets
   the full width underneath so it never wraps around the button. */
.form-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "count reset" "name name";
  align-items: center;
  column-gap: 12px;
  margin: -4px 0 -6px;
}

.form-toolbar .wizard-header {
  display: contents;
}

.reset-btn {
  grid-area: reset;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.reset-btn:hover,
.reset-btn:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
}

/* ---- Homeowner wizard ---- */

/* The page's title is the first thing to read on each wizard step,
   under the progress bar. */
.wizard-step-name {
  grid-area: name;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 6px 0 0;
}

.wizard-nav {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.required-legend {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}

.wizard-missing {
  font-size: 12.5px;
  color: var(--warn);
  background: var(--warn-tint);
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0;
}

.wizard-nav-buttons {
  display: flex;
  gap: 10px;
}

.wizard-nav-buttons .btn-secondary,
.wizard-nav-buttons .btn-primary {
  flex: 1;
  margin-top: 0;
}

.wizard-nav-buttons button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.weight-sliders {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}

.weight-sliders label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.weight-sliders input[type="range"] {
  accent-color: var(--accent2);
}

.rec-block {
  margin-bottom: 16px;
}

.rec-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--accent2);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.rec-table-scroll {
  overflow-x: auto;
}

.rec-table {
  min-width: 480px;
}

.rec-table td:first-child,
.rec-table th:first-child {
  width: 28px;
}

.rec-table input[type="radio"] {
  accent-color: var(--accent2);
  cursor: pointer;
}

.rec-selected {
  background: var(--good-tint);
}

.rec-star {
  color: var(--accent);
}

.rec-brands {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
}

.rec-total-bar {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0 18px;
}

#quoteTable {
  overflow-x: auto;
  display: block;
}

/* ---- Tooltip ---- */

.tip-popover {
  position: fixed;
  max-width: min(260px, 80vw);
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 50;
}

/* ---- Month-by-month chart ---- */

#monthChart svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
}

.mc-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.mc-axis {
  fill: var(--muted);
  font-size: 9px;
  font-family: var(--font-body);
}

.mc-prod {
  fill: var(--accent);
}

.mc-short {
  fill: var(--bad);
  opacity: 0.75;
}

.mc-use {
  stroke: var(--ink);
  stroke-width: 2;
}

.mc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

.mc-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-inline-end: 5px;
  vertical-align: -1px;
}

.mc-key.prod {
  background: var(--accent);
}

.mc-key.use {
  height: 2px;
  vertical-align: 3px;
  background: var(--ink);
}

.mc-key.short {
  background: var(--bad);
  opacity: 0.75;
}

.mc-unit {
  margin-inline-start: auto;
}

.month-chart-note {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 8px 0 0;
}

/* ---- Homeowner cost view ---- */

/* The part cards replace these for homeowners. */
body:not(.installer-mode) #resultCards {
  display: none;
}

.pm-chip {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
}

#homeEquipChip {
  margin-inline-start: 6px;
}

.part-cards {
  margin-top: 12px;
}

/* Contact: a real quote / second opinion, and feedback. */
.consult-card {
  padding: 16px;
  border: 1px solid var(--accent2);
  border-radius: 14px;
  background: var(--accent2-tint);
}

.consult-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

/* An upright oval, so the whole face shows (hair to chin). */
.consult-photo {
  width: 64px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent2);
}

.consult-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
}

.consult-sub {
  margin: 4px 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* In Tzur's own voice: a little larger and darker than the note below. */
.consult-personal {
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 4px;
}

.consult-note {
  margin-top: 18px;
}

.consult-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.consult-btn {
  flex: 1;
  box-sizing: border-box;
  min-width: 110px;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.consult-btn.wa {
  background: #1fa855;
  color: #fff;
}

.consult-btn.tg {
  background: #229ed9;
  color: #fff;
}

.consult-btn.mail {
  border: 1px solid var(--accent2);
  color: var(--accent2);
  background: var(--surface);
}

.feedback-line {
  margin: 14px 4px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.feedback-line a {
  color: var(--accent2);
  font-weight: 600;
}

.installer-estimates .hi-row {
  margin: 8px 0;
  font-size: 13.5px;
}

#homeEstimateRows .hi-row {
  margin-bottom: 4px;
}

/* Installation + total: secondary to the equipment cost. */
.home-install {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.hi-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.hi-row + .hi-row {
  margin-top: 4px;
}

/* Amounts like "~₪8,000" keep the ~ before the number in RTL too. */
.hi-row > span:last-child {
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.hi-total {
  color: var(--ink);
  font-weight: 700;
}

.hi-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.part-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.part-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: start;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
}

.part-card:hover {
  border-color: var(--accent2);
}

.part-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.part-title,
.part-price {
  font-weight: 700;
  font-size: 15px;
}

.part-price {
  white-space: nowrap;
}

.part-sub {
  color: var(--muted);
  font-size: 13.5px;
}

.part-chevron::after {
  content: "›";
  font-size: 22px;
  color: var(--muted);
}

[dir="rtl"] .part-chevron::after {
  content: "‹";
}

.shopping-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--accent2);
  background: var(--accent2-tint);
  color: var(--accent2);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.install-quote {
  margin-top: 12px;
  font-size: 13.5px;
}

.install-quote summary {
  cursor: pointer;
  color: var(--accent2);
  font-weight: 600;
}

/* Installer table: opens a part's page. */
.compare-link {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent2);
  cursor: pointer;
}

.compare-link:hover {
  text-decoration: underline;
}

/* ---- Sub-pages (part details, shopping list) ---- */

/* Full screen on phones, a centered panel on wider screens. */
.sub-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0 16px 32px;
  border: none;
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
}

@media (min-width: 640px) {
  .sub-page {
    width: min(560px, 100%);
    height: auto;
    max-height: 92vh;
    margin: auto;
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
}

.sub-page::backdrop {
  background: rgba(20, 16, 8, 0.45);
}

#subPageBody {
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
}

.pp-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  padding: 12px 0 4px;
}

.pp-back {
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--accent2);
  padding: 6px 0;
  cursor: pointer;
}

.pp-back::before {
  content: "‹ ";
}

[dir="rtl"] .pp-back::before {
  content: "› ";
}

.pp-title {
  font-size: 22px;
  margin: 4px 0 12px;
}

.pp-current,
.pp-option {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface);
}

.pp-current {
  border: 2px solid var(--accent2);
  padding: 14px;
}

.pp-option {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pp-name {
  font-weight: 700;
  font-size: 16px;
}

.pp-size {
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
}

.pp-price {
  margin-top: 6px;
  font-size: 16px;
}

.pp-verdict {
  margin-top: 6px;
}

.pp-muted {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
  margin: 6px 0 0;
}

.pp-tag {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.pp-tag.good {
  background: var(--good-tint);
  color: var(--good);
}

.pp-tag.warn {
  background: var(--warn-tint);
  color: var(--warn);
}

.pp-h {
  font-size: 15px;
  color: var(--muted);
  margin: 18px 0 6px;
}

.pp-diff {
  font-weight: 700;
  white-space: nowrap;
}

.pp-diff.more {
  color: var(--bad);
}

.pp-diff.less {
  color: var(--good);
}

.pp-choose,
.pp-buy {
  border: 1px solid var(--accent2);
  background: var(--accent2-tint);
  color: var(--accent2);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  padding: 7px 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.pp-reset {
  margin-top: 12px;
}

.pp-details {
  margin-top: 18px;
}

.pp-details summary {
  cursor: pointer;
  color: var(--accent2);
  font-weight: 700;
}

.pp-brand {
  border-top: 1px solid var(--border);
  padding: 10px 0;
  font-size: 14px;
}

.pp-brand-name {
  font-weight: 700;
}

.pp-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pp-dots {
  color: var(--ink);
  letter-spacing: 1px;
}

.pp-brand ul {
  margin: 6px 0;
  padding-inline-start: 18px;
  line-height: 1.45;
}

.pp-sources {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.pp-sources a {
  color: var(--accent2);
}

/* Under every set of Buy links: the shops are independent of SunScope. */
.shop-disclaimer {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-inline-start: 3px solid var(--border);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.sp-stale {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--warn);
}

.price-check-notice {
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.sp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.sp-main {
  flex: 1;
  min-width: 0;
}

.sp-buys {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sp-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 0;
  border-top: 1.5px solid var(--ink);
  margin-top: 4px;
}

/* ---- Save / load ---- */

.save-row {
  display: flex;
  gap: 8px;
}

.save-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.saved-quotes-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saved-quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.saved-quote-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-quote-date {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.saved-quote-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-tiny {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-tiny-danger {
  border-color: var(--bad);
  color: var(--bad);
}

.print-btn {
  width: 100%;
  margin-top: 4px;
}

/* ---- Print ---- */

#printSheet {
  display: none;
}

/* "SunScope has a new address" — once, after the move from the old one. */
.moved-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--accent2);
  border-radius: 12px;
  background: var(--accent2-tint);
  font-size: 0.95rem;
  line-height: 1.45;
}
.moved-note[hidden] {
  display: none;
}
.moved-note span {
  flex: 1;
}
.moved-close {
  flex: none;
  margin: -4px -2px 0 0;
  padding: 0 6px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1.2;
  cursor: pointer;
}

@media print {
  body > *:not(#printSheet) {
    display: none !important;
  }
  #printSheet {
    display: block !important;
    color: #000;
    background: #fff;
    font-family: var(--font-body);
  }
  #printSheet h1 {
    font-size: 22px;
    margin: 0 0 2px;
    font-family: var(--font-display);
  }
  #printSheet .print-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
  }
  #printSheet .print-biz-phone {
    font-size: 12px;
    color: #444;
  }
  #printSheet .print-meta {
    font-size: 12px;
    color: #555;
    margin-bottom: 18px;
  }
  #printSheet .print-section {
    margin-bottom: 16px;
    page-break-inside: avoid;
  }
  #printSheet h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #444;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
    margin: 0 0 8px;
    font-family: var(--font-body);
  }
  #printSheet table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  #printSheet td, #printSheet th {
    padding: 5px 6px;
    border-bottom: 1px solid #ddd;
    color: #000;
    text-align: start;
  }
  #printSheet .print-cost-range {
    font-weight: 700;
    font-size: 14px;
    margin: 8px 0 0;
  }
  #printSheet .print-install-note {
    font-size: 10.5px;
    color: #666;
    margin: 4px 0 0;
  }
  #printSheet .print-footer {
    font-size: 10px;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 8px;
    margin-top: 20px;
  }
}


/* ==== Homeowner UX: what's read first is the biggest =====================
   Welcome page → progress bar → step title (largest) → one framed card per
   question with a large title → the inputs → small grey hints.            */

/* Homeowners get one focused column, also on wide screens. */
body:not(.installer-mode) .app {
  max-width: 720px;
}

body:not(.installer-mode) .layout {
  grid-template-columns: 1fr;
}

body:not(.installer-mode) .results-panel {
  position: static;
}

/* ---- Welcome ---- */

.welcome {
  text-align: center;
  padding: 6px 2px 0;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 4px 0 8px;
}

.welcome-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 auto 14px;
  max-width: 30em;
}

.welcome-based {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}

.welcome-points {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 28em;
  display: grid;
  gap: 12px;
  text-align: start;
}

.welcome-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 4px;
}

.wp-icon {
  font-size: 22px;
  line-height: 1.3;
}

.wp-title {
  display: block;
  font-weight: 700;
  font-size: 15.5px;
}

.wp-text {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.welcome-meta {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Progress bar ---- */

.stepper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper li {
  flex: 1;
  position: relative;
  min-width: 0;
}

/* The line to the previous step, coloured once that step is done. */
.stepper li + li::before {
  content: "";
  position: absolute;
  top: 14px;
  inset-inline-end: 50%;
  width: 100%;
  height: 3px;
  background: var(--border);
}

.stepper li.done::before,
.stepper li.current::before {
  background: var(--accent2);
}

/* Above every connecting line (a line is drawn by the next step). */
.stepper button {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.stepper button:disabled {
  cursor: default;
}

.st-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
}

.stepper li.done .st-dot {
  background: var(--accent2);
  border-color: var(--accent2);
  color: var(--surface);
}

.stepper li.current .st-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #1e2420;
  box-shadow: 0 0 0 4px var(--accent-tint);
}

.st-label {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper li.current .st-label {
  color: var(--ink);
  font-weight: 800;
}

/* ---- Question cards ---- */

/* Section titles: a big, plain heading, not small grey capitals. */
body:not(.installer-mode) .field-group > h2 {
  font-size: 20px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 4px 0 10px;
}

/* Where the step title already says it. */
body:not(.installer-mode) #h-location,
body:not(.installer-mode) #h-roof,
body:not(.installer-mode) #h-consumption {
  display: none;
}

/* Each question and its answer, framed together. */
body:not(.installer-mode) .field-group .field-row,
body:not(.installer-mode) .usage-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
  background: var(--surface);
}

/* No frame inside a frame. */
body:not(.installer-mode) .field-row .field-row,
body:not(.installer-mode) .usage-card .field-row {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 12px 0 0;
}


/* The question: larger and darker than anything else in its frame. */
body:not(.installer-mode) .field-group .field-row > label,
body:not(.installer-mode) .field-group .field-row > legend,
body:not(.installer-mode) .field-group .switch-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

body:not(.installer-mode) .field-group .field-row .hint {
  margin-top: 2px;
}


/* ---- Results sections ----
   Your system → Cost (equipment, installation) → month by month →
   accuracy, each under a large title. Homeowners get each as its own
   card, so the panel around them steps back. */

.res-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
}

.res-subtitle {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 18px 0 8px;
}

.res-subtitle:first-of-type {
  margin-top: 0;
}

body:not(.installer-mode) .results-panel {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  gap: 14px;
}

body:not(.installer-mode) .res-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

body:not(.installer-mode) .plain-summary {
  font-size: 15.5px;
}

/* The accuracy title is the section title, with the score beside it. */
body:not(.installer-mode) .confidence-head {
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 4px;
}

body:not(.installer-mode) .confidence-head > span:first-child {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

body:not(.installer-mode) .res-accuracy .accuracy-tips {
  margin-top: 14px;
}


/* ---- Usage step: electricity a month, peak power, the home ---- */

.usage-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 4px;
}

.usage-home-title {
  font-size: 20px;
  margin-top: 22px;
}

.usage-explain {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 6px;
}

.usage-estimate {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent2);
  margin: 8px 0 0;
}

/* Both classes, to beat the later .homeowner-only display: block. */
.usage-links.homeowner-only {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.link-btn {
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent2);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  background: var(--accent2-tint);
}

/* Inside a question's card, the field label sits under its title. */
body:not(.installer-mode) .usage-card .field-row > label {
  font-size: 15px;
}


/* ---- Sizing goal (grid-connected) ---- */

/* A section title with its (i) right beside it. */
.field-group > h2.h-with-tip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-cap {
  margin-top: 8px;
}

.grid-value {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--accent2);
  margin: 0;
}

.grid-payback {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 0;
}

/* A usage question's title with its (i) beside it. */
.usage-title.h-with-tip {
  display: flex;
  align-items: center;
  gap: 8px;
}

#usageTimeCard .segmented {
  margin-top: 8px;
}

/* ---- How a solar system works (welcome page) ---- */

.hiw {
  margin: 16px auto 0;
  max-width: 30em;
  text-align: start;
}

.hiw summary {
  cursor: pointer;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent2);
  padding: 6px 0;
}

.hiw[open] {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px 12px;
}

.hiw-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 6px 0 4px;
}

.hiw-wall, .hiw-roof { fill: var(--surface-2); stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }
.hiw-window { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.hiw-ground { stroke: var(--border); stroke-width: 2; }
.hiw-sun circle { fill: var(--accent); }
.hiw-sun path { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.hiw-ray { stroke: var(--accent); stroke-width: 2; fill: none; opacity: 0.8; }
.hiw-panel { fill: #24497a; stroke: #9db7d8; stroke-width: 1; }
.hiw-panel-grid { stroke: #9db7d8; stroke-width: 1; }
.hiw-bulb { fill: var(--accent); }
.hiw-bulb-base { fill: var(--muted); }
.hiw-dc { stroke: var(--accent); stroke-width: 3; fill: none; }
.hiw-ac { stroke: var(--accent2); stroke-width: 3; fill: none; }
/* The battery's own green — distinct from the inverter's teal in both themes. */
.hiw-batline { stroke: #6cbf45; stroke-width: 3; fill: none; }
.hiw-gridline { stroke: var(--muted); stroke-width: 3; fill: none; }
.hiw-arrowhead { fill: var(--muted); }
.hiw-box { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.hiw-sine { stroke: var(--accent2); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.hiw-bat-cap { fill: var(--ink); }
.hiw-bat-bar { fill: #6cbf45; }
.hiw-pole { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; fill: none; }
.hiw-label { font-family: var(--font-body); font-size: 15px; font-weight: 700; fill: var(--ink); text-anchor: middle; }

/* Electricity flowing: sun → panels → inverter → home. */
.hiw-flow {
  stroke-dasharray: 6 6;
  animation: hiw-dash 1.2s linear infinite;
}

@keyframes hiw-dash {
  to {
    stroke-dashoffset: -24;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hiw-flow {
    animation: none;
  }
}

.hiw-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.hiw-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.hiw-list strong {
  color: var(--ink);
}

/* Each part's colour, as in the drawing. */
.hiw-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 5px;
}

.hiw-dot-panels { background: #24497a; }
.hiw-dot-inverter { background: var(--accent2); }
.hiw-dot-battery { background: #6cbf45; }
.hiw-dot-home { background: var(--accent); }
.hiw-dot-grid { background: var(--muted); }

/* The statement's last line: what the anonymous counting records. */
.banner-privacy {
  display: block;
  margin-top: 6px;
  font-size: 0.9em;
  opacity: 0.85;
}

/* ---- Panel direction & angle ---- */

.field-row > label.tilt-label {
  margin-top: 10px;
}

.angle-tip {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.use-angle-btn {
  align-self: flex-start;
  margin-top: 4px;
}
