/* Standalone pages use the blue/slate palette from v3.12 styles.css.
   --auth-green is retained as the existing shared account-menu token. */
:root { --auth-ink: #18202a; --auth-green: #2457d6; --workspace-paper: #f4f6f8; --workspace-line: #d9e0e7; --workspace-muted: #667085; }
html[data-auth-state="checking"] body, html[data-auth-state="locked"] body { visibility: hidden !important; pointer-events: none !important; }
html[data-auth-state="logout-pending"] body { visibility: visible !important; pointer-events: auto !important; }
html[data-auth-state="logout-pending"] body > :not(#authLogoutScreen) { display: none !important; }
.auth-logout-screen { position: fixed; inset: 0; z-index: 2147483647; overflow: auto; display: grid; place-items: center; padding: 24px; background: var(--workspace-paper); color: var(--auth-ink); font: 16px/1.6 system-ui, sans-serif; }
.auth-logout-screen .auth-card { width: min(100%, 440px); }
.auth-page { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px; box-sizing: border-box; background: var(--workspace-paper); color: var(--auth-ink); font: 16px/1.6 system-ui, sans-serif; }
.auth-card { width: min(100%, 390px); padding: 36px; box-sizing: border-box; border: 1px solid var(--workspace-line); border-radius: 14px; background: #fff; box-shadow: 0 8px 30px rgba(24, 32, 42, .06); }
.auth-brand { color: var(--auth-green); font-weight: 700; letter-spacing: .04em; }
.auth-card h1 { font-size: 28px; margin: 16px 0 4px; }
.auth-card p, .auth-dialog p { color: var(--workspace-muted); }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 6px; font-weight: 600; }
.auth-form input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #98a2b3; border-radius: 8px; font: inherit; background: #fff; color: var(--auth-ink); }
.auth-button { min-height: 44px; padding: 10px 16px; border: 1px solid #98a2b3; border-radius: 8px; background: white; color: var(--auth-ink); cursor: pointer; font: inherit; }
.auth-button.primary { background: var(--auth-green); color: white; border-color: var(--auth-green); }
.auth-button:disabled { opacity: .6; cursor: wait; }
.auth-form input:focus-visible, .auth-button:focus-visible, .auth-account summary:focus-visible { outline: 3px solid #729aff; outline-offset: 3px; }
.auth-form .auth-error { min-height: 1.6em; margin: 0; color: #b42318; font-weight: 400; }
.auth-note { font-size: 14px; }
.auth-account { position: relative; margin: 0; min-width: 0; color: var(--auth-ink); z-index: 50; }
.auth-account > summary { display: flex; align-items: center; gap: 10px; min-height: 46px; max-width: 280px; padding: 6px 12px 6px 6px; border: 1px solid var(--workspace-line); border-radius: 999px; background: #fff; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; }
.auth-account > summary::-webkit-details-marker { display: none; }
.auth-account > summary:hover, .auth-account[open] > summary { background: #edf3ff; border-color: #b9c9f2; }
#authAccountName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-avatar { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--auth-green); color: white; font-size: 13px; }
.auth-chevron { margin-left: auto; color: var(--workspace-muted); }
.auth-account[open] .auth-chevron { transform: rotate(180deg); }
.auth-account-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 306px; max-width: calc(100vw - 32px); max-height: min(720px, calc(100dvh - 96px)); overflow-y: auto; overscroll-behavior: contain; padding: 12px; border: 1px solid var(--workspace-line); border-radius: 14px; background: #fff; box-shadow: 0 16px 48px #10182826, 0 3px 8px #1018280a; }
.auth-account .auth-account-role { margin: 2px 10px 8px; color: var(--workspace-muted); font-size: 12px; font-weight: 650; letter-spacing: .06em; }
.auth-profile { display: grid; gap: 4px; padding: 12px; margin-bottom: 8px; border-radius: 10px; background: #f2f4f7; overflow-wrap: anywhere; }
.auth-profile small { color: var(--workspace-muted); font-size: 12px; }
#studentPill { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.auth-account-actions { display: grid; gap: 2px; }
.auth-account-actions .auth-button, .auth-account-actions a { display: block; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--auth-ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
.auth-account-actions span { display: block; margin-top: 3px; color: var(--workspace-muted); font-size: 12px; font-weight: 400; }
.auth-account-actions b { font-weight: inherit; }
.auth-account-actions .auth-button:hover, .auth-account-actions a:hover { background: #f2f4f7; }
.auth-account-actions a:focus-visible { outline: 3px solid #729aff; outline-offset: -1px; }
.auth-account-security { border-top: 1px solid var(--workspace-line); padding-top: 8px; margin-top: 8px; }
.auth-account-security .auth-signout { color: #b42318; }
.auth-interface-language { display: grid; gap: 4px; margin: 12px 0; min-width: 0; }
.auth-interface-language label { font-size: .82rem; color: var(--workspace-muted); }
.auth-interface-language select { width: 100%; max-width: 100%; min-height: 40px; padding: 6px 8px; border: 1px solid var(--workspace-line); border-radius: 8px; background: #fff; color: var(--auth-ink); font: inherit; }
.auth-interface-language select:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.auth-interface-language [role="status"]:not(:empty) { color: #b42318; font-size: .82rem; }
.auth-account .auth-account-help { margin: 8px 10px 14px; color: var(--workspace-muted); font-size: 13px; line-height: 1.65; }
.auth-account .auth-error { margin: 8px; font-size: 13px; color: #b42318; overflow-wrap: anywhere; }
.auth-account .auth-error:empty { display: none; }
.auth-dialog { width: min(420px, calc(100% - 40px)); max-height: 85vh; max-height: 85dvh; overflow: auto; overscroll-behavior: contain; box-sizing: border-box; border: 1px solid var(--workspace-line); border-radius: 16px; padding: 28px; color: var(--auth-ink); overflow-wrap: anywhere; }
.auth-dialog::backdrop { background: #10182888; }
.auth-dialog h2 { margin-top: 0; }
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* Intrinsic field widths and long feedback must stay inside standalone cards. */
.auth-card, .auth-form, .auth-form label { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.auth-page, .auth-logout-screen { grid-template-columns: minmax(0, 1fr); }
.auth-page { min-height: 100dvh; }
.auth-logout-screen, .auth-account-panel, .auth-button { box-sizing: border-box; }
.auth-form input { min-width: 0; max-width: 100%; }
.auth-button { min-width: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.auth-button:hover:not(:disabled) { background: #f2f4f7; border-color: #98a2b3; }
.auth-button.primary:hover:not(:disabled) { background: #1d46ad; border-color: #1d46ad; }
.auth-dialog :is(input, button) { scroll-margin-block: 12px; }
@media (max-width: 480px) {
  .auth-account > summary { max-width: 180px; }
  .auth-account-panel { position: fixed; top: 72px; right: 12px; width: 306px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 88px); }
  .auth-card { padding: 24px; }
  .auth-dialog { padding: 20px; }
  .auth-dialog .auth-actions { flex-direction: column; }
  .auth-dialog .auth-actions button { width: 100%; }
}
