/* Interactive demos used in the physics lessons. */

/* ---------- Frame for the board-sized demos (forces, work and energy) ---------- */
.sim-frame { position: relative; overflow: hidden; width: 100%; }
.sim-frame.is-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lsim {
  width: 1220px; padding: 6px 20px 10px; box-sizing: border-box; transform-origin: 0 0;
  font-family: var(--font-body); font-size: 26px; line-height: 1.35; color: var(--ink);
  user-select: none; -webkit-user-select: none;
}
.lsim .simarea { position: relative; margin: 6px auto; }
.lsim .simarea > svg { position: absolute; left: 0; top: 0; overflow: visible; }
.lsim .lbl { position: absolute; white-space: nowrap; font-size: 27px; line-height: 1; padding: 2px 3px; }
.lsim .lbl.small { font-size: 23px; }
.lsim .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.lsim .ctl { font-size: 26px; display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.lsim .ctl > span { white-space: nowrap; flex: 0 0 auto; }
.lsim .readout { font-size: 27px; min-height: 46px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.lsim .p30 { font-size: 28px; line-height: 1.35; }
.lsim .cap { font-size: 24px; color: var(--text-muted); }
.lsim .katex { font-size: 1.05em; }

.lsim .btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: 24px; line-height: 1.2;
  padding: 11px 24px; border-radius: 999px; border: 2.5px solid var(--ink);
  background: var(--ink); color: #fff; cursor: pointer;
}
.lsim .btn.alt { background: var(--paper); color: var(--ink); }
.lsim .btn.alt:hover { background: var(--tint-butter); }
.lsim .btn.sel { background: var(--tint-yellow); color: var(--ink); border-color: var(--ink); }
.lsim .btn:disabled { opacity: .4; cursor: default; }

.lsim input[type=range] {
  -webkit-appearance: none; appearance: none; width: 320px; height: 14px; margin: 0 6px;
  background: var(--tint-sky); border: 2px solid var(--pair6-b); border-radius: 8px;
}
.lsim input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--pair2-b); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--pair2-b); cursor: pointer;
}
.lsim input[type=range]::-moz-range-thumb {
  width: 34px; height: 34px; border-radius: 50%; background: var(--pair2-b); border: 4px solid #fff; cursor: pointer;
}

.lsim .cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.lsim .card {
  border: 2.5px solid var(--border); border-radius: 14px; background: var(--paper); padding: 12px 14px;
  font-size: 25px; line-height: 1.25; min-height: 124px; box-sizing: border-box; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.lsim .card:hover { border-color: var(--ink); }
.lsim .card .res { font-weight: 700; color: #2F7D32; visibility: hidden; }
.lsim .card.open { border-color: #2F7D32; background: #E8F5E9; }
.lsim .card.open .res { visibility: visible; }

/* ---------- Momentum demos (drawn in a scalable SVG) ---------- */
.msim { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.msim svg.art { width: 100%; height: auto; display: block; max-width: 100%; }
.msim .ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.95rem; }
.msim .ctrl .sep { width: 1px; align-self: stretch; background: var(--border); margin-inline: 2px; }
.msim .ctrl label { display: flex; align-items: center; gap: 6px; }
.msim .btn {
  font-family: var(--font-head); font-weight: 600; font-size: 0.92rem; line-height: 1.2;
  padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--paper); color: var(--ink); cursor: pointer;
}
.msim .btn:hover { border-color: var(--ink); background: var(--paper); }
.msim .btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.msim .btn.primary:hover { background: #000; }
.msim .btn[aria-pressed="true"] { background: var(--tint-sky); border-color: var(--pair6-b); color: var(--ink); }
.msim .readout { font-size: 0.97rem; font-variant-numeric: tabular-nums; line-height: 1.5; margin: 0; color: var(--text-soft); max-width: none; }
.msim .sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; font-size: 0.92rem; }
.msim .sliders label { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 5.2em; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.msim .sliders input { width: 100%; min-width: 0; accent-color: var(--pair2-b); }
@media (max-width: 700px) { .msim .sliders { grid-template-columns: 1fr; } }
.msim .sv-txt { fill: var(--ink); font-family: var(--font-body); font-size: 17px; }
.msim .sv-small { fill: var(--ink); font-family: var(--font-body); font-size: 14px; }
.msim .sv-msg { fill: var(--ink); font-family: var(--font-body); font-size: 19px; font-weight: 700; }
.msim .sv-math { fill: var(--ink); font-family: var(--font-body); font-style: italic; font-size: 18px; }
.msim text { font-family: var(--font-body); }
.msim .tblwrap { overflow-x: auto; }
.msim table.symtab { border-collapse: collapse; font-size: 0.9rem !important; margin: 0; width: auto; }
.msim table.symtab th, .msim table.symtab td { border: 1px solid var(--panel-head); padding: 5px 12px; text-align: center; }
.msim table.symtab th { background: var(--tint-lavender); font-family: var(--font-head); font-weight: 600; }
.msim table.symtab td:first-child { font-weight: 700; text-align: left; }

/* ---------- Exponential model explorer ---------- */
.expo .expo-svg { width: 100%; height: auto; display: block; }
.expo .viz-controls { margin-top: 6px; }
.expo .expo-eq { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--ink); margin: 10px 0 2px; }
.expo [data-out="kind"] { color: var(--text-soft); margin: 0; }
