.swal2-popup.auth-swal {
    --auth-accent-soft: rgba(var(--site-accent-rgb), 0.14);
    --auth-focus-ring: rgba(var(--site-accent-rgb), 0.18);
    --auth-danger-soft: rgba(var(--site-danger-rgb), 0.14);
    --auth-padding: 2.5rem;
    --auth-gap: 1.85rem;
    --auth-radius: 1.25rem;
    --auth-control-height: 4rem;
    --auth-control-radius: 0.9rem;
    --auth-badge: 3.7rem;
    --auth-title-size: 1.85rem;
    --auth-text-size: 1.15rem;
    --auth-label-size: 1.08rem;
    --auth-input-size: 1.3rem;
    --auth-button-size: 1.25rem;
    --auth-note-size: 1rem;
    --auth-close: 3.1rem;
    --auth-cell-height: 4.9rem;
    --auth-cell-size: 2.15rem;
    width: 34rem;
    max-width: calc(100vw - 2rem);
    padding: var(--auth-padding);
    border: 1px solid var(--site-line);
    border-radius: var(--auth-radius);
    background: var(--site-dialog);
    box-shadow: 0 1.85rem 5rem rgba(var(--site-shade-rgb), 0.55);
    color: var(--site-text-soft);
    text-align: left;
}

.swal2-container.auth-swal-container.swal2-backdrop-show {
    background: rgba(var(--site-night-rgb), 0.72);
}

.auth-swal .auth-swal__body {
    margin: 0;
    padding: 0;
    overflow: visible;
    color: inherit;
    text-align: left;
}

.auth-swal__head {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-swal__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--auth-badge);
    height: var(--auth-badge);
    border-radius: 1.1rem;
    background: var(--auth-accent-soft);
    color: var(--site-accent-text);
    font-size: calc(var(--auth-badge) / 2);
}

.auth-swal__badge.is-danger {
    background: var(--auth-danger-soft);
    color: var(--site-danger-light);
}

.auth-swal__badge i {
    color: inherit;
    font-size: inherit;
}

.auth-swal__title {
    margin: 0 0 0.6rem;
    color: var(--site-text);
    font-size: var(--auth-title-size);
    font-weight: 700;
    line-height: 1.25;
}

.auth-swal__text {
    margin: 0;
    color: var(--site-text-soft);
    font-size: var(--auth-text-size);
    line-height: 1.5;
}

.auth-swal__text b {
    color: var(--site-text);
    font-weight: 600;
}

.auth-swal .auth-swal__label {
    margin: var(--auth-gap) 0 0.6rem;
    justify-content: flex-start;
    color: var(--site-text-soft);
    font-size: var(--auth-label-size);
    font-weight: 600;
}

.auth-swal .auth-swal__input {
    box-sizing: border-box;
    width: 100%;
    height: var(--auth-control-height);
    margin: 0;
    padding: 0 1.25rem;
    border: 1px solid var(--site-field-line);
    border-radius: var(--auth-control-radius);
    background: var(--site-field);
    box-shadow: none;
    color: var(--site-text);
    font-size: var(--auth-input-size);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-swal .auth-swal__input::placeholder {
    color: var(--site-text-muted);
}

.auth-swal .auth-swal__input:focus {
    border-color: var(--site-accent);
    outline: none;
    box-shadow: 0 0 0 0.3rem var(--auth-focus-ring);
}

.auth-swal .auth-swal__error {
    justify-content: flex-start;
    margin: 1rem 0 0;
    padding: 0.8rem 1rem;
    border-radius: var(--auth-control-radius);
    background: var(--auth-danger-soft);
    color: var(--site-danger-pale);
    font-size: var(--auth-label-size);
    font-weight: 500;
}

.auth-swal .auth-swal__error::before {
    margin: 0 0.75rem 0 0;
    background-color: var(--site-danger-strong);
}

.auth-swal .auth-swal__actions {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.9rem;
    width: 100%;
    margin: var(--auth-gap) 0 0;
    padding: 0;
}

.auth-swal .swal2-loader {
    align-self: center;
    margin: 0 auto;
    border-color: var(--site-accent) transparent;
}

.auth-swal__confirm,
.auth-swal__cancel {
    flex: 1 1 0;
    min-height: var(--auth-control-height);
    margin: 0;
    border: 0;
    border-radius: var(--auth-control-radius);
    color: var(--site-text);
    font-size: var(--auth-button-size);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-swal__confirm {
    background: var(--site-accent-strong);
    color: var(--site-on-accent);
}

.auth-swal__confirm:hover {
    background: var(--site-accent);
}

.auth-swal__confirm.is-danger {
    background: var(--site-danger-strong);
}

.auth-swal__confirm.is-danger:hover {
    background: var(--site-danger-hover);
}

.auth-swal__cancel {
    border: 1px solid rgba(var(--site-ink-rgb), 0.16);
    background: transparent;
}

.auth-swal__cancel:hover {
    background: rgba(var(--site-ink-rgb), 0.06);
}

.auth-swal__confirm:focus-visible,
.auth-swal__cancel:focus-visible,
.auth-swal .auth-swal__close:focus-visible {
    outline: 3px solid rgba(var(--site-accent-rgb), 0.5);
    outline-offset: 2px;
}

.auth-swal__confirm:active,
.auth-swal__cancel:active {
    transform: translateY(1px);
}

.auth-swal .auth-swal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: var(--auth-close);
    height: var(--auth-close);
    margin: 0;
    border-radius: 0.8rem;
    color: var(--site-text-soft);
    font-size: 2rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-swal .auth-swal__close:hover {
    background: rgba(var(--site-ink-rgb), 0.06);
    color: var(--site-text);
}

.auth-swal .auth-swal__footer {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin: 1.1rem 0 0;
    padding: 0;
    border: 0;
    color: var(--site-text-soft);
    font-size: var(--auth-note-size);
}

.auth-swal__note {
    width: 100%;
    margin: 0;
    line-height: 1.5;
    text-align: center;
}

.auth-swal__link {
    color: var(--site-accent-light);
    font-weight: 500;
}

.auth-swal__link:hover {
    color: var(--site-accent-pale);
}

.auth-code {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.77rem;
    margin-top: var(--auth-gap);
    cursor: text;
}

.auth-code__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    font-size: 16px;
}

.auth-code__email {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.auth-menu__identity {
    min-width: 0;
}

.auth-menu__line {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-menu__email {
    padding: 0;
    border: 0;
    background: none;
    color: var(--site-text-soft);
    text-align: left;
    cursor: copy;
    transition: color 0.15s ease;
}

.auth-menu__email:hover,
.auth-menu__email:focus-visible {
    color: var(--site-accent);
}

.auth-code__cell {
    display: grid;
    place-items: center;
    height: var(--auth-cell-height);
    border: 1px solid var(--site-field-line);
    border-radius: var(--auth-control-radius);
    background: var(--site-field);
    color: var(--site-text);
    font-family: var(--chat-mono, ui-monospace, monospace);
    font-size: var(--auth-cell-size);
    font-weight: 700;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-code:focus-within .auth-code__cell.is-next {
    border-color: var(--site-accent);
    box-shadow: 0 0 0 0.3rem var(--auth-focus-ring);
}

.auth-code:focus-within .auth-code__cell.is-next:empty::after {
    content: '';
    width: 2px;
    height: calc(var(--auth-cell-size) * 0.95);
    background: var(--site-accent);
    animation: authCodeCaret 1s steps(1) infinite;
}

.auth-code.is-invalid .auth-code__cell {
    border-color: var(--site-danger);
}

.auth-swal--show {
    animation: authSwalIn 0.18s ease-out;
}

.auth-swal--hide {
    animation: authSwalOut 0.12s ease-in forwards;
}

@keyframes authCodeCaret {
    50% { opacity: 0; }
}

@keyframes authSwalIn {
    from { opacity: 0; transform: scale(0.96); }
}

@keyframes authSwalOut {
    to { opacity: 0; transform: scale(0.96); }
}

@keyframes authSheetIn {
    from { transform: translateY(100%); }
}

@keyframes authSheetOut {
    to { transform: translateY(100%); }
}

@media (max-width: 767px) {
    .swal2-popup.auth-swal {
        --auth-padding: 2rem;
        --auth-gap: 2rem;
        --auth-control-height: 4.67rem;
        --auth-control-radius: 1.17rem;
        --auth-badge: 4rem;
        --auth-title-size: 2rem;
        --auth-text-size: 1.33rem;
        --auth-label-size: 1.25rem;
        --auth-input-size: 1.42rem;
        --auth-button-size: 1.42rem;
        --auth-note-size: 1.17rem;
        --auth-close: 3.67rem;
        --auth-cell-height: 5.33rem;
        --auth-cell-size: 2.33rem;
        width: 100%;
        max-width: none;
        padding: 1rem var(--auth-padding) max(3.33rem, calc(env(safe-area-inset-bottom) + 1.5rem));
        border-width: 1px 0 0;
        border-radius: 1.67rem 1.67rem 0 0;
    }

    .swal2-popup.auth-swal::before {
        content: '';
        justify-self: center;
        width: 40px;
        height: 4px;
        margin-bottom: 1.5rem;
        border-radius: 2px;
        background: rgba(var(--site-ink-rgb), 0.22);
    }

    .swal2-container.auth-swal-container {
        padding: 0;
    }

    .swal2-container.auth-swal-container > .swal2-popup {
        grid-column: 1 / 4;
        grid-row: 3;
        align-self: end;
    }

    .auth-swal .auth-swal__close {
        top: 3rem;
        right: var(--auth-padding);
        background: rgba(var(--site-ink-rgb), 0.06);
    }

    .auth-swal .auth-swal__actions {
        flex-direction: column;
    }

    .auth-swal__confirm {
        order: -1;
    }

    .auth-swal .auth-swal__footer {
        flex-direction: column;
        align-items: center;
    }

    .auth-swal__link {
        display: flex;
        align-items: center;
        min-height: var(--auth-close);
    }

    .auth-swal--show {
        animation: authSheetIn 0.25s ease-out;
    }

    .auth-swal--hide {
        animation: authSheetOut 0.18s ease-in forwards;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-swal--show,
    .auth-swal--hide {
        animation: none;
    }
}
