:root {
  color-scheme: dark;
  --bg: #080d16;
  --panel: #101923;
  --line: #253442;
  --text: #e3edf5;
  --muted: #91a7bb;
  --accent: #b9e9cd;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
a {
  color: var(--accent);
}
button,
input,
select {
  font: inherit;
}
button,
select,
input[type="datetime-local"] {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #172430;
  color: var(--text);
  padding: 9px 12px;
}
button {
  cursor: pointer;
}
button:hover,
button:focus-visible {
  border-color: var(--accent);
}
button.active {
  background: #274037;
  color: var(--accent);
  border-color: #75a18a;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 34px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.brand {
  text-decoration: none;
  font-size: 13px;
  color: var(--text);
}
main {
  padding: 28px 34px 40px;
  max-width: 1700px;
  margin: auto;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.intro > a {
  font-size: 12px;
  text-decoration: none;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 9px;
}
h1 {
  font-size: 34px;
  letter-spacing: -1px;
  font-weight: 450;
  margin: 0 0 8px;
}
.intro p:last-child {
  margin: 0;
  color: var(--muted);
}
#bodies {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 15px;
}
#bodies button {
  padding: 11px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--line);
}
#bodies button.active {
  background: #1a3032;
  border-bottom-color: var(--accent);
}
.orb {
  height: 12px;
  width: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: inset -3px -2px 4px #0006;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 16px;
}
.viewport {
  position: relative;
  height: 560px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
#scene,
#guides,
#labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#scene {
  touch-action: none;
  cursor: grab;
}
#guides,
#labels {
  pointer-events: none;
}
#labels button {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #c7d7e7;
  font-size: 10px;
  padding: 7px;
  pointer-events: auto;
  white-space: nowrap;
  text-shadow: 0 1px 4px #000;
}
#labels .point {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  background: var(--dot);
}
.view-heading {
  position: absolute;
  left: 25px;
  top: 25px;
  pointer-events: none;
  text-shadow: 0 2px 8px #000;
}
.view-heading h2 {
  font-size: 30px;
  font-weight: 450;
  margin: 0 0 7px;
  letter-spacing: -0.5px;
}
.view-heading p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}
.camera-buttons {
  position: absolute;
  right: 15px;
  top: 18px;
  display: flex;
  gap: 5px;
}
.camera-buttons button {
  font-size: 11px;
  padding: 7px 10px;
  background: #101923c9;
}
.view-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
  background: linear-gradient(transparent, #080d16);
}
aside,
.panel {
  background: var(--panel);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}
aside h2 {
  font-size: 29px;
  font-weight: 450;
  margin: 5px 0 22px;
}
dl {
  margin: 0;
}
dl > div {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
dt {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}
dd {
  font-size: 14px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}
.actions button {
  font-size: 11px;
}
#body-note,
.fine {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.timeline {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 17px 20px;
  margin: 18px 0;
}
.timeline label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
}
.scrub {
  flex: 1;
}
input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
  margin: 0;
}
.timeline button {
  white-space: nowrap;
}
.timeline select,
.timeline input[type="datetime-local"] {
  font-size: 11px;
}
#time-status {
  max-width: 170px;
  font-size: 10px;
  color: var(--accent);
}
.panels {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
}
h3 {
  font-weight: 450;
  font-size: 19px;
  margin: 0 0 19px;
}
.settings {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.settings label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings select {
  font-size: 10px;
  padding: 7px;
}
.panel p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin: 16px 0;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 400;
}
td,
th {
  padding: 8px 5px;
  border-bottom: 1px solid var(--line);
}
td:last-child {
  color: var(--muted);
}
details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  margin: 15px 0;
}
summary {
  cursor: pointer;
  font-size: 12px;
}
li {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 9px 0;
  overflow-wrap: anywhere;
}
footer {
  padding: 24px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  color: var(--muted);
}
#error {
  position: absolute;
  top: 45%;
  left: 20px;
  right: 20px;
  padding: 20px;
  background: #3a2424;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  #bodies {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .viewport {
    height: 580px;
  }
  .view-heading h2 {
    font-size: 24px;
  }
  .camera-buttons {
    top: auto;
    bottom: 48px;
  }
  .timeline {
    flex-wrap: wrap;
  }
  .scrub {
    min-width: 220px;
  }
  header > span:nth-child(2) {
    display: none;
  }
}
@media (max-width: 760px) {
  header {
    padding: 20px 16px;
  }
  .brand {
    font-size: 10px;
  }
  #status {
    font-size: 9px;
  }
  main {
    padding: 25px 15px;
  }
  .intro > a {
    display: none;
  }
  h1 {
    font-size: 28px;
  }
  .intro p:last-child {
    font-size: 11px;
  }
  #bodies {
    gap: 3px;
  }
  #bodies button {
    font-size: 10px;
    gap: 4px;
    padding: 10px 2px;
  }
  .workspace,
  .panels {
    grid-template-columns: minmax(0, 1fr);
  }
  .viewport {
    height: 460px;
  }
  .view-heading {
    left: 18px;
    top: 22px;
  }
  .view-heading h2 {
    font-size: 23px;
  }
  .view-bottom {
    font-size: 9px;
    flex-direction: column;
    gap: 6px;
  }
  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
  }
  aside > .eyebrow {
    grid-column: 1/-1;
  }
  aside h2 {
    grid-column: 1/-1;
    margin: 0;
  }
  aside dl {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .actions {
    grid-column: 1/-1;
    flex-direction: row;
    margin-top: 4px;
  }
  .actions button {
    flex: 1;
  }
  #body-note,
  .fine {
    grid-column: 1/-1;
    margin: 0;
  }
  .timeline {
    gap: 14px;
    padding: 14px;
  }
  .scrub {
    min-width: 180px;
  }
  #time-status {
    max-width: none;
  }
  .panel {
    padding: 17px;
  }
  footer {
    padding: 20px 16px;
    flex-direction: column;
    gap: 10px;
  }
  .dialog-heading {
    font-size: 9px;
    padding: 8px;
  }
  .dialog-heading button {
    font-size: 9px;
  }
  dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

[hidden] {
  display: none !important;
}
#atmosphere-mount,
#atmosphere-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#atmosphere-scene {
  touch-action: none;
  cursor: grab;
}
.viewport:fullscreen,
.viewport.expanded {
  width: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: var(--bg);
}
.viewport.expanded {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.atmospheric .view-heading {
  max-width: 55%;
}
.atmospheric .view-heading p {
  color: #d4e3eb;
}
.atmospheric #scene,
.atmospheric #guides,
.atmospheric #labels {
  visibility: hidden;
}
#air-hud {
  position: absolute;
  bottom: 54px;
  left: 18px;
  right: 18px;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#air-hud select,
#air-hud button {
  background: #0b1118c9;
  color: var(--text);
  font-size: 11px;
  padding: 7px 9px;
}
#air-level {
  min-width: 0;
  width: 100%;
}
.air-camera-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
[data-air-move] {
  touch-action: none;
  min-width: 32px;
}
#air-readout {
  align-self: flex-start;
  background: #0b1118a8;
  padding: 6px 9px;
  border-radius: 4px;
  font-size: 11px;
}
#air-panel {
  margin-top: 18px;
}
.air-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}
.air-controls label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  min-width: 100px;
  flex: 1;
}
.air-controls input[type="number"] {
  width: 110px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 4px;
}
.air-controls button,
.air-controls select {
  font-size: 11px;
}
#air-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}
#air-boundary {
  color: var(--accent);
}
.atmospheric .camera-buttons {
  top: 18px;
  bottom: auto;
}
@media (max-width: 1100px) {
  .atmospheric .view-heading {
    top: 65px;
    max-width: 90%;
  }
}
@media (max-width: 760px) {
  #air-hud {
    left: 12px;
    right: 12px;
    bottom: 62px;
  }
  #air-hud select,
  #air-hud button {
    font-size: 10px;
  }
  .air-controls label {
    min-width: 110px;
  }
  .atmospheric .camera-buttons {
    left: 12px;
    right: 12px;
    justify-content: flex-end;
  }
}

#air-profile {
  width: 100%;
  height: 230px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.air-plot-label {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 20px;
}
.air-plot-label select {
  font-size: 11px;
}

.workspace aside dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.workspace aside dd {
  font-size: 12px;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .air-camera-row {
    gap: 4px;
  }
  .air-camera-row #air-mode {
    max-width: 98px;
    font-size: 9px;
    padding: 7px 5px;
  }
  .air-camera-row [data-air-move] {
    font-size: 9px;
    padding: 7px 5px;
  }
}

/* Keep controls above the WebGL compositor through fullscreen/resize transitions. */
#guides, #labels { z-index:1; }
.view-heading, .camera-buttons, #air-hud, .view-bottom { z-index:2; }
#error { z-index:3; }
.view-heading, .camera-buttons { transform:translateZ(0); }
