/* ------------------------------------------------------------------ */
/* tokens                                                              */
/* ------------------------------------------------------------------ */
:root {
  --bg: #0e1116;
  --bg-raised: #161b23;
  --bg-sunk: #0a0d12;
  --line: #252c37;
  --line-soft: #1c222b;
  --text: #e8edf4;
  --text-dim: #97a3b4;
  --text-faint: #6b7787;
  --accent: #ffb547;
  --accent-strong: #ff9d1e;
  --accent-ink: #241703;
  --good: #4ade80;
  --bad: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f9;
    --bg-raised: #ffffff;
    --bg-sunk: #eaeef4;
    --line: #dfe4ec;
    --line-soft: #eaeef4;
    --text: #131820;
    --text-dim: #56606f;
    --text-faint: #808b9a;
    --accent: #e08600;
    --accent-strong: #c56f00;
    --accent-ink: #ffffff;
    --good: #16a34a;
    --bad: #dc2626;
    --shadow: 0 8px 24px rgba(20, 30, 50, .10);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ */
/* chrome                                                              */
/* ------------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: radial-gradient(circle at 32% 30%, #ffd88a, var(--accent-strong) 62%, #b45c00);
  box-shadow: 0 0 0 1px rgba(255, 181, 71, .35), 0 0 22px rgba(255, 157, 30, .35);
  flex: none;
}

.topbar h1 { font-size: 18px; }
.topbar p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-dim); }

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

.badge {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--bg-sunk);
}

.badge-warn { color: var(--accent); border-color: rgba(255, 181, 71, .4); }

/* ------------------------------------------------------------------ */
/* layout                                                              */
/* ------------------------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px 8px;
  align-items: start;
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .column-right { order: -1; }
}

.column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.column-right { position: sticky; top: 20px; }

@media (max-width: 980px) {
  .column-right { position: static; }
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.field-hidden { display: none !important; }
.is-hidden { display: none !important; }

/* ------------------------------------------------------------------ */
/* form                                                                */
/* ------------------------------------------------------------------ */
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field-row .field { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row .field { margin-bottom: 0; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .01em;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 181, 71, .18);
}

#postcode { text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

select { cursor: pointer; }

.btn {
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .08s, filter .15s, background .15s;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

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

.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--text-faint); }

.notice {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
}

.notice-error {
  border-color: rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .08);
  color: var(--bad);
}

.notice-warn {
  margin: -6px 0 16px;
  border-color: rgba(255, 181, 71, .45);
  background: rgba(255, 181, 71, .09);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.notice-warn strong { color: var(--accent); }

/* ------------------------------------------------------------------ */
/* results                                                             */
/* ------------------------------------------------------------------ */
.subject {
  margin: -6px 0 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  background: var(--bg-sunk);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  font-weight: 600;
}

.stat-value {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value small { font-size: 13px; font-weight: 600; color: var(--text-dim); margin-left: 2px; }
.stat-sub { margin-top: 2px; font-size: 12px; color: var(--text-faint); }
.stat-hero .stat-value { color: var(--accent); }

.slider-block { margin-top: 18px; }

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-value {
  font-size: 13px;
  font-weight: 640;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-raised);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .4);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-raised);
  cursor: pointer;
}

/* MCS -------------------------------------------------------------- */
.basis {
  margin: -6px 0 16px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.55;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
  color: var(--text-dim);
}

.basis strong { color: var(--text); font-weight: 620; }
.basis-on { border-color: rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .07); }
.basis-on strong { color: var(--good); }
.basis-off { border-color: rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .07); }
.basis-off strong { color: var(--accent); }

.mcs-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  margin-bottom: 18px;
}

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

.mcs-inputs .field { margin-bottom: 0; }
.field-narrow { max-width: 220px; }

.link-btn {
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.link-btn:hover { filter: brightness(1.15); }

.mcs-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.mcs-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  vertical-align: top;
}

.mcs-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}

.mcs-table tr.mcs-section td {
  padding-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}

.mcs-table tr:first-child.mcs-section td { padding-top: 4px; }

.mcs-statements { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }

.mcs-statements p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-faint);
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.mcs-statements .clause {
  display: inline-block;
  font-weight: 700;
  color: var(--text-dim);
  margin-right: 6px;
}

/* battery ---------------------------------------------------------- */
.battery-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.battery-block select { margin-bottom: 14px; }

/* the headline reason for buying storage */
.uplift {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255, 181, 71, .09);
  border: 1px solid rgba(255, 181, 71, .32);
}

.uplift-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}

.uplift-figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.uplift-from {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-faint);
}

.uplift-arrow { font-size: 24px; color: var(--text-faint); }

.uplift-to {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--accent);
}

.uplift-delta {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 181, 71, .2);
}

.uplift-sub {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.uplift-sub strong { color: var(--text); font-weight: 660; }

@media (max-width: 460px) {
  .uplift-to { font-size: 38px; }
  .uplift-from { font-size: 25px; }
}

.assumption-heading {
  margin: 18px 0 -4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
}

details {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-dim);
  list-style: none;
  user-select: none;
}

summary::-webkit-details-marker { display: none; }
summary::before { content: "▸ "; color: var(--text-faint); }
details[open] summary::before { content: "▾ "; }

.assumption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.assumption-grid .field { margin-bottom: 0; }
.assumption-grid input { padding: 8px 10px; font-size: 13.5px; }

.table-scroll { overflow-x: auto; margin-top: 12px; }

.roof-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.roof-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.roof-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  white-space: nowrap;
}

.roof-table td:first-child { color: var(--text); font-weight: 600; }

.source-note {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* map                                                                 */
/* ------------------------------------------------------------------ */
.card-map { display: flex; flex-direction: column; padding-bottom: 14px; }

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.map-head .card-title { margin-bottom: 12px; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.tab {
  padding: 5px 13px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.tab.is-active { background: var(--accent); color: var(--accent-ink); }

.map-stage {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  min-height: 380px;
}

@media (max-width: 980px) {
  .map-stage { min-height: 320px; aspect-ratio: 1 / 1; }
}

.map-surface { position: absolute; inset: 0; width: 100%; height: 100%; }

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(128, 139, 154, .05) 12px 24px),
    var(--bg-sunk);
}

.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 13, 18, .78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 11px;
  color: #dfe6ef;
}

.legend-ramp {
  width: 84px;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #3b4cc0, #4bb3d1, #7fd47f, #f2d43f, #f2793f);
}

.map-caption {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--text-faint);
  min-height: 18px;
}

/* plan view */
.plan-svg { width: 100%; height: 100%; display: block; }
.plan-bg { fill: var(--bg-sunk); }
.plan-building { fill: rgba(148, 163, 184, .10); stroke: rgba(148, 163, 184, .5); stroke-width: .35; }
.plan-segment { fill: rgba(148, 163, 184, .07); stroke: rgba(148, 163, 184, .28); stroke-width: .2; }
.plan-panel { stroke: rgba(0, 0, 0, .55); stroke-width: .05; }
.plan-label { fill: var(--text-faint); font-size: 1.1px; font-family: var(--font); }

/* ------------------------------------------------------------------ */
/* enquiry                                                             */
/* ------------------------------------------------------------------ */
.btn-enquiry { margin-top: 18px; }

.btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}

.btn-quiet:hover { color: var(--text); border-color: var(--text-faint); }

.notice-good {
  border-color: rgba(74, 222, 128, .45);
  background: rgba(74, 222, 128, .09);
  color: var(--good);
}

.enquiry-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.enquiry-dialog::backdrop {
  background: rgba(8, 11, 16, .62);
  backdrop-filter: blur(3px);
}

.enquiry-dialog form { padding: 20px; }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.dialog-head h2 { font-size: 17px; }

.dialog-close {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.dialog-close:hover { color: var(--text); }

.dialog-intro { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); }

.dialog-summary {
  background: var(--bg-sunk);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.dialog-summary strong { color: var(--text); font-weight: 620; }
.dialog-summary .summary-address { display: block; margin-bottom: 4px; }

.optional { color: var(--text-faint); font-weight: 500; }

textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  min-height: 66px;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 181, 71, .18);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.dialog-privacy {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* footer + busy                                                       */
/* ------------------------------------------------------------------ */
.footer {
  padding: 18px 24px 28px;
  max-width: 900px;
}

.footer p { margin: 0; font-size: 12px; color: var(--text-faint); line-height: 1.6; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: rgba(10, 13, 18, .55);
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .btn:active { transform: none; }
}
