:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-2: #fbfcf8;
  --text: #17211d;
  --muted: #66736f;
  --line: #dfe5de;
  --solar: #d79b22;
  --load: #2f6f73;
  --grid: #8b5e9a;
  --good: #147a5a;
  --alert: #b35a2d;
}

/* Generator maintenance and backup readiness */
.generator-resource-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.generator-resource-grid .fuel-panel {
  margin: 0;
}

.maintenance-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(72, 212, 162, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(9, 29, 31, 0.98), rgba(12, 39, 42, 0.96));
  color: #f4fbf9;
}

.maintenance-gauge {
  --maintenance-progress: 0deg;
  width: 136px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#49d8a3 var(--maintenance-progress), rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 24px rgba(63, 215, 161, 0.12);
  position: relative;
}

.maintenance-gauge::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #0b2022;
  border: 1px solid rgba(157, 202, 198, 0.16);
}

.maintenance-gauge[data-status="dueSoon"],
.maintenance-gauge[data-status="due"],
.maintenance-gauge[data-status="coverageWarning"] {
  background: conic-gradient(#f4b63f var(--maintenance-progress), rgba(159, 190, 188, 0.16) 0);
}

.maintenance-gauge[data-status="overdue"] {
  background: conic-gradient(#ef6b6b 360deg, rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 28px rgba(239, 107, 107, 0.2);
}

.maintenance-gauge-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.maintenance-gauge-core strong {
  font-size: 1.55rem;
  line-height: 1;
  color: #f8fffc;
}

.maintenance-gauge-core span,
.maintenance-summary > span {
  color: #91aaa8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.maintenance-summary {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.maintenance-summary > strong {
  font-size: 1.35rem;
  color: #69e6b5;
}

.maintenance-summary > small {
  color: #b4c7c5;
  line-height: 1.4;
}

.maintenance-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
}

.maintenance-mini-grid span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(129, 182, 177, 0.16);
  border-radius: 6px;
  background: rgba(5, 20, 22, 0.58);
}

.maintenance-mini-grid b,
.maintenance-mini-grid em {
  display: block;
  overflow-wrap: anywhere;
}

.maintenance-mini-grid b {
  color: #edf8f6;
  font-size: 0.86rem;
}

.maintenance-mini-grid em {
  margin-top: 3px;
  color: #829c9a;
  font-size: 0.64rem;
  font-style: normal;
  text-transform: uppercase;
}

.resilience-forecast-panel {
  --forecast-card-gap: 10px;
  --forecast-scenario-gap: 7px;
  --forecast-scenario-label-size: 0.74rem;
  --forecast-scenario-value-size: clamp(0.96rem, 1.8vw, 1.12rem);
  --forecast-help-visual-size: 26px;
  --forecast-help-hit-target: 44px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(72, 212, 162, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 27, 32, 0.98), rgba(10, 36, 42, 0.96));
  color: #f4fbf9;
}

.resilience-forecast-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.resilience-forecast-head span {
  color: #91aaa8;
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.resilience-forecast-head h2 {
  color: #f5fbfb;
  font-size: 1.25rem;
  margin: 3px 0;
}

.resilience-forecast-head p,
.resilience-forecast-notes p,
.resilience-forecast-notes li,
.resilience-timeline-legend span,
.resilience-forecast-grid small,
.resilience-checkpoints small {
  color: #b4c7c5;
  line-height: 1.4;
}

.resilience-confidence-wrap > strong {
  align-self: start;
  background: rgba(5, 20, 22, 0.7);
  border: 1px solid rgba(129, 182, 177, 0.22);
  border-radius: 999px;
  color: #7de7b9;
  font-size: 0.78rem;
  padding: 7px 10px;
  white-space: nowrap;
}

.resilience-confidence-wrap,
.forecast-card__header {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) var(--forecast-help-hit-target);
  min-width: 0;
}

.resilience-confidence-wrap {
  align-self: start;
}

.forecast-help-control {
  align-items: center;
  background: transparent;
  border: 0;
  color: #b8f5d8;
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 var(--forecast-help-hit-target);
  font: 800 0.83rem/1 system-ui, sans-serif;
  height: var(--forecast-help-hit-target);
  justify-content: center;
  min-height: var(--forecast-help-hit-target);
  padding: 0;
  place-items: center;
  width: var(--forecast-help-hit-target);
}

.forecast-help-control > span {
  align-items: center;
  background: rgba(5, 20, 22, 0.78);
  border: 1px solid rgba(125, 231, 185, 0.54);
  border-radius: 50%;
  display: inline-flex;
  height: var(--forecast-help-visual-size);
  justify-content: center;
  width: var(--forecast-help-visual-size);
}

.forecast-help-control:hover > span,
.forecast-help-control:focus-visible > span {
  background: rgba(105, 230, 181, 0.16);
}

.forecast-help-control:focus-visible {
  outline: 2px solid #b8f5d8;
  outline-offset: 2px;
}

.forecast-scenario-list {
  display: grid;
  gap: var(--forecast-scenario-gap);
  margin: 7px 0;
  min-width: 0;
}

.forecast-scenario-row {
  align-items: baseline;
  display: grid;
  gap: var(--forecast-card-gap);
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  text-transform: none;
}

.forecast-scenario-label {
  color: #91aaa8;
  font-size: var(--forecast-scenario-label-size);
  line-height: 1.25;
  min-width: 0;
}

.forecast-scenario-value {
  color: #edf8f6;
  font-size: var(--forecast-scenario-value-size);
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

.resilience-help-popover {
  background: #082326;
  border: 1px solid rgba(125, 231, 185, 0.5);
  border-radius: 7px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  color: #d7ebe9;
  max-width: min(360px, calc(100vw - 24px));
  padding: 12px;
  position: fixed;
  z-index: 40;
}

.resilience-help-popover[hidden] {
  display: none;
}

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

.resilience-help-popover-head strong {
  color: #f5fbfb;
  font-size: 0.92rem;
}

.resilience-help-popover p {
  color: #b4c7c5;
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 9px 0 0;
}

.forecast-help-close {
  background: transparent;
  border: 0;
  color: #8decc1;
  cursor: pointer;
  font: 800 0.78rem/1 system-ui, sans-serif;
  min-height: 36px;
  padding: 0 4px;
}

.resilience-forecast-grid,
.resilience-checkpoints {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resilience-forecast-grid article,
.resilience-checkpoints article {
  border: 1px solid rgba(129, 182, 177, 0.16);
  border-radius: 7px;
  background: rgba(5, 20, 22, 0.58);
}

.forecast-card {
  align-content: start;
  display: grid;
  gap: var(--forecast-card-gap);
  min-width: 0;
  padding: 10px;
}

.forecast-card__title {
  color: #91aaa8;
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.forecast-card__primary-value {
  color: #edf8f6;
  display: block;
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.forecast-card__detail,
.forecast-checkpoint-time {
  color: #b4c7c5;
  display: block;
  line-height: 1.4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.forecast-checkpoint-time {
  color: #c9ddda;
  font-weight: 700;
}

.resilience-timeline {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.resilience-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.resilience-timeline-legend span {
  align-items: center;
  display: inline-flex;
  font-size: 0.76rem;
  gap: 6px;
}

.resilience-timeline-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 4px;
  width: 22px;
}

.resilience-timeline-legend .expected { background: #69e6b5; }
.resilience-timeline-legend .conservative { background: #f4c15b; }
.resilience-timeline-legend .reserve { background: #ff8585; }

.resilience-timeline .history-chart-shell canvas {
  display: block;
  height: 260px;
  margin-top: 0;
  max-width: 100%;
  touch-action: none;
  width: 100%;
}

.resilience-timeline .history-chart-controls {
  margin-top: 6px;
}

.resilience-timeline .history-chart-readout {
  background: rgba(5, 20, 22, 0.62);
}

.resilience-forecast-notes {
  display: grid;
  gap: 7px;
}

.resilience-forecast-alert {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid #f4c15b;
  border-radius: 5px;
  background: rgba(98, 69, 20, 0.26);
  color: #f8df9b;
  font-size: 0.8rem;
  line-height: 1.4;
}

.resilience-forecast-alert[data-severity="actionable"] {
  border-left-color: #ff8585;
  background: rgba(100, 39, 36, 0.28);
  color: #ffd0ca;
}

.dashboard-disclosure {
  overflow: hidden;
  border: 1px solid rgba(129, 182, 177, 0.22);
  border-radius: 7px;
  background: rgba(5, 20, 22, 0.34);
}

.dashboard-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  background: rgba(5, 20, 22, 0.36);
}

.dashboard-disclosure > summary::-webkit-details-marker { display: none; }

.dashboard-disclosure > summary::after {
  content: "+";
  color: #9cf0c8;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.dashboard-disclosure[open] > summary::after { content: "-"; }

.dashboard-disclosure__summary-title,
.dashboard-disclosure__summary-state { min-width: 0; }

.dashboard-disclosure__summary-title {
  color: #edf8f6;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-disclosure__summary-state {
  color: #b7cac8;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.dashboard-disclosure[data-attention="true"] {
  border-color: rgba(255, 133, 133, 0.72);
}

.dashboard-disclosure[data-attention="true"] > summary {
  background: rgba(100, 39, 36, 0.22);
}

.dashboard-disclosure[data-attention="true"] > summary::after,
.dashboard-disclosure[data-attention="true"] .dashboard-disclosure__summary-state { color: #ffd0ca; }

.dashboard-disclosure > summary:focus-visible {
  outline: 3px solid #f4c65e;
  outline-offset: -3px;
}

.dashboard-disclosure__body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid rgba(129, 182, 177, 0.16);
}

.resilience-forecast-details .dashboard-disclosure__body { gap: 14px; }

.dashboard-disclosure--solar {
  border-color: rgba(137, 221, 200, 0.2);
  background: rgba(3, 20, 26, 0.24);
}

.dashboard-disclosure--solar > summary { background: rgba(3, 20, 26, 0.3); }

.dashboard-disclosure--live,
.dashboard-disclosure--generator {
  border-color: rgba(129, 182, 177, 0.24);
  background: rgba(5, 20, 22, 0.3);
}

.dashboard-disclosure--live > summary,
.dashboard-disclosure--generator > summary { background: rgba(5, 20, 22, 0.42); }

.live-metrics.live-metrics--core { display: none; }

.live-core-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border-left: 2px solid rgba(125, 231, 185, 0.48);
  background: rgba(5, 20, 22, 0.44);
}

.live-core-metric span {
  color: #9fc1bc;
  font-size: 0.65rem;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.live-core-metric strong {
  color: #edf8f6;
  font-size: 0.86rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.resilience-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
}

.resilience-secondary-grid > article {
  border: 1px solid rgba(129, 182, 177, 0.16);
  border-radius: 7px;
  background: rgba(5, 20, 22, 0.58);
}

.solar-forecast-provenance {
  margin: 0;
  color: #bddbd6;
  font-size: 0.74rem;
  line-height: 1.4;
}

.solar-forecast-provenance span { color: #9fc7c0; }

.generator-resource-disclosure .dashboard-disclosure__body { padding: 12px; }
.generator-resource-disclosure .generator-resource-grid { margin-top: 0; }

.solar-forecast-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(96, 216, 187, 0.32);
  border-radius: 8px;
  background: linear-gradient(125deg, rgba(8, 40, 43, 0.94), rgba(10, 29, 42, 0.9));
  color: #e8f7f1;
}

.solar-forecast-panel__heading,
.solar-forecast-hero,
.solar-forecast-confidence__intro,
.solar-forecast-learning {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.solar-forecast-panel__heading > div,
.solar-forecast-confidence__intro > div,
.solar-forecast-learning > div { min-width: 0; }
.solar-forecast-panel__heading span,
.solar-forecast-hero span,
.solar-forecast-confidence span,
.solar-forecast-learning span { display: block; color: #a9cfca; font-size: 0.72rem; line-height: 1.3; }
.solar-forecast-panel__heading h3 { margin: 2px 0 0; color: #f1fbf7; font-size: 1.08rem; }
.solar-forecast-panel__heading > strong { color: #9cf0c8; font-size: 0.78rem; }
.solar-forecast-panel__heading > strong[data-solar-forecast-state="building"],
.solar-forecast-panel__heading > strong[data-solar-forecast-state="disabled"] { color: #e4cd89; }
.solar-forecast-panel__heading > strong[data-solar-forecast-state="unavailable"],
.solar-forecast-panel__heading > strong[data-solar-forecast-state="degraded"] { color: #ffb1a8; }

.solar-forecast-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 1.25fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
}

.solar-forecast-hero > div,
.solar-forecast-confidence,
.solar-forecast-learning > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(137, 221, 200, 0.17);
  border-radius: 6px;
  background: rgba(3, 20, 26, 0.38);
}

.solar-forecast-hero strong { display: block; margin-top: 4px; color: #edfdf7; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.solar-forecast-hero > .solar-forecast-expected { border-color: rgba(106, 234, 185, 0.4); background: rgba(18, 78, 68, 0.42); }
.solar-forecast-expected strong { color: #7ff1bf; font-size: 1.8rem; }
.solar-forecast-hero small,
.solar-forecast-learning small { display: block; margin-top: 5px; color: #bddbd6; line-height: 1.36; overflow-wrap: anywhere; }

.solar-forecast-confidence { display: grid; gap: 9px; }
.solar-forecast-confidence__intro p { max-width: 48rem; margin: 1px 0 0; color: #c8e1dc; line-height: 1.42; }
.solar-forecast-confidence__intro strong,
.solar-forecast-learning strong { display: block; margin-top: 3px; color: #f3fbf8; }
.solar-forecast-intraday-readiness { display: grid; gap: 9px; min-width: 0; padding: 11px 12px; border: 1px solid rgba(137, 221, 200, 0.17); border-radius: 6px; background: rgba(3, 20, 26, 0.3); }
.solar-forecast-intraday-readiness__intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.solar-forecast-intraday-readiness__intro > div { min-width: 0; }
.solar-forecast-intraday-readiness__intro span,
.solar-forecast-intraday-readiness__metric > span,
.solar-forecast-intraday-readiness__group > span { display: block; color: #a9cfca; font-size: 0.7rem; line-height: 1.3; }
.solar-forecast-intraday-readiness__intro strong { display: block; margin-top: 3px; color: #f3fbf8; font-size: 0.84rem; }
.solar-forecast-intraday-readiness__intro p { max-width: 48rem; margin: 1px 0 0; color: #c8e1dc; font-size: 0.76rem; line-height: 1.4; }
.solar-forecast-intraday-readiness__gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.solar-forecast-intraday-readiness__metric,
.solar-forecast-intraday-readiness__group { min-width: 0; padding: 7px 8px; border-left: 2px solid rgba(185, 215, 208, 0.24); background: rgba(7, 29, 34, 0.26); }
.solar-forecast-intraday-readiness__metric[data-readiness-state="met"] { border-left-color: #75e7b8; }
.solar-forecast-intraday-readiness__metric strong { display: block; margin-top: 2px; color: #e8f7f1; font-size: 0.77rem; line-height: 1.25; }
.solar-forecast-intraday-readiness__progress { display: block; height: 5px; margin-top: 5px; overflow: hidden; border: 1px solid rgba(150, 198, 186, 0.2); border-radius: 999px; background: rgba(2, 15, 21, 0.58); }
.solar-forecast-intraday-readiness__progress > span { display: block; width: calc(var(--evidence-progress, 0) * 100%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(59, 194, 151, 0.8), rgba(115, 231, 184, 0.56)); transition: width 0.22s ease; }
.solar-forecast-intraday-readiness__group { grid-column: span 1; }
.solar-forecast-intraday-readiness__group > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 5px; }
.solar-forecast-intraday-readiness__section { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 0; padding: 8px; border: 1px solid rgba(137, 221, 200, 0.12); border-radius: 5px; background: rgba(4, 21, 27, 0.2); }
.solar-forecast-intraday-readiness__section > span { color: #9fc7c0; font-size: 0.66rem; font-weight: 650; line-height: 1.25; }
.solar-forecast-intraday-readiness__section > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.solar-forecast-intraday-readiness__section[data-readiness-population="curtailed-window"] { border-color: rgba(115, 231, 184, 0.18); background: rgba(9, 40, 42, 0.18); }
.solar-forecast-intraday-readiness__chip { display: grid; gap: 2px; min-width: 0; padding: 4px 5px; border: 1px solid rgba(137, 221, 200, 0.13); border-radius: 4px; background: rgba(4, 20, 27, 0.28); }
.solar-forecast-intraday-readiness__chip > span:first-child { color: #b9dcd5; font-size: 0.61rem; line-height: 1.2; overflow-wrap: anywhere; }
.solar-forecast-intraday-readiness__chip strong { color: #e7f8f1; font-size: 0.63rem; line-height: 1.2; white-space: nowrap; }
.solar-forecast-intraday-readiness__chip[data-readiness-state="met"] { border-color: rgba(117, 231, 184, 0.36); }
.solar-forecast-intraday-readiness__chip .solar-forecast-intraday-readiness__progress { height: 4px; margin-top: 1px; }
.solar-forecast-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 6px; }
.solar-forecast-ladder__stage { position: relative; isolation: isolate; display: grid; grid-template-rows: auto auto auto 1fr auto; align-content: start; min-height: 88px; gap: 4px; overflow: hidden; padding: 8px 9px; border: 1px solid rgba(185, 215, 208, 0.2); border-radius: 5px; color: #8faeaa; background: rgba(4, 20, 27, 0.5); }
.solar-forecast-ladder__stage.complete::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(59, 194, 151, 0.68), rgba(115, 231, 184, 0.3)); }
.solar-forecast-ladder__stage b { display: block; color: currentColor; font-size: 0.78rem; line-height: 1.2; }
.solar-forecast-ladder__evidence { display: block; min-height: 0.84rem; color: currentColor; font-size: 0.66rem; line-height: 1.25; overflow-wrap: normal; opacity: 0.88; }
.solar-forecast-ladder__evidence:empty { display: none; }
.solar-forecast-ladder__gates { display: grid; gap: 5px; margin-top: 1px; }
.solar-forecast-ladder__gate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 5px; color: #bcd7d1; font-size: 0.58rem; line-height: 1.2; }
.solar-forecast-ladder__gate > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.solar-forecast-ladder__gate strong { color: #e0f1ec; font-size: inherit; font-weight: 700; white-space: nowrap; }
.solar-forecast-ladder__gate.categorical strong { color: #93ecc4; }
.solar-forecast-ladder__gate.categorical[data-gate-state="building"] strong { color: #c9ded8; }
.solar-forecast-ladder__gates.preview { gap: 4px; opacity: 0.78; }
.solar-forecast-ladder__gates.preview .solar-forecast-ladder__gate { font-size: 0.54rem; }
.solar-forecast-ladder__gates.preview .solar-forecast-ladder__progress { height: 4px; }
.solar-forecast-ladder__stage.long-term { border-color: rgba(145, 184, 176, 0.27); background: rgba(4, 20, 27, 0.42); }
.solar-forecast-ladder__progress { grid-column: 1 / -1; display: block; height: 5px; overflow: hidden; border: 1px solid rgba(150, 198, 186, 0.2); border-radius: 999px; background: rgba(2, 15, 21, 0.58); }
.solar-forecast-ladder__progress > span { display: block; width: calc(var(--evidence-progress, 0) * 100%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(59, 194, 151, 0.8), rgba(115, 231, 184, 0.56)); transition: width 0.22s ease; }
.solar-forecast-ladder__status { align-self: end; display: block; color: currentColor; font-size: 0.63rem; font-weight: 700; line-height: 1.25; overflow-wrap: normal; }
.solar-forecast-ladder__blocker { display: block; color: #abc8c2; font-size: 0.61rem; line-height: 1.24; overflow-wrap: anywhere; }
.solar-forecast-ladder__stage.complete { border-color: rgba(115, 231, 184, 0.42); color: #d6f5e7; }
.solar-forecast-ladder__stage.complete .solar-forecast-ladder__status { color: #8ef0c4; }
.solar-forecast-ladder__stage.current { border-color: rgba(91, 229, 179, 0.8); color: #f0fff8; box-shadow: inset 3px 0 0 #75e7b8; }
.solar-forecast-ladder__stage.current .solar-forecast-ladder__status { color: #9cf0c8; }
.solar-forecast-ladder__stage.next { border-color: rgba(159, 203, 192, 0.34); color: #d0e2de; background: rgba(6, 25, 31, 0.72); }
.solar-forecast-ladder__stage.next .solar-forecast-ladder__status { color: #c1ddd7; }
.solar-forecast-ladder__stage.future .solar-forecast-ladder__status { color: #7e9c99; }
.solar-forecast-confidence-gates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.solar-forecast-confidence-gate { min-width: 0; padding: 7px 8px; border-left: 2px solid rgba(185, 215, 208, 0.24); background: rgba(7, 29, 34, 0.3); }
.solar-forecast-confidence-gate[data-gate-state="met"] { border-left-color: #75e7b8; }
.solar-forecast-confidence-gate span { color: #a9cfca; font-size: 0.66rem; }
.solar-forecast-confidence-gate strong { display: block; margin-top: 2px; color: #e8f7f1; font-size: 0.72rem; line-height: 1.28; overflow-wrap: anywhere; }

.solar-forecast-learning { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.solar-forecast-coverage { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.solar-forecast-coverage span { display: inline-flex; gap: 3px; padding: 3px 5px; border: 1px solid rgba(137, 221, 200, 0.16); border-radius: 4px; background: rgba(7, 29, 34, 0.3); color: #b9dcd5; font-size: 0.66rem; }
.solar-forecast-coverage strong { display: inline; margin: 0; color: #e7f8f1; font-size: inherit; }
.solar-forecast-safety { margin: 0; color: #afd1ca; font-size: 0.78rem; line-height: 1.4; }

.weather-technical-diagnostics { margin-top: 8px; padding: 10px 12px; border: 1px solid rgba(129, 177, 219, 0.2); border-radius: 7px; background: rgba(7, 27, 35, 0.3); }
.weather-technical-diagnostics > summary { cursor: pointer; color: #cce8e1; font-weight: 700; }
.weather-technical-diagnostics > p { margin: 7px 0 0; color: #abc7c2; font-size: 0.8rem; line-height: 1.4; }
.weather-technical-diagnostics[open] > .weather-shadow-diagnostic { margin-top: 10px; }

.weather-shadow-diagnostic {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(93, 218, 186, 0.26);
  border-radius: 8px;
  background: rgba(9, 38, 43, 0.72);
  color: #d9ece7;
}

.weather-shadow-diagnostic > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.weather-shadow-diagnostic span { color: #c6ded9; }
.weather-shadow-diagnostic small { color: #acc8c3; }
.weather-shadow-diagnostic strong { color: #9cf0c8; letter-spacing: 0; }
.weather-shadow-diagnostic p { color: #d9ece7; margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.weather-shadow-diagnostic strong[data-weather-state="stale"],
.weather-shadow-diagnostic strong[data-weather-state="rate_limited"] { color: #f4c15b; }
.weather-shadow-diagnostic strong[data-weather-state="error"],
.weather-shadow-diagnostic strong[data-weather-state="invalid_response"],
.weather-shadow-diagnostic strong[data-weather-state="unusable"] { color: #ff9d9d; }
.weather-shadow-diagnostic strong[data-weather-state="disabled"],
.weather-shadow-diagnostic strong[data-weather-state="awaiting_configuration"],
.weather-shadow-diagnostic strong[data-weather-state="starting"],
.weather-shadow-diagnostic strong[data-weather-state="fetching"] { color: #c6ded9; }

.weather-evidence-diagnostic {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(129, 177, 219, 0.25);
  border-radius: 8px;
  background: rgba(8, 29, 39, 0.68);
  color: #d5e7ef;
}

.weather-evidence-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.weather-evidence-diagnostic span { color: #bdd6e0; }
.weather-evidence-diagnostic p { color: #d5e7ef; margin: 0; line-height: 1.42; overflow-wrap: anywhere; }
.weather-evidence-diagnostic small { color: #a9c4cf; overflow-wrap: anywhere; }
.weather-evidence-diagnostic strong { color: #8bd9eb; letter-spacing: 0; }
.weather-evidence-diagnostic strong[data-evidence-state="disabled"],
.weather-evidence-diagnostic strong[data-evidence-state="paused"],
.weather-evidence-diagnostic strong[data-evidence-state="awaiting_more_data"],
.weather-evidence-diagnostic strong[data-evidence-state="starting"] { color: #bdd6e0; }
.weather-evidence-diagnostic strong[data-evidence-state="unavailable"] { color: #ffb1a8; }

.weather-evidence-metrics,
.weather-evidence-pipeline,
.weather-evidence-queue {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.weather-evidence-metrics article,
.weather-evidence-pipeline > div,
.weather-evidence-queue > div,
.weather-evidence-queue > p,
.weather-evidence-timeline-section,
.weather-evidence-recent-hours {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(132, 190, 213, 0.18);
  border-radius: 6px;
  background: rgba(4, 20, 28, 0.34);
}

.weather-evidence-metrics span,
.weather-evidence-pipeline span,
.weather-evidence-queue span {
  display: block;
  color: #abcbd5;
  font-size: 0.7rem;
  line-height: 1.25;
}

.weather-evidence-metrics strong,
.weather-evidence-pipeline strong,
.weather-evidence-queue strong {
  display: block;
  margin-top: 3px;
  color: #ecf9fc;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.weather-evidence-pipeline,
.weather-evidence-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weather-evidence-queue > p { grid-column: 1 / -1; color: #bdd6e0; }

.weather-evidence-timeline-section {
  display: grid;
  gap: 8px;
}

.weather-evidence-timeline-section > div:first-child { display: grid; gap: 2px; }
.weather-evidence-timeline-section > div:first-child strong { color: #e8f6fa; }
.weather-evidence-timeline-section > div:first-child small { color: #acc8d1; }

.weather-evidence-timeline {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
}

.weather-evidence-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: #bdd6e0;
  font-size: 0.8rem;
}

.weather-evidence-hour {
  display: grid;
  min-width: 0;
  min-height: 52px;
  padding: 5px 4px;
  border: 1px solid rgba(133, 178, 194, 0.28);
  border-radius: 5px;
  background: rgba(13, 41, 51, 0.9);
  color: #e4f4f7;
  text-align: left;
  cursor: pointer;
}

.weather-evidence-hour span { color: #bad7df; font-size: 0.63rem; }
.weather-evidence-hour b { color: inherit; font-size: 0.61rem; line-height: 1.15; overflow-wrap: anywhere; }
.weather-evidence-hour:hover,
.weather-evidence-hour[aria-pressed="true"] { border-color: #79dded; background: rgba(20, 65, 76, 0.95); }
.weather-evidence-hour:focus-visible { outline: 2px solid #b7eff6; outline-offset: 2px; }
.weather-evidence-hour.state-eligible { color: #a8f0c5; }
.weather-evidence-hour.state-eligible_with_caution { color: #f8d583; }
.weather-evidence-hour.state-insufficient_evidence,
.weather-evidence-hour.state-excluded { color: #ffb3aa; }
.weather-evidence-hour.state-not_applicable { color: #b4cbd0; }
.weather-evidence-hour.state-future,
.weather-evidence-hour.state-waiting_for_hour_completion,
.weather-evidence-hour.state-waiting_for_rollup_finality { color: #b9d5f0; }
.weather-evidence-hour.state-ready_for_reconciliation { color: #ffe1a2; }
.weather-evidence-hour.state-missing_actual_rollup,
.weather-evidence-hour.state-no_forecast_match,
.weather-evidence-hour.state-processing_error,
.weather-evidence-hour.state-unknown { color: #ffb4ad; }

.weather-evidence-timeline-detail {
  margin: 0;
  padding: 7px 8px;
  border-left: 3px solid #73d8e9;
  background: rgba(5, 24, 30, 0.62);
  color: #d7edf2;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.weather-evidence-recent-hours {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.weather-evidence-recent-hours summary { color: #e8f6fa; cursor: pointer; }
.weather-evidence-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.weather-evidence-table-wrap table {
  width: max-content;
  min-width: 1040px;
  border-collapse: collapse;
  color: #d9edf2;
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
.weather-evidence-table-wrap th,
.weather-evidence-table-wrap td {
  padding: 7px;
  border-bottom: 1px solid rgba(133, 178, 194, 0.18);
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow-wrap: normal;
}
.weather-evidence-table-wrap th { color: #b9dce5; font-size: 0.69rem; text-transform: uppercase; }

@media (max-width: 560px) {
  .weather-evidence-header { align-items: flex-start; flex-direction: column; gap: 2px; }
  .weather-evidence-metrics,
  .weather-evidence-pipeline,
  .weather-evidence-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weather-evidence-timeline { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 400px) {
  .weather-evidence-timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .dashboard-disclosure > summary {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 8px;
    min-height: 44px;
    padding: 9px 11px;
  }
  .dashboard-disclosure__summary-state {
    grid-column: 1;
    text-align: left;
  }
  .dashboard-disclosure > summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .dashboard-disclosure__body { padding: 11px; }
  .weather-shadow-diagnostic > div { align-items: flex-start; flex-direction: column; gap: 2px; }
  .solar-forecast-panel { padding: 13px; }
  .solar-forecast-panel__heading,
  .solar-forecast-confidence__intro,
  .solar-forecast-intraday-readiness__intro { flex-direction: column; gap: 5px; }
  .solar-forecast-hero,
  .solar-forecast-learning { grid-template-columns: 1fr; }
  .solar-forecast-expected strong { font-size: 1.55rem; }
  .solar-forecast-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solar-forecast-confidence-gates { grid-template-columns: 1fr; }
  .solar-forecast-intraday-readiness__gates { grid-template-columns: 1fr; }
  .solar-forecast-intraday-readiness__section > div { grid-template-columns: 1fr; }
}

.resilience-forecast-notes p,
.resilience-forecast-notes ul {
  margin: 0;
}

.resilience-forecast-notes ul {
  padding-left: 18px;
}

.config-section-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 9px 0 6px;
  border-bottom: 1px solid rgba(115, 169, 165, 0.2);
}

.config-section-divider strong { color: #edf8f6; }
.config-section-divider small { color: #91aaa8; }

.generator-maintenance-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.generator-maintenance-actions button:first-child {
  grid-column: 1 / -1;
}

.readiness-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.readiness-check {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(119, 169, 166, 0.22);
  border-radius: 6px;
  background: rgba(5, 24, 26, 0.72);
}

.readiness-check span,
.readiness-check strong,
.readiness-check small { display: block; }
.readiness-check span { color: #90aaa7; font-size: 0.68rem; text-transform: uppercase; }
.readiness-check strong { margin: 4px 0; color: #66e4b2; }
.readiness-check small { color: #b7cac8; line-height: 1.35; }
.readiness-review strong { color: #f4c15b; }
.readiness-degraded strong,
.readiness-unknown strong { color: #f4c15b; }
.readiness-fail strong { color: #ff8585; }

@media (max-width: 900px) {
  .generator-resource-grid { grid-template-columns: 1fr; }
  .readiness-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resilience-forecast-grid,
  .resilience-checkpoints { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .maintenance-panel { grid-template-columns: 104px minmax(0, 1fr); padding: 13px; gap: 12px; }
  .maintenance-gauge { width: 96px; }
  .maintenance-gauge-core strong { font-size: 1.15rem; }
  .maintenance-mini-grid { grid-template-columns: 1fr; }
  .generator-maintenance-actions,
  .readiness-check-grid { grid-template-columns: 1fr; }
  .generator-maintenance-actions button:first-child { grid-column: auto; }
  .config-section-divider { align-items: flex-start; flex-direction: column; gap: 3px; }
  .resilience-forecast-panel { padding: 13px; }
  .resilience-forecast-head { grid-template-columns: 1fr; }
  .resilience-forecast-head > strong { justify-self: start; white-space: normal; }
  .resilience-forecast-grid,
  .resilience-checkpoints { grid-template-columns: 1fr; }
  .resilience-timeline .history-chart-shell canvas { height: 220px; }
}

/* Configuration Integrity Audit: local spreadsheet review only. */
.config-audit-panel,
.installation-profile-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.config-audit-hero,
.config-audit-empty,
.config-audit-baseline,
.config-audit-candidate,
.config-audit-report {
  min-width: 0;
}

.config-audit-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.config-audit-hero h2,
.config-audit-empty h3,
.config-audit-baseline h3,
.config-audit-candidate h3,
.config-audit-report h3 {
  margin: 3px 0 0;
}

.config-audit-hero p,
.config-audit-notice,
.config-audit-checklist-panel > p {
  max-width: 76ch;
  color: #aac1bf;
  line-height: 1.5;
}

.config-audit-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(87, 208, 171, 0.25);
  border-radius: 6px;
  background: rgba(10, 43, 43, 0.56);
}

.config-audit-readonly,
.config-audit-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(87, 208, 171, 0.32);
  border-radius: 999px;
  color: #83ebc5;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.config-audit-pill[data-tone="warning"] { color: #f5ca69; border-color: rgba(245, 202, 105, 0.46); }
.config-audit-pill[data-tone="critical"],
.config-audit-pill[data-tone="attention"] { color: #ff9b9b; border-color: rgba(255, 155, 155, 0.46); }

.config-audit-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
}

.config-audit-empty ol {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  color: #bdd0ce;
  line-height: 1.55;
}

.config-audit-upload-label,
.config-audit-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(91, 218, 181, 0.56);
  border-radius: 6px;
  background: #2b8769;
  color: #f5fffc;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.config-audit-upload-label.subtle { background: rgba(19, 66, 64, 0.78); }
.config-audit-upload-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.config-audit-upload-label:focus-within,
.config-audit-actions button:focus-visible,
.config-audit-filter:focus-visible,
.config-audit-checklist-item input:focus-visible { outline: 3px solid #f4c65e; outline-offset: 3px; }

.config-audit-details,
.config-audit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.config-audit-details > div,
.config-audit-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(118, 183, 178, 0.18);
  border-radius: 5px;
  background: rgba(4, 25, 27, 0.48);
}

.config-audit-details dt,
.config-audit-summary span {
  color: #8fa9a7;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
}

.config-audit-details dd,
.config-audit-summary strong {
  display: block;
  margin: 4px 0 0;
  color: #e8f5f1;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.config-audit-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.config-audit-candidate { display: grid; gap: 10px; }
.config-audit-issues { display: grid; gap: 8px; }
.config-audit-issue { display: grid; gap: 5px; min-width: 0; padding: 9px 10px; border-left: 3px solid #f4c65e; background: rgba(86, 69, 26, 0.2); color: #e8d9a9; }
.config-audit-issue.error { border-color: #ee8d8d; background: rgba(104, 40, 40, 0.22); color: #ffc3c3; }
.config-audit-issue h4,
.config-audit-issue p { margin: 0; overflow-wrap: anywhere; }
.config-audit-issue h4 { color: inherit; font-size: 0.95rem; }
.config-audit-issue small { color: #b6cbc8; overflow-wrap: anywhere; }
.config-audit-issue dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 2px 0; }
.config-audit-issue dl > div { min-width: 0; padding: 6px 7px; border: 1px solid rgba(194, 229, 222, 0.16); background: rgba(3, 20, 22, 0.28); }
.config-audit-issue dt { color: #b6cbc8; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; }
.config-audit-issue dd { margin: 3px 0 0; color: #f1fbf8; font-weight: 700; overflow-wrap: anywhere; }
.config-audit-ok { margin: 0; color: #86e7c5; line-height: 1.45; }
.config-audit-error { color: #ffb0b0; }

.config-audit-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.config-audit-summary-grid .metric { min-width: 0; }
.config-audit-summary-grid .metric strong { overflow-wrap: anywhere; }
.config-audit-report { display: grid; gap: 14px; }
.config-audit-findings { display: grid; gap: 10px; }
.config-audit-finding-card { display: grid; gap: 8px; min-width: 0; padding: 12px; border: 1px solid rgba(245, 202, 105, 0.34); border-left: 4px solid #f4c65e; border-radius: 6px; background: rgba(8, 33, 34, 0.7); }
.config-audit-finding-card.severity-critical { border-color: rgba(255, 143, 143, 0.5); border-left-color: #ef8585; }
.config-audit-finding-card > div { display: flex; justify-content: space-between; gap: 10px; }
.config-audit-finding-card > div span { color: #98b3b0; font-size: 0.8rem; }
.config-audit-finding-card p { margin: 0; color: #c1d2d0; line-height: 1.45; overflow-wrap: anywhere; }
.config-audit-finding-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; }
.config-audit-finding-card dl div { min-width: 0; }
.config-audit-finding-card dt { color: #8fa9a7; font-size: 0.68rem; text-transform: uppercase; }
.config-audit-finding-card dd { margin: 3px 0 0; color: #f4fffc; overflow-wrap: anywhere; }

.config-audit-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.config-audit-filter { min-height: 38px; padding: 7px 10px; border: 1px solid rgba(109, 181, 174, 0.25); border-radius: 999px; background: rgba(9, 42, 43, 0.65); color: #c1d3d1; cursor: pointer; font: inherit; font-size: 0.78rem; }
.config-audit-filter.active { border-color: #62d7ae; background: rgba(47, 132, 104, 0.5); color: #f2fffb; }
.generator-event-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.generator-event-filter { min-height: 36px; padding: 6px 10px; border: 1px solid rgba(109, 181, 174, 0.25); border-radius: 999px; background: rgba(9, 42, 43, 0.65); color: #c1d3d1; cursor: pointer; font: inherit; font-size: 0.78rem; }
.generator-event-filter.active { border-color: #62d7ae; background: rgba(47, 132, 104, 0.5); color: #f2fffb; }
.generator-event-filter:focus-visible { outline: 3px solid #f4c65e; outline-offset: 2px; }
.generator-activity { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 7px; border: 1px solid rgba(137, 221, 200, 0.2); border-radius: 999px; color: #cde9e5; font-size: 0.74rem; line-height: 1.2; white-space: normal; }
.generator-activity.confirmed { border-color: rgba(94, 224, 179, 0.45); color: #aaf0d0; }
.generator-activity.unconfirmed { border-color: rgba(244, 198, 94, 0.45); color: #f4d58b; }
.generator-activity.none { border-color: rgba(142, 181, 194, 0.24); color: #a9c0c5; }
.generator-activity.unknown { border-color: rgba(244, 198, 94, 0.45); color: #f4d58b; }
.generator-evidence-note { display: block; margin-top: 3px; color: #f4d58b; font-size: 0.69rem; line-height: 1.25; white-space: normal; }
.generator-lifecycle-detail { display: block; min-width: 210px; max-width: 320px; text-align: left; white-space: normal; }
.generator-lifecycle-detail summary { cursor: pointer; color: #d6eeea; font-weight: 700; }
.generator-lifecycle-detail summary:focus-visible { outline: 3px solid #f4c65e; outline-offset: 2px; }
.generator-lifecycle-detail ul { display: grid; gap: 3px; margin: 7px 0 0; padding-left: 18px; color: #b6cbc8; font-size: 0.73rem; }
.generator-lifecycle-detail li { overflow-wrap: anywhere; }
.generator-planning-summary { display: block; min-width: 220px; max-width: 360px; text-align: left; white-space: normal; }
.generator-planning-summary summary { cursor: pointer; color: #d6eeea; font-weight: 700; }
.generator-planning-summary summary:focus-visible { outline: 3px solid #f4c65e; outline-offset: 2px; }
.generator-planning-summary dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 8px; margin: 7px 0 0; color: #b6cbc8; font-size: 0.73rem; }
.generator-planning-summary dt { color: #87aaa8; }
.generator-planning-summary dd { margin: 0; overflow-wrap: anywhere; }
.generator-planning-summary ul { display: grid; gap: 3px; margin: 7px 0 0; padding-left: 18px; color: #b6cbc8; font-size: 0.73rem; }
.generator-planning-summary li { overflow-wrap: anywhere; }
.config-audit-findings-panel .table-wrap { overflow-x: auto; }
.config-audit-findings-panel table { min-width: 860px; }
.config-audit-findings-panel td { max-width: 260px; overflow-wrap: anywhere; vertical-align: top; }
.config-audit-findings-panel td.config-audit-status-cell { width: 220px; white-space: normal; }
.config-audit-status-value { display: block; font-weight: 700; overflow-wrap: anywhere; }
.config-audit-status-cell .config-audit-profile-evidence { display: block; box-sizing: border-box; max-inline-size: 100%; margin-top: 7px; white-space: normal; }

.config-audit-checklist { display: grid; gap: 8px; }
.config-audit-checklist-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 9px; padding: 10px; border: 1px solid rgba(118, 183, 178, 0.18); border-radius: 6px; background: rgba(5, 27, 29, 0.5); cursor: pointer; }
.config-audit-checklist-item input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: #5ee0b3; }
.config-audit-checklist-item span { display: grid; gap: 3px; min-width: 0; }
.config-audit-checklist-item small { color: #92adaa; }
.config-audit-checklist-item em { color: #d3e0de; font-style: normal; line-height: 1.4; overflow-wrap: anywhere; }
.config-audit-checklist-item b { color: #f4c65e; line-height: 1.4; overflow-wrap: anywhere; }

.installation-profile-editor,
.installation-profile-candidate { display: grid; gap: 12px; }
.installation-profile-guidance { margin: 0; max-width: 80ch; color: #aac1bf; line-height: 1.45; }
.installation-profile-empty { margin: 0; padding: 11px; border: 1px dashed rgba(135, 200, 194, 0.28); border-radius: 6px; color: #aac1bf; line-height: 1.45; }
.installation-profile-full-view { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(118, 183, 178, 0.18); color: #cde5df; }
.installation-profile-full-view summary { cursor: pointer; font-weight: 800; }
.installation-profile-full-view summary:focus-visible { outline: 3px solid #f4c65e; outline-offset: 3px; }
.installation-profile-full-view > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.installation-profile-full-view article { display: grid; gap: 3px; min-width: 0; padding: 8px; border: 1px solid rgba(118, 183, 178, 0.16); border-radius: 6px; background: rgba(5, 27, 29, 0.52); }
.installation-profile-full-view article strong { color: #ecf8f5; overflow-wrap: anywhere; }
.installation-profile-full-view article span { color: #8ce6c3; font-weight: 800; overflow-wrap: anywhere; }
.installation-profile-full-view article small { color: #9bb5b2; overflow-wrap: anywhere; }
.installation-profile-full-view article p { margin: 3px 0 0; color: #c9ddd9; line-height: 1.4; overflow-wrap: anywhere; }
.installation-profile-candidate-base { margin: 0; color: #b9ded5; line-height: 1.4; overflow-wrap: anywhere; }
.installation-profile-change-list { display: grid; gap: 8px; }
.installation-profile-change-list h4 { margin: 0; color: #d6ece7; font-size: 0.82rem; }
.installation-profile-change { display: grid; gap: 3px; min-width: 0; padding: 8px; border-left: 3px solid #62d7ae; background: rgba(47, 132, 104, 0.14); color: #cde5df; overflow-wrap: anywhere; }
.installation-profile-change strong { color: #effaf7; }
.installation-profile-change small { color: #a9c7c1; }
.installation-profile-form { display: grid; gap: 12px; min-width: 0; }
.installation-profile-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; margin: 0; padding: 11px; border: 1px solid rgba(118, 183, 178, 0.18); border-radius: 7px; }
.installation-profile-group legend { padding: 0 6px; color: #a9bdc2; font-size: 0.73rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.installation-profile-capability { display: grid; gap: 9px; min-width: 0; padding: 10px; border: 1px solid rgba(118, 183, 178, 0.16); border-radius: 6px; background: rgba(5, 27, 29, 0.52); }
.installation-profile-capability-heading { display: flex; align-items: start; justify-content: space-between; gap: 9px; min-width: 0; }
.installation-profile-capability-heading label { display: grid; gap: 3px; min-width: 0; color: #ecf8f5; }
.installation-profile-capability-heading small { color: #9bb5b2; line-height: 1.35; overflow-wrap: anywhere; }
.installation-profile-unit { flex: 0 0 auto; padding: 3px 6px; border: 1px solid rgba(112, 211, 180, 0.3); border-radius: 999px; color: #8ce6c3; font-size: 0.71rem; font-weight: 800; }
.installation-profile-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 0.8fr); gap: 8px; min-width: 0; }
.installation-profile-primary-control { grid-column: 1 / -1; min-width: 0; }
.installation-profile-controls label { display: grid; gap: 4px; min-width: 0; color: #a9bdc2; font-size: 0.72rem; }
.installation-profile-controls input,
.installation-profile-controls select { min-width: 0; min-height: 38px; width: 100%; border: 1px solid rgba(135, 200, 194, 0.26); border-radius: 5px; background: rgba(7, 28, 31, 0.88); color: #effaf7; font: inherit; padding: 7px 8px; }
.installation-profile-value-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; min-width: 0; }
.installation-profile-unknown { min-height: 38px; border: 1px solid rgba(135, 200, 194, 0.26); border-radius: 5px; background: rgba(19, 66, 64, 0.78); color: #cce9e3; font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.installation-profile-controls input:focus-visible,
.installation-profile-controls select:focus-visible,
.installation-profile-unknown:focus-visible,
.installation-profile-editor button:focus-visible { outline: 3px solid #f4c65e; outline-offset: 3px; }
.config-audit-profile-evidence { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 8px; border-left: 3px solid #62d7ae; background: rgba(47, 132, 104, 0.14); color: #b9ded5; line-height: 1.4; overflow-wrap: anywhere; }
details.config-audit-profile-evidence { cursor: pointer; }
.config-audit-profile-evidence dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 4px 0 0; }
.config-audit-profile-evidence dt { color: #90aaa7; font-size: 0.68rem; text-transform: uppercase; }
.config-audit-profile-evidence dd { margin: 3px 0 0; color: #edf9f6; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .config-audit-hero,
  .config-audit-empty { grid-template-columns: 1fr; display: grid; }
  .config-audit-readonly { justify-self: start; }
  .config-audit-details,
  .config-audit-summary,
  .config-audit-summary-grid,
  .config-audit-finding-card dl,
  .config-audit-issue dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-audit-upload-label,
  .config-audit-actions button { width: 100%; }
  .config-audit-actions { display: grid; }
  .installation-profile-group { grid-template-columns: 1fr; }
  .installation-profile-full-view > div { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .config-audit-details,
  .config-audit-summary,
  .config-audit-summary-grid,
  .config-audit-finding-card dl,
  .config-audit-issue dl { grid-template-columns: 1fr; }
  .config-audit-finding-card > div { display: grid; }
  .installation-profile-controls,
  .config-audit-profile-evidence dl { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .forecast-scenario-row {
    align-items: start;
    gap: 2px;
    grid-template-columns: 1fr;
  }

  .forecast-scenario-value {
    text-align: left;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

.topbar {
  align-items: center;
  background: #18231f;
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 44px);
}

.savings-showcase {
  align-items: stretch;
  background: #101714;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 6px;
  justify-items: stretch;
  margin-left: auto;
  min-width: min(680px, 50vw);
  padding: 10px;
}

.inverter-state-indicator {
  align-content: center;
  background: rgba(10, 25, 23, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #d6e6df;
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  min-height: 64px;
  min-width: 176px;
  padding: 8px 18px;
  text-align: left;
}

.inverter-state-indicator span {
  color: #b7c9c2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inverter-state-indicator strong {
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.05;
}

.inverter-state-indicator small {
  color: #a9bbb4;
  font-size: 10px;
  font-weight: 600;
  max-width: 230px;
}

.inverter-state-indicator.healthy {
  background: rgba(20, 122, 90, 0.2);
  border-color: rgba(73, 229, 166, 0.48);
  box-shadow: inset 0 0 22px rgba(41, 206, 140, 0.08);
}

.inverter-state-indicator.healthy strong {
  color: #67efb7;
}

.inverter-state-indicator.checking strong {
  color: #f4c867;
}

.inverter-state-indicator.review {
  background: rgba(125, 82, 10, 0.52);
  border-color: rgba(248, 190, 70, 0.72);
  box-shadow: inset 0 0 22px rgba(244, 183, 57, 0.1), 0 0 20px rgba(181, 119, 18, 0.18);
}

.inverter-state-indicator.review strong {
  color: #ffd878;
}

.inverter-state-indicator.review small,
.inverter-state-indicator.review span {
  color: #ffe7ad;
}

.inverter-state-indicator.error {
  background: rgba(132, 22, 24, 0.72);
  border-color: rgba(255, 101, 94, 0.86);
  box-shadow: 0 0 0 3px rgba(255, 70, 62, 0.18), 0 0 28px rgba(255, 54, 47, 0.34);
}

.inverter-state-indicator.error strong {
  animation: inverter-state-alert 1.15s ease-in-out infinite;
  color: #fff0ee;
}

.inverter-state-indicator.error small,
.inverter-state-indicator.error span {
  color: #ffd3cf;
}

@keyframes inverter-state-alert {
  0%, 100% { opacity: 1; text-shadow: 0 0 4px rgba(255, 255, 255, 0.28); }
  50% { opacity: 0.38; text-shadow: 0 0 14px rgba(255, 121, 111, 0.88); }
}

.inverter-state-events-panel {
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.has-inverter-state-error .inverter-state-events-panel {
  border-color: rgba(255, 91, 81, 0.68) !important;
  box-shadow: 0 0 0 2px rgba(255, 70, 62, 0.12), 0 16px 38px rgba(80, 5, 7, 0.28) !important;
}

.has-inverter-state-review .inverter-state-events-panel {
  border-color: rgba(241, 178, 53, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(234, 160, 37, 0.09), 0 16px 38px rgba(72, 49, 8, 0.2) !important;
}

.inverter-event-status {
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  padding: 4px 8px;
  text-transform: uppercase;
}

.inverter-event-status.active,
.inverter-event-status.error {
  background: rgba(207, 55, 49, 0.2);
  color: #ff8f86;
}

.inverter-event-status.review {
  background: rgba(209, 144, 27, 0.17);
  color: #ffd06b;
}

.inverter-event-status.resolved {
  background: rgba(56, 217, 150, 0.13);
  color: #72e2b8;
}

.tab-panel[data-tab-panel="rollups"] .inverter-event-active td {
  background: rgba(88, 20, 24, 0.72);
}

.tab-panel[data-tab-panel="rollups"] .inverter-event-review td {
  background: rgba(84, 60, 14, 0.56);
}

.inverter-state-table-wrap {
  max-height: 390px;
}

.inverter-state-table {
  min-width: 2265px;
  table-layout: fixed;
  width: 2265px;
}

.inverter-state-table .inverter-col-status { width: 104px; }
.inverter-state-table .inverter-col-setting { width: 180px; }
.inverter-state-table .inverter-col-value { width: 145px; }
.inverter-state-table .inverter-col-register { width: 170px; }
.inverter-state-table .inverter-col-context { width: 225px; }
.inverter-state-table .inverter-col-source { width: 160px; }
.inverter-state-table .inverter-col-explanation { width: 295px; }
.inverter-state-table .inverter-col-confirmation { width: 220px; }
.inverter-state-table .inverter-col-expected { width: 175px; }
.inverter-state-table .inverter-col-valid { width: 180px; }
.inverter-state-table .inverter-col-first { width: 155px; }
.inverter-state-table .inverter-col-latest { width: 165px; }
.inverter-state-table .inverter-col-count { width: 91px; }

.inverter-state-table th,
.inverter-state-table td {
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.inverter-state-table th {
  line-height: 1.25;
  padding: 11px 10px;
  vertical-align: bottom;
}

.inverter-state-table td {
  line-height: 1.42;
  padding: 11px 10px;
}

.inverter-state-table .event-cell-status,
.inverter-state-table .event-cell-count {
  text-align: center;
}

.inverter-state-table .event-cell-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.inverter-state-table .event-cell-date {
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.event-classification,
.event-secondary,
.event-action {
  display: block;
  margin-top: 6px;
}

.event-classification,
.event-secondary {
  color: #9fb8b7;
  font-size: 11px;
  line-height: 1.35;
}

.event-classification {
  text-transform: capitalize;
}

.event-action {
  color: #d9eeea;
  font-size: 12px;
  line-height: 1.4;
}

.savings-roller {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(0, 1fr);
  justify-items: stretch;
  min-width: 0;
}

.savings-label {
  color: #cfd8d0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.savings-roller-total .roller-value {
  color: #f6c768;
  font-size: clamp(25px, 3.1vw, 39px);
}

.savings-roller-today .roller-value {
  color: #9ed7b9;
  font-size: clamp(19px, 2.2vw, 28px);
}

.savings-roller .roller-value.is-negative {
  color: #f29b91;
}

.roller-value {
  align-items: center;
  display: flex;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  gap: 2px;
  letter-spacing: 0;
  line-height: 1;
  min-height: 1em;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.roller-digit {
  background: linear-gradient(#252f2a 0 49%, #121a17 50% 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.38);
  display: inline-block;
  height: 1em;
  overflow: hidden;
  position: relative;
  width: 0.7em;
}

.roller-digit::after,
.roller-static::after {
  background: rgba(0, 0, 0, 0.42);
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 50%;
  z-index: 2;
}

.roller-strip {
  display: grid;
  line-height: 1;
  transform: translateY(0);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.18, 0.82, 0.22, 1);
  will-change: transform;
}

.roller-strip span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  height: 1em;
  line-height: 1;
  text-transform: none;
}

.roller-static {
  align-items: center;
  background: linear-gradient(#202822 0 49%, #111713 50% 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #d6dfd8;
  display: inline-block;
  min-width: 0.46em;
  padding: 0 0.06em;
  position: relative;
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 700;
}

.topbar p {
  color: #cfd8d0;
  font-size: 13px;
  margin-top: 6px;
  max-width: 900px;
  overflow-wrap: anywhere;
}

button {
  background: #f3b43f;
  border: 0;
  border-radius: 6px;
  color: #1a1a14;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.upload-button {
  align-items: center;
  background: #18231f;
  border: 1px solid #18231f;
  border-radius: 6px;
  color: #f7fbf4;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 13px;
}

.header-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  min-height: 40px;
  padding: 0 10px;
  width: 150px;
}

.header-input::placeholder {
  color: #c9d3cd;
}

.header-input:focus {
  border-color: #f3b43f;
  outline: 2px solid rgba(243, 180, 63, 0.18);
}

#workbookUpload {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

body.flow-history-open {
  overflow: hidden;
}

main {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1440px;
  padding: 20px clamp(14px, 3vw, 34px) 38px;
}

.tabbar {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px;
}

.tab-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #4f5f58;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 18px;
}

.tab-button.active {
  background: #18231f;
  color: #fff;
}

.tab-panel {
  display: grid;
  gap: 18px;
}

.tab-panel[hidden] {
  display: none;
}

.status {
  background: #ecf4ef;
  border: 1px solid #cfe0d7;
  border-radius: 7px;
  color: #255743;
  font-size: 14px;
  padding: 11px 14px;
}

.status.error {
  background: #fff1ec;
  border-color: #edc9bb;
  color: #8b321a;
}

.form-status {
  grid-column: 1 / -1;
  margin: 0;
}

#generatorAutomationStatus {
  display: grid;
  gap: 3px;
}

#generatorAutomationStatus strong {
  color: inherit;
  font-size: 0.92rem;
}

#generatorAutomationStatus span {
  line-height: 1.4;
}

.api-usage-tracker {
  background: #f7fbf4;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px;
}

.api-usage-tracker span {
  display: grid;
  gap: 3px;
}

.api-usage-tracker strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.api-usage-tracker small,
.api-usage-tracker p {
  color: var(--muted);
}

.api-usage-tracker p {
  grid-column: 1 / -1;
  margin: 0;
}

.source-safety-note {
  background: #f3f8f6;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  line-height: 1.5;
  margin: 0;
  padding: 10px 12px;
}

.source-diagnostics {
  background: #f7fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.source-diagnostics span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.source-diagnostics strong {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.source-diagnostics small,
.source-diagnostics p {
  color: var(--muted);
  font-size: 11px;
}

.source-diagnostics p {
  grid-column: 1 / -1;
  margin: 0;
}

.metric-grid,
.chart-grid,
.table-grid {
  display: grid;
  gap: 14px;
}

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

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

.table-grid {
  grid-template-columns: 1.35fr 1fr;
}

.metric,
.panel,
.live-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 28, 24, 0.05);
}

.metric {
  display: grid;
  gap: 7px;
  min-height: 122px;
  padding: 18px;
}

.metric span,
.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.did-you-know-hero {
  display: grid;
  gap: 14px;
}

.did-you-know-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.did-you-know-card {
  background: linear-gradient(180deg, #fbfcf8, #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(20, 28, 24, 0.04);
  display: grid;
  gap: 10px;
  min-height: 260px;
  overflow: hidden;
  padding: 14px;
}

.did-you-know-card.loading {
  align-content: center;
  min-height: 180px;
}

.did-you-know-card h3 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
}

.did-you-know-card strong {
  color: #17211d;
  font-size: 30px;
  line-height: 1;
}

.did-you-know-card p {
  color: #33443c;
  font-size: 14px;
  line-height: 1.45;
}

.did-you-know-card small {
  color: var(--muted);
  font-size: 12px;
}

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

.fact-card-head span {
  background: #e8f3ec;
  border: 1px solid #c9ded2;
  border-radius: 999px;
  color: #173b31;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 4px 8px;
  text-transform: uppercase;
}

.fact-card-head small {
  text-align: right;
}

.fact-visual {
  align-items: center;
  display: grid;
  min-height: 86px;
  position: relative;
}

.fact-visual.has-tooltip {
  cursor: help;
}

.fact-visual.has-tooltip::after {
  background: rgba(20, 28, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  bottom: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  color: #fff;
  content: attr(data-tooltip);
  display: block;
  font-size: 12px;
  left: 8px;
  line-height: 1.35;
  max-width: min(360px, calc(100% - 16px));
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 4;
}

.fact-visual.has-tooltip:hover::after,
.fact-visual.has-tooltip:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.fact-badge {
  background: #f0f5f0;
  border: 1px solid #d9e5dc;
  border-radius: 7px;
  height: 72px;
  overflow: hidden;
  position: relative;
}

.fact-badge::after {
  color: rgba(23, 33, 29, 0.3);
  content: "100%";
  font-size: 12px;
  font-weight: 700;
  position: absolute;
  right: 10px;
  top: 10px;
}

.fact-badge span {
  background: linear-gradient(90deg, #2f6f73, #d79b22);
  display: block;
  height: 100%;
  max-width: 100%;
  width: var(--fact-value);
}

.fact-sparkline {
  height: 86px;
  width: 100%;
}

.fact-sparkline polyline {
  fill: none;
  stroke: #2f6f73;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.fact-sparkline.empty {
  background: #f0f5f0;
  border-radius: 7px;
}

.fact-rank,
.fact-bars,
.fact-delta {
  display: grid;
  gap: 8px;
}

.fact-rank {
  grid-template-columns: auto minmax(0, 1fr);
}

.fact-rank span {
  color: #365149;
  font-size: 12px;
  font-weight: 700;
}

.fact-rank i,
.fact-bars i,
.fact-delta i {
  background: linear-gradient(90deg, #2f6f73, #d79b22);
  border-radius: 999px;
  display: block;
  height: 10px;
  width: var(--fact-value);
}

.fact-bars {
  align-items: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 78px;
}

.fact-bars span,
.fact-delta span {
  display: grid;
  gap: 6px;
}

.fact-bars i {
  align-self: end;
  border-radius: 6px 6px 2px 2px;
  height: 54px;
  max-width: 100%;
}

.fact-bars em,
.fact-delta em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.fact-delta {
  align-content: center;
}

.fact-delta i {
  height: 18px;
}

.accordion {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.accordion summary {
  align-items: center;
  background: #f7faf7;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  min-height: 48px;
  padding: 0 14px;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  color: #365149;
  content: "+";
  font-size: 20px;
  font-weight: 700;
}

.accordion[open] > summary::after {
  content: "-";
}

.accordion summary span {
  color: #17211d;
  font-size: 14px;
  font-weight: 700;
}

.accordion summary small {
  color: var(--muted);
  font-size: 12px;
}

.accordion .table-wrap {
  border-top: 1px solid var(--line);
}

.config-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.write-access-panel {
  align-items: end;
  display: grid;
  gap: 12px 18px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 1fr) minmax(470px, 0.9fr);
  padding: 16px;
}

.write-access-panel h2,
.write-access-panel p {
  margin: 0;
}

.write-access-panel > div:first-child {
  display: grid;
  gap: 5px;
}

.write-access-panel > div:first-child p {
  color: #9fb7bc;
  font-size: 12px;
}

.write-access-controls {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(250px, 1fr) 170px;
}

.write-access-controls button {
  white-space: nowrap;
}

.write-access-controls label {
  display: grid;
  gap: 6px;
}

.write-access-controls .panel-input {
  width: 100%;
}

.write-access-panel .form-status {
  grid-column: 1 / -1;
}

.trusted-device-access {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 10px 16px;
  align-items: end;
  border-top: 1px solid rgba(159, 183, 188, 0.22);
  padding-top: 12px;
}

.trusted-device-access > div:first-child {
  display: grid;
  gap: 4px;
}

.trusted-device-access strong,
.trusted-device-access small {
  overflow-wrap: anywhere;
}

.trusted-device-access small,
.trusted-device-quick small {
  color: #9fb7bc;
  font-size: 12px;
}

.trusted-device-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trusted-device-security-reset {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 360px) max-content;
  align-items: end;
  gap: 8px;
}

.trusted-device-quick {
  display: grid;
  gap: 5px;
}

.config-group {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.config-group + .config-group {
  margin-top: 10px;
}

.config-group-heading {
  align-items: end;
  border-top: 1px solid rgba(142, 181, 194, 0.2);
  display: grid;
  gap: 6px 18px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  padding: 20px 2px 2px;
}

.config-group:first-child .config-group-heading {
  border-top: 0;
  padding-top: 2px;
}

.config-group-heading h2 {
  color: #f4fbfb;
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
}

.config-group-heading p {
  color: #9fb7bc;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  text-align: right;
}

.config-group-lead,
.config-group-wide {
  grid-column: 1 / -1;
}

.config-card {
  display: grid;
  gap: 12px;
}

.historic-source-card {
  align-self: start;
}

.historic-source-form {
  align-items: end;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr);
}

.config-accordion {
  gap: 0;
  padding: 0;
}

.config-accordion summary {
  border-radius: 7px;
  padding: 0 16px;
}

.config-accordion[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
}

.config-accordion:not([open]) > :not(summary) {
  display: none;
}

.config-accordion-body {
  padding: 14px 16px 16px;
}

.workbook-accordion-body {
  display: grid;
  gap: 12px;
}

.workbook-meta {
  display: grid;
  gap: 10px;
}

.workbook-meta > div {
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.workbook-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workbook-meta a,
.workbook-meta strong {
  color: #17211d;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.workbook-meta a:hover {
  color: #147a5a;
}

.workbook-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.config-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
}

.config-form .panel-input,
.config-form button {
  width: 100%;
}

.config-form button {
  align-self: end;
}

.config-form .compact-button {
  align-self: center;
  padding: 8px 12px;
  width: auto;
}

.config-form .tariff-action-button {
  border: 1px solid #b8d1c4;
  box-shadow: none;
  min-height: 38px;
}

.config-form .tariff-action-button.muted {
  background: #f7faf7;
  color: #173b31;
}

.config-form .tariff-action-button.muted:hover:not(:disabled) {
  background: #e7f3eb;
  border-color: #8fb8a5;
}

.config-form .tariff-action-button.strong {
  background: #24483e;
  border-color: #24483e;
  color: #f7fbf4;
}

.config-form .tariff-action-button.strong:hover:not(:disabled) {
  background: #173b31;
}

.icon-text-button {
  background: #f1f6f2;
  color: #24483e;
  font-size: 12px;
  padding: 7px 9px;
  width: auto;
}

.icon-text-button:hover:not(:disabled) {
  background: #e2efe7;
}

.password-field {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.password-field .panel-input {
  border-radius: 6px 0 0 6px;
}

.password-field .peek-button {
  background: #18231f;
  border-radius: 0 6px 6px 0;
  color: #f7fbf4;
  min-height: 40px;
  padding: 0 12px;
  width: auto;
}

.password-field .peek-button[aria-pressed="true"] {
  background: #2f6f73;
}

.checkbox-field {
  align-items: center;
  align-self: center;
  color: #253f36;
  display: flex !important;
  gap: 9px !important;
  font-weight: 650;
  min-height: auto;
  padding: 7px 0;
}

.checkbox-field input {
  accent-color: #147a5a;
  margin: 0;
}

.config-form label.checkbox-field {
  color: #253f36;
  display: flex !important;
  font-weight: 750;
}

.flow-panel-toggle {
  align-items: center;
  grid-column: 1 / -1;
}

.preferences-section {
  border-top: 1px solid rgba(142, 181, 194, 0.22);
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 16px;
}

.preferences-section-heading {
  display: grid;
  gap: 4px;
}

.preferences-section-heading > strong {
  color: #f5fbfb;
  font-size: 14px;
  font-weight: 800;
}

.preferences-section-heading > small {
  color: #a9bdc2;
  font-size: 12px;
  line-height: 1.4;
}

.flow-panel-toggle span {
  display: grid;
  gap: 4px;
}

.flow-panel-toggle strong {
  color: inherit;
  font-size: 13px;
}

.flow-panel-toggle small {
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0.76;
}

.config-upload {
  justify-self: start;
}

.savings-panel {
  display: grid;
  gap: 12px;
}

.tariff-form {
  max-width: 760px;
}

.tariff-name {
  width: 170px;
}

.tariff-period-helper {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  margin: -4px 0 0;
}

.tariff-card {
  grid-column: 1 / -1;
}

.tariff-import-card {
  grid-column: 1 / -1;
}

.tariff-import-form {
  align-items: end;
}

.tariff-import-ai-details {
  align-self: stretch;
  grid-column: 1 / -1;
}

.tariff-import-ai-body {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 14px 14px;
}

.tariff-import-helper {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  line-height: 1.45;
  margin: 0;
}

.tariff-import-status {
  align-self: stretch;
  background: #eef7f1;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #173b31;
  grid-column: 1 / -1;
  min-height: 42px;
  padding: 11px 13px;
}

.tariff-import-status.error {
  background: #fff3f0;
  border-color: #efb1a5;
  color: #7d1f12;
}

.tariff-import-actions {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tariff-import-review {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.tariff-import-draft,
.tariff-import-proposal {
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.tariff-import-draft header,
.tariff-import-proposal header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tariff-import-proposal h3,
.tariff-import-draft h3 {
  font-size: 15px;
  margin: 0;
}

.tariff-import-proposal small,
.tariff-import-draft small {
  color: var(--muted);
}

.tariff-import-messages {
  display: grid;
  gap: 6px;
}

.tariff-import-message {
  border-radius: 6px;
  font-size: 12px;
  padding: 7px 9px;
}

.tariff-import-message.warn {
  background: #fff8e6;
  color: #6b4a00;
}

.tariff-import-message.error {
  background: #fff0ed;
  color: #7d1f12;
}

.tariff-import-evidence {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.tariff-import-period-grid span {
  background: #f3f7f4;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.tariff-editor {
  align-items: end;
}

.select-action-field {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
}

.select-action-field .tariff-action-button {
  align-self: end;
  white-space: nowrap;
  width: auto;
}

.tariff-overwrite-warning {
  background: #fff8e6;
  border: 1px solid #e9d48c;
  border-radius: 7px;
  color: #5d4308;
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
  line-height: 1.45;
  padding: 10px 12px;
}

.tariff-overwrite-warning[hidden] {
  display: none;
}

.tariff-block-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 12px;
}

.tariff-block-panel .panel-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0;
}

.tariff-block-panel h3 {
  font-size: 15px;
  margin: 0;
}

.tariff-block-wrap {
  max-height: 260px;
}

.tariff-block-input {
  min-width: 110px;
}

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

.savings-grid article {
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 12px;
}

.savings-grid span {
  color: var(--muted);
  font-size: 12px;
}

.savings-grid strong {
  font-size: 22px;
}

.savings-grid small {
  color: var(--muted);
  font-size: 11px;
}

.savings-reconciliation {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.savings-reconciliation > span {
  background: var(--surface-soft, #f7faf7);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.savings-reconciliation strong {
  font-size: 17px;
}

.savings-reconciliation small,
.savings-reconciliation p {
  color: var(--muted);
  font-size: 11px;
}

.savings-reconciliation p {
  align-self: center;
  grid-column: 1 / -1;
  margin: 0;
}

.live-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.live-title {
  margin-bottom: 0;
}

.attention-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
}

.attention-pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: default;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 30px;
  padding: 0 11px;
}

button.attention-pill {
  cursor: pointer;
}

.attention-pill.ok {
  background: #e8f5ed;
  border-color: #b8dcc7;
  color: #0d5d3f;
}

.attention-pill.info {
  background: #eef4f7;
  border-color: #c8dbe3;
  color: #2f5f73;
}

.attention-pill.warn {
  background: #fff6df;
  border-color: #edcf7a;
  color: #705210;
}

.attention-pill.danger {
  background: #fae9e2;
  border-color: #e1a083;
  color: #8b351a;
}

.live-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.live-card {
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 12px;
}

.live-card span {
  color: var(--muted);
  font-size: 12px;
}

.live-card strong {
  font-size: 23px;
}

.live-card small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.live-card em {
  color: #66736f;
  font-size: 11px;
  font-style: normal;
}

.live-overview {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(300px, 1.1fr) minmax(360px, 1fr);
}

.flow-panel {
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-areas:
    ". pv ."
    "grid center battery"
    ". load ."
    ". generator .";
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px;
  position: relative;
}

.flow-panel::before,
.flow-panel::after {
  background: var(--line);
  content: "";
  left: 18%;
  pointer-events: none;
  position: absolute;
  right: 18%;
  top: 50%;
}

.flow-panel::before {
  height: 1px;
}

.flow-panel::after {
  bottom: 15%;
  left: 50%;
  right: auto;
  top: 15%;
  width: 1px;
}

.flow-node,
.flow-center {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 10px;
  position: relative;
  text-align: center;
  z-index: 1;
}

.flow-node span,
.flow-center span,
.today-panel span {
  color: var(--muted);
  font-size: 12px;
}

.flow-node strong,
.flow-center strong {
  font-size: 18px;
}

.flow-node small {
  color: var(--muted);
  font-size: 11px;
}

.flow-node.pv {
  grid-area: pv;
}

.flow-node.grid {
  grid-area: grid;
}

.flow-node.battery {
  grid-area: battery;
}

.flow-node.load {
  grid-area: load;
}

.flow-node.generator {
  grid-area: generator;
}

.flow-center {
  background: #18231f;
  border-color: #18231f;
  color: #fff;
  grid-area: center;
}

.flow-center span {
  color: #cfd8d0;
}

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

.today-panel article {
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 11px;
}

.today-panel strong {
  font-size: 19px;
}

.fuel-panel {
  align-items: stretch;
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1.2fr) minmax(260px, 1fr) auto;
  padding: 12px;
}

.fuel-gauge {
  display: grid;
  gap: 8px;
}

.fuel-gauge-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.fuel-gauge-head span,
.fuel-stats span {
  color: var(--muted);
  font-size: 12px;
}

.fuel-gauge-head strong {
  font-size: 22px;
}

.fuel-bar {
  background: #dfe5de;
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.fuel-bar span {
  background: linear-gradient(90deg, #b35a2d, #f3b43f, #147a5a);
  display: block;
  height: 100%;
  transition: width 0.25s ease;
  width: 0;
}

.fuel-gauge small {
  color: var(--muted);
  font-size: 11px;
}

.fuel-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fuel-stats article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 5px;
  padding: 9px;
}

.fuel-stats strong {
  font-size: 17px;
}

.fuel-form {
  align-content: center;
}

.live-details {
  margin-top: 0;
}

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

.panel.wide {
  grid-column: 1 / -1;
}

.panel-title {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title h2 {
  font-size: 17px;
}

.inline-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 38px;
  padding: 0 10px;
  width: 130px;
}

.table-heading {
  color: #365149;
  font-size: 14px;
  margin: 16px 0 8px;
}

canvas {
  cursor: crosshair;
  display: block;
  height: 260px;
  max-height: 310px;
  width: 100%;
}

.chart-tooltip {
  background: rgba(20, 28, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  color: #fff;
  display: none;
  font-size: 12px;
  line-height: 1.45;
  max-width: 260px;
  padding: 9px 10px;
  pointer-events: none;
  position: fixed;
  z-index: 20;
}

.chart-tooltip strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.chart-tooltip span {
  display: block;
  white-space: nowrap;
}

.flow-history-modal[hidden] {
  display: none;
}

.flow-history-modal {
  inset: 0;
  overflow: hidden;
  position: fixed;
  z-index: 120;
}

.flow-history-backdrop {
  background: rgba(3, 8, 10, 0.68);
  inset: 0;
  position: absolute;
}

.flow-history-sheet {
  background:
    radial-gradient(circle at 16% 0%, rgba(245, 166, 35, 0.16), transparent 26%),
    radial-gradient(circle at 92% 12%, rgba(79, 169, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(17, 34, 39, 0.98), rgba(7, 18, 22, 0.98));
  border: 1px solid rgba(142, 181, 194, 0.32);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  color: #eef8f7;
  display: grid;
  gap: 14px;
  left: 50%;
  max-height: min(86vh, 720px);
  max-width: min(760px, calc(100vw - 28px));
  overflow: hidden;
  padding: clamp(16px, 3vw, 24px);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 28px));
}

.flow-history-modal.is-routing .flow-history-sheet {
  max-height: min(92vh, 860px);
  max-width: min(920px, calc(100vw - 28px));
  overflow-y: auto;
  width: min(920px, calc(100vw - 28px));
}

.flow-history-header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.flow-history-header small {
  color: #9fb4ba;
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.flow-history-header h2 {
  color: #ffffff;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.1;
}

.flow-history-header span {
  color: #b8c9cd;
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}

.flow-history-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #eef8f7;
  font-size: 28px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  width: 42px;
}

.flow-history-chart-wrap {
  background: rgba(7, 20, 24, 0.72);
  border: 1px solid rgba(142, 181, 194, 0.18);
  border-radius: 14px;
  min-height: 280px;
  overflow: hidden;
  position: relative;
}

.flow-history-chart-wrap canvas {
  cursor: ew-resize;
  display: block;
  height: 280px;
  touch-action: none;
  width: 100%;
}

.flow-history-readout {
  align-items: center;
  background: rgba(7, 20, 24, 0.64);
  border: 1px solid rgba(142, 181, 194, 0.16);
  border-radius: 10px;
  color: #eef8f7;
  display: none;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 11px;
  width: 100%;
}

.flow-history-readout strong {
  color: #9fb4ba;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.flow-history-readout span {
  color: #d6f8e9;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.flow-history-slider,
.history-chart-slider {
  accent-color: #38d996;
  min-height: 32px;
  touch-action: pan-y;
  width: 100%;
}

.flow-history-status {
  color: #a9bdc2;
  font-size: 13px;
  line-height: 1.45;
}

.flow-history-legend {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-history-legend[hidden],
.flow-history-routing-summary[hidden] {
  display: none;
}

.routing-legend-group {
  align-items: center;
  background: rgba(7, 20, 24, 0.58);
  border: 1px solid rgba(142, 181, 194, 0.14);
  border-radius: 10px;
  display: grid;
  gap: 7px;
  padding: 8px 10px;
}

.routing-legend-group > strong {
  color: #9fb4ba;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.routing-legend-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

button.routing-legend-chip {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(142, 181, 194, 0.18);
  border-radius: 999px;
  color: #8fa5ab;
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  width: auto;
}

button.routing-legend-chip i {
  background: var(--series-color);
  border-radius: 999px;
  box-shadow: 0 0 8px color-mix(in srgb, var(--series-color) 70%, transparent);
  height: 7px;
  width: 7px;
}

button.routing-legend-chip.is-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: color-mix(in srgb, var(--series-color, #52e0a4) 48%, rgba(142, 181, 194, 0.28));
  color: #eef8f7;
}

button.routing-legend-chip:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.flow-history-routing-summary {
  background: rgba(7, 20, 24, 0.64);
  border: 1px solid rgba(142, 181, 194, 0.16);
  border-radius: 12px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.routing-summary-row,
.routing-total-row {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: 92px minmax(0, 1fr);
  padding: 9px 12px;
}

.routing-summary-row + .routing-summary-row,
.routing-total-row {
  border-top: 1px solid rgba(142, 181, 194, 0.12);
}

.routing-summary-row strong,
.routing-total-row strong {
  color: #eef8f7;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.routing-summary-row span,
.routing-total-row span {
  color: #b8c9cd;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.routing-summary-sources strong {
  color: #ffd36b;
}

.routing-summary-destinations strong {
  color: #77e8ef;
}

.flow-history-routing-summary small {
  border-top: 1px solid rgba(142, 181, 194, 0.12);
  color: #82979d;
  font-size: 10px;
  line-height: 1.35;
  padding: 8px 12px 9px;
}

.calculation-header {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

button.calculation-help {
  align-items: center;
  background: rgba(47, 111, 115, 0.12);
  border: 1px solid rgba(47, 111, 115, 0.32);
  border-radius: 999px;
  color: #2f6f73;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  line-height: 1;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

button.calculation-help:hover,
button.calculation-help:focus-visible {
  background: #2f6f73;
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.16);
  color: #ffffff;
  outline: none;
  transform: none;
}

.calculation-tooltip {
  line-height: 1.45;
  max-width: min(320px, calc(100vw - 16px));
  white-space: normal;
}

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

.table-export-heading {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(90, 232, 178, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.table-export-heading:hover,
.table-export-heading:focus-visible {
  color: #ffffff;
  outline: none;
  text-decoration-color: rgba(90, 232, 178, 0.95);
}

.table-wrap-limited {
  max-height: 238px;
  overflow: auto;
}

.rollup-table-wrap {
  max-height: min(64vh, 620px);
  overflow: auto;
  scrollbar-gutter: stable;
}

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

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

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2),
td:nth-child(7),
th:nth-child(7) {
  text-align: left;
}

.coverage-badge {
  background: #ecf4ef;
  border: 1px solid #cfe0d7;
  border-radius: 999px;
  color: #24463a;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  min-width: 86px;
  padding: 4px 8px;
}

.coverage-partial {
  background: #fff7df;
  border-color: #eed187;
  color: #6f4d06;
}

.coverage-missing {
  background: #fff1ec;
  border-color: #edc9bb;
  color: #87412b;
}

.coverage-recovered {
  background: #e8f6f0;
  border-color: #8acdb2;
  color: #0d694a;
  min-width: 150px;
}

.reliability-indicator {
  align-content: center;
  background: rgba(10, 25, 23, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #d6e6df;
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  min-height: 64px;
  min-width: 176px;
  padding: 8px 18px;
  text-align: left;
}

.reliability-indicator span {
  color: #b7c9c2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reliability-indicator strong {
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.05;
}

.reliability-indicator small {
  color: #a9bbb4;
  font-size: 10px;
  font-weight: 600;
  max-width: 230px;
}

.reliability-indicator.healthy {
  background: rgba(20, 122, 90, 0.2);
  border-color: rgba(73, 229, 166, 0.48);
}

.reliability-indicator.healthy strong { color: #67efb7; }
.reliability-indicator.checking strong { color: #f4c867; }

.reliability-indicator.review {
  background: rgba(125, 82, 10, 0.52);
  border-color: rgba(248, 190, 70, 0.72);
}

.reliability-indicator.review strong { color: #ffd878; }

.reliability-indicator.error {
  background: rgba(132, 22, 24, 0.72);
  border-color: rgba(255, 101, 94, 0.86);
}

.reliability-indicator.error strong { color: #fff0ee; }

.reliability-overview {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
}

.reliability-overview > div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
}

.reliability-overview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.reliability-overview strong {
  font-size: 13px;
  line-height: 1.35;
}

.subsection-heading {
  font-size: 14px;
  margin: 14px 16px 8px;
}

.reliability-table-wrap {
  margin: 0 16px 18px;
  max-height: 290px;
}

.recovery-badge,
.quality-category {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  text-transform: capitalize;
}

.recovery-recovered {
  background: #e8f6f0;
  border-color: #8acdb2;
  color: #0d694a;
}

.recovery-pending,
.quality-confirmation_hold {
  background: #fff7df;
  border-color: #eed187;
  color: #6f4d06;
}

.quality-policy_filtered {
  background: #edf4f8;
  border-color: #bfd3df;
  color: #31596b;
}

.quality-telemetry_fault {
  background: #fff1ec;
  border-color: #edc9bb;
  color: #87412b;
}

@media (max-width: 1400px) {
  .topbar {
    flex-wrap: wrap;
  }

  .savings-showcase {
    flex-basis: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .reliability-indicator,
  .inverter-state-indicator {
    flex: 1 1 145px;
    min-width: 0;
  }

  .reliability-overview {
    grid-template-columns: 1fr 1fr;
  }

  .reliability-panel .panel-title {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .energy-flow-diagram.mobile-flow-layer-active .energy-flow-lines {
    opacity: 0;
  }

  .energy-flow-diagram.mobile-flow-layer-active .mobile-flow-layer {
    display: block;
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
  }

  .energy-flow-diagram.mobile-flow-layer-active .mobile-flow-segment {
    animation: mobileFlowPulse var(--mobile-flow-speed) linear infinite;
  }
}

@media (min-width: 721px), (orientation: landscape) {
  .energy-flow-diagram .energy-flow-lines {
    opacity: 1;
  }

  .energy-flow-diagram .mobile-flow-layer {
    display: none !important;
  }
}

thead th {
  background: var(--panel-2);
  color: #4f5f58;
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}

.rollup-table-wrap thead th {
  box-shadow: 0 1px 0 var(--line), 0 8px 14px rgba(25, 38, 32, 0.08);
}

tbody tr:hover {
  background: #f8faf5;
}

.state-list {
  line-height: 1.45;
  min-width: 360px;
  text-align: left;
  white-space: normal;
}

@media (max-width: 980px) {
  .metric-grid,
  .live-metrics,
  .chart-grid,
  .table-grid,
  .config-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-grid,
  .panel.wide {
    grid-column: auto;
  }

  .fuel-panel {
    grid-template-columns: 1fr;
  }

  .live-overview {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .flow-history-sheet {
    border-radius: 18px 18px 0 0;
    bottom: 0;
    left: 0;
    max-height: 88vh;
    max-width: none;
    top: auto;
    transform: none;
    width: 100%;
  }

  .flow-history-modal.is-routing .flow-history-sheet {
    max-height: 92vh;
    max-height: 92dvh;
    max-width: none;
    width: 100%;
  }

  .flow-history-header h2 {
    font-size: clamp(24px, 7vw, 34px);
  }

  .flow-history-chart-wrap canvas {
    height: 240px;
  }

  .flow-history-readout {
    gap: 3px;
    grid-template-columns: 1fr;
    padding: 7px 10px;
  }

  .flow-history-readout span {
    text-align: left;
  }

  .flow-history-legend {
    gap: 6px;
  }

  .routing-legend-group {
    align-content: start;
    padding: 7px 8px;
  }

  button.routing-legend-chip {
    font-size: 10px;
    min-height: 28px;
    padding: 4px 7px;
  }

  .routing-summary-row,
  .routing-total-row {
    gap: 4px;
    grid-template-columns: 1fr;
    padding: 7px 10px;
  }

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

  .inverter-state-indicator {
    justify-self: stretch;
  }

  .actions {
    justify-content: flex-start;
    width: 100%;
  }

  .savings-showcase {
    margin-left: 0;
    min-width: 100%;
  }

  .savings-roller {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .tabbar {
    overflow-x: auto;
  }

  .header-input {
    flex: 1 1 170px;
  }

  .metric-grid,
  .live-metrics,
  .savings-grid,
  .config-grid,
  .config-group,
  .config-form,
  .chart-grid,
  .did-you-know-grid,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .config-group-heading {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .config-group-heading p {
    text-align: left;
  }

  .write-access-panel,
  .write-access-controls,
  .trusted-device-access {
    grid-template-columns: 1fr;
  }

  .trusted-device-security-reset {
    grid-template-columns: 1fr;
  }

  .write-access-controls button {
    width: 100%;
  }

  .metric strong {
    font-size: 26px;
  }

  .select-action-field {
    grid-template-columns: 1fr;
  }

  .select-action-field .tariff-action-button {
    width: 100%;
  }
}

/* Modern Home Assistant-inspired refresh */
:root {
  --bg: #eef3f7;
  --bg-band: #f7fafc;
  --panel: #ffffff;
  --panel-2: #f8fbfd;
  --panel-3: #eef6f8;
  --text: #14211f;
  --muted: #62716f;
  --line: #d8e2e4;
  --line-strong: #c2d1d5;
  --solar: #f5a623;
  --load: #16987a;
  --battery: #2f80ed;
  --grid: #7b61a8;
  --generator: #d76b35;
  --savings: #0f766e;
  --good: #147a5a;
  --alert: #b35a2d;
  --danger: #c73b32;
  --shadow-soft: 0 10px 30px rgba(31, 45, 50, 0.08);
  --shadow-lift: 0 18px 48px rgba(31, 45, 50, 0.12);
}

body {
  background:
    linear-gradient(180deg, #e8f0f5 0, #f6f8fa 420px, #eef3f7 100%);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

.topbar {
  background:
    linear-gradient(135deg, #172722 0%, #1d3a35 56%, #0f2424 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 54px rgba(14, 31, 34, 0.2);
  min-height: 132px;
  padding: 24px clamp(18px, 4vw, 46px);
}

.topbar > div:first-child {
  display: grid;
  flex: 1 1 260px;
  gap: 8px;
  min-width: 0;
}

h1 {
  color: #f8fbf8;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: 0;
}

.topbar p {
  color: rgba(232, 244, 239, 0.82);
  font-size: 14px;
}

.savings-showcase {
  background: rgba(7, 17, 18, 0.78);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 20px 42px rgba(0, 0, 0, 0.22);
  flex: 1 1 420px;
  max-width: min(640px, 48vw);
  min-width: 0;
  overflow: hidden;
  padding: 12px;
}

.inverter-state-indicator,
.reliability-indicator,
.generator-fuel-indicator {
  align-self: flex-start;
  margin-top: -10px;
  min-height: 54px;
  padding: 7px 16px;
}

.generator-fuel-indicator {
  align-content: center;
  background: rgba(10, 25, 23, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #d6e6df;
  cursor: pointer;
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  min-width: 176px;
  text-align: left;
}

.generator-fuel-indicator span {
  color: #b7c9c2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.generator-fuel-indicator strong {
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.05;
}

.generator-fuel-indicator small {
  color: #a9bbb4;
  font-size: 10px;
  font-weight: 600;
  max-width: 230px;
}

.generator-fuel-indicator.healthy {
  background: rgba(20, 122, 90, 0.2);
  border-color: rgba(73, 229, 166, 0.48);
}

.generator-fuel-indicator.healthy strong { color: #67efb7; }
.generator-fuel-indicator.checking strong { color: #f4c867; }

.generator-fuel-indicator.review {
  background: rgba(125, 82, 10, 0.52);
  border-color: rgba(248, 190, 70, 0.72);
}

.generator-fuel-indicator.review strong { color: #ffd878; }

.generator-fuel-indicator.error {
  background: rgba(132, 22, 24, 0.72);
  border-color: rgba(255, 101, 94, 0.86);
  box-shadow: 0 0 0 3px rgba(255, 70, 62, 0.14), 0 0 24px rgba(255, 54, 47, 0.26);
}

.generator-fuel-indicator.error strong {
  animation: inverter-state-alert 1.15s ease-in-out infinite;
  color: #fff0ee;
}

.savings-label {
  color: rgba(232, 244, 239, 0.78);
  letter-spacing: 0;
  text-transform: none;
}

main {
  gap: 20px;
  margin-top: -30px;
  max-width: 1500px;
}

.tabbar {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(204, 218, 222, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 7px;
  position: sticky;
  top: 10px;
  z-index: 10;
}

.tab-button {
  border-radius: 7px;
  color: #4f6462;
  font-size: 14px;
  min-height: 44px;
  min-width: 44px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.tab-button:hover:not(.active) {
  background: #edf5f7;
  color: #203431;
}

.tab-button.active {
  background: #173934;
  box-shadow: 0 8px 20px rgba(23, 57, 52, 0.18);
  color: #fff;
}

.metric,
.panel,
.live-panel {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(201, 216, 219, 0.95);
  box-shadow: var(--shadow-soft);
}

.panel,
.live-panel {
  padding: 18px;
}

.panel-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel-title h2 {
  color: #10201e;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-title span,
.metric span {
  color: var(--muted);
}

.metric {
  border-left: 4px solid rgba(22, 152, 122, 0.45);
  gap: 9px;
  min-height: 132px;
  padding: 18px;
}

.metric strong {
  color: #12221f;
  font-size: clamp(28px, 2.4vw, 36px);
}

.metric small {
  color: #71817e;
}

.live-panel {
  border: 1px solid rgba(196, 213, 217, 0.95);
  gap: 16px;
  overflow: hidden;
  position: relative;
}

.live-panel::before {
  background: linear-gradient(90deg, var(--solar), var(--load), var(--battery), var(--generator));
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.live-title {
  align-items: center;
}

#liveUpdated {
  background: #edf6f7;
  border: 1px solid #cfe0e4;
  border-radius: 999px;
  color: #35514d;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.attention-strip {
  min-height: 34px;
}

.attention-pill {
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  min-height: 32px;
}

.attention-pill.ok {
  background: #e5f6ec;
  border-color: #b7e0ca;
}

.attention-pill.info {
  background: #e8f3fb;
  border-color: #c5dff2;
}

.attention-pill.warn {
  background: #fff6dc;
  border-color: #efd487;
}

.attention-pill.danger {
  background: #ffebe6;
  border-color: #efb3a4;
}

.live-metrics {
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.live-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border: 1px solid #d7e4e6;
  border-left: 4px solid var(--load);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 45, 50, 0.06);
  gap: 8px;
  min-height: 132px;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.live-card::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 68px;
  opacity: 0.08;
  position: absolute;
  right: -24px;
  top: -20px;
  width: 68px;
}

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

.live-card-head i {
  align-items: center;
  background: #eff7f7;
  border: 1px solid #d5e7e8;
  border-radius: 999px;
  color: inherit;
  display: inline-flex;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 8px;
}

.live-card span {
  color: #526866;
  font-weight: 700;
}

.live-card strong {
  color: #0f1f1d;
  font-size: 28px;
  letter-spacing: 0;
}

.live-card small {
  color: #6b7e7b;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-card em {
  color: #7d8d8a;
}

.live-card.metric-solar {
  border-left-color: var(--solar);
  color: var(--solar);
}

.live-card.metric-load {
  border-left-color: var(--load);
  color: var(--load);
}

.live-card.metric-battery {
  border-left-color: var(--battery);
  color: var(--battery);
}

.live-card.metric-gridpower {
  border-left-color: var(--grid);
  color: var(--grid);
}

.live-card.metric-generator {
  border-left-color: var(--generator);
  color: var(--generator);
}

.live-card.metric-mode,
.live-card.metric-neutral {
  border-left-color: #486460;
  color: #486460;
}

.live-overview {
  gap: 14px;
  grid-template-columns: minmax(420px, 1.25fr) minmax(330px, 0.75fr);
}

.flow-panel {
  background:
    linear-gradient(180deg, #f9fcfc 0%, #edf6f8 100%);
  border-color: #cbdde1;
  border-radius: 8px;
  min-height: 340px;
  overflow: hidden;
  padding: 18px;
}

.flow-panel::before,
.flow-panel::after {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.1), rgba(22, 152, 122, 0.55), rgba(47, 128, 237, 0.12));
}

.flow-panel::before {
  box-shadow: 0 0 18px rgba(22, 152, 122, 0.14);
}

.flow-node,
.flow-center {
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(31, 45, 50, 0.06);
  min-height: 88px;
  padding: 12px;
}

.flow-node {
  background: rgba(255, 255, 255, 0.94);
}

.flow-node::before,
.flow-center::before {
  border-radius: 999px;
  content: "";
  height: 9px;
  justify-self: center;
  width: 34px;
}

.flow-node.pv::before {
  background: var(--solar);
}

.flow-node.grid::before {
  background: var(--grid);
}

.flow-node.battery::before {
  background: var(--battery);
}

.flow-node.load::before {
  background: var(--load);
}

.flow-node.generator::before {
  background: var(--generator);
}

.flow-center {
  background: linear-gradient(180deg, #173934, #0f2624);
  border-color: #173934;
  box-shadow: 0 16px 34px rgba(23, 57, 52, 0.2);
}

.flow-center::before {
  background: #b8ece1;
}

.flow-node span,
.flow-center span,
.today-panel span,
.fuel-gauge-head span,
.fuel-stats span,
.savings-grid span {
  font-weight: 700;
  letter-spacing: 0;
}

.flow-node strong,
.flow-center strong {
  font-size: 20px;
}

.today-panel {
  gap: 12px;
}

.today-panel article,
.savings-grid article,
.savings-reconciliation > span,
.fuel-stats article {
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  border-color: #d6e4e7;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(31, 45, 50, 0.05);
}

.today-panel article {
  min-height: 88px;
  padding: 13px;
}

.tab-panel[data-tab-panel="history"] .savings-reconciliation {
  background: linear-gradient(135deg, rgba(10, 24, 24, 0.96), rgba(18, 45, 41, 0.94));
  border: 1px solid rgba(96, 143, 139, 0.34);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 28px rgba(14, 31, 34, 0.12);
  padding: 10px;
}

.tab-panel[data-tab-panel="history"] .savings-reconciliation > span {
  background: rgba(4, 15, 17, 0.72);
  border-color: rgba(74, 203, 158, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tab-panel[data-tab-panel="history"] .savings-reconciliation strong {
  color: #f5fbfb;
  font-variant-numeric: tabular-nums;
}

.tab-panel[data-tab-panel="history"] .savings-reconciliation small {
  color: #8fd8c0;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tab-panel[data-tab-panel="history"] .savings-reconciliation p {
  color: #bad0cf;
}

.today-panel strong,
.fuel-stats strong,
.savings-grid strong {
  color: #10201e;
}

.fuel-panel {
  background: #f8fbfc;
  border-color: #d3e2e5;
  border-radius: 8px;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr) auto;
  padding: 14px;
}

.fuel-bar {
  background: #dce8eb;
  height: 18px;
}

.fuel-bar span {
  background: linear-gradient(90deg, var(--danger), var(--generator), var(--solar), var(--good));
}

.chart-grid,
.table-grid,
.metric-grid {
  gap: 16px;
}

.panel canvas {
  margin-top: 4px;
  min-height: 240px;
}

.did-you-know-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border-color: #d6e4e7;
  box-shadow: var(--shadow-soft);
}

.accordion {
  background: #fff;
  border-color: #d5e3e6;
  border-radius: 8px;
}

.accordion summary {
  background: linear-gradient(180deg, #fbfdfd, #f3f8f9);
  min-height: 54px;
  padding: 14px 16px;
}

.accordion summary:hover {
  background: #edf6f7;
}

.accordion summary::after {
  color: #1f5750;
}

.accordion summary span {
  color: #132320;
  font-size: 14px;
}

.accordion summary small {
  color: #6b7d7a;
}

.config-card.accordion {
  padding: 0;
}

.config-accordion-body {
  background: #ffffff;
  border-top: 1px solid #d9e5e8;
  padding: 16px;
}

.config-form label {
  color: #435755;
  font-size: 12px;
  font-weight: 800;
}

.panel-input,
select.panel-input,
input.panel-input {
  background: #fbfdfd;
  border-color: #cbdde1;
  border-radius: 7px;
  color: #10201e;
  min-height: 42px;
}

.panel-input:focus,
select.panel-input:focus,
input.panel-input:focus {
  border-color: #32a6bd;
  box-shadow: 0 0 0 3px rgba(50, 166, 189, 0.14);
  outline: none;
}

button,
.upload-button,
.tariff-action-button,
.icon-text-button {
  border-radius: 7px;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:not(:disabled):hover,
.upload-button:hover,
.tariff-action-button:not(:disabled):hover,
.icon-text-button:not(:disabled):hover {
  box-shadow: 0 8px 18px rgba(31, 45, 50, 0.12);
  transform: translateY(-1px);
}

button {
  background: #f0aa32;
  color: #1b2118;
}

.icon-text-button,
.tariff-action-button.muted {
  background: #eaf4f5;
  color: #1c514c;
}

.status,
.form-status,
.status-line {
  border-radius: 8px;
}

.table-wrap,
.table-wrap-limited,
.rollup-table-wrap {
  border-radius: 8px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #f2f8f9;
  color: #435755;
  letter-spacing: 0;
}

td {
  background: rgba(255, 255, 255, 0.72);
}

tbody tr:nth-child(even) td {
  background: rgba(248, 251, 252, 0.9);
}

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

.chart-tooltip,
.fact-visual.has-tooltip::after {
  background: rgba(15, 31, 29, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Shared visual styling for supporting tabs */
.tab-panel[data-tab-panel="did-you-know"],
.tab-panel[data-tab-panel="history"],
.tab-panel[data-tab-panel="rollups"],
.tab-panel[data-tab-panel="configuration"],
.tab-panel[data-tab-panel="installation-profile"],
.tab-panel[data-tab-panel="config-audit"] {
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 166, 35, 0.12), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(47, 128, 237, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(7, 16, 19, 0.94), rgba(11, 27, 32, 0.9));
  border: 1px solid rgba(125, 157, 168, 0.22);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(7, 16, 19, 0.22);
  color: #eef8f7;
  overflow: hidden;
  padding: clamp(14px, 2vw, 24px);
  position: relative;
}

.tab-panel[data-tab-panel="did-you-know"]::before,
.tab-panel[data-tab-panel="history"]::before,
.tab-panel[data-tab-panel="battery-information"]::before,
.tab-panel[data-tab-panel="rollups"]::before,
.tab-panel[data-tab-panel="configuration"]::before,
.tab-panel[data-tab-panel="installation-profile"]::before,
.tab-panel[data-tab-panel="config-audit"]::before {
  background: linear-gradient(90deg, #f5a623, #38d996, #4fa9ff, #d76b35);
  box-shadow: 0 0 24px rgba(79, 169, 255, 0.34);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.tab-panel[data-tab-panel="did-you-know"] .panel,
.tab-panel[data-tab-panel="history"] .panel,
.tab-panel[data-tab-panel="battery-information"] .panel,
.tab-panel[data-tab-panel="rollups"] .panel,
.tab-panel[data-tab-panel="configuration"] .panel,
.tab-panel[data-tab-panel="installation-profile"] .panel,
.tab-panel[data-tab-panel="config-audit"] .panel,
.tab-panel[data-tab-panel="history"] .metric,
.tab-panel[data-tab-panel="installation-profile"] .metric,
.tab-panel[data-tab-panel="config-audit"] .metric {
  background:
    linear-gradient(180deg, rgba(17, 34, 39, 0.92), rgba(10, 24, 29, 0.9));
  border-color: rgba(142, 181, 194, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 38px rgba(0, 0, 0, 0.22);
  color: #eef8f7;
}

.tab-panel[data-tab-panel="history"] .metric {
  border-left-color: rgba(56, 217, 150, 0.72);
}

.tab-panel[data-tab-panel="history"] .metric strong,
.tab-panel[data-tab-panel="history"] .metric span,
.tab-panel[data-tab-panel="history"] .metric small,
.tab-panel[data-tab-panel="did-you-know"] .panel-title h2,
.tab-panel[data-tab-panel="history"] .panel-title h2,
.tab-panel[data-tab-panel="battery-information"] .panel-title h2,
.tab-panel[data-tab-panel="rollups"] .panel-title h2,
.tab-panel[data-tab-panel="configuration"] .panel-title h2,
.tab-panel[data-tab-panel="installation-profile"] .panel-title h2,
.tab-panel[data-tab-panel="installation-profile"] .panel-title h3,
.tab-panel[data-tab-panel="config-audit"] .panel-title h2,
.tab-panel[data-tab-panel="config-audit"] .panel-title h3,
.tab-panel[data-tab-panel="config-audit"] .config-audit-hero h2,
.tab-panel[data-tab-panel="config-audit"] .config-audit-empty h3 {
  color: #f5fbfb;
}

/* The later shared light-theme metric and checkbox rules need explicit dark-surface values here. */
.tab-panel[data-tab-panel="config-audit"] .metric strong {
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="config-audit"] .checkbox-field,
.tab-panel[data-tab-panel="config-audit"] .checkbox-field span {
  color: #d5e8e5;
}

.tab-panel[data-tab-panel="config-audit"] .checkbox-field input {
  accent-color: #38d996;
}

.tab-panel[data-tab-panel="did-you-know"] .panel-title span,
.tab-panel[data-tab-panel="history"] .panel-title span,
.tab-panel[data-tab-panel="battery-information"] .panel-title span,
.tab-panel[data-tab-panel="rollups"] .panel-title span,
.tab-panel[data-tab-panel="configuration"] .panel-title span,
.tab-panel[data-tab-panel="installation-profile"] .panel-title span,
.tab-panel[data-tab-panel="history"] .metric small,
.tab-panel[data-tab-panel="config-audit"] .panel-title span,
.tab-panel[data-tab-panel="config-audit"] .metric span,
.tab-panel[data-tab-panel="config-audit"] .metric small {
  color: #a9bdc2;
}

.tab-panel[data-tab-panel="battery-information"] .panel-title p {
  color: #a9bdc2;
}

.tab-panel[data-tab-panel="did-you-know"] .did-you-know-card,
.tab-panel[data-tab-panel="history"] .savings-grid article,
.tab-panel[data-tab-panel="configuration"] .workbook-meta > div,
.tab-panel[data-tab-panel="configuration"] .api-usage-tracker,
.tab-panel[data-tab-panel="configuration"] .source-diagnostics,
.tab-panel[data-tab-panel="configuration"] .source-safety-note,
.tab-panel[data-tab-panel="configuration"] .tariff-block-panel,
.tab-panel[data-tab-panel="configuration"] .tariff-import-review-card,
.tab-panel[data-tab-panel="configuration"] .tariff-import-proposal-card {
  background: rgba(12, 24, 29, 0.78);
  border-color: rgba(142, 181, 194, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 30px rgba(0, 0, 0, 0.18);
  color: #eef8f7;
}

.tab-panel[data-tab-panel="did-you-know"] .did-you-know-card {
  border-left: 4px solid rgba(245, 166, 35, 0.78);
}

.tab-panel[data-tab-panel="did-you-know"] .did-you-know-card strong,
.tab-panel[data-tab-panel="did-you-know"] .did-you-know-card h3,
.tab-panel[data-tab-panel="history"] .savings-grid strong,
.tab-panel[data-tab-panel="configuration"] .api-usage-tracker strong,
.tab-panel[data-tab-panel="configuration"] .workbook-meta strong,
.tab-panel[data-tab-panel="configuration"] .workbook-meta a {
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="did-you-know"] .did-you-know-card p,
.tab-panel[data-tab-panel="did-you-know"] .did-you-know-card small,
.tab-panel[data-tab-panel="history"] .savings-grid span,
.tab-panel[data-tab-panel="history"] .savings-grid small,
.tab-panel[data-tab-panel="configuration"] .api-usage-tracker small,
.tab-panel[data-tab-panel="configuration"] .api-usage-tracker p,
.tab-panel[data-tab-panel="configuration"] .source-diagnostics small,
.tab-panel[data-tab-panel="configuration"] .source-diagnostics p,
.tab-panel[data-tab-panel="configuration"] .source-safety-note,
.tab-panel[data-tab-panel="configuration"] .workbook-meta span,
.tab-panel[data-tab-panel="configuration"] .tariff-period-helper {
  color: #a9bdc2;
}

.tab-panel[data-tab-panel="configuration"] .source-diagnostics strong {
  color: #f5fbfb;
}

@media (max-width: 700px) {
  .savings-reconciliation {
    grid-template-columns: 1fr;
  }

  .savings-reconciliation p {
    grid-column: 1;
  }
  .source-diagnostics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tab-panel[data-tab-panel="history"] .chart-grid {
    grid-template-columns: 1fr;
  }

  .tab-panel[data-tab-panel="history"] .panel canvas {
    height: clamp(220px, 58vw, 280px);
    min-height: 220px;
  }

  .tab-panel[data-tab-panel="history"] .panel-title {
    align-items: start;
    gap: 8px;
    grid-template-columns: 1fr;
  }
}

.tab-panel[data-tab-panel="did-you-know"] .fact-card-head span {
  background: rgba(56, 217, 150, 0.14);
  border-color: rgba(56, 217, 150, 0.28);
  color: #b8f5dd;
}

.tab-panel[data-tab-panel="did-you-know"] .fact-visual {
  background: rgba(7, 16, 19, 0.42);
  border-color: rgba(142, 181, 194, 0.22);
}

.tab-panel[data-tab-panel="history"] canvas,
.tab-panel[data-tab-panel="did-you-know"] canvas {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-radius: 10px;
}

.history-chart-shell {
  position: relative;
  min-width: 0;
  margin-top: 4px;
}

.tab-panel[data-tab-panel="history"] .history-chart-shell canvas,
.history-chart-shell canvas[data-history-selector="true"] {
  display: block;
  width: 100%;
  margin-top: 0;
  touch-action: none;
}

.history-chart-selection-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 10px;
  pointer-events: none;
}

.history-chart-selection-overlay[hidden],
.history-chart-readout[hidden] {
  display: none;
}

.history-chart-selection-cursor {
  position: absolute;
  top: 20px;
  bottom: 50px;
  width: 0;
  border-left: 1px dashed rgba(222, 241, 239, 0.78);
  transform: translateX(-0.5px);
}

.history-chart-selection-markers i {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid #0b2022;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--marker-color) 32%, transparent);
  transform: translate(-50%, -50%);
}

.history-chart-controls {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.history-chart-slider {
  width: 100%;
  height: 32px;
  margin: 0;
  cursor: ew-resize;
}

.history-chart-slider:focus-visible {
  outline: 2px solid rgba(242, 181, 68, 0.9);
  outline-offset: 1px;
  border-radius: 999px;
}

.history-chart-slider:disabled {
  cursor: default;
  opacity: 0.46;
}

.history-chart-readout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(129, 182, 177, 0.16);
  border-radius: 6px;
  background: rgba(5, 20, 22, 0.58);
}

.history-chart-readout > strong {
  color: #bcd1cf;
  font-size: 0.72rem;
  white-space: nowrap;
}

.history-chart-readout > div {
  display: flex;
  justify-content: flex-end;
  gap: 6px 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.history-chart-readout span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #9fb6b4;
  font-size: 0.7rem;
  white-space: nowrap;
}

.history-chart-readout span > i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--series-color);
}

.history-chart-readout b {
  color: #edf8f6;
  font-size: 0.75rem;
}

@media (max-width: 560px) {
  .history-chart-readout {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .history-chart-readout > div {
    justify-content: flex-start;
  }
}

.tab-panel[data-tab-panel="history"] .accordion,
.tab-panel[data-tab-panel="rollups"] .accordion,
.tab-panel[data-tab-panel="configuration"] .accordion {
  background: rgba(8, 21, 26, 0.82);
  border-color: rgba(142, 181, 194, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.18);
}

.tab-panel[data-tab-panel="history"] .accordion summary,
.tab-panel[data-tab-panel="rollups"] .accordion summary,
.tab-panel[data-tab-panel="configuration"] .accordion summary {
  background:
    linear-gradient(180deg, rgba(20, 39, 45, 0.95), rgba(12, 28, 34, 0.95));
  border-color: rgba(142, 181, 194, 0.2);
}

.tab-panel[data-tab-panel="history"] .accordion summary:hover,
.tab-panel[data-tab-panel="rollups"] .accordion summary:hover,
.tab-panel[data-tab-panel="configuration"] .accordion summary:hover {
  background:
    linear-gradient(180deg, rgba(27, 51, 58, 0.98), rgba(15, 35, 41, 0.98));
}

.tab-panel[data-tab-panel="history"] .accordion summary span,
.tab-panel[data-tab-panel="rollups"] .accordion summary span,
.tab-panel[data-tab-panel="configuration"] .accordion summary span {
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="history"] .accordion summary small,
.tab-panel[data-tab-panel="rollups"] .accordion summary small,
.tab-panel[data-tab-panel="configuration"] .accordion summary small {
  color: #a9bdc2;
}

.tab-panel[data-tab-panel="history"] .accordion summary::after,
.tab-panel[data-tab-panel="rollups"] .accordion summary::after,
.tab-panel[data-tab-panel="configuration"] .accordion summary::after {
  color: #9fe6d0;
}

.tab-panel[data-tab-panel="rollups"] .reliability-overview > div {
  background: rgba(11, 25, 30, 0.9);
  border-color: rgba(142, 181, 194, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tab-panel[data-tab-panel="rollups"] .reliability-overview span {
  color: #9fb8bd;
}

.tab-panel[data-tab-panel="rollups"] .reliability-overview strong {
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="configuration"] .config-accordion-body {
  background: rgba(7, 16, 19, 0.34);
  border-top-color: rgba(142, 181, 194, 0.2);
}

.battery-bank-configuration,
.physical-battery-rows,
.battery-cycle-analytics,
.battery-cycle-rows {
  display: grid;
  gap: 12px;
}

.battery-bank-summary,
.physical-battery-row,
.battery-cycle-card {
  border: 1px solid rgba(142, 181, 194, 0.24);
  border-radius: 7px;
  background: rgba(5, 17, 21, 0.46);
  padding: 12px;
}

.battery-bank-configuration h3,
.battery-cycle-card h4,
.physical-battery-row-heading strong {
  color: #f1fbfa;
  margin: 0;
}

.battery-bank-configuration .subsection-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.battery-bank-configuration .subsection-heading h3 { margin: 0; }
.battery-bank-configuration .subsection-heading > span { color: #9fc9c6; font-size: 0.82rem; }

.physical-battery-row-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.physical-battery-remove {
  background: transparent;
  border: 1px solid rgba(235, 146, 146, 0.65);
  color: #ffd7d7;
}

.physical-battery-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.physical-battery-fields label,
.battery-cycle-card small,
.battery-cycle-card p,
.battery-bank-summary p {
  color: #c4d7d6;
}

.physical-battery-note { grid-column: span 2; }
.physical-battery-fields .checkbox-field { align-items: center; grid-column: span 2; }

.battery-cycle-rows {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.battery-cycle-card dl div { min-width: 0; }
.battery-cycle-card dt { color: #8fb5b2; font-size: 0.76rem; }
.battery-cycle-card dd { color: #f4fbfb; font-weight: 700; margin: 2px 0 0; overflow-wrap: anywhere; }

.battery-information-panel,
.battery-information-cards,
.battery-chart-grid,
.battery-information-overview,
.battery-provenance-grid {
  display: grid;
  gap: 14px;
}

.battery-information-hero .panel-title { align-items: start; }
.battery-information-notice {
  background: rgba(68, 187, 151, 0.13);
  border-left: 3px solid #61d7b4;
  color: #d9f5ed;
  font-weight: 700;
  margin: 14px 0 0;
  padding: 11px 13px;
}
.battery-information-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.battery-information-overview > div,
.battery-chart-card,
.battery-addition-timeline > div {
  background: rgba(4, 20, 23, 0.72);
  border: 1px solid rgba(142, 181, 194, 0.22);
  border-radius: 7px;
}
.battery-information-card {
  background: linear-gradient(180deg, rgba(17, 34, 39, 0.96), rgba(10, 24, 29, 0.95));
  border: 1px solid rgba(142, 181, 194, 0.26);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 30px rgba(0, 0, 0, 0.18);
}
.battery-information-overview > div { display: grid; gap: 4px; min-height: 72px; padding: 12px; }
.battery-information-overview span,
.battery-information-card dt,
.battery-provenance-grid dt { color: #9ec1bf; font-size: 0.76rem; }
.battery-information-overview strong { color: #f3fbfa; font-size: 1rem; overflow-wrap: anywhere; }
.battery-methodology p { color: #c9dddd; line-height: 1.5; max-width: 960px; }
.battery-information-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.battery-information-card { display: grid; gap: 13px; padding: 15px; }
.battery-information-card header { align-items: start; display: flex; gap: 12px; justify-content: space-between; }
.battery-information-card header span { color: #9fc9c6; font-size: 0.8rem; }
.battery-information-card h3 { color: #f4fbfb; margin: 3px 0; }
.battery-information-card header p,
.battery-information-card footer,
.battery-information-card small { color: #c3d7d5; margin: 0; }
.battery-confidence { background: rgba(97, 215, 180, 0.13); border: 1px solid rgba(97, 215, 180, 0.45); color: #a9efd6; font-size: 0.7rem; padding: 5px 7px; }
.battery-information-card dl { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.battery-information-card dl div { min-width: 0; }
.battery-information-card dd { color: #f4fbfb; font-weight: 700; margin: 3px 0 0; overflow-wrap: anywhere; }
.battery-nameplate,
.battery-reference,
.battery-projection { border-top: 1px solid rgba(142, 181, 194, 0.18); display: grid; gap: 4px; padding-top: 11px; }
.battery-nameplate strong,
.battery-reference strong,
.battery-projection strong { color: #e7f4f2; font-size: 0.82rem; }
.battery-nameplate span,
.battery-reference span,
.battery-projection span { color: #c6dddd; font-size: 0.84rem; overflow-wrap: anywhere; }
.battery-reference { background: rgba(242, 181, 68, 0.07); margin: 0 -15px; padding: 11px 15px 0; }
.battery-projection { background: rgba(139, 201, 242, 0.07); margin: 0 -15px; padding: 11px 15px 0; }
.battery-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.battery-chart-card { min-width: 0; padding: 12px; }
.battery-chart-card h3 { color: #e9f5f3; font-size: 0.96rem; margin: 0 0 4px; }
.battery-chart-card canvas {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-radius: 7px;
  height: 250px;
  min-height: 220px;
  width: 100%;
}
.battery-addition-chart { align-content: start; }
.battery-addition-timeline { display: grid; gap: 8px; }
.battery-addition-timeline > div { border-left: 3px solid #61d7b4; display: grid; gap: 3px; padding: 10px; }
.battery-addition-timeline strong { color: #ecf8f6; }
.battery-addition-timeline span,
.battery-addition-timeline small { color: #c7dbd9; }
.battery-provenance-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0; }
.battery-provenance-grid div { background: rgba(4, 20, 23, 0.45); border-left: 2px solid rgba(97, 215, 180, 0.55); padding: 9px; }
.battery-provenance-grid dd { color: #edf9f7; margin: 4px 0 0; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .battery-information-overview,
  .battery-chart-grid { grid-template-columns: 1fr; }
  .battery-chart-card canvas { height: 230px; }
}

@media (max-width: 480px) {
  .battery-information-card dl { grid-template-columns: 1fr; }
  .battery-information-card header { align-items: start; flex-direction: column; }
  .battery-chart-card canvas { height: 210px; min-height: 210px; }
}

@media (max-width: 760px) {
  .physical-battery-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .physical-battery-note,
  .physical-battery-fields .checkbox-field { grid-column: span 2; }
}

.tab-panel[data-tab-panel="configuration"] .config-form label,
.tab-panel[data-tab-panel="configuration"] .config-form label.checkbox-field {
  color: #cde9ea;
}

.tab-panel[data-tab-panel="configuration"] .panel-input,
.tab-panel[data-tab-panel="configuration"] select.panel-input,
.tab-panel[data-tab-panel="configuration"] input.panel-input {
  background: rgba(4, 14, 18, 0.68);
  border-color: rgba(142, 181, 194, 0.3);
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="configuration"] .panel-input::placeholder,
.tab-panel[data-tab-panel="configuration"] input.panel-input::placeholder {
  color: #7f969d;
}

.tab-panel[data-tab-panel="configuration"] .panel-input:focus,
.tab-panel[data-tab-panel="configuration"] select.panel-input:focus,
.tab-panel[data-tab-panel="configuration"] input.panel-input:focus {
  border-color: #38d996;
  box-shadow: 0 0 0 3px rgba(56, 217, 150, 0.15);
}

.tab-panel[data-tab-panel="configuration"] button,
.tab-panel[data-tab-panel="configuration"] .upload-button,
.tab-panel[data-tab-panel="did-you-know"] button {
  background: linear-gradient(180deg, #f6bd4d, #e49a22);
  color: #17211d;
}

.tab-panel[data-tab-panel="configuration"] .icon-text-button,
.tab-panel[data-tab-panel="configuration"] .tariff-action-button.muted,
.tab-panel[data-tab-panel="configuration"] .peek-button,
.tab-panel[data-tab-panel="did-you-know"] .icon-text-button {
  background: rgba(56, 217, 150, 0.13);
  border: 1px solid rgba(56, 217, 150, 0.26);
  color: #d8fff1;
}

.tab-panel[data-tab-panel="configuration"] .tariff-action-button.strong {
  background: linear-gradient(180deg, #1e7566, #13554c);
  border-color: rgba(112, 235, 199, 0.28);
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="configuration"] .status,
.tab-panel[data-tab-panel="configuration"] .form-status,
.tab-panel[data-tab-panel="configuration"] .status-line,
.tab-panel[data-tab-panel="installation-profile"] .status,
.tab-panel[data-tab-panel="installation-profile"] .form-status,
.tab-panel[data-tab-panel="config-audit"] .status,
.tab-panel[data-tab-panel="config-audit"] .form-status {
  background: rgba(56, 217, 150, 0.12);
  border-color: rgba(56, 217, 150, 0.26);
  color: #cbf7e8;
}

.tab-panel[data-tab-panel="configuration"] .status.error,
.tab-panel[data-tab-panel="configuration"] .form-status.error,
.tab-panel[data-tab-panel="configuration"] .status-line.error,
.tab-panel[data-tab-panel="installation-profile"] .status.error,
.tab-panel[data-tab-panel="installation-profile"] .form-status.error,
.tab-panel[data-tab-panel="config-audit"] .status.error,
.tab-panel[data-tab-panel="config-audit"] .form-status.error {
  background: rgba(199, 59, 50, 0.16);
  border-color: rgba(199, 59, 50, 0.34);
  color: #ffd2ca;
}

.tab-panel[data-tab-panel="history"] .table-wrap,
.tab-panel[data-tab-panel="rollups"] .table-wrap,
.tab-panel[data-tab-panel="configuration"] .table-wrap,
.tab-panel[data-tab-panel="config-audit"] .table-wrap {
  background: rgba(7, 16, 19, 0.56);
  border-color: rgba(142, 181, 194, 0.23);
}

.tab-panel[data-tab-panel="history"] th,
.tab-panel[data-tab-panel="rollups"] th,
.tab-panel[data-tab-panel="configuration"] th,
.tab-panel[data-tab-panel="config-audit"] th {
  background: rgba(18, 39, 46, 0.98);
  border-bottom-color: rgba(142, 181, 194, 0.24);
  color: #cde9ea;
}

.tab-panel[data-tab-panel="history"] td,
.tab-panel[data-tab-panel="rollups"] td,
.tab-panel[data-tab-panel="configuration"] td,
.tab-panel[data-tab-panel="config-audit"] td {
  background: rgba(11, 25, 30, 0.86);
  border-bottom-color: rgba(142, 181, 194, 0.14);
  color: #edf8f8;
}

.tab-panel[data-tab-panel="history"] tbody tr:nth-child(even) td,
.tab-panel[data-tab-panel="rollups"] tbody tr:nth-child(even) td,
.tab-panel[data-tab-panel="configuration"] tbody tr:nth-child(even) td,
.tab-panel[data-tab-panel="config-audit"] tbody tr:nth-child(even) td {
  background: rgba(15, 32, 38, 0.9);
}

.tab-panel[data-tab-panel="history"] tbody tr:hover td,
.tab-panel[data-tab-panel="rollups"] tbody tr:hover td,
.tab-panel[data-tab-panel="configuration"] tbody tr:hover td,
.tab-panel[data-tab-panel="config-audit"] tbody tr:hover td {
  background: rgba(37, 75, 82, 0.78);
}

/* Keep the dashboard's weather evidence table in the dark operational palette. */
.tab-panel[data-tab-panel="dashboard"] .weather-evidence-table-wrap {
  background: rgba(7, 16, 19, 0.56);
  border: 1px solid rgba(142, 181, 194, 0.23);
  border-radius: 6px;
}

.tab-panel[data-tab-panel="dashboard"] .weather-evidence-table-wrap th {
  background: rgba(18, 39, 46, 0.98);
  border-bottom-color: rgba(142, 181, 194, 0.24);
  color: #cde9ea;
}

.tab-panel[data-tab-panel="dashboard"] .weather-evidence-table-wrap td {
  background: rgba(11, 25, 30, 0.86);
  border-bottom-color: rgba(142, 181, 194, 0.14);
  color: #edf8f8;
}

.tab-panel[data-tab-panel="dashboard"] .weather-evidence-table-wrap tbody tr:nth-child(even) td {
  background: rgba(15, 32, 38, 0.9);
}

.tab-panel[data-tab-panel="dashboard"] .weather-evidence-table-wrap tbody tr:hover td {
  background: rgba(37, 75, 82, 0.78);
}

.generator-control-panel {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(270px, 1fr) minmax(210px, auto);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 107, 53, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(19, 35, 42, 0.97), rgba(12, 27, 34, 0.98));
  box-shadow: inset 3px 0 0 rgba(215, 107, 53, 0.78), 0 12px 30px rgba(0, 0, 0, 0.18);
}

.generator-control-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.generator-control-identity > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.generator-control-identity span,
.generator-control-identity small,
.generator-control-status {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.generator-control-identity strong {
  color: var(--text-main);
  font-size: 1rem;
}

.generator-control-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(215, 107, 53, 0.4);
  border-radius: 8px;
  background: rgba(215, 107, 53, 0.12) url("/assets/icons/generator.png") center / 28px 28px no-repeat;
}

.generator-control-indicators,
.generator-control-actions,
.generator-control-unlock {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.generator-control-unlock {
  grid-column: 3;
  grid-row: 1;
}

.generator-control-unlock input {
  width: 128px;
  min-width: 0;
}

.generator-control-actions {
  grid-column: 3;
  justify-content: flex-end;
}

.generator-control-status {
  grid-column: 1 / 3;
  margin: 0;
}

.control-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(142, 168, 177, 0.22);
  border-radius: 999px;
  background: rgba(116, 143, 151, 0.09);
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.control-state-pill.is-online,
.control-state-pill.is-stopped,
.control-state-pill.is-stop-request {
  border-color: rgba(58, 185, 138, 0.34);
  color: #74ddb4;
}

.control-state-pill.is-running,
.control-state-pill.is-start-request {
  border-color: rgba(215, 107, 53, 0.45);
  color: #f1a06f;
}

.control-state-pill.is-offline {
  border-color: rgba(232, 99, 99, 0.36);
  color: #ef8b8b;
}

.generator-command {
  min-width: 76px;
  border-radius: 7px;
}

.generator-command.start {
  background: #d76b35;
  color: #07151a;
}

.generator-command.stop {
  background: #45b98c;
  color: #07151a;
}

.generator-switch-semantics {
  grid-column: 1 / -1;
}

.generator-automation-status {
  align-items: center;
  background: rgba(10, 24, 28, 0.72);
  border: 1px solid rgba(142, 168, 177, 0.2);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 9px 12px;
}

.generator-automation-status span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.generator-automation-status strong {
  color: #f8fbf8;
  font-size: 1rem;
}

.generator-automation-status small {
  color: var(--text-muted);
  line-height: 1.35;
}

.generator-automation-mini {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 5px;
}

.generator-automation-mini span {
  background: rgba(4, 18, 23, 0.6);
  border: 1px solid rgba(142, 168, 177, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 7px;
}

.generator-automation-mini b {
  color: #f8fbf8;
  font-size: 0.82rem;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generator-automation-mini em {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.generator-automation-actions {
  display: grid;
  gap: 9px;
  grid-template-columns: 1.2fr 1fr 1fr;
}

.generator-automation-actions button {
  min-height: 40px;
}

.generator-automation-diagnostics {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .generator-control-panel {
    grid-template-columns: 1fr 1fr;
  }

  .generator-control-unlock,
  .generator-control-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .generator-control-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .generator-control-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .generator-control-indicators {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .generator-control-unlock,
  .generator-control-actions,
  .generator-control-status {
    grid-column: 1;
  }

  .generator-automation-actions {
    grid-template-columns: 1fr;
  }

  .generator-automation-mini {
    grid-template-columns: 1fr;
  }

  .generator-control-actions {
    justify-content: stretch;
  }

  .generator-control-actions button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inverter-state-indicator.error strong,
  .generator-fuel-indicator.error strong {
    animation: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .topbar {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar > div:first-child,
  .savings-showcase {
    grid-column: 1 / -1;
    margin-left: 0;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .inverter-state-indicator,
  .reliability-indicator,
  .generator-fuel-indicator {
    align-self: stretch;
    margin-top: 0;
    min-width: 0;
    width: 100%;
  }

  main {
    margin-top: -20px;
  }

  .live-overview,
  .fuel-panel {
    grid-template-columns: 1fr;
  }

  .flow-panel {
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: auto;
    padding: 14px 14px 16px;
  }

  .topbar > div:first-child {
    grid-column: 1 / -1;
  }

  .topbar h1 {
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.05;
  }

  .topbar p {
    font-size: 12px;
  }

  .inverter-state-indicator,
  .reliability-indicator,
  .generator-fuel-indicator {
    align-self: stretch;
    border-radius: 16px;
    gap: 0;
    margin-top: 0;
    min-height: 40px;
    min-width: 0;
    padding: 5px 9px;
    width: 100%;
  }

  .inverter-state-indicator span,
  .reliability-indicator span,
  .generator-fuel-indicator span {
    font-size: 8px;
    letter-spacing: 0.05em;
    line-height: 1.1;
  }

  .inverter-state-indicator strong,
  .reliability-indicator strong,
  .generator-fuel-indicator strong {
    font-size: 13px;
    line-height: 1.05;
  }

  .inverter-state-indicator small,
  .reliability-indicator small,
  .generator-fuel-indicator small {
    display: none;
  }

  main {
    margin-top: -12px;
  }

  .tab-button {
    padding: 0 14px;
  }

  .live-metrics {
    grid-template-columns: 1fr;
  }

  .flow-panel {
    grid-template-areas:
      "pv"
      "center"
      "load"
      "battery"
      "grid"
      "generator";
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .flow-panel::before,
  .flow-panel::after {
    display: none;
  }

  .today-panel,
  .fuel-stats {
    grid-template-columns: 1fr;
  }
}

/* Energy-flow hero redesign */
.tab-panel[data-tab-panel="dashboard"] {
  gap: 16px;
}

.tab-panel[data-tab-panel="dashboard"] .live-panel {
  background:
    radial-gradient(circle at 18% 18%, rgba(245, 166, 35, 0.18), transparent 27%),
    radial-gradient(circle at 78% 24%, rgba(47, 128, 237, 0.16), transparent 28%),
    radial-gradient(circle at 50% 95%, rgba(20, 122, 90, 0.2), transparent 32%),
    linear-gradient(145deg, #071013 0%, #101b22 45%, #071114 100%);
  border-color: rgba(125, 157, 168, 0.28);
  box-shadow: 0 28px 90px rgba(7, 16, 19, 0.28);
  color: #eef8f7;
  padding: clamp(16px, 2.2vw, 26px);
}

.tab-panel[data-tab-panel="dashboard"] .live-panel::before {
  background: linear-gradient(90deg, #f5a623, #38d996, #4fa9ff, #d76b35);
  box-shadow: 0 0 28px rgba(79, 169, 255, 0.45);
}

.tab-panel[data-tab-panel="dashboard"] .panel-title h2 {
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="dashboard"] .panel-title span {
  color: #a9bdc2;
}

.tab-panel[data-tab-panel="dashboard"] #liveUpdated {
  background: rgba(10, 23, 28, 0.8);
  border-color: rgba(132, 172, 185, 0.36);
  color: #cde9ea;
}

.energy-control-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(680px, 1.7fr) minmax(320px, 0.8fr);
}

.energy-flow-diagram {
  --flow-node-width: min(188px, 20%);
  --flow-node-center-width: min(203px, 24%);
  --flow-node-icon-size: 47px;
  --solar-intensity: 0;
  --load-intensity: 0;
  --battery-intensity: 0;
  --generator-intensity: 0;
  --grid-intensity: 0;
  --solar-speed: 3.2s;
  --load-speed: 3s;
  --battery-speed: 3.3s;
  --generator-speed: 3.2s;
  --grid-speed: 3.1s;
  --solar-opacity: 0.38;
  --load-opacity: 0.38;
  --battery-opacity: 0.38;
  --generator-opacity: 0.38;
  --grid-opacity: 0.38;
  --solar-width: 5px;
  --load-width: 5px;
  --battery-width: 5px;
  --generator-width: 5px;
  --grid-width: 5px;
  background: rgba(3, 10, 14, 0.54);
  border: 1px solid rgba(131, 172, 184, 0.24);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 80px rgba(21, 38, 48, 0.7),
    0 18px 46px rgba(0, 0, 0, 0.24);
  height: clamp(480px, 38vw, 540px);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.energy-flow-diagram::before {
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.energy-flow-lines {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.estimated-routing-indicator {
  align-items: flex-start;
  background: rgba(5, 17, 23, 0.88);
  border: 1px dashed rgba(255, 205, 117, 0.72);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  color: #ffe0a6;
  display: none;
  flex-direction: column;
  gap: 3px;
  left: 16px;
  max-width: min(430px, calc(100% - 32px));
  padding: 9px 11px;
  position: absolute;
  top: 14px;
  z-index: 8;
}

.estimated-routing-indicator strong {
  font-size: 0.75rem;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: uppercase;
}

.estimated-routing-indicator span {
  color: rgba(255, 239, 209, 0.9);
  font-size: 0.78rem;
  line-height: 1.3;
}

.energy-flow-diagram[data-routing-mode="estimated"] .estimated-routing-indicator {
  display: flex;
}

.mobile-flow-layer {
  display: none;
}

.mobile-flow-segment {
  --mobile-flow-color: #8fabb4;
  --mobile-flow-thickness: 6px;
  --mobile-flow-speed: 2.8s;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(255, 255, 255, 0.92) 34%, transparent 56%) 0 0 / 46px 100%,
    var(--mobile-flow-color);
  border-radius: 999px;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--mobile-flow-color) 78%, transparent),
    0 0 22px color-mix(in srgb, var(--mobile-flow-color) 42%, transparent);
  display: block;
  min-height: var(--mobile-flow-thickness);
  min-width: var(--mobile-flow-thickness);
  opacity: 0.96;
  position: absolute;
  transform-origin: left center;
}

.mobile-flow-segment.solar {
  box-shadow:
    0 0 12px rgba(255, 211, 106, 0.96),
    0 0 28px rgba(245, 181, 54, 0.56);
}

.energy-flow-diagram[data-routing-mode="estimated"] .mobile-flow-segment.inferred {
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--mobile-flow-color) 92%, white) 0 14px,
    transparent 14px 22px
  );
  outline: 1px dashed rgba(255, 205, 117, 0.78);
  outline-offset: 2px;
  opacity: 0.82;
}

.flow-group {
  --flow-color: #8fabb4;
  --flow-opacity: 0.72;
  --flow-particle-opacity: 0.8;
  --flow-speed: 3s;
  --flow-width: 6px;
  pointer-events: none;
}

.flow-solar,
.flow-solar-load,
.flow-solar-battery {
  --flow-color: #f5b536;
}

.flow-load {
  --flow-color: #83f5ff;
}

.flow-battery-charge,
.flow-battery-discharge,
.flow-battery-house {
  --flow-color: #43e489;
}

.flow-generator,
.flow-generator-battery,
.flow-generator-house {
  --flow-color: #ff9f43;
}

.flow-grid-import,
.flow-grid-export,
.flow-grid-house,
.flow-house-grid,
.flow-grid-battery {
  --flow-color: #6ab7ff;
}

.flow-solar-load,
.flow-generator-battery,
.flow-grid-battery,
.direct-flow {
  display: none;
}

.flow-grid-battery[data-active="true"] {
  display: block;
}

.energy-flow-diagram[data-show-inverter="false"] .node-inverter,
.energy-flow-diagram[data-show-inverter="false"] .flow-solar,
.energy-flow-diagram[data-show-inverter="false"] .flow-load,
.energy-flow-diagram[data-show-inverter="false"] .flow-battery-charge,
.energy-flow-diagram[data-show-inverter="false"] .flow-battery-discharge,
.energy-flow-diagram[data-show-inverter="false"] .flow-generator,
.energy-flow-diagram[data-show-inverter="false"] .flow-grid-import,
.energy-flow-diagram[data-show-inverter="false"] .flow-grid-export {
  display: none;
}

.energy-flow-diagram[data-show-inverter="false"] .direct-flow {
  display: block;
}

.energy-flow-diagram[data-show-inverter="false"] .flow-solar-load,
.energy-flow-diagram[data-show-inverter="false"] .flow-generator-battery {
  display: block;
}

.flow-base,
.flow-glow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.25s ease, stroke 0.25s ease, stroke-width 0.25s ease;
}

.flow-base {
  opacity: 0.32;
  stroke: rgba(118, 151, 162, 0.48);
  stroke-width: 5;
}

.flow-glow {
  filter: url(#flowGlow);
  opacity: 0;
  stroke: var(--flow-color);
  stroke-dasharray: 16 18;
  stroke-width: var(--flow-width);
}

.flow-particle {
  fill: var(--flow-color);
  filter: url(#flowGlow);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.flow-group[data-active="true"] .flow-base {
  opacity: 0.5;
  stroke: color-mix(in srgb, var(--flow-color) 38%, rgba(118, 151, 162, 0.7));
}

.flow-group[data-active="true"] .flow-glow {
  animation: flowDash var(--flow-speed) linear infinite;
  opacity: var(--flow-opacity);
}

.flow-group[data-active="true"] .flow-particle {
  opacity: var(--flow-particle-opacity);
}

.flow-solar-load .flow-base,
.flow-generator-battery .flow-base,
.flow-grid-battery .flow-base,
.direct-flow .flow-base {
  opacity: 0.18;
  stroke-dasharray: 4 14;
}

.flow-solar-load[data-active="true"] .flow-base,
.flow-generator-battery[data-active="true"] .flow-base,
.flow-grid-battery[data-active="true"] .flow-base,
.direct-flow[data-active="true"] .flow-base {
  opacity: 0.35;
}

.flow-solar-load[data-active="true"] .flow-glow,
.flow-generator-battery[data-active="true"] .flow-glow,
.flow-grid-battery[data-active="true"] .flow-glow,
.direct-flow[data-active="true"] .flow-glow {
  opacity: 0.58;
  stroke-dasharray: 8 18;
}

.energy-flow-diagram[data-routing-mode="estimated"] .inferred-flow .flow-base {
  stroke-dasharray: 7 13;
}

.energy-flow-diagram[data-routing-mode="estimated"] .inferred-flow[data-active="true"] .flow-base {
  opacity: 0.48;
  stroke-width: max(4px, calc(var(--flow-width) - 1px));
}

.energy-flow-diagram[data-routing-mode="estimated"] .inferred-flow[data-active="true"] .flow-glow {
  opacity: 0.42;
  stroke-dasharray: 10 18;
}

.energy-flow-diagram[data-routing-mode="estimated"] .inferred-flow[data-active="true"] .flow-particle {
  opacity: 0.48;
}

@keyframes flowDash {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -102;
  }
}

.energy-node {
  align-items: center;
  background: rgba(13, 26, 31, 0.88);
  border: 1px solid rgba(153, 194, 206, 0.24);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 9px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 81px;
  padding: 10px;
  position: absolute;
  width: var(--flow-node-width);
  z-index: 2;
}

.energy-node[data-flow-history-node] {
  cursor: pointer;
  outline: none;
}

.energy-node[data-flow-history-node]::after {
  background: rgba(8, 22, 26, 0.82);
  border: 1px solid rgba(142, 181, 194, 0.28);
  border-radius: 999px;
  color: #bdeade;
  content: "24h";
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  opacity: 0;
  padding: 3px 6px;
  position: absolute;
  right: 7px;
  top: 7px;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.energy-node[data-flow-history-node]:hover,
.energy-node[data-flow-history-node]:focus-visible {
  border-color: rgba(90, 232, 178, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(56, 217, 150, 0.12),
    0 16px 38px rgba(0, 0, 0, 0.28);
}

.energy-node[data-flow-history-node]:hover::after,
.energy-node[data-flow-history-node]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.energy-node span:not(.node-icon),
.energy-node small {
  color: #93aab1;
  display: block;
  font-size: 11px;
  line-height: 1.22;
}

.energy-node strong {
  color: #f6fbfb;
  display: block;
  font-size: clamp(13px, 1.35vw, 18px);
  line-height: 1.1;
  margin: 3px 0;
}

.energy-node strong:not(#flowMode) {
  letter-spacing: 0;
  white-space: nowrap;
}

.node-inverter #flowMode {
  background: rgba(169, 140, 255, 0.1);
  border: 1px solid rgba(169, 140, 255, 0.2);
  border-radius: 8px;
  color: #d8cdfd;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  margin: 2px 0 1px;
  max-width: 100%;
  overflow-wrap: break-word;
  padding: 4px 6px;
}

.node-solar {
  left: 50%;
  top: 34px;
  transform: translateX(-50%);
}

.node-inverter {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--flow-node-center-width);
}

.node-load {
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
}

.node-grid {
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
}

.node-generator {
  bottom: 54px;
  left: 76px;
}

.node-battery {
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
}

.energy-flow-diagram[data-show-inverter="false"] .node-solar {
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
}

.energy-flow-diagram[data-show-inverter="false"] .node-load {
  right: clamp(28px, 11%, 130px);
  top: 44%;
  transform: translateY(-50%);
}

.energy-flow-diagram[data-show-inverter="false"] .node-battery {
  bottom: 56px;
  left: auto;
  right: clamp(78px, 22%, 240px);
  transform: none;
}

.energy-flow-diagram[data-show-inverter="false"] .node-generator {
  bottom: 56px;
  left: clamp(78px, 22%, 240px);
}

.energy-flow-diagram[data-show-inverter="false"] .node-grid {
  left: clamp(28px, 11%, 130px);
  top: 44%;
  transform: translateY(-50%);
}

.node-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  display: block;
  height: var(--flow-node-icon-size);
  position: relative;
  width: var(--flow-node-icon-size);
}

.tab-panel[data-tab-panel="dashboard"] .node-icon {
  background-color: rgba(10, 28, 34, 0.96);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.2);
  height: var(--flow-node-icon-size);
  overflow: hidden;
  width: var(--flow-node-icon-size);
}

.tab-panel[data-tab-panel="dashboard"] .node-icon img {
  display: block;
  height: 100%;
  object-fit: contain;
  padding: 0;
  position: relative;
  width: 100%;
  z-index: 1;
}

.tab-panel[data-tab-panel="dashboard"] .solar-icon {
  background-image: url("/assets/icons/solar-panels.png");
  border-color: rgba(245, 181, 54, 0.34);
}

.tab-panel[data-tab-panel="dashboard"] .inverter-icon {
  background-image: url("/assets/icons/inverter.png");
  border-color: rgba(156, 207, 255, 0.34);
}

.tab-panel[data-tab-panel="dashboard"] .house-icon {
  background-image: url("/assets/icons/house.png");
  border-color: rgba(131, 245, 255, 0.34);
}

.tab-panel[data-tab-panel="dashboard"] .grid-icon {
  background-image: url("/assets/icons/grid.png");
  border-color: rgba(106, 183, 255, 0.34);
}

.tab-panel[data-tab-panel="dashboard"] .generator-icon {
  background-image: url("/assets/icons/generator.png");
  border-color: rgba(255, 159, 67, 0.36);
}

.tab-panel[data-tab-panel="dashboard"] .battery-icon {
  background-image: url("/assets/icons/battery.png");
  background-size: 94%;
  border-color: rgba(67, 228, 137, 0.38);
}

.tab-panel[data-tab-panel="dashboard"] .solar-icon::before,
.tab-panel[data-tab-panel="dashboard"] .solar-icon::after,
.tab-panel[data-tab-panel="dashboard"] .inverter-icon::before,
.tab-panel[data-tab-panel="dashboard"] .inverter-icon::after,
.tab-panel[data-tab-panel="dashboard"] .house-icon::before,
.tab-panel[data-tab-panel="dashboard"] .house-icon::after,
.tab-panel[data-tab-panel="dashboard"] .grid-icon::before,
.tab-panel[data-tab-panel="dashboard"] .grid-icon::after,
.tab-panel[data-tab-panel="dashboard"] .generator-icon::before,
.tab-panel[data-tab-panel="dashboard"] .generator-icon::after,
.tab-panel[data-tab-panel="dashboard"] .battery-icon::before,
.tab-panel[data-tab-panel="dashboard"] .battery-icon::after {
  display: none;
}

.tab-panel[data-tab-panel="dashboard"] .battery-icon #batteryGaugeFill {
  display: none;
}

.solar-icon::before {
  background: repeating-linear-gradient(90deg, transparent 0 12px, rgba(255, 255, 255, 0.22) 12px 14px), linear-gradient(145deg, #f6c04b, #a76d12);
  border-radius: 6px;
  content: "";
  height: 30px;
  left: 11px;
  position: absolute;
  top: 12px;
  transform: skewX(-10deg);
  width: 33px;
}

.inverter-icon::before {
  border: 2px solid #9ccfff;
  border-radius: 8px;
  content: "";
  height: 32px;
  left: 13px;
  position: absolute;
  top: 11px;
  width: 28px;
}

.inverter-icon::after {
  background: #9ccfff;
  border-radius: 999px;
  box-shadow: 0 9px 0 #9ccfff, 0 18px 0 #9ccfff;
  content: "";
  height: 4px;
  left: 23px;
  position: absolute;
  top: 18px;
  width: 8px;
}

.house-icon::before {
  border-bottom: 18px solid #a9fbff;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  content: "";
  left: 9px;
  position: absolute;
  top: 10px;
}

.house-icon::after {
  background: #a9fbff;
  border-radius: 3px;
  content: "";
  height: 18px;
  left: 15px;
  position: absolute;
  top: 27px;
  width: 24px;
}

.grid-icon::before {
  border-bottom: 38px solid #72b9ff;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  content: "";
  left: 11px;
  opacity: 0.95;
  position: absolute;
  top: 8px;
}

.grid-icon::after {
  background: #071013;
  box-shadow: 0 10px 0 #071013, 0 20px 0 #071013;
  content: "";
  height: 3px;
  left: 16px;
  position: absolute;
  top: 18px;
  width: 22px;
}

.generator-icon::before {
  border: 3px solid #ff9f43;
  border-radius: 8px;
  content: "";
  height: 28px;
  left: 11px;
  position: absolute;
  top: 15px;
  width: 32px;
}

.generator-icon::after {
  background: #ff9f43;
  border-radius: 999px;
  box-shadow: 16px 0 0 #ff9f43;
  content: "";
  height: 6px;
  left: 14px;
  position: absolute;
  top: 39px;
  width: 6px;
}

.battery-icon {
  border-color: rgba(67, 228, 137, 0.55);
  overflow: hidden;
}

.battery-icon::before {
  border: 2px solid #43e489;
  border-radius: 7px;
  content: "";
  inset: 10px 13px 8px;
  position: absolute;
}

.battery-icon::after {
  background: #43e489;
  border-radius: 3px 3px 0 0;
  content: "";
  height: 5px;
  left: 23px;
  position: absolute;
  top: 5px;
  width: 10px;
}

#batteryGaugeFill {
  background: linear-gradient(0deg, #43e489, #b6f774);
  border-radius: 4px;
  bottom: 11px;
  left: 15px;
  position: absolute;
  transition: height 0.35s ease;
  width: 24px;
  z-index: 1;
}

.battery-status-chips {
  align-items: center;
  display: flex;
  gap: 5px;
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 0;
}

.soc-chip,
.battery-rate-chip {
  background: rgba(67, 228, 137, 0.12);
  border: 1px solid rgba(67, 228, 137, 0.38);
  border-radius: 999px;
  color: #aaf5c9;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.battery-rate-chip.is-charging {
  background: rgba(67, 228, 137, 0.12);
  border-color: rgba(67, 228, 137, 0.38);
  color: #7ff0ad;
}

.battery-rate-chip.is-discharging {
  background: rgba(242, 107, 107, 0.12);
  border-color: rgba(242, 107, 107, 0.42);
  color: #ff8f8f;
}

.battery-rate-chip.is-idle {
  background: rgba(143, 171, 180, 0.1);
  border-color: rgba(143, 171, 180, 0.28);
  color: #a8bcc2;
}

.mini-gauge {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
}

.mini-gauge span {
  background: currentColor;
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.35s ease;
  width: 0;
}

.node-solar,
.summary-solar,
.metric-solar {
  color: #f5b536;
}

.node-load,
.summary-load,
.metric-load {
  color: #83f5ff;
}

.node-battery,
.summary-battery,
.metric-battery {
  color: #43e489;
}

.node-grid,
.summary-grid,
.metric-gridpower {
  color: #72b9ff;
}

.node-generator,
.summary-generator,
.metric-generator {
  color: #ff9f43;
}

.node-inverter,
.metric-mode {
  color: #a98cff;
}

.flow-solar-active .node-solar,
.flow-load-active .node-load,
.flow-battery-charging .node-battery,
.flow-battery-discharging .node-battery,
.flow-generator-active .node-generator,
.flow-grid-import .node-grid,
.flow-grid-export .node-grid {
  border-color: color-mix(in srgb, currentColor 55%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 30px color-mix(in srgb, currentColor 38%, transparent),
    0 16px 36px rgba(0, 0, 0, 0.26);
}

.flow-generator-active .node-generator {
  animation: generatorPulse 2.4s ease-in-out infinite;
}

@keyframes generatorPulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.dashboard-visual-rail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.tab-panel[data-tab-panel="dashboard"] .today-panel {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab-panel[data-tab-panel="dashboard"] .today-panel article,
.tab-panel[data-tab-panel="dashboard"] .live-card,
.tab-panel[data-tab-panel="dashboard"] .fuel-panel {
  background: rgba(12, 24, 29, 0.78);
  border-color: rgba(142, 181, 194, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 30px rgba(0, 0, 0, 0.2);
  color: #eef8f7;
}

.tab-panel[data-tab-panel="dashboard"] .today-panel article {
  border-left: 4px solid currentColor;
  min-height: 96px;
}

.tab-panel[data-tab-panel="dashboard"] .today-panel span,
.tab-panel[data-tab-panel="dashboard"] .live-card span,
.tab-panel[data-tab-panel="dashboard"] .live-card small,
.tab-panel[data-tab-panel="dashboard"] .live-card em,
.tab-panel[data-tab-panel="dashboard"] .fuel-gauge-head span,
.tab-panel[data-tab-panel="dashboard"] .fuel-stats span,
.tab-panel[data-tab-panel="dashboard"] .fuel-gauge small {
  color: #9fb6bd;
}

.tab-panel[data-tab-panel="dashboard"] .today-panel strong,
.tab-panel[data-tab-panel="dashboard"] .live-card strong,
.tab-panel[data-tab-panel="dashboard"] .fuel-gauge-head strong,
.tab-panel[data-tab-panel="dashboard"] .fuel-stats strong {
  color: #f5fbfb;
}

.tab-panel[data-tab-panel="dashboard"] .live-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab-panel[data-tab-panel="dashboard"] .live-card {
  min-height: 118px;
}

.tab-panel[data-tab-panel="dashboard"] .live-card-head i {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.tab-panel[data-tab-panel="dashboard"] .fuel-panel {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
}

.tab-panel[data-tab-panel="dashboard"] .fuel-form {
  display: none;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-bar {
  background: rgba(255, 255, 255, 0.12);
}

.tab-panel[data-tab-panel="dashboard"] .fuel-gauge {
  align-content: center;
  background:
    radial-gradient(circle at 92% 10%, rgba(215, 107, 53, 0.16), transparent 34%),
    rgba(7, 18, 22, 0.44);
  border: 1px solid rgba(142, 181, 194, 0.22);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-height: 118px;
  padding: 14px;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats {
  align-items: stretch;
  gap: 10px;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article {
  background:
    linear-gradient(180deg, rgba(18, 36, 42, 0.94), rgba(8, 22, 27, 0.94));
  border: 1px solid rgba(142, 181, 194, 0.24);
  border-left: 4px solid rgba(215, 107, 53, 0.92);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 26px rgba(0, 0, 0, 0.18);
  gap: 8px;
  min-height: 118px;
  overflow: hidden;
  padding: 14px 14px 13px;
  position: relative;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 64px;
  opacity: 0.08;
  position: absolute;
  right: -22px;
  top: -22px;
  width: 64px;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article:nth-child(1) {
  border-left-color: #ff9f43;
  color: #ffb05c;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article:nth-child(2) {
  border-left-color: #f5b536;
  color: #f8c75d;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article:nth-child(3) {
  border-left-color: #43e489;
  color: #73efaa;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats span {
  color: #a9bdc2;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats strong {
  color: #f5fbfb;
  font-size: clamp(20px, 1.7vw, 26px);
  letter-spacing: 0;
  line-height: 1.08;
  position: relative;
  z-index: 1;
}

@media (min-width: 1181px) {
  .tab-panel[data-tab-panel="dashboard"] .live-panel {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(640px, 1.55fr) minmax(340px, 0.85fr);
    grid-template-areas:
      "title title"
      "attention attention"
      "flow rail"
      "forecast forecast"
      "fuel fuel"
      "control control";
  }

  .tab-panel[data-tab-panel="dashboard"] .live-title {
    grid-area: title;
  }

  .tab-panel[data-tab-panel="dashboard"] #attentionStrip {
    grid-area: attention;
  }

  .tab-panel[data-tab-panel="dashboard"] .energy-control-grid {
    display: contents;
  }

  .tab-panel[data-tab-panel="dashboard"] .energy-flow-diagram {
    grid-area: flow;
    height: clamp(610px, 45vw, 680px);
  }

  .tab-panel[data-tab-panel="dashboard"] .dashboard-visual-rail {
    grid-area: rail;
    max-height: clamp(610px, 45vw, 680px);
    overflow: auto;
    padding-right: 3px;
  }

  .tab-panel[data-tab-panel="dashboard"] .fuel-panel {
    align-self: start;
    grid-area: fuel;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
  }

  .tab-panel[data-tab-panel="dashboard"] .resilience-forecast-panel {
    grid-area: forecast;
  }

  .tab-panel[data-tab-panel="dashboard"] .fuel-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-panel[data-tab-panel="dashboard"] .fuel-stats article {
    min-height: 96px;
    padding: 12px;
  }

  .tab-panel[data-tab-panel="dashboard"] .fuel-stats strong {
    font-size: clamp(17px, 1.25vw, 22px);
  }

  .tab-panel[data-tab-panel="dashboard"] .generator-control-panel {
    grid-area: control;
  }
}

.about-panel {
  gap: 16px;
}

.about-hero {
  align-items: stretch;
  background:
    radial-gradient(circle at 18% 18%, rgba(245, 181, 54, 0.18), transparent 30%),
    radial-gradient(circle at 88% 22%, rgba(79, 169, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #071216, #10272d 58%, #0b171b);
  color: #f5fbfb;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  overflow: hidden;
  position: relative;
}

.about-hero::before {
  background: linear-gradient(90deg, #f5b536, #43e489, #72b9ff);
  content: "";
  height: 4px;
  inset: 0 0 auto;
  opacity: 0.9;
  position: absolute;
}

.about-kicker,
.about-summary-card span,
.horizon-grid article span {
  color: #91cfd0;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.about-hero h2 {
  color: #ffffff;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 8px 0 12px;
}

.about-hero p {
  color: #bad0d5;
  font-size: 15px;
  line-height: 1.7;
  max-width: 760px;
}

.about-version-card {
  align-content: center;
  background: rgba(9, 24, 29, 0.82);
  border: 1px solid rgba(145, 207, 208, 0.22);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.24);
  display: grid;
  gap: 8px;
  padding: 18px;
}

.about-version-card span,
.about-version-card small {
  color: #9fb6bd;
  font-size: 12px;
  font-weight: 800;
}

.about-version-card strong {
  color: #f5b536;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: 0;
  line-height: 1;
}

.about-grid,
.horizon-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.about-summary-card,
.horizon-grid article {
  background:
    linear-gradient(180deg, rgba(18, 36, 42, 0.94), rgba(8, 22, 27, 0.94));
  border: 1px solid rgba(142, 181, 194, 0.24);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 30px rgba(0, 0, 0, 0.18);
  color: #eef8f7;
  display: grid;
  gap: 9px;
  min-height: 148px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.about-summary-card::after,
.horizon-grid article::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 72px;
  opacity: 0.07;
  position: absolute;
  right: -26px;
  top: -26px;
  width: 72px;
}

.about-summary-card:nth-child(1),
.horizon-grid article:nth-child(1),
.horizon-grid article:nth-child(5) {
  color: #43e489;
}

.about-summary-card:nth-child(2),
.horizon-grid article:nth-child(2),
.horizon-grid article:nth-child(6) {
  color: #72b9ff;
}

.about-summary-card:nth-child(3),
.horizon-grid article:nth-child(3),
.horizon-grid article:nth-child(7) {
  color: #f5b536;
}

.about-summary-card:nth-child(4),
.horizon-grid article:nth-child(4),
.horizon-grid article:nth-child(8) {
  color: #ff9f43;
}

.about-summary-card strong,
.horizon-grid article strong {
  color: #f5fbfb;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.about-summary-card p,
.horizon-grid article p,
.about-entry p {
  color: #a9bdc2;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
  position: relative;
  z-index: 1;
}

.about-section {
  background:
    linear-gradient(180deg, rgba(15, 32, 38, 0.96), rgba(8, 20, 25, 0.96));
  border-color: rgba(142, 181, 194, 0.24);
  color: #eef8f7;
}

.about-section .panel-title {
  margin-bottom: 4px;
}

.about-section .panel-title h2 {
  color: #f5fbfb;
}

.about-section .panel-title span {
  color: #a9bdc2;
}

.about-accordion {
  background: rgba(10, 23, 28, 0.82);
  border-color: rgba(142, 181, 194, 0.24);
  margin-top: 10px;
}

.about-accordion summary {
  background: linear-gradient(180deg, rgba(21, 43, 49, 0.96), rgba(13, 29, 35, 0.96));
  color: #f5fbfb;
}

.about-accordion summary:hover {
  background: rgba(31, 61, 68, 0.96);
}

.about-accordion summary span {
  color: #f5fbfb;
}

.about-accordion summary small {
  color: #91cfd0;
}

.about-accordion summary::after {
  color: #91cfd0;
}

.about-entry {
  border-top: 1px solid rgba(142, 181, 194, 0.2);
  padding: 14px 16px 16px;
}

.horizon-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.horizon-grid article span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  justify-self: start;
  padding: 5px 9px;
}

@supports not (color: color-mix(in srgb, white 50%, black)) {
  .flow-solar-active .node-solar,
  .flow-load-active .node-load,
  .flow-battery-charging .node-battery,
  .flow-battery-discharging .node-battery,
  .flow-generator-active .node-generator,
  .flow-grid-import .node-grid,
  .flow-grid-export .node-grid {
    border-color: currentColor;
  }
}

@media (max-width: 1180px) {
  .energy-control-grid {
    grid-template-columns: 1fr;
  }

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

  .energy-flow-diagram {
    --flow-node-width: min(188px, 22%);
    --flow-node-center-width: min(203px, 26%);
    min-height: 500px;
  }

  .tab-panel[data-tab-panel="dashboard"] .live-metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  main {
    margin-top: 0;
  }

  .tabbar {
    position: static;
    top: auto;
    z-index: 1;
  }

  .energy-flow-diagram {
    --flow-node-width: min(86px, 27%);
    --flow-node-center-width: min(104px, 32%);
    --flow-node-icon-size: 30px;
    aspect-ratio: auto;
    display: block;
    height: clamp(500px, 136vw, 560px);
    min-height: 500px;
    padding: 0;
  }

  .energy-flow-diagram[data-show-inverter="false"] {
    --flow-node-width: min(94px, 29%);
    height: clamp(410px, 108vw, 470px);
    min-height: 410px;
  }

  .energy-flow-lines {
    display: block;
  }

  .energy-node,
  .node-solar,
  .node-grid,
  .node-inverter,
  .node-load,
  .node-generator,
  .node-battery {
    left: auto;
    position: absolute;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    width: var(--flow-node-width);
  }

  .energy-node {
    gap: 6px;
    min-height: 64px;
    padding: 7px;
  }

  .node-solar {
    left: 50%;
    top: 58px;
    transform: translateX(-50%);
  }

  .node-inverter {
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: var(--flow-node-center-width);
  }

  .node-load {
    right: 7px;
    top: 46%;
    transform: translateY(-50%);
  }

  .node-battery {
    top: 68%;
    bottom: auto;
    left: auto;
    right: 7px;
    transform: none;
    width: min(108px, 33%);
  }

  .node-solar {
    width: min(96px, 30%);
  }

  .node-generator {
    width: min(92px, 29%);
  }

  .node-grid {
    left: 7px;
    top: 46%;
    transform: translateY(-50%);
  }

  .node-generator {
    top: 68%;
    bottom: auto;
    left: 7px;
  }

  .energy-flow-diagram .flow-group:not([data-active="true"]) .flow-base {
    opacity: 0;
    stroke-width: 3;
  }

  .energy-flow-diagram .direct-flow:not([data-active="true"]) {
    display: none;
  }

  .energy-flow-diagram .flow-solar-load:not([data-active="true"]),
  .energy-flow-diagram .flow-generator-battery:not([data-active="true"]),
  .energy-flow-diagram .flow-grid-battery:not([data-active="true"]) {
    display: none;
  }

  .energy-flow-diagram .flow-group[data-active="true"] .flow-base {
    opacity: 0.52;
    stroke-width: 5;
  }

  .energy-flow-diagram .flow-group[data-active="true"] .flow-glow {
    opacity: 0.88;
    stroke-dasharray: none;
  }

  .energy-flow-diagram[data-routing-mode="estimated"] .inferred-flow .flow-base {
    stroke-dasharray: 7 13;
  }

  .energy-flow-diagram[data-routing-mode="estimated"] .inferred-flow[data-active="true"] .flow-glow {
    stroke-dasharray: 10 18;
  }

  .energy-flow-diagram .flow-solar[data-active="true"] .flow-base,
  .energy-flow-diagram .flow-solar[data-active="true"] .flow-glow {
    stroke-width: 6;
  }

  .energy-flow-diagram .flow-solar[data-active="true"] .flow-base {
    opacity: 0.78;
    stroke: rgba(255, 211, 106, 0.92);
  }

  .energy-flow-diagram .flow-solar[data-active="true"] .flow-glow {
    filter: none;
    opacity: 1;
    stroke: #ffd36a;
  }

  .energy-flow-diagram[data-show-inverter="false"] .node-solar {
    left: 50%;
    top: 58px;
    transform: translateX(-50%);
  }

  .energy-flow-diagram[data-show-inverter="false"] .node-load {
    right: 7px;
    top: 46%;
    transform: translateY(-50%);
  }

  .energy-flow-diagram[data-show-inverter="false"] .node-grid {
    left: 7px;
    top: 46%;
    transform: translateY(-50%);
  }

  .energy-flow-diagram[data-show-inverter="false"] .node-generator {
    top: 68%;
    bottom: auto;
    left: 7px;
  }

  .energy-flow-diagram[data-show-inverter="false"] .node-battery {
    top: 68%;
    bottom: auto;
    left: auto;
    right: 7px;
    transform: none;
    width: min(108px, 33%);
  }

  .energy-node span:not(.node-icon),
  .energy-node small {
    font-size: 10px;
  }

  .energy-node small {
    display: none;
  }

  .energy-node strong {
    font-size: clamp(12px, 3.9vw, 16px);
    margin: 2px 0;
  }

  .node-inverter #flowMode {
    border-radius: 7px;
    font-size: 9px;
    line-height: 1.1;
    max-width: 72px;
    padding: 3px 5px;
  }

  .soc-chip,
  .battery-rate-chip {
    font-size: 10px;
    padding: 3px 6px;
  }

  .tab-panel[data-tab-panel="dashboard"] .today-panel,
  .tab-panel[data-tab-panel="dashboard"] .live-metrics,
  .tab-panel[data-tab-panel="dashboard"] .fuel-panel,
  .about-hero,
  .about-grid,
  .horizon-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .energy-node strong:not(#flowMode) {
    font-size: clamp(9px, 2.7vw, 11px);
    letter-spacing: 0;
    white-space: nowrap;
  }

  .tab-panel[data-tab-panel="dashboard"] .live-title {
    align-items: flex-start;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .tab-panel[data-tab-panel="dashboard"] .live-title > div {
    min-width: 0;
    width: 100%;
  }

  .tab-panel[data-tab-panel="dashboard"] .live-title h2 {
    font-size: clamp(20px, 5.4vw, 22px);
    line-height: 1.12;
    max-width: 100%;
    text-wrap: balance;
  }

  .tab-panel[data-tab-panel="dashboard"] .live-title #liveStatus {
    display: block;
    margin-top: 4px;
  }

  .tab-panel[data-tab-panel="dashboard"] #liveUpdated {
    justify-self: end;
    max-width: 100%;
  }
}

@media (max-width: 980px) and (orientation: landscape) and (pointer: coarse) {
  .topbar {
    align-items: stretch;
    gap: 7px;
    grid-template-columns: minmax(220px, 1.1fr) repeat(3, minmax(112px, 0.72fr));
    min-height: auto;
    padding: 10px 14px 12px;
  }

  .topbar > div:first-child {
    align-content: center;
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .topbar h1 {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.02;
  }

  .topbar p {
    font-size: 12px;
  }

  .inverter-state-indicator,
  .reliability-indicator,
  .generator-fuel-indicator {
    border-radius: 14px;
    gap: 0;
    min-height: 38px;
    padding: 5px 9px;
    width: 100%;
  }

  .inverter-state-indicator span,
  .reliability-indicator span,
  .generator-fuel-indicator span {
    font-size: 7px;
    letter-spacing: 0.06em;
    line-height: 1;
  }

  .inverter-state-indicator strong,
  .reliability-indicator strong,
  .generator-fuel-indicator strong {
    font-size: 13px;
    line-height: 1.04;
  }

  .inverter-state-indicator small,
  .reliability-indicator small,
  .generator-fuel-indicator small {
    display: none;
  }

  .savings-showcase {
    align-content: center;
    gap: 3px;
    grid-column: 2 / -1;
    grid-row: 2;
    min-width: 0;
    padding: 6px 8px;
  }

  .savings-roller {
    gap: 8px;
    grid-template-columns: minmax(112px, auto) 1fr;
    min-height: 24px;
  }

  .savings-label {
    font-size: 12px;
  }

  .savings-roller .roller-value {
    font-size: clamp(18px, 3.1vw, 26px);
    letter-spacing: 0.01em;
  }

  main {
    margin-top: 0;
  }

  .tabbar {
    position: static;
    top: auto;
    z-index: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-group[data-active="true"] .flow-glow,
  .flow-generator-active .node-generator,
  .mobile-flow-segment {
    animation: none !important;
  }

  .flow-particle,
  .energy-node::after {
    display: none !important;
  }
}

@keyframes mobileFlowPulse {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 46px 0, 0 0;
  }
}

/* Dated tariff application and municipal billing */
.tariff-application-card {
  grid-column: 1 / -1;
}

.tariff-application-form {
  align-items: end;
}

.tariff-exception-toggle {
  min-height: 40px;
}

.tariff-assignment-panel {
  border: 1px solid rgba(142, 181, 194, 0.25);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 12px;
}

.tariff-assignment-panel[hidden],
#municipalBillingDateField[hidden] {
  display: none;
}

.tariff-assignment-wrap {
  max-height: 330px;
  overflow: auto;
}

.tariff-assignment-wrap td:first-child {
  min-width: 155px;
}

.tariff-assignment-wrap td:first-child strong,
.tariff-assignment-wrap td:first-child span {
  display: block;
}

.tariff-assignment-wrap td:first-child span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.tariff-application-status {
  grid-column: 1 / -1;
}

.pricing-status {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 4px 8px;
  white-space: nowrap;
}

.pricing-ok {
  background: rgba(56, 217, 150, 0.13);
  border-color: rgba(56, 217, 150, 0.28);
  color: #b8f5dd;
}

.pricing-missing {
  background: rgba(245, 166, 35, 0.13);
  border-color: rgba(245, 166, 35, 0.32);
  color: #ffd996;
}

.savings-row-unpriced td {
  background: rgba(245, 166, 35, 0.055);
  color: #aebfc2;
}

.tab-panel[data-tab-panel="configuration"] .tariff-assignment-panel {
  background: rgba(12, 24, 29, 0.78);
  color: #eef8f7;
}

@media (max-width: 700px) {
  .tariff-assignment-panel {
    padding: 10px;
  }

  .tariff-assignment-wrap {
    max-height: 300px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .flow-history-sheet {
    border-radius: 16px;
    bottom: auto;
    gap: 8px;
    height: calc(100svh - 18px);
    height: calc(100dvh - 18px);
    left: 50%;
    max-height: none;
    max-width: calc(100vw - 28px);
    overflow-y: auto;
    padding: 12px 16px;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, calc(100vw - 28px));
    -webkit-overflow-scrolling: touch;
  }

  .flow-history-header {
    align-items: center;
  }

  .flow-history-header small {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .flow-history-header h2 {
    font-size: clamp(20px, 4.5vw, 28px);
  }

  .flow-history-header span {
    font-size: 12px;
    margin-top: 4px;
  }

  .flow-history-close {
    font-size: 24px;
    height: 38px;
    min-height: 38px;
    width: 38px;
  }

  .flow-history-chart-wrap {
    min-height: 0;
  }

  .flow-history-chart-wrap canvas {
    height: clamp(150px, 38dvh, 210px);
  }

  .flow-history-slider {
    margin: 0;
  }

  .flow-history-status {
    font-size: 12px;
    margin: 0;
  }

  .flow-history-modal.is-routing .flow-history-sheet {
    align-content: start;
    gap: 5px;
    width: min(980px, calc(100vw - 20px));
  }

  .flow-history-modal.is-routing .flow-history-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-history-modal.is-routing .routing-legend-group {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 4px 7px;
  }

  .flow-history-modal.is-routing button.routing-legend-chip {
    font-size: 9px;
    min-height: 24px;
    padding: 3px 6px;
  }

  .flow-history-modal.is-routing .flow-history-chart-wrap canvas {
    height: 125px;
  }

  .flow-history-modal.is-routing.has-flow-selection .flow-history-chart-wrap canvas {
    height: 105px;
  }

  .flow-history-modal.is-routing .flow-history-routing-summary {
    overflow: visible;
  }

  .flow-history-modal.is-routing .routing-summary-row,
  .flow-history-modal.is-routing .routing-total-row {
    grid-template-columns: 84px minmax(0, 1fr);
    padding: 4px 8px;
  }

  .flow-history-modal.is-routing .flow-history-routing-summary small,
  .flow-history-modal.is-routing .flow-history-status {
    display: none;
  }

  .flow-history-readout {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 4px 8px;
  }

  .flow-history-readout strong {
    font-size: 10px;
  }

  .flow-history-readout span {
    font-size: 13px;
    text-align: right;
  }
}

/* The disclosure is the live-panel grid item; its body owns the paired cards. */
.tab-panel[data-tab-panel="dashboard"] .generator-resource-disclosure {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.tab-panel[data-tab-panel="dashboard"] .generator-resource-disclosure .generator-resource-grid {
  grid-area: auto;
  grid-column: auto;
  width: 100%;
  min-width: 0;
}

.tab-panel[data-tab-panel="dashboard"] .generator-resource-grid > .fuel-panel,
.tab-panel[data-tab-panel="dashboard"] .generator-resource-grid > .maintenance-panel {
  grid-area: auto;
  width: 100%;
  min-width: 0;
}

@media (min-width: 1181px) {
  .tab-panel[data-tab-panel="dashboard"] .generator-resource-disclosure {
    grid-area: fuel;
    align-self: start;
  }
}

/* Match the diesel panel to the generator-service gauge language. */
.tab-panel[data-tab-panel="dashboard"] .generator-resource-grid > .fuel-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border: 1px solid rgba(72, 212, 162, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(9, 29, 31, 0.98), rgba(12, 39, 42, 0.96));
  box-shadow: none;
  color: #f4fbf9;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-gauge {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.fuel-gauge-ring {
  --fuel-progress: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: 136px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#f2b544 var(--fuel-progress), rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 24px rgba(242, 181, 68, 0.12);
}

.fuel-gauge-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(157, 202, 198, 0.16);
  border-radius: 50%;
  background: #0b2022;
}

.fuel-gauge[data-status="low"] .fuel-gauge-ring {
  background: conic-gradient(#f28c3d var(--fuel-progress), rgba(159, 190, 188, 0.16) 0);
}

.fuel-gauge[data-status="critical"] .fuel-gauge-ring {
  background: conic-gradient(#ef6b6b var(--fuel-progress), rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 28px rgba(239, 107, 107, 0.2);
}

.fuel-gauge-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.fuel-gauge-core strong {
  color: #f8fffc;
  font-size: 1.55rem;
  line-height: 1;
}

.fuel-gauge-core span {
  color: #91aaa8;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fuel-gauge-core b {
  color: #dce9e7;
  font-size: inherit;
}

.fuel-summary {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.fuel-summary > span {
  color: #91aaa8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fuel-summary > strong {
  color: #f2c96b;
  font-size: 1.35rem;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-summary > small {
  color: #b4c7c5;
  line-height: 1.4;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(129, 182, 177, 0.16);
  border-radius: 6px;
  background: rgba(5, 20, 22, 0.58);
  box-shadow: none;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats article::after {
  display: none;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats strong,
.tab-panel[data-tab-panel="dashboard"] .fuel-stats span {
  display: block;
  overflow-wrap: anywhere;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats strong {
  color: #edf8f6;
  font-size: 0.86rem;
  line-height: 1.25;
}

.tab-panel[data-tab-panel="dashboard"] .fuel-stats span {
  margin-top: 3px;
  color: #829c9a;
  font-size: 0.64rem;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .tab-panel[data-tab-panel="dashboard"] .generator-resource-grid > .fuel-panel {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .fuel-gauge-ring {
    width: 96px;
  }

  .fuel-gauge-core strong {
    font-size: 1.15rem;
  }

  .tab-panel[data-tab-panel="dashboard"] .fuel-stats {
    grid-template-columns: 1fr;
  }
}

/* Present generator control as the operational member of the resource-panel family. */
.tab-panel[data-tab-panel="dashboard"] .generator-control-panel {
  display: grid;
  grid-template-columns: 150px minmax(250px, 0.8fr) minmax(330px, 1.2fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(72, 212, 162, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(9, 29, 31, 0.98), rgba(12, 39, 42, 0.96));
  box-shadow: none;
  color: #f4fbf9;
}

.generator-control-gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: 136px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#ef6b6b 360deg, rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 24px rgba(239, 107, 107, 0.12);
}

.generator-control-gauge::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(157, 202, 198, 0.16);
  border-radius: 50%;
  background: #0b2022;
}

.generator-control-gauge[data-status="ready"] {
  background: conic-gradient(#49d8a3 360deg, rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 24px rgba(63, 215, 161, 0.12);
}

.generator-control-gauge[data-status="running"] {
  background: conic-gradient(#f28c3d 360deg, rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 26px rgba(242, 140, 61, 0.18);
}

.generator-control-gauge[data-status="review"] {
  background: conic-gradient(#f2b544 360deg, rgba(159, 190, 188, 0.16) 0);
  box-shadow: 0 0 24px rgba(242, 181, 68, 0.14);
}

.generator-control-gauge-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.generator-control-gauge .generator-control-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border: 0;
  background: url("/assets/icons/generator.png") center / 31px 31px no-repeat;
}

.generator-control-gauge-core strong {
  color: #f8fffc;
  font-size: 0.92rem;
  line-height: 1;
}

.generator-control-gauge-core small,
.generator-control-summary > span,
.generator-automation-copy > span {
  color: #91aaa8;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.generator-control-summary {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.generator-control-summary > strong {
  color: #69e6b5;
  font-size: 1.35rem;
}

.generator-control-gauge[data-status="running"] + .generator-control-summary > strong {
  color: #f2a064;
}

.generator-control-gauge[data-status="review"] + .generator-control-summary > strong {
  color: #f2c96b;
}

.generator-control-gauge[data-status="unavailable"] + .generator-control-summary > strong {
  color: #ef8b8b;
}

.generator-control-summary > small {
  color: #b4c7c5;
  line-height: 1.4;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-indicators {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
  overflow: visible;
  padding: 0;
}

.tab-panel[data-tab-panel="dashboard"] .control-state-pill {
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border-radius: 6px;
  background: rgba(5, 20, 22, 0.58);
  overflow: hidden;
  text-overflow: ellipsis;
}

.generator-control-operations {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-unlock,
.tab-panel[data-tab-panel="dashboard"] .generator-control-actions,
.tab-panel[data-tab-panel="dashboard"] .generator-control-status {
  grid-column: auto;
  grid-row: auto;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-unlock,
.tab-panel[data-tab-panel="dashboard"] .generator-control-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-unlock {
  grid-template-columns: minmax(130px, 1fr) auto;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-unlock input {
  width: 100%;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-actions {
  justify-content: stretch;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-actions button {
  width: 100%;
  min-width: 0;
}

.tab-panel[data-tab-panel="dashboard"] .generator-control-status {
  min-height: 1.35em;
  margin: 0;
  color: #a9bfbd;
  line-height: 1.35;
}

.tab-panel[data-tab-panel="dashboard"] .generator-automation-status {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 11px 12px;
  border-color: rgba(129, 182, 177, 0.16);
  border-radius: 6px;
  background: rgba(5, 20, 22, 0.58);
}

.generator-automation-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.generator-automation-copy > strong {
  color: #edf8f6;
  font-size: 0.94rem;
}

.generator-automation-copy > small {
  color: #91aaa8;
  line-height: 1.35;
}

.tab-panel[data-tab-panel="dashboard"] .generator-automation-mini {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

@media (max-width: 900px) {
  .tab-panel[data-tab-panel="dashboard"] .generator-control-panel {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .generator-control-gauge {
    width: 96px;
  }

  .generator-control-gauge .generator-control-icon {
    width: 27px;
    height: 27px;
    background-size: 25px 25px;
  }

  .generator-control-gauge-core strong {
    font-size: 0.8rem;
  }

  .generator-control-operations,
  .tab-panel[data-tab-panel="dashboard"] .generator-automation-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .tab-panel[data-tab-panel="dashboard"] .generator-control-indicators {
    grid-template-columns: 1fr;
  }

  .tab-panel[data-tab-panel="dashboard"] .generator-automation-status {
    grid-template-columns: 1fr;
  }

  .tab-panel[data-tab-panel="dashboard"] .generator-automation-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-metrics.live-metrics--core {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-disclosure--live .dashboard-disclosure__body { padding: 10px; }

  .dashboard-disclosure--live .live-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-disclosure--live .live-card {
    min-height: 0;
    padding: 9px;
  }

  .dashboard-disclosure--live .live-card strong { font-size: 1rem; }

  .resilience-forecast-grid { gap: 8px; }

  .resilience-forecast-grid .forecast-card { padding: 9px; }

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

  .solar-forecast-hero > .solar-forecast-target {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 7px 9px;
  }

  .solar-forecast-target strong { margin-top: 0; }

  .generator-resource-disclosure .dashboard-disclosure__body { padding: 10px; }
}
