#auth-controls {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

#auth-open-button,
#auth-account-button {
    border: 1px solid white;
    border-radius: 4px;
    background: transparent;
    color: white;
    padding: 8px 14px;
    font-weight: bold;
    cursor: pointer;
}

#auth-open-button:hover,
#auth-account-button:hover {
    background: white;
    color: #0066cc;
}

#auth-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

#auth-account-button {
    max-width: 280px;
}

.auth-account-mobile-label {
    display: none;
}

#auth-account-menu {
    position: fixed;
    z-index: 100001;
    min-width: 190px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#auth-account-menu[hidden] {
    display: none;
}

#auth-account-menu button {
    width: 100%;
    border: 0;
    background: white;
    padding: 11px 14px;
    text-align: left;
    font-weight: bold;
    cursor: pointer;
}

#auth-account-menu button:hover {
    background: #f2f6fa;
}

#auth-delete-open-button {
    border-top: 1px solid #eee !important;
    color: #b00020;
}

#auth-user[hidden] {
    display: none;
}

#auth-user-email {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
}

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

.auth-dialog {
    position: relative;
    width: min(420px, 100%);
    border-radius: 8px;
    background: white;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.auth-close-button {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 28px;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin: 8px 0 22px;
    border-bottom: 1px solid #ddd;
}

.auth-tab {
    flex: 1;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 10px;
    color: #555;
    font-weight: bold;
    cursor: pointer;
}

.auth-tab.active {
    border-bottom-color: #0066cc;
    color: #0066cc;
}

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

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

.auth-form h2 {
    margin: 0 0 12px;
    color: #0066cc;
}

.auth-form input {
    border: 1px solid #aaa;
    border-radius: 4px;
    padding: 11px;
    font-size: 16px;
}

.auth-form small {
    color: #666;
}

.auth-submit-button {
    margin-top: 14px;
    border: 0;
    border-radius: 4px;
    background: #0066cc;
    color: white;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
}

.auth-submit-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.auth-link-button {
    align-self: center;
    border: 0;
    background: transparent;
    color: #0066cc;
    padding: 6px;
    text-decoration: underline;
    cursor: pointer;
}

.auth-form-description {
    margin: 0 0 8px;
    color: #555;
    line-height: 1.45;
}

.auth-message {
    min-height: 20px;
    margin: 16px 0 0;
    color: #b00020;
}

.auth-message.success {
    color: #167000;
}

.auth-danger-title {
    color: #b00020 !important;
}

.auth-delete-warning {
    margin: 0 0 12px;
    color: #555;
    line-height: 1.45;
}

.auth-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.auth-cancel-button,
.auth-delete-button {
    border-radius: 4px;
    padding: 11px 14px;
    font-weight: bold;
    cursor: pointer;
}

.auth-cancel-button {
    border: 1px solid #777;
    background: white;
    color: #444;
}

.auth-delete-button {
    border: 1px solid #b00020;
    background: #b00020;
    color: white;
}

.auth-delete-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 768px) {
    #auth-controls {
        left: 8px;
    }

    #auth-open-button,
    #auth-account-button {
        padding: 6px 8px;
        font-size: 11px;
    }

    #auth-user {
        gap: 6px;
    }

    #auth-user-email {
        display: none;
    }

    .auth-account-mobile-label {
        display: inline;
    }

    #auth-account-menu {
        min-width: 170px;
    }

    .auth-dialog {
        padding: 24px 20px;
    }

    .auth-delete-actions {
        flex-direction: column-reverse;
    }
}
