html.auth-pending body { overflow: hidden !important; }
html.auth-pending body > :not(#authGate):not(noscript) { visibility: hidden !important; }
#authGate {
  position: fixed; inset: 0; z-index: 200000; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px; box-sizing: border-box;
  background: #faf5f6; color: #29323d;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Noto Sans JP", sans-serif;
}
#authGate[hidden] { display: none; }
#authLogoutBtn[hidden] { display: none; }
#homeAuthBtn[hidden] { display: none; }
.auth-home-btn {
  flex-shrink: 0; min-height: 36px; padding: 7px 16px;
  border: 1px solid #ca788c; border-radius: 999px;
  background: #fff; color: #8a354c; font: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.auth-home-btn:hover { background: #fff2f5; }
.auth-home-btn:focus-visible { outline: 3px solid #a75066; outline-offset: 2px; }
@media (max-width: 640px) {
  header .header-main-row { flex-wrap: wrap; gap: 8px; }
  header .header-right { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .auth-home-btn { padding: 7px 12px; }
}
.auth-card {
  width: 100%; max-width: 440px; box-sizing: border-box; padding: 36px;
  border: 1px solid #e9dfe2; border-radius: 18px; background: #fff;
  box-shadow: 0 12px 38px #7254600d;
}
.auth-brand { color: #a75066; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.auth-card h1 { margin: 12px 0; font-size: 26px; line-height: 1.5; }
.auth-intro { margin: 0 0 26px; font-size: 14px; line-height: 1.8; color: #626670; }
#authForm > label { display: block; margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
#authForm > input {
  width: 100%; box-sizing: border-box; border: 1px solid #cdd2d8; border-radius: 8px;
  padding: 12px; background: #fff; color: #29323d; font: inherit; font-size: 16px;
}
#authGate input:focus-visible, #authGate button:focus-visible { outline: 3px solid #de8a9e; outline-offset: 2px; }
#authForm .auth-remember { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 400; line-height: 1.7; }
.auth-remember input { width: 17px; height: 17px; margin: 2px 0 0; flex: 0 0 auto; accent-color: #a75066; }
.auth-hint { color: #72757d; font-size: 12px; line-height: 1.7; margin: 6px 0; }
.auth-status { color: #a23248; font-size: 13px; line-height: 1.7; min-height: 22px; margin: 18px 0 12px; }
.auth-submit { width: 100%; padding: 13px; border: 0; border-radius: 8px; background: #a75066; color: white; font: inherit; font-weight: 700; cursor: pointer; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-retry { display: block; margin: 14px auto 0; padding: 8px; background: none; border: 0; color: #6e6268; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.auth-note { border-top: 1px solid #eee7e9; padding-top: 16px; margin: 20px 0 0; font-size: 11px; line-height: 1.8; color: #7e7780; }
@media (max-width: 480px) { #authGate { padding: 16px; } .auth-card { padding: 28px 22px; } }
@media (max-height: 700px) { #authGate { align-items: flex-start; } }
