/*
 * Shared account-menu component
 *
 * This is the canonical visual definition used by both WordPress and Laravel.
 */

.has-support-session {
    padding-top: var(--support-banner-height, 48px);
}
.has-support-session .site-header {
    top: var(--support-banner-height, 48px);
}
.support-session-banner {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10000;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3rem 1rem;
    border-bottom: 1px solid #e7c65f;
    background: #fff8df;
    color: #4b3711;
    padding: 0.4rem 1rem;
    font: 500 0.82rem/1.35 var(--tg-font-interface);
    text-align: center;
}
.support-session-banner form {
    margin: 0;
}
.support-session-banner button {
    border: 1px solid #805d12;
    border-radius: 0.3rem;
    background: transparent;
    color: inherit;
    padding: 0.3rem 0.65rem;
    font: 700 0.8rem/1.2 var(--tg-font-interface);
    cursor: pointer;
}
.support-session-banner button:hover {
    background: #f5e8ba;
}
.support-session-banner button:focus-visible {
    outline: 2px solid #805d12;
    outline-offset: 2px;
}

.header-account {
    position: relative;
    display: flex;
    align-items: center;
    align-self: center;
}

.header-account__trigger,
.header-account__upgrade {
    box-sizing: border-box;
    height: var(--tg-header-control-height);
    min-height: var(--tg-header-control-height);
    max-height: var(--tg-header-control-height);
    flex-shrink: 0;
    align-self: center;
}

.header-trial-status {
    display: inline-flex;
    min-height: 1.5rem;
    align-items: center;
    border: 1px solid #a4a4a4;
    border-radius: var(--tg-button-radius);
    background: #fff;
    padding: 0.12rem 0.42rem;
    color: #66716c;
    font-family: var(--tg-font-interface);
    font-size: 0.5rem;
    font-weight: var(--tg-weight-regular);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color var(--tg-duration-fast) var(--tg-ease-standard),
        border-color var(--tg-duration-fast) var(--tg-ease-standard);
}

.header-trial-status:hover {
    border-color: var(--tg-button);
    background: #f2f7f4;
    color: var(--tg-navy-dark);
}

.header-trial-status:focus-visible {
    outline: 2px solid var(--tg-green);
    outline-offset: 3px;
}

.header-account__trigger {
    display: inline-flex;
    min-width: 0;
    max-width: 11rem;
    align-items: center;
    gap: 0.42rem;
    border: 1px solid #a4a4a4;
    border-radius: var(--tg-button-radius);
    background: #fff;
    padding: 0 0.65rem;
    color: var(--tg-navy-dark);
    font-family: var(--tg-font-interface);
    font-size: var(--tg-nav-font-size);
    font-weight: var(--tg-weight-button) !important;
    line-height: 1;
    cursor: pointer;
    outline: 0;
    transition:
        background-color var(--tg-duration-fast) var(--tg-ease-standard),
        border-color var(--tg-duration-fast) var(--tg-ease-standard);
}

.header-account__trigger:hover {
    border-color: var(--tg-button);
    background: #f2f7f4;
}

.header-account__trigger:focus,
.header-account__trigger:focus-visible {
    outline: 0;
}

.header-account.is-open .header-account__trigger,
.header-account__trigger[data-state='open'] {
    background: #f2f7f4;
}

.header-account__avatar {
    display: inline-flex;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--tg-green-soft);
    color: #17251f;
    font-size: 0.56rem;
    font-weight: var(--tg-weight-regular);
    line-height: 1;
}

.header-account__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-account__name {
    min-width: 0;
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-account__chevron {
    width: 0.55rem;
    height: 0.4rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    transition: transform var(--tg-duration-fast) var(--tg-ease-standard);
}

.header-account.is-open .header-account__chevron,
.header-account__trigger[data-state='open'] .header-account__chevron {
    transform: rotate(180deg);
}

.header-account__menu {
    z-index: 50;
    width: 15rem;
    min-width: 15rem;
    overflow: hidden;
    border: 1px solid #d7e1dc;
    border-radius: var(--tg-radius);
    background: #fff;
    padding: 0.35rem;
    color: #27352f;
    font-family: var(--tg-font-interface);
    box-shadow: 0 0.5rem 1.5rem rgb(20 45 34 / 14%);
}

/* Radix portals the Laravel menu to document.body. Keep the shared component
 * geometry authoritative there as well as on the inline WordPress menu. */
.header-account__menu[data-slot='dropdown-menu-content'] {
    width: 15rem;
    min-width: 15rem;
    border-radius: var(--tg-radius);
    padding: 0.35rem;
}

.header-account > .header-account__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
}

.header-account__menu[hidden] {
    display: none;
}

.header-account__identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #e5ece8;
    padding: 0.4rem 0.45rem 0.55rem;
    font-weight: var(--tg-weight-regular);
    text-align: left;
}

.header-account__identity[data-slot='dropdown-menu-label'] {
    padding: 0.4rem 0.45rem 0.55rem;
    font-weight: var(--tg-weight-regular);
}

.header-account__avatar--menu {
    width: 2rem;
    height: 2rem;
    font-size: 0.65rem;
}

.header-account__identity-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.header-account__identity-copy strong,
.header-account__identity-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-account__identity-copy strong {
    color: var(--tg-navy-dark);
    font-size: var(--tg-nav-font-size);
    font-weight: var(--tg-weight-regular);
}

.header-account__identity-copy small {
    color: var(--tg-muted);
    font-size: var(--tg-nav-font-size);
    font-weight: var(--tg-weight-regular);
}

.header-account__identity-copy .header-account__plan {
    margin-top: 0.12rem;
    color: #27352f;
    text-transform: capitalize;
}

.header-account__separator {
    height: 1px;
    margin: 0 0 0.25rem;
    background: #e5ece8;
}

.header-account__separator[data-slot='dropdown-menu-separator'] {
    margin: 0 0 0.25rem;
}

.header-account__menu-links {
    display: grid;
    padding-block: 0.25rem;
}

.header-account__menu-link,
.header-account__menu-link[data-slot='dropdown-menu-item'] {
    display: flex;
    width: 100%;
    min-height: 1.9rem;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    padding: 0.35rem 0.45rem;
    color: #27352f;
    font-family: var(--tg-font-interface);
    font-size: var(--tg-nav-font-size);
    font-weight: var(--tg-weight-regular);
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    outline: 0;
}

.header-account__menu-link svg {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 auto;
    color: #66716c;
}

.header-account__menu-link[data-slot='dropdown-menu-item']
    svg:not([class*='text-']) {
    width: 0.9rem;
    height: 0.9rem;
}

.header-account__menu-link:hover,
.header-account__menu-link:focus,
.header-account__menu-link:focus-visible,
.header-account__menu-link[data-highlighted] {
    background: #eef4f1;
    color: #17251f;
}

.header-account__menu-link--upgrade,
.header-account__menu-link--upgrade[data-slot='dropdown-menu-item'] {
    display: none;
    color: var(--tg-green);
    font-weight: var(--tg-weight-regular);
}

.header-account__menu-link--upgrade svg {
    color: currentColor;
}

.header-account__logout {
    margin: 0;
    padding-top: 0.25rem;
    border-top: 1px solid #e5ece8;
}

.header-account__menu-link--logout,
.header-account__menu-link--logout[data-slot='dropdown-menu-item'] {
    color: #a33131;
}

.header-account__menu-link--logout svg {
    color: currentColor;
}

.site-actions .header-account__upgrade.button {
    padding: 0 0.65rem;
    font-size: var(--tg-nav-font-size);
    line-height: 1;
    white-space: nowrap;
}

.site-actions .header-account__upgrade:hover,
.site-actions .header-account__upgrade:active {
    transform: none;
    box-shadow: none;
}

@media (max-width: 767px) {
    .header-trial-status {
        min-height: 1.45rem;
        padding-inline: 0.34rem;
        font-size: 0.46rem;
    }

    .header-account__trigger {
        width: var(--tg-header-control-height);
        min-width: var(--tg-header-control-height);
        max-width: var(--tg-header-control-height);
        min-height: var(--tg-header-control-height);
        justify-content: center;
        gap: 0;
        padding-inline: 0;
        font-size: var(--tg-nav-font-size);
    }

    .header-account__name,
    .header-account__chevron {
        display: none;
    }

    .header-account > .header-account__menu {
        position: fixed;
        top: var(--tg-header-height);
        right: 1rem;
        width: min(15rem, calc(100vw - 2rem));
        min-width: 0;
    }

    .site-actions .header-account__upgrade {
        display: none;
    }

    .header-account__menu-link--upgrade,
    .header-account__menu-link--upgrade[data-slot='dropdown-menu-item'] {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-account__trigger,
    .header-account__chevron {
        transition: none;
    }
}
