﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --header-height: 64px;
  --teal: #1D9E75;
  --teal-light: #E1F5EE;
  --teal-mid: #5DCAA5;
  --teal-dark: #085041;
  --navy: #0D1B2A;
  --slate: #4A6580;
  --amber: #F5A623;
  --red: #E24B4A;
  --surface: #F0F4F8;
  --border: rgba(0,0,0,0.1);
  --text: #0D1B2A;
  --text-muted: #4A6580;
  --text-faint: #8FA3B5;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #111C27;
    --border: rgba(255,255,255,0.1);
    --text: #E8F0F7;
    --text-muted: #8FA3B5;
    --text-faint: #4A6580;
    --white: #182535;
    --navy: #E8F0F7;
  }
}

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ------ Layout ------ */
.app-header {
  background: var(--navy);
  color: #E8F0F7;
  padding: 0 2rem;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.app-header .logo-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.1;
  text-decoration: none;
}
.app-header .logo-home-link:hover .logo,
.app-header .logo-home-link:focus-visible .logo {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.app-header .logo { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.app-header .logo span { color: var(--teal-mid); }
.app-header .logo-tagline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #b8d4cc;
}
.app-header .network-badge {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-faint);
  background: rgba(255,255,255,0.07);
  padding: 4px 10px;
  border-radius: 99px;
}

.app-header .top-nav {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-header .top-nav a {
  font-size: 13px;
  color: #d4e6f5;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 0.5px solid transparent;
}

.app-header .top-nav a:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.app-header .top-nav a.is-active,
.app-header .top-nav a[aria-current="page"] {
  color: #ffffff;
  border-color: rgba(93, 202, 165, 0.45);
  background: rgba(93, 202, 165, 0.2);
}

.service-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2rem;
  background: rgba(93, 202, 165, 0.14);
  border-bottom: 0.5px solid var(--border);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 500;
}

.service-info-bar i {
  font-size: 15px;
  flex-shrink: 0;
}

.service-info-bar span {
  line-height: 1.35;
}

.service-info-bar a {
  color: inherit;
  font-weight: 600;
}

.service-info-bar a:hover {
  text-decoration-thickness: 2px;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - var(--header-height));
}

/* ------ Sidebar ------ */
.sidebar {
  background: var(--white);
  border-right: 0.5px solid var(--border);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.section-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.section-head-actions {
  display: flex;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  align-items: center;
}

.plan-head-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.field { margin-bottom: 10px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.field input:not([type=checkbox]), .field select {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:not([type=checkbox]):focus, .field select:focus { border-color: var(--teal); }
.field input[type=file] {
  padding: 6px;
}
.field input[type=file]::file-selector-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 4px 10px;
  margin-right: 10px;
  cursor: pointer;
}
.field input[type=file]::file-selector-button:hover {
  background: rgba(93, 202, 165, 0.12);
}
.field input[type=file]::-webkit-file-upload-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 4px 10px;
  margin-right: 10px;
  cursor: pointer;
}
.field input[type=file]::-webkit-file-upload-button:hover {
  background: rgba(93, 202, 165, 0.12);
}
.field input[type=checkbox] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}
.field select {
  width: 100%;
}
.gst-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  cursor: pointer;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row-4 { grid-template-columns: 0.9fr 1.2fr 0.9fr 0.9fr; }
.field-row-5 { grid-template-columns: 0.9fr 1.2fr 0.9fr 0.9fr 1fr; }
.icp-lookup-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.icp-lookup-row .action-btn {
  white-space: nowrap;
}
.radio-inline-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.radio-inline-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  cursor: pointer;
}
/* ------ Tariff rows ------ */
.tariff-header {
  display: grid;
  grid-template-columns: 72px 72px 1fr 28px;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  padding: 0 0 4px 0;
}
.tariff-row {
  display: grid;
  grid-template-columns: 72px 72px 1fr 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
}
.tariff-row input {
  padding: 5px 7px;
  font-size: 13px;
}
.del-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: var(--radius);
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.del-btn:hover { color: var(--red); background: #FCEBEB; }
.add-tariff-btn {
  width: 100%;
  padding: 7px;
  background: none;
  border: 0.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 0.15s;
}
.add-tariff-btn:hover { background: var(--surface); }

/* ------ Plan picker ------ */
.plan-toggle-btn {
  font-size: 12px;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-weight: 600;
}
.plan-toggle-btn:hover { text-decoration: underline; }
.plan-toggle-btn.is-active {
  text-decoration: underline;
  color: var(--text);
}
.action-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.action-btn:hover {
  background: rgba(93, 202, 165, 0.12);
}
.plan-check-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border);
  user-select: none;
}
.plan-check-label.is-current-plan {
  background: rgba(93, 202, 165, 0.08);
}
.plan-check-label:last-child { border-bottom: none; }
.plan-compare-option {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.plan-compare-option span {
  flex: 1;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.plan-check-label input[type=checkbox] {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
  flex-shrink: 0;
  cursor: pointer;
}

/* ------ Run button ------ */
.run-btn {
  width: 100%;
  padding: 11px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
}
.run-btn:hover { opacity: 0.88; }
.run-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ------ Main panel ------ */
.main {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

/* ------ Retailers listing page ------ */
.retailers-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.retailers-panel {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}

.retailers-head {
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--border);
  background: linear-gradient(180deg, rgba(93, 202, 165, 0.16) 0%, rgba(93, 202, 165, 0.04) 100%);
}

.retailers-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.retailers-head p {
  margin-top: 6px;
  color: var(--text-muted);
}

.retailers-table-wrap {
  overflow-x: auto;
}

.retailers-table {
  width: 100%;
  border-collapse: collapse;
}

.retailers-table th,
.retailers-table td {
  padding: 12px 18px;
  border-bottom: 0.5px solid var(--border);
  text-align: left;
}

.retailers-table th {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.retailers-table td {
  font-size: 14px;
}

.retailers-table tbody tr:last-child td {
  border-bottom: none;
}

.retailers-link {
  color: var(--teal);
  font-weight: 600;
}

.retailers-link:hover {
  text-decoration-thickness: 2px;
}

.retailers-note {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.retailers-empty {
  padding: 18px;
  color: var(--text-muted);
}

.retailers-footnote {
  margin-top: 12px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ------ Metric cards ------ */
.results-context {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 2px;
}
.gst-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-light);
  border: 0.5px solid rgba(8, 80, 65, 0.2);
}
.gst-results-toggle {
  font-size: 13px;
  color: var(--text-muted);
}

.tou-display-toggle-label {
  font-size: 12px;
  color: var(--text-muted);
}

.plan-include-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 8px;
}

.plan-filter-summary {
  margin: -2px 0 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.optimized-controls {
  display: grid;
  gap: 6px;
  margin: 2px 0 10px;
}

.optimized-controls-title {
  font-size: 13px;
  color: var(--text-muted);
}

.optimized-controls span {
  font-size: 13px;
  color: var(--text);
  min-width: 120px;
  text-align: right;
}

.optimized-capacity-range-control {
  margin-top: 2px;
  display: grid;
  gap: 6px;
}

.optimized-capacity-range-row {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  gap: 10px;
}

.optimized-capacity-range-row span {
  min-width: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.optimized-dual-range {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
}

.optimized-dual-range-thumb-value {
  position: absolute;
  top: -8px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text);
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
}

.optimized-dual-range-track,
.optimized-dual-range-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
}

.optimized-dual-range-track {
  background: rgba(143, 163, 181, 0.35);
}

.optimized-dual-range-fill {
  left: 0;
  right: auto;
  width: 100%;
  background: var(--teal);
}

.optimized-dual-range input[type=range] {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.optimized-dual-range input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.optimized-dual-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--teal);
  margin-top: -5px;
  cursor: pointer;
}

.optimized-dual-range input[type=range]::-moz-range-track {
  height: 4px;
  background: transparent;
}

.optimized-dual-range input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--teal);
  cursor: pointer;
}

#optimized-capacity-range-threshold {
  width: 100%;
  accent-color: var(--teal);
}

.optimized-capacity-range-value {
  justify-self: end;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.optimized-hidden-control {
  display: none;
}

.optimized-chart-card {
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 10px;
  border: 0.5px solid var(--border);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(29, 158, 117, 0.12), transparent 52%),
    var(--surface);
}

.optimized-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.optimized-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.optimized-chart-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.optimized-chart-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.optimized-chart-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.5);
}

.optimized-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 240px;
}

.optimized-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.plan-option-summary {
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(212, 241, 165, 0.15);
  border-left: 3px solid #a5d47a;
  border-radius: 4px;
}

.plan-option-summary-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.plan-option-summary-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.plan-option-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.plan-option-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  padding: 10px 12px;
  border: 0.5px solid rgba(90, 122, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}
.plan-option-item-current {
  border-color: rgba(29, 158, 117, 0.55);
  box-shadow: 0 0 0 1px rgba(29, 158, 117, 0.18);
  background: rgba(93, 202, 165, 0.12);
}

.plan-option-item-selected {
  border-color: rgba(75, 121, 177, 0.55);
  box-shadow: 0 0 0 1px rgba(75, 121, 177, 0.18);
  background: rgba(234, 242, 251, 0.7);
}

.plan-option-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.plan-option-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(29, 158, 117, 0.12);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-option-current-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(29, 158, 117, 0.2);
  color: #0f5c45;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-option-selected-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(75, 121, 177, 0.2);
  color: #244668;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-option-name {
  padding-right: 84px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.plan-option-meta {
  margin-top: 2px;
  padding-right: 84px;
  font-size: 12px;
  color: var(--text-muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.plan-option-meta .plan-option-stat {
  min-width: 86px;
}

.plan-option-meta .plan-option-stat-battery-size {
  min-width: 0;
}

.plan-option-meta .plan-option-stat-annual-bill {
  min-width: 150px;
  align-items: flex-start;
}

.plan-option-meta .plan-option-stat-annual-bill .ss-label {
  text-align: left;
}

.plan-option-meta .plan-option-stat-annual-bill .ss-value {
  text-align: left;
}

.plan-option-capacity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}

.plan-option-capacity i {
  font-size: 1em;
  line-height: 1;
  color: var(--teal-mid);
}

.plan-option-meta-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 2px;
  min-width: 0;
}

.plan-option-meta-line {
  white-space: nowrap;
  line-height: 1.2;
}

.plan-option-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 8px;
}

.plan-option-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.plan-option-stat-daily-charge .ss-value {
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ss-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.ss-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ss-value-annual-bill {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.ss-value-nowrap {
  white-space: nowrap;
}

.ss-value.saving {
  color: var(--teal);
}

.ss-value.saving-swapped {
  color: var(--text);
}

.ss-value.with-battery-swapped {
  color: var(--teal);
}

.ss-value-vs-save {
  color: var(--teal);
}

.ss-value-vs-more {
  color: var(--red);
}

.ss-value-vs-neutral {
  color: var(--text-muted);
}

.plan-option-solar-mini {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.plan-option-readiness-mini {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.3;
}

.plan-option-readiness-label {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.plan-option-readiness-value {
  font-weight: 700;
}

.plan-option-readiness-detail {
  color: var(--text-muted);
}

.plan-option-stats-comparison {
  grid-template-columns: minmax(0, 0.97fr) minmax(0, 1.03fr);
  padding-right: 44px;
}

.plan-option-stats-comparison .ss-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.plan-option-stats-comparison .ss-value {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  font-size: 13px;
  line-height: 1.25;
}

.plan-option-action {
  position: absolute;
  top: 10px;
  right: 12px;
  flex-shrink: 0;
  align-self: auto;
  margin-left: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.metric .m-label { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.metric .m-value { font-size: 24px; font-weight: 500; color: var(--text); line-height: 1; }
.metric .m-sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.metric.accent .m-value { color: var(--teal); }
.metric-summary {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}
.metric-summary strong {
  color: var(--text);
  font-weight: 600;
}

/* ------ Panels ------ */
.panel {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 7px;
}
.panel-title i { color: var(--teal); }

.pinned-plan-strip {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(93, 202, 165, 0.08) 0%, rgba(255, 255, 255, 0.96) 100%);
  padding: 10px;
}

.pinned-plan-strip-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
  font-weight: 600;
}

.pinned-plan-strip-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pinned-plan-strip-loading,
.pinned-plan-strip-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 4px;
}

.pinned-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pinned-plan-card {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 8px 9px;
  display: grid;
  gap: 4px;
}

.pinned-plan-card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  font-weight: 600;
}

.pinned-plan-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.pinned-plan-card-control {
  display: grid;
  gap: 3px;
}

.pinned-plan-card-toggles {
  gap: 2px;
}

.pinned-plan-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}

.pinned-plan-card-toggle input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
}

.pinned-plan-card-current .pinned-plan-card-toggles {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-self: end;
  grid-column: 2;
  grid-row: 2;
  gap: 4px;
}

.pinned-plan-card-current .pinned-plan-card-total {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  text-align: left;
}

.pinned-plan-card-current {
  grid-template-columns: 1fr auto;
  align-items: end;
  column-gap: 10px;
  border-color: #c8e9de;
  background: linear-gradient(180deg, #f6fbf9 0%, #ffffff 100%);
}

.pinned-plan-card-current .pinned-plan-card-title {
  grid-column: 1 / -1;
}

.pinned-plan-card-current .pinned-plan-card-meta {
  grid-column: 1 / -1;
}

.pinned-plan-card-control-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pinned-plan-card-select {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.pinned-plan-card-plan {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-plan-card-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  min-height: 18px;
}

.pinned-plan-card-saving {
  font-size: 12px;
  line-height: 1.35;
  min-height: 16px;
  color: var(--teal-dark);
}

.pinned-plan-card-saving-placeholder {
  visibility: hidden;
}

/* ------ Battery config panel (controls + stats side by side) ------ */
.bat-config-layout {
  display: block;
  padding: 12px;
}
.bat-config-controls { display: flex; flex-direction: column; gap: 8px; }
.bat-advanced {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 10px;
}
.bat-advanced > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
}
.bat-advanced > summary::-webkit-details-marker {
  display: none;
}
.bat-advanced > summary::before {
  content: '---';
  margin-right: 6px;
  color: var(--text-faint);
}
.bat-advanced[open] > summary::before {
  content: '---';
}
.bat-advanced .field-row {
  margin-top: 8px;
}
.bat-config-layout .bat-stats {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
}
.bat-config-controls .field-row-4 .field,
.bat-config-controls .field-row-5 .field,
.bat-config-controls .field-row-6 .field {
  margin-bottom: 0;
}
.bat-config-controls .field-row-4 .field label,
.bat-config-controls .field-row-5 .field label,
.bat-config-controls .field-row-6 .field label {
  font-size: 12px;
}
.bat-config-controls .field-row-4 .field input:not([type=checkbox]),
.bat-config-controls .field-row-4 .field select,
.bat-config-controls .field-row-5 .field input:not([type=checkbox]),
.bat-config-controls .field-row-5 .field select,
.bat-config-controls .field-row-6 .field input:not([type=checkbox]),
.bat-config-controls .field-row-6 .field select {
  font-size: 13px;
  padding: 7px 8px;
}

/* ------ Battery viz ------ */
.battery-wrap { display: flex; align-items: center; gap: 20px; }
.battery-shell {
  width: 160px;
  height: 52px;
  border: 2px solid var(--border);
  border-radius: 7px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.battery-shell::after {
  content: '';
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 22px;
  background: var(--border);
  border-radius: 0 4px 4px 0;
}
.battery-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 5px;
  width: 0%;
  transition: width 1s ease;
}
.battery-fill.low { background: var(--blue); }
.battery-fill.empty { background: var(--teal); }
.battery-pct-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
}
.battery-caption { font-size: 12px; color: var(--text-faint); margin-top: 5px; text-align: center; }
.bat-stats { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.bat-stat {
  padding: 7px 10px;
  border-bottom: 0.5px solid var(--border);
  border-right: 0.5px solid var(--border);
  font-size: 13px;
}
.bat-stat:nth-child(2n) { border-right: none; }
.bat-stat:nth-last-child(-n+2) { border-bottom: none; }
.bat-stat .bs-key { color: var(--text-faint); margin-bottom: 2px; }
.bat-stat .bs-val { font-weight: 500; color: var(--text); }

/* ------ Tabs ------ */
.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 1rem;
}
.tabs-left {
  display: flex;
  gap: 0;
  min-width: 0;
}
.tabs-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-bottom: 6px;
}
.tab-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ------ Methodology page ------ */
.methodology-page {
  display: grid;
  gap: 14px;
}

.methodology-hero {
  padding: 14px 16px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(29, 158, 117, 0.16), transparent 55%),
    var(--white);
}

.methodology-hero h2 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.methodology-hero p {
  color: var(--text-muted);
}

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

.methodology-card {
  padding: 14px 16px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.methodology-card h3 {
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.methodology-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  display: grid;
  gap: 7px;
}

.methodology-card-caveat {
  border-color: rgba(217, 119, 6, 0.4);
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.1), rgba(245, 166, 35, 0.04)),
    var(--white);
}

.methodology-note {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  background: var(--white);
}

.methodology-note h3 {
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.methodology-note p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.methodology-note p:last-child {
  margin-bottom: 0;
}

.methodology-contact {
  padding: 14px 16px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.methodology-contact h3 {
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.methodology-contact-copy {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.contact-form .field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.contact-form .field textarea:focus {
  border-color: var(--teal);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.contact-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.contact-actions .run-btn {
  width: auto;
  min-width: 160px;
  padding: 10px 16px;
}

.contact-status {
  font-size: 12px;
  color: var(--text-muted);
}

.contact-status.is-success {
  color: var(--teal-dark);
}

.contact-status.is-error {
  color: var(--red);
}

.contact-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ------ Rankings table ------ */
.rankings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rankings-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 10px 10px;
  border-bottom: 0.5px solid var(--border);
}
.rankings-table td { padding: 10px; border-bottom: 0.5px solid var(--border); }
.rankings-table tr:last-child td { border-bottom: none; }
.rankings-table tr.winner td { background: var(--teal-light); }
.rankings-table tr.winner td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.rankings-table tr.winner td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.rank-num { font-weight: 600; color: var(--text-faint); }
.rank-num.first { color: var(--teal-dark); }
.supplier-name { font-weight: 500; }
.plan-name { font-size: 13px; color: var(--text-muted); }
.plan-detail { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.th-note { font-size: 11px; font-weight: 400; color: var(--text-faint); display: block; margin-top: 2px; }
.cost-delta { display: block; font-size: 12px; font-weight: 400; color: var(--text-faint); margin-top: 2px; }
.cost-cell { font-weight: 500; }
.no-battery-cell { color: var(--text-faint); }
.saving-cell { color: var(--teal); font-weight: 500; }
.swapped-saving-cell { color: var(--text); }
.swapped-with-battery-cell { color: var(--teal); font-weight: 500; }
.saving-cell-with-action {
  white-space: normal;
}
.saving-cell-with-action > span {
  display: block;
  white-space: nowrap;
}
.saving-cell-with-action .action-btn {
  display: inline-block;
  margin-top: 6px;
  margin-left: 0;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}
.badge.best { background: #9FE1CB; color: var(--teal-dark); }
.badge.flat { background: var(--surface); color: var(--text-faint); }
.elbow-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 99px;
  border: 0.5px solid #f1d47a;
  background: #fff4cc;
  color: #7a5a00;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.plan-option-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 99px;
  border: 0.5px solid #d4f1a5;
  background: #f4ffcc;
  color: #5a7a00;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ------ Monthly bars ------ */
.monthly-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: flex-end; }
.month-col { text-align: center; }
.month-bar-wrap { height: 80px; display: flex; align-items: flex-end; justify-content: center; }
.month-bar { width: 100%; background: var(--teal-mid); border-radius: 3px 3px 0 0; min-height: 4px; transition: height 0.6s ease; }
.month-bar.winter { background: var(--teal); }
.month-label { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.month-val { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

/* ------ Insights ------ */
.insight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
  gap: 12px;
}
.insight-row-group-start {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 0.5px solid rgba(13, 27, 42, 0.1);
}
.insights-summary-panel .insight-row-group-start:first-of-type {
  margin-top: 0;
}
.insight-row:last-child { border-bottom: none; }
.insight-key { color: var(--text-muted); flex-shrink: 0; }
.insight-val { font-weight: 500; text-align: right; }
.insight-val-note {
  max-width: 320px;
  min-width: 0;
  white-space: normal;
}
.insight-val.positive { color: var(--teal); }
.insight-val-status-yes { color: var(--teal); }
.insight-val-status-maybe { color: #d97706; }
.insight-val-status-no { color: var(--red); }
.insights-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 14px;
  align-items: start;
}
.insights-summary-panel {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}
.insights-summary-table-wrap {
  padding: 8px 10px 0;
  overflow-x: auto;
}
.insights-summary-table {
  table-layout: auto;
  min-width: 640px;
}
.insights-summary-table th {
  white-space: normal;
}
.insights-summary-table td {
  white-space: normal;
  vertical-align: top;
  border-bottom: none;
}
@media (min-width: 1200px) {
  .insights-summary-table th:first-child,
  .insights-summary-table td:first-child {
    width: 34%;
  }
  .insights-summary-table th:nth-child(2),
  .insights-summary-table td:nth-child(2),
  .insights-summary-table th:nth-child(3),
  .insights-summary-table td:nth-child(3),
  .insights-summary-table th:nth-child(4),
  .insights-summary-table td:nth-child(4),
  .insights-summary-table th:nth-child(5),
  .insights-summary-table td:nth-child(5),
  .insights-summary-table th:nth-child(6),
  .insights-summary-table td:nth-child(6) {
    width: 13%;
    white-space: nowrap;
  }
}
.insights-rankings-panel {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}
.insights-rankings-table {
  width: 96%;
  margin: 0 auto;
}
.insights-rankings-table th:first-child,
.insights-rankings-table td:first-child {
  min-width: 280px;
}
.insights-rankings-table th:nth-child(2),
.insights-rankings-table th:nth-child(3),
.insights-rankings-table th:nth-child(4),
.insights-rankings-table td:nth-child(2),
.insights-rankings-table td:nth-child(3),
.insights-rankings-table td:nth-child(4) {
  width: 118px;
  white-space: nowrap;
}
.insights-rankings-table td:nth-child(2),
.insights-rankings-table td:nth-child(3),
.insights-rankings-table td:nth-child(4) {
  vertical-align: top;
}
.insights-summary-panel .insight-row {
  padding-left: 12px;
  padding-right: 12px;
}
.insights-installer-promo {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #f8fff8 0%, #eef8ff 100%);
  padding: 16px;
  display: grid;
  gap: 10px;
}
.insights-installer-promo-media {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 0.5px solid rgba(29, 158, 117, 0.18);
}
.insights-installer-promo-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1d9e75 0%, #5dcaa5 100%);
  color: #fff;
  flex-shrink: 0;
}
.insights-installer-promo-icon-wrap i {
  font-size: 22px;
  line-height: 1;
}
.insights-installer-promo-chip {
  padding: 3px 8px;
  border-radius: 999px;
  border: 0.5px solid rgba(90, 122, 0, 0.22);
  background: #fff;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.insights-installer-promo-eyebrow {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal-dark);
}
.insights-installer-promo-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  color: var(--text);
}
.insights-installer-promo-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}
.insights-installer-promo-cta {
  justify-self: start;
}
.insights-rankings-body {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 420px;
  padding: 8px 10px;
}

/* ------ Best case recommendation ------ */
.bestcase-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.bestcase-card {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
}
.bestcase-title {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.bestcase-headline {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.bestcase-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}
.bestcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.bestcase-item {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}
.bestcase-item span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.bestcase-item strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.bestcase-note {
  font-size: 13px;
  color: var(--text-muted);
  border-top: 0.5px solid var(--border);
  padding-top: 8px;
}

/* ------ Energy infographic ------ */
.energy-infographic {
  margin-top: 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}
.info-title {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
}
.info-note {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
  background: var(--white);
  border-bottom: 0.5px solid var(--border);
}
.info-block {
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
}
.info-block:last-child { border-bottom: none; }
.info-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.info-arrows {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-faint);
}
.info-arrows span {
  white-space: normal;
}
.stack-bar {
  width: 100%;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: var(--surface);
  border: 0.5px solid var(--border);
}
.seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.seg-label {
  display: inline-block;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.seg-grid { background: #d97706; }
.seg-battery { background: var(--teal); }
.seg-peak-grid { background: #4b79b1; }
.seg-charge { background: var(--teal); }
.seg-peak-grid .seg-label {
  color: #fff;
}
.info-meta {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.info-meta-grid-blue {
  color: #4b79b1;
}

/* ------ TOU infographic ------ */
.tou-infographic {
  margin-top: 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}
.tou-infographic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 0;
}
.tou-infographic-head .info-title {
  margin-bottom: 0;
  flex: 1 1 auto;
}
.tou-infographic-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 12px 0;
}
.tou-band-captions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tou-day-type-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tou-day-type-control-static .tou-day-type-static {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 4px;
}
.tou-grid {
  padding: 8px 12px;
  display: grid;
  gap: 10px;
}
.timeline-band-captions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tou-24h-wrap {
  padding: 10px 12px 8px;
}
.tou-24h-wrap + .info-block,
.tou-24h-wrap + .tou-legend {
  margin-top: 0;
}
.tou-subhead {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.tou-24h-line {
  width: 100%;
  height: 24px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  overflow: hidden;
  display: flex;
  background: var(--surface);
}
.tou-slot {
  flex: 1 1 0;
  height: 100%;
  display: block;
  border-right: none;
}
.tou-slot:last-child { border-right: none; }
.tou-slot-fill {
  height: 100%;
  width: 100%;
}
.tou-slot-fill.peak { background: #e39a3e; }
.tou-slot-fill.shoulder { background: #6f98c8; }
.tou-slot-fill.cheap { background: #39b58a; }
.tou-24h-ticks {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
}
.tou-source-key {
  margin-top: 6px;
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-faint);
}
.tou-load-bars {
  margin-top: 6px;
  height: 68px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.04), transparent 60%);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.tou-load-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
.tou-load-grid,
.tou-load-battery {
  width: 100%;
}
.tou-load-grid {
  background: #5f7f9d;
}
.tou-load-battery {
  background: var(--teal);
}
.tou-key-chip.key-load-line {
  background: #183a5a;
}
.timeline-combined-wrap {
  padding: 0 12px 10px;
}
.timeline-band-captions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-line-key {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.timeline-line-key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.timeline-line-key-swatch {
  width: 16px;
  height: 0;
  border-top: 3px solid transparent;
  border-radius: 999px;
  display: inline-block;
}
.timeline-line-key-swatch.grid {
  border-top-color: #4b79b1;
}
.timeline-line-key-swatch.forecast {
  border-top-color: #1d4f8c;
  border-top-style: dashed;
}
.timeline-line-key-swatch.solar {
  border-top-color: #d97706;
}
.timeline-frame {
  display: block;
}
.timeline-combined {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.timeline-band {
  display: flex;
  align-items: flex-end;
  width: 100%;
}
.timeline-band-labels {
  align-items: stretch;
  min-height: 22px;
  background: rgba(0, 0, 0, 0.015);
  border-bottom: 0.5px solid var(--border);
}
.timeline-period-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 2px 6px;
  font-size: 13px;
  line-height: 1.1;
  color: var(--text-muted);
  border-right: 0.5px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.timeline-period-label:last-child {
  border-right: none;
}
.timeline-period-label.peak {
  background: rgba(215, 139, 46, 0.24);
}
.timeline-period-label.shoulder {
  background: rgba(75, 121, 177, 0.22);
}
.timeline-period-label.cheap {
  background: rgba(57, 181, 138, 0.24);
}
.timeline-period-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-period-rate {
  font-size: 12px;
  color: var(--text-faint);
}
.timeline-band-soc {
  position: relative;
  height: 60px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.03), transparent 60%);
}
.soc-edge-labels {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.soc-edge-label {
  position: absolute;
  left: 6px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(70, 85, 102, 0.10);
  color: var(--text-muted);
  font-size: 8px;
  line-height: 1;
}
.soc-edge-label.top {
  top: 4px;
}
.soc-edge-label.bottom {
  bottom: 4px;
}
.soc-edge-label-pct {
  font-weight: 600;
}
.timeline-load-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}
.timeline-load-line {
  fill: none;
  stroke: #1d4f8c;
  stroke-width: 2;
  stroke-dasharray: 6 3;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}
.timeline-grid-consumption-line {
  fill: none;
  stroke: #4b79b1;
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}
.timeline-solar-line {
  fill: none;
  stroke: #d97706;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45));
}
.soc-24h-line {
  width: 100%;
  height: 72px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.03), transparent 60%),
    linear-gradient(to right, transparent 0 24.5%, rgba(0, 0, 0, 0.035) 24.5% 25%, transparent 25% 49.5%, rgba(0, 0, 0, 0.035) 49.5% 50%, transparent 50% 74.5%, rgba(0, 0, 0, 0.035) 74.5% 75%, transparent 75% 100%);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.soc-slot {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1px;
  min-width: 0;
  position: relative;
  z-index: 3;
}
.soc-slot::before {
  content: "";
  position: absolute;
  inset: 6px 18% 6px 18%;
  border: 1px solid rgba(70, 85, 102, 0.22);
  border-radius: 8px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.72);
}
.soc-slot::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 42%;
  right: 42%;
  height: 3px;
  border-radius: 999px;
  background: rgba(70, 85, 102, 0.22);
}
.soc-slot-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.soc-slot.state-peak .soc-slot-fill {
  background: linear-gradient(to top, #d78b2e, #f0b35c);
}
.soc-slot.state-shoulder .soc-slot-fill {
  background: linear-gradient(to top, #4b79b1, #7e9fc6);
}
.soc-slot.state-cheap .soc-slot-fill {
  background: linear-gradient(to top, #39b58a, #67c8a4);
}
.tou-legend {
  padding: 0 12px 12px;
  display: grid;
  gap: 6px;
  overflow-x: auto;
}
.tou-legend-section {
  margin-top: 8px;
  border-top: 0.5px solid var(--border);
}
.tou-legend-header {
  padding: 10px 12px 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.dispatch-footer-grid {
  padding: 10px 14px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dispatch-footer-card {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.02);
}
.dispatch-footer-card .info-label {
  margin-bottom: 6px;
}
.dispatch-footer-card .info-label .info-label-inline-value {
  display: inline-block;
  margin-left: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.donut-alloc-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.donut-alloc {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: transparent;
  isolation: isolate;
}
.donut-alloc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--donut-fill);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17.4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17.4px));
  pointer-events: none;
}
.donut-alloc::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 0.5px var(--border);
  pointer-events: none;
}
.donut-alloc-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.donut-alloc-center-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.donut-alloc-center-unit {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.donut-alloc-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.donut-alloc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.donut-alloc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.donut-alloc-dot-charge {
  background: var(--teal);
}
.donut-alloc-dot-peak-grid {
  background: #4b79b1;
}
.donut-alloc-dot-home {
  background: #d97706;
}
.donut-alloc-dot-peak-solar {
  background: #d97706;
}
.donut-alloc-dot-solar-export {
  background: #4b79b1;
}
@media (max-width: 1180px) {
  .dispatch-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.dispatch-footer-card .info-meta {
  margin-top: 6px;
}
.tou-legend-item {
  display: grid;
  grid-template-columns: minmax(230px, 2.4fr) minmax(86px, 0.95fr) minmax(92px, 1fr) minmax(92px, 1fr) minmax(104px, 1.1fr) minmax(92px, 1fr) minmax(92px, 1fr) minmax(92px, 1fr) minmax(104px, 1.1fr);
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-faint);
  min-width: 980px;
}
.tou-legend-head {
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 2px;
}
.tou-legend-item > span:first-child {
  white-space: nowrap;
}
.tou-legend-item > span:not(:first-child) {
  white-space: nowrap;
}
.tou-legend-item > span:first-child .tou-dot {
  margin-right: 6px;
}
.tou-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.tou-dot.peak { background: #d78b2e; }
.tou-dot.shoulder { background: #4b79b1; }
.tou-dot.cheap { background: var(--teal); }
.tou-name {
  font-size: 12px;
  color: var(--text-muted);
}
.tou-rate {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tou-rate.peak {
  color: #6b3b00;
  background: #ffe7c8;
}
.tou-rate.shoulder {
  color: #244668;
  background: #dde9f5;
}
.tou-rate.cheap {
  color: var(--teal-dark);
  background: #d9f1e8;
}
.tou-mini {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ------ Calculation breakdown ------ */
.calc-breakdown {
  margin-top: 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calc-title {
  background: var(--surface);
  padding: 12px 16px;
  font-size: 13px;
.dispatch-footer-card .info-kicker {
  margin-top: -2px;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 0.5px solid var(--border);
}
.calc-subtitle {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 12px;
}
.calc-step {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 0.5px solid var(--border);
  gap: 12px;
}
.calc-step:last-child { border-bottom: none; }
.calc-section {
  background: var(--surface);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 0.5px solid var(--border);
}
.powerflow-figure {
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--border);
  background: var(--white);
}
.powerflow-svg {
  width: 100%;
  max-width: 55rem;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}
.pf-box {
  stroke-width: 1;
}
.pf-grid {
  fill: #eaf2fb;
  stroke: #4b79b1;
}
.pf-battery {
  fill: #e5f5ef;
  stroke: #1d9e75;
}
.pf-home {
  fill: #fff1e2;
  stroke: #d97706;
}
.pf-box-title {
  font-size: 14px;
  font-weight: 600;
  fill: var(--text-muted);
}
.pf-box-value {
  font-size: 12.5px;
  font-weight: 500;
  fill: var(--text);
}
.pf-grid-text {
  fill: #4b79b1;
}
.pf-battery-text {
  fill: #1d9e75;
}
.pf-home-text {
  fill: #d97706;
}
.pf-box-detail {
  font-size: 8.5px;
  font-weight: 500;
  fill: var(--text-faint);
}
.pf-flow {
  stroke-width: 2;
  fill: none;
}
.pf-label-bg {
  fill: #f8fbff;
  opacity: 0.94;
}
.pf-grid-home {
  color: #4b79b1;
  stroke: currentColor;
}
.pf-grid-battery {
  color: #318f74;
  stroke: currentColor;
}
.pf-battery-home {
  color: #1d9e75;
  stroke: currentColor;
}
.pf-flow-label {
  font-size: 0.9rem;
  font-weight: 700;
  fill: #2a3648;
}
.pf-flow-detail {
  font-size: 0.74rem;
  font-weight: 500;
  fill: #2f3d50;
}
.pf-flow-subdetail {
  font-size: 0.74rem;
  font-weight: 500;
  fill: #2f3d50;
}
.pf-flow-total {
  font-weight: 700;
  fill: #151f2d;
}
.pf-flow-split {
  letter-spacing: 0;
  text-decoration: none;
}
.pf-flow-split .pf-inline-label {
  fill: #2f3d50;
  font-weight: 600;
}
.pf-flow-split .pf-inline-value {
  fill: #1a2332;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pf-inline-value-end {
  text-anchor: end;
}
.pf-flow-split .pf-inline-value.pf-inline-value-key {
  fill: var(--teal);
}
.pf-flow-label-grid-home .pf-inline-label { fill: #18253a; }
.pf-flow-label-grid-battery .pf-inline-label { fill: #1a8f5a; }
.pf-flow-label-battery-home .pf-inline-label { fill: #1a8f5a; }
.pf-flow-detail.pf-flow-split .pf-inline-label,
.pf-flow-detail.pf-flow-split .pf-inline-value,
.pf-flow-subdetail.pf-flow-split .pf-inline-label,
.pf-flow-subdetail.pf-flow-split .pf-inline-value {
  font-weight: 500;
}
.pf-flow-total.pf-flow-split .pf-inline-label,
.pf-flow-total.pf-flow-split .pf-inline-value {
  font-weight: 700;
}
.pf-footnote {
  font-size: 0.73rem;
  font-weight: 500;
  fill: #2b3a4f;
}
.pf-footnote-positive {
  font-weight: 700;
}
.pf-flow-card {
  fill: #ffffff;
  stroke: none;
}
.pf-flow-card-home {
  stroke: #c2cdda;
  stroke-width: 1;
}
.pf-flow-divider {
  stroke: #b8c3d1;
  stroke-width: 0.8;
}
.pf-footnote-card {
  fill: #ffffff;
  stroke: #c2cdda;
  stroke-width: 1;
}
.pf-footnote-divider {
  stroke: #c8d1dc;
  stroke-width: 0.8;
  stroke-dasharray: 1.2 1.8;
}
.pf-footnote-icon-ring {
  fill: #eaf6ef;
  stroke: #1a8f5a;
  stroke-width: 1;
}
.pf-footnote-icon {
  fill: #1a8f5a;
  font-size: 7px;
  font-weight: 700;
  dominant-baseline: middle;
}
.pf-footnote-label {
  fill: #1b8858;
  font-weight: 700;
}
.pf-footnote-value {
  fill: #1e2a3a;
  font-weight: 500;
}
.pf-footnote-annual {
  fill: #4a5a70;
  font-weight: 500;
}

/* Simplified Power Flow Diagram - Compact Layout */
.powerflow-figure {
  width: 100%;
}

.powerflow-diagram {
  position: relative;
  margin: 0 auto 10px;
  background: white;
  border-radius: 8px;
  width: min(820px, 100%);
}

.powerflow-svg {
  width: 100%;
  height: auto;
  display: block;
  min-height: 160px;
  transform: translateY(-20px);
}

/* Single SVG powerflow styles */
.pf-svg-node {
  stroke-width: 2;
}

.pf-svg-node-grid {
  fill: #f7fbff;
  stroke: #4b79b1;
}

.pf-svg-node-battery {
  fill: #f4fbf8;
  stroke: #1d9e75;
}

.pf-svg-node-home {
  fill: #f8fafc;
  stroke: #334155;
}

.pf-svg-node-solar {
  fill: #fff8eb;
  stroke: #d97706;
}

.pf-svg-connector {
  stroke: #4b79b1;
  stroke-width: 2.25;
  fill: none;
  stroke-linecap: round;
}

.pf-svg-label-bg {
  fill: #ffffff;
  stroke: #4b79b1;
  stroke-width: 1;
}

.pf-svg-flow-label {
  font-size: 11px;
  font-weight: 700;
  fill: #4b79b1;
}

.pf-svg-connector-battery-home {
  stroke: #1d9e75;
}

.pf-svg-label-bg-battery-home {
  stroke: #1d9e75;
}

.pf-svg-flow-label-battery-home {
  fill: #1d9e75;
}

.pf-svg-connector-solar-home,
.pf-svg-connector-solar-battery {
  stroke: #d97706;
}

.pf-svg-connector-solar-export {
  stroke: #d97706;
}

.pf-svg-label-bg-solar-home,
.pf-svg-label-bg-solar-battery {
  stroke: #d97706;
}

.pf-svg-label-bg-solar-export {
  stroke: #d97706;
}

.pf-svg-flow-label-solar {
  fill: #d97706;
}

.pf-svg-node-title {
  font-size: 12px;
  font-weight: 700;
  fill: #1a2d44;
}

.pf-svg-node-subtitle {
  font-size: 11px;
  fill: #6b7b8f;
}

.pf-svg-node-value {
  font-size: 12px;
  font-weight: 700;
}

.pf-svg-node-value-grid {
  fill: #4b79b1;
}

.pf-svg-node-value-battery {
  fill: #1d9e75;
}

.pf-svg-node-value-home {
  fill: #334155;
}

.pf-svg-node-value-solar {
  fill: #d97706;
}

/* Flow legend: explains the two energy paths */
.pf-flow-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px 14px;
  margin-top: 4px;
  background: #fafbfc;
  border-radius: 0 0 8px 8px;
  font-size: 13px;
}

.pf-flow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.pf-flow-label {
  font-weight: 600;
  color: #0d1b2a;
  min-width: 60px;
}

.pf-flow-direct .pf-flow-label {
  color: #4b79b1;
}

.pf-flow-delayed .pf-flow-label {
  color: #1d9e75;
}

.pf-flow-amount {
  font-weight: 700;
  color: #0d1b2a;
  min-width: 80px;
}

.pf-flow-note {
  color: #6b7b8f;
  font-size: 12px;
}

@media (min-width: 601px) {
  .powerflow-diagram {
    margin-bottom: 0;
  }

  .powerflow-svg {
    min-height: 180px;
  }
}

.pf-connector {
  fill: none;
  stroke-linecap: round;
}

.pf-label-bg {
  fill: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

.pf-label {
  font-size: 12px;
  font-weight: 600;
  fill: #4a5a70;
  pointer-events: none;
}

.pf-label-grid-home {
  fill: #4b79b1;
}

.pf-label-grid-battery {
  fill: #1d9e75;
}

.pf-label-battery-home {
  fill: #d97706;
}

/* Detail cards grid */
.powerflow-detail-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(185px, 1fr));
  justify-content: center;
  width: min(840px, 100%);
  margin: 0 auto 20px;
  gap: 14px;
}

.powerflow-detail-cards.no-solar {
  grid-template-columns: repeat(3, minmax(195px, 260px));
}

.pf-detail-card-solar {
  border-color: #e7c58f;
}

.pf-detail-card {
  background: white;
  border: 1px solid #c2cdda;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid #c2cdda;
  margin-bottom: 8px;
}

.pf-card-title {
  color: #2a3648;
  font-size: 13px;
}

.pf-card-header .pf-card-value {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.pf-card-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.pf-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.pf-card-label {
  color: #6b7b8f;
  flex: 0 0 auto;
}

.pf-card-value {
  color: #2a3648;
  font-weight: 500;
  text-align: right;
}

.pf-card-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #e0e6ed;
  font-weight: 600;
  color: #2a3648;
  font-size: 12px;
}

/* Results panel */
.powerflow-results-panel {
  margin-top: 16px;
  width: min(840px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.powerflow-footnote-card {
  border: 1px solid #c2cdda;
  background: #ffffff;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.powerflow-footnote-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: #2b3a4f;
}

.powerflow-footnote-row-saving {
  border-top: 1px dashed #c8d1dc;
  padding-top: 8px;
}

.powerflow-footnote-label {
  color: #1b8858;
  font-weight: 700;
}

.powerflow-footnote-value {
  color: #1e2a3a;
  font-weight: 600;
  text-align: right;
}

.pf-footnote-annual {
  font-size: 11px;
  color: #6b7b8f;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .powerflow-diagram {
    position: relative;
    min-height: auto;
  }

  .powerflow-svg {
    display: block;
    min-height: 160px;
  }

  .pf-flow-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .pf-flow-item {
    flex: 0 0 calc(50% - 8px);
  }

  .powerflow-detail-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.pf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid #c2cdda;
  flex-shrink: 0;
}
.pf-card-title {
  color: #2a3648;
  font-size: 13px;
}
.pf-card-header .pf-card-value {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.pf-card-title-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.pf-card-title-subtext {
  color: #6b7b8f;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.pf-card-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
}
.pf-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  flex-shrink: 0;
}
.pf-card-label {
  color: #2f3d50;
  font-weight: 500;
  min-width: 65px;
  flex-shrink: 0;
}
.pf-card-row .pf-card-value {
  color: #1a2332;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex: 1;
  font-size: 11px;
}
.pf-card-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  padding-top: 4px;
  border-top: 1px solid #c2cdda;
  color: #151f2d;
  flex-shrink: 0;
}
.pf-card-total .pf-card-label {
  font-weight: 700;
}
.pf-card-total .pf-card-value {
  text-align: right;
  flex: 1;
  font-size: 11px;
}
.calc-equation { background: var(--surface); }
.calc-total { background: var(--surface); font-weight: 600; }
.cs-key { color: var(--text-muted); flex-shrink: 0; }
.cs-val { text-align: right; font-weight: 500; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cs-note { font-weight: 400; font-size: 12px; color: var(--text-faint); }
.cs-limit { color: var(--amber); font-size: 13px; }
.notice {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ------ Empty state ------ */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-faint);
  font-size: 13px;
}
.empty i {
  font-size: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  line-height: 1;
  margin: 0 auto 10px;
  color: var(--text-faint);
}

/* ------ Loading ------ */
.loading { text-align: center; padding: 1rem; color: var(--text-faint); font-size: 13px; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    padding: 1rem;
    gap: 1rem;
  }
  .main {
    padding: 1rem;
    gap: 1rem;
  }
  .field-row,
  .field-row-3,
  .field-row-4,
  .field-row-5 {
    grid-template-columns: 1fr;
  }
  .icp-lookup-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .icp-lookup-row .action-btn {
    width: 100%;
  }
  .section-head {
    margin-bottom: 8px;
  }
  .plan-compare-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .section-head-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }
  .plan-head-toggle-group {
    gap: 6px;
  }
  .plan-head-toggle-group .plan-toggle-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    line-height: 1.2;
    color: var(--text-muted);
  }
  .plan-head-toggle-group .plan-toggle-btn:hover {
    background: var(--surface);
    text-decoration: none;
  }
  .plan-toggle-btn,
  .gst-toggle-label,
  .tou-display-toggle-label {
    min-height: 30px;
  }
  .insights-summary-table {
    min-width: 560px;
  }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .monthly-grid { grid-template-columns: repeat(6, 1fr); }
  .optimized-chart-head { flex-direction: column; }
  .optimized-chart-meta { justify-content: flex-start; }
  .optimized-chart-canvas-wrap { height: 210px; }
  .plan-option-list { grid-template-columns: 1fr; }
  .plan-option-item { flex-direction: column; }
  .plan-option-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-option-meta {
    grid-template-columns: 1fr;
  }
  .plan-option-meta .plan-option-stat-annual-bill {
    min-width: 0;
  }
  .ss-value-annual-bill {
    font-size: 20px;
  }
  .plan-option-action {
    position: static;
    top: auto;
    right: auto;
    align-self: flex-end;
    margin-left: 0;
  }
  .powerflow-figure { padding: 14px; }
  .pf-box-title { font-size: 13px; }
  .pf-box-value { font-size: 11px; }
  .pf-flow-label { font-size: 0.84rem; }
  .pf-flow-detail { font-size: 0.68rem; }
  .pf-flow-subdetail { font-size: 0.68rem; }
  .pf-footnote { font-size: 0.69rem; }
  .pf-flow-divider,
  .pf-footnote-divider { stroke-width: 0.7; }
  .info-meta { flex-direction: column; gap: 4px; }
  .tou-24h-line {
    height: 22px;
  }
  .timeline-band-tou {
    height: 20px;
  }
  .timeline-band-soc {
    height: 60px;
  }
  .timeline-band-labels {
    min-height: 18px;
  }
  .timeline-period-label {
    font-size: 9px;
    padding: 2px 4px;
  }
  .tou-source-key {
    flex-direction: column;
    gap: 3px;
  }
  .tou-load-bars {
    height: 56px;
  }
  .soc-24h-line {
    height: 60px;
  }
  .dispatch-footer-grid {
    padding: 10px 12px 12px;
    grid-template-columns: 1fr;
  }
  .bestcase-compare-grid {
    grid-template-columns: 1fr;
  }
  .tabs {
    flex-direction: column;
    align-items: stretch;
  }
  .tabs-left {
    overflow-x: auto;
  }
  .tabs-right {
    margin-left: 0;
    justify-content: flex-end;
  }
  .methodology-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-actions {
    grid-template-columns: 1fr;
  }
  .contact-actions .run-btn {
    width: 100%;
  }
  .insights-top-layout {
    grid-template-columns: 1fr;
  }
  .pinned-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .soc-axis {
    font-size: 8px;
  }
  .tou-legend-item {
    grid-template-columns: minmax(170px, 1fr) repeat(8, minmax(64px, auto));
    row-gap: 2px;
    column-gap: 6px;
  }
  .info-arrows {
    flex-direction: column;
    gap: 2px;
    margin-bottom: 7px;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 8px 1rem;
    min-height: auto;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .app-header .logo {
    font-size: 14px;
  }
  .app-header .logo-tagline {
    font-size: 10px;
  }
  .app-header .top-nav {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .app-header .top-nav a {
    white-space: nowrap;
  }
  .service-info-bar {
    padding: 8px 1rem;
  }
  .section-head-actions {
    align-items: center;
  }
  .section-head-actions .tou-display-toggle-label {
    font-size: 11px;
  }
  .plan-head-toggle-group .plan-toggle-btn {
    padding: 4px 9px;
    font-size: 11px;
  }
  .tabs-left .tab-btn {
    white-space: nowrap;
  }
  .plan-check-label {
    padding: 9px 0;
  }
  .insights-summary-table {
    min-width: 520px;
  }
  .tou-legend-item {
    min-width: 760px;
  }
  .tou-name,
  .tou-rate,
  .tou-mini {
    font-size: 11px;
  }
  .pinned-plan-grid {
    grid-template-columns: 1fr;
  }
}




