/* One compact segmented control on every viewport. */
.aim-mobile-brand { display: none; }

.app-shell .aim-mobile-select {
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
  min-width: 0 !important;
  height: 38px !important;
  padding: 3px !important;
  border: 1px solid rgba(193, 171, 241, .26) !important;
  border-radius: 999px !important;
  background: rgba(11, 10, 18, .9) !important;
  transform: none !important;
}

.app-shell .aim-mobile-select > button {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  height: 30px !important;
  padding: 0 11px !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #aaa3b7 !important;
  background: transparent !important;
  font: 700 11px/1 "Inter", "Instrument Sans", ui-sans-serif, system-ui, sans-serif !important;
  cursor: pointer;
}

.app-shell .aim-mobile-select > button.is-active {
  color: #fff !important;
  background: linear-gradient(135deg, #8a5eee, #6345ce) !important;
  box-shadow: 0 5px 14px rgba(111, 77, 230, .36), inset 0 1px rgba(255,255,255,.2) !important;
}

.app-shell .aim-mobile-select > button:disabled { opacity: .32; }

.app-shell .topbar-actions .aim-mobile-select {
  margin: 0 !important;
}

.app-shell .aim-mobile-select + .aim-mobile-select {
  margin-left: 2px;
}

@media (max-width: 620px) {
  .app-shell .topbar {
    display: flex !important;
    align-items: center !important;
    min-height: 66px !important;
    padding: 0 12px !important;
    gap: 10px !important;
  }

  .app-shell .mobile-menu-button {
    order: 1;
    margin: 0 !important;
  }

  .app-shell .topbar::before {
    content: "";
    display: block;
    order: 2;
    flex: 0 0 82px;
    width: 82px;
    height: 28px;
    background: url("/brand/aimcode-logo-light.svg") center / contain no-repeat;
  }

  .app-shell .aim-mobile-brand {
    display: none !important;
  }

  .app-shell .topbar-actions {
    order: 3;
    width: auto !important;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  .app-shell .topbar-trail { display: none !important; }

  .app-shell .topbar-actions .aim-mobile-select {
    height: 34px !important;
  }

  .app-shell .aim-mobile-brand {
    align-items: center;
    flex: 0 0 88px;
    width: 88px;
    min-width: 0;
  }

  .app-shell .aim-mobile-brand img {
    width: 88px;
    height: auto;
    object-fit: contain;
  }

  .app-shell .topbar-actions .aim-mobile-select > button {
    height: 26px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
  }

  /* The pseudo brand is the stable mobile fallback; do not let React layout updates
     push it out when the authenticated header re-renders. */
  .app-shell .topbar-actions > .topbar-balance,
  .app-shell .topbar-actions > .live-online-badge,
  .app-shell .topbar-actions > .admin-entry,
  .app-shell .topbar-actions > .user-menu {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .app-shell .topbar {
    min-height: 58px !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }

  .app-shell .topbar::before {
    flex-basis: 70px;
    width: 70px;
    height: 25px;
  }

  .app-shell .topbar-actions {
    gap: 4px !important;
  }

  .app-shell .aim-mobile-select {
    height: 32px !important;
  }

  .app-shell .aim-mobile-select > button {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 9px !important;
  }
}
