/* G9M-N8.1-A1 — reusable DATAxis Client Portal shell */
body.dataxis-client-portal-page {
    margin: 0;
    background: #f2f6fb;
}

body.dataxis-client-portal-page.admin-bar .dataxis-portal-header {
    top: 32px;
}

.dataxis-client-portal-page .dataxis-portal-shell,
.dataxis-client-portal-page .dataxis-portal-shell *,
.dataxis-client-portal-page .dataxis-portal-shell *::before,
.dataxis-client-portal-page .dataxis-portal-shell *::after {
    box-sizing: border-box;
}

.dataxis-client-portal-page .dataxis-portal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f2f6fb;
    color: #0d223a;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dataxis-portal-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    min-height: 74px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: #0d3558;
    box-shadow: 0 2px 8px rgba(7, 32, 54, .13);
    color: #fff;
}

.dataxis-portal-header__inner {
    width: 100%;
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
}

.dataxis-portal-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.dataxis-portal-brand:hover,
.dataxis-portal-brand:focus {
    color: #fff;
    text-decoration: none;
}

.dataxis-portal-brand__mark {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: #1595df;
}

.dataxis-portal-brand__mark svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dataxis-portal-brand__name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.dataxis-portal-nav {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
}

.dataxis-portal-nav__item {
    min-height: 42px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #d8e5f1;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.dataxis-portal-nav__item--active {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.dataxis-portal-nav__item--active:hover,
.dataxis-portal-nav__item--active:focus {
    color: #fff;
    text-decoration: none;
}

/* Keep portal header link colors authoritative over host-theme/global a:visited rules. */
.dataxis-portal-header a.dataxis-portal-brand:visited {
    color: #fff;
}

.dataxis-portal-header a.dataxis-portal-nav__item:visited {
    color: #d8e5f1;
    text-decoration: none;
}

.dataxis-portal-header a.dataxis-portal-nav__item--active:visited {
    color: #fff;
}

.dataxis-portal-header a.dataxis-portal-user__logout:visited {
    color: #24415f;
}

.dataxis-portal-nav__item--static {
    cursor: default;
}

.dataxis-portal-nav__item--link {
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.dataxis-portal-nav__item--link:hover,
.dataxis-portal-nav__item--link:focus-visible {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .10);
    outline: none;
}

.dataxis-portal-nav__grid-icon {
    width: 14px;
    height: 14px;
    display: grid;
    grid-template-columns: repeat(2, 5px);
    grid-auto-rows: 5px;
    gap: 2px;
}

.dataxis-portal-nav__grid-icon span {
    border: 1px solid currentColor;
    border-radius: 1px;
}

.dataxis-portal-nav__icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    flex: 0 0 16px;
    align-items: center;
    justify-content: center;
    opacity: .95;
}

.dataxis-portal-nav__icon svg {
    width: 16px;
    height: 16px;
    display: block;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dataxis-portal-nav__chevron,
.dataxis-portal-user__chevron {
    width: 12px;
    height: 12px;
    display: inline-flex;
    flex: 0 0 12px;
    align-items: center;
    justify-content: center;
    margin-left: 1px;
    opacity: .92;
}

.dataxis-portal-nav__chevron svg,
.dataxis-portal-user__chevron svg {
    width: 12px;
    height: 12px;
    display: block;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dataxis-portal-nav__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1fbe75;
    box-shadow: 0 0 0 2px rgba(31, 190, 117, .16);
}

.dataxis-portal-user {
    position: relative;
    min-width: 220px;
    max-width: 220px;
    flex: 0 0 auto;
    color: #fff;
}

.dataxis-portal-user__trigger {
    width: 100%;
    min-width: inherit;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 9px;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    cursor: pointer;
    list-style: none;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.dataxis-portal-user__trigger::-webkit-details-marker {
    display: none;
}

.dataxis-portal-user__trigger::marker {
    content: "";
}

.dataxis-portal-user__trigger:hover,
.dataxis-portal-user__trigger:focus-visible,
.dataxis-portal-user[open] .dataxis-portal-user__trigger {
    background: rgba(255, 255, 255, .11);
    border-color: rgba(255, 255, 255, .24);
}

.dataxis-portal-user__trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .82);
    outline-offset: 2px;
}

.dataxis-portal-user__chevron {
    transition: transform 140ms ease;
}

.dataxis-portal-user[open] .dataxis-portal-user__chevron {
    transform: rotate(180deg);
}

.dataxis-portal-user__menu {
    position: absolute;
    z-index: 1300;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid #d7e2ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(7, 32, 54, .18);
    color: #0d223a;
}

.dataxis-portal-user__logout {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    box-sizing: border-box;
    color: #24415f;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.dataxis-portal-user__logout:hover,
.dataxis-portal-user__logout:focus-visible {
    background: #eef5fb;
    border-color: #d7e8f5;
    color: #0b69ad;
    text-decoration: none;
    outline: none;
}

.dataxis-portal-user__logout svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dataxis-portal-user__avatar {
    width: 30px;
    height: 30px;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
}

.dataxis-portal-user__avatar svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.dataxis-portal-user__copy {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.dataxis-portal-user__copy strong,
.dataxis-portal-user__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dataxis-portal-user__copy strong {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.dataxis-portal-user__copy small {
    margin-top: 1px;
    color: #b9ccdc;
    font-size: 10px;
    line-height: 1.2;
}

.dataxis-portal-header-shortcuts {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.dataxis-portal-header-shortcut {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 42px;
    display: inline-grid;
    flex: 0 0 42px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 9px;
    background: rgba(255, 255, 255, .07);
    color: #d8e5f1;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.dataxis-portal-header-shortcut:hover,
.dataxis-portal-header-shortcut:focus-visible {
    border-color: rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .13);
    color: #fff;
    outline: none;
}

.dataxis-portal-header-shortcut:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .82);
    outline-offset: 2px;
}

.dataxis-portal-header-shortcut:active {
    transform: translateY(1px);
}

.dataxis-portal-header-shortcut svg {
    width: 18px;
    height: 18px;
    display: block;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dataxis-portal-main {
    width: 100%;
    flex: 1 0 auto;
    padding: 18px 0 36px;
}

.dataxis-portal-footer {
    width: 100%;
    border-top: 1px solid #dbe5ef;
    background: #fff;
    color: #6a7d91;
}

.dataxis-portal-footer__inner {
    width: min(1360px, calc(100% - 48px));
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
    font-size: 12px;
}

@media (max-width: 1220px) {
    .dataxis-portal-header__inner {
        flex-wrap: wrap;
        gap: 10px 18px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .dataxis-portal-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .dataxis-portal-user {
        margin-left: auto;
    }
}

@media (max-width: 782px) {
    body.dataxis-client-portal-page.admin-bar .dataxis-portal-header {
        top: 46px;
    }
}

@media (max-width: 640px) {
    .dataxis-portal-header {
        position: relative;
    }

    body.dataxis-client-portal-page.admin-bar .dataxis-portal-header {
        top: 0;
    }

    .dataxis-portal-header__inner {
        padding-right: 14px;
        padding-left: 14px;
    }

    .dataxis-portal-user {
        min-width: 0;
        max-width: 50%;
    }

    .dataxis-portal-header-shortcuts {
        gap: 6px;
    }

    .dataxis-portal-header-shortcut {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 8px;
    }

    .dataxis-portal-footer__inner {
        width: min(100% - 28px, 1360px);
    }
}

/* G9M-N8.1-A3 — reference-fidelity shell polish. Presentation only. */
@media (min-width: 1221px) {
    .dataxis-portal-header,
    .dataxis-portal-header__inner {
        min-height: 78px;
    }

    .dataxis-portal-header__inner {
        gap: 28px;
        padding-right: 40px;
        padding-left: 40px;
    }

    .dataxis-portal-brand {
        gap: 11px;
    }

    .dataxis-portal-brand__mark {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .dataxis-portal-brand__mark svg {
        width: 23px;
        height: 23px;
    }

    .dataxis-portal-brand__name {
        font-size: 22px;
    }

    .dataxis-portal-nav {
        gap: 8px;
    }

    .dataxis-portal-nav__item {
        min-height: 46px;
        gap: 9px;
        padding-right: 14px;
        padding-left: 14px;
        border-radius: 9px;
        font-size: 14px;
    }

    .dataxis-portal-user {
        min-width: 258px;
        max-width: 258px;
    }

    .dataxis-portal-user__trigger {
        padding: 9px 14px;
        border-radius: 10px;
    }

    .dataxis-portal-user__avatar {
        width: 30px;
        height: 30px;
    }

    .dataxis-portal-user__copy strong {
        font-size: 12.5px;
    }

    .dataxis-portal-user__copy small {
        font-size: 10.5px;
    }
}

/* Portal Chrome responsive hardening — compact desktop/laptop.
 * Preserve a single row while there is room, without allowing navigation
 * labels or long account names to collide. */
@media (min-width: 1221px) and (max-width: 1540px) {
    .dataxis-portal-header,
    .dataxis-portal-header__inner {
        min-height: 74px;
    }

    .dataxis-portal-header__inner {
        gap: 16px;
        padding-right: 20px;
        padding-left: 20px;
    }

    .dataxis-portal-brand {
        gap: 9px;
    }

    .dataxis-portal-brand__mark {
        width: 34px;
        height: 34px;
    }

    .dataxis-portal-brand__mark svg {
        width: 21px;
        height: 21px;
    }

    .dataxis-portal-brand__name {
        font-size: 20px;
    }

    .dataxis-portal-nav {
        gap: 2px;
    }

    .dataxis-portal-nav__item {
        min-height: 42px;
        gap: 6px;
        padding-right: 8px;
        padding-left: 8px;
        border-radius: 8px;
        font-size: 13px;
    }

    .dataxis-portal-user {
        min-width: 220px;
        max-width: 220px;
    }

    .dataxis-portal-user__trigger {
        gap: 8px;
        padding: 8px 10px;
        border-radius: 9px;
    }

    .dataxis-portal-user__avatar {
        width: 28px;
        height: 28px;
    }

    .dataxis-portal-user__copy strong {
        font-size: 12px;
    }

    .dataxis-portal-user__copy small {
        font-size: 10px;
    }

    .dataxis-portal-header-shortcuts {
        gap: 6px;
    }

    .dataxis-portal-header-shortcut {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 8px;
    }
}

.dataxis-portal-main {
    padding-top: 24px;
    padding-bottom: 44px;
}

.dataxis-portal-footer__inner {
    width: min(1810px, calc(100% - 96px));
    min-height: 44px;
    font-size: 11px;
}

@media (max-width: 640px) {
    .dataxis-portal-main {
        padding-top: 14px;
        padding-bottom: 28px;
    }

    .dataxis-portal-footer__inner {
        width: min(100% - 28px, 1810px);
    }
}


/* Portal Chrome responsive R2 — deliberate mobile composition.
 * Keep brand, account and direct shortcuts together; navigation becomes one
 * horizontal rail below instead of allowing the shortcuts to form a third row. */
@media (max-width: 640px) {
    .dataxis-portal-header__inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "brand user shortcuts"
            "nav nav nav";
        align-items: center;
        gap: 8px 10px;
        padding: 10px 12px;
    }

    .dataxis-portal-brand {
        grid-area: brand;
        min-width: 0;
    }

    .dataxis-portal-user {
        grid-area: user;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin-left: 0;
    }

    .dataxis-portal-user__trigger {
        min-width: 0;
        gap: 7px;
        padding: 7px 8px;
    }

    .dataxis-portal-header-shortcuts {
        grid-area: shortcuts;
        gap: 6px;
    }

    .dataxis-portal-header-shortcut {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .dataxis-portal-nav {
        grid-area: nav;
        order: initial;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 4px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-bottom: 0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .dataxis-portal-nav::-webkit-scrollbar {
        display: none;
    }

    .dataxis-portal-nav__item {
        min-height: 38px;
        gap: 6px;
        padding-right: 10px;
        padding-left: 10px;
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .dataxis-portal-header__inner {
        gap: 7px 8px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .dataxis-portal-brand__name {
        display: none;
    }

    .dataxis-portal-brand__mark {
        width: 30px;
        height: 30px;
    }

    .dataxis-portal-brand__mark svg {
        width: 19px;
        height: 19px;
    }

    .dataxis-portal-user__avatar {
        width: 26px;
        height: 26px;
    }

    .dataxis-portal-user__copy small {
        display: none;
    }

    .dataxis-portal-header-shortcut {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }
}
/* Portal responsive R2C — calmer mobile Chrome.
 * On phone widths, keep only the DATAxis mark in the brand and collapse the
 * account trigger to its avatar. The account dropdown itself retains a useful
 * width and the direct Favorite / Settings actions remain one tap away. */
@media (max-width: 560px) {
    .dataxis-portal-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .dataxis-portal-brand {
        gap: 7px;
    }

    .dataxis-portal-brand__name {
        display: block;
        font-size: 15px;
        line-height: 1;
        white-space: nowrap;
    }

    .dataxis-portal-brand__mark {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .dataxis-portal-brand__mark svg {
        width: 19px;
        height: 19px;
    }

    .dataxis-portal-user {
        width: auto;
        min-width: 0;
        max-width: none;
        justify-self: end;
    }

    .dataxis-portal-user__trigger {
        width: 36px;
        min-width: 36px;
        height: 36px;
        justify-content: center;
        gap: 0;
        padding: 0;
    }

    .dataxis-portal-user__copy,
    .dataxis-portal-user__chevron {
        display: none;
    }

    .dataxis-portal-user__avatar {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .dataxis-portal-user__menu {
        right: 0;
        left: auto;
        width: 220px;
        min-width: 220px;
    }

    .dataxis-portal-header-shortcuts {
        gap: 6px;
    }

    .dataxis-portal-header-shortcut {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .dataxis-portal-nav {
        scroll-padding-left: 10px;
        scroll-padding-right: 10px;
    }
}

@media (max-width: 380px) {
    .dataxis-portal-header__inner {
        gap: 7px 8px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .dataxis-portal-brand {
        gap: 0;
    }

    .dataxis-portal-brand__name {
        display: none;
    }

    .dataxis-portal-header-shortcuts {
        gap: 5px;
    }

    .dataxis-portal-header-shortcut,
    .dataxis-portal-user__trigger {
        width: 34px;
        min-width: 34px;
        height: 34px;
        flex-basis: 34px;
    }
}

/* R4B — while a Portal drawer locks scrolling, avoid a second admin-bar
   offset on the sticky header. In normal browsing the original 32/46px
   sticky offset remains unchanged. Do not affect mobile relative header. */
@media (min-width: 641px) {
    html.dataxis-favorites-open body.dataxis-client-portal-page.admin-bar .dataxis-portal-header,
    html.dataxis-settings-open body.dataxis-client-portal-page.admin-bar .dataxis-portal-header {
        top: 0;
    }
}
