/* Auth is a self-contained form, shared by desktop and mobile. */
html body #accountDialog {
  box-sizing: border-box; width: min(480px, calc(100% - 32px)); max-width: 480px;
  height: fit-content; max-height: calc(100dvh - 48px); margin: auto; padding: 0;
  inset: 0; border: 1px solid var(--os-strong-line); border-radius: 22px;
  background: var(--os-surface); color: var(--os-text); overflow: auto;
  font-family: inherit; text-align: left;
}
html body #accountDialog [hidden] { display: none !important; }
html body #accountDialog .auth-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; width: 100%; min-height: 76px; height: auto; margin: 0; padding: 16px 24px;
  box-sizing: border-box; border-bottom: 1px solid var(--os-strong-line); background: var(--os-surface);
}
html body #accountDialog h2 { margin: 0; font-weight: 750; font-family: inherit; font-size: 24px; line-height: 1.3; letter-spacing: 0; }
html body #accountDialog #closeAccountDialog {
  flex: 0 0 40px; width: 40px; height: 40px; padding: 0; margin: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--os-raised); color: var(--os-text);
}
html body #accountDialog #signedOutAccount,
html body #accountDialog #signedInAccount { padding: 24px; width: 100%; box-sizing: border-box; }
html body #accountDialog .account-intro { margin: 0 0 24px; font-size: 14px; line-height: 1.8; color: var(--os-muted); }
html body #accountDialog .auth-form { display: flex; flex-direction: column; width: 100%; gap: 0; margin: 0; padding: 0; }
html body #accountDialog .auth-form > label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; position: static;
  margin: 0 0 8px; padding: 0; height: auto; min-height: 0; width: 100%; background: none;
  border: 0; border-radius: 0; font-size: 14px; font-weight: 650; line-height: 1.5; color: var(--os-text);
}
html body #accountDialog label small { font-size: 12px; font-weight: 400; color: var(--os-muted); }
html body #accountDialog .auth-form input {
  box-sizing: border-box; position: static; display: block; flex: none; width: 100%; min-width: 0;
  height: 48px; min-height: 48px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--os-strong-line);
  border-radius: 12px; background: var(--os-raised); color: var(--os-text);
  font: inherit; font-size: 16px; line-height: 22px; outline: none;
}
html body #accountDialog input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
html body #accountDialog .auth-password { position: relative; width: 100%; margin-bottom: 20px; }
html body #accountDialog .auth-password input { padding-right: 64px; margin-bottom: 0; }
html body #accountDialog .auth-password button { position: absolute; top: 2px; right: 4px; height: 44px; min-width: 52px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--os-muted); font: inherit; font-size: 12px; cursor: pointer; }
html body #accountDialog .login-error { margin: 0 0 16px; color: var(--primary); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
html body #accountDialog .login-error:empty { display: none; }
html body #accountDialog .primary-button {
  box-sizing: border-box; display: flex; justify-content: center; align-items: center; width: 100%; height: auto;
  min-height: 48px; margin: 4px 0 0; padding: 12px 16px; border: 0; border-radius: 14px;
  background: var(--primary); color: var(--on-primary); font: inherit; font-size: 15px; font-weight: 650;
}
html body #accountDialog .account-switch-button,
html body #accountDialog #logoutButton {
  display: flex; justify-content: center; align-items: center; width: 100%; min-height: 44px;
  margin: 12px 0 0; padding: 10px; border: 0; border-radius: 12px; background: transparent;
  color: var(--primary); font: inherit; font-size: 14px; font-weight: 600;
}
html body #accountDialog button:disabled { opacity: .55; cursor: default; }
html body #accountDialog button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
html body #accountDialog .account-note { margin: 16px 0 0; color: var(--os-muted); text-align: center; font-size: 12px; line-height: 1.8; }
html body #accountDialog #verificationPanel { text-align: center; }
html body #accountDialog .auth-mail-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 8px 0 12px; background: var(--primary-container); color: var(--on-primary-container); border-radius: 20px; font-size: 30px; }
html body #accountDialog #verificationPanel h3 { margin: 8px 0 12px; font-size: 20px; }
html body #accountDialog #verificationPanel .account-intro { margin-bottom: 12px; }
html body #accountDialog .verification-email { display: block; overflow-wrap: anywhere; font-size: 16px; }
html body #accountDialog #verificationLoginButton { margin-top: 24px; }
html body #accountDialog .account-user { background: var(--os-raised); border-radius: 14px; }
@media (max-width: 719px) {
  html body #accountDialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  html body #accountDialog .auth-head { min-height: 64px; padding: 12px 20px; }
  html body #accountDialog h2 { font-size: 22px; }
  html body #accountDialog #signedOutAccount,
  html body #accountDialog #signedInAccount { max-width: 480px; margin-inline: auto; padding: 24px 20px; }
}
