/* Login only. No root tokens or messenger selectors. */
html[data-theme][data-theme] #auth-screen { background: var(--login-bg); background-image: none; color: var(--login-ink); }
#auth-screen {
  --login-bg: #f2f2f7; --login-surface: #fff; --login-ink: #1c1c1e;
  --login-muted: #636366; --login-fill: #f2f2f7; --login-line: #d1d1d6; --login-blue: #006bdd;
  background: var(--login-bg); color: var(--login-ink); color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  height: 100dvh; min-height: 0; overflow-y: auto; align-items: flex-start;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
html[data-theme="dark"] #auth-screen:not([data-login-theme="light"]),
#auth-screen[data-login-theme="dark"] {
  --login-bg: #000; --login-surface: #1c1c1e; --login-ink: #f5f5f7;
  --login-muted: #aeaeb2; --login-fill: #2c2c2e; --login-line: #48484a; --login-blue: #75b8ff;
  color-scheme: dark;
}
#auth-screen .auth-bg, #auth-screen .auth-logo-glow { display: none; }
#auth-screen .auth-card {
  width: min(420px, 100%); max-width: 100%; margin: auto;
  padding: 32px 26px 24px; border-radius: 28px; border: 1px solid var(--login-line);
  background: var(--login-surface); color: var(--login-ink); backdrop-filter: none;
  box-shadow: 0 12px 40px rgb(0 0 0 / .08); overflow: visible;
}
#auth-screen .auth-logo-icon { width: 76px; height: 76px; border-radius: 19px; box-shadow: none; }
#auth-screen .auth-logo-text { font-size: 28px; font-weight: 700; letter-spacing: -.7px; color: var(--login-ink); background: none; -webkit-text-fill-color: var(--login-ink); }
#auth-screen .subtitle { color: var(--login-muted); font-size: 14px; line-height: 1.45; margin-bottom: 28px; }
#auth-screen .auth-input-group { height: 52px; min-height: 52px; border-radius: 13px; background: var(--login-fill); border: 1px solid var(--login-line); box-shadow: none; margin-bottom: 12px; }
#auth-screen .auth-input-group:focus-within { border-color: var(--login-blue); box-shadow: 0 0 0 3px rgb(0 122 255 / .18); }
#auth-screen .auth-input-group input { font: 400 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; color: var(--login-ink) !important; -webkit-text-fill-color: var(--login-ink); background: transparent; }
#auth-screen .auth-input-group input::placeholder { color: var(--login-muted) !important; -webkit-text-fill-color: var(--login-muted); }
#auth-screen .auth-input-group input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--login-fill) inset !important; -webkit-text-fill-color: var(--login-ink) !important; }
#auth-screen .auth-input-icon, #auth-screen .auth-eye-btn { color: var(--login-muted); }
#auth-screen .auth-eye-btn { min-width: 44px; min-height: 44px; background: transparent; }
#auth-screen .auth-card button#auth-submit, #auth-screen .auth-card button#auth-code-submit {
  height: 50px; min-height: 50px; border-radius: 13px; font-size: 17px; font-weight: 600;
  color: #fff; -webkit-text-fill-color: #fff; background: #007aff; box-shadow: none; border: 0; transform: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
#auth-screen .auth-qr-btn { min-height: 48px; border-radius: 13px; font-size: 15px; font-weight: 600; color: var(--login-blue); background: var(--login-fill); border: 1px solid var(--login-line); box-shadow: none; }
#auth-screen .auth-remember { color: var(--login-muted); font-size: 12px; }
#auth-screen .auth-checkbox { width: 20px; height: 20px; border-radius: 6px; border-color: var(--login-line); }
#auth-screen .auth-remember input:checked ~ .auth-checkbox { background: #007aff; }
#auth-screen .auth-alt-link, #auth-screen .auth-forgot { color: var(--login-blue); min-height: 44px; font-size: 13px; font-weight: 500; }
#auth-screen .auth-code-label { color: var(--login-muted); }
#auth-screen .login-theme-picker { display: flex; width: max-content; max-width: 100%; margin: 20px auto 0; padding: 3px; gap: 2px; border-radius: 9px; background: var(--login-fill); }
#auth-screen .login-theme-picker button { min-height: 40px; padding: 6px 13px; border: 0; border-radius: 7px; color: var(--login-muted); background: transparent; font: 500 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#auth-screen .login-theme-picker button[aria-pressed="true"] { background: var(--login-surface); color: var(--login-ink); box-shadow: 0 1px 4px rgb(0 0 0 / .13); }
#auth-screen :is(button, a):focus-visible { outline: 3px solid var(--login-blue); outline-offset: 3px; }
/* The grouped field supplies its own visible keyboard focus ring. */
#auth-screen .auth-input-group input:focus,
#auth-screen .auth-input-group input:focus-visible { outline: none; box-shadow: none; }
@media (max-width: 430px) { #auth-screen .auth-card { padding: 28px 22px 22px; border-radius: 24px; } }
@media (prefers-reduced-motion: reduce) { #auth-screen *, #auth-screen *::before, #auth-screen *::after { animation: none; transition: none; } }
