/* Small, signed-in notifications shortcut beside the header profile photo.
   No fake unread badge and no push-alert promises. */
.topbar #headerNotificationBell{
  display:grid!important;
  place-items:center;
  position:relative;
  flex:0 0 40px;
  width:40px;
  height:40px;
  padding:0;
  margin:0;
  border-radius:14px;
  background:linear-gradient(145deg,#302444,#1b1827)!important;
  color:#eadfff!important;
  border:1px solid #8065a5!important;
  box-shadow:inset 0 1px #ffffff15,0 5px 14px #0005!important;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.topbar #headerNotificationBell.hidden{display:none!important}
.topbar #headerNotificationBell svg{
  display:block;
  width:21px;
  height:21px;
  pointer-events:none;
  transform-origin:50% 16%;
  animation:l1017-header-bell-ring 10s ease-in-out infinite;
}
.topbar #headerNotificationBell:hover{
  background:linear-gradient(145deg,#44305e,#292039)!important;
  border-color:#bd94f5!important;
}
.topbar #headerNotificationBell:active{transform:scale(.95)}
.topbar #headerNotificationBell:focus-visible{
  outline:3px solid #e6d7ff!important;
  outline-offset:3px!important;
}
.topbar #headerNotificationBell:hover svg{
  animation:l1017-header-bell-hover .65s ease-in-out 1;
}
@keyframes l1017-header-bell-ring{
  0%,88%,97%,100%{transform:rotate(0)}
  89%{transform:rotate(8deg)}
  91%{transform:rotate(-8deg)}
  93%{transform:rotate(5deg)}
  95%{transform:rotate(-3deg)}
}
@keyframes l1017-header-bell-hover{
  0%,100%{transform:rotate(0)}
  25%{transform:rotate(9deg)}
  50%{transform:rotate(-9deg)}
  75%{transform:rotate(4deg)}
}
/* RTL header: account avatar is the leftmost control, bell immediately to its right. */
.topbar #googleProfileButton:not(.hidden),
body.l1017-live-ui .topbar #googleProfileButton:not(.hidden){
  order:10!important;
  margin:0!important;
}
body.l1017-live-ui .topbar #headerNotificationBell{
  order:9!important;
  flex:0 0 39px!important;
  width:39px!important;
  height:39px!important;
  border-radius:13px!important;
  margin:0!important;
}
@media(max-width:900px){
  body.l1017-live-ui .topbar #headerNotificationBell{
    flex-basis:37px!important;
    width:37px!important;height:37px!important;
  }
  body.l1017-live-ui .topbar #headerNotificationBell svg{width:20px;height:20px}
}
@media(max-width:430px){
  body.l1017-live-ui .topbar #headerNotificationBell{
    flex:0 0 34px!important;
    width:34px!important;height:36px!important;
    border-radius:12px!important;
  }
  body.l1017-live-ui .topbar #headerNotificationBell svg{width:19px;height:19px}
}
@media(max-width:350px){
  body.l1017-live-ui .topbar #headerNotificationBell{
    flex-basis:32px!important;width:32px!important;height:34px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .topbar #headerNotificationBell svg{animation:none!important;transform:none!important}
  .topbar #headerNotificationBell{transition:none!important}
}

/* Keep the wallet, bell and avatar as one close visual cluster on mobile.
   RTL flex order (from right to left): wallet 8 → bell 9 → avatar 10. */
@media(max-width:900px){
  body.l1017-live-ui .topbar:has(#googleProfileButton:not(.hidden)):has(#headerNotificationBell:not(.hidden)){
    justify-content:flex-start!important;
    gap:3px!important;
    column-gap:3px!important;
  }
  body.l1017-live-ui .topbar:has(#googleProfileButton:not(.hidden)) .account-wallet-group{
    margin:0!important;
    padding:0!important;
  }
  body.l1017-live-ui .topbar #headerNotificationBell:not(.hidden){
    order:9!important;
    margin:0!important;
  }
  body.l1017-live-ui .topbar #googleProfileButton:not(.hidden){
    order:10!important;
    margin:0!important;
  }
}
@media(max-width:430px){
  body.l1017-live-ui .topbar:has(#googleProfileButton:not(.hidden)):has(#headerNotificationBell:not(.hidden)){
    gap:2px!important;
    column-gap:2px!important;
  }
}


/* Structural order lock: the header cluster is LTR regardless of the Arabic page.
   Left -> right: profile photo, notifications bell, wallet balance. */
.topbar #headerAccountCluster{
  display:flex!important;
  flex-flow:row nowrap!important;
  direction:ltr!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:4px!important;
  column-gap:4px!important;
  padding:0!important;
  margin:0!important;
  order:99!important;
  flex:0 0 auto!important;
  min-width:0!important;
}
body.l1017-live-ui .topbar #headerAccountCluster > #googleProfileButton,
body.l1017-live-ui .topbar #headerAccountCluster > #googleProfileButton:not(.hidden){
  order:0!important;
  margin:0!important;
}
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
  order:1!important;
  margin:0!important;
}
body.l1017-live-ui .topbar #headerAccountCluster > .account-wallet-group,
body.l1017-live-ui .topbar #headerAccountCluster > .account-wallet-group:has(#customerWalletChip){
  order:2!important;
  direction:rtl!important;
  padding:0!important;
  margin:0!important;
  flex:0 0 auto!important;
}
/* A single compact group stays pinned at the left edge even if other
   legacy header controls have auto margins or their own display order. */
body.l1017-live-ui .topbar #headerAccountCluster{
  margin-inline-start:auto!important;
}
@media(max-width:900px){
  body.l1017-live-ui .topbar #headerAccountCluster{
    gap:3px!important;
    column-gap:3px!important;
  }
}
@media(max-width:430px){
  body.l1017-live-ui .topbar #headerAccountCluster{
    gap:2px!important;
    column-gap:2px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    width:clamp(116px,34vw,144px)!important;
    max-width:144px!important;
  }
}

/* Actual left edge positioning on mobile: visual order alone is not enough.
   Reserve physical space for the cluster so the rest of the header cannot overlap it. */
@media(max-width:900px){
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)){
    position:sticky!important;
    padding-left:clamp(215px,32vw,265px)!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster:has(#googleProfileButton:not(.hidden)){
    position:absolute!important;
    left:10px!important;
    right:auto!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    margin:0!important;
    width:max-content!important;
    max-width:calc(100% - 15px)!important;
    flex:0 0 auto!important;
    justify-content:flex-start!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):not(:has(#customerWalletChip:not(.hidden))){
    padding-left:94px!important;
  }
}
@media(max-width:430px){
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
    padding-left:clamp(198px,56vw,234px)!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster:has(#googleProfileButton:not(.hidden)){
    left:8px!important;
    gap:2px!important;
  }
}
@media(max-width:350px){
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
    padding-left:199px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster:has(#googleProfileButton:not(.hidden)){
    left:6px!important;
  }
}

/* Circular notification button with a clear outer ring.
   Overrides legacy square corners while preserving icon animation and header placement. */
.topbar #headerAccountCluster > #headerNotificationBell,
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
  width:40px!important;
  height:40px!important;
  flex:0 0 40px!important;
  min-width:40px!important;
  min-height:40px!important;
  border-radius:50%!important;
  border:2px solid #b995ff!important;
  background:rgba(77,55,122,.26)!important;
  box-shadow:0 0 0 3px rgba(185,149,255,.16),inset 0 1px rgba(255,255,255,.12),0 5px 14px rgba(0,0,0,.33)!important;
}
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell svg{
  width:19px!important;
  height:19px!important;
}
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell:hover{
  border-color:#d8c2ff!important;
  background:rgba(93,63,148,.35)!important;
  box-shadow:0 0 0 4px rgba(216,194,255,.19),inset 0 1px rgba(255,255,255,.16)!important;
}
@media(max-width:430px){
  body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
    width:36px!important;
    height:36px!important;
    flex:0 0 36px!important;
    min-width:36px!important;
    min-height:36px!important;
    border-radius:50%!important;
  }
}
@media(max-width:350px){
  body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
    width:34px!important;
    height:34px!important;
    flex:0 0 34px!important;
    min-width:34px!important;
    min-height:34px!important;
  }
}

/* Slightly larger notification bell and a little breathing room.
   Keep physical left anchoring and the LTR avatar → bell → balance order. */
body.l1017-live-ui .topbar #headerAccountCluster{
  gap:6px!important;
  column-gap:6px!important;
}
.topbar #headerAccountCluster > #headerNotificationBell,
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  flex:0 0 42px!important;
  border-radius:50%!important;
}
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell svg{
  width:22px!important;
  height:22px!important;
}
@media(max-width:900px){
  body.l1017-live-ui .topbar #headerAccountCluster{
    gap:5px!important;
    column-gap:5px!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)){
    padding-left:clamp(275px,49vw,288px)!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):not(:has(#customerWalletChip:not(.hidden))){
    padding-left:102px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    min-height:40px!important;
    flex:0 0 40px!important;
  }
}
@media(max-width:430px){
  body.l1017-live-ui .topbar #headerAccountCluster{
    gap:5px!important;
    column-gap:5px!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
    padding-left:clamp(208px,60vw,248px)!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    flex:0 0 38px!important;
  }
}
@media(max-width:350px){
  body.l1017-live-ui .topbar #headerAccountCluster{
    gap:4px!important;
    column-gap:4px!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
    padding-left:208px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    flex:0 0 36px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell svg{
    width:20px!important;
    height:20px!important;
  }
}


/* Unread badge: visible ONLY for server-confirmed new status notifications. */
.topbar #headerNotificationBell,
body.l1017-live-ui .topbar #headerAccountCluster > #headerNotificationBell{
  overflow:visible!important;
}
.topbar #headerNotificationBell .header-notification-count{
  position:absolute!important;
  top:-8px!important;
  right:-5px!important;
  z-index:2!important;
  display:grid!important;
  place-items:center!important;
  min-width:19px!important;
  height:19px!important;
  padding:0 4px!important;
  border:2px solid #160f27!important;
  border-radius:999px!important;
  color:#fff!important;
  background:linear-gradient(145deg,#ff5865,#e02037)!important;
  box-shadow:0 3px 11px #ed2c5280!important;
  font-family:system-ui,sans-serif!important;
  font-size:10px!important;
  font-weight:900!important;
  line-height:1!important;
  text-align:center!important;
  font-variant-numeric:tabular-nums;
  pointer-events:none!important;
  white-space:nowrap!important;
  transform-origin:center!important;
}
.topbar #headerNotificationBell .header-notification-count[hidden]{
  display:none!important;
}
@media(prefers-reduced-motion:no-preference){
  .topbar #headerNotificationBell .header-notification-count:not([hidden]){
    animation:l1017UnreadBadgePop .32s cubic-bezier(.22,1.6,.4,1) both;
  }
  @keyframes l1017UnreadBadgePop{
    from{opacity:.6;scale:.5}
    to{opacity:1;scale:1}
  }
}
@media(max-width:430px){
  .topbar #headerNotificationBell .header-notification-count{
    top:-7px!important;
    right:-4px!important;
    min-width:18px!important;
    height:18px!important;
    font-size:10px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .topbar #headerNotificationBell .header-notification-count{
    animation:none!important;
  }
}

/* Large, legible wallet amount: allow room for full decimals beside the logo and plus. */
body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  color:#fff!important;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;
  font-weight:950!important;
  letter-spacing:-.65px!important;
  line-height:1.1!important;
  text-shadow:0 1px 0 #ffffff15,0 2px 12px #bca6ff48!important;
  font-size:var(--l1017-header-balance-font-size,26px)!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}
@media(max-width:900px){
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    width:clamp(163px,43vw,188px)!important;
    max-width:188px!important;
    grid-template-columns:28px minmax(0,1fr) 28px!important;
    gap:3px!important;
    padding:3px 4px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip .gb-libyana-badge{
    width:28px!important;height:28px!important;min-width:28px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerTopupShortcut{
    width:28px!important;height:28px!important;
    min-width:28px!important;min-height:28px!important;
  }
}
@media(max-width:430px){
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    width:clamp(156px,43vw,179px)!important;
    max-width:179px!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
    padding-left:clamp(252px,69vw,292px)!important;
  }
}
@media(max-width:350px){
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    width:145px!important;
    max-width:145px!important;
    grid-template-columns:25px minmax(0,1fr) 25px!important;
  }
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip .gb-libyana-badge,
  body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerTopupShortcut{
    width:25px!important;height:25px!important;min-width:25px!important;min-height:25px!important;
  }
  body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
    padding-left:240px!important;
  }
}

/* Bigger balance numerals requested: prioritize the amount without clipping the carrier logo. */
body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  font-size:var(--l1017-header-balance-font-size,34px)!important;
  font-weight:950!important;
  letter-spacing:-.9px!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  line-height:1!important;
  text-shadow:0 1px 2px #0007,0 0 12px #cfb4ff44!important;
}
@media(max-width:900px){
 body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
   width:clamp(180px,46vw,205px)!important;
   max-width:205px!important;
   grid-template-columns:27px minmax(0,1fr) 27px!important;
   gap:3px!important;
 }
}
@media(max-width:430px){
 body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
   width:clamp(174px,49vw,194px)!important;
   max-width:194px!important;
   grid-template-columns:27px minmax(0,1fr) 27px!important;
 }
 body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
   padding-left:clamp(263px,74vw,300px)!important;
 }
}
@media(max-width:350px){
 body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
   width:152px!important;
   max-width:152px!important;
   grid-template-columns:25px minmax(0,1fr) 25px!important;
 }
 body.l1017-live-ui .topbar:has(#headerAccountCluster #googleProfileButton:not(.hidden)):has(#customerWalletChip:not(.hidden)){
   padding-left:240px!important;
 }
}

/* True text-width fitting: keep short wallet balances visibly large on iPhone. */
body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  font-size:var(--l1017-header-balance-font-size,36px)!important;
  font-weight:950!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  transform:scaleX(var(--l1017-header-balance-scale,1))!important;
  transform-origin:50% 50%!important;
  text-overflow:clip!important;
  overflow:visible!important;
  white-space:nowrap!important;
}

/* Harmonized mobile wallet amount: balanced, fully visible digits. */
body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  font-size:var(--l1017-header-balance-font-size,29px)!important;
  font-weight:850!important;
  letter-spacing:-.3px!important;
  line-height:1.12!important;
  text-shadow:0 1px 5px #0005!important;
  text-align:center!important;
}
@media(max-width:430px){
 body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
   width:clamp(166px,46vw,186px)!important;
   max-width:186px!important;
 }
}
@media(max-width:350px){
 body.l1017-live-ui .topbar #headerAccountCluster .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
   width:148px!important;
   max-width:148px!important;
 }
}
