:root {
  color-scheme: dark;
  --bg: #101319;
  --panel: #191d25;
  --line: #303641;
  --muted: #9ba4b3;
  --lime: #b9ef65;
  --text: #edf1f7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.5 Inter,
    Segoe UI,
    Arial,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  background: #252b35;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 11px;
  white-space: nowrap;
}
button:hover {
  border-color: #7d899b;
  background: #333c48;
}
button.active,
.primary {
  background: var(--lime);
  color: #17200e;
  border-color: var(--lime);
  font-weight: 650;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
input,
select {
  background: #10141b;
  border: 1px solid #363e4c;
  color: var(--text);
  border-radius: 5px;
  padding: 7px 9px;
  min-width: 0;
  width: 100%;
}
input:focus,
select:focus {
  outline: 1px solid var(--lime);
}
header {
  height: 74px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 22px;
}
.brand {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 2px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand small {
  font-size: 10px;
  line-height: 1.2;
  width: 40px;
  color: var(--muted);
  letter-spacing: 1.2px;
}
.mark {
  font-size: 32px;
  color: var(--lime);
}
.project {
  color: #b1b9c6;
}
nav {
  display: flex;
  gap: 8px;
}
.badge {
  font:
    10px/1.5 ui-monospace,
    monospace;
  letter-spacing: 1.1px;
  color: #bbc5d2;
  border: 1px solid #3a414c;
  padding: 4px 6px;
  border-radius: 4px;
  margin-left: 8px;
}
main {
  display: grid;
  grid-template-columns: 280px minmax(350px, 1fr) 290px;
  min-height: calc(100vh - 110px);
}
aside {
  background: var(--panel);
  padding: 23px 19px;
  border-right: 1px solid var(--line);
  max-height: calc(100vh - 110px);
  overflow: auto;
}
aside:last-child {
  border-left: 1px solid var(--line);
  border-right: 0;
}
h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 4px 0;
}
h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 18px;
}
h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
}
.section {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 20px;
}
.field {
  display: grid;
  grid-template-columns: 1fr 90px;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.field label {
  font-size: 13px;
  color: #c3cbd7;
}
.field label small {
  color: var(--muted);
  font-size: 11px;
}
.wide {
  width: 100%;
  margin: 8px 0;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * {
  flex: 1;
}
.muted,
.hint {
  color: var(--muted);
}
.hint {
  font-size: 12px;
  line-height: 1.6;
}
.warning {
  color: #ecc483;
  background: #3a3020;
  border: 1px solid #665231;
  padding: 10px;
  border-radius: 5px;
  font-size: 12px;
  margin-top: 12px;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 30%, #242c38 0%, #151a22 70%);
}
.viewhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 23px 26px 0;
}
.viewhead .badge {
  font-size: 9px;
}
#viewport {
  position: relative;
  flex: 1;
  min-height: 370px;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.viewtools {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 2;
}
.viewtools button {
  font-size: 11px;
  background: #1e2531cc;
  padding: 6px 8px;
}
.viewtools button.active {
  color: var(--lime);
  border-color: #6e844e;
}
.scene-note {
  position: absolute;
  bottom: 18px;
  left: 24px;
  color: #8390a4;
  font-size: 11px;
  pointer-events: none;
}
.axis {
  position: absolute;
  bottom: 15px;
  right: 26px;
  color: #f18d8d;
  font: 12px monospace;
}
.axis span {
  color: #b9ef65;
  margin: 7px;
}
.axis b {
  color: #86adff;
}
.transport {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: #171c25;
}
.transport label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-left: 10px;
}
.transport input {
  width: 55px;
  padding: 6px;
}
.transport #motion-info {
  font:
    11px ui-monospace,
    monospace;
  color: #b6c2d2;
  margin-left: auto;
}
#metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 22px 24px;
  background: #131820;
  border-top: 1px solid var(--line);
  gap: 14px;
}
.metric small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.metric strong {
  font:
    22px/1.8 ui-monospace,
    monospace;
  font-weight: 400;
}
.metric em {
  font-size: 11px;
  color: var(--muted);
  font-style: normal;
}
.gear-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  background: #202630;
  border: 1px solid #39414c;
}
.gear-card.selected {
  border-color: var(--lime);
  background: #293326;
}
.gear-card .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gear-card strong {
  font-size: 13px;
  font-weight: 500;
}
.gear-card small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.gear-card b {
  margin-left: auto;
  font:
    18px ui-monospace,
    monospace;
}
.ratio {
  font:
    38px/1.3 ui-monospace,
    monospace;
  color: var(--lime);
  letter-spacing: -2px;
  margin: 15px 0 3px;
}
.solution {
  padding: 12px;
  background: #11171f;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 10px;
}
.solution strong {
  color: var(--lime);
}
details {
  margin-top: 17px;
}
summary {
  cursor: pointer;
  color: #bbc5d4;
  font-size: 13px;
}
footer {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
footer i {
  display: inline-block;
  background: var(--lime);
  border-radius: 50%;
  width: 5px;
  height: 5px;
  margin-right: 7px;
}
footer button {
  font-size: 11px;
  border: 0;
  background: none;
  padding: 0;
}
dialog {
  background: #1a202a;
  color: var(--text);
  border: 1px solid #465162;
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  padding: 26px;
  box-shadow: 0 20px 80px #0009;
}
dialog::backdrop {
  background: #080c13bb;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 21px;
}
.close {
  float: right;
}
dialog p {
  color: #bcc5d2;
}
.support-eyebrow { color: #8fc6ff; font-size: 11px; letter-spacing: .14em; font-weight: 700; }
.download-support h2 { margin-top: 10px; line-height: 1.35; }
.download-countdown { text-align: center; background: #111821; border: 1px solid #344154; border-radius: 12px; padding: 18px; margin: 20px 0; }
.download-countdown strong { font-size: 44px; color: #95cbff; font-variant-numeric: tabular-nums; }
.download-countdown p { min-height: 2.6em; margin: 6px 0 12px; }
.download-countdown progress { width: 100%; height: 7px; accent-color: #7dbaff; }
.download-ad { margin: 0 0 20px; }
.download-ad-label { margin: 0 0 8px; color: #aab7c8; font-size: 13px; }
.download-ad-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid #344154; border-radius: 12px; background: #080c12; }
.download-ad video { display: block; width: 100%; height: 100%; object-fit: cover; }
.download-ad-audio { position: absolute; right: 9px; bottom: 9px; min-height: 32px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(8,12,18,.82); color: #fff; font-size: 12px; backdrop-filter: blur(5px); }
.download-ad-audio:hover { background: rgba(20,31,44,.94); }
.download-ad-audio:focus-visible { outline: 3px solid #95cbff; outline-offset: 2px; }
.support-tip { padding: 18px; border: 1px solid #44526b; border-radius: 12px; }
.support-tip h3 { margin: 0 0 8px; }
.paypal-tip { display: block; text-align: center; padding: 13px 10px; border-radius: 8px; background: #ffd66a; color: #172643; font-weight: 700; text-decoration: none; }
.paypal-tip:hover { background: #ffe49d; }
.paypal-tip:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.download-actions button { flex: 1; }
.download-actions button[hidden] { display: none; }
.workspace { position: relative; }
#mechanical-panel { position: absolute; right: 12px; top: 98px; z-index: 8; width: min(350px, calc(100% - 24px)); max-height: calc(100% - 120px); overflow-y: auto; background: #1a202af5; border: 1px solid #495971; border-radius: 12px; box-shadow: 0 12px 45px #0008; padding: 20px; }
#mechanical-panel[hidden] { display: none; }
#mechanical-panel h2 { margin: 12px 0 20px; font-size: 22px; }
#mechanical-panel .field { gap: 12px; }
#mechanical-panel .field input { max-width: 100px; }
#mechanical-panel .field select { max-width: 175px; }
#mechanical-panel .field:has(select) { grid-template-columns: 1fr; }
#mechanical-panel .field select { max-width: none; }
#mechanical-panel .primary:hover { background: #c9fa81; color: #17200e; }
#mechanical-panel button { white-space: normal; }
#mechanical-panel .warning { font-size: 12px; }
.viewtools { flex-wrap: wrap; }
.component-row { display: flex; align-items: stretch; gap: 6px; margin: 7px 0; min-width: 0; }
.component-row .gear-card { flex: 1; min-width: 0; margin: 0; }
.component-eye { flex: 0 0 36px; padding: 6px; font-size: 20px; }
.component-eye[data-mode="ghost"] { color: #a3c9ff; border-style: dashed; }
.component-eye[data-mode="hide"] { color: #929baa; }
.component-select { flex: 1; min-width: 0; white-space: normal; text-align: left; }
#experimental-features summary { font-weight: 650; color: var(--lime); }
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.error {
  color: #ffac9d;
}
@media (min-width: 1500px) {
  main {
    grid-template-columns: 310px 1fr 320px;
  }
  aside {
    padding: 26px;
  }
}
@media (max-width: 1100px) {
  main {
    grid-template-columns: 250px minmax(320px, 1fr);
  }
  #train {
    grid-column: 1/-1;
    max-height: none;
    display: block;
  }
  header .project {
    display: none;
  }
  aside {
    max-height: none;
  }
  .workspace {
    min-height: 650px;
  }
  #metrics {
    padding: 14px;
  }
  .transport {
    flex-wrap: wrap;
  }
  .viewhead .badge {
    display: none;
  }
}
@media (max-width: 650px) {
  header {
    height: auto;
    padding: 14px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 16px;
  }
  nav {
    width: 100%;
  }
  nav button {
    flex: 1;
    font-size: 12px;
  }
  main {
    display: flex;
    flex-direction: column;
  }
  .workspace {
    order: -1;
    min-height: 550px;
  }
  #viewport {
    min-height: 330px;
  }
  aside {
    padding: 20px;
  }
  footer {
    height: auto;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
  }
  .metric strong {
    font-size: 18px;
  }
}

#viewport canvas {
  position: absolute;
  inset: 0;
}
.transport #speed {
  width: 75px;
  padding: 0;
  accent-color: var(--lime);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  color: #c3cbd7;
  font-size: 13px;
}
.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--lime);
}
.selected-speed {
  padding: 12px;
  background: #11171f;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 14px;
}
.selected-speed strong {
  display: block;
  font:
    18px/1.8 ui-monospace,
    monospace;
  color: var(--lime);
}
.rpm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.rpm-label {
  position: absolute;
  transform: translate(-50%, -110%);
  background: #101721eb;
  border: 1px solid #6680a1;
  color: #edf1f7;
  border-radius: 6px;
  padding: 6px 9px;
  white-space: nowrap;
  font:
    12px/1.5 ui-monospace,
    monospace;
  box-shadow: 0 4px 16px #0005;
}
.rpm-label:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  height: 13px;
  border-left: 1px solid #6680a1;
}
.rpm-label.selected {
  border-color: var(--lime);
  color: var(--lime);
}

.brand-cad { color: var(--lime); letter-spacing: 1px; }
