/* Shared graph-space switch. The pill contains a visual sliding thumb and
   remains reachable even when the equation panel takes zero screen width. */
.equation-panel-toggle {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--border, var(--stroke));
  border-radius: 999px;
  background: var(--panel-solid, var(--panel));
  color: var(--text);
  box-shadow: var(--shadow-sm, var(--shadow));
  font: 750 12px/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.equation-panel-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.panel-toggle-track {
  display: inline-flex;
  align-items: center;
  width: 34px;
  height: 21px;
  border-radius: 12px;
  background: var(--accent);
  padding: 3px;
  transition: background 160ms ease;
}
.panel-toggle-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transform: translateX(13px);
  transition: transform 160ms ease;
}
.equation-panel-toggle[aria-checked="false"] .panel-toggle-track {background: var(--muted);}
.equation-panel-toggle[aria-checked="false"] .panel-toggle-thumb {transform: translateX(0);}

.graph-stage > .equation-panel-toggle {left: 166px;}
@media(min-width:841px) {
  .graph-app.equation-panel-collapsed {grid-template-columns: 0 minmax(0,1fr);}
  .graph-app.equation-panel-collapsed > .sidebar {visibility: hidden; pointer-events:none;}
}
@media(max-width:840px) {
  .graph-stage > .equation-panel-toggle {top:10px;left:152px;min-height:44px;}
}
@media(max-width:340px) {
  .graph-stage > .equation-panel-toggle {left:auto;right:10px;width:44px;justify-content:center;padding:6px;}
  .graph-stage > .equation-panel-toggle .panel-toggle-label {display:none;}
}
@media(prefers-reduced-motion:reduce) {
  .panel-toggle-track,.panel-toggle-thumb {transition:none;}
}
