
/* =========================================================
   MOBILE ACCOUNT BAR — REAL GAP FIX v46
   Keep the handle, account badges, online dot, and navigation buttons as one
   compact row. Nothing gets a flexible spacer between it and the next item.
   ========================================================= */
@media (max-width: 640px) {
  .card.account-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 9px 9px !important;
    min-height: 50px !important;
    overflow: visible !important;
  }

  #authenticatedAccountIdentity.account-identity {
    display: block !important;
    flex: 0 1 auto !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 100px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  #authenticatedAccountIdentity .verified-username-line {
    display: inline-grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: max-content !important;
    align-items: center !important;
    justify-content: start !important;
    column-gap: 1px !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    font-size: 12.8px !important;
    line-height: 1 !important;
  }

  #authenticatedAccountIdentity .verified-username-line > span:first-child {
    display: none !important;
  }

  #authenticatedAccountIdentity .verified-handle {
    display: inline-flex !important;
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 64px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #authenticatedAccountIdentity #currentUsername {
    display: inline !important;
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #authenticatedAccountIdentity .verified-badge,
  #authenticatedAccountIdentity .role-badge,
  #authenticatedAccountIdentity .developer-badge,
  #authenticatedAccountIdentity .admin-badge {
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #authenticatedAccountIdentity .verified-badge {
    width: 13px !important;
    min-width: 13px !important;
    height: 13px !important;
    min-height: 13px !important;
  }

  #authenticatedAccountIdentity .role-badge,
  #authenticatedAccountIdentity .developer-badge,
  #authenticatedAccountIdentity .admin-badge {
    width: 15px !important;
    min-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
  }

  #authenticatedAccountIdentity .role-wrench-icon,
  #authenticatedAccountIdentity .role-badge > .role-wrench-icon,
  #authenticatedAccountIdentity .developer-badge > .role-wrench-icon,
  #authenticatedAccountIdentity .admin-badge > .role-wrench-icon {
    width: 14px !important;
    min-width: 14px !important;
    height: 14px !important;
    min-height: 14px !important;
  }

  #authenticatedAccountIdentity #onlineBadge.online-badge {
    position: static !important;
    display: inline-block !important;
    flex: none !important;
    width: 8px !important;
    min-width: 8px !important;
    max-width: 8px !important;
    height: 8px !important;
    min-height: 8px !important;
    max-height: 8px !important;
    margin: 0 0 0 1px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #35c66b !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, #35c66b 16%, transparent) !important;
    overflow: hidden !important;
  }

  #authenticatedAccountIdentity #onlineBadge.online-badge.offline {
    background: var(--muted-text) !important;
    box-shadow: none !important;
  }

  #authenticatedAccountButtons,
  .card.account-bar #authenticatedAccountButtons,
  .card.account-bar .account-buttons {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #authenticatedAccountButtons > button,
  .card.account-bar #authenticatedAccountButtons > button {
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
  }
}

@media (max-width: 360px) {
  .card.account-bar {
    gap: 3px !important;
    padding-inline: 7px !important;
  }

  #authenticatedAccountIdentity.account-identity {
    max-width: 88px !important;
  }

  #authenticatedAccountIdentity .verified-handle {
    max-width: 53px !important;
  }

  #authenticatedAccountButtons,
  .card.account-bar #authenticatedAccountButtons {
    gap: 2px !important;
  }

  #authenticatedAccountButtons > button,
  .card.account-bar #authenticatedAccountButtons > button {
    flex-basis: 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
}



/* =========================================================
   MOBILE ACCOUNT BAR — LEFT IDENTITY / RIGHT CONTROLS v47
   The account identity is its own left-aligned section; navigation controls
   are a separate right-aligned section. Internal identity spacing stays tight.
   ========================================================= */
@media (max-width: 640px) {
  .card.account-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-content: stretch !important;
    column-gap: 8px !important;
    width: 100% !important;
    padding: 9px 12px !important;
  }

  #authenticatedAccountIdentity.account-identity {
    grid-column: 1 !important;
    justify-self: start !important;
    align-self: center !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  #authenticatedAccountButtons,
  .card.account-bar #authenticatedAccountButtons,
  .card.account-bar .account-buttons {
    grid-column: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    justify-content: flex-end !important;
    width: max-content !important;
    margin: 0 !important;
  }
}

@media (max-width: 360px) {
  .card.account-bar {
    column-gap: 5px !important;
    padding-inline: 9px !important;
  }
}
