body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.status-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 11px;
}

.sim-tag {
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 3px;
}

.status-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  grid-template-columns: 2.1fr 1fr 1fr;
  grid-template-rows: 1.4fr 1fr 1fr;
  grid-template-areas:
    "map    sensor  plan"
    "map    weapon  health"
    "datalink log   log";
}

.map-panel { grid-area: map; }
.sensor-panel { grid-area: sensor; }
.plan-panel { grid-area: plan; }
.weapon-panel { grid-area: weapon; }
.health-panel { grid-area: health; }
.datalink-panel { grid-area: datalink; }
.log-panel { grid-area: log; }

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
}

.panel-sub {
  font-size: 10px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.plan-body {
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  overflow: hidden;
  min-height: 0;
}

.plan-block {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.command-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.command-input-wrap {
  flex: 1 1 auto;
  min-width: 100px;
}

#command-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px;
}

#command-input:focus {
  outline: none;
  border-color: var(--accent);
}

.autonomy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-dim);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(4, minmax(170px, 1fr));
    grid-template-areas:
      "map map"
      "sensor plan"
      "weapon health"
      "datalink log";
  }
}

@media (max-width: 720px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(7, minmax(160px, 1fr));
    grid-template-areas:
      "map"
      "sensor"
      "plan"
      "weapon"
      "health"
      "datalink"
      "log";
    overflow: auto;
  }
}
