/* Outside .prototype and in the native dialog top layer: no 560px phone limit. */
.volts-chart-expand,.volts-chart-back,.volts-chart-control {
  flex-shrink:0;min-width:44px;min-height:44px;border:1px solid #344751;
  border-radius:12px;background:#17252d;color:#d6e2f2;padding:8px;
  display:grid;place-items:center;cursor:pointer;touch-action:manipulation;
}
.volts-chart-expand { align-self:flex-start;margin-left:2px; }
.volts-chart-expand svg,.volts-chart-back svg {
  width:20px;height:20px;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;fill:none;
}
.volts-chart-expand:focus-visible,.volts-chart-viewer button:focus-visible,
.volts-chart-viewer input:focus-visible { outline:2px solid #94b5ff;outline-offset:3px; }
.volts-chart-viewer {
  position:fixed;inset:0;margin:0;width:100%;height:100vh;height:100dvh;
  max-width:none;max-height:none;border:0;border-radius:0;background:#0d151a;
  color:#f6f8ff;padding:12px;z-index:1000;overflow:auto;
  padding-top:max(12px,env(safe-area-inset-top,0px));
  padding-bottom:max(12px,env(safe-area-inset-bottom,0px));
  padding-left:max(12px,env(safe-area-inset-left,0px));
  padding-right:max(12px,env(safe-area-inset-right,0px));
  font-family:inherit;
}
.volts-chart-viewer:not([open]) { display:none; }
.volts-chart-viewer[open] { display:flex;flex-direction:column;gap:10px; }
.volts-chart-viewer::backdrop { background:#0d151a; }
.volts-chart-open { overflow:hidden; }
.volts-chart-toolbar { display:flex;align-items:center;gap:12px;flex-shrink:0; }
.volts-chart-title { min-width:0;flex:1;line-height:1.35; }
.volts-chart-title strong { display:block;font-size:16px; }
.volts-chart-title span { display:block;font-size:12px;color:#98aabd; }
.volts-chart-zooms { display:flex;gap:5px; }
.volts-chart-control { font-size:13px; }
.volts-chart-control.selected { color:#fff;border-color:#778ff0;background:#3f4ea0; }
.volts-chart-rotate { color:#98aabd;font-size:12px;line-height:1.5;margin:0; }
.volts-chart-viewer .volts-chart-expanded {
  flex:1;min-height:0;display:flex;flex-direction:column;margin:0;
  padding:14px 12px;overflow:visible;box-shadow:none;
}
.volts-chart-viewer .volts-chart-expanded .chart-head { flex-shrink:0;margin-bottom:14px; }
.volts-chart-viewer .volts-chart-expanded .chart-head>div:first-child { min-width:0; }
.volts-chart-viewer .volts-chart-expanded .chart-head h2 { font-size:16px; }
.volts-chart-viewer .volts-chart-expanded .volts-chart-expand { display:none; }
.volts-chart-scroll { flex:1;min-height:180px;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;scrollbar-color:#536bb2 #132029; }
.volts-chart-canvas { width:100%;height:100%;min-height:180px;display:flex;flex-direction:column; }
.volts-chart-viewer .volts-chart-canvas .plot {
  flex:1;min-height:145px;height:auto;margin-left:42px;
  background:repeating-linear-gradient(to top,transparent 0 44px,#3445504a 45px);
}
.volts-chart-viewer .volts-chart-canvas .plot-labels span { left:-39px;font-size:11px; }
.volts-chart-viewer .volts-chart-canvas .x-labels { margin-left:42px;flex-shrink:0;min-height:20px; }
.volts-chart-viewer .line,.volts-chart-viewer .voltage-limit { vector-effect:non-scaling-stroke; }
.volts-chart-viewer .chart-tooltip { transition:none;max-width:min(95%,420px);white-space:normal;text-align:left; }
.volts-chart-viewer .chart-tooltip span { font-size:12px;line-height:1.45; }
.volts-chart-viewer .chart-legend { flex-shrink:0;margin-top:10px; }
.volts-chart-viewer .phase-pills { flex-shrink:0;margin-top:10px; }
.volts-chart-viewer .phase-pills button { min-height:44px; }
.volts-chart-viewer .chart-help { flex-shrink:0;margin:8px 0 0;line-height:1.45;font-size:11px; }
.volts-chart-pan { display:flex;align-items:center;gap:12px;flex-shrink:0;color:#b8c8dc;font-size:12px;min-height:28px; }
.volts-chart-pan[hidden] { display:none; }
.volts-chart-pan input { width:100%;min-width:80px;flex:1;accent-color:#8297ff; }
@media(orientation:landscape) {
  .volts-chart-viewer .volts-chart-rotate { display:none; }
  .volts-chart-viewer[open] { gap:6px; }
  .volts-chart-viewer .volts-chart-expanded { padding:10px 12px; }
  .volts-chart-viewer .volts-chart-expanded .chart-head { margin-bottom:8px; }
  .volts-chart-viewer .chart-legend { margin-top:6px; }
  .volts-chart-viewer .phase-pills { margin-top:6px; }
  .volts-chart-viewer .chart-help { margin-top:4px; }
}
@media(max-height:390px) and (orientation:landscape) {
  .volts-chart-viewer .volts-chart-expanded { flex:none;min-height:265px; }
  .volts-chart-viewer .chart-head p,.volts-chart-viewer .chart-value small { display:none; }
}
@media(max-width:380px) {
  .volts-chart-toolbar { gap:8px; }
  .volts-chart-title strong { font-size:14px; }
  .volts-chart-control { min-width:38px;padding:6px; }
}
