.top-right-nav {
    position: fixed;
    top: 28px;
    right: 30px;
    z-index: 2100;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 20260512_NAV_AUTH_SESSION_MATCH_1 */
:root {
    --app-modal-backdrop: rgba(34, 41, 52, 0.48);
    --app-modal-backdrop-filter: blur(6px) saturate(106%);
    --public-light-modal-backdrop: var(--app-modal-backdrop);
    --public-light-modal-backdrop-filter: var(--app-modal-backdrop-filter);
    --auth-sheet-overlay: var(--app-modal-backdrop);
    --auth-sheet-overlay-filter: var(--app-modal-backdrop-filter);
    --auth-sheet-backdrop-glow: rgba(0, 0, 0, 0);
    --auth-sheet-panel: rgba(12, 14, 18, 0.98);
    --auth-sheet-panel-strong: rgba(15, 18, 22, 0.995);
    --auth-sheet-surface: rgba(255, 255, 255, 0.04);
    --auth-sheet-surface-strong: rgba(255, 255, 255, 0.07);
    --auth-sheet-border: rgba(255, 255, 255, 0.08);
    --auth-sheet-text: #f2f5f8;
    --auth-sheet-muted: rgba(231, 236, 242, 0.62);
    --auth-sheet-soft: rgba(231, 236, 242, 0.4);
    --auth-sheet-accent: #6b9ece;
    --auth-sheet-accent-strong: #7eb8ef;
    --auth-sheet-link-accent: #7eb8ef;
    --auth-sheet-blue-soft: rgba(107, 158, 206, 0.12);
    --auth-sheet-blue-soft-strong: rgba(107, 158, 206, 0.18);
    --auth-sheet-blue-border: rgba(107, 158, 206, 0.34);
    --auth-sheet-blue-bright: #7eb8ef;
    --auth-sheet-blue-bright-soft: rgba(126, 184, 239, 0.2);
    --auth-sheet-danger: #d48a83;
    --auth-sheet-success: #94bba8;
    --auth-sheet-panel-shadow:
        0 26px 70px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --auth-sheet-field-bg: rgba(255, 255, 255, 0.042);
    --auth-sheet-field-bg-focus: rgba(255, 255, 255, 0.042);
    --auth-sheet-field-placeholder: rgba(231, 236, 242, 0.28);
    --auth-sheet-tab-bg: rgba(255, 255, 255, 0.032);
    --auth-sheet-tab-border: rgba(255, 255, 255, 0.06);
    --auth-sheet-tab-indicator: rgba(220, 227, 235, 0.11);
    --auth-sheet-tab-indicator-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --auth-sheet-divider-line: rgba(255, 255, 255, 0.08);
    --auth-sheet-google-bg: rgba(255, 255, 255, 0.03);
    --auth-sheet-google-bg-hover: rgba(255, 255, 255, 0.06);
    --auth-sheet-google-border: rgba(255, 255, 255, 0.08);
    --auth-sheet-google-border-hover: rgba(255, 255, 255, 0.14);
    --auth-sheet-control-shadow-hover: 0 10px 22px rgba(0, 0, 0, 0.18);
    --auth-sheet-link-hover: #f2f5f8;
    --auth-sheet-handle-bg: rgba(107, 158, 206, 0.24);
    --auth-sheet-portaled-field-bg: rgba(12, 14, 18, 0.015);
    --auth-sheet-scrollbar-thumb: rgba(126, 184, 239, 0.34);
    --auth-sheet-scrollbar-thumb-hover: rgba(126, 184, 239, 0.48);
    --auth-sheet-scrollbar-track-border: rgba(11, 14, 20, 0.94);
    --auth-sheet-mobile-bottom-inset: max(0px, env(safe-area-inset-bottom));
}

html[data-theme="light"],
html:not([data-theme="dark"]) {
    --app-modal-backdrop: rgba(31, 76, 118, 0.20);
    --app-modal-backdrop-filter: blur(8px) saturate(108%);
    --auth-sheet-overlay: var(--app-modal-backdrop);
    --auth-sheet-overlay-filter: var(--app-modal-backdrop-filter);
    --auth-sheet-panel: rgba(252, 253, 255, 0.985);
    --auth-sheet-panel-strong: #ffffff;
    --auth-sheet-surface: rgba(248, 250, 252, 0.94);
    --auth-sheet-surface-strong: rgba(241, 245, 249, 0.98);
    --auth-sheet-border: rgba(148, 163, 184, 0.22);
    --auth-sheet-text: #0f172a;
    --auth-sheet-muted: rgba(71, 85, 105, 0.78);
    --auth-sheet-soft: rgba(100, 116, 139, 0.72);
    --auth-sheet-accent: #6b9ece;
    --auth-sheet-accent-strong: #7eb8ef;
    --auth-sheet-link-accent: #6b9ece;
    --auth-sheet-blue-soft: rgba(107, 158, 206, 0.1);
    --auth-sheet-blue-soft-strong: rgba(126, 184, 239, 0.14);
    --auth-sheet-blue-border: rgba(107, 158, 206, 0.26);
    --auth-sheet-blue-bright: #7eb8ef;
    --auth-sheet-blue-bright-soft: rgba(126, 184, 239, 0.16);
    --auth-sheet-danger: #b91c1c;
    --auth-sheet-success: #15803d;
    --auth-sheet-panel-shadow:
        0 28px 70px rgba(148, 163, 184, 0.2),
        0 8px 24px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
    --auth-sheet-field-bg: rgba(248, 250, 252, 0.96);
    --auth-sheet-field-bg-focus: #ffffff;
    --auth-sheet-field-placeholder: rgba(100, 116, 139, 0.58);
    --auth-sheet-tab-bg: rgba(241, 245, 249, 0.94);
    --auth-sheet-tab-border: rgba(148, 163, 184, 0.2);
    --auth-sheet-tab-indicator: #ffffff;
    --auth-sheet-tab-indicator-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
    --auth-sheet-divider-line: rgba(148, 163, 184, 0.2);
    --auth-sheet-google-bg: rgba(255, 255, 255, 0.9);
    --auth-sheet-google-bg-hover: #ffffff;
    --auth-sheet-google-border: rgba(148, 163, 184, 0.24);
    --auth-sheet-google-border-hover: rgba(107, 158, 206, 0.3);
    --auth-sheet-control-shadow-hover: 0 12px 24px rgba(148, 163, 184, 0.18);
    --auth-sheet-link-hover: #527fa8;
    --auth-sheet-handle-bg: rgba(107, 158, 206, 0.24);
    --auth-sheet-portaled-field-bg: rgba(255, 255, 255, 0.18);
    --auth-sheet-scrollbar-thumb: rgba(148, 163, 184, 0.34);
    --auth-sheet-scrollbar-thumb-hover: rgba(100, 116, 139, 0.46);
    --auth-sheet-scrollbar-track-border: rgba(252, 253, 255, 0.98);
}

body.auth-sheet-open {
    overflow: hidden;
}

.login-trigger-btn {
    position: relative;
}

.auth-display-none {
    display: none;
}

.avatar-dropdown [hidden],
.avatar-dropdown:not(.is-authenticated) .auth-user-only,
.avatar-dropdown[data-auth-state="guest"] .auth-user-only,
.avatar-dropdown.is-authenticated .auth-guest-only,
.avatar-dropdown[data-auth-state="authenticated"] .auth-guest-only {
    display: none !important;
}

.auth-dropdown-layer {
    z-index: 2100;
}

.avatar-unread-badge,
.dropdown-notif-badge {
    display: none;
}

.avatar-unread-badge {
    position: absolute;
    top: 8px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.avatar-unread-badge.is-visible {
    display: block;
}

.dropdown-notif-badge.is-visible {
    display: inline-block;
}

.auth-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 12060;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: max(40px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background: var(--auth-sheet-overlay);
    backdrop-filter: var(--auth-sheet-overlay-filter);
    -webkit-backdrop-filter: var(--auth-sheet-overlay-filter);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity, backdrop-filter;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.auth-sheet-overlay[hidden] {
    display: none;
}

.auth-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/*
  Legacy login-overlay compatibility:
  the new auth sheet still carries .login-overlay for shared close handlers,
  but older global stylesheets force a darker overlay with !important.
  Lock #loginModal back to the auth-sheet material values here so the backdrop
  stays consistent with the chat widget on every page.
*/
#loginModal.auth-sheet-overlay,
#loginModal.auth-sheet-overlay.active,
#loginModal.auth-sheet-overlay.login-overlay,
#loginModal.auth-sheet-overlay.login-overlay.active {
    background: var(--auth-sheet-overlay) !important;
    backdrop-filter: var(--auth-sheet-overlay-filter) !important;
    -webkit-backdrop-filter: var(--auth-sheet-overlay-filter) !important;
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
}

#loginModal.auth-sheet-overlay:not(.active):not(.closing),
#loginModal.auth-sheet-overlay.login-overlay:not(.active):not(.closing),
#loginModal.auth-sheet-overlay.closing,
#loginModal.auth-sheet-overlay.login-overlay.closing {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#loginModal.auth-sheet-overlay.auth-sheet-force-hidden,
#loginModal.auth-sheet-overlay.login-overlay.auth-sheet-force-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
}

#loginModal.auth-sheet-overlay.auth-sheet-force-hidden .auth-sheet-surface,
#loginModal.auth-sheet-overlay.login-overlay.auth-sheet-force-hidden .auth-sheet-surface {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
    animation: none !important;
}

.auth-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.auth-sheet-overlay.active .auth-sheet-backdrop {
    opacity: 0;
}

#loginModal.auth-sheet-overlay .auth-sheet-backdrop,
#loginModal.auth-sheet-overlay.login-overlay .auth-sheet-backdrop {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 0 !important;
}

.auth-sheet-stage {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: min(100%, 480px);
    min-height: 0;
}

.auth-sheet {
    position: relative;
    width: 100%;
    max-height: min(88svh, 860px);
    min-height: 0;
    border-radius: 26px;
    overflow: hidden;
    color: var(--auth-sheet-text);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    isolation: isolate;
}

.auth-sheet-surface {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background: var(--auth-sheet-panel);
    border: 1px solid var(--auth-sheet-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--auth-sheet-panel-shadow);
}

#loginModal.auth-sheet-overlay .auth-sheet-surface,
#loginModal.auth-sheet-overlay.login-overlay .auth-sheet-surface {
    background: var(--auth-sheet-panel) !important;
    border: 1px solid var(--auth-sheet-border) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: var(--auth-sheet-panel-shadow) !important;
}

.auth-sheet-motion-shell {
    position: relative;
    z-index: 1;
    min-height: 0;
    width: min(100%, 414px);
    margin: 0 auto;
    padding-bottom: 10px;
    transform: translateY(24px) scale(0.988);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.auth-sheet-form-core {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    width: min(100%, 414px);
    margin: 0 auto;
    padding: 10px 18px 16px;
    transform: translateY(18px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.auth-sheet-overlay.active .auth-sheet-motion-shell,
.auth-sheet-overlay.active .auth-sheet-form-core {
    transform: none;
    opacity: 1;
}

@keyframes authSheetStaggeredRise {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-sheet-overlay.active .auth-sheet-header {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.08s backwards;
}

.auth-sheet-overlay.active .auth-sheet-tabs:not([hidden]) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.13s backwards;
}

.auth-sheet-overlay.active .auth-sheet-message:not([hidden]) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.18s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active > :not(.auth-sheet-form):nth-child(1) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.18s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active > :not(.auth-sheet-form):nth-child(2) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.23s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active > :not(.auth-sheet-form):nth-child(3) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.28s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active > :not(.auth-sheet-form):nth-child(4) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.33s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active > :not(.auth-sheet-form):nth-child(5) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.38s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active .auth-sheet-form > :nth-child(1) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.24s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active .auth-sheet-form > :nth-child(2) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.29s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active .auth-sheet-form > :nth-child(3) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.34s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active .auth-sheet-form > :nth-child(4) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.39s backwards;
}

.auth-sheet-overlay.active .auth-sheet-view.is-active .auth-sheet-form > :nth-child(5) {
    animation: authSheetStaggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.44s backwards;
}

.auth-sheet-drag-zone {
    display: flex;
    justify-content: center;
    min-height: 28px;
    padding: 16px 24px 4px;
    touch-action: none;
}

.auth-sheet-handle {
    width: 42px;
    height: 3px;
    border-radius: 999px;
    background: var(--auth-sheet-handle-bg);
    transition: background-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.auth-sheet-drag-zone.is-close-armed .auth-sheet-handle {
    background: #ff5f56;
    box-shadow: 0 0 0 1px rgba(224, 68, 62, 0.2), 0 0 18px rgba(255, 95, 86, 0.34);
}

.auth-sheet-header {
    padding: 0 20px 6px;
    text-align: center;
}

.auth-sheet-overline {
    margin: 0 0 5px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--auth-sheet-accent);
}

.auth-sheet-title {
    width: 100%;
    margin: 0 auto;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(1.56rem, 4.7vw, 1.84rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
    font-weight: 600;
}

.auth-sheet-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0 20px;
    padding: 3px;
    border-radius: 999px;
    background: var(--auth-sheet-tab-bg);
    border: 1px solid var(--auth-sheet-tab-border);
    overflow: hidden;
    isolation: isolate;
}

.auth-sheet-tabs[hidden] {
    display: none;
}

.auth-sheet-tab-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: var(--auth-sheet-tab-indicator);
    box-shadow: var(--auth-sheet-tab-indicator-shadow);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), width 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}

.auth-sheet-tab {
    appearance: none;
    border: none;
    position: relative;
    z-index: 1;
    border-radius: 999px;
    padding: 8px 12px;
    background: transparent;
    color: var(--auth-sheet-soft);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.auth-sheet-tab:hover {
    color: var(--auth-sheet-text);
}

.auth-sheet-tab.is-active {
    background: transparent;
    color: var(--auth-sheet-text);
}

.auth-sheet-message {
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
    white-space: pre-line;
    border: 1px solid transparent;
}

.auth-sheet-message[hidden] {
    display: none;
}

.auth-sheet-message.is-reserved[hidden] {
    display: block !important;
    box-sizing: border-box;
    height: var(--auth-sheet-message-reserve-height, auto) !important;
    min-height: var(--auth-sheet-message-reserve-height, 0px);
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    color: transparent;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.auth-sheet-message.is-error {
    color: #ffd7d1;
    background: rgba(216, 132, 118, 0.12);
    border-color: rgba(216, 132, 118, 0.28);
}

html[data-theme="light"] #loginModal .auth-sheet-message.is-error,
html:not([data-theme="dark"]) #loginModal .auth-sheet-message.is-error {
    color: #9f3029;
    background: rgba(224, 80, 67, 0.09);
    border-color: rgba(205, 83, 70, 0.34);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
    font-weight: 600;
    text-shadow: none;
}

.auth-sheet-message.is-success {
    color: #dff6e7;
    background: rgba(143, 194, 161, 0.12);
    border-color: rgba(143, 194, 161, 0.3);
}

html[data-theme="light"] #loginModal .auth-sheet-message.is-success,
html:not([data-theme="dark"]) #loginModal .auth-sheet-message.is-success {
    color: #166534;
    background: rgba(220, 252, 231, 0.82);
    border-color: rgba(34, 197, 94, 0.34);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
    font-weight: 600;
    text-shadow: none;
}

.auth-sheet-body {
    position: relative;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 0;
    overscroll-behavior: contain;
    scrollbar-color: var(--auth-sheet-scrollbar-thumb) transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

#loginModal.auth-sheet-input-active .auth-sheet-body,
#loginModal[data-auth-current-view="register"] .auth-sheet-body,
#loginModal[data-auth-current-view="reset"] .auth-sheet-body {
    overflow-y: auto;
}

.auth-sheet-body::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.auth-sheet-body::-webkit-scrollbar-track,
.auth-sheet-body::-webkit-scrollbar-corner {
    background: transparent;
}

.auth-sheet-body::-webkit-scrollbar-thumb {
    border: 2px solid var(--auth-sheet-scrollbar-track-border);
    border-radius: 999px;
    background: var(--auth-sheet-scrollbar-thumb);
    background-clip: content-box;
}

.auth-sheet-body::-webkit-scrollbar-thumb:hover {
    background: var(--auth-sheet-scrollbar-thumb-hover);
    background-clip: content-box;
}

.auth-sheet-view {
    display: none;
}

.auth-sheet-view.is-active {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#loginView.auth-sheet-view--primary {
    gap: 10px;
    padding-top: 8px;
}

#loginView .auth-sheet-login-stack {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
}

#loginView .auth-sheet-login-fields-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#loginView .auth-sheet-google-btn {
    margin-top: 2px;
}

#loginView .auth-sheet-form {
    gap: 10px;
    margin-top: 0;
}

#loginView .auth-sheet-inline-row--spread {
    margin-top: 0;
}

#loginView .auth-sheet-submit {
    width: min(100%, 82%);
    margin: 0 auto;
}

#registerView .auth-sheet-submit,
#resetView .auth-sheet-submit {
    width: min(100%, 84%);
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
}

.auth-sheet-note {
    margin: 0;
    color: var(--auth-sheet-muted);
    font-size: 12px;
    line-height: 1.5;
}

.auth-sheet-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth-sheet-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-sheet-label {
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-sheet-soft);
}

#loginModal .auth-sheet-input-proxy,
.auth-sheet-input-proxy {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid var(--auth-sheet-border);
    background: var(--auth-sheet-field-bg);
    color: var(--auth-sheet-text);
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: text !important;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    box-sizing: border-box;
}

#loginModal .auth-sheet-input-proxy.is-active,
.auth-sheet-input-proxy.is-active {
    border-color: var(--auth-sheet-link-accent) !important;
}

.auth-sheet-input-proxy.is-portaled .auth-sheet-input-proxy-value,
.auth-sheet-input-proxy.is-portaled .auth-sheet-input-proxy-placeholder {
    opacity: 0;
}

.auth-sheet-input-proxy-value {
    display: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-sheet-input-proxy.is-filled .auth-sheet-input-proxy-value {
    display: block;
}

.auth-sheet-input-proxy-placeholder {
    color: var(--auth-sheet-field-placeholder);
    font-size: 14px;
    line-height: 1.25;
}

.auth-sheet-input-proxy.is-filled .auth-sheet-input-proxy-placeholder {
    display: none;
}

#loginModal .auth-sheet-input,
.auth-sheet-input {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid var(--auth-sheet-border) !important;
    background: var(--auth-sheet-field-bg) !important;
    color: var(--auth-sheet-text);
    font-size: 16px;
    line-height: 1.35;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: pan-y;
    box-sizing: border-box;
    caret-color: var(--auth-sheet-link-accent) !important;
    cursor: text;
}

.auth-sheet-input--parked {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#loginModal .auth-sheet-input.auth-sheet-input--portaled,
.auth-sheet-input.auth-sheet-input--portaled,
#authInputPlane .auth-sheet-input.auth-sheet-input--portaled,
#loginModal .auth-sheet-input.auth-sheet-input--portaled:focus,
.auth-sheet-input.auth-sheet-input--portaled:focus,
#authInputPlane .auth-sheet-input.auth-sheet-input--portaled:focus {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    caret-color: var(--auth-sheet-link-accent) !important;
}

#loginModal .auth-sheet-input.auth-sheet-input--portaled::placeholder,
.auth-sheet-input.auth-sheet-input--portaled::placeholder {
    color: transparent;
}

#loginModal .auth-sheet-input.auth-sheet-input--proxy-hidden,
.auth-sheet-input.auth-sheet-input--proxy-hidden,
#loginModal .auth-sheet-input.auth-sheet-input--proxy-hidden:focus,
.auth-sheet-input.auth-sheet-input--proxy-hidden:focus {
    color: transparent !important;
    caret-color: transparent !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.auth-sheet-input::placeholder {
    color: var(--auth-sheet-field-placeholder);
    font-size: 14px;
}

#loginModal .auth-sheet-input:focus,
.auth-sheet-input:focus {
    border-color: var(--auth-sheet-link-accent) !important;
    background: var(--auth-sheet-field-bg-focus) !important;
    box-shadow: none !important;
}

#loginModal .auth-sheet-input:-webkit-autofill,
#loginModal .auth-sheet-input:-webkit-autofill:hover,
#loginModal .auth-sheet-input:-webkit-autofill:focus,
.auth-sheet-input:-webkit-autofill,
.auth-sheet-input:-webkit-autofill:hover,
.auth-sheet-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-sheet-text) !important;
    caret-color: var(--auth-sheet-link-accent) !important;
    border-color: var(--auth-sheet-border) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--auth-sheet-field-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--auth-sheet-field-bg) inset !important;
    transition:
        background-color 9999s ease-in-out 0s,
        color 9999s ease-in-out 0s;
}

#loginModal .auth-sheet-input:-webkit-autofill:focus,
#loginModal .auth-sheet-input:-webkit-autofill:focus-visible,
.auth-sheet-input:-webkit-autofill:focus,
.auth-sheet-input:-webkit-autofill:focus-visible {
    border-color: var(--auth-sheet-link-accent) !important;
    -webkit-box-shadow:
        0 0 0 1000px var(--auth-sheet-field-bg-focus) inset,
        0 0 0 3px rgba(126, 184, 239, 0.14) !important;
    box-shadow:
        0 0 0 1000px var(--auth-sheet-field-bg-focus) inset,
        0 0 0 3px rgba(126, 184, 239, 0.14) !important;
}

#loginModal .auth-sheet-input:-moz-autofill,
#loginModal .auth-sheet-input:-moz-autofill:focus,
.auth-sheet-input:-moz-autofill,
.auth-sheet-input:-moz-autofill:focus {
    color: var(--auth-sheet-text) !important;
    caret-color: var(--auth-sheet-link-accent) !important;
    box-shadow: 0 0 0 1000px var(--auth-sheet-field-bg) inset !important;
}

.auth-sheet-inline-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: end;
}

.auth-sheet-inline-group--code {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 10px;
    align-items: stretch;
}

.auth-sheet-field--code {
    min-width: 0;
}

.auth-sheet-input-proxy--code,
.auth-sheet-input--code {
    min-width: 0;
}

.auth-sheet-inline-group--code .auth-sheet-secondary {
    width: 124px;
    min-height: 44px;
    padding-left: 16px;
    padding-right: 16px;
    align-self: stretch;
    background: var(--auth-sheet-blue-soft);
    border-color: var(--auth-sheet-blue-border);
    font-weight: 700;
}

.auth-input-plane {
    position: fixed;
    inset: 0;
    z-index: 12090;
    isolation: isolate;
    pointer-events: none;
}

.auth-input-plane.is-active {
    pointer-events: none;
}

.auth-sheet-inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.auth-sheet-inline-row--spread {
    justify-content: space-between;
}

.auth-sheet-inline-row--center {
    justify-content: center;
}

.auth-sheet-check {
    display: inline-flex;
    align-items: center;
    color: var(--auth-sheet-muted);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.auth-sheet-check--start {
    align-items: flex-start;
}

.auth-sheet-check input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0;
}

.auth-sheet-check > span {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding-left: 28px;
    gap: 5px;
    flex-wrap: wrap;
    line-height: 22px;
}

.auth-sheet-check > span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--auth-sheet-blue-border);
    border-radius: 6px;
    background: var(--auth-sheet-field-bg);
    box-shadow: none;
    transform: translateY(-50%);
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.auth-sheet-check > span::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    width: 8px;
    height: 4px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    border-radius: 1px;
    opacity: 0;
    transform: translateY(-62%) rotate(-45deg) scale(0.72);
    transform-origin: center;
    transition:
        opacity 0.16s ease,
        transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1.25);
}

.auth-sheet-check:hover > span::before {
    border-color: var(--auth-sheet-accent-strong);
    background: var(--auth-sheet-field-bg-focus);
}

.auth-sheet-check input[type="checkbox"]:checked + span::before {
    border-color: #6b9ece;
    background: #78acd8;
    box-shadow: none;
}

.auth-sheet-check input[type="checkbox"]:checked + span::after {
    opacity: 1;
    transform: translateY(-62%) rotate(-45deg) scale(1);
}

.auth-sheet-check input[type="checkbox"]:focus-visible + span::before {
    outline: 2px solid rgba(126, 184, 239, 0.45);
    outline-offset: 3px;
}

.auth-sheet-check input[type="checkbox"]:active + span::before {
    transform: translateY(-50%) scale(0.96);
}

.auth-sheet-check input[type="checkbox"]:disabled + span {
    cursor: not-allowed;
    opacity: 0.58;
}

.auth-sheet-check a {
    color: var(--auth-sheet-link-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(231, 236, 242, 0.2);
}

.auth-sheet-link {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    color: var(--auth-sheet-link-accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.auth-sheet-link:hover {
    color: var(--auth-sheet-link-hover);
}

.auth-sheet-submit,
.auth-sheet-secondary,
.auth-sheet-google-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.22s ease, filter 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.auth-sheet-google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    width: 100%;
    padding: 10px 14px;
    background: var(--auth-sheet-google-bg);
    border-color: var(--auth-sheet-google-border);
    color: var(--auth-sheet-text);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
}

.auth-sheet-google-btn:hover {
    transform: translate3d(0, -1px, 0);
    background: var(--auth-sheet-google-bg-hover);
    border-color: var(--auth-sheet-google-border-hover);
    box-shadow: var(--auth-sheet-control-shadow-hover);
}

.auth-sheet-google-mark,
.auth-sheet-google-btn img {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.auth-sheet-google-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-sheet-google-mark svg {
    display: block;
    width: 18px;
    height: 18px;
}

.google-login-btn.is-loading,
.auth-sheet-google-btn.is-loading {
    pointer-events: none !important;
    opacity: 0.75;
}

.google-login-btn__spinner {
    margin-right: 8px;
}

.auth-sheet-google-btn.gsi-hidden {
    display: none;
}

.auth-sheet-google-render-slot {
    display: none;
    width: 100%;
    min-height: 44px;
    justify-content: center;
}

.auth-sheet-google-render-slot.is-ready {
    display: flex;
}

.auth-sheet-google-render-slot.is-ready > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-sheet-google-render-slot iframe {
    max-width: 100%;
}

.auth-google-debug-badge {
    display: none;
    width: 100%;
    padding: 8px 12px;
    margin-top: -2px;
    border-radius: 12px;
    border: 1px dashed rgba(107, 158, 206, 0.34);
    background: rgba(107, 158, 206, 0.08);
    color: var(--auth-sheet-muted);
    font-size: 11px;
    line-height: 1.45;
    letter-spacing: 0.01em;
    text-align: center;
}

.auth-google-debug-badge.is-visible {
    display: block;
}

.auth-google-debug-floating {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    display: none;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(107, 158, 206, 0.28);
    background: rgba(12, 18, 32, 0.84);
    color: rgba(245, 248, 255, 0.94);
    box-shadow: 0 12px 28px rgba(7, 12, 23, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px;
    line-height: 1.45;
    letter-spacing: 0.01em;
    text-align: left;
    pointer-events: none;
}

.auth-google-debug-floating.is-visible {
    display: block;
}

.auth-admin-badge {
    color: #fbbf24;
}

.auth-sheet-divider {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    justify-items: center;
    column-gap: 18px;
    width: min(100%, calc(100% - 28px));
    margin: 0 auto;
    color: var(--auth-sheet-soft);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-sheet-divider::before,
.auth-sheet-divider::after {
    content: "";
    width: 100%;
    height: 1px;
    background: var(--auth-sheet-divider-line);
}

#loginModal .auth-sheet-submit,
#loginModal .auth-sheet-submit.login-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    width: 100%;
    padding: 11px 15px;
    background: #eef2f6 !important;
    color: #0f1317 !important;
    border: 1px solid rgba(237, 241, 245, 0.78) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    font-size: 14px;
    font-weight: 700;
}

#loginModal #loginView .auth-sheet-submit,
#loginModal #registerView .auth-sheet-submit {
    width: min(100%, 82%);
    max-width: 200px;
    min-height: 44px;
    padding: 11px 15px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 15px;
}

#loginModal #registerView .auth-sheet-submit {
    margin-top: auto;
}

#loginModal #registerView .auth-sheet-inline-group--code {
    width: 100%;
    grid-template-columns: minmax(0, 300px) 124px;
    justify-content: space-between;
    gap: 10px;
}

#loginModal #registerView .auth-sheet-inline-group--code .verify-code-btn {
    justify-self: end;
}

#loginModal .auth-sheet-input,
#loginModal .auth-sheet-input:focus,
#loginModal .auth-sheet-input.auth-sheet-input--portaled,
#loginModal .auth-sheet-input.auth-sheet-input--portaled:focus {
    caret-color: var(--auth-sheet-link-accent) !important;
}

html[data-theme="light"] #loginModal .auth-sheet-input,
html[data-theme="light"] #loginModal .auth-sheet-input:focus,
html[data-theme="light"] #loginModal .auth-sheet-input.auth-sheet-input--portaled,
html[data-theme="light"] #loginModal .auth-sheet-input.auth-sheet-input--portaled:focus,
html:not([data-theme="dark"]) #loginModal .auth-sheet-input,
html:not([data-theme="dark"]) #loginModal .auth-sheet-input:focus,
html:not([data-theme="dark"]) #loginModal .auth-sheet-input.auth-sheet-input--portaled,
html:not([data-theme="dark"]) #loginModal .auth-sheet-input.auth-sheet-input--portaled:focus {
    caret-color: #527fa8 !important;
}

#loginModal .auth-sheet-submit:hover,
#loginModal .auth-sheet-submit.login-submit-btn:hover {
    transform: translateY(-1px);
    background: #f6f8fb !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] #loginModal .auth-sheet-submit,
html[data-theme="light"] #loginModal .auth-sheet-submit.login-submit-btn,
html:not([data-theme="dark"]) #loginModal .auth-sheet-submit,
html:not([data-theme="dark"]) #loginModal .auth-sheet-submit.login-submit-btn {
    background: rgba(107, 158, 206, 0.96) !important;
    border-color: rgba(82, 127, 168, 0.36) !important;
    color: #08131f !important;
    box-shadow: none !important;
    filter: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

html[data-theme="light"] #loginModal .auth-sheet-submit:hover,
html[data-theme="light"] #loginModal .auth-sheet-submit.login-submit-btn:hover,
html:not([data-theme="dark"]) #loginModal .auth-sheet-submit:hover,
html:not([data-theme="dark"]) #loginModal .auth-sheet-submit.login-submit-btn:hover {
    transform: translate3d(0, -1px, 0);
    background: rgba(112, 166, 216, 0.96) !important;
    border-color: rgba(82, 127, 168, 0.5) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    filter: none;
}

html[data-theme="light"] #loginModal .auth-sheet-google-btn:hover,
html:not([data-theme="dark"]) #loginModal .auth-sheet-google-btn:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(107, 158, 206, 0.34);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#loginModal .auth-sheet-submit:disabled,
.auth-sheet-submit:disabled,
.auth-sheet-secondary:disabled,
.auth-sheet-google-btn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
    box-shadow: none;
}

.auth-sheet-secondary {
    min-height: 44px;
    padding: 0 13px;
    background: var(--auth-sheet-google-bg);
    border-color: var(--auth-sheet-google-border);
    color: var(--auth-sheet-text);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.auth-sheet-secondary:hover {
    transform: translateY(-1px);
    background: var(--auth-sheet-blue-soft-strong);
    border-color: rgba(126, 184, 239, 0.42);
}

#loginModal .auth-sheet-inline-group--code .verify-code-btn,
#loginModal .auth-sheet-inline-group--code .verify-code-btn:hover,
#loginModal .auth-sheet-inline-group--code .verify-code-btn:active,
#loginModal .auth-sheet-inline-group--code .verify-code-btn:focus-visible {
    border-radius: 13px;
    background: rgba(216, 224, 234, 0.12) !important;
    border: 1px solid rgba(216, 224, 234, 0.18) !important;
    color: #e9eef4 !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 700;
}

#loginModal .auth-sheet-inline-group--code .verify-code-btn:hover {
    transform: none;
    background: rgba(226, 233, 242, 0.18) !important;
    border-color: rgba(226, 233, 242, 0.24) !important;
    box-shadow: none !important;
}

html[data-theme="light"] #loginModal .auth-sheet-inline-group--code .verify-code-btn,
html[data-theme="light"] #loginModal .auth-sheet-inline-group--code .verify-code-btn:hover,
html[data-theme="light"] #loginModal .auth-sheet-inline-group--code .verify-code-btn:active,
html[data-theme="light"] #loginModal .auth-sheet-inline-group--code .verify-code-btn:focus-visible,
html:not([data-theme="dark"]) #loginModal .auth-sheet-inline-group--code .verify-code-btn,
html:not([data-theme="dark"]) #loginModal .auth-sheet-inline-group--code .verify-code-btn:hover,
html:not([data-theme="dark"]) #loginModal .auth-sheet-inline-group--code .verify-code-btn:active,
html:not([data-theme="dark"]) #loginModal .auth-sheet-inline-group--code .verify-code-btn:focus-visible {
    background: rgba(107, 158, 206, 0.16) !important;
    border-color: rgba(107, 158, 206, 0.38) !important;
    color: #102033 !important;
}

html[data-theme="light"] #loginModal .auth-sheet-inline-group--code .verify-code-btn:hover:not(:disabled),
html:not([data-theme="dark"]) #loginModal .auth-sheet-inline-group--code .verify-code-btn:hover:not(:disabled) {
    background: rgba(107, 158, 206, 0.22) !important;
    border-color: rgba(107, 158, 206, 0.5) !important;
}

#loginModal .auth-sheet-inline-group--code .verify-code-btn:disabled {
    opacity: 0.84;
}

html[data-theme="light"] #loginModal .auth-sheet-inline-group--code .verify-code-btn:disabled,
html:not([data-theme="dark"]) #loginModal .auth-sheet-inline-group--code .verify-code-btn:disabled {
    background: rgba(107, 158, 206, 0.11) !important;
    border-color: rgba(107, 158, 206, 0.28) !important;
    color: rgba(15, 23, 42, 0.54) !important;
}

#loginModal .auth-sheet-inline-group--code .verify-code-btn:active,
#loginModal .auth-sheet-inline-group--code .verify-code-btn:focus-visible,
.auth-sheet-inline-group--code .auth-sheet-secondary:active,
.auth-sheet-inline-group--code .auth-sheet-secondary:focus-visible {
    transform: translateY(0);
    box-shadow: none !important;
}

.auth-sheet-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(23, 24, 28, 0.28);
    border-top-color: #17181c;
    animation: authSheetSpin 0.8s linear infinite;
}

@keyframes authSheetSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 769px) {
    .auth-sheet-overlay {
        align-items: center;
        padding: 24px;
    }

    .auth-sheet-stage {
        width: min(100%, 480px);
    }

    .auth-sheet-drag-zone {
        display: none;
    }

    .auth-sheet {
        border-radius: 28px;
    }

    .auth-sheet-motion-shell {
        padding-bottom: 0;
    }

    .auth-sheet-header {
        padding-top: 18px;
    }

    .auth-sheet-overlay.auth-sheet-input-active .auth-sheet-body {
        padding-bottom: 0;
    }

    #loginModal .auth-sheet-input-proxy,
    .auth-sheet-input-proxy.auth-sheet-input-proxy--desktop-hidden {
        display: none;
    }

    #loginModal .auth-sheet-input.auth-sheet-input--canonical,
    .auth-sheet-input.auth-sheet-input--canonical,
    #loginModal .auth-sheet-input.auth-sheet-input--canonical.auth-sheet-input--parked,
    .auth-sheet-input.auth-sheet-input--canonical.auth-sheet-input--parked {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 11px 13px !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: auto !important;
        border: 1px solid var(--auth-sheet-border) !important;
        background: var(--auth-sheet-field-bg) !important;
    }

    #loginModal .auth-sheet-input.auth-sheet-input--canonical:focus,
    #loginModal .auth-sheet-input.auth-sheet-input--canonical:focus-visible,
    .auth-sheet-input.auth-sheet-input--canonical:focus,
    .auth-sheet-input.auth-sheet-input--canonical:focus-visible,
    #loginModal .auth-sheet-input.auth-sheet-input--canonical.auth-sheet-input--parked:focus,
    #loginModal .auth-sheet-input.auth-sheet-input--canonical.auth-sheet-input--parked:focus-visible,
    .auth-sheet-input.auth-sheet-input--canonical.auth-sheet-input--parked:focus,
    .auth-sheet-input.auth-sheet-input--canonical.auth-sheet-input--parked:focus-visible {
        border-color: var(--auth-sheet-link-accent) !important;
        background: var(--auth-sheet-field-bg-focus) !important;
        box-shadow: 0 0 0 3px rgba(126, 184, 239, 0.14) !important;
    }

    .auth-input-plane {
        display: none;
    }
}

@media (max-height: 680px) {
    #loginModal .auth-sheet-body {
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .auth-sheet-overlay.auth-sheet-input-active .auth-sheet-body {
        padding-bottom: var(--auth-sheet-mobile-bottom-inset);
    }

    .top-right-nav {
        top: 20px;
        right: 16px;
    }

    .auth-sheet-overlay {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: var(--auth-sheet-mobile-bottom-inset);
    }

    .auth-sheet-stage {
        width: 100%;
    }

    .auth-sheet {
        width: 100%;
        max-height: 88svh;
        border-radius: 20px 20px 0 0;
    }

    .auth-sheet-motion-shell {
        padding-bottom: 7px;
    }

    .auth-sheet-form-core {
        padding: 10px 20px calc(14px + env(safe-area-inset-bottom));
    }

    .auth-sheet-header {
        padding: 0 20px 6px;
    }

    .auth-sheet-tabs {
        margin-left: 20px;
        margin-right: 20px;
    }

    .auth-sheet-inline-group {
        grid-template-columns: 1fr;
    }

    .auth-sheet-inline-group--code {
        grid-template-columns: minmax(0, 1fr) 124px;
    }

    #loginModal #registerView .auth-sheet-inline-group--code {
        grid-template-columns: minmax(0, 1fr) 124px;
    }

    .auth-sheet-inline-row--spread {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    /*
      iOS Safari caret stability:
      flatten auth-sheet motion only while an input is focused, and give the
      portaled real input a tiny paint layer so the caret is composited
      against the input itself instead of a fully transparent surface.
    */
    .auth-sheet-overlay.active:focus-within,
    .auth-sheet-overlay.ios-focus-lock {
        transform: none !important;
        will-change: auto !important;
    }

    .auth-sheet-overlay.active:focus-within .auth-sheet-motion-shell,
    .auth-sheet-overlay.active:focus-within .auth-sheet-form-core,
    .auth-sheet-overlay.ios-focus-lock .auth-sheet-motion-shell,
    .auth-sheet-overlay.ios-focus-lock .auth-sheet-form-core {
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
        transition: none !important;
        will-change: auto !important;
    }

    .auth-sheet-overlay.active:focus-within .auth-sheet-input.auth-sheet-input--portaled,
    .auth-sheet-overlay.active:focus-within .auth-sheet-input.auth-sheet-input--portaled:focus,
    .auth-sheet-overlay.ios-focus-lock .auth-sheet-input.auth-sheet-input--portaled,
    .auth-sheet-overlay.ios-focus-lock .auth-sheet-input.auth-sheet-input--portaled:focus {
        background: var(--auth-sheet-portaled-field-bg) !important;
        opacity: 1 !important;
        color: var(--auth-sheet-text) !important;
        caret-color: var(--auth-sheet-link-accent) !important;
        text-indent: 0 !important;
        text-align: left !important;
        text-shadow: none !important;
    }

    .auth-sheet-overlay.active:focus-within .auth-sheet-input.auth-sheet-input--portaled::placeholder,
    .auth-sheet-overlay.active:focus-within .auth-sheet-input.auth-sheet-input--portaled::-webkit-input-placeholder,
    .auth-sheet-overlay.ios-focus-lock .auth-sheet-input.auth-sheet-input--portaled::placeholder,
    .auth-sheet-overlay.ios-focus-lock .auth-sheet-input.auth-sheet-input--portaled::-webkit-input-placeholder {
        color: transparent !important;
        -webkit-text-fill-color: transparent !important;
    }

    #loginModal.auth-sheet-submit-active.auth-sheet-input-active .auth-sheet-body,
    #loginModal.auth-sheet-submitting.auth-sheet-input-active .auth-sheet-body {
        padding-bottom: var(--auth-sheet-mobile-bottom-inset) !important;
    }

    #loginModal.auth-sheet-submit-active .auth-sheet-motion-shell,
    #loginModal.auth-sheet-submit-active .auth-sheet-form-core,
    #loginModal.auth-sheet-submitting .auth-sheet-motion-shell,
    #loginModal.auth-sheet-submitting .auth-sheet-form-core {
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
        will-change: auto !important;
    }
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .auth-sheet-overlay.auth-sheet-input-active .auth-sheet-body {
        padding-bottom: calc(min(360px, 42svh) + env(safe-area-inset-bottom));
    }

    #loginModal .auth-sheet-submit:hover,
    #loginModal .auth-sheet-submit.login-submit-btn:hover,
    html[data-theme="light"] #loginModal .auth-sheet-submit:hover,
    html[data-theme="light"] #loginModal .auth-sheet-submit.login-submit-btn:hover,
    html:not([data-theme="dark"]) #loginModal .auth-sheet-submit:hover,
    html:not([data-theme="dark"]) #loginModal .auth-sheet-submit.login-submit-btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

@media (max-width: 420px) {
    .auth-sheet-title {
        font-size: 1.46rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    .auth-sheet-overlay,
    .auth-sheet-backdrop,
    .auth-sheet-stage,
    .auth-sheet,
    .auth-sheet-tab,
    .auth-sheet-input,
    .auth-sheet-submit,
    .auth-sheet-secondary,
    .auth-sheet-google-btn,
    .auth-sheet-link {
        transition: none;
    }

    .auth-sheet-spinner {
        animation: none;
    }
}
