/* Profile dropdown — shared across INTENTOS pages */
.profile-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    box-sizing: border-box;
}

.profile-menu-wrap > .profile-dropdown:not(.profile-dropdown--sidebar):not(.profile-dropdown--portaled):not(.profile-dropdown--sheet) {
    position: absolute;
    left: 50%;
    right: auto;
    top: calc(100% + 0.5rem);
    transform: translate(-50%, -6px);
}

.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    z-index: 300;
}

.profile-menu-wrap > .profile-dropdown.open:not(.profile-dropdown--sidebar):not(.profile-dropdown--portaled):not(.profile-dropdown--sheet) {
    transform: translate(-50%, 0);
}

.profile-dropdown [data-user-email] {
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown a,
.profile-dropdown .theme-picker-trigger {
    box-sizing: border-box;
    max-width: 100%;
}

/* Mobile sheet — only while open (portaled to body via JS) */
.profile-dropdown--sheet {
    position: fixed !important;
    margin-top: 0 !important;
    transform: none !important;
    box-sizing: border-box !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 300 !important;
}

.profile-dropdown--sheet.open {
    transform: none !important;
}

@media (max-width: 767px) {
    .profile-dropdown:not(.profile-dropdown--sidebar) .theme-picker-trigger {
        gap: 0.5rem;
        min-width: 0;
    }

    .profile-dropdown:not(.profile-dropdown--sidebar) .theme-picker-meta {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Sidebar profile menu (studio / dashboard aside) */
.profile-dropdown--sidebar {
    min-width: 15.5rem;
    width: max-content;
    max-width: min(18rem, calc(100vw - 2rem));
    white-space: nowrap;
}

.profile-dropdown--sidebar a,
.profile-dropdown--sidebar .theme-picker-trigger {
    white-space: nowrap;
}

.studio-app.sidebar-narrow .studio-sidebar-profile .profile-dropdown--sidebar.open,
.dash-aside .profile-menu-wrap .profile-dropdown--sidebar.open {
    position: fixed;
    left: max(1rem, env(safe-area-inset-left, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    width: auto;
    min-width: 0;
    max-width: none;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    top: auto;
    margin: 0;
    z-index: 300;
    white-space: normal;
}

.profile-dropdown .theme-picker-wrap {
    border-top: 1px solid var(--t-border);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    min-width: 0;
}

.profile-menu-wrap {
    position: relative;
    flex-shrink: 0;
}
