/* v0.3 auth overlay: fixed viewport center, background click never dismisses. */
.auth-overlay[hidden], .auth-form[hidden], .auth-feedback[hidden] { display: none !important; }
.auth-overlay { position: fixed; z-index: 1200; inset: 0; padding: 24px 14px; display: grid; place-items: center; background: rgba(14, 23, 43, .65); overflow-y: auto; overscroll-behavior: contain; }
.auth-dialog { box-sizing: border-box; width: min(100%, 420px); max-height: calc(100dvh - 48px); overflow-y: auto; margin: auto; background: #fff; color: #16223a; border-radius: 18px; border: 1px solid rgba(155, 165, 182, .45); box-shadow: 0 30px 100px rgba(5, 12, 27, .34); padding: 26px 30px 24px; }
.auth-dialog-heading { position: relative; min-height: 35px; display: flex; justify-content: center; align-items: center; margin: 0 0 19px; }
.auth-dialog-heading h2 { font-size: 21px; font-weight: 750; line-height: 1.4; text-align: center; margin: 0; padding: 0 28px; color: #152746; }
.auth-close { position: absolute; right: -8px; top: 50%; transform: translateY(-50%); border: 0; padding: 5px 8px; background: transparent; border-radius: 7px; font-size: 25px; line-height: 1; color: #667085; cursor: pointer; }
.auth-close:hover,.auth-close:focus-visible { background: #eef2f7; color: #162d53; }
.auth-form { display: grid; gap: 9px; }
.auth-form label { display: block; font-size: 13px; font-weight: 700; margin-top: 5px; }
.auth-form input { width: 100%; box-sizing: border-box; min-height: 43px; border: 1px solid #c9d1df; border-radius: 9px; padding: 10px 12px; background: #fff; color: #192640; font-size: 14px; }
.auth-form input:focus { outline: 2px solid #397bdd; outline-offset: 1px; border-color: #397bdd; }
.auth-primary { cursor: pointer; border: 0; width: 100%; min-height: 44px; background: #1e64c7; color: white; border-radius: 9px; font-weight: 700; font-size: 15px; margin-top: 13px; }
.auth-primary:hover { background: #174e9e; }
.auth-primary:disabled,.auth-form input:disabled { opacity: .65; cursor: wait; }
.auth-link-row { display: flex; align-items: center; justify-content: center; gap: 13px; flex-wrap: wrap; margin-top: 8px; color: #94a0b0; }
.auth-link-row button { background: none; border: none; cursor: pointer; color: #405f90; font-size: 13px; padding: 5px 3px; }
.auth-link-row button:hover { text-decoration: underline; }
.auth-link-row button:disabled { opacity: .4; cursor: not-allowed; text-decoration: none; }
.auth-feedback { margin: 0 0 13px; padding: 10px 12px; font-size: 13px; line-height: 1.5; border: 1px solid #adc9f5; color: #24538f; background: #f3f8ff; border-radius: 9px; }
.auth-feedback.is-error { background: #fff5f5; color: #a52834; border-color: #f3c6cc; }
.auth-form-description { margin: 0 0 4px; color: #627084; font-size: 13px; line-height: 1.6; }
body.auth-open { overflow: hidden; }
.header-auth-controls { display: flex; flex-shrink: 0; align-items: center; gap: 7px; }
.header-auth-button { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-height: 34px; cursor: pointer; border: 1px solid #cbd8eb; border-radius: 7px; color: #345783; background: #f7faff; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.header-auth-button:hover { background: #e9f2ff; }
.header-auth-button.auth-signup { background: #2563bd; border-color: #2563bd; color: #fff; }
.header-account-name { color: #dceafb; font-size: 12px; font-weight: 650; }
.auth-required-panel { padding: 45px 18px; text-align: center; margin: 20px auto; max-width: 540px; border: 1px solid #d8e1ed; background: #fff; border-radius: 17px; }
.auth-required-panel h1 { margin-top: 0; font-size: 25px; }
.auth-required-panel p { color: #66758b; font-size: 14px; line-height: 1.7; }
.auth-required-panel .auth-primary { max-width: 220px; }
@media(max-width:720px) {
 .auth-dialog { padding: 22px 20px 20px; max-height: calc(100dvh - 30px); }
 .auth-dialog-heading h2 { font-size: 19px; }
 .header-auth-button { padding: 5px 8px; font-size: 11px; }
 .header-account-name { display: none; }
}
