@media(min-width: 1221px){body #main #overview-page .metrics.metrics-powerstation{grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(10px,1vw,18px)}body #main #overview-page .metrics.metrics-powerstation .metric{min-width:0;padding-inline:clamp(10px,1vw,20px)}body #main #overview-page .metrics.metrics-powerstation .metric-label{font-size:clamp(12px,1.1vw,17px);overflow-wrap:normal}}
body #main #overview-page .powerstation-metric .metric-reading{display:flex;flex-direction:column;gap:4px;justify-content:center;align-items:center}
.powerstation-flows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:4px;text-align:center;font-size:clamp(11px,.9vw,14px)}
.powerstation-flow{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;line-height:1.25;color:var(--cr-muted)}
.powerstation-flow strong{color:var(--cr-ink);font-weight:650;font-variant-numeric:tabular-nums;white-space:nowrap}

.powerstation-soc-bar{display:block;width:100%;max-width:160px;margin:2px auto 0}
.powerstation-track{height:8px;display:block;background:#cad5df;border-radius:8px;overflow:hidden}
.powerstation-soc-bar .powerstation-fill{height:8px;width:100%;clip-path:inset(0 calc(100% - var(--ps-level,0%)) 0 0)}
.powerstation-soc-bar[data-current=false] .powerstation-fill{visibility:hidden}
body #main .powerstation-management{box-sizing:border-box;width:100%;max-width:var(--portal-content-width,1280px);margin:24px 0}
.powerstation-management h2,.powerstation-management h3,.powerstation-management p{margin-block:0 10px}
.powerstation-management button,.powerstation-management select{font:inherit}
.ps-heading,.ps-add,.powerstation-switches form{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ps-heading h2,.ps-output h3{margin:0}
.ps-connection[data-current=true]{color:#27864d}
.ps-connection[data-current=false]{color:var(--muted)}
.ps-readings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}
.ps-reading{display:grid;grid-template-rows:auto 1fr 8px;justify-items:center;align-items:center;min-width:0;background:var(--cr-surface);border:1px solid var(--line);border-radius:var(--cr-radius);padding:16px 12px;text-align:center;gap:6px}.ps-reading .small{font-weight:600;color:var(--muted)}.ps-reading .powerstation-soc-bar{margin:0;max-width:100%;width:min(100%,220px)}
.ps-reading strong{font-size:clamp(24px,2.2vw,34px);font-weight:750;color:var(--blue);font-variant-numeric:tabular-nums;line-height:1.2}
.powerstation-switches form{padding:12px 0;border-top:1px solid var(--line)}
.ps-output{display:flex;flex-direction:column;gap:2px}
.ps-toggle{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:10px;overflow:hidden;min-width:140px;background:var(--paper)}
.powerstation-management .ps-toggle button{border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--ink);padding:8px 14px;min-height:42px;font:inherit;font-weight:600;cursor:pointer}
.powerstation-management .ps-toggle button[aria-pressed=true]{background:var(--blue);color:white}
.powerstation-management .ps-toggle button:disabled{cursor:not-allowed;opacity:.55}
.ps-add{margin:16px 0}.ps-add .field,.ps-device{flex:1;min-width:0;margin:0}.ps-device{display:flex;flex-direction:column;overflow-wrap:anywhere}.ps-refresh{display:inline-flex}.ps-remove{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}
.powerstation-management [data-ps-command]:empty{display:none}
@media(max-width:540px){.ps-readings{grid-template-columns:repeat(2,minmax(0,1fr))}.ps-soc{grid-column:1/-1}.ps-add .field,.ps-device{flex-basis:100%}.ps-add .primary{width:100%}.ps-refresh{justify-content:center;width:100%}}
/* RC20: identical voltage palette; SOC uses a filled length rather than a voltage pointer. */
body #main #overview-page .powerstation-metric .metric-label{padding-inline-end:1.25rem}
body #main #overview-page .powerstation-metric .metric-reading .metric-value{margin-block:2px}
.powerstation-soc-bar .powerstation-fill{background:linear-gradient(90deg,#c83c38 0%,#e98428 30%,#e4c24a 48%,#64aa69 65%,#27864d 100%)}
.history-ps select{display:block;max-width:100%;min-height:2.5rem;font:inherit}
body #main .gas-card .gas-runtime{grid-column:2/-1;font-size:12px;line-height:1.35;color:var(--muted);margin:2px 0;overflow-wrap:anywhere}
body #main .gas-card .gas-runtime[hidden],#gas-consumption[hidden]{display:none!important}
.gas-consumption{margin:12px 0}.gas-consumption-values{display:flex;gap:16px;flex-wrap:wrap}.gas-consumption-values span{flex:1;min-width:100px;font-size:13px}.gas-consumption-values strong{display:block;color:var(--ink);font-weight:600}
@media(max-width:540px){body #main .gas-card .gas-runtime{grid-column:1/-1;text-align:center;font-size:11px}}
body #main .messages{margin-block:14px 18px;padding:14px 18px;line-height:1.5}
body #main .messages p{margin:0}

/* RC21: shared desktop content edges and two equally sized output columns. */
body #main .powerstation-management .powerstation-switches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px;border-top:1px solid var(--line);padding-top:4px}
body #main .powerstation-management .powerstation-switches form{min-width:0;margin:0;border:0;padding:16px 0;gap:12px}
body #main .powerstation-management .powerstation-switches form+form{border-left:1px solid var(--line);padding-left:24px}
body #main .powerstation-management .ps-toggle{flex:none;grid-template-columns:repeat(2,minmax(0,1fr));min-width:140px;border-radius:12px}
body #main .powerstation-management .ps-toggle button{width:100%;margin:0;min-height:44px;padding:8px 14px;border-radius:0;font-size:14px;line-height:1.4}
body #main .powerstation-management .ps-remove{display:flex;justify-content:flex-end}
body #main .powerstation-management [data-ps-switch-hint][hidden]{display:none!important}
@media(max-width:900px){
 body #main .powerstation-management{margin:14px 0}
 body #main .powerstation-management .powerstation-switches{grid-template-columns:minmax(0,1fr);gap:0}
 body #main .powerstation-management .powerstation-switches form+form{border-left:0;border-top:1px solid var(--line);padding-left:0}
 body #main .powerstation-management .ps-remove{justify-content:flex-start}
 /* Only an unpaired final tile spans both columns; even counts are untouched. */
 body #main #overview-page .metrics>.metric:last-child:nth-child(odd){grid-column:1/-1;text-align:center}
 body #main #overview-page .metrics>.metric:last-child:nth-child(odd) .metric-reading{justify-content:center;align-items:center;text-align:center}
 body #main #overview-page .metrics>.metric:last-child:nth-child(odd) .metric-label{text-align:left;justify-content:flex-start}
 body #main #overview-page .metrics>.metric:last-child:nth-child(odd) .metric-note{text-align:center}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .metric-reading{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto auto;gap:6px 8px;width:100%}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .metric-value{grid-column:2;grid-row:1;justify-self:center}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .powerstation-flows{display:contents}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .powerstation-flow{font-size:12px;text-align:center;align-self:center;grid-row:1}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .powerstation-flow:first-child{grid-column:1}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .powerstation-flow:last-child{grid-column:3}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .powerstation-soc-bar{grid-column:1/-1;grid-row:2;width:100%;max-width:none;margin:2px auto}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .metric-note{display:flex;justify-content:center}
}
@media(max-width:540px){.ps-reading{padding:12px 8px}.ps-reading strong{font-size:24px}}

/* RC22: titles fit the available width, with equal sizing across live tiles.
   Reserve real space for the history icon rather than breaking a single letter. */
body #main #overview-page .metrics .metric .metric-label{
 display:flex;align-items:center;min-width:0;min-height:30px;gap:5px;
 padding-inline-end:1.5rem;overflow-wrap:normal;word-break:normal;
}
body #main #overview-page .metrics .metric-label .metric-label-text{
 flex:1 1 0;min-width:0;white-space:nowrap;overflow-wrap:normal;word-break:normal;
 font-size:var(--metric-title-size,inherit);line-height:1.25;
}
body #main #overview-page .metrics .live-metric-icon{flex:0 0 clamp(20px,2vw,31px);width:clamp(20px,2vw,31px);height:clamp(20px,2vw,31px)}
body #main #overview-page .metrics .live-metric-icon svg{width:65%;height:65%}
body #main #overview-page .metrics .metric .history-trigger{inset: .45rem .35rem auto auto}
body #main #overview-page .powerstation-metric .metric-note[hidden]{display:none!important}
body #main #overview-page .powerstation-metric .metric-reading .powerstation-flows{margin-top:3px}
@media(min-width:901px){
 body #main #overview-page .metrics.metrics-powerstation .metric-label{gap:4px;padding-inline-end:20px}
 body #main #overview-page .metrics.metrics-powerstation .history-trigger{width:20px;height:20px;inset:.35rem .3rem auto auto}
 body #main #overview-page .metrics.metrics-powerstation .live-metric-icon{width:clamp(17px,1.7vw,28px);height:clamp(17px,1.7vw,28px);flex-basis:clamp(17px,1.7vw,28px)}
}
@media(max-width:900px){
 body.rc15-mobile-shell #main #overview-page .metrics .metric .metric-label{min-height:23px;padding-inline-end:17px;gap:4px}
 body #main #overview-page .metrics .metric .history-trigger{width:19px;height:19px;inset:.25rem .2rem auto auto}
 body #main #overview-page .metrics .metric .history-trigger svg{width:15px;height:15px}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .metric-reading{grid-template-rows:auto auto;gap:6px 8px}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .metric-value{grid-column:2;grid-row:1}
 body #main #overview-page .metrics>.powerstation-metric:last-child:nth-child(odd) .powerstation-flow{align-self:center;font-size:12px;grid-row:1}
}
@media(max-width:540px){
 .ps-readings .ps-soc{grid-column:1/-1;grid-row:1}
 .ps-readings .ps-reading:first-child{grid-column:1;grid-row:2}
 .ps-readings .ps-reading:last-child{grid-column:2;grid-row:2}
}

@media(min-width:901px) and (max-width:1220px){body #main #overview-page .metrics.metrics-powerstation{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:350px){
 body.rc15-mobile-shell #main #overview-page .metrics .metric .metric-label{gap:3px;padding-inline-end:14px}
 body #main #overview-page .metrics .live-metric-icon{width:15px;height:20px;flex-basis:15px}
 body #main #overview-page .metrics .metric .history-trigger{width:16px;height:16px}
}

/* RC28: setup guide and catalogue use the shared portal typography. */
.powerstation-management .ps-catalogue{margin-top:16px;padding:16px;max-width:100%;box-sizing:border-box}
.powerstation-management .ps-catalogue summary{font:inherit;font-weight:600;cursor:pointer;line-height:1.5;color:var(--ink)}
.powerstation-management .ps-catalogue h3,.powerstation-management .ps-catalogue h4{margin:16px 0 8px;font:inherit;font-weight:650}
.powerstation-management .ps-model-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:6px 20px;padding-left:20px;margin:8px 0 12px;font:inherit;overflow-wrap:anywhere}
.powerstation-management .ps-setup-steps{padding-left:22px;line-height:1.55}
.powerstation-management .ps-setup-steps li+li{margin-top:6px}
.powerstation-management .ps-setup-notice{border-top:1px solid var(--line);margin-top:16px;padding-top:12px}

/* RC35: same compact forecast in gas details and history, never on live cards. */
[data-gas-summary][hidden]{display:none!important}
.gas-consumption h4{margin:12px 0 8px;font-size:14px}
.gas-consumption .gas-runtime-values{border-bottom:1px solid var(--line);padding-bottom:10px}
#telemetry-history .gas-consumption{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:12px;box-shadow:none}
#telemetry-history .gas-consumption h3{margin:0 0 6px}
