/* SerieAGoal v1.16 — header guests vs members.
 * Additive, scoped to .sg-topbar--guest. Logged-in header untouched.
 * No theme/favourites/notification/profile buttons are rendered for guests.
 */
.sg-topbar.sg-topbar--guest .sg-top-actions {
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  justify-self:end!important;
  gap:8px!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger {
  flex:0 0 40px!important;
  display:grid!important;
  place-items:center!important;
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  padding:0!important;
  margin:0!important;
  background:transparent!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger:hover,
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger:focus-visible {
  background:rgba(255,255,255,.13)!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-btn {
  display:inline-flex!important;
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
  width:auto!important;
  height:36px!important;
  min-height:36px!important;
  min-width:0!important;
  padding:0 16px!important;
  border:1px solid rgba(255,255,255,.29)!important;
  border-radius:9px!important;
  font-family:inherit!important;
  font-size:12px!important;
  line-height:1!important;
  font-weight:800!important;
  letter-spacing:0!important;
  text-decoration:none!important;
  transition:background .16s ease,border-color .16s ease,transform .16s ease!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-login {
  background:rgba(0,0,0,.1)!important;
  color:#fff!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-login:hover {
  background:rgba(255,255,255,.14)!important;
  border-color:rgba(255,255,255,.6)!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-register {
  background:#04ae89!important;
  border-color:#04ae89!important;
  color:#062b23!important;
  box-shadow:0 2px 9px rgba(0,0,0,.08)!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-register:hover {
  background:#16cba3!important;
  border-color:#16cba3!important;
  transform:translateY(-1px)!important;
}
html[data-sg-theme="dark"] .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-register {
  background:#26d9a4!important;
  border-color:#26d9a4!important;
  color:#062b23!important;
}
.sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-btn:focus-visible {
  outline:2px solid #fff!important;
  outline-offset:3px!important;
}

/* Tight notebook width: give room to the two CTAs without touching main nav. */
@media (min-width:761px) and (max-width:1100px) {
  .sg-topbar.sg-topbar--guest .sg-top-actions {gap:5px!important}
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-btn {
    height:34px!important;min-height:34px!important;
    padding-inline:10px!important;font-size:11px!important;
  }
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger {
    flex-basis:36px!important;width:36px!important;height:36px!important;min-width:36px!important;
  }
}

/* Guest mobile keeps navigation hamburger; authentication takes priority over
   search, which remains available in desktop header and normal site navigation. */
@media (max-width:760px) {
  .sg-topbar.sg-topbar--guest .sg-topbar-inner {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:4px!important;
    padding-left:max(8px,env(safe-area-inset-left))!important;
    padding-right:max(8px,env(safe-area-inset-right))!important;
  }
  .sg-topbar.sg-topbar--guest .sg-brand {
    grid-column:1!important;min-width:0!important;max-width:102px!important;
  }
  .sg-topbar.sg-topbar--guest .sg-brand img {max-width:100%!important}
  .sg-topbar.sg-topbar--guest .sg-search-launch {display:none!important}
  .sg-topbar.sg-topbar--guest .sg-top-actions {
    grid-column:2!important;
    grid-row:1!important;
    display:flex!important;
    width:auto!important;height:40px!important;
    gap:4px!important;
    align-items:center!important;
    margin:0!important;
    padding:0!important;
  }
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger {
    display:grid!important;
    flex:0 0 32px!important;
    width:32px!important;height:36px!important;min-width:32px!important;
    border-radius:7px!important;
  }
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger .sg-site-ai-trigger-label {display:none!important}
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger img {width:21px!important;height:21px!important}
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-btn {
    height:34px!important;min-height:34px!important;
    border-radius:8px!important;
    padding:0 9px!important;
    font-size:11px!important;
  }
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-mobile-menu-trigger {
    display:grid!important;
    flex:0 0 36px!important;
    width:36px!important;height:36px!important;min-width:36px!important;
    place-items:center!important;
    padding:0!important;margin:0!important;
    border-radius:8px!important;
  }
}
@media (max-width:360px) {
  .sg-topbar.sg-topbar--guest .sg-brand {max-width:77px!important}
  .sg-topbar.sg-topbar--guest .sg-top-actions {gap:2px!important}
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-site-ai-trigger {
    flex-basis:29px!important;width:29px!important;min-width:29px!important;
  }
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-auth-header-btn {
    padding-inline:7px!important;font-size:10.5px!important;
  }
  .sg-topbar.sg-topbar--guest .sg-top-actions>.sg-mobile-menu-trigger {
    flex-basis:33px!important;width:33px!important;min-width:33px!important;
  }
}
