:root {
  --tnb-blue: #0057a8;
  --tnb-blue-deep: #003f7d;
  --tnb-blue-dark: #062d55;
  --tnb-blue-soft: #eaf4ff;
  --tnb-red: #ed1c24;
  --tnb-red-dark: #c81018;
  --sun-yellow: #f6c445;
  --battery-green: #0b8f72;
  --battery-green-soft: #e9f8f3;
  --grid-slate: #74849a;
  --ink: #142033;
  --ink-soft: #44536a;
  --muted: #6d7b8e;
  --line: #dce4ee;
  --line-strong: #c7d3e0;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --surface-blue: #f1f7fd;
  --warning: #a96500;
  --warning-soft: #fff5d9;
  --danger: #b4232b;
  --danger-soft: #fff0f0;
  --success: #08715b;
  --success-soft: #e7f8f1;
  --shadow-sm: 0 1px 2px rgb(16 35 57 / 5%), 0 8px 24px rgb(16 35 57 / 5%);
  --shadow-md: 0 20px 60px rgb(0 49 94 / 13%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
summary {
  font: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

input {
  color: var(--ink);
}

select {
  color: var(--ink);
}

a {
  color: inherit;
}

svg {
  display: block;
}

.noscript {
  padding: 12px 18px;
  color: white;
  background: var(--danger);
  font-weight: 700;
  text-align: center;
}

.top-accent {
  height: 5px;
  background: linear-gradient(90deg, var(--tnb-red) 0 22%, var(--tnb-blue) 22% 100%);
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 82% 10%, rgb(255 255 255 / 15%), transparent 24%),
    radial-gradient(circle at 72% 78%, rgb(41 160 255 / 20%), transparent 28%),
    linear-gradient(135deg, var(--tnb-blue-dark), var(--tnb-blue) 64%, #0b6dc4);
}

.hero::after {
  position: absolute;
  right: -120px;
  bottom: -240px;
  width: 520px;
  height: 520px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  box-shadow:
    0 0 0 64px rgb(255 255 255 / 3%),
    0 0 0 128px rgb(255 255 255 / 2%);
  content: "";
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding-bottom: 22px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid rgb(255 255 255 / 15%);
}

.brand-lockup {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: white;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 85%);
  border-radius: 9px;
  color: white;
  font-family: Georgia, serif;
  font-style: italic;
}

.research-preview-tag {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid rgb(255 227 135 / 45%);
  border-radius: 999px;
  color: #ffe9a8;
  background: rgb(255 196 0 / 10%);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.independent-label {
  color: rgb(255 255 255 / 70%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  gap: 32px;
  align-items: center;
  padding-top: 20px;
}

.section-kicker,
.verdict-box__eyebrow {
  margin: 0 0 9px;
  color: inherit;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 3.4vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero__lead {
  max-width: 720px;
  margin: 10px 0 0;
  color: rgb(255 255 255 / 80%);
  font-size: 14px;
  line-height: 1.45;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.hero__badges span {
  padding: 5px 9px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  color: rgb(255 255 255 / 78%);
  background: rgb(255 255 255 / 7%);
  font-size: 11px;
  font-weight: 650;
}

.hero__diagram {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 8%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
  backdrop-filter: blur(10px);
}

.diagram-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}

.energy-node {
  display: flex;
  min-width: 0;
  min-height: 72px;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 13px;
  color: white;
  background: rgb(0 28 55 / 20%);
  font-size: 12px;
  font-weight: 800;
}

.energy-node__icon {
  color: var(--sun-yellow);
  font-size: 28px;
  line-height: 1;
}

.energy-node svg {
  width: 28px;
  height: 28px;
}

.energy-node--home {
  color: #eaf6ff;
}

.energy-node--battery {
  color: #74e0c4;
}

.energy-arrow {
  color: rgb(255 255 255 / 52%);
  font-size: 16px;
}

.scenario-options {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}

.scenario-option {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 9px;
  background: rgb(0 28 55 / 18%);
  text-align: center;
}

.scenario-option--battery {
  border-color: rgb(116 224 196 / 34%);
  background: rgb(11 143 114 / 14%);
}

.scenario-option strong,
.scenario-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-option strong {
  font-size: 10px;
}

.scenario-option small,
.scenario-or {
  color: rgb(255 255 255 / 60%);
  font-size: 8px;
}

.grid-tag {
  margin-top: 2px;
  color: rgb(255 255 255 / 62%);
  font-size: 11px;
  text-align: center;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.96fr);
  gap: 28px;
  align-items: start;
  padding-block: 54px 70px;
}

.inputs-column,
.results-column {
  min-width: 0;
}

.section-heading {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading--wide {
  align-items: start;
}

.section-heading h2,
.results-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.section-heading p:not(.section-kicker) {
  margin: 7px 0 0;
  color: var(--muted);
}

.section-kicker {
  color: var(--tnb-blue);
}

.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--tnb-blue);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.text-button:hover {
  color: var(--tnb-red);
}

.panel,
.results-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.input-panel {
  padding: 23px;
}

.input-panel + .input-panel,
.input-panel + .advanced-panel,
.advanced-panel + .input-actions {
  margin-top: 16px;
}

.panel__header {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 19px;
}

.panel__header h3,
.advanced-section h3,
.flow-section h3,
.threshold-box h3,
.verdict-box h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.018em;
}

.panel__header p,
.advanced-section__heading p,
.subsection-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.step-badge {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--tnb-blue);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 5px 14px rgb(0 87 168 / 22%);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 17px;
}

.preset-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.preset-control-row .preset-chip {
  min-height: 44px;
}

.preset-custom {
  display: flex;
  min-width: 142px;
  min-height: 44px;
  flex: 1 1 142px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fbfdff;
}

.preset-custom:focus-within {
  border-color: var(--tnb-blue);
  background: white;
  box-shadow: 0 0 0 3px rgb(0 87 168 / 10%);
}

.preset-custom__label {
  padding-left: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.preset-custom input {
  width: 62px;
  min-width: 0;
  flex: 1 1 62px;
  padding: 8px 4px 8px 7px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.preset-custom__unit {
  padding-right: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.preset-inline-stat {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.preset-inline-stat strong {
  color: var(--tnb-blue-deep);
  font-size: 13px;
}

.preset-chip {
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: white;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: 140ms ease;
}

.preset-chip:hover {
  border-color: var(--tnb-blue);
  color: var(--tnb-blue);
  transform: translateY(-1px);
}

.preset-chip.is-active {
  border-color: var(--tnb-blue);
  color: white;
  background: var(--tnb-blue);
  box-shadow: 0 4px 12px rgb(0 87 168 / 18%);
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.solar-cost-summary {
  margin-top: 18px;
}

.battery-maximizer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgb(0 87 168 / 18%);
  border-radius: var(--radius-sm);
  background: var(--surface-blue);
}

.battery-maximizer__copy {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: baseline;
}

.battery-maximizer__copy strong {
  color: var(--tnb-blue-deep);
  font-size: 18px;
}

.battery-maximizer__copy small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.compact-action-button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--tnb-blue);
  border-radius: var(--radius-sm);
  color: white;
  background: var(--tnb-blue);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 140ms ease;
}

.compact-action-button:hover {
  background: var(--tnb-blue-deep);
  transform: translateY(-1px);
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.field__help {
  color: var(--muted);
  font-size: 10px;
}

.field__help a {
  color: var(--tnb-blue);
  font-weight: 700;
}

.field--wide {
  grid-column: span 2;
}

.select-input {
  width: 100%;
  min-height: 45px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: #fbfdff;
  font-size: 12px;
  font-weight: 700;
}

.select-input:focus {
  border-color: var(--tnb-blue);
  box-shadow: 0 0 0 3px rgb(0 87 168 / 10%);
}

.afa-recent-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.afa-month-chip {
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: white;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  cursor: pointer;
}

.afa-month-chip strong {
  display: block;
  color: var(--tnb-blue-deep);
  font-size: 11px;
}

.afa-month-chip.is-active {
  border-color: var(--tnb-blue);
  color: white;
  background: var(--tnb-blue);
}

.afa-month-chip.is-active strong {
  color: white;
}

.input-with-unit {
  display: flex;
  min-height: 45px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  transition: 140ms ease;
}

.input-with-unit:focus-within {
  border-color: var(--tnb-blue);
  background: white;
  box-shadow: 0 0 0 3px rgb(0 87 168 / 10%);
}

.input-with-unit input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 750;
}

.input-with-unit > span {
  flex: 0 0 auto;
  padding: 0 11px 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.input-with-unit--prefix > span {
  padding: 0 2px 0 11px;
}

.field--readout {
  min-height: 74px;
  justify-content: center;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-blue);
}

.field--readout strong {
  color: var(--tnb-blue-deep);
  font-size: 20px;
  line-height: 1;
}

.field--readout > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.field--highlight .input-with-unit {
  border-color: #efc05a;
  background: var(--warning-soft);
}

.slider-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.slider-block--compact {
  margin-top: 16px;
  padding-top: 15px;
}

.slider-block__heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.slider-block__heading label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.slider-block__heading p {
  max-width: 510px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.percentage-pill {
  min-width: 59px;
  padding: 6px 9px;
  border-radius: 999px;
  color: white;
  background: var(--tnb-blue);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.range-input {
  width: 100%;
  height: 7px;
  margin: 20px 0 7px;
  border-radius: 99px;
  outline: none;
  background: linear-gradient(90deg, var(--grid-slate), var(--tnb-blue), var(--sun-yellow));
  appearance: none;
}

.range-input::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--tnb-blue-deep);
  box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
  cursor: grab;
  appearance: none;
}

.range-input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--tnb-blue-deep);
  box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
  cursor: grab;
}

.range-labels,
.split-readout {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.split-readout {
  gap: 12px;
  margin-top: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 11px;
}

.split-readout strong {
  color: var(--ink);
}

.advanced-panel {
  overflow: hidden;
}

.advanced-panel > summary,
.result-details > summary,
.tariff-details > summary {
  display: flex;
  list-style: none;
  cursor: pointer;
}

.advanced-panel > summary::-webkit-details-marker,
.result-details > summary::-webkit-details-marker,
.tariff-details > summary::-webkit-details-marker {
  display: none;
}

.advanced-panel > summary {
  align-items: center;
  justify-content: space-between;
  padding: 19px 22px;
}

.advanced-panel > summary strong {
  display: block;
  font-size: 14px;
}

.advanced-panel > summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.summary-chevron {
  color: var(--tnb-blue);
  font-size: 22px;
  transition: transform 160ms ease;
}

.advanced-panel[open] .summary-chevron {
  transform: rotate(180deg);
}

.advanced-content {
  border-top: 1px solid var(--line);
}

.advanced-section {
  padding: 22px;
}

.advanced-section + .advanced-section {
  border-top: 1px solid var(--line);
}

.advanced-section__heading {
  margin-bottom: 15px;
}

.tariff-details {
  margin: 0 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.tariff-details > summary {
  padding: 14px 16px;
  color: var(--tnb-blue-deep);
  font-size: 12px;
  font-weight: 800;
}

.tariff-fields {
  padding: 0 16px 16px;
}

.muted-note {
  margin: 0 16px 16px;
  color: var(--muted);
  font-size: 11px;
}

.muted-note code {
  color: var(--tnb-blue-deep);
  font-weight: 700;
}

.input-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.secondary-button {
  display: inline-flex;
  min-height: 44px;
  gap: 9px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--tnb-blue);
  border-radius: var(--radius-sm);
  color: var(--tnb-blue);
  background: white;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 140ms ease;
}

.secondary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button:hover {
  color: white;
  background: var(--tnb-blue);
  transform: translateY(-1px);
}

.privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.results-column {
  position: sticky;
  top: 18px;
}

.results-card {
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.results-card__top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 23px 23px 20px;
  border-bottom: 1px solid var(--line);
}

.status-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-badge--neutral {
  color: var(--tnb-blue-deep);
  background: var(--tnb-blue-soft);
}

.status-badge--positive {
  color: var(--success);
  background: var(--success-soft);
}

.status-badge--warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-badge--negative {
  color: var(--danger);
  background: var(--danger-soft);
}

.bill-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.bill-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  background: white;
}

.bill-card > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.bill-card strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.bill-card small {
  min-height: 31px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.bill-card--solar {
  box-shadow: inset 0 4px 0 var(--sun-yellow);
}

.bill-card--battery {
  box-shadow: inset 0 4px 0 var(--battery-green);
}

.bill-card--battery strong {
  color: var(--success);
}

.verdict-box {
  margin: 20px;
  padding: 19px;
  border: 1px solid #cde4f7;
  border-radius: 14px;
  background: linear-gradient(145deg, #eff8ff, #f8fbff);
}

.verdict-box.is-positive {
  border-color: #b8e2d5;
  background: linear-gradient(145deg, #ecfaf5, #f8fffc);
}

.verdict-box.is-warning {
  border-color: #efdba0;
  background: linear-gradient(145deg, #fff8e5, #fffdf7);
}

.verdict-box.is-negative {
  border-color: #f0c7c9;
  background: linear-gradient(145deg, #fff2f2, #fffafa);
}

.verdict-box__eyebrow {
  color: var(--tnb-blue);
  font-size: 9px;
}

.verdict-box h3 {
  font-size: 20px;
}

.verdict-box > p:not(.verdict-box__eyebrow) {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

.metric-strip > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgb(0 87 168 / 10%);
  border-radius: 10px;
  background: rgb(255 255 255 / 72%);
}

.metric-strip span,
.metric-strip small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.metric-strip strong {
  display: block;
  overflow: hidden;
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-strip strong.is-positive {
  color: var(--success);
}

.metric-strip strong.is-negative {
  color: var(--danger);
}

.flow-section,
.threshold-box {
  margin: 0 20px 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.subsection-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.subsection-heading > strong {
  flex: 0 0 auto;
  color: var(--tnb-blue);
  font-size: 13px;
}

.energy-bar {
  display: flex;
  width: 100%;
  height: 37px;
  overflow: hidden;
  margin-top: 16px;
  border-radius: 10px;
  background: #e9eef4;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 4%);
}

.energy-bar > span {
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  color: white;
  transition: width 250ms ease;
}

.energy-bar em {
  overflow: hidden;
  padding-inline: 5px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.energy-bar__solar {
  background: #d9a820;
}

.energy-bar__battery {
  background: var(--battery-green);
}

.energy-bar__grid {
  background: var(--grid-slate);
}

.energy-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.energy-legend span {
  color: var(--muted);
  font-size: 9px;
}

.energy-legend strong {
  display: block;
  margin: 2px 0 0 14px;
  color: var(--ink);
  font-size: 11px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
}

.legend-dot--solar {
  background: #d9a820;
}

.legend-dot--battery {
  background: var(--battery-green);
}

.legend-dot--grid {
  background: var(--grid-slate);
}

.threshold-box {
  border-color: #d2e5f6;
  background: var(--surface-blue);
}

.threshold-box__header {
  display: flex;
  gap: 11px;
  align-items: center;
}

.threshold-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--tnb-blue);
  font-size: 18px;
  font-weight: 850;
}

.threshold-box h3 {
  font-size: 16px;
}

.effect-list {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.effect-list li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 11px;
}

.effect-list li::before {
  position: absolute;
  top: 2px;
  left: 0;
  color: var(--battery-green);
  content: "✓";
  font-weight: 900;
}

.threshold-tags {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px solid #d5e4f1;
}

.threshold-tags span:not(.threshold-arrow) {
  padding: 5px 8px;
  border: 1px solid #c5d9e9;
  border-radius: 999px;
  color: var(--tnb-blue-deep);
  background: white;
  font-size: 9px;
  font-weight: 750;
}

.threshold-arrow {
  color: var(--muted);
  font-size: 11px;
}

.result-details {
  border-top: 1px solid var(--line);
}

.result-details > summary {
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  color: var(--tnb-blue);
  background: #fbfdff;
  font-size: 11px;
  font-weight: 800;
}

.result-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.result-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.result-detail-grid > div {
  padding: 13px 16px;
  background: white;
}

.result-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.result-detail-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.bill-breakdown {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.bill-breakdown h4 {
  margin: 0 0 9px;
  font-size: 12px;
}

.bill-breakdown dl {
  margin: 0;
}

.bill-breakdown dl > div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: 10px;
}

.bill-breakdown dl > div:last-child {
  border-bottom: 0;
}

.bill-breakdown dt,
.bill-breakdown dd {
  margin: 0;
}

.bill-breakdown dd {
  color: var(--ink);
  font-weight: 800;
}

.comparison-section {
  padding-block: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
  box-shadow: 1px 0 0 var(--line);
}

th:first-child {
  z-index: 2;
  background: var(--surface-soft);
}

td:first-child {
  background: white;
}

th:first-child,
td:first-child,
th:last-child,
td:last-child {
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.035em;
  line-height: 1.3;
  text-transform: uppercase;
}

th + th {
  border-left: 1px solid var(--line);
}

.roi-column {
  min-width: 128px;
  text-align: center;
}

.roi-column--battery {
  background: #f4f9ff;
}

td {
  color: var(--ink-soft);
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdff;
}

.current-row td {
  background: #f2f8ff;
}

.current-row td:first-child {
  box-shadow: inset 4px 0 0 var(--tnb-blue), 1px 0 0 var(--line);
}

.table-number {
  color: var(--ink);
  font-weight: 760;
}

.table-saving {
  color: var(--success);
  font-weight: 850;
}

.table-payback {
  color: var(--tnb-blue-deep);
  font-weight: 850;
}

.threshold-change {
  display: inline-block;
  max-width: 330px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
}

.threshold-same {
  color: var(--muted);
  font-size: 10px;
}

.site-footer {
  padding-block: 34px;
  color: rgb(255 255 255 / 78%);
  background: var(--tnb-blue-dark);
}

.footer-grid {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer strong {
  color: white;
  font-size: 14px;
}

.site-footer p {
  max-width: 650px;
  margin: 6px 0 0;
  font-size: 11px;
}

.footer-disclaimer {
  margin-top: 16px !important;
  padding-left: 12px;
  border-left: 2px solid rgb(185 221 255 / 45%);
  color: rgb(255 255 255 / 72%);
  line-height: 1.55;
}

.footer-disclaimer span {
  color: white;
  font-weight: 850;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 10px;
}

.footer-links a {
  color: #b9ddff;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 15px;
  border-radius: 10px;
  color: white;
  background: var(--tnb-blue-dark);
  box-shadow: 0 14px 42px rgb(0 0 0 / 24%);
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgb(0 87 168 / 30%);
  outline-offset: 3px;
}

@media (max-width: 1050px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  }

  .field-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bill-cards {
    grid-template-columns: 1fr;
  }

  .bill-card {
    min-height: 92px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .hero__grid,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero__grid {
    padding-top: 22px;
  }

  .hero__diagram {
    display: none;
  }

  .results-column {
    position: static;
  }

  .bill-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bill-card {
    min-height: 125px;
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .container {
    width: min(calc(100% - 24px), var(--container));
  }

  .site-nav {
    min-height: 54px;
  }

  .independent-label {
    max-width: 115px;
    font-size: 10px;
    text-align: right;
  }

  .hero__inner {
    padding-bottom: 20px;
  }

  .hero__grid {
    gap: 0;
    padding-top: 18px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero__lead {
    display: none;
  }

  .hero__badges {
    margin-top: 14px;
  }

  .hero__badges span:not(:first-child) {
    display: none;
  }

  .main-grid {
    gap: 38px;
    padding-block: 30px 54px;
  }

  .section-heading h2,
  .results-card h2 {
    font-size: 23px;
  }

  .input-panel {
    padding: 18px;
  }

  .field-grid--2,
  .field-grid--3 {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .field--readout {
    min-height: 70px;
  }

  .battery-maximizer {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-action-button {
    width: 100%;
  }

  .slider-block__heading {
    align-items: center;
  }

  .split-readout {
    flex-direction: column;
  }

  .advanced-panel > summary {
    padding: 17px;
  }

  .advanced-section {
    padding: 18px;
  }

  .tariff-details {
    margin: 0 18px 18px;
  }

  .input-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-card__top {
    padding: 19px;
  }

  .bill-cards {
    grid-template-columns: 1fr;
  }

  .bill-card {
    min-height: 94px;
  }

  .verdict-box,
  .flow-section,
  .threshold-box {
    margin-inline: 14px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .energy-legend {
    grid-template-columns: 1fr;
  }

  .energy-legend strong {
    display: inline;
    margin-left: 3px;
  }

  .result-detail-grid {
    grid-template-columns: 1fr;
  }

  .comparison-section {
    padding-block: 50px;
  }

  .footer-grid {
    flex-direction: column;
  }

  .footer-links {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .top-accent,
  .hero__diagram,
  .input-actions,
  .comparison-section,
  .site-footer,
  .toast,
  .text-button {
    display: none !important;
  }

  body {
    background: white;
  }

  .hero {
    color: var(--ink);
    background: white;
  }

  .hero__inner {
    padding-bottom: 20px;
  }

  .site-nav,
  .hero__badges {
    display: none;
  }

  .hero__grid,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero__lead {
    color: var(--ink-soft);
  }

  .results-column {
    position: static;
  }

  .panel,
  .results-card {
    box-shadow: none;
  }
}
