:root {
  color-scheme: dark;
  --bg: #0a1016;
  --panel: #12242a;
  --border: #294047;
  --orange: #f18008;
  --text: #edf3f5;
  --muted: #8da6af;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    13px 'Segoe UI',
    Arial,
    sans-serif;
}
button,
input {
  font: inherit;
}
button {
  border: 1px solid #3a5057;
  background: #1b333c;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.15s;
}
button:hover {
  border-color: var(--orange);
  background: #29434c;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
.regulation-scroll:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
button.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #111d23;
  font-weight: 700;
}
header {
  margin: 16px 20px 20px;
  padding: 14px 20px;
  border: 1px solid #68441e;
  border-top: 3px solid var(--orange);
  border-radius: 12px;
  background: #12242a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 35px #0004;
}
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.symbol {
  font-size: 22px;
  line-height: 0.7;
  color: var(--orange);
  letter-spacing: 3px;
  width: 64px;
  padding: 8px;
}
.divider {
  height: 38px;
  width: 1px;
  background: #3c535b;
}
h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.6px;
}
h1 small {
  font-size: 9px;
  color: var(--orange);
  border: 1px solid #66401d;
  border-radius: 4px;
  padding: 3px 6px;
  vertical-align: middle;
  margin-left: 6px;
}
.brand p {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 5px 0 0;
}
.actions {
  display: flex;
  gap: 20px;
  align-items: center;
}
.family {
  font-size: 11px;
  color: var(--muted);
}
main {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  padding: 0 20px 20px;
  max-width: 2000px;
  margin: auto;
}
.panel {
  background: linear-gradient(135deg, #14282f, #101f26);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.settings {
  padding: 20px;
  align-self: start;
}
.eyebrow {
  color: var(--muted);
  letter-spacing: 1.5px;
  font-size: 9px;
  font-weight: 700;
}
.live {
  color: #62d7a8;
  float: right;
  font-size: 8px;
  letter-spacing: 0.4px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 12px 0 8px;
  letter-spacing: -0.3px;
}
.muted {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 0;
}
.settings section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 20px;
}
h3 {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-weight: 600;
}
h3 b {
  font-size: 10px;
  color: var(--orange);
}
h3 span {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
  font-size: 10px;
}
label {
  display: block;
  color: #b2c3c9;
  font-size: 11px;
}
output {
  float: right;
  color: var(--orange);
  font-family: Consolas, monospace;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--orange);
  cursor: pointer;
  margin: 12px 0 4px;
}
.range-caption {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 15px;
}
.full {
  width: 100%;
}
.note {
  font-size: 10px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 0;
}
.segment {
  background: #0d1d24;
  border: 1px solid var(--border);
  border-left: 3px solid var(--segment);
  padding: 11px;
  border-radius: 6px;
  margin-bottom: 9px;
}
.segment-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
}
.segment-title strong {
  color: var(--segment);
}
.segment-title span {
  color: var(--muted);
  font-size: 9px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.fields label {
  font-size: 9px;
}
input[type='number'] {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid #31464e;
  background: #12242a;
  border-radius: 4px;
  color: var(--text);
  padding: 7px;
  font:
    13px Consolas,
    monospace;
}
.dashed {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}
.status {
  border: 1px solid #315b4b;
  background: #16352d;
  color: #85dabb;
  padding: 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.7;
  margin-top: 20px;
}
.workspace {
  min-width: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stats > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #12242a;
  padding: 16px 18px;
}
.stats span {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.stats strong {
  display: block;
  font:
    500 27px Consolas,
    monospace;
  margin-top: 9px;
}
.stats small {
  font:
    10px 'Segoe UI',
    sans-serif;
  color: var(--muted);
  margin-left: 6px;
}
.viewport {
  height: clamp(430px, 59vh, 800px);
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #1b3039, #0b141c 80%);
}
#scene {
  width: 100%;
  height: 100%;
  touch-action: none;
}
#scene canvas {
  display: block;
}
.viewport-top {
  position: absolute;
  left: 21px;
  right: 21px;
  top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.viewport h2 {
  font-size: 17px;
  margin-top: 7px;
}
.badge {
  font-size: 9px;
  letter-spacing: 1px;
  color: #f5a24a;
  background: #f1800814;
  border: 1px solid #a56a2b55;
  border-radius: 4px;
  padding: 7px 10px;
}
.camera-tools {
  position: absolute;
  top: 85px;
  left: 21px;
  right: 21px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.camera-tools button {
  font-size: 10px;
  padding: 7px 11px;
  background: #12242ae8;
}
.camera-tools .active {
  color: var(--orange);
  border-color: var(--orange);
}
.scene-bottom {
  position: absolute;
  bottom: 18px;
  left: 21px;
  display: flex;
  gap: 16px;
  font-size: 9px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  margin-right: 5px;
}
.orange {
  background: #f18008;
}
.red {
  background: #e65749;
}
.green {
  background: #62d7a8;
}
.hint {
  position: absolute;
  bottom: 18px;
  right: 20px;
  color: #728d98;
  font-size: 9px;
}
.bottom {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.bottom .panel {
  padding: 18px;
}
.playback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.playback #clock {
  margin-left: auto;
  font: 17px Consolas;
  color: var(--muted);
}
.explanation h3 {
  margin: 13px 0 0;
  font-size: 15px;
}
.explanation .muted {
  font-size: 11px;
}
.explanation b {
  color: #d4e0e5;
  font-weight: 500;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #6c8993;
  font-size: 10px;
  padding: 17px 2px;
}
footer span {
  font-size: 8px;
  letter-spacing: 1px;
}
#error {
  position: absolute;
  top: 45%;
  left: 20%;
  right: 20%;
  background: #3a2e20;
  padding: 20px;
  color: #ffc486;
}
.regulation-fields { margin-top: 12px; }
.regulation-panel { margin-top: 14px; padding: 18px; }
.regulation-scroll { overflow-x: auto; margin-top: 12px; }
.regulation-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 11px; }
.regulation-table caption { text-align: left; padding-bottom: 12px; }
.regulation-table th, .regulation-table td { text-align: left; padding: 10px 9px; border-bottom: 1px solid var(--border); }
.regulation-table th { color: var(--muted); font-weight: 600; }
.regulation-table td[data-on='true'] { color: var(--orange); font-weight: 700; }
.regulation-table .command { font-weight: 700; color: var(--orange); }
input:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 1050px) {
  main {
    grid-template-columns: 270px 1fr;
    gap: 12px;
  }
  .settings {
    padding: 16px;
  }
  .stats > div {
    padding: 14px 10px;
  }
  .stats span {
    font-size: 8px;
    letter-spacing: 0.6px;
  }
  .stats strong {
    font-size: 23px;
  }
  .family,
  .hint {
    display: none;
  }
  .badge {
    font-size: 8px;
  }
  .bottom {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  header {
    margin: 12px;
    padding: 12px;
  }
  .symbol,
  .divider,
  .actions {
    display: none;
  }
  main {
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px;
  }
  .workspace {
    display: contents;
  }
  .stats {
    order: -2;
    gap: 6px;
  }
  .viewport {
    order: -1;
    height: 440px;
  }
  .stats small {
    display: block;
    margin: 4px 0 0;
  }
  .badge {
    display: none;
  }
  .bottom {
    margin: 0;
  }
  .scene-bottom {
    gap: 9px;
    font-size: 8px;
  }
  .settings {
    width: 100%;
  }
}
