/* Account screens share the live project palette; no separate brand colors. */
#accountBackdrop { background: rgb(9 9 11 / .58); backdrop-filter: blur(5px); }
#accountModal {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border: 1px solid var(--border); border-radius: var(--radius-modal, 36px);
  background: var(--card); box-shadow: 0 24px 80px rgb(0 0 0 / .22); padding: 0 40px 32px;
}
#accountModal:not(.hidden) { animation: auth-enter 200ms ease-out; }
#accountModal .account-modal-head { position: relative; justify-content: center; padding: 28px 40px 18px; border: 0; }
#accountModal .auth-wordmark { width: 142px; flex: 0 0 142px; margin: 0; }
#accountModal .drawer-close, #accountModal .auth-back {
  position: absolute; top: 20px; width: 44px; height: 44px; min-height: 44px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: var(--field); color: var(--text); cursor: pointer;
}
#accountModal .drawer-close { right: -4px; }
#accountModal .auth-back { left: -4px; }
#accountModal .drawer-close .ri-icon, #accountModal .auth-back .ri-icon { width: 22px; height: 22px; }
#accountModal .hidden { display: none !important; }
.auth-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0 !important; margin: -1px !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#accountGuest { display: flex; flex-direction: column; }
#accountModal .account-tabs { margin: 0 0 16px; border: 0; border-radius: 16px; padding: 4px; background: var(--field); }
#accountModal .account-tabs button { min-height: 48px; font-size: 16px; font-weight: 600; border-radius: 12px; }
#accountModal .auth-step-title { z-index: 1; text-align: center; margin: 28px 0 10px; font-size: 17px; line-height: 1.4; font-weight: 600; }
#accountModal .account-form { display: flex; flex-direction: column; gap: 16px; padding: 0; }
#accountModal .account-form label { font-size: 14px; font-weight: 500; line-height: 1.5; gap: 7px; }
#accountModal .account-form input {
  width: 100%; min-width: 0; height: 48px; background: var(--field); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 0 14px;
  font-family: inherit; font-size: 16px; font-weight: 400; box-shadow: none;
}
#accountModal input::placeholder { color: var(--muted); opacity: 1; }
#accountModal .auth-code-row, #accountModal .auth-password-field { display: grid; gap: 7px; width: 100%; }
#accountModal .auth-password-input { position: relative; }
#accountModal #authCode { padding-right: 48px; }
#accountModal #authCode::-ms-reveal, #accountModal #authCode::-ms-clear { display: none; }
#accountModal .account-form input:focus { outline: 2px solid var(--accent) !important; outline-offset: -2px !important; border-color: var(--accent) !important; box-shadow: none !important; }
#accountModal .auth-password-toggle { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted-strong); cursor: pointer; }
#accountModal .auth-password-toggle .ri-icon { width: 20px; height: 20px; }
#accountModal .registration-code-group { display: grid; gap: 7px; }
#accountModal .registration-code-input { position: relative; display: flex; }
#accountModal #authBack { border-radius: 50%; }
#accountModal #registrationCode { padding-right: 124px; }
#accountModal #requestRegistrationCode { position: absolute; right: 3px; top: 3px; width: 116px; height: 42px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
#accountModal #requestRegistrationCode:disabled { color: var(--muted); cursor: default; }
#accountModal .auth-text-button, #accountModal .auth-mode-switch button { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }
#accountModal .auth-forgot { align-self: flex-end; min-height: 32px; margin-top: -10px; }
#accountModal #sendCodeBtn { width: 100%; height: 48px; min-height: 48px; border-radius: 14px; background: var(--action); color: var(--on-action); box-shadow: none; font-size: 16px; }
#accountModal #sendCodeBtn:hover:not(:disabled) { background: var(--action-hover); }
#accountModal button:active:not(:disabled) { filter: brightness(.95); }
#accountModal button:disabled { cursor: wait; }
#accountModal .auth-mode-switch { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; min-height: 32px; color: var(--muted); font-size: 14px; }
#accountModal .auth-mode-switch button { min-height: 32px; }
#accountModal .account-message { min-height: 0; margin: 0; padding: 0; font-size: 13px; color: var(--muted-strong); }
#accountModal .account-message:empty { display: none; }
#accountModal .account-message.error { color: var(--danger); }
#accountModal .auth-reset-hint { margin: -8px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
#accountModal .wechat-login { padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.auth-qr-area { position: relative; width: 220px; height: 220px; margin: 0 auto; border-radius: 14px; border: 1px solid var(--border); background: var(--card-soft); overflow: hidden; }
.auth-qr-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 18px; color: var(--muted-strong); text-align: center; font-size: 14px; }
.auth-qr-placeholder .ri-icon { width: 56px; height: 56px; color: var(--muted); }
.auth-qr-area.is-embedded { width: min(220px, 100%); height: 220px; border: 0; background: #fff; }
#wechatQrMount iframe { display: block; width: 220px; max-width: 100%; height: 220px; border: 0; }
#accountModal #wechatInstruction { font-size: 16px; font-weight: 600; color: var(--text); }
#accountModal #wechatMessage { text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 340px; }
#accountModal .auth-wechat-actions { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
#accountModal .auth-wechat-actions .auth-text-button { min-height: 32px; display: inline-flex; align-items: center; }
#accountModal .auth-consent { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding-top: 12px; margin-top: 0; font-size: 12px; color: var(--muted-strong); line-height: 1.7; }
#accountModal #wechatInstruction,
#accountModal #wechatMessage { display: none !important; }
#accountModal .auth-consent-note, #accountModal .auth-consent-links { margin: 0; text-align: center; }
#accountModal .auth-consent-links { display: flex; align-items: center; gap: 3px; }
#accountModal .auth-legal-link { background: transparent; color: var(--accent); border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }
#authConsentMessage { width: 100%; margin: 0; color: var(--danger); text-align: center; }
#authConsentMessage:empty { display: none; }
#authLegalDialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 28px; border: 1px solid var(--border); border-radius: 24px; background: var(--card); color: var(--text); }
#authLegalDialog::backdrop { background: rgb(9 9 11 / .5); }
#authLegalDialog h2 { margin: 0 0 20px; font-size: 22px; }
#authLegalDialog h3 { font-size: 16px; margin: 20px 0 8px; }
#authLegalDialog p { font-size: 14px; line-height: 1.8; color: var(--muted-strong); }
#authLegalDialog button { display: block; width: 100%; margin-top: 24px; min-height: 44px; }
@keyframes auth-enter { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 520px) {
  #accountModal { padding: 0 22px 24px; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 28px; }
  #accountModal .account-modal-head { padding: 24px 40px 16px; }
  #accountModal .auth-wordmark { width: 132px; flex-basis: 132px; }
  #accountModal .drawer-close, #accountModal .auth-back { top: 17px; }
  #accountModal .auth-consent { padding-top: 12px; }
  #accountModal .auth-step-title { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { #accountModal:not(.hidden) { animation: none; } }
