:root {
  color-scheme: dark;
  --bg: #090f19;
  --panel: #101925;
  --field: #09121e;
  --border: #263345;
  --text: #edf0f4;
  --muted: #a8b5c7;
  --green: #7be3c1;
  --orange: #e7b575;
  --red: #ffa5a0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button,
select,
input {
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--field);
}
button {
  min-height: 44px;
  padding: 9px 13px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #1e2c3d;
  border-color: #53647a;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
select {
  padding: 9px 28px 9px 10px;
  min-height: 42px;
  font-size: 0.875rem;
  max-width: 100%;
}
input {
  min-width: 0;
  padding: 9px 10px;
  width: 100%;
  min-height: 42px;
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  accent-color: var(--green);
}
input[type="range"] {
  padding: 0;
  accent-color: var(--green);
  min-height: 24px;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
#canvas-wrap:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
a {
  color: var(--green);
}
p {
  line-height: 1.55;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 650;
}
h2 {
  font-size: 1rem;
  font-weight: 620;
  margin: 0;
}
h3 {
  font-size: 1rem;
}
small {
  font-size: 0.8125rem;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.app-header {
  height: 78px;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  background: #0c131f;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-mark {
  font-size: 2.4rem;
  color: var(--green);
  line-height: 1;
}
.brand p {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 4px 0 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand p span {
  margin: 0 8px;
  color: #506176;
}
.header-actions {
  display: flex;
  gap: 8px;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.header-actions .quiet {
  border: 1px solid var(--border);
}
.workspace {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  min-height: calc(100dvh - 78px);
}
.controls {
  grid-column: 1;
  grid-row: 1;
  background: var(--panel);
  border-right: 1px solid var(--border);
  height: calc(100dvh - 78px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #38485e transparent;
}
.viewer-column {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  height: calc(100dvh - 78px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.scene {
  position: relative;
  min-height: 360px;
  flex: 1 0 460px;
  background: #060c16;
  overflow: hidden;
}
#canvas-wrap {
  position: absolute;
  inset: 0;
  touch-action: none;
}
#canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.scene-title {
  position: absolute;
  left: 25px;
  top: 24px;
  pointer-events: none;
  max-width: calc(100% - 225px);
  text-shadow: 0 2px 12px #000;
}
.eyebrow {
  font-size: 0.69rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: #95a7c0;
  display: block;
  margin-bottom: 8px;
}
.scene-title h2 {
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  letter-spacing: -0.025em;
  font-weight: 500;
}
.scene-title p {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 8px 0;
}
.view-settings {
  position: absolute;
  top: 25px;
  right: 24px;
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.view-settings select {
  background: #101b2bd9;
}
.legend {
  position: absolute;
  left: 25px;
  top: 122px;
  display: flex;
  gap: 18px;
  font-size: 0.8125rem;
  pointer-events: none;
  color: #d9e1ec;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.line {
  height: 2px;
  width: 20px;
  display: inline-block;
  background: var(--orange);
}
.line.trial {
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0 6px,
    transparent 6px 10px
  );
}
.camera-tools {
  position: absolute;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  background: #0e1725db;
  backdrop-filter: blur(8px);
  border: 1px solid #33435a;
  border-radius: 9px;
  max-width: calc(100% - 24px);
  overflow-x: auto;
}
.camera-tools button {
  white-space: nowrap;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  padding: 8px 12px;
  min-height: 36px;
}
.camera-tools button:hover {
  background: #263950;
}
.scene-bottom {
  position: absolute;
  bottom: 17px;
  left: 23px;
  right: 23px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9dafc5;
  font-size: 0.69rem;
  pointer-events: none;
}
#scene-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.body-label {
  position: absolute;
  font-size: 0.75rem;
  white-space: nowrap;
  color: #d7e2f2;
  text-shadow: 0 2px 5px #000;
  transform: translate(8px, -50%);
  line-height: 1.2;
}
.body-label.lagrange {
  color: #9baabe;
}
.body-label.axis {
  font-size: 0.7rem;
}
.loading {
  position: absolute;
  inset: 0;
  background: #08101eb8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 3;
  backdrop-filter: blur(3px);
}
.loading p {
  margin: 14px 15px;
  text-align: center;
}
.spinner {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  border: 2px solid #304153;
  border-top-color: var(--green);
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.graphics-error {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 45%;
  padding: 22px;
  background: #121f2fea;
  border: 1px solid var(--border);
  z-index: 4;
}
.graphics-error p {
  margin-bottom: 0;
  color: var(--muted);
}
.playback {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #0d1521;
}
.playback-buttons {
  display: flex;
  gap: 6px;
}
.play {
  background: var(--green);
  color: #08261d;
  border-color: var(--green);
  min-width: 91px;
}
.play:hover {
  background: #a0f0d7;
  color: #08261d;
}
.timeline-label {
  flex: 1;
  display: grid;
  gap: 3px;
  min-width: 45px;
}
.timeline-label > span {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.timeline-label output {
  color: var(--text);
}
.speed-label {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.speed-label select {
  min-width: 72px;
}
.readouts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px 24px;
  gap: 16px;
  background: #0d1521;
}
.readouts > div {
  min-width: 0;
}
.readouts span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 7px;
}
.readouts strong {
  font:
    500 clamp(0.9rem, 1.3vw, 1.2rem) / 1.25 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: -0.03em;
  display: block;
  overflow-wrap: anywhere;
}
.run-status {
  padding: 12px 24px;
  color: #a8bdcf;
  background: #101c2a;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.5;
  min-height: 46px;
}
.run-status.warning {
  color: var(--orange);
}
.result-details {
  padding: 10px 24px;
  background: #0d1521;
  font-size: 0.8125rem;
}
.result-details summary {
  padding: 4px 0;
  color: var(--muted);
}
.result-details p {
  margin: 8px 0;
}
.result-details table {
  width: 100%;
  border-collapse: collapse;
}
.result-details th,
.result-details td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}
.control-section {
  padding: 21px 22px;
  border-bottom: 1px solid var(--border);
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.step {
  font:
    500 0.69rem ui-monospace,
    monospace;
  color: #7f94aa;
  letter-spacing: 0.04em;
}
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.preset-button {
  text-align: left;
  min-height: 58px;
  padding: 10px 12px;
  color: #c4d0df;
  font-weight: 600;
  background: #142132;
}
.preset-button span {
  display: block;
  font-size: 0.69rem;
  font-weight: 400;
  color: #92a6bd;
  margin-top: 3px;
}
.preset-button[aria-pressed="true"] {
  border-color: var(--green);
  background: #18342f;
  color: #b0f5df;
}
.preset-button[aria-pressed="true"] span {
  color: #9abfb2;
}
.description {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 14px 0 8px;
  line-height: 1.5;
}
.preset-period {
  font:
    500 0.75rem ui-monospace,
    SFMono-Regular,
    monospace;
  color: var(--orange);
  margin: 0;
}
.input-explainer {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.55;
}
.input-explainer strong {
  color: #d9e6ef;
  font-weight: 500;
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}
.field-row label {
  font-size: 0.8125rem;
  color: var(--muted);
}
.field-row label span {
  font-size: 0.75rem;
}
.state-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}
.state-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.state-field label {
  font-size: 0.8125rem;
  color: #c5d1e1;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.state-field .unit {
  font-size: 0.69rem;
  color: #7e94aa;
}
.state-field input {
  font:
    400 0.78rem/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  padding: 10px 7px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  width: 100%;
}
.state-field input:focus {
  background: #132536;
}
.duration-row input {
  width: 118px;
  font-size: 0.875rem;
}
.period-buttons {
  display: flex;
  gap: 6px;
  margin: 10px 0 14px;
}
.period-buttons button {
  flex: 1;
  font-size: 0.75rem;
  min-height: 34px;
  padding: 6px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: #092c21;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.primary:hover {
  background: #a0f0d7;
  color: #092c21;
}
.full {
  width: 100%;
  margin-top: 9px;
}
.secondary {
  background: #192b3c;
  border-color: #3b5068;
  color: #dceaf6;
}
.edited-tag {
  font-size: 0.65rem;
  color: var(--green);
  border: 1px solid #466b62;
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: auto;
}
.precision-control {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 8px;
  align-items: center;
}
.precision-control > label {
  font-size: 0.875rem;
  color: var(--muted);
}
.precision-control .secondary {
  grid-column: 1/-1;
}
.precision-control select {
  padding-right: 8px;
}
.hint {
  font-size: 0.75rem;
  color: #93a7bd;
  line-height: 1.6;
  margin: 12px 0 0;
}
details summary {
  cursor: pointer;
  font-size: 0.875rem;
  padding: 10px 0;
  color: #c4d2e2;
}
details summary:focus-visible {
  border-radius: 4px;
}
.experiments details {
  margin-top: 11px;
}
.push-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.push-controls label {
  display: grid;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.checkboxes {
  display: grid;
  gap: 11px;
  margin: 8px 0 18px;
}
.checkboxes label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.display-section {
  padding-top: 12px;
  padding-bottom: 12px;
}
.error-message {
  color: var(--red);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.control-footer {
  padding: 22px;
  font-size: 0.75rem;
  color: #8299af;
  line-height: 1.7;
}
.text-button {
  padding: 0;
  border: 0;
  min-height: 28px;
  font-size: 0.75rem;
  text-align: left;
  background: none;
  color: #b5c6d9;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100;
  background: var(--green);
  color: #062719;
  padding: 12px;
}
.skip-link:focus {
  top: 5px;
}
dialog {
  color: var(--text);
  background: #101b29;
  border: 1px solid #3c5067;
  border-radius: 12px;
  max-width: 730px;
  width: calc(100% - 26px);
  max-height: 88dvh;
  padding: 0;
}
dialog::backdrop {
  background: #030811c9;
  backdrop-filter: blur(5px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 23px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #101b29;
  z-index: 1;
}
.dialog-heading h2 {
  font-size: 1.25rem;
}
.dialog-heading button {
  font-size: 1.3rem;
  padding: 5px 14px;
}
.dialog-content {
  padding: 20px 24px 30px;
}
.dialog-content h3 {
  color: var(--green);
  margin: 24px 0 9px;
}
.dialog-content h3:first-child {
  margin-top: 0;
}
.dialog-content p,
.dialog-content li {
  font-size: 0.9375rem;
  color: #c2cfdf;
  line-height: 1.65;
}
.dialog-content li {
  margin: 8px 0;
}
.noscript {
  position: fixed;
  inset: 20% 10%;
  background: #21334a;
  padding: 35px;
  z-index: 100;
}
.dialog-content sub {
  font-size: 0.65rem;
}
@media (min-width: 1700px) {
  .workspace {
    grid-template-columns: 390px minmax(0, 1fr);
  }
  .control-section {
    padding-left: 28px;
    padding-right: 28px;
  }
  .state-field input {
    font-size: 0.875rem;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 322px minmax(0, 1fr);
  }
  .control-section {
    padding: 19px 16px;
  }
  .gesture-hint {
    display: none;
  }
  .readouts {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .scene-title {
    max-width: calc(100% - 186px);
    left: 18px;
  }
  .view-settings {
    right: 16px;
  }
  .view-settings select {
    max-width: 153px;
  }
  .camera-tools {
    width: max-content;
  }
  .camera-tools button {
    padding: 8px;
  }
  .playback {
    padding: 14px 16px;
    gap: 8px;
  }
  .speed-label {
    flex-direction: column;
    gap: 3px;
  }
  .legend {
    left: 18px;
  }
  .scene-bottom {
    left: 18px;
  }
  .playback-buttons {
    gap: 1px;
  }
}
@media (max-width: 760px) {
  .app-header {
    height: 71px;
    padding: 12px 15px;
  }
  .brand-mark {
    font-size: 2rem;
  }
  .brand {
    gap: 9px;
  }
  .brand h1 {
    font-size: 1.04rem;
  }
  .brand p {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }
  .header-actions {
    gap: 3px;
  }
  .header-actions .quiet {
    font-size: 0.75rem;
    max-width: 92px;
    padding: 5px 8px;
    min-height: 40px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 71px);
  }
  .viewer-column {
    height: auto;
    overflow: visible;
    display: flex;
  }
  .scene {
    height: clamp(380px, 62dvh, 590px);
    min-height: 380px;
    flex: none;
  }
  .controls {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .control-section {
    padding: 22px 18px;
    border-right: 1px solid var(--border);
  }
  .preset-section {
    grid-column: 1/-1;
  }
  .preset-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .preset-button {
    font-size: 0.875rem;
    padding: 10px;
  }
  .description {
    max-width: 600px;
  }
  .scene-title h2 {
    font-size: 1.45rem;
  }
  .scene-title {
    top: 20px;
  }
  .scene-title p {
    font-size: 0.75rem;
    line-height: 1.5;
  }
  .eyebrow {
    font-size: 0.62rem;
  }
  .view-settings {
    top: 18px;
    font-size: 0.7rem;
  }
  .legend {
    top: 118px;
    font-size: 0.75rem;
  }
  .playback {
    padding: 12px 15px;
  }
  .readouts {
    padding: 16px;
    gap: 17px;
    grid-template-columns: 1fr 1fr;
  }
  .readouts strong {
    font-size: 1.02rem;
  }
  .readouts span {
    font-size: 0.75rem;
  }
  .run-status {
    padding: 11px 16px;
  }
  .result-details {
    padding: 10px 16px;
  }
  .camera-tools {
    bottom: 43px;
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    max-width: calc(100% - 24px);
    justify-content: flex-start;
  }
  .camera-tools button {
    font-size: 0.75rem;
    min-height: 38px;
  }
  .scene-bottom {
    bottom: 16px;
    font-size: 0.65rem;
  }
  .control-footer {
    grid-column: 1/-1;
  }
  .state-field input {
    font-size: 0.78rem;
  }
  .graphics-error {
    top: 37%;
    font-size: 0.8rem;
  }
  .dialog-content {
    padding: 18px;
  }
  .dialog-heading {
    padding: 14px 18px;
  }
}
@media (max-width: 480px) {
  .controls {
    display: block;
  }
  .preset-grid {
    grid-template-columns: 1fr 1fr;
  }
  .control-section {
    padding: 22px 20px;
    border-right: 0;
  }
  .state-field input {
    font-size: 0.875rem;
  }
  .scene-title {
    max-width: calc(100% - 154px);
    left: 15px;
  }
  .scene-title h2 {
    font-size: 1.22rem;
  }
  .view-settings select {
    max-width: 137px;
    font-size: 0.75rem;
    padding-left: 7px;
  }
  .view-settings {
    right: 12px;
  }
  .legend {
    left: 15px;
    gap: 13px;
  }
  .scene {
    height: 420px;
  }
  .play {
    min-width: 75px;
    font-size: 0.8125rem;
    padding: 8px;
  }
  .speed-label {
    font-size: 0.625rem;
  }
  .speed-label select {
    min-width: 66px;
    padding-left: 7px;
  }
  .playback-buttons #restart {
    padding: 8px;
  }
  .scene-bottom {
    left: 15px;
  }
  .precision-control {
    grid-template-columns: 1fr 74px;
  }
  .header-actions .quiet {
    border: 0;
    max-width: 75px;
  }
  .dialog-content p,
  .dialog-content li {
    font-size: 0.875rem;
  }
}
.state-fields {
  grid-template-columns: 1fr;
  gap: 9px;
}
.state-field {
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.state-field label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.875rem;
}
.state-field input {
  font-size: 0.875rem;
  padding: 10px 9px;
}
.field-row label,
.input-explainer,
.precision-control > label,
.checkboxes label {
  font-size: 0.875rem;
}
.period-buttons button[aria-pressed="true"] {
  border-color: #5c907f;
  color: var(--green);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
