*{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,.btn-link{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,.btn-link:hover{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;
}
.resource-management-panel{
  flex:0 0 0;
  max-width:0;
  min-width:0;
  overflow:hidden;
  opacity:0;
  display:flex;
  flex-direction:column;
  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);
  contain:layout paint style;
  pointer-events:none;
  overscroll-behavior:contain;
  transition:flex-basis .25s ease .08s,max-width .25s ease .08s,opacity .25s ease .08s;
}
.resource-management-panel.resource-panel-open{
  flex-basis:min(30vw,400px);
  max-width:min(30vw,400px);
  opacity:1;
  pointer-events:auto;
  transition:flex-basis .3s ease,max-width .3s ease,opacity .2s ease .12s;
}
.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-detail-title,
.resource-empty-title{
  margin:0;
  font-size:16px;
  line-height:1.2;
  font-weight:600;
  text-align:left;
  color:#eef8ff;
}
.resource-section-caption,
.resource-detail-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-right:2px;
}
.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-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-module{
  flex:0 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,
.resource-storage-module{
  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,
.resource-summary-value{
  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-detail-summary{
  --resource-accent:#7de3ff;
  --resource-accent-soft:rgba(125,227,255,.16);
  border-radius:15px;
  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:12px 14px 11px;
  box-shadow:inset 0 1px 0 rgba(222,238,248,.05);
  margin-bottom:0;
}
.resource-detail-summary+.resource-storage-list{
  border-top:1px solid rgba(110,152,180,.3);
  padding-top:14px;
}
.resource-detail-summary .resource-storage-amount-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.resource-detail-summary .resource-storage-amount{
  font-size:19px;
}
.resource-detail-summary .resource-storage-fill{
  font-size:19px;
}
.resource-detail-summary-meta{
  margin-top:10px;
  font-size:11px;
  line-height:1.2;
  color:#8eaabc;
}
.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-id{
  flex-shrink:0;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:#d6ebf9;
  font-size:11px;
  line-height:1;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.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;
}
.resource-pool-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 0 6px;
  border-top:1px solid rgba(110,152,180,.15);
}
.resource-pool-header:first-child{
  border-top:none;
  padding-top:0;
}
.resource-pool-header-left{
  display:flex;
  align-items:center;
  gap:8px;
}
.resource-pool-label{
  font-size:12px;
  font-weight:600;
  color:var(--resource-accent);
  letter-spacing:.05em;
}
.resource-pool-count{
  font-size:11px;
  color:#8eaabc;
}
.resource-pool-stats{
  flex-shrink:0;
  font-size:11px;
  color:#93afc1;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.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}
.home-controls{flex:1 1 auto;display:flex;align-items:center;justify-content:center}
.home-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}
.field{display:flex;flex-direction:column;gap:4px}
.home-buttons{display:flex;gap:12px;align-items:center;justify-content:center}
.world-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:260px;
  overflow-y:auto;
  padding:2px;
}
.world-list-section{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.world-list-section-title{
  margin:8px 0 4px;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8ca2b3;
}
.world-list-entry{
  display:flex;
  gap:10px;
  align-items:baseline;
  padding:9px 10px;
  border-radius:10px;
  border:1px solid rgba(90,126,151,.28);
  background:rgba(19,28,35,.9);
}
.world-list-entry-copy{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.world-list-entry-title{
  font-size:13px;
  color:#eff9ff;
}
.world-list-entry:has(input:disabled) .world-list-entry-title{
  color:#6b7f8c;
}
.world-list-entry:has(input:disabled) .world-list-entry-meta{
  color:#556570;
}
.world-list-entry-meta{
  font-size:11px;
  color:#94a8b6;
}
.auth-container{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px}
.auth-form{width:100%;max-width:320px;display:flex;flex-direction:column;gap:12px}
.auth-actions{margin-top:16px;display:flex;flex-direction:column;gap:8px;align-items:center}
.auth-actions form{margin:0}
.auth-actions a{color:#8ab4ff;text-decoration:none}
.auth-actions 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)}

/* 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: 16px;
  --editor-button-size: 34px;
  position:absolute;
  inset:0;
  z-index:16;
  pointer-events:none;
  font-family:"Trebuchet MS","Segoe UI",sans-serif;
}
.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;
  height:var(--editor-button-size);
  padding:0 8px;
  border-color:#2f6f99;
  background:rgba(13,44,70,.86);
  color:#bce7ff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:12px;
}
.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.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.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-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;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-empty{font-size:12px;color:#89adce;padding:8px 4px}
.editor-craft-dialog-actions{display:flex;justify-content:flex-end;gap:8px}

@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 (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;
  }
  .resource-management-panel.resource-panel-open{
    flex-basis:min(30vw,400px,100vw);
    max-width:min(30vw,400px,100vw);
  }
  .resource-summary-grid{
    grid-template-columns:1fr;
  }
}
@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;
  }
}

.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}
