.portal-global-header {
    --portal-header-line: #3e3e3e;
    --portal-header-paper: rgba(255, 253, 249, 0.96);
    --portal-header-soft: #6d6d6d;
    --portal-header-active: #ece6d9;
    margin-bottom: 22px;
    color: #1b1b1b;
    background: var(--portal-header-paper);
    border: 3px solid var(--portal-header-line);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.09);
    font-family: "Comic Sans MS", "Segoe Print", "Bradley Hand", cursive;
}

.portal-global-main {
    min-height: 74px;
    display: grid;
    grid-template-columns: minmax(210px, 0.7fr) minmax(420px, 1.5fr) minmax(220px, 0.7fr);
    gap: 22px;
    align-items: center;
    padding: 12px 16px;
}

.portal-global-brand,
.portal-global-user,
.portal-primary-nav,
.portal-secondary-nav {
    display: flex;
    align-items: center;
}

.portal-global-brand {
    min-width: 0;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.portal-global-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 2px solid var(--portal-header-line);
    background: #202020;
    color: #fffdf8;
    font-family: "Courier New", monospace;
    font-weight: 700;
}

.portal-global-brand-copy,
.portal-global-user-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.portal-global-brand-copy strong {
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-global-brand-copy small,
.portal-global-user-copy small {
    color: var(--portal-header-soft);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-primary-nav {
    align-self: stretch;
    justify-content: center;
    gap: 2px;
}

.portal-primary-link,
.portal-secondary-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

.portal-primary-link {
    align-self: stretch;
    min-height: 46px;
    padding: 8px 16px;
    border-bottom: 3px solid transparent;
    font-weight: 700;
}

.portal-primary-link:hover,
.portal-primary-link.active {
    background: rgba(236, 230, 217, 0.62);
    border-bottom-color: var(--portal-header-line);
}

.portal-global-user {
    justify-content: flex-end;
    gap: 12px;
}

.portal-global-user-copy {
    text-align: right;
}

.portal-global-user-copy strong {
    max-width: 190px;
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-signout-button,
.portal-secondary-action {
    min-height: 38px;
    padding: 7px 12px;
    border: 2px solid var(--portal-header-line);
    border-radius: 0;
    background: #f7f5ef;
    color: inherit;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
    cursor: pointer;
    font: inherit;
}

.portal-secondary-nav {
    min-height: 40px;
    gap: 4px;
    padding: 5px 16px;
    overflow-x: auto;
    border-top: 1px dashed var(--portal-header-line);
    background: rgba(236, 230, 217, 0.42);
}

.portal-secondary-link {
    min-height: 30px;
    flex: 0 0 auto;
    padding: 4px 11px;
    color: #4b4b4b;
    font-size: 0.86rem;
}

.portal-secondary-link:hover,
.portal-secondary-link.active {
    background: #fffdf9;
    color: #1b1b1b;
    box-shadow: inset 0 -2px 0 var(--portal-header-line);
}

.portal-secondary-action {
    min-height: 30px;
    margin-left: auto;
    padding: 4px 10px;
    box-shadow: none;
    font-size: 0.82rem;
}

@media (max-width: 980px) {
    .portal-global-main {
        grid-template-columns: minmax(220px, 1fr) auto;
        gap: 10px 16px;
    }

    .portal-primary-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .portal-primary-link {
        flex: 0 0 auto;
    }
}

@media (max-width: 620px) {
    .portal-global-main {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .portal-global-user {
        justify-content: space-between;
    }

    .portal-global-user-copy {
        text-align: left;
    }

    .portal-primary-nav {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
    }

    .portal-primary-link {
        min-height: 38px;
        padding: 6px 10px;
        font-size: 0.88rem;
    }

    .portal-secondary-nav {
        padding-inline: 10px;
    }
}
