/* GiC | Membership badge layout V5.
   No-level badge is an IN-FLOW second row, fully contained in the profile card.
   This stylesheet ONLY styles the signed-in mobile drawer account block.
   Tier appearance and backend permissions remain unchanged.
 */
@media (max-width: 850px) {
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 142px !important;
    max-height: none !important;
    gap: 12px !important;
    padding: 13px 13px 15px !important;
    overflow: visible !important;
  }
  /* Actual top row wrapper: the avatar and name never compete with the badge. */
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > .gic-badge-v5-identity {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > .gic-badge-v5-identity > .gic-v4-avatar {
    grid-area: auto !important;
    flex: 0 0 42px !important;
    align-self: center !important;
    margin: 0 !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > .gic-badge-v5-identity > .gic-v4-user-info {
    display: flex !important;
    flex: 1 1 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    align-self: center !important;
    grid-area: auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 3px !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > .gic-badge-v5-identity > .gic-v4-user-info small {
    height: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    display: block !important;
    line-height: 1.4 !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > button.gic-v4-plan.gic-v4-smart-badge:not(.has-level) {
    display: inline-flex !important;
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    grid-area: auto !important;
    flex: 0 0 auto !important;
    order: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    width: max-content !important;
    max-width: calc(100% - 16px) !important;
    min-width: min(176px, 95%) !important;
    min-height: 40px !important;
    height: auto !important;
    padding: 9px 20px !important;
    margin: 0 auto !important;
    text-align: center !important;
    z-index: 1 !important;
  }
}
@media (max-width: 375px) {
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) {
    padding: 11px 10px 13px !important;
    min-height: 138px !important;
    gap: 11px !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > .gic-badge-v5-identity {
    gap: 9px !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge:not(.has-level)) > .gic-badge-v5-identity > .gic-v4-avatar {
    flex-basis: 38px !important;
  }
}

/* GiC | Compact Membership Badge V6 (no-level state only).
   Keep "FREE MEMBERSHIP" intact, but return it to the RIGHT of the user identity,
   as a small inline pill, instead of a full-width second row.
   CORE and PRO states are intentionally unaffected.
   V5's original JS continues to own the identity wrapper; no JS changes.
*/
@media (max-width: 850px) {
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: calc(100% - 2px) !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 66px !important;
    height: auto !important;
    margin: 0 1px 10px !important;
    padding: 10px 9px !important;
    gap: 7px !important;
    overflow: hidden !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > .gic-badge-v5-identity {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > .gic-badge-v5-identity > .gic-v4-user-info {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > .gic-badge-v5-identity > .gic-v4-user-info small {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    overflow: hidden !important;
    overflow-wrap: normal !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level) {
    display: inline-flex !important;
    position: static !important;
    flex: 0 0 auto !important;
    order: 0 !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 45% !important;
    min-height: 31px !important;
    height: 31px !important;
    margin: 0 !important;
    padding: 6px 8px !important;
    gap: 4px !important;
    align-self: center !important;
    justify-self: auto !important;
    inset: auto !important;
    transform: none !important;
    font: 800 10px/1.05 Manrope,system-ui,sans-serif !important;
    letter-spacing: .006em !important;
    white-space: nowrap !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level) .gic-v4-badge-tier {
    font: inherit !important;
    letter-spacing: inherit !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 375px) {
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) {
    padding: 8px 7px !important;
    gap: 5px !important;
    min-height: 63px !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > .gic-badge-v5-identity {
    gap: 6px !important;
  }
  html body > #mobileNav.mobile-menu.gic-premium-drawer-v4 .gic-v4-account.gic-badge-v5-stacked:has(> button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level)) > button.gic-v4-plan.gic-v4-smart-badge.is-free:not(.has-level) {
    font-size: 8.75px !important;
    padding: 5px 6px !important;
    min-height: 29px !important;
    height: 29px !important;
  }
}
