/* Canonical profile-card avatar presentation. Loaded after the general framework
   so uploaded images can never size the drawer or escape their frame. */
.t-drawer.profile-account-drawer {
    width: min(420px, calc(100vw - 24px));
}

.profile-account-drawer .profile-drawer {
    gap: 14px;
}

.profile-account-drawer .profile-drawer__identity.profile-drawer__identity--person {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.profile-account-drawer .profile-drawer__avatar-frame {
    width: 112px;
    height: 112px;
    min-width: 112px;
    max-width: 112px;
    min-height: 112px;
    max-height: 112px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 2px solid rgba(143, 96, 38, .68);
    border-radius: 50%;
    background: linear-gradient(145deg, #fffaf0, #dbc69d);
    box-shadow: 0 8px 22px rgba(57, 42, 22, .2), inset 0 0 0 4px rgba(255, 255, 255, .42);
}

.profile-account-drawer .profile-drawer__avatar-frame > img,
.profile-account-drawer img[data-profile-photo="current"] {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
}

.profile-drawer__identity-copy {
    min-width: 0;
}

.profile-drawer__identity-copy h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-drawer__photo-editor {
    display: grid;
    gap: 9px;
    padding: 0 16px 14px;
    border-bottom: 1px solid rgba(145, 111, 53, .18);
}

.profile-drawer__native-file {
    position: fixed !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.profile-drawer__photo-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.profile-drawer__photo-primary,
.profile-drawer__photo-secondary {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    font: 600 .78rem Georgia, serif;
    text-align: center;
    cursor: pointer;
}

.profile-drawer__photo-primary {
    border: 1px solid rgba(117, 72, 27, .76);
    background: linear-gradient(#7d4a1e, #572b10);
    color: #fff0c6;
    box-shadow: 0 4px 10px rgba(57, 31, 13, .18);
}

.profile-drawer__photo-secondary {
    border: 1px solid rgba(125, 76, 56, .28);
    background: rgba(255, 250, 243, .78);
    color: #704735;
}

.profile-drawer__photo-primary:hover,
.profile-drawer__photo-secondary:hover {
    filter: brightness(1.05);
}

.profile-drawer__photo-primary:disabled,
.profile-drawer__photo-secondary:disabled {
    cursor: wait;
    opacity: .58;
}

.profile-drawer__preview-note,
.profile-drawer__photo-status {
    margin: 0;
    color: #6d5a43;
    font-size: .76rem;
    line-height: 1.35;
}

@media (max-width: 560px) {
    .profile-account-drawer .profile-drawer__identity.profile-drawer__identity--person {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
    }

    .profile-account-drawer .profile-drawer__avatar-frame {
        width: 88px;
        height: 88px;
        min-width: 88px;
        max-width: 88px;
        min-height: 88px;
        max-height: 88px;
    }
}

/* Header profile trigger ------------------------------------------------------
   This is the single compact control in the upper-right ribbon. It deliberately
   overrides theme artwork/background rules so the old blue placeholder can no
   longer paint behind the account trigger. */
.app-header .profile-identity {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 190px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 2px 10px 2px 3px !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(112, 78, 31, .52) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(255, 250, 235, .98), rgba(226, 207, 168, .96)) !important;
    background-image: linear-gradient(180deg, rgba(255, 250, 235, .98), rgba(226, 207, 168, .96)) !important;
    color: #4d331b !important;
    box-shadow: 0 2px 7px rgba(47, 31, 14, .2), inset 0 1px rgba(255,255,255,.72) !important;
    cursor: pointer !important;
    appearance: none !important;
}

.app-header .profile-identity:hover,
.app-header .profile-identity:focus-visible {
    background: linear-gradient(180deg, #fffaf0, #d9bd83) !important;
    border-color: rgba(105, 68, 24, .78) !important;
    outline: none !important;
    box-shadow: 0 3px 9px rgba(47, 31, 14, .26), inset 0 1px rgba(255,255,255,.8) !important;
}

.app-header .profile-identity__avatar {
    box-sizing: border-box !important;
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    flex: 0 0 28px !important;
    overflow: hidden !important;
    border: 1px solid rgba(112, 78, 31, .58) !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #fffaf0, #d8bd88) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.58) !important;
}

.app-header .profile-identity__avatar > img,
.app-header .profile-identity img[data-profile-photo="header"] {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
}

.app-header .profile-identity__name {
    min-width: 0 !important;
    max-width: 118px !important;
    overflow: hidden !important;
    color: #4d331b !important;
    font: 600 .82rem Georgia, serif !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.app-header .profile-identity__chevron {
    flex: 0 0 auto !important;
    color: #7a582d !important;
    font-size: .78rem !important;
    line-height: 1 !important;
    transform: translateY(-1px) !important;
}

@media (max-width: 720px) {
    .app-header .profile-identity {
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        padding: 2px !important;
        justify-content: center !important;
    }

    .app-header .profile-identity__name,
    .app-header .profile-identity__chevron {
        display: none !important;
    }
}
