#cabinet-touchscreen {
  display:inline-block;margin-top:10px;padding:8px 12px;border-radius:5px;
  background:#175a59;color:#fff;font-size:12px;font-weight:650
}
#cabinet-touchscreen[hidden] {display:none}
.touchscreen-focused .cabinet-heading,.touchscreen-focused .cabinet-tools,
.touchscreen-focused #cabinet-hotspots {visibility:hidden}
#touchscreen {
  --hmi-paper:#111f2b;--hmi-inset:#182b3b;--hmi-line:#375065;--hmi-muted:#a9bdca;
  --hmi-accent:#8de2d5;--hmi-text:#f3f8fc;
  position:fixed;inset:auto;margin:0;padding:0;max-width:none;max-height:none;box-sizing:border-box;
  border:1px solid #263e51;border-radius:3px;background:var(--hmi-paper);color:var(--hmi-text);
  font-family:Inter, "Microsoft YaHei", system-ui,sans-serif;font-size:13px;
}
#touchscreen[open] {display:flex;flex-direction:column;overflow:hidden;animation:hmi-appear .36s ease-out both}
@keyframes hmi-appear {from {opacity:0} to {opacity:1}}
@media(prefers-reduced-motion:reduce) {#touchscreen[open] {animation:none}}
#touchscreen::backdrop {background:transparent}
#touchscreen.expanded {inset:0;width:calc(100vw - 32px);height:calc(100dvh - 32px);margin:auto;border-radius:9px}
#touchscreen.expanded::backdrop {background:#101d2cbf}
.hmi-header {display:flex;gap:12px;align-items:center;justify-content:space-between;padding:9px 13px;border-bottom:1px solid var(--hmi-line)}
.hmi-brand {display:flex;gap:9px;align-items:center;white-space:nowrap}
#hmi-logo {object-fit:contain;width:84px;height:25px;padding:4px 7px;box-sizing:border-box;background:#f1f7fa;border-radius:3px}
#touchscreen-title,#hmi-clock {color:var(--hmi-muted)}
#hmi-identity {font-size:12px;color:var(--hmi-accent);white-space:nowrap}
.hmi-actions {display:flex;gap:5px}
#touchscreen button {
  color:var(--hmi-text);font:inherit;padding:7px 10px;min-height:34px;border-radius:4px;
  border:1px solid var(--hmi-line);background:var(--hmi-inset);cursor:pointer
}
#touchscreen button:hover {border-color:var(--hmi-accent)}
#touchscreen :focus-visible {outline:2px solid var(--hmi-accent);outline-offset:2px}
#touchscreen button:disabled {opacity:.52;cursor:default}
#touchscreen button[hidden] {display:none}
#hmi-nav {display:flex;gap:5px;padding:6px 12px;overflow:auto;flex-shrink:0;border-bottom:1px solid var(--hmi-line)}
#hmi-nav button {flex:1 0 auto;padding-inline:7px;background:transparent;border-color:transparent;white-space:nowrap}
#hmi-nav button[aria-current="page"] {background:#254750;border-color:#426269;color:#b6fbf1}
.hmi-page {flex:1;min-height:0;overflow:auto;padding:13px;container-type:inline-size}
.hmi-page h3 {font-size:17px;margin:0 0 5px}
.hmi-page p {line-height:1.45;margin:4px 0 9px;color:var(--hmi-muted)}
.hmi-metrics {display:grid;grid-template-columns:repeat(auto-fit,minmax(117px,1fr));gap:6px;margin:9px 0}
.hmi-metric {margin:0;border:1px solid var(--hmi-line);border-radius:5px;background:var(--hmi-inset);padding:9px;min-width:0}
.hmi-metric dt {font-size:11px;color:var(--hmi-muted);margin-bottom:3px}
.hmi-metric dd {font-size:20px;font-variant-numeric:tabular-nums;line-height:1.2;margin:0}
.hmi-metric small {font-size:11px;font-weight:400;color:#b6c8d1}
.hmi-flow {display:flex;flex-wrap:wrap;column-gap:9px;row-gap:4px;align-items:center;padding:8px;border-left:2px solid var(--hmi-accent);background:#193544;color:#c1eee9}
.hmi-page.hmi-home-page {container-type:size;padding:10px 13px}
.hmi-topology-view {
  --ac-wire:#7ec9f3;--dc-wire:#edb86e;--topo-wire:clamp(10px,3cqh,19px);
  max-width:1240px;margin:0 auto;display:grid;gap:clamp(6px,1.6cqh,11px);
}
.hmi-topo-heading,.hmi-topo-tools {display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.hmi-topo-heading h3 {font-size:clamp(18px,4.5cqh,28px);margin-bottom:1px}
.hmi-page .hmi-topo-heading p {margin:0;font-size:12px}
.hmi-topo-tools span::before {display:inline-block;content:"";width:14px;height:3px;margin-right:5px;vertical-align:middle;background:var(--wire)}
.hmi-topology-view .ac {--wire:var(--ac-wire)}
.hmi-topology-view .dc {--wire:var(--dc-wire)}
.hmi-schematic {padding:clamp(7px,1.75cqh,12px) clamp(8px,1.5cqw,18px);border:1px solid #334e61;border-radius:8px;background:#101e29}
.hmi-grid-entry {width:min(245px,75%);margin:auto}
.hmi-schematic-block,#touchscreen .hmi-topo-node {
  display:grid;justify-items:center;align-content:center;gap:2px;text-align:center;
  border:1px solid #425c6c;border-radius:6px;background:#182d3d;padding:4px 6px;font-size:12px;line-height:1.25;
}
.hmi-schematic-block.hmi-grid-reading {display:flex;align-items:center;gap:12px;justify-content:space-between;text-align:left;padding-inline:10px}
.hmi-grid-reading>span,.hmi-cabinet-reading {display:grid;gap:2px}
.hmi-schematic-block small,.hmi-topo-node small {font-weight:400;font-size:10px;color:#b8ced9}
.hmi-topo-power {font-size:clamp(16px,4.2cqh,24px);line-height:1.1;font-variant-numeric:tabular-nums;white-space:nowrap}
.hmi-breaker {height:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--ac-wire)}
.hmi-breaker i {width:5px;height:5px;border:1px solid currentColor;border-radius:50%}
.hmi-breaker b {width:1px;height:6px;background:currentColor}
.hmi-breaker.open {color:#f3a078}
.hmi-breaker.open b {transform:rotate(-48deg);transform-origin:bottom}
.hmi-topo-rail {display:flex;justify-content:space-between;gap:6px;align-items:center;border-block:1px solid var(--wire);padding:3px 9px;color:var(--wire);background:#182936;font-size:11px}
.hmi-topo-rail.ac:not(.live) {border-color:#607382;color:#abbbc5}
.hmi-topo-branches {display:grid;grid-template-columns:minmax(98px,1fr) minmax(0,3.7fr) minmax(116px,1fr);gap:clamp(7px,1.6cqw,18px)}
.hmi-side-branch,.hmi-hybrid-branch {min-width:0}
.hmi-hybrid-branch>.hmi-schematic-block {max-width:154px;margin:auto}
.hmi-mobile-feeders {display:none}
.hmi-wire {position:relative;width:3px;height:var(--topo-wire);background:#405261;margin:auto}
.hmi-wire.live {background:repeating-linear-gradient(to bottom,var(--wire) 0 5px, #324d60 5px 11px);animation:hmi-wire-down .7s linear infinite}
.hmi-wire.live[data-direction="up"] {animation-direction:reverse}
.hmi-wire.live::after {content:"";position:absolute;left:-3px;bottom:0;border-inline:4.5px solid transparent;border-top:5px solid var(--wire)}
.hmi-wire.live[data-direction="up"]::after {top:0;bottom:auto;transform:rotate(180deg)}
@keyframes hmi-wire-down {to {background-position:0 11px}}
.hmi-topology-view.paused .hmi-wire.live {animation-play-state:paused}
.hmi-dc-devices {display:grid;grid-template-columns:repeat(var(--dc-columns),minmax(0,1fr));gap:6px}
.hmi-hybrid-branch[data-cabinets="1"]>.hmi-topo-rail,
.hmi-hybrid-branch[data-cabinets="1"]>.hmi-dc-devices {max-width:480px;margin-inline:auto}
.hmi-topo-cabinet,.hmi-topo-solar-path {min-width:0}
.hmi-topo-node img {display:block;width:100%;height:clamp(28px,8cqh,54px);object-fit:contain}
#touchscreen .hmi-topo-node {width:100%;color:#eff7fc;min-height:0}
#touchscreen .hmi-topo-cabinet .hmi-topo-node {
  grid-template-columns:minmax(28px,44px) minmax(0,1fr);gap:5px;align-items:center;
  text-align:left;justify-items:start;min-height:58px;
}
@container(min-width:681px) {
  #touchscreen .hmi-hybrid-branch[data-cabinets="1"] .hmi-topo-cabinet .hmi-topo-node {
    grid-template-columns:minmax(28px,44px) max-content;justify-content:center;gap:8px;
  }
}
#touchscreen .hmi-topo-node:hover {border-color:var(--hmi-accent)}
#touchscreen .hmi-topo-node.current {border-top:2px solid var(--hmi-accent)}
.hmi-topo-solar-path .hmi-schematic-block {font-size:11px}
#touchscreen .hmi-topo-solar-path .hmi-topo-node {grid-template-columns:auto auto;justify-content:center;align-items:center}
.hmi-topo-solar-path .hmi-topo-node small {grid-column:1/-1}
.hmi-solar-icon {width:22px;height:13px;background:repeating-linear-gradient(90deg,transparent 0 6px,#87aacb 6px 7px),repeating-linear-gradient(0deg,#244b72 0 5px,#87aacb 5px 6px);border:1px solid #9dbcda;transform:skew(-12deg)}
.hmi-page .hmi-topo-note {font-size:11px;margin:0}
.hmi-topo-summary .hmi-metrics {
  margin:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;
  border-block:1px solid var(--hmi-line);background:#142430;
}
.hmi-topo-summary .hmi-metric {border:0;border-radius:0;background:transparent;padding:6px 9px}
.hmi-topo-summary .hmi-metric + .hmi-metric {border-left:1px solid var(--hmi-line)}
.hmi-topo-summary .hmi-metric dd {font-size:clamp(15px,3.9cqh,22px)}
@container (min-width:681px) and (max-height:455px) {
  .hmi-topology-view {
    --topo-wire:9px;grid-template-columns:minmax(0,1fr) minmax(108px,15%);
    grid-template-areas:"heading heading" "diagram summary" "diagram note";
    grid-template-rows:auto auto 1fr;gap:6px 9px;align-items:start;
  }
  .hmi-topo-heading {grid-area:heading}
  .hmi-schematic {grid-area:diagram;padding-block:6px}
  .hmi-topo-summary {grid-area:summary}
  .hmi-page .hmi-topo-note {grid-area:note}
  .hmi-topo-summary .hmi-metrics {grid-template-columns:1fr}
  .hmi-topo-summary .hmi-metric {padding-block:4px}
  .hmi-topo-summary .hmi-metric + .hmi-metric {border:0;border-top:1px solid var(--hmi-line)}
  #touchscreen .hmi-topo-cabinet .hmi-topo-node {min-height:49px}
  #touchscreen .hmi-hybrid-branch[data-cabinets="3"] .hmi-topo-cabinet .hmi-topo-node {
    grid-template-columns:25px minmax(0,1fr);gap:3px;padding-inline:3px;font-size:11px;
  }
}
@container(max-width:680px) {
  .hmi-topo-branches {grid-template-columns:repeat(2,minmax(0,1fr));column-gap:8px;row-gap:0;align-items:start}
  .hmi-hybrid-branch {grid-column:1/-1;grid-row:1}
  .hmi-mobile-feeders {display:flex;grid-column:1/-1;grid-row:2;margin-top:10px}
  .hmi-site-branch {grid-column:1;grid-row:3}
  .hmi-charging-branch {grid-column:2;grid-row:3}
  .hmi-dc-devices {gap:4px}
  #touchscreen .hmi-topo-cabinet .hmi-topo-node {grid-template-columns:1fr;text-align:center;justify-items:center;gap:2px;padding-inline:3px}
  .hmi-topo-node img {width:auto;max-width:100%;height:29px}
  .hmi-topo-power {font-size:16px}
}
@container(max-width:410px) {
  .hmi-topo-summary .hmi-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  .hmi-topo-summary .hmi-metric:nth-child(3) {border-left:0}
  .hmi-topo-summary .hmi-metric:nth-child(n+3) {border-top:1px solid var(--hmi-line)}
  #touchscreen .hmi-topo-solar-path .hmi-topo-node {grid-template-columns:1fr}
  .hmi-cabinet-reading>span {overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce) {
  .hmi-wire.live {animation:none}
}
.hmi-cards {display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:7px;margin:10px 0}
.hmi-card {text-align:left}
.hmi-card strong,.hmi-card span {display:block;margin-block:3px}
.hmi-card span {color:var(--hmi-muted);font-size:11px}
.hmi-footer {display:flex;justify-content:space-between;align-items:center;gap:9px;padding:6px 13px;font-size:11px;border-top:1px solid var(--hmi-line)}
#hmi-status {color:var(--hmi-accent)}
#touchscreen .hmi-primary {background:var(--hmi-accent);color:#132e32;border-color:transparent;font-weight:670}
.hmi-manual {display:grid;grid-template-columns:112px minmax(0,1fr);gap:15px;max-width:1120px;margin:auto}
.hmi-manual-nav {display:grid;gap:6px;align-content:start}
#touchscreen .hmi-manual-nav button {text-align:left}
#touchscreen button[aria-current="page"],#touchscreen .hmi-choice-group button[aria-pressed="true"] {background:#25505a;border-color:#668e90;color:#d0f6ee}
.hmi-choice-group {display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-block:9px}
.hmi-manual-wiring {border:1px solid var(--hmi-line);border-radius:7px;padding:12px;background:#122330}
.hmi-manual-wiring ul {margin:8px 0 0;padding-left:16px;line-height:1.8;color:#c5e8ed}
.hmi-manual-policies {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(7px,1.4vmin,16px)}
#touchscreen .hmi-manual-policies button {display:grid;align-content:center;gap:6px;min-height:72px;text-align:left;padding:10px}
.hmi-manual-policies small {color:var(--hmi-muted)}
.hmi-manual-fields {display:grid;gap:8px;grid-template-columns:repeat(auto-fit,minmax(132px,1fr))}
.hmi-manual-fields label {display:grid;gap:3px}
.hmi-manual-fields .hmi-rule-toggle,.hmi-manual-fields p {grid-column:1/-1}
.hmi-manual-fields .hmi-rule-toggle {display:flex;gap:7px}
.hmi-manual-fields small {color:var(--hmi-muted)}
.hmi-manual-fields fieldset {border:1px solid var(--hmi-line);border-radius:5px;min-width:0}
.hmi-manual-fields input[type="number"],#hmi-alarm-form input {
  font:inherit;width:100%;min-height:34px;padding:3px 7px;box-sizing:border-box;color:var(--hmi-text);background:#0e1b25;border:1px solid #708799;border-radius:4px
}
.hmi-points {display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:8px;margin-block:12px}
.hmi-points input,.hmi-rule-toggle input {accent-color:var(--hmi-accent)}
#hmi-alarm-form input {width:58px}
@container(max-width:540px) {
  .hmi-manual {grid-template-columns:1fr}
  .hmi-manual-nav {grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
  #touchscreen .hmi-manual-nav button {text-align:center;padding-inline:3px;overflow-wrap:anywhere}
  #touchscreen .hmi-manual-policies button {padding:7px 5px}
}
.hmi-table {width:100%;border-collapse:collapse;text-align:left;font-size:12px}
.hmi-table th,.hmi-table td {padding:7px 5px;border-bottom:1px solid var(--hmi-line)}
.hmi-table th {color:var(--hmi-muted);font-weight:500}
.hmi-storage {
  max-width:1540px;margin:0 auto;display:grid;gap:clamp(10px,1.8vmin,22px);color:#f3f8fc;
  --hmi-line:#344b5b;--hmi-inset:#162937;
}
.hmi-storage-heading,.hmi-analysis-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.hmi-storage-heading h3 {font-size:clamp(20px,3vmin,31px);letter-spacing:-.025em}
.hmi-storage-heading p,.hmi-analysis p {margin:0}
.hmi-storage-actions,.hmi-trend-switch {display:flex;gap:6px;align-items:center;flex-wrap:wrap}
#touchscreen .hmi-alarm-active {border-color:#906b39;color:#ffd6a2;background:#362c25}
.hmi-storage-actions b {margin-left:4px;font-variant-numeric:tabular-nums}
.hmi-storage .hmi-metrics {margin:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-block:1px solid var(--hmi-line)}
.hmi-storage .hmi-metric {background:transparent;border:0;border-radius:0;padding:clamp(9px,1.4vmin,18px)}
.hmi-storage .hmi-metric + .hmi-metric {border-left:1px solid var(--hmi-line)}
.hmi-storage .hmi-metric dt {font-size:clamp(11px,1.45vmin,14px)}
.hmi-storage .hmi-metric dd {font-size:clamp(21px,3.6vmin,40px);font-weight:650;letter-spacing:-.035em}
.hmi-storage-grid {display:grid;grid-template-columns:minmax(0,1.95fr) minmax(260px,1fr);gap:14px;align-items:start}
.hmi-simulation .hmi-storage-grid {grid-template-columns:minmax(0,1.65fr) minmax(265px,1fr)}
.hmi-simulation>.hmi-metrics .hmi-metric {padding:7px 9px}
.hmi-simulation>.hmi-metrics .hmi-metric dd {font-size:clamp(20px,3vmin,31px)}
.hmi-simulation #hmi-trend {height:clamp(135px,17dvh,205px)}
#touchscreen.expanded .hmi-simulation #hmi-trend {height:clamp(155px,23dvh,285px)}
.hmi-sim-sample {min-width:0}
.hmi-sim-sample h4 {margin:0 0 6px;font-size:14px}
.hmi-sim-sample .hmi-metrics {border:0;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.hmi-sim-sample .hmi-metric {border:1px solid var(--hmi-line);border-radius:5px;padding:6px 7px}
.hmi-sim-sample .hmi-metric dd {font-size:19px}
#touchscreen .hmi-device-row {
  display:grid;grid-template-columns:1fr auto;width:100%;min-height:30px;margin-top:5px;
  padding:4px 8px;gap:4px;text-align:left;align-items:center;
}
.hmi-device-row small {color:var(--hmi-muted)}
.hmi-device-row strong {font-variant-numeric:tabular-nums}
.hmi-sim-sample .hmi-device-row[data-power="active"] strong {color:var(--hmi-accent)}
@container (max-width:700px) {.hmi-simulation .hmi-storage-grid {grid-template-columns:1fr}}
@container (max-width:740px) {.hmi-simulation .hmi-sim-sample {grid-row:auto}}
.hmi-analysis,.hmi-fleet {background:#122330;border:1px solid var(--hmi-line);border-radius:8px;padding:clamp(10px,1.4vmin,19px);min-width:0}
.hmi-analysis h4,.hmi-fleet h4 {font-size:clamp(15px,1.85vmin,19px);margin:0;font-weight:650}
.hmi-analysis>p {margin-top:7px;font-size:12px}
#touchscreen .hmi-trend-switch button[aria-pressed="true"] {background:#25505a;color:#c4f7ed;border-color:#668e90}
#hmi-trend {display:block;width:100%;height:clamp(166px,27dvh,330px);margin-top:10px;background:#101e29;border-radius:5px}
.hmi-trend-empty {min-height:150px;display:grid;place-items:center;color:var(--hmi-muted)}
.hmi-scrub {display:grid;grid-template-columns:auto minmax(70px,1fr);gap:13px;align-items:center;margin:9px 2px;color:var(--hmi-muted)}
.hmi-scrub input {width:100%;margin:0;accent-color:var(--hmi-accent)}
.hmi-trend-values {display:flex;flex-wrap:wrap;gap:5px 12px;padding-top:8px;border-top:1px solid var(--hmi-line);color:var(--hmi-muted);font-size:12px}
.hmi-trend-values strong,.hmi-trend-values b {color:var(--hmi-text);font-variant-numeric:tabular-nums}
.hmi-trend-values i {display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}
.hmi-fleet h4 {display:flex;justify-content:space-between;align-items:center}
.hmi-fleet h4 span {font-size:13px;color:var(--hmi-muted);font-variant-numeric:tabular-nums}
#touchscreen .hmi-fleet-row {
  margin-top:9px;display:grid;grid-template-columns:70px minmax(0,1fr);gap:11px;align-items:center;
  width:100%;min-height:82px;text-align:left;background:#182e3e;border-color:#3d5666;padding:8px 11px 8px 6px;
}
#touchscreen .hmi-fleet-row.local {border-left:3px solid var(--hmi-accent)}
.hmi-fleet-row img {width:100%;height:62px;object-fit:contain;filter:drop-shadow(0 3px 2px #0007)}
.hmi-fleet-data {display:block;min-width:0}
.hmi-fleet-data>strong,.hmi-fleet-data>span {display:block;margin-bottom:3px}
.hmi-fleet-data>span {color:var(--hmi-muted);font-size:12px}
.hmi-soc-label {display:flex;justify-content:space-between;align-items:center;gap:8px;margin:4px 0;color:var(--hmi-muted)}
.hmi-fleet-data>.hmi-soc-label {display:flex}
.hmi-soc-label strong,.hmi-soc-label b {color:var(--hmi-accent);font-variant-numeric:tabular-nums}
.hmi-storage meter {display:block;width:100%;height:7px}
.hmi-storage meter::-webkit-meter-bar {background:#2f4859;border:0;border-radius:4px}
.hmi-storage meter::-webkit-meter-optimum-value {background:#7ddacb;border-radius:4px}
.hmi-fleet>p {font-size:11px;margin:10px 0 0}
.hmi-device-layout {display:grid;grid-template-columns: minmax(150px,1fr) minmax(0,2.2fr);gap:16px}
.hmi-device-photo {display:grid;justify-items:center;align-content:center;gap:7px;padding:10px;border:1px solid var(--hmi-line);border-radius:8px;background:#182e3e}
.hmi-device-photo img {width:100%;max-width:270px}
.hmi-device-photo span {font-size:12px;color:var(--hmi-muted);text-align:center}
.hmi-device .hmi-metrics {grid-template-columns:repeat(3,minmax(0,1fr));margin:9px 0 15px}
@media(min-width:851px) {
  #touchscreen.expanded .hmi-page {padding:clamp(18px,3.2vmin,42px) clamp(22px,4vw,72px)}
}
@container(max-width:700px) {
  .hmi-storage-grid {grid-template-columns:1fr}
  .hmi-fleet {grid-row:1}
}
@container(max-width:490px) {
  .hmi-storage .hmi-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  .hmi-storage .hmi-metric:nth-child(odd) {border-left:0}
  .hmi-storage .hmi-metric:nth-child(n+3) {border-top:1px solid var(--hmi-line)}
  .hmi-device-layout {grid-template-columns:minmax(0,1fr)}
  .hmi-device-photo img {max-width:180px}
}
@media(max-width:850px) {
  #touchscreen.expanded {width:100vw;height:100dvh;border-radius:0}
  #touchscreen button {min-height:44px}
  #touchscreen .hmi-device-row {min-height:42px}
}
@media(max-width:530px) {
  .hmi-header {flex-wrap:wrap;gap:6px;padding:8px 10px}
  #hmi-identity {order:3;width:100%}
  .hmi-page {padding:10px}
}
/* The instrument face matches the native 1024 × 600 display. */
.touchscreen-focused.cabinet-mode {--cabinet-rail:0px}
.touchscreen-focused .cabinet-card {display:none}
.touchscreen-focused.cabinet-mode #viewport {inset:0}
#touchscreen[open] {overflow:visible;animation:none;border:0;background:transparent}
#touchscreen.expanded {
  width:min(calc(100vw - 28px),calc((100dvh - 106px) * 1024 / 600),1240px);
  height:auto;aspect-ratio:1024 / 600;
}
.hmi-screen-shell {width:100%;height:100%;overflow:hidden;background:#eaf2f5}
#hmi-home-face {display:none;position:relative;width:100%;height:100%}
.hmi-showing-home #hmi-home-face {display:block}
#hmi-home-face canvas {display:block;width:100%;height:100%}
#hmi-mobile-home {display:none}
#hmi-hit-targets,#hmi-mobile-targets {position:absolute;inset:0}
#touchscreen :is(#hmi-hit-targets,#hmi-mobile-targets) button {
  position:absolute;min-height:0;min-width:0;padding:0;
  border:1px solid transparent;background:transparent;border-radius:5px;
}
#touchscreen :is(#hmi-hit-targets,#hmi-mobile-targets) button:focus-visible {outline:2px solid #167a77;outline-offset:-3px}
@media (hover:hover) {
  #touchscreen :is(#hmi-hit-targets,#hmi-mobile-targets) button:hover {background:#15786c0c;border-color:#83aaa7}
}
.hmi-sr {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.hmi-viewer-tools {
  position:absolute;z-index:2;bottom:calc(100% + 9px);left:0;right:0;
  display:flex;align-items:center;gap:5px;flex-wrap:wrap;
  color:#edf5f8;
}
.hmi-viewer-spacer {flex:1}
#touchscreen .hmi-viewer-tools button {
  min-height:31px;background:#263b4a;border-color:#5e7887;color:#f4fbfd;
  padding:4px 9px;white-space:nowrap;
}
#touchscreen .hmi-viewer-tools button:hover {background:#346071}
#hmi-demo {
  position:absolute;left:0;top:calc(100% + 5px);max-width:min(400px,100%);
  background:#172a36;border:1px solid #627d8a;border-radius:5px;padding:7px;
  box-shadow:0 12px 24px #12273740;
}
#hmi-demo:not([hidden]) {display:flex;gap:5px;flex-wrap:wrap}
#touchscreen #hmi-demo button[aria-pressed="true"] {background:#146961}

.hmi-tab-screen {
  --hmi-paper:#edf5f7;--hmi-inset:#f9fcfd;--hmi-line:#b7cdd9;
  --hmi-muted:#4b6679;--hmi-accent:#14736d;--hmi-text:#183449;
  flex:1;min-height:0;height:100%;display:flex;flex-direction:column;
  color:var(--hmi-text);background:var(--hmi-paper);
}
.hmi-showing-home .hmi-tab-screen {display:none}
.hmi-tab-screen .hmi-header,.hmi-tab-screen .hmi-footer,.hmi-tab-screen #hmi-nav {background:#f9fcfd}
.hmi-tab-screen .hmi-metric small,.hmi-tab-screen .hmi-soc-label {color:var(--hmi-muted)}
.hmi-tab-screen .hmi-storage {color:var(--hmi-text);--hmi-line:inherit;--hmi-inset:inherit}
.hmi-tab-screen .hmi-flow {background:#d5ebe9;color:#185c59}
#touchscreen .hmi-tab-screen button[aria-current="page"],
#touchscreen .hmi-tab-screen button[aria-pressed="true"] {background:#d5eaed;color:#175d62;border-color:#98bac4}
#touchscreen .hmi-tab-screen .hmi-primary {color:#fff}
#touchscreen .hmi-tab-screen .hmi-fleet-row,
#touchscreen .hmi-tab-screen .hmi-device-row {color:var(--hmi-text);background:var(--hmi-inset)}
#touchscreen .hmi-tab-screen .hmi-fleet-row.local {border-left-color:#14736d}
.hmi-tab-screen .hmi-device-photo,.hmi-tab-screen .hmi-analysis,.hmi-tab-screen .hmi-fleet {background:var(--hmi-inset)}
.hmi-tab-screen #hmi-trend {background:#ecf3f6}
.hmi-tab-screen .hmi-manual-wiring {background:var(--hmi-inset)}
.hmi-tab-screen .hmi-manual-wiring ul {color:var(--hmi-text)}
.hmi-tab-screen .hmi-manual-fields input[type="number"],.hmi-tab-screen #hmi-alarm-form input {background:#fff}
.hmi-tab-screen .hmi-storage meter::-webkit-meter-bar {background:#d8e6ea}
.hmi-tab-screen .hmi-storage meter::-webkit-meter-optimum-value {background:#168175}
.hmi-gun {padding:8px 0;border-top:1px solid var(--hmi-line)}
.hmi-gun .hmi-metrics {margin:4px 0}
.hmi-gun .hmi-metric {padding:5px}
.hmi-gun .hmi-metric dd {font-size:15px}

@media(max-width:850px) {
  .touchscreen-focused.cabinet-mode #viewport {height:100dvh}
  #touchscreen.expanded {width:calc(100vw - 16px)}
  #touchscreen.expanded:not(.hmi-showing-home) {height:calc(100dvh - 120px);aspect-ratio:auto}
  #touchscreen .hmi-viewer-tools button {min-height:42px}
  #hmi-hit-targets {touch-action:manipulation}
}
@media(max-width:560px) {
  #show-battery {display:inline-block;min-height:40px;pointer-events:auto;text-align:left}
  #touchscreen.expanded.hmi-showing-home {aspect-ratio:auto;height:auto;max-height:calc(100dvh - 132px)}
  .hmi-showing-home .hmi-screen-shell {overflow:auto}
  .hmi-showing-home #hmi-home-face {display:none}
  .hmi-showing-home #hmi-mobile-home {display:block;position:relative;aspect-ratio:400 / 566;width:100%}
  #hmi-mobile-home canvas {width:100%;height:100%;display:block}
}
