.command-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.command-channels button {
  min-height: 30px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 999px;
  background: rgba(237, 244, 239, 0.06);
  color: rgba(237, 244, 239, 0.82);
  font-size: 11px;
  font-weight: 900;
}

.command-channels button.active {
  border-color: rgba(255, 209, 102, 0.78);
  background: rgba(255, 209, 102, 0.22);
  color: #ffe8a8;
}

.command-channels button:disabled {
  opacity: 0.36;
}

.command-authority {
  display: grid;
  gap: 5px;
}

.command-authority-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid rgba(237, 244, 239, 0.12);
  border-radius: 8px;
  background: rgba(237, 244, 239, 0.045);
}

.command-authority-row.active {
  border-color: rgba(255, 209, 102, 0.38);
  background: rgba(255, 209, 102, 0.09);
}

.command-authority-row span {
  overflow: hidden;
  color: rgba(237, 244, 239, 0.74);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-authority-row.active span {
  color: #ffe8a8;
}

.command-authority-row button {
  min-width: 46px;
  min-height: 24px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 7px;
  background: rgba(255, 209, 102, 0.16);
  color: #ffe8a8;
  font-size: 10px;
  font-weight: 900;
}

.command-authority-row button:disabled {
  opacity: 0.45;
}

.command-memory {
  display: grid;
  gap: 5px;
  min-height: 34px;
  padding: 8px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.06);
}

.command-memory span {
  color: rgba(237, 244, 239, 0.78);
  font-size: 11px;
  font-weight: 850;
}

.command-memory .ordered {
  color: #ffe8a8;
}

.command-memory .empty {
  color: rgba(237, 244, 239, 0.48);
}

.command-radio-toggle.has-orders::after {
  background: rgba(255, 209, 102, 0.94);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

.mobile-action.mobile-chat-toggle {
  position: fixed;
  left: max(28px, env(safe-area-inset-left));
  top: max(74px, env(safe-area-inset-top));
  width: 68px;
  height: 44px;
  border-radius: 10px;
  border-color: rgba(142, 216, 255, 0.42);
  background: rgba(9, 16, 18, 0.84);
  color: rgba(237, 244, 239, 0.96);
  font-size: 13px;
  font-weight: 950;
}

.mobile-action.mobile-chat-toggle.hidden {
  display: none;
}

.mobile-controls.radio-open .move-stick,
.mobile-controls.radio-open .mobile-aim-zone,
.mobile-controls.radio-open .mobile-ammo-row,
.mobile-controls.radio-open .mobile-action[data-mobile-key],
.mobile-controls.radio-open .mobile-action[data-mobile-mouse],
.mobile-controls.radio-open .mobile-action.weapon-cycle,
.mobile-controls.radio-open .mobile-action.role-change,
.mobile-controls.radio-open .mobile-action.scoreboard-toggle,
.mobile-controls.radio-open .mobile-action.tactical-map-toggle,
.mobile-controls.radio-open .mobile-action.mobile-chat-toggle {
  display: none !important;
}

@media (max-height: 620px) and (orientation: landscape) {
  .command-panel {
    left: max(8px, env(safe-area-inset-left));
    bottom: max(8px, calc(env(safe-area-inset-bottom) + 8px));
    width: min(252px, calc(100vw - 16px));
    transform: scale(0.86);
    transform-origin: left bottom;
  }

  .command-radio-antenna,
  .command-radio-device::before,
  .command-radio-device::after,
  .command-speaker {
    display: none;
  }

  .command-radio-shell {
    gap: 6px;
    padding: 10px;
    border-width: 1px;
    border-radius: 14px;
  }

  .command-radio-brand {
    min-height: 20px;
    padding-right: 62px;
  }

  .command-radio-brand span,
  .command-radio-brand b,
  .command-head span,
  .command-memory span,
  .command-log span {
    font-size: 10px;
  }

  .command-head {
    min-height: 58px;
    padding: 8px;
  }

  .command-head strong {
    font-size: 13px;
  }

  .command-control-deck {
    gap: 6px;
    padding: 7px;
  }

  .command-channels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .command-memory {
    min-height: 26px;
    padding: 6px;
    gap: 4px;
  }

  .command-assets,
  .command-buttons,
  .command-specials {
    gap: 5px;
  }

  .command-assets button,
  .command-buttons button,
  .command-specials button {
    min-height: 28px;
    padding: 5px 6px;
    font-size: 10px;
  }

  .command-log {
    max-height: 30px;
    overflow: hidden;
  }

  .command-tactical-map {
    left: 276px;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, calc(env(safe-area-inset-bottom) + 8px));
    width: auto;
    height: min(178px, calc(100vh - 16px));
    min-width: 0;
    min-height: 0;
  }
}
