/* ============================================================================
 * learn_equations.css — Door 3 6-Family Equation Atlas & Interactive Curve Tabs (<= 165 lines)
 * Shares Quiet UI 4-theme tokens.css & .chem-tab-strip single-row underline geometry.
 * ============================================================================ */

html[data-view="equations"] body #whitepaperMain,
html[data-view="equations"] body #tocSidebar,
html[data-view="equations"] body #codeDrawer,
html[data-view="equations"] body .portal-home-mount,
html[data-view="equations"] body #chemWorkspaceMount,
html[data-view="equations"] body #workspaceMount,
html[data-view="equations"] body .left-rail-backdrop,
html[data-view="equations"] body #btnToggleTocSidebar,
html[data-view="equations"] body #btnToggleCodeDrawer,
html[data-view="equations"] body #btnToggleReviewMode,
html[data-view="equations"] body .pub-masthead .top-quick-search-wrap { display: none; }
html[data-view="equations"] body #pubWorkspace {
  display: flex; flex-direction: column; padding: 0; margin: 0; max-width: none; height: calc(100vh - 46px); overflow: hidden;
}

#equationsWorkspaceMount { display: none; }
html[data-view="equations"] body #equationsWorkspaceMount {
  display: flex; flex-direction: column; width: 100%; height: calc(100vh - 46px);
  overflow: hidden; background: var(--bg-canvas); color: var(--ink-primary);
}

.eq-root { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.eq-tab-strip {
  display: flex; align-items: stretch; justify-content: space-between;
  border-bottom: 1px solid var(--border-grid); background: var(--bg-elevated);
}
.eq-tab-strip .ws-tab-item.is-active {
  background: var(--bg-canvas); color: var(--accent-link);
  border-bottom: 2.5px solid var(--accent-link);
}
.eq-stage-host { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.eq-scroll { flex: 1; overflow-y: auto; padding: 20px 18px 48px; }
.eq-shell, .eq-tab-shell { max-width: 1140px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.eq-atlas-head { display: flex; flex-direction: column; gap: 8px; }
.eq-kicker {
  font: 700 11px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--eq-pillar, var(--accent-link));
}
.eq-title, .eq-tab-title { margin: 0; font: 700 clamp(1.3rem, 2.5vw, 1.75rem)/1.2 var(--font-serif); color: var(--ink-primary); }
.eq-subtitle { margin: 0; max-width: 72ch; font: 400 0.94rem/1.55 var(--font-sans); color: var(--ink-secondary); }
.eq-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.eq-filter-btn { min-height: 32px; }

.eq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.eq-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius-card, 12px);
  background: var(--bg-elevated); border: 1px solid var(--border-grid);
  border-top: 3px solid var(--eq-pillar, var(--accent-link)); min-width: 0;
}
.eq-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.eq-fam-pill, .eq-use-count {
  font: 700 11px/1.2 var(--font-mono); padding: 2px 7px; border-radius: 999px;
  background: var(--bg-recessed); color: var(--ink-secondary);
}
.eq-card-title { margin: 0; font: 700 1rem/1.25 var(--font-sans); color: var(--ink-primary); }
.eq-formula-box, .eq-formula-banner {
  font: 700 13px/1.35 var(--font-mono); padding: 7px 10px; border-radius: 8px;
  background: var(--bg-canvas); border: 1px solid var(--border-grid); color: var(--eq-pillar, var(--accent-link));
  overflow-x: auto; white-space: nowrap;
}
.eq-formula-banner { font-size: 14.5px; display: inline-block; margin-top: 6px; max-width: 100%; }
.eq-spark-wrap {
  background: var(--bg-canvas); border: 1px solid var(--border-grid); border-radius: 8px; padding: 4px 6px;
}
.eq-spark-svg { display: block; width: 100%; height: 42px; }
.eq-card-hook { margin: 0; font: 400 12.5px/1.45 var(--font-sans); color: var(--ink-secondary); flex: 1; }
.eq-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 8px; border-top: 1px solid var(--border-grid);
}
.eq-card-uses { font: 600 11px/1.2 var(--font-sans); color: var(--ink-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-open-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 11px;
  white-space: nowrap; flex-shrink: 0;
  border-radius: 8px; font: 700 12px/1 var(--font-sans); text-decoration: none; cursor: pointer;
  background: var(--sig-bg); color: var(--accent-link); border: 1px solid color-mix(in oklab, var(--accent-link) 45%, transparent);
}

.eq-tab-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eq-tab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.eq-panel {
  background: var(--bg-elevated); border: 1px solid var(--border-grid);
  border-radius: var(--radius-card, 12px); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.eq-slider-row { display: flex; flex-direction: column; gap: 4px; font: 600 12px/1.2 var(--font-sans); color: var(--ink-primary); }
.eq-slider-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eq-slider-row input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent-link); }
.eq-readout-box {
  padding: 9px 11px; border-radius: 8px; background: var(--sig-bg); color: var(--accent-link);
  font: 700 13px/1.35 var(--font-mono); font-variant-numeric: tabular-nums;
}
.eq-mode-row { display: flex; flex-wrap: wrap; gap: 6px; }
.eq-mode-btn { min-height: 30px; font-size: 11.5px; }
.eq-tab-shell table.booktabs th, .eq-tab-shell .ws-calc-kicker { text-transform: none; letter-spacing: normal; }
.eq-canvas-wrap { border-radius: 8px; overflow: hidden; border: 1px solid var(--border-grid); background: var(--bg-canvas); }
.eq-plot-canvas { display: block; width: 100%; height: auto; aspect-ratio: 540 / 248; }
.eq-used-section { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--border-grid); }
.eq-used-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.eq-used-pill {
  display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 10px;
  border-radius: 999px; background: var(--bg-canvas); border: 1px solid var(--border-grid);
  color: var(--ink-primary); font: 600 11.5px/1.2 var(--font-sans); text-decoration: none;
}
.eq-used-pill:hover, .eq-open-btn:hover { border-color: var(--accent-link); color: var(--accent-link); }
.eq-open-btn:focus-visible, .eq-used-pill:focus-visible, .eq-filter-btn:focus-visible, .eq-mode-btn:focus-visible {
  outline: 2px solid var(--accent-link); outline-offset: 2px;
}

@media (max-width: 980px) { .eq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .eq-tab-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .eq-scroll { padding: 14px 12px 48px; }
  .eq-grid { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .eq-card, .eq-panel, .eq-used-pill, .eq-open-btn { border-color: CanvasText; }
}
