*{box-sizing:border-box}
html,body{height:100%}
html{color-scheme:dark}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Helvetica,Arial,sans-serif;margin:0;background:#0b0b0b;color:#e6e6e6;display:flex;flex-direction:column}
button{display:inline-block;padding:8px 12px;border:1px solid #3a3a3a;border-radius:6px;background:#1e1e1e;color:#e6e6e6;cursor:pointer;font-size:inherit;font-family:inherit;line-height:1.2;text-decoration:none}
button:hover:enabled{background:#252525;border-color:#4a4a4a}
button:active:enabled{background:#2c2c2c}
button:disabled{opacity:.5;cursor:not-allowed}
.grow{flex:1 1 auto}
.row{display:flex;gap:8px;align-items:center}
input[type=text],input[type=password],input[type=number]{width:100%;padding:8px;border:1px solid #3a3a3a;border-radius:6px;font-family:inherit;background:#161616;color:#e6e6e6}
main{position:relative;flex:1 1 auto;min-height:0;display:flex;flex-direction:column}

/* simulation layout */
.sim-layout{flex:1 1 auto;display:flex;min-height:0}
#viewport{flex:1 1 auto;min-height:0;position:relative}
.flight-telemetry{
  --flight-accent:#8fd4ff;
  --flight-accent-soft:rgba(143,212,255,.22);
  --flight-accent-strong:#e9f6ff;
  --flight-accent-chip-bg:rgba(19,46,70,.72);
  --flight-vsi-pos:50%;
  --flight-g-pos:0%;
  --flight-pressure-pos:0%;
  position:absolute;
  top:0;
  left:0;
  right:0;
  display:flex;
  justify-content:center;
  z-index:11;
  pointer-events:none;
}
.flight-telemetry.trend-ascent{
  --flight-accent:#72f0c5;
  --flight-accent-soft:rgba(114,240,197,.22);
  --flight-accent-strong:#eafff6;
  --flight-accent-chip-bg:rgba(14,52,44,.78);
}
.flight-telemetry.trend-descent{
  --flight-accent:#ffb37c;
  --flight-accent-soft:rgba(255,179,124,.22);
  --flight-accent-strong:#fff1e7;
  --flight-accent-chip-bg:rgba(67,35,20,.78);
}
.flight-telemetry-shell{
  width:min(70%,800px,calc(100% - 24px));
  position:relative;
  overflow:hidden;
  padding:3px 6px 6px;
  background:
    linear-gradient(180deg,rgba(7,18,30,.97),rgba(3,10,18,.94)),
    repeating-linear-gradient(90deg,rgba(129,165,189,.08) 0,rgba(129,165,189,.08) 1px,transparent 1px,transparent 18px);
  border:1px solid rgba(132,173,198,.55);
  border-top:none;
  border-radius:0 0 18px 18px;
  box-shadow:0 18px 40px rgba(0,0,0,.42),inset 0 1px 0 rgba(217,235,248,.08);
  backdrop-filter:blur(12px);
}
.flight-telemetry-shell::before{
  content:"";
  position:absolute;
  top:0;
  left:18%;
  right:18%;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(238,248,255,.35),transparent);
}
.flight-telemetry-readout{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
}
.flight-telemetry-block{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  gap:4px;
  min-height:78px;
  padding:5px 6px;
  border:1px solid rgba(105,152,184,.22);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(13,30,46,.72),rgba(7,17,28,.86));
  box-shadow:inset 0 1px 0 rgba(217,235,248,.04);
}
.flight-telemetry-block-accent{
  box-shadow:inset 0 1px 0 rgba(217,235,248,.04);
}
.flight-telemetry-label{
  font-size:10px;
  line-height:1;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:#7f97a8;
}
.flight-telemetry-value{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:18px;
  line-height:1.05;
  font-weight:700;
  color:#e9f4ff;
  white-space:nowrap;
}
.flight-telemetry-block-accent .flight-telemetry-value{
  color:var(--flight-accent-strong);
}
.flight-telemetry-note{
  font-size:10px;
  line-height:1.15;
  color:#84a9c2;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.flight-telemetry-vsi{
  position:relative;
  width:100%;
  height:18px;
  margin-top:1px;
}
.flight-telemetry-vsi::before{
  content:"";
  position:absolute;
  left:4px;
  right:4px;
  top:50%;
  height:6px;
  transform:translateY(-50%);
  border:1px solid rgba(110,147,171,.22);
  border-radius:999px;
  background:linear-gradient(90deg,rgba(235,136,94,.25),rgba(118,154,182,.34) 50%,rgba(73,211,175,.25));
}
.flight-telemetry-vsi-mark{
  position:absolute;
  top:3px;
  bottom:3px;
  width:1px;
  background:rgba(207,226,239,.45);
}
.flight-telemetry-vsi-mark-left{left:18%}
.flight-telemetry-vsi-mark-center{left:50%}
.flight-telemetry-vsi-mark-right{left:82%}
.flight-telemetry-vsi-needle{
  position:absolute;
  top:1px;
  bottom:1px;
  width:2px;
  left:calc(var(--flight-vsi-pos) - 1px);
  border-radius:999px;
  background:var(--flight-accent);
  transition:left .12s linear,background-color .12s linear,box-shadow .12s linear;
}
.flight-telemetry-gmeter{
  position:relative;
  width:100%;
  height:18px;
  margin-top:1px;
}
.flight-telemetry-gmeter::before{
  content:"";
  position:absolute;
  left:4px;
  right:4px;
  top:50%;
  height:6px;
  transform:translateY(-50%);
  border:1px solid rgba(110,147,171,.22);
  border-radius:999px;
  background:linear-gradient(90deg,rgba(86,170,214,.28),rgba(102,218,162,.28) 38%,rgba(224,198,94,.28) 70%,rgba(232,116,116,.3));
}
.flight-telemetry-gmeter-mark{
  position:absolute;
  top:3px;
  bottom:3px;
  width:1px;
  background:rgba(207,226,239,.45);
}
.flight-telemetry-gmeter-mark-left{left:18%}
.flight-telemetry-gmeter-mark-center{left:50%}
.flight-telemetry-gmeter-mark-right{left:82%}
.flight-telemetry-gmeter-needle{
  position:absolute;
  top:1px;
  bottom:1px;
  width:2px;
  left:calc(var(--flight-g-pos) - 1px);
  border-radius:999px;
  background:#ffe792;
  transition:left .12s linear,background-color .12s linear,box-shadow .12s linear;
}
.flight-telemetry-pressure{
  position:relative;
  width:100%;
  height:18px;
  margin-top:1px;
}
.flight-telemetry-pressure::before{
  content:"";
  position:absolute;
  left:4px;
  right:4px;
  top:50%;
  height:6px;
  transform:translateY(-50%);
  border:1px solid rgba(110,147,171,.22);
  border-radius:999px;
  background:linear-gradient(90deg,rgba(120,140,160,.18),rgba(100,180,220,.30) 50%,rgba(80,200,240,.38));
}
.flight-telemetry-pressure-mark{
  position:absolute;
  top:3px;
  bottom:3px;
  width:1px;
  background:rgba(207,226,239,.45);
}
.flight-telemetry-pressure-mark-left{left:18%}
.flight-telemetry-pressure-mark-center{left:50%}
.flight-telemetry-pressure-mark-right{left:82%}
.flight-telemetry-pressure-needle{
  position:absolute;
  top:1px;
  bottom:1px;
  width:2px;
  left:calc(var(--flight-pressure-pos) - 1px);
  border-radius:999px;
  background:#8fd4ff;
  transition:left .12s linear,background-color .12s linear,box-shadow .12s linear;
}
.sim-controls{position:absolute;top:12px;right:12px;display:flex;gap:6px;z-index:15}
.sim-controls button{width:34px;height:34px;padding:0;border-color:#2d6a93;background:rgba(12,43,68,.86);color:#bce7ff;display:inline-flex;align-items:center;justify-content:center}
.sim-controls button:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.sim-controls button.active{border-color:#87cbff;background:rgba(33,82,120,.95);color:#e6f8ff}
#disconnectBtn{border-color:#9f3838;background:rgba(86,24,24,.9);color:#ffdede}
#disconnectBtn:hover:enabled{border-color:#e36a6a;background:rgba(122,32,32,.94);color:#fff4f4}
.sim-action-icon{width:18px;height:18px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.spawn-craft-controls{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:10;display:flex;gap:8px}
.sim-text-btn{height:34px;padding:0 12px;border-color:#2d6a93;background:rgba(12,43,68,.86);color:#bce7ff;font-size:13px}
.sim-text-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.sim-sidebar{position:absolute;top:12px;left:12px;z-index:18;display:flex;flex-direction:column;align-items:stretch;gap:6px}
.sim-sidebar-btn{
  height:34px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 14px 0 10px;
  font-size:13px;
  color:#bce7ff;
  border-color:rgba(97,155,190,.72);
  background:
    linear-gradient(180deg,rgba(11,40,63,.94),rgba(5,20,35,.94)),
    repeating-linear-gradient(90deg,rgba(112,164,196,.08) 0,rgba(112,164,196,.08) 1px,transparent 1px,transparent 14px);
  box-shadow:0 10px 24px rgba(0,0,0,.28);
}
.sim-sidebar-btn:hover:enabled{
  border-color:rgba(143,220,255,.82);
  color:#e9f8ff;
}
.sim-sidebar-btn.active{
  border-color:rgba(143,220,255,.82);
  background:
    linear-gradient(180deg,rgba(18,56,83,.98),rgba(8,28,46,.98)),
    repeating-linear-gradient(90deg,rgba(139,210,247,.1) 0,rgba(139,210,247,.1) 1px,transparent 1px,transparent 14px);
  color:#e9f8ff;
}
.side-panel-dock{
  --side-panel-width:min(30vw,400px);
  flex:0 0 0;
  min-width:0;
  max-width:0;
  position:relative;
  overflow:hidden;
  opacity:0;
  pointer-events:none;
  border-right:1px solid rgba(118,167,194,.55);
  background:
    linear-gradient(180deg,rgba(6,19,31,1),rgba(3,10,18,1)),
    repeating-linear-gradient(0deg,rgba(116,156,181,.06) 0,rgba(116,156,181,.06) 1px,transparent 1px,transparent 20px);
  box-shadow:12px 0 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(222,238,248,.08);
  overscroll-behavior:contain;
  transition:flex-basis .3s cubic-bezier(.4,0,.2,1),max-width .3s cubic-bezier(.4,0,.2,1),opacity .2s ease;
}
.side-panel-dock:has(.side-panel.side-panel-open){
  flex-basis:var(--side-panel-width);
  max-width:var(--side-panel-width);
  opacity:1;
  pointer-events:auto;
}
.side-panel{
  position:absolute;
  top:0;
  left:0;
  bottom:0;
  width:var(--side-panel-width);
  overflow:hidden;
  opacity:0;
  pointer-events:none;
  display:flex;
  flex-direction:column;
  contain:layout paint style;
  transition:opacity .2s ease;
}
.side-panel.side-panel-open{
  opacity:1;
  pointer-events:auto;
}
.resource-panel-header{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px 16px 14px;
  border-bottom:1px solid rgba(108,149,176,.2);
}
.resource-panel-header::after{
  content:"";
  position:absolute;
  left:18px;
  right:18px;
  bottom:0;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(214,235,248,.14),transparent);
}
.resource-panel-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.resource-panel-kicker{
  font-size:10px;
  line-height:1;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:#83a0b3;
}
.resource-panel-title{
  margin:0;
  font-size:22px;
  line-height:1.1;
  font-weight:700;
  color:#edf7ff;
  text-align:left;
}
.resource-panel-subtitle{
  margin:0;
  font-size:12px;
  line-height:1.35;
  color:#93afc1;
}
.resource-panel-close{
  width:34px;
  height:34px;
  padding:0;
  border-radius:10px;
  border:1px solid rgba(108,149,176,.28);
  background:rgba(11,31,47,.86);
  color:#bddcf0;
  font-size:20px;
  line-height:1;
}
.resource-panel-body{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.resource-panel-section{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:14px 16px 16px;
}
.resource-section-header{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.resource-section-title,
.resource-empty-title{
  margin:0;
  font-size:16px;
  line-height:1.2;
  font-weight:600;
  text-align:left;
  color:#eef8ff;
}
.resource-section-caption{
  font-size:12px;
  line-height:1.35;
  color:#8eaabc;
}
.resource-overview-list,
.resource-storage-list{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:5px 2px 5px 0;
  margin-block:-5px;
  scroll-padding-block:5px;
}
.resource-overview-card,
.resource-storage-row{
  --resource-accent:#7de3ff;
  --resource-accent-soft:rgba(125,227,255,.16);
}
.resource-overview-card{
  display:block;
  width:100%;
  text-align:left;
  border-radius:16px;
  border:1px solid rgba(112,159,189,.26);
  background:
    linear-gradient(180deg,var(--resource-accent-soft),rgba(5,20,33,.82)),
    linear-gradient(180deg,rgba(13,34,50,.76),rgba(5,16,27,.92));
  padding:14px 14px 12px;
  box-shadow:inset 0 1px 0 rgba(222,238,248,.05);
}
.resource-overview-card:hover{
  border-color:rgba(148,204,236,.52);
}
.resource-overview-card.is-active,
.resource-storage-row.is-active,
.resource-detail-back:focus-visible{
  outline:2px solid var(--resource-accent,#7de3ff);
  outline-offset:2px;
  border-color:rgba(148,204,236,.52);
}
.resource-overview-head{
  display:flex;
  align-items:baseline;
  gap:8px;
}
.resource-overview-head .resource-overview-name{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.resource-overview-head .resource-overview-fill{
  flex-shrink:0;
  margin-left:auto;
}
.resource-detail-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.resource-storage-top{
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
}
.resource-storage-top .resource-storage-title{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.resource-storage-top .resource-storage-amount{
  flex-shrink:0;
  margin-left:auto;
}
.resource-storage-bottom{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:6px;
}
.resource-storage-bottom .resource-meter{
  flex:1 1 auto;
  margin-top:0;
}
.resource-overview-name,
.resource-storage-title{
  font-size:15px;
  line-height:1.2;
  font-weight:600;
  color:#eef7ff;
}
.resource-overview-meta{
  font-size:12px;
  line-height:1.3;
  color:#91adc0;
}
.resource-overview-fill,
.resource-storage-fill{
  flex-shrink:0;
  font-size:12px;
  line-height:1.2;
  font-weight:600;
  color:var(--resource-accent);
}
.resource-overview-amount,
.resource-storage-amount{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#f3fbff;
}
.resource-overview-amount-row{
  display:flex;
  align-items:baseline;
  gap:8px;
  margin-top:10px;
}
.resource-overview-amount{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:19px;
  line-height:1.1;
}
.resource-overview-transport{
  flex-shrink:0;
  margin-left:auto;
  padding:3px 8px;
  border-radius:999px;
  font-size:10px;
  line-height:1;
  letter-spacing:.04em;
  background:rgba(255,255,255,.06);
  color:var(--resource-accent);
  border:1px solid rgba(255,255,255,.06);
}
.resource-meter{
  position:relative;
  width:100%;
  height:10px;
  margin-top:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(110,146,168,.14);
  border:1px solid rgba(106,146,171,.16);
}
.resource-meter-tight{
  height:8px;
  margin-top:10px;
}
.resource-meter-fill{
  position:absolute;
  inset:0 auto 0 0;
  width:0;
  border-radius:999px;
  background:linear-gradient(90deg,var(--resource-accent),rgba(255,255,255,.86));
  box-shadow:0 0 18px var(--resource-accent-soft);
  transition:width .12s linear;
}
.resource-detail-back{
  flex-shrink:0;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#c0dff2;
  background:rgba(11,31,47,.82);
  border-color:rgba(108,149,176,.32);
}
.resource-storage-row{
  border-radius:15px;
  border:1px solid rgba(112,159,189,.2);
  background:
    linear-gradient(180deg,var(--resource-accent-soft),rgba(6,18,31,.8)),
    linear-gradient(180deg,rgba(10,27,41,.76),rgba(4,14,24,.94));
  padding:10px 12px 9px;
  box-shadow:inset 0 1px 0 rgba(222,238,248,.04);
}
.resource-storage-row:hover{
  border-color:rgba(148,204,236,.42);
}
.resource-storage-amount{
  font-size:13px;
  line-height:1.2;
}
.resource-storage-flow{
  flex-shrink:0;
  font-size:11px;
  line-height:1.2;
  color:#8eaabc;
}
.resource-panel-empty{
  margin:auto;
  max-width:280px;
  padding:18px;
  text-align:center;
  color:#97b2c4;
}
.resource-empty-title{
  text-align:center;
}
.resource-empty-text{
  margin:10px 0 0;
  font-size:13px;
  line-height:1.5;
}
.map-object-header{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 18px 15px;
  border-bottom:1px solid rgba(103,163,194,.16);
  background:
    radial-gradient(circle at 18% -40%,rgba(88,196,230,.2),transparent 58%),
    linear-gradient(180deg,rgba(9,29,44,.96),rgba(5,18,29,.92));
}
.map-object-header-copy{min-width:0;display:flex;flex-direction:column;gap:4px}
.map-object-title{margin:0;font-size:23px;line-height:1.1;font-weight:700;color:#f0f9ff;text-align:left}
.map-object-close{
  width:34px;
  height:34px;
  flex-shrink:0;
  padding:0;
  border-radius:50%;
  border:1px solid rgba(111,177,207,.3);
  background:rgba(7,26,40,.88);
  color:#b9ddeb;
  font-size:20px;
  line-height:1;
}
.map-object-close:hover:enabled{border-color:rgba(116,223,235,.7);background:rgba(12,46,64,.94);color:#effcff}
.map-object-filters{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:8px;
  padding:12px 16px;
  border-bottom:1px solid rgba(103,163,194,.16);
  background:rgba(4,15,25,.72);
}
.map-object-filter{
  min-width:0;
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  border-radius:11px;
  border-color:rgba(93,145,176,.28);
  background:rgba(9,27,42,.7);
  color:#8fa9b9;
  text-align:left;
}
.map-object-filter:hover:enabled{border-color:rgba(111,191,216,.55);background:rgba(12,39,57,.86);color:#d8eff7}
.map-object-filter.active{
  border-color:rgba(105,216,230,.58);
  background:linear-gradient(180deg,rgba(22,64,76,.78),rgba(8,34,48,.9));
  color:#e7fcff;
  box-shadow:inset 0 1px 0 rgba(203,249,255,.08),0 0 20px rgba(105,216,230,.08);
}
.map-object-filter-symbol{position:relative;width:22px;height:22px;display:block}
.map-object-filter-craft .map-object-filter-symbol::before{
  content:"";
  position:absolute;
  left:6px;
  top:4px;
  width:0;
  height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-bottom:14px solid currentColor;
  transform:rotate(18deg);
  filter:drop-shadow(0 0 5px rgba(111,230,241,.35));
}
.map-object-filter-craft .map-object-filter-symbol::after{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  width:20px;
  height:8px;
  border:1px solid currentColor;
  border-color:currentColor transparent transparent;
  border-radius:50%;
  transform:rotate(-18deg);
  opacity:.65;
}
.map-object-filter-body .map-object-filter-symbol::before{
  content:"";
  position:absolute;
  inset:4px;
  border:1.5px solid currentColor;
  border-radius:50%;
  background:radial-gradient(circle at 35% 32%,rgba(255,255,255,.35),transparent 24%);
  box-shadow:0 0 8px rgba(111,230,241,.18);
}
.map-object-filter-body .map-object-filter-symbol::after{
  content:"";
  position:absolute;
  left:1px;
  top:9px;
  width:20px;
  height:7px;
  border:1px solid currentColor;
  border-radius:50%;
  transform:rotate(-17deg);
}
.map-object-filter-label{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:600;white-space:nowrap}
.map-object-filter-count{
  min-width:22px;
  padding:3px 6px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:#a9c4d2;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:10px;
  line-height:1;
  text-align:center;
}
.map-object-filter.active .map-object-filter-count{background:rgba(105,216,230,.12);color:#bff8ff}
.map-object-body{flex:1 1 auto;min-height:0;position:relative;padding:13px 13px 10px}
.map-object-list{
  height:100%;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:9px;
  padding:3px 3px 8px;
  scroll-padding-block:3px;
}
.map-object-card{
  --object-accent:#72dbe8;
  --object-accent-soft:rgba(73,190,205,.12);
  width:100%;
  flex:0 0 auto;
  display:block;
  position:relative;
  overflow:hidden;
  padding:13px 13px 11px;
  border:1px solid rgba(102,151,178,.24);
  border-radius:15px;
  background:
    linear-gradient(125deg,var(--object-accent-soft),transparent 46%),
    linear-gradient(180deg,rgba(11,31,46,.9),rgba(5,17,28,.96));
  box-shadow:inset 0 1px 0 rgba(221,241,250,.05),0 9px 22px rgba(0,0,0,.13);
  color:#eef8ff;
  text-align:left;
  transition:border-color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.map-object-card::before{
  content:"";
  position:absolute;
  left:0;
  top:12px;
  bottom:12px;
  width:2px;
  border-radius:0 4px 4px 0;
  background:var(--object-accent);
  opacity:.42;
  box-shadow:0 0 12px var(--object-accent);
}
.map-object-card:hover:enabled{
  transform:translateX(2px);
  border-color:rgba(126,197,222,.48);
  background:
    linear-gradient(125deg,var(--object-accent-soft),transparent 54%),
    linear-gradient(180deg,rgba(14,38,55,.94),rgba(6,21,33,.98));
}
.map-object-card:focus-visible{outline:2px solid var(--object-accent);outline-offset:2px}
.map-object-card.is-focused{
  border-color:var(--object-accent);
  box-shadow:inset 0 1px 0 rgba(229,249,255,.08),0 0 0 1px color-mix(in srgb,var(--object-accent) 22%,transparent),0 12px 28px rgba(0,0,0,.22);
}
.map-object-card.is-focused::before{width:3px;opacity:1}
.map-object-card.state-surface{--object-accent:#6fcb75;--object-accent-soft:rgba(111,203,117,.14)}
.map-object-card.state-flight{--object-accent:#63d2f2;--object-accent-soft:rgba(99,210,242,.14)}
.map-object-card.state-suborbital{--object-accent:#5a9bea;--object-accent-soft:rgba(90,155,234,.14)}
.map-object-card.state-orbit{--object-accent:#9a70e8;--object-accent-soft:rgba(154,112,232,.15)}
.map-object-card.state-escape{--object-accent:#e05aae;--object-accent-soft:rgba(224,90,174,.15)}
.map-object-card.state-body{--object-accent:#4cc9a7;--object-accent-soft:rgba(76,201,167,.14)}
.map-object-card.state-unknown{--object-accent:#91a1ad;--object-accent-soft:rgba(145,161,173,.12)}
.map-object-card-head{display:flex;align-items:center;gap:11px;min-width:0}
.map-object-card-identity{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.map-object-card-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;line-height:1.15;font-weight:700;color:#f1f9ff}
.map-object-state-line{display:flex;align-items:center;gap:7px;min-width:0;margin-top:12px}
.map-object-state{display:flex;align-items:center;gap:6px;min-width:0;color:var(--object-accent);font-size:11px;font-weight:600;white-space:nowrap}
.map-object-state-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:var(--object-accent);box-shadow:0 0 8px var(--object-accent)}
.map-object-marker{
  flex:0 0 auto;
  margin-left:auto;
  padding:3px 6px;
  border-radius:999px;
  font-size:9px;
  line-height:1;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.map-object-focus{border:1px solid rgba(216,255,62,.34);background:rgba(216,255,62,.1);color:#d8ff3e}
.map-object-controlled{border:1px solid rgba(255,79,63,.34);background:rgba(255,79,63,.1);color:#ff4f3f}
.map-object-metrics{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
  padding-top:9px;
  border-top:1px solid rgba(100,148,173,.13);
}
.map-object-metric{min-width:0;display:flex;flex-direction:column;gap:3px}
.map-object-metric + .map-object-metric{padding-left:9px;border-left:1px solid rgba(100,148,173,.13)}
.map-object-metric-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;line-height:1;text-transform:uppercase;letter-spacing:.13em;color:#668595}
.map-object-metric-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.2;color:#dcecf4}
.map-object-empty{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:30px 24px;
  color:#7f9baa;
  text-align:center;
}
.map-object-empty-orbit{position:relative;width:58px;height:58px;margin-bottom:14px;border:1px solid rgba(108,207,220,.24);border-radius:50%}
.map-object-empty-orbit::before{content:"";position:absolute;inset:18px;border:2px solid #6acbd8;border-radius:50%;box-shadow:0 0 14px rgba(106,203,216,.3)}
.map-object-empty-orbit::after{content:"";position:absolute;left:-7px;top:22px;width:70px;height:17px;border:1px solid rgba(106,203,216,.6);border-radius:50%;transform:rotate(-16deg)}
.map-object-empty-title{margin:0;color:#d9ebf3;font-size:15px;line-height:1.2;text-align:center}
.map-object-empty-copy{max-width:250px;margin:8px 0 0;font-size:12px;line-height:1.5}
.control-craft-btn{position:absolute;bottom:12px;right:12px;z-index:10}
.replay-panel{
  position:absolute;
  right:12px;
  bottom:12px;
  z-index:12;
  width:min(320px,calc(100vw - 24px));
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  border:1px solid rgba(97,155,190,.62);
  border-radius:14px;
  background:
    linear-gradient(180deg,rgba(8,29,45,.96),rgba(4,15,26,.96)),
    repeating-linear-gradient(90deg,rgba(114,167,198,.08) 0,rgba(114,167,198,.08) 1px,transparent 1px,transparent 14px);
  box-shadow:0 16px 34px rgba(0,0,0,.4);
}
.replay-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.replay-row-head{
  justify-content:space-between;
}
.replay-row-tight > button{
  flex:1 1 0;
  min-width:0;
}
.replay-field{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.replay-field-label{
  font-size:10px;
  line-height:1;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#8eb2c7;
}
.replay-select,
.replay-panel input[type=number]{
  width:100%;
  padding:8px;
  border:1px solid rgba(93,145,176,.38);
  border-radius:8px;
  background:rgba(7,21,34,.92);
  color:#eef8ff;
}
.replay-panel button{
  padding:7px 10px;
  border-color:rgba(93,145,176,.38);
  background:rgba(12,39,59,.92);
}
.replay-panel button:hover:enabled{
  border-color:rgba(121,190,229,.62);
  background:rgba(18,55,81,.96);
}
.replay-toggle-btn{
  flex:0 0 auto;
}
.replay-status-chip{
  padding:5px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  color:#d8eefb;
  font-size:11px;
  line-height:1;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.replay-speed-value{
  margin-left:auto;
}
.replay-mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#eef7ff;
  font-size:12px;
}
.control-help{position:absolute;top:12px;left:12px;z-index:10;font-size:12px;background:rgba(0,0,0,.7);color:#fff;padding:6px 8px;border-radius:4px;border:1px solid #444;pointer-events:none}
.navball-container{
  position:absolute;
  bottom:16px;
  left:50%;
  transform:translateX(-50%);
  z-index:11;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  pointer-events:none;
}
.navball-row{
  position:relative;
}
.throttle-indicator{
  width:14px;
  height:180px;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(132,173,198,.4);
  border-radius:4px;
  position:absolute;
  right:calc(100% + 8px);
  bottom:0;
}
.throttle-fill{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  height:0%;
  background:linear-gradient(to top,#2a8a2a,#5ec45e);
  transition:height 30ms linear;
}
.throttle-label{
  position:absolute;
  bottom:4px;
  left:50%;
  transform:translateX(-50%);
  font-size:8px;
  font-weight:bold;
  color:#fff;
  text-shadow:0 1px 2px rgba(0,0,0,.8);
  line-height:1;
  pointer-events:none;
  z-index:1;
  white-space:nowrap;
}
.navball-frame{
  width:180px;
  height:180px;
  border-radius:50%;
  overflow:hidden;
  position:relative;
  border:2px solid rgba(132,173,198,.55);
  box-shadow:0 6px 20px rgba(0,0,0,.5),inset 0 0 16px rgba(0,0,0,.25);
}
.navball-frame::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:radial-gradient(circle,transparent 50%,rgba(0,0,0,.25) 72%,rgba(0,0,0,.55) 100%);
  pointer-events:none;
}
.navball-canvas{position:absolute;top:0;left:0;width:100%;height:100%;display:block}
.navball-reticle{position:absolute;inset:0;pointer-events:none;z-index:1}
.navball-toggle{
  pointer-events:auto;
  padding:3px 14px;
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.guidance-mode-panel{
  display:grid;
  grid-template-columns:repeat(2,36px);
  grid-template-rows:repeat(4,36px);
  gap:4px;
  pointer-events:auto;
  position:absolute;
  left:calc(100% + 8px);
  bottom:0;
}
.guidance-mode-btn{
  width:36px;
  height:36px;
  padding:0;
  border:1px solid rgba(132,173,198,.5);
  background:rgba(0,0,0,.55);
  color:#cfe3f2;
  border-radius:4px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:background .15s,color .15s,border-color .15s;
}
.guidance-mode-btn:hover{
  background:rgba(80,120,160,.4);
  color:#fff;
}
.guidance-mode-btn.active{
  background:rgba(255,170,0,.22);
  border-color:#ffaa00;
  color:#ffcc44;
}
.guidance-mode-btn svg{width:26px;height:26px;display:block}
.sim-layout.editor-mode #viewport{background:radial-gradient(circle at 30% 20%,rgba(38,99,163,.28),rgba(3,12,25,.95) 55%,rgba(2,7,15,1));}
.sim-layout.editor-mode .world-debug-only{display:none !important;}
.sim-layout.editor-mode .world-setting-row{display:none}
.sim-layout.editor-mode .sim-controls{display:none}
.sim-layout:not(.editor-mode) .editor-setting-row{display:none}

label{font-size:12px;color:#aaa}
.lobby-controls{flex:1 1 auto;display:flex;min-height:0}
.lobby-controls-inner{max-width:400px;width:100%;padding:24px;border-radius:12px;background:#111;border:1px solid #2a2a2a;display:flex;flex-direction:column;gap:16px}
.lobby-loading{margin:auto;align-items:center;text-align:center}
.lobby-loading-logo{height:110px}
.field{display:flex;flex-direction:column;gap:4px}
.lobby-buttons{display:flex;gap:12px;align-items:center;justify-content:center}

.lobby-screen{
  width:100%;
  max-width:1840px;
  margin:0 auto;
  min-height:0;
  padding:24px clamp(16px,2vw,32px);
  display:flex;
  flex-direction:column;
  gap:18px;
}
.lobby-toolbar{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.lobby-server-summary{display:flex;flex-direction:column;gap:4px;min-width:220px}
.lobby-server-summary span{font-size:12px;color:#aaa}
.lobby-server-summary strong{font-size:14px;color:#eef6ff;font-weight:600}
.lobby-toolbar-actions{display:flex;gap:10px;align-items:center;margin-left:auto;flex-wrap:wrap}

.lobby-server-browser{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-columns:240px minmax(0,1fr) 300px;
  border:1px solid #20282f;
  border-radius:12px;
  background:#0b0f12;
}
.lobby-server-list{
  min-height:0;
  overflow-y:auto;
  padding:12px;
  border-right:1px solid #20282f;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.lobby-server-item{
  width:100%;
  text-align:left;
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:11px;
  border:1px solid #232b31;
  border-radius:8px;
  background:#11161a;
  color:#dce8ee;
  cursor:pointer;
}
.lobby-server-item:hover{border-color:#34505f;background:#141c22}
.lobby-server-item.selected{
  border-color:#4b8ba0;
  background:#142228;
  box-shadow:inset 0 0 0 1px rgba(75,139,160,.35);
}
.lobby-server-item.checking{opacity:.9}
.lobby-server-item.unreachable{opacity:.85}
.lobby-server-item.offline{opacity:.78}
.lobby-server-item-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.lobby-server-title{min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.server-status{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.05em;
  border-radius:999px;
  padding:2px 7px;
  border:1px solid #36434b;
  color:#aebbc5;
}
.server-status.online{color:#9ce5c2;border-color:rgba(80,180,130,.32);background:rgba(60,150,110,.12)}
.server-status.checking{color:#f1d48a;border-color:rgba(215,180,106,.35);background:rgba(160,120,40,.12)}
.server-status.unreachable{color:#f0bd93;border-color:rgba(214,140,84,.35);background:rgba(170,95,45,.12)}
.server-status.offline{color:#eca5a5;border-color:rgba(200,90,90,.32);background:rgba(150,60,60,.12)}
.lobby-server-endpoint,.lobby-detail-mono{
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:11px;
  color:#7d8c96;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.lobby-server-meta{font-size:12px;color:#94a5b0}
.lobby-session-pane{
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.lobby-session-pane-head{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid #20282f;
}
.lobby-session-pane-head h2{margin:0;font-size:15px;text-align:left;color:#eef6ff}
.lobby-session-pane-head p{margin:3px 0 0;font-size:12px;color:#8fa1ad}
.lobby-session-list{
  min-height:0;
  overflow:auto;
  padding:14px;
}
.lobby-session-table{
  display:table;
  width:100%;
  min-width:max-content;
  table-layout:auto;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid #20282f;
  border-radius:8px;
  overflow:hidden;
}
.lobby-session-row{
  display:table-row;
  background:#11161a;
  cursor:pointer;
}
.lobby-session-row > *{
  display:table-cell;
  height:42px;
  padding:0 12px;
  border-bottom:1px solid #1c242a;
  background:inherit;
  vertical-align:middle;
  white-space:nowrap;
}
.lobby-session-row > *:first-child{padding-left:14px}
.lobby-session-row > *:last-child{padding-right:14px}
.lobby-session-row:last-child > *{border-bottom:0}
.lobby-session-row:hover > *{background:#141c22}
.lobby-session-row.selected > *{background:#152634}
.lobby-session-row.selected > *:first-child{box-shadow:inset 2px 0 0 #4b8ba0}
.lobby-session-row:focus-visible > *{background:#17232c}
.lobby-session-row:focus-visible > *:first-child{box-shadow:inset 2px 0 0 #6aa8bf}
.lobby-session-row.disabled{cursor:not-allowed}
.lobby-session-row.disabled > *{opacity:.5}
.lobby-session-row-head{
  background:#0d1216;
  color:#758692;
  font-size:10.5px;
  text-transform:uppercase;
  letter-spacing:.06em;
  cursor:default;
}
.lobby-session-row-head > *{height:34px}
.lobby-session-row-head span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.lobby-session-row-head span:nth-child(n+4){text-align:right}
.lobby-session-name,.lobby-session-world{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.lobby-session-name{font-size:13.5px;color:#eef6ff;font-weight:500}
.lobby-session-world{font-size:12.5px;color:#9fb2c0}
.lobby-session-kind-cell{text-align:left}
.lobby-session-kind{
  display:inline-flex;
  align-items:center;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#b8c4cc;
  border:1px solid #3a4650;
  border-radius:999px;
  padding:2px 8px;
}
.lobby-session-kind.live{color:#9ce5c2;border-color:rgba(80,180,130,.32);background:rgba(60,150,110,.12)}
.lobby-session-num,.lobby-session-updated{font-size:12px;color:#c3d0d9;text-align:right;font-variant-numeric:tabular-nums}
.lobby-session-updated{color:#8a98a3}
.lobby-details-pane{
  min-height:0;
  overflow-y:auto;
  padding:16px;
  border-left:1px solid #20282f;
  display:flex;
  flex-direction:column;
  gap:10px;
  background:#0d1114;
}
.lobby-detail-title{margin-bottom:4px}
.lobby-detail-title h2{margin:0;font-size:15px;text-align:left;color:#eef6ff}
.lobby-detail-title p{margin:3px 0 0;font-size:12px;color:#8fa1ad}
.lobby-detail-row{
  display:grid;
  grid-template-columns:88px minmax(0,1fr);
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid #1b2329;
  font-size:12px;
}
.lobby-detail-row span:first-child{color:#82919b}
.lobby-detail-row span:last-child{color:#d0dce3;min-width:0;overflow:hidden;text-overflow:ellipsis}
.lobby-detail-connect-btn{margin-top:4px;background:#1d3a4a;border-color:#356076;color:#eaf6ff}
.lobby-empty{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  padding:48px 24px;
}
.lobby-empty-title{font-size:15px;color:#9aa7b2}
.lobby-empty-sub{font-size:12.5px;color:#6f7d88}
.lobby-empty.offline .lobby-empty-title{color:#e08a8a}
.lobby-step-nav{display:none}
.lobby-back-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid #232b31;
  border-radius:8px;
  background:#11161a;
  color:#dce8ee;
  font-size:13px;
}
.lobby-back-btn:hover:enabled{border-color:#34505f;background:#141c22}
.lobby-back-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:980px){
  .lobby-server-browser{grid-template-columns:1fr}
  .lobby-server-list,.lobby-details-pane{border-right:0;border-left:0;border-bottom:1px solid #20282f}
  .lobby-session-table{min-width:0}
  .lobby-session-row > span:nth-child(n+4){display:none}
}
@media (orientation:portrait) and (max-width:980px){
  .lobby-server-browser{display:flex;flex-direction:column}
  .lobby-server-list,
  .lobby-session-pane,
  .lobby-details-pane{flex:1 1 auto;border:0}
  .lobby-server-browser[data-lobby-step="servers"] .lobby-session-pane,
  .lobby-server-browser[data-lobby-step="servers"] .lobby-details-pane,
  .lobby-server-browser[data-lobby-step="sessions"] .lobby-server-list,
  .lobby-server-browser[data-lobby-step="sessions"] .lobby-details-pane,
  .lobby-server-browser[data-lobby-step="details"] .lobby-server-list,
  .lobby-server-browser[data-lobby-step="details"] .lobby-session-pane{display:none}
  .lobby-server-browser[data-lobby-step="sessions"] .lobby-step-nav,
  .lobby-server-browser[data-lobby-step="details"] .lobby-step-nav{
    display:flex;
    align-items:center;
    padding:10px 12px;
    border-bottom:1px solid #20282f;
  }
}
.auth-container{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px}
.auth-container .brand{margin-bottom:18px}
.auth-container .brand-logo{height:64px}
.auth-back{position:absolute;top:20px;left:20px;display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border:1px solid #2a2f37;border-radius:8px;background:#161616;color:#9aa7b2;font-size:13px;text-decoration:none}
.auth-back:hover{border-color:#3a4350;background:#1c1c1c;color:#dbe7f0}
.auth-back svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.auth-form{width:100%;max-width:320px;display:flex;flex-direction:column;gap:12px}
.auth-stack{width:100%;max-width:320px;display:flex;flex-direction:column;gap:16px}
.auth-stack h1{margin:0}
.auth-guest{margin:0}
.auth-guest-btn{width:100%;padding:15px 16px;font-size:1.1rem;font-weight:700;border:none;border-radius:10px;background:linear-gradient(135deg,#5da9da,#3a6ea5);color:#fff;cursor:pointer;transition:filter .15s ease}
.auth-guest-btn:hover{filter:brightness(1.08)}
.auth-divider{display:flex;align-items:center;gap:12px;color:#7a8794;font-size:11px;text-transform:uppercase;letter-spacing:.06em}
.auth-divider::before,.auth-divider::after{content:"";flex:1;height:1px;background:#2a2f37}
.auth-register{margin:0;text-align:center;font-size:13px;color:#9aa7b2}
.auth-register a{color:#8ab4ff;text-decoration:none}
.auth-register a:hover{text-decoration:underline}
h1{margin:0 0 16px;font-size:20px;font-weight:600;text-align:center}

/* debug sidebar and frame chart UI */
#charts-stack{flex:0 0 360px;display:none;flex-direction:column;align-items:stretch;gap:8px;padding:12px;padding-left:16px;border-left:1px solid #2a2a2a;background:#050505;overflow-y:auto;height:100%;position:relative}
.sim-layout.debug-open #charts-stack{display:flex}
#debug-resize-handle{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:ew-resize;background:transparent;z-index:10}
#debug-resize-handle:hover,#debug-resize-handle.dragging{background:rgba(138,180,255,.3)}
.debug-panel-body{display:contents}
.debug-panel-header{display:none}
.debug-panel-close-btn{padding:2px 12px;font-size:24px;line-height:1;background:transparent;border:none;color:#888;cursor:pointer}
.debug-panel-close-btn:hover{color:#e6e6e6}

/* Chart panels container in debug sidebar */
.chart-panels-container{display:flex;flex-wrap:wrap;gap:8px;flex:1 1 auto;min-height:0;overflow-y:auto;align-content:start}
.chart-panels-container .chart-card{width:160px;height:180px;min-width:140px;min-height:150px;resize:both}
.chart-buttons-row{display:flex;gap:8px;margin-top:8px;align-items:center}
.chart-buttons-row .add-chart-btn,.chart-buttons-row .reset-layout-btn{flex:1 1 0}
.chart-buttons-row .auto-reset-label{display:flex;align-items:center;gap:4px;font-size:11px;color:#aaa;cursor:pointer;white-space:nowrap}
.chart-buttons-row .auto-reset-label input{margin:0;cursor:pointer}
.debug-camera-value{font-size:12px;color:#e6e6e6;font-family:monospace;line-height:1.2}

/* toggle grid for binary options */
.toggle-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px}
.toggle-item{display:flex;align-items:center;gap:4px;font-size:11px;color:#aaa;cursor:pointer}
.toggle-item input[type=checkbox]{margin:0;width:14px;height:14px;cursor:pointer}
.toggle-item span{white-space:nowrap}

/* settings panel */
.settings-panel{position:absolute;top:52px;right:12px;z-index:20;background:#111;border:1px solid #2a2a2a;border-radius:8px;padding:16px;min-width:240px;box-shadow:0 4px 16px rgba(0,0,0,.5)}
.settings-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-size:14px;font-weight:600;color:#e6e6e6}
.settings-close-btn{padding:2px 8px;font-size:16px;background:transparent;border:none;color:#888;cursor:pointer}
.settings-close-btn:hover{color:#e6e6e6}
.settings-body{display:flex;flex-direction:column;gap:12px}
.settings-row{display:flex;flex-direction:column;gap:6px}
.settings-slider-row{display:flex;align-items:center;gap:8px}
.settings-slider-row input[type=range]{flex:1;accent-color:#8ab4ff}
.settings-slider-value{min-width:36px;text-align:right;font-family:monospace;font-size:12px;color:#e6e6e6}

.editor-overlay{
  --editor-gap: 10px;
  --editor-left-width: 250px;
  --editor-right-width: 370px;
  --editor-top-height: 54px;
  --editor-icon-size: 20px;
  --editor-button-size: 34px;
  position:absolute;
  inset:0;
  z-index:16;
  pointer-events:none;
  font-family:"Trebuchet MS","Segoe UI",sans-serif;
}
.editor-info-actions .editor-mobile-only{display:none}
.editor-workspace-hitbox{
  position:absolute;
  left:calc(var(--editor-left-width) + var(--editor-gap));
  right:calc(var(--editor-right-width) + var(--editor-gap));
  top:calc(var(--editor-top-height) + var(--editor-gap));
  bottom:var(--editor-gap);
  pointer-events:none;
}
.editor-left-panel{
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  width:var(--editor-left-width);
  border-right:1px solid #1f4f70;
  background:
    linear-gradient(180deg,rgba(5,26,44,.96),rgba(3,16,30,.96)),
    repeating-linear-gradient(0deg,rgba(74,132,173,.07) 0,rgba(74,132,173,.07) 1px,transparent 1px,transparent 20px);
  display:flex;
  flex-direction:column;
  pointer-events:auto;
}
.editor-left-top-bar{
  display:flex;
  flex-shrink:0;
  height:var(--editor-top-height);
  border-bottom:1px solid #1f4f70;
  padding:8px 10px;
  gap:6px;
  align-items:center;
}
.editor-left-tab-btn{
  flex:1 1 0;
  min-width:0;
  overflow:hidden;
  height:var(--editor-button-size);
  padding:0 6px;
  border-color:#2f6f99;
  background:rgba(13,44,70,.86);
  color:#bce7ff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:12px;
}
.editor-left-tab-btn .editor-icon-svg{flex-shrink:0}
.editor-left-tab-btn span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-left-tab-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-left-tab-btn.active{border-color:#87cbff;background:rgba(33,82,120,.95);color:#e6f8ff}
.editor-left-tab-container{
  flex:1 1 auto;
  min-height:0;
  display:flex;
}
.editor-left-tab-container.hidden{display:none}
.editor-staging-shell{
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 8px 10px 10px;
}
.editor-staging-reset-btn{
  flex:0 0 auto;
  height:var(--editor-button-size);
  padding:0 10px;
  border-color:#2d6a93;
  background:rgba(12,43,68,.86);
  color:#bce7ff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:12px;
  font-weight:600;
}
.editor-staging-reset-btn .editor-icon-svg{margin:0}
.editor-staging-reset-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-stages-list{
  flex:1 1 50%;
  min-height:60px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:5px;
  padding-right:2px;
}
.editor-stage-row{
  position:relative;
  border:1px solid #265a80;
  border-radius:5px;
  background:linear-gradient(180deg,rgba(16,54,84,.82),rgba(9,35,57,.9));
  padding:6px 8px;
  display:flex;
  flex-direction:column;
  gap:5px;
  cursor:grab;
}
.editor-stage-row.dragging{opacity:.55;cursor:grabbing}
.editor-stage-row.drag-before::before,
.editor-stage-row.drag-after::after{
  content:"";
  position:absolute;
  left:6px;
  right:6px;
  height:2px;
  border-radius:2px;
  background:#8ee2ff;
  box-shadow:0 0 8px rgba(142,226,255,.8);
}
.editor-stage-row.drag-before::before{top:-4px}
.editor-stage-row.drag-after::after{bottom:-4px}
.editor-stage-row.next-up{
  border-color:#ffd166;
  background:linear-gradient(180deg,rgba(80,64,30,.82),rgba(50,40,18,.9));
}
.editor-stage-row.highlighted{outline:2px solid #ffd166;outline-offset:1px}
.editor-stage-row.next-up .editor-stage-id{border-color:#ffd166;color:#ffe9b3}
.editor-stage-header{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  color:#9ad9ff;
}
.editor-stage-id{
  width:22px;
  height:22px;
  border:1px solid #2f6f99;
  border-radius:4px;
  background:rgba(13,44,70,.86);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  color:#bce7ff;
  font-weight:700;
}
.editor-stage-key-input{
  flex:1 1 auto;
  min-width:0;
  height:22px;
  padding:0 6px;
  font-size:11px;
  border:1px solid #2f6f99;
  border-radius:3px;
  background:rgba(8,28,48,.9);
  color:#d3ebff;
  font-family:inherit;
  cursor:text;
}
.editor-stage-action-list{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  min-height:24px;
}
.editor-stage-action-list.drag-empty-target{
  outline:1px dashed #8ee2ff;
  outline-offset:-1px;
  border-radius:3px;
}
.editor-stage-action-icon{
  position:relative;
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid;
  border-radius:4px;
  cursor:pointer;
  flex-shrink:0;
}
.editor-stage-action-list .editor-stage-action-icon{cursor:grab}
.editor-stage-action-icon.icon-engine{border-color:#d8804f;background:rgba(80,32,16,.85);color:#ffc89e}
.editor-stage-action-icon.icon-separator{border-color:#7baad8;background:rgba(20,46,80,.85);color:#cce5ff}
.editor-stage-action-icon.icon-other{border-color:#5d8aa6;background:rgba(20,40,60,.85);color:#cfdde7}
.editor-stage-action-icon:hover{filter:brightness(1.25)}
.editor-stage-action-icon.highlighted{outline:2px solid #ffd166;outline-offset:1px}
.editor-stage-action-icon.dragging{opacity:.55;cursor:grabbing}
.editor-stage-action-icon.drag-before::before,
.editor-stage-action-icon.drag-after::after{
  content:"";
  position:absolute;
  top:-2px;
  bottom:-2px;
  width:2px;
  border-radius:2px;
  background:#8ee2ff;
  box-shadow:0 0 6px rgba(142,226,255,.8);
  pointer-events:none;
}
.editor-stage-action-icon.drag-before::before{left:-3px}
.editor-stage-action-icon.drag-after::after{right:-3px}
.editor-stage-action-icon-svg{width:12px;height:12px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.editor-stage-controls{
  display:flex;
  gap:4px;
}
.editor-stage-btn{
  width:22px;
  height:22px;
  padding:0;
  border-color:#2f6f99;
  background:rgba(13,44,70,.86);
  color:#bce7ff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.editor-stage-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-stage-btn-danger{border-color:#873030;background:rgba(70,20,20,.7);color:#f0a0a0}
.editor-stage-btn-danger:hover:enabled{border-color:#b84a4a;background:rgba(95,30,30,.8);color:#ffc8c8}
.editor-stage-btn-svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.editor-staging-add-stage-btn{
  border-color:#2f6f99;
  background:rgba(13,44,70,.86);
  color:#bce7ff;
  padding:6px 8px;
  font-size:11px;
}
.editor-staging-add-stage-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-staging-divider{border-top:1px solid #1f4f70;margin:4px 0 2px}
.editor-staging-search{
  flex-shrink:0;
  height:26px;
  padding:0 6px;
  font-size:11px;
  border:1px solid #2f6f99;
  border-radius:3px;
  background:rgba(8,28,48,.9);
  color:#d3ebff;
  font-family:inherit;
}
.editor-staging-available-list{
  flex:1 1 auto;
  min-height:60px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:5px;
  padding-right:2px;
}
.editor-staging-available-row{
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid #265a80;
  border-radius:5px;
  background:linear-gradient(180deg,rgba(16,54,84,.82),rgba(9,35,57,.9));
  color:#d8f1ff;
  padding:6px 8px;
  font-size:12px;
  cursor:pointer;
}
.editor-staging-available-row:hover{border-color:#5da9da;background:linear-gradient(180deg,rgba(22,70,106,.85),rgba(11,44,72,.95))}
.editor-staging-available-row.highlighted{outline:2px solid #ffd166;outline-offset:1px}
.editor-staging-available-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-staging-available-part-name{font-size:10px;color:#9ad9ff}
.editor-staging-empty{font-size:11px;color:#89adce;padding:6px 4px;font-style:italic}

.flight-staging-panel{
  position:absolute;
  left:14px;
  bottom:14px;
  z-index:14;
  display:flex;
  flex-direction:column;
  gap:6px;
  pointer-events:auto;
  font-family:"Trebuchet MS","Segoe UI",sans-serif;
}
.flight-staging-panel.hidden{display:none}
.flight-stages-list{
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:50vh;
  overflow-y:auto;
}
.flight-stage-row{
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid #265a80;
  border-radius:5px;
  background:linear-gradient(180deg,rgba(16,54,84,.82),rgba(9,35,57,.9));
  padding:4px 6px;
}
.flight-stage-row.next-up{
  border-color:#ffd166;
  background:linear-gradient(180deg,rgba(80,64,30,.82),rgba(50,40,18,.9));
}
.flight-stage-row.highlighted{outline:2px solid #ffd166;outline-offset:1px}
.flight-stage-id{
  width:22px;
  height:22px;
  border:1px solid #2f6f99;
  border-radius:4px;
  background:rgba(13,44,70,.86);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  color:#bce7ff;
  font-weight:700;
  flex-shrink:0;
}
.flight-stage-row.next-up .flight-stage-id{border-color:#ffd166;color:#ffe9b3}
.flight-stage-actions{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  min-height:24px;
}
.flight-activate-stage-btn{
  border-color:#d88030;
  background:rgba(80,40,16,.9);
  color:#ffd9a8;
  padding:6px 12px;
  font-size:12px;
  font-weight:600;
}
.flight-activate-stage-btn:hover:enabled{border-color:#ffaa55;background:rgba(120,60,24,.94);color:#ffe6c4}
.flight-activate-stage-btn:disabled{opacity:.5}
.editor-category-list{
  width:40px;
  border-right:1px solid #1d4a68;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:10px 4px;
  flex-shrink:0;
}
.editor-category-btn{
  width:var(--editor-button-size);
  height:var(--editor-button-size);
  border-radius:4px;
  border:1px solid #2f6f99;
  background:rgba(11,40,66,.85);
  color:#9ad9ff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.editor-category-icon{
  width:var(--editor-icon-size);
  height:var(--editor-icon-size);
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1;
  stroke-linecap:round;
  stroke-linejoin:round;
  overflow:visible;
}
.editor-category-btn.active{
  border-color:#87cbff;
  background:rgba(33,82,120,.95);
  color:#e6f8ff;
}
.editor-part-list-shell{
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px 8px 10px 10px;
}
.editor-panel-title{
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#92c9ef;
}
.editor-parts-list{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:5px;
  padding-right:2px;
}
.editor-template-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  text-align:left;
  border:1px solid #265a80;
  border-radius:5px;
  background:linear-gradient(180deg,rgba(16,54,84,.82),rgba(9,35,57,.9));
  color:#d8f1ff;
  padding:6px 8px;
  font-size:12px;
}
.editor-template-row:hover{border-color:#4e95c7;background:linear-gradient(180deg,rgba(22,70,106,.85),rgba(11,44,72,.95))}
.editor-template-stat{color:#98c8e8;font-size:10px;font-family:monospace}
.editor-template-row.dragging{border-color:#8ee2ff;background:linear-gradient(180deg,rgba(45,112,155,.95),rgba(18,62,92,.95))}
.editor-left-resize-handle{
  position:absolute;
  top:0;
  bottom:0;
  width:8px;
  left:calc(var(--editor-left-width) - 4px);
  cursor:ew-resize;
  pointer-events:auto;
  z-index:2;
}
.editor-left-resize-handle:hover,.editor-left-resize-handle.dragging{background:rgba(106,191,235,.34)}
.editor-right-resize-handle{
  position:absolute;
  top:0;
  bottom:0;
  width:8px;
  right:calc(var(--editor-right-width) - 4px);
  cursor:ew-resize;
  pointer-events:auto;
  z-index:2;
}
.editor-right-resize-handle:hover,.editor-right-resize-handle.dragging{background:rgba(106,191,235,.34)}
.editor-top-bar{
  position:absolute;
  left:calc(var(--editor-left-width) + var(--editor-gap));
  right:calc(var(--editor-right-width) + var(--editor-gap));
  top:var(--editor-gap);
  height:var(--editor-top-height);
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid #2a6992;
  border-radius:7px;
  background:
    linear-gradient(180deg,rgba(11,39,63,.92),rgba(6,25,43,.96)),
    repeating-linear-gradient(90deg,rgba(97,175,224,.08) 0,rgba(97,175,224,.08) 1px,transparent 1px,transparent 16px);
  pointer-events:auto;
}
.editor-craft-name-display{
  flex:1 1 auto;
  min-width:0;
  text-align:left;
  border-color:#2f6f99;
  background:rgba(13,44,70,.86);
  color:#d8f2ff;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.editor-craft-name-display:hover{border-color:#5da8d8}
.editor-craft-name-input{
  flex:1 1 auto;
  min-width:0;
  border-color:#54a5d7 !important;
}
.editor-top-actions{display:flex;gap:6px}
.editor-icon-btn{
  width:var(--editor-button-size);
  height:var(--editor-button-size);
  padding:0;
  border-color:#2d6a93;
  background:rgba(12,43,68,.86);
  color:#bce7ff;
  font-weight:700;
}
.editor-icon-svg{
  width:var(--editor-icon-size);
  height:var(--editor-icon-size);
  display:block;
  margin:auto;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.editor-icon-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-mode-bar{
  position:absolute;
  left:calc(var(--editor-left-width) + var(--editor-gap));
  top:calc(var(--editor-top-height) + var(--editor-gap) + var(--editor-gap));
  display:flex;
  gap:4px;
  pointer-events:auto;
  z-index:1;
}
.editor-mode-btn{
  width:var(--editor-button-size);
  height:var(--editor-button-size);
  padding:0;
  border-color:#2d6a93;
  background:rgba(12,43,68,.86);
  color:#8cc3e8;
}
.editor-mode-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92);color:#bce7ff}
.editor-mode-btn.active{border-color:#87cbff;background:rgba(33,82,120,.95);color:#e6f8ff}
.editor-mode-icon{
  width:var(--editor-icon-size);
  height:var(--editor-icon-size);
  display:block;
  margin:auto;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.editor-info-bar{
  position:absolute;
  top:0;
  bottom:0;
  right:0;
  width:var(--editor-right-width);
  border-left:1px solid #1f4f70;
  background:
    linear-gradient(180deg,rgba(5,26,44,.98),rgba(3,16,30,.97)),
    repeating-linear-gradient(0deg,rgba(74,132,173,.06) 0,rgba(74,132,173,.06) 1px,transparent 1px,transparent 20px);
  display:flex;
  flex-direction:column;
  pointer-events:auto;
}
.editor-info-actions{
  display:flex;
  gap:6px;
  padding:10px;
  border-bottom:1px solid #1f4f70;
  width:100%;
}
.editor-info-actions button{
  flex:1 1 0;
  width:0;
  border-color:#2f6e98;
  background:rgba(13,43,68,.86);
  color:#caeeff;
  height:var(--editor-button-size);
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
#editorLaunchBtn{
  border-color:#2d9c5f;
  background:rgba(20,86,51,.9);
  color:#d8ffe9;
}
#editorLaunchBtn:hover:enabled{
  border-color:#55d88a;
  background:rgba(30,118,70,.94);
  color:#f0fff6;
}
.editor-action-icon{
  width:var(--editor-icon-size);
  height:var(--editor-icon-size);
  flex-shrink:0;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.editor-info-actions button:hover:enabled{
  border-color:#66b3de;
  background:rgba(24,68,101,.92);
}
.editor-info-actions button.active{
  border-color:#87cbff;
  background:rgba(33,82,120,.95);
  color:#e6f8ff;
}
.editor-info-meta{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px;
  border-bottom:1px solid #1f4f70;
}
.editor-info-meta-row{
  display:grid;
  grid-template-columns:58px 1fr;
  gap:8px;
  align-items:start;
  font-size:12px;
  color:#d2ecff;
}
.editor-tag{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#81b8dd}
.editor-info-content{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.editor-info-section{
  border:1px solid #25597f;
  background:rgba(10,37,60,.72);
  border-radius:6px;
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.editor-info-section-title{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#90c6eb;
}
.editor-info-grid{
  display:grid;
  grid-template-columns:88px 1fr;
  gap:6px 8px;
  align-items:center;
  font-size:12px;
}
.editor-info-grid .value{font-family:monospace;color:#cce9ff}
.editor-info-grid label{font-size:11px;color:#90c0df}
.editor-info-grid input[type=text],.editor-info-grid input[type=number]{height:32px;padding:6px}
.editor-info-grid input[type=range]{width:100%}
.editor-info-grid select{width:100%;padding:5px 6px;border:1px solid #3a78b7;border-radius:4px;background:#071d34;color:#d9f0ff;font-family:inherit;font-size:11px}
.editor-info-note{font-size:11px;color:#9bc4e1}
.editor-storage-list{display:flex;flex-direction:column;gap:9px}
.editor-storage-row{display:flex;flex-direction:column;gap:5px}
.editor-storage-head{display:flex;align-items:center;gap:8px}
.editor-storage-name{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  color:#dcecfb;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.editor-storage-name::before{
  content:"";
  flex-shrink:0;
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--resource-accent);
  box-shadow:0 0 6px var(--resource-accent-soft);
}
.editor-storage-amount{
  flex-shrink:0;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:11px;
  color:#9fc3dd;
  white-space:nowrap;
}
.editor-storage-control{
  position:relative;
  height:16px;
  display:flex;
  align-items:center;
}
.editor-storage-track{
  position:relative;
  width:100%;
  height:8px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(110,146,168,.16);
}
.editor-storage-meter-fill{
  position:absolute;
  inset:0 auto 0 0;
  width:0;
  border-radius:999px;
  background:var(--resource-accent);
  opacity:.88;
}
.editor-storage-knob{
  position:absolute;
  top:50%;
  left:0;
  width:14px;
  height:14px;
  border-radius:999px;
  transform:translateY(-50%);
  background:#eaf6ff;
  border:2px solid var(--resource-accent);
  box-shadow:0 0 6px var(--resource-accent-soft);
  pointer-events:none;
  transition:transform .1s ease;
}
.editor-storage-control:hover .editor-storage-knob{
  transform:translateY(-50%) scale(1.15);
}
.editor-storage-range{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  opacity:0;
  cursor:ew-resize;
}
.editor-selected-actions,
.editor-placement-controls{
  position:absolute;
  left:50%;
  bottom:var(--editor-gap);
  transform:translateX(-50%);
  z-index:6;
  pointer-events:auto;
}
.editor-selected-actions{
  display:flex;
  gap:8px;
  pointer-events:none;
}
.editor-move-selected-btn,
.editor-delete-selected-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:44px;
  padding:0 18px;
  font-weight:600;
  box-shadow:0 6px 20px rgba(0,0,0,.42);
  pointer-events:auto;
}
.editor-move-selected-btn{
  border-color:#2d9c5f;
  background:rgba(20,86,51,.92);
  color:#d8ffe9;
}
.editor-move-selected-btn:hover:enabled{border-color:#55d88a;background:rgba(30,118,70,.95)}
.editor-delete-selected-btn{
  border-color:#9c3a3a;
  background:rgba(86,26,26,.9);
  color:#ffd9d9;
}
.editor-delete-selected-btn:hover:enabled{border-color:#d36b6b;background:rgba(118,40,40,.94)}
.editor-move-selected-btn.hidden,
.editor-delete-selected-btn.hidden{display:none}
.editor-placement-controls{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:6px;
  width:min(360px,calc(100% - 20px));
  padding:8px;
  border:1px solid #2a6992;
  border-radius:10px;
  background:linear-gradient(180deg,rgba(11,39,63,.96),rgba(6,25,43,.97));
  box-shadow:0 8px 24px rgba(0,0,0,.45);
}
.editor-placement-controls.hidden{display:none}
.editor-place-btn{
  height:44px;
  padding:0;
  border-color:#2f6f99;
  background:rgba(13,44,70,.86);
  color:#cfecff;
  font-weight:600;
}
.editor-place-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-place-confirm{border-color:#2d9c5f;background:rgba(20,86,51,.9);color:#d8ffe9}
.editor-place-confirm:hover:enabled{border-color:#55d88a;background:rgba(30,118,70,.94)}
.editor-place-abort{border-color:#9c3a3a;background:rgba(86,26,26,.9);color:#ffd9d9}
.editor-place-abort:hover:enabled{border-color:#d36b6b;background:rgba(118,40,40,.94)}
.editor-template-drag-label{
  position:absolute;
  z-index:24;
  transform:translate(12px,12px);
  padding:6px 8px;
  border:1px solid #5ab0df;
  border-radius:5px;
  background:rgba(13,48,74,.95);
  color:#d8f4ff;
  font-size:11px;
  pointer-events:none;
}

.editor-craft-dialog{position:absolute;inset:0;z-index:18;display:flex;align-items:center;justify-content:center;background:rgba(2,8,15,.72);pointer-events:auto}
.editor-craft-dialog-card{width:min(560px,calc(100% - 28px));max-height:calc(100% - 28px);overflow:hidden;display:flex;flex-direction:column;gap:10px;padding:14px;background:rgba(7,20,37,.96);border:1px solid #3f75a3;border-radius:10px}
.editor-craft-dialog-header{font-size:14px;font-weight:600;color:#d7edff}
.editor-craft-dialog-list{display:flex;flex-direction:column;gap:8px;overflow-y:auto;max-height:320px}
.editor-craft-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px;border:1px solid #2f5f87;border-radius:6px;background:rgba(16,43,70,.7)}
.editor-craft-row-name{flex:1 1 auto;min-width:0;font-size:12px;color:#d3ebff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-craft-row-btns{display:flex;gap:4px;flex-shrink:0}
.editor-craft-row-btn{padding:6px 10px}
.editor-craft-row-btn-secondary{border-color:#2f5f87;background:rgba(16,43,70,.7);color:#89adce}
.editor-craft-row-btn-secondary:hover:enabled{border-color:#4a8ab8;background:rgba(25,60,95,.8);color:#b8dcf5}
.editor-craft-row-btn-danger{border-color:#873030;background:rgba(70,20,20,.7);color:#f0a0a0}
.editor-craft-row-btn-danger:hover:enabled{border-color:#b84a4a;background:rgba(95,30,30,.8);color:#ffc8c8}
.editor-craft-row-name-input{flex:1 1 auto;min-width:0;padding:4px 6px;font-size:12px;border:1px solid #54a5d7;border-radius:4px;background:rgba(8,28,48,.9);color:#d3ebff;font-family:inherit}
.editor-craft-row-meta{flex:0 0 auto;font-size:10px;color:#89adce;white-space:nowrap}
.editor-craft-row-badge{margin-left:6px;padding:1px 6px;font-size:10px;color:#ffd166;border:1px solid #6a4d10;border-radius:8px;white-space:nowrap}
.editor-craft-empty{font-size:12px;color:#89adce;padding:8px 4px}
.editor-craft-dialog-actions{display:flex;justify-content:flex-end;gap:8px}
.editor-confirm-message{font-size:13px;color:#b8d6ef;line-height:1.5}
.editor-history-shell{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column;gap:6px;padding:10px 8px 10px 10px}
.editor-history-hint{font-size:11px;color:#89adce;line-height:1.4}
.editor-history-list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:4px;overflow-y:auto}
.editor-history-row{display:flex;align-items:center;gap:6px;padding:6px 8px;font-size:12px;text-align:left;border:1px solid #2f5f87;border-radius:6px;background:rgba(16,43,70,.7);color:#d3ebff}
.editor-history-row:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.editor-history-row.current{border-color:#87cbff;background:rgba(33,82,120,.95);color:#e6f8ff}
.editor-history-row-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-history-row-branch{flex:0 0 auto;font-size:10px;color:#ffd166}

@media (max-width: 1150px){
  .editor-overlay{
    --editor-left-width:250px;
    --editor-right-width:320px;
  }
}
@media (max-width: 900px){
  .editor-overlay{
    --editor-left-width:220px;
    --editor-right-width:300px;
  }
  .editor-info-grid{grid-template-columns:74px 1fr}
}
@media (max-width: 760px){
  .editor-overlay{
    --editor-left-width:220px;
    --editor-right-width:260px;
  }
  .editor-info-actions{grid-template-columns:1fr}
}
@media (orientation: portrait) and (max-width: 900px){
  .editor-overlay{--editor-toolbar-h:54px;overflow:hidden}
  .editor-info-actions .editor-mobile-only{display:inline-flex}
  #editorLeftResizeHandle,#editorRightResizeHandle{display:none}

  .editor-top-bar{left:var(--editor-gap);right:var(--editor-gap)}
  .editor-mode-bar{left:var(--editor-gap)}
  .editor-selected-actions,
  .editor-placement-controls{bottom:calc(var(--editor-toolbar-h) + var(--editor-gap))}
  .editor-overlay.mobile-parts-open .editor-selected-actions,
  .editor-overlay.mobile-parts-open .editor-placement-controls,
  .editor-overlay.mobile-info-open .editor-selected-actions,
  .editor-overlay.mobile-info-open .editor-placement-controls{display:none}
  .editor-workspace-hitbox{
    left:var(--editor-gap);
    right:var(--editor-gap);
    bottom:calc(var(--editor-toolbar-h) + var(--editor-gap));
  }
  .editor-overlay.mobile-parts-open .editor-workspace-hitbox,
  .editor-overlay.mobile-info-open .editor-workspace-hitbox{
    bottom:calc(58vh + var(--editor-toolbar-h) + var(--editor-gap));
  }

  .editor-left-panel{
    top:auto;
    left:0;
    right:0;
    width:auto;
    bottom:var(--editor-toolbar-h);
    height:58vh;
    border-right:0;
    border-top:1px solid #1f4f70;
    z-index:4;
    transform:translateY(calc(100% + var(--editor-toolbar-h)));
    transition:transform .25s cubic-bezier(.4,0,.2,1);
  }
  .editor-overlay.mobile-parts-open .editor-left-panel{transform:none}

  .editor-info-bar{
    top:auto;
    bottom:0;
    left:0;
    right:0;
    width:auto;
    height:auto;
    max-height:calc(58vh + var(--editor-toolbar-h));
    border-left:0;
    background:transparent;
    z-index:5;
  }
  .editor-info-actions{
    order:3;
    border-top:1px solid #1f4f70;
    border-bottom:0;
    padding-bottom:10px;
    background:linear-gradient(180deg,rgba(5,26,44,.98),rgba(3,16,30,.97));
  }
  .editor-info-meta{
    order:1;
    max-height:0;
    padding:0 10px;
    border-bottom:0;
    overflow:hidden;
    background:linear-gradient(180deg,rgba(5,26,44,.98),rgba(3,16,30,.97));
  }
  .editor-info-content{
    order:2;
    flex:0 1 auto;
    max-height:0;
    padding:0 10px;
    overflow:hidden;
    background:linear-gradient(180deg,rgba(5,26,44,.98),rgba(3,16,30,.97));
  }
  .editor-overlay.mobile-info-open .editor-info-meta{
    max-height:none;
    padding:10px;
    border-bottom:1px solid #1f4f70;
  }
  .editor-overlay.mobile-info-open .editor-info-content{
    max-height:46vh;
    padding:10px;
    overflow-y:auto;
  }
}
@media (max-width: 760px){
  .flight-telemetry-shell{
    width:min(620px,calc(100vw - 18px));
    padding:3px 4px 4px;
  }
  .flight-telemetry-readout{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .flight-telemetry-block{
    min-height:74px;
  }
}
@media (max-width: 480px){
  .flight-telemetry{
    top:0;
  }
  .flight-telemetry-shell{
    width:min(360px,calc(100% - 12px));
    padding:2px 3px 3px;
  }
  .flight-telemetry-readout{
    grid-template-columns:1fr;
  }
  .flight-telemetry-value{
    font-size:17px;
  }
  .sim-sidebar{
    top:auto;
    bottom:12px;
    left:12px;
  }
}
@media (max-width: 720px){
  .sim-layout{position:relative}
  .side-panel-dock{
    --side-panel-width:min(88vw,400px);
    position:absolute;
    inset:0 auto 0 0;
    width:var(--side-panel-width);
    z-index:40;
    height:100%;
  }
  #charts-stack{position:absolute;inset:0;z-index:30;flex-basis:auto;width:auto;padding:0;gap:0;border-left:0;overflow:hidden}
  #debug-resize-handle{display:none}
  .debug-panel-header{
    display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;
    padding:12px 16px;
    border-bottom:1px solid #2a2a2a;background:#050505;font-size:15px;font-weight:600;color:#e6e6e6;
  }
  .debug-panel-body{
    display:flex;flex-direction:column;gap:10px;flex:1 1 auto;overflow-y:auto;
    padding:14px 16px;
  }
  .toggle-grid{gap:12px 14px}
  .toggle-item{font-size:13px}
  .toggle-item input[type=checkbox]{width:18px;height:18px}
}

.hidden{display:none}
#viewport canvas{width:100%;height:100%;display:block}

/* terrain stats */
.terrain-stats{background:rgba(0,0,0,.7);border-radius:5px;font-size:11px}
.terrain-stats-header{font-weight:600;margin-bottom:8px;color:#aaa}
.terrain-stats-grid{display:grid;grid-template-columns:auto 1fr;gap:4px 8px}
.terrain-stats-grid span:nth-child(odd){color:#888}
.terrain-stats-grid span:nth-child(even){color:#e6e6e6;font-family:monospace}
.mini-chart-container{height:40px;margin-top:6px}
.mini-chart-canvas{display:block;width:100%;height:100%}

/* Metric popover (tree-in-dropdown for debug panel) */
.metric-popover-wrapper{position:relative;display:inline-block}
.metric-popover-trigger{padding:4px 8px;font-size:10px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.metric-popover-panel{position:absolute;top:100%;left:0;z-index:100;margin-top:4px;background:#1a1a1a;border:1px solid #3a3a3a;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.5);min-width:200px;max-width:300px;max-height:300px;overflow-y:auto}
.metric-popover-tree{padding:8px}

/*
 * Metric selector styles
 * The MetricSelector is a standalone UI component for selecting metrics.
 * It outputs a metric name to an abstract consumer - it knows nothing about
 * what consumes the selection (could be a chart, export, etc).
 */
.metric-tree-selector{font-size:11px}
.tree-empty{color:#666;text-align:center;padding:8px}
.tree-list{list-style:none;margin:0;padding:0 0 0 12px}
.metric-tree-selector>.tree-list{padding-left:0}
.tree-item{margin:2px 0}
.tree-toggle{display:inline-block;width:14px;cursor:pointer;color:#888;font-size:9px;user-select:none}
.tree-toggle:hover{color:#fff}
.tree-branch-label{color:#aaa;font-weight:500}
.tree-leaf{background:transparent;border:1px solid transparent;border-radius:4px;padding:2px 6px;color:#8ab4ff;cursor:pointer;font-size:11px;text-align:left;width:auto}
.tree-leaf:hover{background:#1a1a2e;border-color:#3a3a5a}
.tree-leaf.selected{background:#1a2a3a;border-color:#3a5a7a;color:#fff}

/*
 * ChartWidget - a generic, abstract data visualization component.
 * ALL graphs are IDENTICAL and completely abstract data sinks.
 * Any graph can receive data from ANY source - the graph has no knowledge
 * of where its data originates. Data producers (selectors, APIs, etc.)
 * know nothing about the graph - they just output data to an abstract consumer.
 */
.chart-widget{
  --cw-ylabels-width: 32px;
  --cw-xlabels-height: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  font-size: 11px;
  height: 100%;
}
.cw-legend{display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:center;padding:4px 0}
.cw-legend-item{display:inline-flex;gap:4px;align-items:center;font-size:10px}
.cw-legend-color{width:12px;height:3px;display:inline-block}
.cw-legend-value{color:#fff}
.cw-chart-area{
  display: grid;
  grid-template-columns: var(--cw-ylabels-width) 1fr;
  grid-template-rows: 1fr var(--cw-xlabels-height);
  min-height: 0;
}
.cw-ylabels{
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  color: #888;
  padding-right: 4px;
  text-align: right;
}
.cw-ylabels .y-tick{line-height: 1}
.cw-canvas-wrap{
  grid-row: 1;
  grid-column: 2;
  position: relative;
  min-height: 0;
  min-width: 0;
}
.cw-canvas{display:block;width:100%;height:100%}
.cw-xlabels{
  grid-row: 2;
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #888;
}
.cw-tooltip{position:absolute;display:none;background:rgba(20,20,20,.95);color:#fff;padding:6px 8px;border-radius:4px;font-size:10px;pointer-events:none;border:1px solid #444;white-space:nowrap;z-index:10}
.cw-tooltip .tt-time{color:#888;font-size:9px;margin-bottom:4px}
.cw-tooltip .tt-row{display:flex;gap:6px;align-items:center}
.cw-tooltip .dot{width:8px;height:8px;border-radius:50%}
.cw-tooltip .tt-label{color:#aaa}
.cw-tooltip .tt-val{color:#fff;font-weight:500}

/* Telemetry page layout */
.metrics-page{display:flex;flex-direction:column;height:100vh}
.metrics-header-bar{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;background:#111;border-bottom:1px solid #2a2a2a;flex-shrink:0}
.metrics-header-bar h1{margin:0;font-size:18px;font-weight:600}
.header-controls{display:flex;gap:12px;align-items:center}
.back-link{color:#8ab4ff;text-decoration:none;font-size:13px}
.back-link:hover{text-decoration:underline}
.metrics-main{flex:1 1 auto;padding:24px;overflow-y:auto}
.charts-container{display:flex;flex-wrap:wrap;gap:16px;align-items:start;align-content:start}
.chart-card{background:#111;border:1px solid #2a2a2a;border-radius:8px;padding:12px;display:flex;flex-direction:column;gap:8px;resize:both;overflow:hidden;width:350px;height:250px;min-width:280px;min-height:200px}
.chart-card-header{display:flex;justify-content:flex-end;flex-shrink:0}
.remove-chart-btn{padding:4px 10px;font-size:12px;background:#2a1a1a;border-color:#4a2a2a;color:#ff6666}
.remove-chart-btn:hover:enabled{background:#3a2020;border-color:#6a3030}
/* Chart card internal layout */
.chart-title{flex:1;font-size:12px;font-weight:500;color:#e6e6e6;cursor:pointer}
.chart-title:hover{color:#8ab4ff}
.chart-selector-container{flex:1 1 auto;min-height:0;overflow-y:auto}
.chart-selector-container.hidden{display:none}
.chart-graph-container{flex:1 1 auto;min-height:0}
.chart-graph-container.hidden{display:none}

/* Camera tools */
.camera-tools-header{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px 16px 14px;
  border-bottom:1px solid rgba(108,149,176,.2);
}
.camera-tools-title{min-width:0;margin:0;font-size:22px;line-height:1.1;font-weight:700;color:#edf7ff;text-align:left}
.camera-tools-close{
  width:34px;height:34px;padding:0;border-radius:10px;flex-shrink:0;
  border:1px solid rgba(108,149,176,.28);background:rgba(11,31,47,.86);
  color:#bddcf0;font-size:20px;line-height:1;
}
.camera-tools-close:hover:enabled{border-color:rgba(143,220,255,.6);background:rgba(18,55,81,.92)}
.camera-tools-section{
  display:flex;flex-direction:column;gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(108,149,176,.16);
}
.camera-tools-mode-section{flex:1 1 auto;min-height:0;border-bottom:none}
.camera-tools-tips{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px}
.camera-tools-tip{display:flex;align-items:center;gap:8px;font-size:12px;color:#93afc1}
.camera-tools-tip kbd{
  min-width:20px;padding:2px 6px;text-align:center;
  border:1px solid rgba(108,149,176,.4);border-radius:5px;
  background:rgba(11,31,47,.9);color:#cfe8f8;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;
}
.camera-tools-btn{width:100%;border-color:#2d6a93;background:rgba(12,43,68,.86);color:#bce7ff}
.camera-tools-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.camera-tools-btn-accent{border-color:#3f8f5f;background:rgba(16,54,34,.86);color:#bdf5cf}
.camera-tools-btn-accent:hover:enabled{border-color:#5fbf85;background:rgba(24,79,49,.92)}
.camera-tools-control{display:flex;align-items:center;gap:10px}
.camera-tools-control-label{flex:0 0 88px;min-width:0;font-size:11px;color:#90c0df;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.camera-tools-key{flex:0 0 22px;font-size:12px;font-weight:600;color:#bce7ff;cursor:help}
.camera-tools-select{
  flex:1 1 auto;min-width:0;padding:7px 8px;border:1px solid rgba(93,145,176,.38);border-radius:6px;
  background:rgba(7,21,34,.92);color:#eef8ff;font-family:inherit;font-size:13px;
}
.camera-tools-editor{display:flex;align-items:center;flex-wrap:nowrap;gap:6px;flex:1 1 auto;min-width:0}
.camera-tools-number{
  flex:0 0 76px;width:76px;padding:6px 8px;
  border:1px solid rgba(93,145,176,.38);border-radius:6px;
  background:rgba(7,21,34,.92);color:#eef8ff;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;
}
.camera-tools-editor-btns{display:flex;gap:4px;flex:1 1 auto;flex-wrap:nowrap;min-width:0}
.camera-tools-step-btn{
  flex:1 1 0;min-width:0;padding:6px 2px;
  border-color:#2f6f99;background:rgba(13,44,70,.86);color:#bce7ff;
  font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.camera-tools-step-btn:hover:enabled{border-color:#5da9da;background:rgba(25,71,105,.92)}
.camera-tools-slider{flex:1 1 auto;min-width:0;accent-color:#8ab4ff}
.camera-tools-actions{display:flex;gap:8px}
.camera-tools-actions .camera-tools-btn{flex:1 1 0}
.camera-tools-points{
  flex:1 1 auto;min-height:0;overflow-y:auto;
  display:flex;flex-direction:column;gap:10px;padding-right:2px;
}
.camera-tools-empty{font-size:12px;color:#8eaabc;padding:10px 2px}
.camera-tools-point{
  border-radius:14px;border:1px solid rgba(112,159,189,.26);
  background:linear-gradient(180deg,rgba(13,34,50,.76),rgba(5,16,27,.92));
  padding:12px;display:flex;flex-direction:column;gap:10px;
}
.camera-tools-point-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.camera-tools-point-label{font-size:13px;font-weight:600;color:#eef8ff}
.camera-tools-point-actions{display:flex;gap:6px;flex-shrink:0}
.camera-tools-point-btn{padding:4px 10px;font-size:12px;border-color:rgba(93,145,176,.38);background:rgba(12,39,59,.92);color:#cfe8f8}
.camera-tools-point-btn:hover:enabled{border-color:rgba(121,190,229,.62);background:rgba(18,55,81,.96)}
.camera-tools-point-btn.active{border-color:#87cbff;background:rgba(33,82,120,.95);color:#e6f8ff}
.camera-tools-point-remove{border-color:#873030;background:rgba(70,22,22,.86);color:#f0a0a0}
.camera-tools-point-remove:hover:enabled{border-color:#c25151;background:rgba(99,30,30,.92);color:#ffd5d5}
.camera-tools-point-grid{display:flex;flex-direction:column;gap:8px}

/* Clean-image recording: hide HUD chrome but keep the debug panel if it is open */
.sim-layout.camera-ui-hidden .sim-controls,
.sim-layout.camera-ui-hidden .sim-sidebar,
.sim-layout.camera-ui-hidden .flight-telemetry,
.sim-layout.camera-ui-hidden .navball-container,
.sim-layout.camera-ui-hidden .spawn-craft-controls,
.sim-layout.camera-ui-hidden .control-craft-btn,
.sim-layout.camera-ui-hidden .replay-panel,
.sim-layout.camera-ui-hidden .flight-staging-panel,
.sim-layout.camera-ui-hidden .settings-panel,
.sim-layout.camera-ui-hidden .control-help,
.sim-layout.camera-ui-hidden .side-panel-dock{display:none !important;}
