:root { --ink:#1d2a1f; --muted:#63705f; --line:#d7ddd0; --green:#2f5d3a; --paper:#fbfcf8; }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }
header { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.9rem 1.5rem; border-bottom:1px solid var(--line); background:#fff; }
header .brand { display:inline-flex; align-items:center; text-decoration:none; }
header .brand-logo { height:26px; width:auto; display:block; }
nav a { margin-left:1rem; color:var(--muted); text-decoration:none; }
@media (hover: hover) and (pointer: fine) { nav a:hover { color:var(--green); } }
main { max-width:62rem; margin:0 auto; padding:1.5rem 1.5rem 3rem; }
h1 { font-size:1.6rem; margin:.2rem 0 1.2rem; }
h2 { font-size:1.1rem; margin:2rem 0 .6rem; }
footer { border-top:1px solid var(--line); padding:1rem 1.5rem; color:var(--muted); font-size:.8rem; }
footer .build { float:right; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.75rem; }
section { border:1px solid var(--line); border-radius:10px; background:#fff; padding:var(--panel-padding-block) var(--panel-padding-inline); margin-bottom:1rem; }
/* The same box as a section, for the customer's pages: <section> inside a Razor code block is
   read as the section directive, which is a corner worth not standing in. */
.panel { border:1px solid var(--line); border-radius:10px; background:#fff; padding:var(--panel-padding-block) var(--panel-padding-inline); margin-bottom:1rem; }
label { display:block; font-size:.8rem; color:var(--muted); margin:.6rem 0 .2rem; }
label.check { display:flex; align-items:flex-start; gap:.5rem; font-size:.85rem; color:var(--ink); margin:.8rem 0; }
label.check input { width:auto; max-width:none; margin:.2rem 0 0; }
/* Saving belongs to the whole form, not to whichever section it happens to sit under. */
.save-bar { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; border:1px solid var(--line);
  border-radius:8px; background:#fff; padding:.8rem 1rem; margin:1rem 0 2rem; }
.save-bar button { margin-top:0; }
.save-bar .muted { flex:1 1 22rem; font-size:.82rem; }
.hint { font-size:.8rem; color:var(--muted); margin:.25rem 0 .6rem; max-width:32rem; }
/* The export switch: a state, what it means, and the way to change it. */
.terms { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; border:1px solid var(--line);
  border-radius:8px; background:#fff; padding:.7rem .9rem; margin:1rem 0; }
.terms .muted { flex:1 1 100%; font-size:.82rem; }
.terms button { margin-top:0; }
.terms label.check { margin:0; }
.terms label.inline { display:flex; align-items:center; gap:.4rem; margin:0; font-size:.8rem;
  color:var(--muted); white-space:nowrap; }
.terms label.inline input { width:5.5rem; max-width:none; padding:.35rem .5rem; }
.switch-state { font-size:.75rem; font-weight:600; letter-spacing:.04em; text-transform:uppercase;
  padding:.2rem .5rem; border-radius:999px; }
.switch-state.on { background:#eef4e8; color:var(--green); }
.switch-state.off { background:#fdf3ee; color:#7a3320; }
input,select { width:100%; max-width:32rem; padding:.5rem .6rem; font:inherit; border:1px solid #b9c4ae; border-radius:6px; background:#fff; }
.ok-diagnostic-panel { margin-top:1.5rem; min-width:0; }
.ok-diagnostic-panel[aria-busy="true"] { opacity:.7; }
.ok-diagnostic-results { overflow-x:auto; max-width:100%; }
.ok-diagnostic-results table { width:max-content; min-width:100%; }
.ok-diagnostic-results td { max-width:18rem; overflow-wrap:anywhere; white-space:normal; }
.ok-diagnostic-results .ok-candidate td:first-child { font-weight:700; color:var(--green); }
button, a.button { margin-top:.8rem; padding:.55rem 1rem; font:inherit; font-weight:600; color:#fff; background:var(--green); border:1px solid var(--green); border-radius:6px; cursor:pointer; }
button.secondary, a.button.secondary { background:#fff; color:var(--green); }
a.button { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
table { width:100%; border-collapse:collapse; font-size:.9rem; }
th,td { text-align:left; padding:.5rem .6rem; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:.7rem; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(14rem,1fr)); gap:.4rem 1.4rem; margin:1rem 0 0; }
.facts dt { font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.facts dd { margin:.1rem 0 0; }
.message { border-left:3px solid var(--green); background:#eef4e8; padding:.6rem .8rem; border-radius:5px; margin:1rem 0; }
.error { border-left:3px solid #963b25; background:#fdf3ee; padding:.6rem .8rem; border-radius:5px; margin:1rem 0; color:#7a3320; }
.muted { color:var(--muted); font-size:.85rem; }
code { background:#f1f4ec; padding:.05rem .3rem; border-radius:4px; }

/* The plan strip: one block per hour, height is the price, colour is what the plan
   does in that hour. Same idea as the public page's price chart, same palette. */
.plan-strip { display:flex; align-items:flex-end; gap:3px; height:120px; margin:1rem 0 .4rem;
  border-bottom:1px solid var(--line); background:repeating-linear-gradient(to top,transparent 0,transparent 29px,#eef2e6 29px,#eef2e6 30px); }
.plan-hour { flex:1; border-radius:2px 2px 0 0; background:#dde4d2; min-width:4px; }
.plan-hour.charge { background:#e8c25f; }
.plan-hour.grid-charge { background:#c1492e; }
.plan-hour.discharge { background:#7b8b99; }
.plan-hour.export { background:#4f8a4f; }
.plan-hour.idle { background:#cfd9c2; }
/* The far end of the plan, priced at a typical time of day rather than at a published price. */
.plan-hour.forecast { opacity:.4; }
.legend { display:flex; flex-wrap:wrap; gap:.3rem 1.2rem; font-size:.75rem; color:var(--muted); margin:0 0 1.5rem; }
.legend .key { display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:.35rem; background:#cfd9c2; }
.legend .key.charge { background:#e8c25f; }
.legend .key.grid-charge { background:#c1492e; }
.legend .key.discharge { background:#7b8b99; }
.legend .key.export { background:#4f8a4f; }
.legend .key.plan { background:#2f5d3a; }
.legend .key.all-in { background:#6f9a52; }
.assumptions { font-size:.85rem; color:var(--muted); padding-left:1.1rem; }
.assumptions li { margin:.3rem 0; }
/* Running cost: two lines, one scale, drawn without any script. non-scaling-stroke
   keeps the line weight honest while the box is stretched to the page width. */
.cost-chart { display:block; width:100%; height:150px; margin:1rem 0 0; border-bottom:1px solid var(--line); }
.cost-chart polyline { fill:none; stroke-width:2; vector-effect:non-scaling-stroke; }
.cost-chart .plan { stroke:#2f5d3a; }
.cost-chart .all-in { stroke:#6f9a52; stroke-dasharray:6 4; }
.cost-chart .zero { stroke:#d7ddd0; stroke-width:1; vector-effect:non-scaling-stroke; }
/* Forecast against production: the expectation is dashed, what happened is drawn solid. */
.pv-chart { display:block; width:100%; height:150px; margin:1rem 0 0; border-bottom:1px solid var(--line); }
.pv-chart polyline { fill:none; stroke-width:2; vector-effect:non-scaling-stroke; }
.pv-chart .forecast { stroke:#b9c4ae; stroke-dasharray:6 4; }
.pv-chart .actual { stroke:#2f5d3a; }
.pv-chart .now { stroke:#963b25; stroke-width:1; stroke-dasharray:2 3; vector-effect:non-scaling-stroke; }
.legend .key.forecast { background:#b9c4ae; }
.legend .key.actual { background:#2f5d3a; }
.legend .key.now { background:#963b25; }
.chart-tip { font-size:.8rem; line-height:1.5; }
#plan-chart, #forecast-chart { margin:.6rem 0 0; }
.chart-days { display:flex; gap:.5rem; flex-wrap:wrap; }
.chart-days[hidden] { display:none; }
.chart-days button { display:flex; align-items:center; gap:.45rem; }
.chart-days button small { font-weight:400; }
.chart-days button[aria-pressed="true"] { background:var(--green); border-color:var(--green); color:white; }
.chart-days button:disabled { opacity:1; cursor:default; }
.admin-table tr[hidden] { display:none; }
.chart-times { display:flex; justify-content:space-between; color:var(--muted); font-size:.7rem; margin-top:.35rem; }
/* Nine columns of numbers do not fit a phone, so the table scrolls sideways inside
   the page rather than pushing the whole page wide. */
.admin-table-wrap { overflow-x:auto; }
.admin-table { min-width:34rem; }
/* A price the market has not published yet: the row is real, the number is a typical time of
   day, and saying so in the table is what keeps the chart's shading honest further down. */
.admin-table tbody tr.estimated { color:#7d8a76; font-style:italic; }
.small { font-size:.8rem; }
/* The operator reads plans on a phone as often as not. */
@media (max-width:34rem) {
  main { padding:1.2rem 1rem 2.5rem; }
  h1 { font-size:1.3rem; }
  .facts { grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:.5rem 1rem; }
  .facts dd { font-size:.95rem; }
  .plan-strip { height:90px; }
}

.pv-day h2 { text-align:center; font-size:1rem; margin:1rem 0 .8rem; }
.pv-summary { display:flex; justify-content:center; align-items:center; gap:.55rem; margin:1rem auto; max-width:32rem; }
.pv-amount { display:flex; flex-direction:column; font-size:.85rem; }
.pv-amount:first-child { text-align:right; }
.pv-amount strong { white-space:nowrap; }
.pv-progress { height:1.8rem; background:#f1f2f4; flex:1; max-width:19rem; min-width:4rem; }
.pv-progress span { display:block; height:100%; background:#ffe96c; }
.pv-weather { display:grid; gap:.35rem; margin:1.2rem 3rem 0; }
.pv-weather-cell { text-align:center; border-bottom:4px solid #a0a8be; padding-bottom:.25rem; font-size:clamp(.85rem,2.6vw,1.5rem); }
.pv-weather-cell.bright { border-color:#ffe96c; }
.pv-day [data-pv-chart] { margin-top:0; }
.pv-legend { gap:.4rem 1rem; margin-top:.35rem; }
.pv-cloud-key { margin-left:auto; }
.pv-key { display:inline-block; width:1.4rem; vertical-align:middle; border-top:3px solid #ffcf00; margin-right:.4rem; }
.pv-key.predicted { border-top-style:dashed; }
.pv-key.now { border-color:#ff416a; border-top-style:dotted; }
.pv-key.weather { border-color:#7e88a4; }
.pv-key.cloud { border-color:#e0dff0; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.pv-weather-icon { display:block; width:100%; max-width:2.3rem; height:2rem; margin:auto; }

.today-overview { margin-bottom:1rem; padding:var(--panel-padding-block) var(--panel-padding-inline); border:1px solid var(--line); border-radius:8px; background:var(--panel, #fff); }
.today-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.9rem 1.4rem; }
.today-overview > div { min-width:0; }
.today-overview small { display:block; }
.today-overview dd { font-size:1.15rem; }
.past-plan-toggle { text-align:left; display:flex; align-items:center; gap:.6rem; width:100%; }
.past-plan-toggle [data-past-symbol] { font-size:1.2rem; width:1rem; }
@media (max-width:600px) { .today-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; } }

/* Home Screen windows can extend to the iPhone's rounded screen edges. */
body { padding-left:env(safe-area-inset-left, 0px); padding-right:env(safe-area-inset-right, 0px); }
footer { padding-bottom:calc(1rem + env(safe-area-inset-bottom, 0px)); }
.phone-shortcut { margin-top:.75rem; max-width:32rem; }
.phone-shortcut summary { cursor:pointer; padding:.5rem 0; }
.phone-shortcut p { margin:.25rem 0; }
@media (max-width:34rem) {
  header { flex-wrap:wrap; padding:.75rem 1rem; }
  header nav { display:flex; flex-wrap:wrap; gap:.25rem .75rem; align-items:center; }
  header nav a { margin-left:0; padding:.5rem 0; }
  button { min-height:44px; }
  footer .build { float:none; display:block; margin-top:.5rem; }
  .panel, section { padding:1rem; }
}

.language-switch { white-space:nowrap; }
.login-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
.setup-link { display:inline-block; padding:.5rem 0; }

.demo-badge { display:inline-block; padding:.25rem .7rem; border-radius:2rem; background:#e6eddc; color:#2f5d3a; font-size:.8rem; font-weight:600; }
.demo-intro p { margin:.6rem 0 1rem; }
.demo-saving { display:flex; align-items:center; gap:1rem; margin:1rem 0 1.4rem; padding:1rem 1.2rem; background:#edf3e6; border-radius:.6rem; }
.demo-saving strong { font-size:2.4rem; line-height:1; color:#2f5d3a; }
.demo-story { display:grid; grid-template-columns:repeat(3,1fr); gap:1.2rem; }
@media (max-width:600px) { .demo-story { grid-template-columns:1fr; gap:0; } }

@media (max-width:600px) { .demo-saving .small { display:none; } }

/* A phone shows one day of the graph and the daily money summary. */
.cost-heading-mobile { display:none; }
@media (max-width:600px) {
  .interval-plan, .plan-debug, .plan-explanations, .plan-footer { display:none; }
  .chart-days { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.4rem; }
  .chart-days button { flex-direction:column; justify-content:center; gap:0; padding:.45rem .25rem; }
  .chart-days button small { font-size:.7rem; }
  .cost-heading-desktop { display:none; }
  .cost-heading-mobile { display:inline; }
  .plan-costs { overflow:visible; margin-top:1rem; }
  .plan-cost-table { min-width:0; width:100%; table-layout:fixed; font-size:.8rem; }
  .plan-cost-table th, .plan-cost-table td { padding:.55rem .3rem; overflow-wrap:anywhere; }
  .plan-cost-table th:first-child { width:44%; }
  .plan-cost-table th:not(:first-child) { width:28%; }
  .plan-cost-table td:not(:first-child) { font-variant-numeric:tabular-nums; }
  .plan-cost-table .small { font-size:.7rem; }
}

.plan-debug { margin:1rem 0; }
.plan-debug summary { cursor:pointer; color:var(--green); font-weight:600; padding:.6rem 0; }

.manual-login-links { margin-top:1rem; }
.manual-login-links summary { cursor:pointer; color:var(--muted); }
.portal-header { flex-wrap:wrap; }
.portal-header nav { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem .8rem; }
.portal-header nav a { margin-left:0; }
.settings-sites { display:flex; flex-wrap:wrap; gap:.75rem; margin:1rem 0; }
.settings-sites a { margin:0; }
.settings-sites [aria-current="page"] { font-weight:700; color:var(--green); }
.customer-settings section h2 { margin-top:0; }

/* Header links match the portal's secondary sign-out button. */
header nav { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem .6rem; }
header nav a, header nav button.secondary { display:inline-flex; align-items:center; justify-content:center;
  margin:0; padding:.55rem 1rem; border:1px solid var(--green); border-radius:6px; background:#fff;
  color:var(--green); font:inherit; font-weight:600; text-decoration:none; white-space:nowrap; }
@media (hover: hover) and (pointer: fine) { header nav a:hover, header nav button.secondary:hover { background:#eef4e8; } }
header nav a:focus-visible, header nav button.secondary:focus-visible { outline:3px solid #64804e; outline-offset:2px; }
header nav form { margin:0; }
@media (max-width:600px) {
  header nav a, header nav button.secondary { padding:.45rem .65rem; font-size:.85rem; }
}

.plan-cost-table .cost-secondary { font-size:.75rem; color:var(--muted); }
.plan-cost-table .cost-secondary td { padding-top:.2rem; padding-bottom:.4rem; }
@media (max-width:600px) { .plan-cost-table .cost-secondary { font-size:.7rem; } }

.live-house { display:block; margin-top:.3rem; font-size:.8rem; font-variant-numeric:tabular-nums; }
.live-house strong { font-weight:500; }

.car-connect-form { margin-top:1.5rem; }
.car-connect-steps { padding-left:1.4rem; line-height:1.6; }
.car-connect-form input, .car-connect-form select { max-width:100%; }
.car-approval-form { margin-top:1.5rem; }
.manual-car-connection { margin-top:1rem; }
.manual-car-connection summary { cursor:pointer; color:var(--muted); }
.car-approval-form button:disabled { opacity:.55; cursor:not-allowed; }

.charger-copy-field { display: flex; gap: .5rem; align-items: center; margin: .4rem 0; }
.charger-copy-field input { flex: 1; min-width: 0; width: 0; font-family: monospace; }
.charger-copy-field button { flex: 0 0 auto; margin: 0; }
.charger-guide { padding-left: 1.4rem; }
.charger-guide > li { margin: 1rem 0; }
.charger-settings { min-width: 0; }
.customer-settings + .customer-settings { margin-top: 2rem; }

.ev-plan-summary { margin-top:.55rem; font-size:.875rem; }
.ev-plan-summary small { display:block; line-height:1.4; }
.ev-plan-heading { font-weight:600; }
.ev-plan-total { margin:.1rem 0; }
.ev-plan-runs { list-style:none; padding:0; margin:.35rem 0 0; font-size:.8rem; }
.ev-plan-runs li { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.1rem .5rem; padding:.1rem 0; }
.ev-plan-more { margin-top:.25rem; font-size:.8rem; }
.ev-plan-more summary { cursor:pointer; }
.ev-plan-shortfall { margin-top:.3rem; color:var(--muted); }


.ev-time-select { display:flex; align-items:center; gap:.35rem; width:fit-content; }
.ev-time-select select { width:5.5rem; margin:0; }
.ev-day-row { display:grid; grid-template-columns:6.5rem 1fr; align-items:center; gap:.35rem .75rem; padding:.55rem 0; }
.ev-day-row > label { margin:0; }
.ev-day-options { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; min-width:0; }
.ev-day-options .check { margin:0; }
.ev-copy-days { grid-column:2; justify-self:start; font-size:.8rem; padding:.3rem .55rem; margin:0; }
@media(max-width:420px) { .ev-day-row { grid-template-columns:5.5rem 1fr; gap:.35rem; } .ev-time-select select { width:4.4rem; } }

.vehicle-heading { display:flex; align-items:baseline; gap:.45rem; margin:0; }
.vehicle-heading > span:first-child { flex:0 0 auto; }
.vehicle-unplugged-status { font-size: .8rem; }
.vehicle-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.9rem; }
.vehicle-plan-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.35rem; align-items:start; margin-top:.25rem; }
.vehicle-buttons { display:flex; gap:.25rem; align-items:center; }
.vehicle-buttons form { display:flex; align-items:center; margin:0; }
.small-button { margin:0; padding:.25rem .35rem; font-size:.75rem; white-space:nowrap; }
.car-name-fields { display:flex; gap:.5rem; align-items:center; }
.car-name-fields input { flex:1; min-width:0; }
.car-name-fields button { flex:0 0 auto; }
.car-timing-dialog { width:min(34rem,calc(100vw - 2rem)); max-height:85dvh; overflow:auto; border:1px solid var(--line); border-radius:12px; padding:1.25rem; color:var(--ink); background:var(--panel,#fff); }
.car-timing-dialog::backdrop { background:rgb(0 0 0 / .35); }
.dialog-close { float:right; margin:0; border:0; padding:0 .3rem; background:transparent; color:inherit; font-size:1.5rem; }
/* A car is the last right-hand metric, including on phones. Its controls get their
   own compact row instead of widening the whole card or squeezing the plan. */
.vehicle-unplugged-buttons { margin-left:auto; }
.vehicle-unplugged-buttons .car-preview-action { margin:0; }
@media(max-width:600px) {
  .today-overview { column-gap:.8rem; }
  .today-overview dt { font-size:.65rem; letter-spacing:.04em; line-height:1.5; }
  .today-overview dd { font-size:1.05rem; line-height:1.4; }
  .today-overview .vehicle-overview { grid-column:auto; }
  .today-overview .vehicle-heading { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.25rem .35rem; }
  .today-overview .vehicle-name { font-size:.8rem; }
  .today-overview .vehicle-unplugged-buttons { grid-column:1 / -1; margin:0; }
  .today-overview .vehicle-plan-row { grid-template-columns:minmax(0,1fr); gap:.3rem; }
  .today-overview .vehicle-plan-row > div { min-width:0; }
  .today-overview .vehicle-buttons { flex-direction:row; flex-wrap:wrap; align-items:center; gap:.25rem; }
  .today-overview .vehicle-buttons button { min-height:44px; padding:.25rem .3rem; font-size:.7rem; }
  .today-overview .vehicle-cable-status { font-size:.75rem; }
  .today-overview .ev-plan-compact { line-height:1.4; }
  .today-overview .ev-plan-compact small { font-size:.75rem; }
}

.car-preview-action { margin:0 0 0 auto; flex:0 0 auto; }

.licence-admin-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:14px 0; }

.ev-only-home .button { display:inline-flex; align-items:center; padding:10px 16px; border:1px solid #2c5f37; border-radius:8px; background:#2c5f37; color:#fff; text-decoration:none; font-weight:600; }
@media (hover: hover) and (pointer: fine) { .ev-only-home .button:hover { background:#214a2b; } }

.vehicle-overview button:disabled { opacity:.45; cursor:not-allowed; }

/* Compact customer overview; actions stay visible on phones without a wide table. */
.customer-overview { list-style:none; padding:0; margin:0; display:grid; gap:12px; }
.customer-overview-card { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:16px;
  align-items:center; padding:16px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.customer-overview-identity { display:grid; gap:4px; min-width:0; overflow-wrap:anywhere; }
.customer-overview-details { display:flex; gap:20px; margin:0; }
.customer-overview-details dt { font-size:.8rem; color:var(--muted); }
.customer-overview-details dd { margin:4px 0 0; }
.customer-overview-actions { display:flex; gap:8px; }
.customer-action { display:inline-flex; align-items:center; justify-content:center; min-height:44px;
  box-sizing:border-box; padding:8px 18px; border:1px solid var(--green); border-radius:6px;
  background:var(--green); color:#fff; font-weight:600; text-decoration:none; }
.customer-action.secondary { background:#fff; color:var(--green); }
@media (hover: hover) and (pointer: fine) { .customer-action:hover { background:#193b31; color:#fff; } }
.customer-action:focus-visible { outline:3px solid #64804e; outline-offset:2px; }
@media(max-width:700px) {
  .customer-overview-card { grid-template-columns:minmax(0,1fr); gap:12px; padding:14px; }
  .customer-overview-details { gap:24px; flex-wrap:wrap; }
  .customer-overview-actions .customer-action { flex:1; }
}

.today-overview .battery-power { display:block; }

.customer-settings label.electric-heating-setting { min-height:44px; align-items:center; }

.today-overview .battery-discharge-rate { color: #c93648; white-space: nowrap; margin-left: .35em; font-size: .55em; font-weight: 500; }
:root[data-theme="dark"] .today-overview .battery-discharge-rate { color: #ff8796; }

.error-log-heading,.error-log-summary{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.error-log-list{list-style:none;padding:0;display:grid;gap:.8rem}.error-log-item{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(10rem,auto);gap:1rem;align-items:center;margin:0}
.error-log-item strong,.error-log-item small,.error-log-cause{display:block}.error-log-item small,.error-log-cause{overflow-wrap:anywhere}.error-log-severity{display:block;font-size:.8rem;margin-bottom:.3rem}.error-log-cause{font-size:.8rem;margin:.4rem 0;background:transparent}.error-log-count{text-align:center}.error-log-count strong{font-size:1.7rem}.error-log-item dl{font-size:.8rem;margin:0}.error-log-item dt{color:var(--muted,#69766f)}.error-log-item dd{margin:0 0 .4rem}
@media(max-width:600px){.error-log-item{grid-template-columns:minmax(0,1fr) auto}.error-log-item dl{grid-column:1/-1;display:flex;gap:1.5rem;flex-wrap:wrap}.error-log-count small{max-width:5rem}}

.error-log-severity.severe{color:#b84731}html[data-theme="dark"] .error-log-severity.severe{color:#f3a398}

.ev-onboarding-steps { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 0; list-style: none; margin: 24px 0; }
.ev-onboarding-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ev-onboarding-steps li[aria-current="step"] { color: var(--text); font-weight: 700; }
.ev-onboarding-steps li span { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; }
.ev-onboarding-steps .complete span { background: #193b31; color: white; border-color: #193b31; }

.battery-average-cost { white-space:nowrap; }

.pv-summary { max-width:42rem; flex-wrap:wrap; }
.pv-generated-values { display:flex; align-items:baseline; gap:.45rem; font-size:1.1rem; }
.pv-generated-values .pv-producing { text-align:left; font-size:.5em; color:#368f39; white-space:nowrap; }
@media (max-width:480px) { .pv-summary .pv-progress { order:4; flex-basis:100%; max-width:none; height:.65rem; } .pv-summary { justify-content:space-between; } }

.live-grid { display:block; margin-top:.2rem; font-size:.8rem; font-variant-numeric:tabular-nums; }
.live-grid strong { font-weight:500; }
.live-grid .grid-import { color:#b03a46; }
.live-grid .grid-export { color:var(--green); }
:root[data-theme="dark"] .live-grid .grid-import { color:#ff8796; }

.tibber-connection-guide { margin-bottom: 16px; font-size: .9rem; }
.tibber-connection-guide p { margin-bottom: 8px; }
.tibber-connection-guide ol { margin: 0; padding-left: 24px; }
.tibber-connection-guide li { margin-bottom: 8px; line-height: 1.5; }

/* Car preferences belong to each car; charger setup shares the same EV panel. */
.ev-settings-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0 1.25rem; }
.ev-settings .ev-settings-tabs a.button[aria-current="page"] { background: #2f6b44; color: #fff; border-color: #2f6b44; }
.ev-settings-part { min-width: 0; }
.ev-settings-part h3 { margin-top: 0; }

.chart-days button[hidden] { display:none; }
.chart-days.show-history { display:flex; flex-direction:row-reverse; flex-wrap:nowrap; overflow-x:auto; padding-bottom:.3rem; }
.chart-days.show-history button { flex:0 0 auto; }
.chart-history-toggle { min-width:2.2rem; justify-content:center; }
@media(max-width:600px) {
  .chart-days:has(.chart-history-toggle) { grid-template-columns:2.2rem repeat(3,minmax(0,1fr)); }
  .chart-days.show-history { display:flex; }
}

/* Reserve the chart canvas while a different day's data is loading. */
[data-plan-chart] { min-height:240px; }
[data-plan-chart][hidden] { display:block; visibility:hidden; }
[data-pv-chart] { min-height:205px; }

.inverter-diagnostic-values{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem 1rem}.inverter-diagnostic-values dt{color:var(--muted)}.inverter-diagnostic-values dd{margin:0;overflow-wrap:anywhere}

.sales-lead h2{margin-top:0}.sales-lead .lead-message,.lead-comment p{white-space:pre-wrap;overflow-wrap:anywhere}.sales-lead textarea{width:100%;max-width:100%;font:inherit}.lead-comment{border-left:3px solid var(--line);padding:.4rem .8rem;margin:.8rem 0}.sales-lead details{margin:1rem 0}.sales-lead summary{cursor:pointer}

.sales-leads{min-width:0;overflow-wrap:anywhere}

/* Keep future heating inputs next to their opt-in; older browsers show the fields. */
[data-heat-pump-inputs]:not(:has([name="Equipment.PlannedHeatPump"]:checked)) [data-heat-pump-fields] { display: none; }

/* Compact month-to-date savings, with the same table available on demand. */
.savings-panel{border:1px solid var(--line);border-radius:.8rem;overflow:hidden;margin:1rem 0}
.savings-panel>summary{min-height:44px;box-sizing:border-box;display:flex;align-items:center;gap:.5rem;list-style:none;cursor:pointer;padding:.8rem 1rem;font-size:.85rem}
.savings-panel>summary::-webkit-details-marker{display:none}
.savings-title{flex:1;min-width:0}.savings-panel>summary strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.savings-arrow{color:var(--muted)}.savings-panel[open] .savings-arrow{transform:rotate(180deg)}
.savings-panel .admin-table-wrap{margin:0;border:0}.savings-panel .plan-cost-table{margin:0}
@media(max-width:600px){.savings-panel>summary{gap:.3rem;padding:.75rem .5rem;font-size:.72rem}.savings-panel>summary strong{font-size:.8rem}}
