.portalheader {
    background-color: #ffffff;
    border-bottom: 1px solid #E0E0E0;
    padding: 0 40px;
    min-height: 72px;
}

.portalheader-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
}

.portalheader-logo {
    height: 64px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    margin-right: 24px;
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .portalheader-logo {
        height: 50px;
    }
}

.portalheader .navbar-toggler {
    border-color: #555555;
}

.portalheader .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(85, 85, 85, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.portalheader .nav-link,
.portalheader .nav-link.dropdown-toggle,
.portalheader .portalheader-nav > li > a,
.portalheader .portalheader-navigation > li > a,
.portalheader .portalheader-brand,
.portalheader .portalheader-text,
.portalheader .portalheader-foreground,
.portalheader a,
.portalheader a:link,
.portalheader a:visited,
.portalheader-foreground {
    color: var(--rally-on-surface);
    background-color: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.portalheader .nav-link:hover,
.portalheader .nav-link:focus,
.portalheader .nav-link.dropdown-toggle:hover,
.portalheader .nav-link.dropdown-toggle:focus,
.portalheader .portalheader-nav > li > a:hover,
.portalheader .portalheader-nav > li > a:focus,
.portalheader .portalheader-nav > .open > a,
.portalheader .portalheader-nav > .open > a:hover,
.portalheader .portalheader-nav > .open > a:focus,
.portalheader .portalheader-navigation > li > a:hover,
.portalheader .portalheader-navigation > li > a:focus,
.portalheader .portalheader-brand:hover,
.portalheader .portalheader-brand:focus,
.navbar a.portalheader-foreground:hover,
.navbar a.portalheader-foreground:focus,
a.portalheader-foreground:hover,
a.portalheader-foreground:focus,
button.portalheader-foreground:hover,
button.portalheader-foreground:focus {
    color: var(--rally-on-surface);
    background-color: var(--rally-surface-container);
    text-decoration: none;
}

.portalheader button.nav-link,
.portalheader button.portalheader-foreground {
    outline: none;
}

.portalheader button.nav-link:focus-visible,
.portalheader button.portalheader-foreground:focus-visible {
    outline: 2px solid var(--rally-focused-state);
    outline-offset: 2px;
}

.portalheader-nav__nowrap {
    white-space: nowrap;
}

.rally-lang-menu {
    --rally-lang-border: #757575;
    --rally-lang-radius: 8px;
    --rally-lang-font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    position: relative;
    display: inline-block;
    margin-left: 4px;
    font-family: var(--rally-lang-font);
}

.rally-lang-menu__static {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--rally-lang-radius);
    color: var(--rally-on-surface-variant);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    background-color: transparent;
    transition: background-color 120ms ease-in-out;
    cursor: default;
}

.rally-lang-menu__static:hover,
.rally-lang-menu__static:focus {
    background-color: var(--rally-surface-container);
}

.rally-lang-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    background-color: transparent;
    color: var(--rally-on-surface-variant);
    border: 1px solid transparent;
    border-radius: var(--rally-lang-radius);
    font-family: var(--rally-lang-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out;
}

.rally-lang-menu__trigger:hover {
    color: var(--rally-on-surface);
    background-color: var(--rally-surface-container);
}

.rally-lang-menu__trigger:focus,
.rally-lang-menu[data-rally-open="true"] .rally-lang-menu__trigger {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(47, 43, 220, 0.12);
}

.rally-lang-menu__chevron {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: var(--rally-on-surface-variant);
    transition: transform 120ms ease-in-out;
}

.rally-lang-menu[data-rally-open="true"] .rally-lang-menu__chevron {
    transform: rotate(180deg);
}

.rally-lang-menu__list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 100%;
    list-style: none;
    margin: 0;
    padding: 4px;
    background-color: var(--rally-surface);
    border: none;
    border-radius: var(--rally-lang-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    display: none;
}

.rally-lang-menu[data-rally-open="true"] .rally-lang-menu__list {
    display: block;
}

.rally-lang-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--rally-on-surface-variant);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease-in-out;
}

.rally-lang-menu__item:hover,
.rally-lang-menu__item:focus {
    background-color: var(--rally-surface-container);
    outline: none;
}

.rally-lang-menu__item:focus-visible {
    outline: 2px solid var(--rally-focused-state);
    outline-offset: -2px;
}

.rally-lang-menu__label {
    text-transform: capitalize;
}

.rally-lang-menu__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    font-size: 12px;
    color: var(--rally-on-surface-variant);
    visibility: hidden;
}

.rally-lang-menu__item[aria-selected="true"] .rally-lang-menu__check {
    visibility: visible;
}

.portalheader .nav-item.dropdown #navbarDropdownMenu {
    right: 0;
    left: auto;
}

.portalheader .dropdown-menu .dropdown-item {
    color: var(--rally-on-surface);
}

.portalheader .dropdown-menu .dropdown-item:hover,
.portalheader .dropdown-menu .dropdown-item:focus {
    color: var(--rally-on-surface);
    background-color: var(--rally-surface-container);
}

.portalheader .dropdown-menu button.dropdown-item:focus-visible {
    outline: 2px solid var(--rally-focused-state);
    outline-offset: -2px;
}

.portalheader-submenu__chevron {
    margin-left: 0.5rem;
}

.portalheader-submenu {
    position: static !important;
    margin: 0;
    border: none;
    padding-left: 1rem;
    box-shadow: none;
    max-width: 100%;
    overflow: hidden;
}

.portalheader-user-name-label {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    vertical-align: middle;
    text-align: left;
    max-width: 280px;
}

.portalheader-user-name-label__primary,
.portalheader-user-name-label__secondary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.portalheader-user-name-label__secondary {
    font-size: 0.75em;
    opacity: 0.75;
    line-height: 1.2;
}

#navbarDropdownMenu {
    width: min(320px, calc(100vw - 2rem));
}

.portalheader .dropdown-menu .dropdown-item--wrap {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

@media (max-width: 991.98px) {
    .portalheader-user-name-label {
        max-width: 200px;
    }
}
