/**
 * byteomi-systems/mechanical-systems/thermal-expansion.html
 * Gap Rail · Coil Bed — ΔL=αL₀ΔT · gap · σ≈EαΔT
 */

.doc-byteomi-preset.doc-byteomi-preset--hero.doc-byteomi-preset--thermal {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}

.doc-byteomi-preset--thermal .doc-byteomi-preset__tag {
  color: rgba(232, 160, 96, 0.95);
}

.doc-byteomi-preset--thermal.is-gap-fail .doc-th-lab__stage-wrap {
  border-color: rgba(224, 96, 80, 0.45);
  box-shadow: inset 0 0 40px rgba(224, 96, 80, 0.08);
}

.doc-byteomi-preset--thermal.is-constrained .doc-th-lab__stage-wrap {
  border-color: rgba(176, 128, 232, 0.4);
  box-shadow: inset 0 0 40px rgba(176, 128, 232, 0.07);
}

.doc-byteomi-preset--thermal.is-free .doc-th-lab__stage-wrap {
  border-color: rgba(94, 200, 212, 0.35);
  box-shadow: inset 0 0 40px rgba(94, 200, 212, 0.06);
}

.doc-byteomi-preset--thermal.is-mat-copper .doc-th-lab__stage-wrap {
  background:
    radial-gradient(70% 55% at 28% 40%, rgba(184, 106, 58, 0.14), transparent 58%),
    radial-gradient(50% 40% at 78% 65%, rgba(232, 136, 72, 0.08), transparent 52%),
    #07080b;
}

.doc-byteomi-preset--thermal.is-mat-glass .doc-th-lab__stage-wrap {
  background:
    radial-gradient(70% 55% at 30% 40%, rgba(126, 224, 240, 0.12), transparent 58%),
    radial-gradient(50% 40% at 75% 65%, rgba(168, 220, 232, 0.08), transparent 52%),
    #07080b;
}

.doc-byteomi-preset--thermal.is-mat-aluminum .doc-th-lab__stage-wrap {
  background:
    radial-gradient(70% 55% at 28% 40%, rgba(200, 210, 220, 0.1), transparent 58%),
    radial-gradient(50% 40% at 78% 65%, rgba(232, 200, 120, 0.06), transparent 52%),
    #07080b;
}

.doc-th-disclaimer {
  margin: 0 0 1.35rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 160, 96, 0.28);
  background: linear-gradient(120deg, rgba(232, 160, 96, 0.08), transparent 70%);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(185, 200, 210, 0.9);
}

.doc-th-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(232, 160, 96, 0.55);
  background: linear-gradient(90deg, rgba(232, 160, 96, 0.08), transparent 70%);
}

.doc-th-lab__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr);
  gap: 0.65rem;
  align-items: stretch;
}

.doc-th-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 28% 40%, rgba(232, 160, 96, 0.1), transparent 58%),
    radial-gradient(50% 40% at 78% 65%, rgba(94, 200, 212, 0.07), transparent 52%),
    #07080b;
}

.doc-th-lab__stage {
  position: absolute;
  inset: 0;
}

.doc-th-lab__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.doc-th-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-th-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-th-lab__plot {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  min-height: 240px;
}

.doc-th-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-th-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-th-lab__formula {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: rgba(232, 160, 96, 0.92);
}

.doc-th-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-th-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-th-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-th-lab__console-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(232, 160, 96, 0.8);
  margin-right: auto;
}

.doc-th-lab__presets,
.doc-th-lab__modes,
.doc-th-lab__mats {
  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-th-lab__preset-btn,
.doc-th-lab__mode-btn,
.doc-th-lab__mat-btn,
.doc-th-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-th-lab__mode-btn.is-active {
  color: #141018;
  background: linear-gradient(145deg, #e8a860, #c48440);
}

.doc-th-lab__preset-btn.is-active {
  color: #141018;
  background: linear-gradient(145deg, #e8a860, #c48440);
}

.doc-th-lab__preset-btn[data-th-preset="gapFail"].is-active {
  color: #1a0808;
  background: linear-gradient(145deg, #e07060, #a03828);
}

.doc-th-lab__preset-btn[data-th-preset="constrained"].is-active {
  color: #120818;
  background: linear-gradient(145deg, #c4a0e8, #7850a8);
}

.doc-th-lab__preset-btn[data-th-preset="cool"].is-active {
  color: #061018;
  background: linear-gradient(145deg, #6a9ad0, #3a6088);
}

/* Material chips — each reads as its substance */
.doc-th-lab__mat-btn[data-th-mat="steel"] {
  color: rgba(170, 190, 205, 0.75);
  box-shadow: inset 3px 0 0 rgba(94, 200, 212, 0.45);
}
.doc-th-lab__mat-btn[data-th-mat="aluminum"] {
  color: rgba(210, 218, 225, 0.75);
  box-shadow: inset 3px 0 0 rgba(200, 208, 216, 0.55);
}
.doc-th-lab__mat-btn[data-th-mat="copper"] {
  color: rgba(220, 160, 120, 0.8);
  box-shadow: inset 3px 0 0 rgba(184, 106, 58, 0.65);
}
.doc-th-lab__mat-btn[data-th-mat="glass"] {
  color: rgba(160, 220, 230, 0.8);
  box-shadow: inset 3px 0 0 rgba(126, 224, 240, 0.55);
}

.doc-th-lab__mat-btn[data-th-mat="steel"].is-active {
  color: #0e1418;
  background: linear-gradient(145deg, #8aa0b0, #5a7080);
  box-shadow: inset 0 0 0 1px rgba(94, 200, 212, 0.35);
}
.doc-th-lab__mat-btn[data-th-mat="aluminum"].is-active {
  color: #14181c;
  background: linear-gradient(145deg, #e8eef4, #a8b4c0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.doc-th-lab__mat-btn[data-th-mat="copper"].is-active {
  color: #1a0e08;
  background: linear-gradient(145deg, #d48848, #8a4828);
  box-shadow: inset 0 0 0 1px rgba(232, 136, 72, 0.4);
}
.doc-th-lab__mat-btn[data-th-mat="glass"].is-active {
  color: #062028;
  background: linear-gradient(145deg, rgba(168, 220, 232, 0.95), rgba(80, 140, 160, 0.9));
  box-shadow: inset 0 0 0 1px rgba(126, 224, 240, 0.5);
}

.doc-th-lab__action-btn {
  color: #141018;
  background: linear-gradient(145deg, #e8a860, #c48440);
}

.doc-th-lab__action-btn.is-active {
  box-shadow: 0 0 0 1px rgba(176, 128, 232, 0.5), 0 0 12px rgba(232, 160, 96, 0.25);
}

.doc-th-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-th-lab__sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.7rem 1rem;
}

.doc-th-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-th-lab__field-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(232, 160, 96, 0.9);
}

.doc-th-lab__field input[type="range"] {
  width: 100%;
  accent-color: #e8a860;
}

.doc-th-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-th-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-th-lab__layout {
    grid-template-columns: 1fr;
  }

  .doc-th-lab__stage-wrap,
  .doc-th-lab__plot-wrap {
    min-height: min(42vh, 360px);
  }
}
