/**
 * byteomi-systems/mechanical-systems/collision.html
 * Impulse Rail · Before/After — p=mv · J=Δp · elastic|inelastic
 */

.doc-byteomi-preset.doc-byteomi-preset--hero.doc-byteomi-preset--collision {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}

.doc-byteomi-preset--collision .doc-byteomi-preset__tag {
  color: rgba(94, 200, 212, 0.95);
}

.doc-byteomi-preset--collision.is-energy-loss .doc-cl-lab__action-btn[data-cl-run].is-active {
  box-shadow: 0 0 0 1px rgba(232, 160, 96, 0.55), 0 0 12px rgba(232, 160, 96, 0.22);
}

.doc-byteomi-preset--collision.is-energy-loss .doc-cl-lab__stage-wrap {
  border-color: rgba(232, 160, 96, 0.42);
  box-shadow: inset 0 0 40px rgba(232, 160, 96, 0.07);
}

.doc-byteomi-preset--collision.is-elastic .doc-cl-lab__stage-wrap {
  border-color: rgba(94, 200, 212, 0.38);
  box-shadow: inset 0 0 40px rgba(94, 200, 212, 0.06);
}

.doc-cl-disclaimer {
  margin: 0 0 1.35rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(94, 200, 212, 0.22);
  background: linear-gradient(120deg, rgba(94, 200, 212, 0.07), transparent 70%);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(185, 200, 210, 0.9);
}

.doc-cl-disclaimer p {
  margin: 0;
}

.doc-math-line {
  margin: 0.85rem 0;
  padding: 0.65rem 0.9rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: rgba(210, 225, 235, 0.92);
  border-left: 2px solid rgba(94, 200, 212, 0.55);
  background: linear-gradient(90deg, rgba(94, 200, 212, 0.08), transparent 70%);
}

.doc-cl-lab__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr);
  gap: 0.65rem;
  align-items: stretch;
}

.doc-cl-lab__stage-wrap {
  position: relative;
  min-height: min(52vh, 440px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120, 160, 180, 0.18);
  background:
    radial-gradient(70% 55% at 30% 35%, rgba(94, 200, 212, 0.1), transparent 58%),
    radial-gradient(50% 40% at 75% 70%, rgba(176, 128, 232, 0.08), transparent 52%),
    #07080b;
}

.doc-cl-lab__stage {
  position: absolute;
  inset: 0;
}

.doc-cl-lab__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.doc-cl-lab__stage-hud {
  position: absolute;
  left: 0.6rem;
  bottom: 0.5rem;
  z-index: 2;
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  color: rgba(185, 200, 210, 0.78);
  pointer-events: none;
}

.doc-cl-lab__plot-wrap {
  position: relative;
  min-height: min(52vh, 440px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120, 160, 180, 0.16);
  background: #08090b;
  display: flex;
  flex-direction: column;
}

.doc-cl-lab__plot {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  min-height: 240px;
}

.doc-cl-lab__plot-label {
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: rgba(160, 170, 190, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.doc-cl-lab__hud {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0.75rem 0 0.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(120, 160, 180, 0.12);
  background: rgba(8, 10, 14, 0.55);
}

.doc-cl-lab__formula {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: rgba(94, 200, 212, 0.92);
}

.doc-cl-lab__readout {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.45;
  color: rgba(180, 175, 165, 0.85);
}

.doc-cl-lab__console {
  margin-top: 0.55rem;
  padding: 0.7rem 0.85rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 180, 0.16);
  background: linear-gradient(165deg, rgba(18, 24, 28, 0.92), rgba(10, 10, 12, 0.95));
}

.doc-cl-lab__console-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-cl-lab__console-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(94, 200, 212, 0.75);
  margin-right: auto;
}

.doc-cl-lab__presets,
.doc-cl-lab__modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.15rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-cl-lab__preset-btn,
.doc-cl-lab__mode-btn,
.doc-cl-lab__action-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(185, 200, 210, 0.65);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.doc-cl-lab__preset-btn.is-active,
.doc-cl-lab__mode-btn.is-active {
  color: #141018;
  background: linear-gradient(145deg, #5ec8d4, #3a98a8);
}

.doc-cl-lab__action-btn {
  color: #0e1418;
  background: linear-gradient(145deg, #5ec8d4, #3a98a8);
}

.doc-cl-lab__action-btn.is-active {
  box-shadow: 0 0 0 1px rgba(176, 128, 232, 0.55), 0 0 12px rgba(94, 200, 212, 0.25);
}

.doc-cl-lab__action-btn--ghost {
  color: rgba(185, 200, 210, 0.75);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.doc-cl-lab__sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.7rem 1rem;
}

.doc-cl-lab__field {
  display: grid;
  grid-template-columns: 3.8rem 1fr auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.75rem;
  color: rgba(210, 220, 228, 0.88);
}

.doc-cl-lab__field-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(94, 200, 212, 0.9);
}

.doc-cl-lab__field input[type="range"] {
  width: 100%;
  accent-color: #5ec8d4;
}

.doc-cl-lab__field strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(210, 220, 228, 0.9);
  white-space: nowrap;
  min-width: 5rem;
  text-align: right;
}

.doc-cl-lab__hint {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(140, 155, 165, 0.88);
}

@media (max-width: 820px) {
  .doc-cl-lab__layout {
    grid-template-columns: 1fr;
  }

  .doc-cl-lab__stage-wrap,
  .doc-cl-lab__plot-wrap {
    min-height: min(42vh, 360px);
  }
}
