/* ===== ESTIMATOR — interactive beregner (blueprint 06) =====
   Section forces the built-in dark "outage" palette via data-theme="outage"
   on the <section>, so tokens resolve dark regardless of page theme. */

#estimator {
  padding: var(--s8) 0;
  background: var(--bg);           /* dark, via data-theme="outage" */
  color: var(--ink);
}
#estimator .section-head h2 { color: var(--ink); }
#estimator .section-head p { color: var(--muted); }

#estimator .est-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--grid-gap);
  margin-top: var(--s5);
  align-items: start;
}
@media (max-width: 900px) { #estimator .est-grid { grid-template-columns: 1fr; } }
/* prevent grid blowout: children must be allowed to shrink below content width */
#estimator .est-grid > * { min-width: 0; }

/* ---------- inputs ---------- */
#estimator .est-inputs {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  padding: var(--s4);
}
#estimator .est-group-label {
  margin: 0 0 var(--s3);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); font-weight: 700;
}
#estimator .est-field { border: 0; margin: 0 0 var(--s4); padding: 0; }
#estimator .est-field legend {
  padding: 0; margin-bottom: 10px;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
#estimator .est-choices { display: flex; gap: 8px; flex-wrap: wrap; }
#estimator .est-choices--2 { display: grid; grid-template-columns: 1fr 1fr; }

#estimator .est-choice {
  flex: 1 1 auto;
  min-width: 62px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 10px);
  padding: 10px 12px;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
#estimator .est-choice--wide { display: flex; flex-direction: column; gap: 2px; }
#estimator .est-choice .c-title { font-weight: 600; font-size: 14px; }
#estimator .est-choice .c-sub { font-size: 12px; color: var(--muted); }
#estimator .est-choice:hover { border-color: var(--green); }
#estimator .est-choice.is-active {
  border-color: var(--green);
  background: rgba(0, 180, 131, .14);
  box-shadow: inset 0 0 0 1px var(--green);
}
#estimator .est-choice.is-active .c-sub { color: var(--ink); }

#estimator .est-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

/* solar switch */
#estimator .est-switch {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; margin-top: var(--s2);
  padding-top: var(--s3); border-top: 1px solid var(--line);
}
#estimator .est-switch input { position: absolute; opacity: 0; pointer-events: none; }
#estimator .est-switch-track {
  flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px;
  background: var(--line); position: relative; transition: background .18s;
}
#estimator .est-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .18s;
}
#estimator .est-switch input:checked + .est-switch-track { background: var(--green); }
#estimator .est-switch input:checked + .est-switch-track .est-switch-thumb { transform: translateX(20px); }
#estimator .est-switch input:focus-visible + .est-switch-track { outline: 2px solid var(--green); outline-offset: 2px; }
#estimator .est-switch-text { display: flex; flex-direction: column; gap: 1px; }
#estimator .est-switch-text .c-title { font-weight: 600; font-size: 14px; }
#estimator .est-switch-text .c-sub { font-size: 12px; color: var(--muted); }

/* ---------- result ---------- */
#estimator .est-result {
  background: linear-gradient(165deg, var(--bg-elev), color-mix(in srgb, var(--slate) 22%, var(--bg-elev)));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  padding: var(--s4);
}
#estimator .est-scenario {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  margin-bottom: var(--s3);
}
#estimator .est-scn {
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); background: transparent; border: 0;
  padding: 6px 14px; border-radius: 999px; transition: color .15s, background .15s;
}
#estimator .est-scn.is-active { color: #04140e; background: var(--green); }

#estimator .est-config-label {
  margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
#estimator .est-config {
  margin: 6px 0 var(--s4); font-size: clamp(20px, 3vw, 28px); color: var(--ink);
  letter-spacing: -.01em;
}

#estimator .est-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
#estimator .est-kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-md, 12px);
  background: var(--bg);
}
#estimator .est-kpi--accent { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
#estimator .est-kpi .k-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#estimator .est-kpi .k-value { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; color: var(--ink); line-height: 1.1; }
#estimator .est-kpi--accent .k-value { color: var(--green); }
#estimator .est-kpi .k-sub { font-size: 12px; color: var(--muted); }

/* revenue split bars */
#estimator .est-breakdown { margin-top: var(--s4); }
#estimator .est-breakdown-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 2px 10px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
#estimator .est-config { overflow-wrap: anywhere; }
#estimator .est-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
#estimator .est-bar {
  display: grid; grid-template-columns: 116px 1fr auto; align-items: center; gap: 10px;
  font-size: 13px;
}
#estimator .est-bar-key { color: var(--muted); }
#estimator .est-bar-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
#estimator .est-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--green); }
#estimator .est-bar-val { color: var(--ink); font-size: 12px; text-align: right; }
#estimator .est-bar.is-empty .est-bar-key,
#estimator .est-bar.is-empty .est-bar-val { opacity: .45; }

/* payback */
#estimator .est-payback {
  margin-top: var(--s4); padding: var(--s3);
  border: 1px solid color-mix(in srgb, var(--green) 40%, var(--line));
  border-radius: var(--radius-md, 12px);
  background: rgba(0, 180, 131, .07);
}
#estimator .est-payback .p-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#estimator .est-payback .p-value {
  font-size: clamp(34px, 6vw, 52px); font-weight: 800; color: var(--green); line-height: 1.05;
}
#estimator .est-payback .p-unit { font-size: .42em; color: var(--muted); font-weight: 700; }
#estimator .est-payback .p-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

#estimator .est-cta { width: 100%; justify-content: center; margin-top: var(--s4); text-align: center; }
#estimator .est-disclaimer { margin: var(--s2) 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }

@media (max-width: 520px) {
  #estimator .est-choices--2 { grid-template-columns: 1fr; }
  #estimator .est-kpis { grid-template-columns: 1fr; }
  #estimator .est-bar { grid-template-columns: 92px 1fr auto; }
}
