/* EOS fitting control panel (docs/ui/EOSPanel.js). Reuses the app's
   .control-group / toggle_row tokens; only the pieces unique to this panel
   (drop zones, result table, status lines) are defined here. */

.eos-group-label {
  display: block;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-md);
  color: var(--muted-fg);
}

/* Energy/Pressure/Volume selectors stacked one per row, rather than run
   together inline — each row's label has a fixed width so the selects line
   up under one another. */
.eos-unit-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.eos-unit-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.eos-unit-row label {
  flex: 0 0 60px;
  font-size: var(--fs-base);
  color: var(--muted-fg);
}

.eos-unit-row select {
  flex: 1;
  background: var(--input-bg);
  color: var(--panel-fg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 3px var(--sp-2);
}

.eos-pyodide-status {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted-fg);
}

.eos-drop-zone {
  border: 2px dashed var(--panel-border);
  border-radius: var(--radius-md);
  padding: 18px var(--sp-4);
  text-align: center;
  cursor: pointer;
  color: var(--muted-fg);
  font-size: var(--fs-md);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.eos-drop-zone:hover {
  background: var(--wash-0);
}

.eos-drop-zone.highlight {
  border-color: var(--highlight-color, var(--info));
  background: var(--wash-1-5);
}

.eos-drop-zone-ref {
  padding: var(--sp-4);
}

.eos-primary-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-3);
}

.eos-pane-btn {
  background: var(--input-bg);
  color: var(--panel-fg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 2px var(--sp-3);
  cursor: pointer;
  font-size: var(--fs-md);
}

.eos-pane-btn:hover {
  background: var(--wash-2);
}

/* Seldom-needed sections are collapsible (<details>/<summary>) and start
   closed. The summary follows the quiet collapse-header idiom of the
   Backend/Atomistic panels (backendPanel.css .atomistic-collapse-toggle):
   a caret plus bold accent-toned title on a transparent background — no
   filled strip — with the caret rotating on expand. Also reused by the
   Color panel's Advanced tracer section. */
.eos-collapsible-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--fg-85);
}

.eos-collapsible-summary::-webkit-details-marker {
  display: none;
}

.eos-collapsible-arrow {
  display: inline-block;
  font-size: var(--fs-sm);
  color: inherit;
  transition: transform 0.15s ease;
}

.eos-collapsible[open] .eos-collapsible-arrow {
  transform: rotate(90deg);
}

.eos-collapsible-body {
  padding: var(--sp-3) 0 0;
}

.eos-ref-divisor-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--fs-base);
  color: var(--muted-fg);
}

.eos-ref-divisor-row input[type="number"] {
  width: 70px;
  background: var(--input-bg);
  color: var(--panel-fg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 3px var(--sp-2);
}

.eos-column-info {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted-fg);
  line-height: var(--lh-normal);
}

.eos-status-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.eos-status-group .eos-pyodide-status {
  margin-top: 0;
}

.eos-status {
  font-size: var(--fs-base);
  color: var(--muted-fg);
  min-height: 1.2em;
  margin: var(--sp-1) 0;
}

.eos-copy-value {
  cursor: pointer;
  border-radius: var(--radius-4);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.eos-copy-value:hover {
  background: var(--wash-2);
}

.eos-copy-value.eos-copied {
  background: rgba(46, 204, 113, 0.25);
  color: #2ecc71;
}

.eos-result-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-3) 0;
  font-size: var(--fs-md);
}

.eos-result-table th,
.eos-result-table td {
  border: 1px solid var(--panel-border);
  padding: 5px var(--sp-3);
  text-align: left;
}

.eos-result-table th {
  background: var(--wash-1-5);
  font-weight: var(--fw-medium);
}

.eos-fit-stats {
  font-size: var(--fs-sm);
  color: var(--muted-fg);
  line-height: 1.6;
  margin-bottom: var(--sp-3-5);
}

.eos-results h4 {
  margin: var(--sp-4) 0 var(--sp-1) 0;
  font-size: var(--fs-md);
}

.eos-results h4:first-child {
  margin-top: 0;
}

/* EOS-specific plot-card content: the P-V plot's "Show Error Plots" mini
   toggle. Generic card chrome (including plot div sizing, via
   .split-item-body) lives in sideDock.css. */

/* Docked to the bottom, the pane is wide and short — lay the E-V and P-V
   plots out side by side instead of stacked so each keeps useful height.
   Only the container's axis flips; each .split-item's own layout (title,
   buttons, toggle) is untouched. Scoped to side-docked windows: a floating
   or main-docked plots window keeps its stacked layout regardless of where
   the dock happens to sit. */
#viewArea.split-dock-bottom .cv-panel.cv-side-docked .cv-plot-stack {
  flex-direction: row;
}

#viewArea.split-dock-bottom .cv-panel.cv-side-docked .cv-plot-stack .split-item {
  min-width: 0; /* let the two plots actually shrink to share the row */
}

/* P-V plot only: a mini "Show Error Plots" toggle on the left (empty space
   there), action buttons kept on the right. */
.eos-plot-actions-split {
  justify-content: space-between;
  align-items: center;
}

.eos-plot-actions-right {
  display: flex;
  gap: var(--sp-2);
}

/* Reuses the app's .toggle_switch/.toggle_slider tokens (toggle_styles.css)
   rather than a plain checkbox, scaled down to fit this corner. */
.eos-mini-toggle.toggle_container {
  margin: 0;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--muted-fg);
}

.eos-mini-toggle .toggle_switch {
  width: 26px;
  height: 14px;
}

.eos-mini-toggle .toggle_slider::before {
  width: 10px;
  height: 10px;
  left: 2px;
  top: 2px;
}

.eos-mini-toggle .toggle_switch input:checked + .toggle_slider::before {
  transform: translateX(12px);
}

/* The expanded (fullscreen) view has far more room — scale the mini toggle
   up to match the bigger action buttons/fonts used there (full size, same
   as the toggle's other uses in the app). */
.split-item.expanded .eos-mini-toggle.toggle_container {
  font-size: var(--fs-lg);
  gap: var(--sp-3);
}

.split-item.expanded .eos-mini-toggle .toggle_switch {
  width: 46px;
  height: 24px;
}

.split-item.expanded .eos-mini-toggle .toggle_slider::before {
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
}

.split-item.expanded .eos-mini-toggle .toggle_switch input:checked + .toggle_slider::before {
  transform: translateX(22px);
}
