/* =====================================================================
   Kinematics — section styles
   Extends toolkit.css primitives: .widget / .controls / .readout /
   .explainer / .math-details.  All original rules preserved; additions
   are grouped under "ADDED" banners.
   ===================================================================== */

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.preset-row button {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.preset-row button:hover { border-color: var(--accent); color: var(--accent); }
.preset-row button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.control-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 8px 0 -2px;
}
.control-group-label:first-child { margin-top: 0; }

.mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.mode-toggle button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.mode-toggle button.active {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--chip);
}
.mode-toggle button b { display: block; font-size: 13.5px; margin-bottom: 2px; color: var(--text-primary); }

.dual-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 680px) {
  .dual-pane { grid-template-columns: 1fr; }
}
.dual-pane .pane-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
  text-align: center;
}

.try-at-home {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  padding: 16px 20px;
  margin: 0 0 18px;
}
.try-at-home h4 {
  margin: 0 0 8px;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.try-at-home h4::before { content: "🧪"; font-size: 15px; }
.try-at-home ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
}
.try-at-home ol li { margin-bottom: 4px; }

.verdict-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.verdict-badge.good { background: rgba(27, 175, 122, 0.18); color: #1baf7a; }
.verdict-badge.bad  { background: rgba(227, 73, 72, 0.18);  color: #e34948; }
/* ADDED: neutral/"warn" state for borderline results (e.g. "falls short") */
.verdict-badge.warn { background: rgba(214, 158, 46, 0.18); color: #b7791f; }

.var-list {
  columns: 2;
  column-gap: 24px;
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 100ch;
}
.var-list div { margin-bottom: 4px; break-inside: avoid; }
.var-list var { color: var(--text-primary); font-family: "SFMono-Regular", Consolas, monospace; font-style: normal; }
@media (max-width: 600px) { .var-list { columns: 1; } }

h3.subhead {
  font-size: 16px;
  margin: 28px 0 4px;
  border-top: 1px solid var(--gridline);
  padding-top: 20px;
}
h3.subhead:first-of-type { border-top: none; padding-top: 0; margin-top: 8px; }

/* =====================================================================
   ADDED — Accessibility & interactivity polish
   (Safe to include now; degrades gracefully with your current markup.)
   ===================================================================== */

/* Visible keyboard focus everywhere (WCAG 2.4.7). */
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Bigger, easier slider targets + consistent cross-browser look. */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 22px;
}
input[type="range"]:disabled { cursor: not-allowed; opacity: 0.5; }

/* ADDED — Prediction-reveal pattern.
   Wrap the answer/simulation in [data-reveal] (hidden initially) and add a
   button with [data-reveal-btn="<id>"] matching the [data-reveal] element id.
   The JS wires this automatically. */
[data-reveal] {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.45s ease;
}
[data-reveal].revealed {
  max-height: 4000px;
  opacity: 1;
}
.prediction {
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: var(--chip);
  padding: 14px 18px;
  margin: 0 0 18px;
}
.prediction h4 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.prediction h4::before { content: "🤔"; }
.prediction .reveal-btn {
  margin-top: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.prediction .reveal-btn:hover { filter: brightness(1.05); }

/* ADDED — unified simulation control bar (Play / Pause / Reset).
   Use class .sim-controls on a flex container of buttons if you add them. */
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.sim-controls button {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sim-controls button:hover { border-color: var(--accent); color: var(--accent); }
.sim-controls button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ADDED — SVG helpers so paths from every widget share styling. */
.svg-grid       { stroke: var(--gridline); stroke-width: 1; }
.svg-axis       { stroke: var(--muted); stroke-width: 1.2; }
.path-ideal     { fill: none; stroke: var(--accent); stroke-width: 2; }
.path-drag      { fill: none; stroke: #e34948; stroke-width: 2; stroke-dasharray: 5 4; }
.path-secondary { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }

/* ADDED — respect user motion preferences (guide: "slow motion where
   appropriate" + a11y). Animations still run but transitions calm down. */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition: none; }
  * { animation-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ADDED — print-friendly: hide interactive chrome, keep diagrams/text. */
@media print {
  .sim-controls, .preset-row, .mode-toggle, #tabbar { display: none !important; }
  .panel { display: block !important; }
  [data-reveal] { max-height: none; opacity: 1; overflow: visible; }
}
