/* First-paint account state.
   <html data-auth="user|guest"> is written by the inline script in PublicLayout before
   any style applies. React confirms the account and then drives the real attributes
   (data-auth-state on the public button, data-authenticated on the workspace header). */

/* Public header: both labels are in the HTML; the hint shows one until PublicAuth reports. */
.lp-login [data-login-label] { display: none; }
.lp-login:not([data-auth-state]) [data-login-label=guest] { display: inline; }
html[data-auth=user] .lp-login:not([data-auth-state]) [data-login-label=guest] { display: none; }
html[data-auth=user] .lp-login:not([data-auth-state]) [data-login-label=user] { display: inline; }
.lp-login[data-auth-state=guest] [data-login-label=guest],
.lp-login[data-auth-state=user] [data-login-label=user] { display: inline; }

/* Workspace header while the stored credential is still being verified (data-authenticated=pending).
   The guest button is the only sign-in control; under a "user" hint it is drawn as the account avatar
   and still opens sign-in, so an old credential never blocks an explicit login. */
html body .app-header[data-authenticated=pending] [data-pending] { pointer-events: none; }
html body .app-header .header-auth.is-guest > .ph { display: none; }
html[data-auth=user] body .app-header[data-authenticated=pending] .header-auth.is-guest {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; margin: 0;
  border: 2px solid #111; border-radius: 50%; background: #fff; color: #111; box-shadow: none; line-height: 1;
}
html[data-auth=user] body .app-header[data-authenticated=pending] .header-auth.is-guest > .ph { display: inline-block; font-size: 30px; line-height: 1; }
html[data-auth=user] body .app-header[data-authenticated=pending] .header-auth.is-guest > span { display: none; }
@media (max-width: 767px) {
  html[data-auth=user] body .app-header.workspace-header[data-authenticated=pending] .header-auth.is-guest {
    grid-column: 3; grid-row: 1; justify-self: end; width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  }
}
html:not([data-auth=user]) body .app-header[data-authenticated=pending] :is(.header-balance-group[data-pending], #header-earn[data-pending]) { display: none !important; }
html body .app-header .header-pending-text {
  display: inline-block; width: 2.2em; height: 0.9em; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, #e6e6e6, #f5f5f5, #e6e6e6); background-size: 200% 100%;
  animation: header-pending-shimmer 1.2s linear infinite;
}
@keyframes header-pending-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { html body .app-header .header-pending-text { animation: none; } }
