.site-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
    position: relative;
}

.site-auth-button,
.site-profile-button,
.site-auth-menu button,
.site-auth-modal button,
.site-auth-modal input {
    font: inherit;
}

.site-auth-button,
.site-profile-button {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: inherit;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.site-auth-button {
    font-weight: 700;
}

.site-profile-button {
    padding: 0 10px;
}

.site-auth-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.14);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.72);
    font-family: 'VCR', monospace;
    font-size: 10px;
    text-transform: uppercase;
}

.site-auth-username,
.site-auth-small,
.site-auth-label,
.site-auth-segment,
.site-auth-submit,
.site-auth-secondary,
.site-auth-error,
.site-auth-success,
.site-auth-progress {
    font-family: 'VCR', monospace;
    letter-spacing: 0;
    text-transform: uppercase;
}

.site-auth-username {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.72);
}

.site-auth-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 70;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(13, 13, 13, 0.96);
    padding: 8px;
}

.site-auth-menu button {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    min-height: 32px;
    padding: 0 10px;
    cursor: pointer;
}

.site-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
}

.site-auth-overlay[hidden],
.site-auth-menu[hidden] {
    display: none !important;
}

.site-auth-modal {
    width: min(420px, 100%);
    border: 1px solid rgba(248, 245, 239, 0.16);
    background: #10100f;
    color: #f8f5ef;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.site-auth-modal-head {
    min-height: 58px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(248, 245, 239, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-auth-title {
    margin: 0;
    font-size: 18px;
    line-height: 1;
}

.site-auth-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(248, 245, 239, 0.16);
    background: transparent;
    color: #f8f5ef;
    cursor: pointer;
}

.site-auth-body {
    padding: 16px;
    display: grid;
    gap: 14px;
}

.site-auth-small {
    color: rgba(248, 245, 239, 0.56);
    font-size: 10px;
    line-height: 1.45;
}

.site-auth-segments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: rgba(248, 245, 239, 0.14);
    border: 1px solid rgba(248, 245, 239, 0.14);
}

.site-auth-segment {
    min-height: 38px;
    border: 0;
    background: #1a1a18;
    color: rgba(248, 245, 239, 0.62);
    cursor: pointer;
    font-size: 10px;
}

.site-auth-segment[aria-pressed="true"] {
    background: #f8f5ef;
    color: #070707;
}

.site-auth-field {
    display: grid;
    gap: 7px;
}

.site-auth-label {
    color: rgba(248, 245, 239, 0.52);
    font-size: 10px;
}

.site-auth-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(248, 245, 239, 0.16);
    background: rgba(7, 7, 7, 0.42);
    color: #f8f5ef;
    padding: 10px 12px;
    outline: none;
}

.site-auth-input:focus {
    border-color: rgba(98, 210, 111, 0.7);
    box-shadow: 0 0 0 3px rgba(98, 210, 111, 0.12);
}

.site-auth-submit,
.site-auth-secondary {
    min-height: 42px;
    border: 1px solid rgba(248, 245, 239, 0.16);
    padding: 0 14px;
    cursor: pointer;
}

.site-auth-submit {
    background: #f8f5ef;
    color: #070707;
    font-weight: 700;
}

.site-auth-submit[disabled] {
    opacity: 0.62;
    cursor: wait;
}

.site-auth-secondary {
    background: transparent;
    color: rgba(248, 245, 239, 0.72);
}

.site-auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-auth-error {
    color: #ffaea8;
    font-size: 10px;
    line-height: 1.45;
}

.site-auth-success {
    color: #a8efb0;
    font-size: 10px;
    line-height: 1.45;
}

.site-auth-progress {
    color: rgba(248, 245, 239, 0.64);
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 560px) {
    .site-auth {
        min-width: 0;
    }

    .site-auth-button {
        min-height: 36px;
        padding: 0 11px;
    }

    .site-profile-button {
        max-width: 150px;
    }

    .site-auth-username {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
