:root {
    --header-brand: #0e5668;
    --header-text: #0e5668;
    --header-light: #41cae8;
    --header-active: #1a879f;
    --header-menu: #09323c;
    --header-hover: #062d36;
    --header-pressed: #062d36;
    --header-white: #f5f8f7;
    --header-muted: #a8bab5;
    --header-line: #062d36;
}

/* Public website viewport and scroll ownership.
   Kept global so it cannot be lost through Blazor CSS isolation. */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
}

.site-shell {
    position: fixed !important;
    inset: 0 !important;
    overflow: hidden !important;
}

.site-shell > .public-app-header {
    position: absolute !important;
    top: 0;
    right: 0;
    left: 0;
}

.site-scroll-area {
    position: absolute !important;
    top: 72px !important;
    right: 0;
    bottom: 0;
    left: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
}

@supports not selector(::-webkit-scrollbar) {
    .site-scroll-area {
        scrollbar-color: rgb(14, 86, 104) rgb(5, 38, 45);
        scrollbar-width: thin;
    }
}

.site-scroll-area::-webkit-scrollbar {
    width: 9px;
    background: rgb(5, 38, 45);
}

.site-scroll-area::-webkit-scrollbar-track,
.site-scroll-area::-webkit-scrollbar-track-piece,
.site-scroll-area::-webkit-scrollbar-corner {
    background: rgb(5, 38, 45);
}

.site-scroll-area::-webkit-scrollbar-thumb {
    border: 2px solid rgb(5, 38, 45);
    border-radius: 0;
    background: rgb(14, 86, 104);
}

.site-scroll-area::-webkit-scrollbar-thumb:hover,
.site-scroll-area::-webkit-scrollbar-thumb:active {
    background: rgb(26, 135, 159);
}

.site-scroll-area::-webkit-scrollbar-button,
.site-scroll-area::-webkit-scrollbar-button:single-button,
.site-scroll-area::-webkit-scrollbar-button:vertical,
.site-scroll-area::-webkit-scrollbar-button:vertical:decrement,
.site-scroll-area::-webkit-scrollbar-button:vertical:increment,
.site-scroll-area::-webkit-scrollbar-button:horizontal,
.site-scroll-area::-webkit-scrollbar-button:horizontal:decrement,
.site-scroll-area::-webkit-scrollbar-button:horizontal:increment {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.app-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--header-line);
    background-color: #05262d;
    background-image: radial-gradient(ellipse 72% 145% at 50% -52%, #0e5668 0%, #05262d 73%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 9px 26px rgba(0, 0, 0, 0.3);
    backdrop-filter: none;
}

.app-header-container {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    width: min(1430px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
    align-items: stretch;
    gap: 34px;
}

.brand {
    display: inline-flex;
    width: max-content;
    min-width: 0;
    align-self: center;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 140ms ease, transform 140ms ease;
}

.app-navigation {
    display: flex;
    height: 72px;
    align-items: stretch;
    justify-content: center;
}

.app-navigation a {
    display: flex;
    min-width: 124px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #1a879f;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.01em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 140ms ease;
}

.navigation-icon {
    position: relative;
    display: block;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

.navigation-icon img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 140ms ease;
}

.navigation-icon-inactive {
    opacity: 1;
}

.navigation-icon-active {
    opacity: 0;
}

.app-navigation a:hover,
.app-navigation a:active,
.app-navigation a.active,
.app-navigation a:focus-visible {
    background: transparent;
    color: #dcdcdc;
}

.app-navigation a:hover .navigation-icon-inactive,
.app-navigation a:active .navigation-icon-inactive,
.app-navigation a.active .navigation-icon-inactive,
.app-navigation a:focus-visible .navigation-icon-inactive {
    opacity: 0;
}

.app-navigation a:hover .navigation-icon-active,
.app-navigation a:active .navigation-icon-active,
.app-navigation a.active .navigation-icon-active,
.app-navigation a:focus-visible .navigation-icon-active {
    opacity: 1;
}

.app-navigation a:focus-visible,
.brand:focus-visible,
.header-user-button:focus-visible,
.auth-header-action:focus-visible {
    outline: 2px solid var(--header-light);
    outline-offset: -3px;
}

.app-user-actions {
    display: flex;
    min-width: 0;
    align-self: center;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
}

.auth-header-actions {
    display: flex;
    min-width: 0;
    grid-column: 3;
    align-self: center;
    align-items: center;
    justify-content: flex-end;
}

.public-header-actions {
    gap: 9px;
}

.public-header-actions [hidden] {
    display: none !important;
}

.public-trial-link {
    white-space: nowrap;
    text-align: center;
}

.public-app-header .brand {
    width: auto;
    max-width: 180px;
}

.public-app-header .app-header-container {
    grid-template-columns: minmax(180px, 1fr) auto minmax(240px, 1fr);
}

/* Use the desktop App header rails and reserve the same scrollbar space. */
@media (min-width: 1181px) {
    .public-app-header:not(.faq-app-header) {
        box-sizing: border-box;
        padding-inline-end: 10px;
    }

    .public-app-header:not(.faq-app-header) .app-header-container {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        width: min(1400px, calc(100% - 76px));
    }

    .public-app-header:not(.faq-app-header) .brand {
        justify-self: start;
    }
}

.auth-header-action {
    display: inline-flex;
    min-height: 34px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(65, 202, 232, 0.3);
    border-radius: 0;
    background: rgba(6, 45, 54, 0.72);
    color: var(--header-white);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.auth-header-action:hover {
    border-color: var(--header-light);
    background: var(--header-hover);
    color: var(--header-light);
}

.auth-header-action:active {
    background: var(--header-pressed);
}

/* Public website navigation uses the same header system as the App. */
.public-navigation a {
    min-width: 0;
    padding: 0 15px;
    color: #1a879f;
    font-size: 12px;
    font-weight: 750;
    text-transform: none;
    white-space: nowrap;
}

/* The root attribute is the authoritative active navigation state. */
html[data-active-section="home"]
    .public-navigation a[data-scroll-target="home"],
html[data-active-section="features"]
    .public-navigation a[data-scroll-target="features"],
html[data-active-section="how-it-works"]
    .public-navigation a[data-scroll-target="how-it-works"],
html[data-active-section="odds-lab"]
    .public-navigation a[data-scroll-target="odds-lab"],
html[data-active-section="performance"]
    .public-navigation a[data-scroll-target="performance"],
html[data-active-section="tracker"]
    .public-navigation a[data-scroll-target="tracker"],
html[data-active-section="home-faq"]
    .public-navigation a[data-scroll-target="home-faq"],
html[data-active-section="pricing"]
    .public-navigation a[data-scroll-target="pricing"],
.public-navigation a.active,
.public-navigation a[aria-current="location"] {
    color: #dcdcdc;
}

.public-navigation a:hover,
.public-navigation a:active,
.public-navigation a.active,
.public-navigation a:focus-visible {
    color: #dcdcdc !important;
}

.header-user-button {
    overflow: hidden;
    max-width: 190px;
    min-height: 34px;
    padding: 0 16px;
    border: 1px solid rgba(65, 202, 232, 0.3);
    border-radius: 0;
    background: rgba(6, 45, 54, 0.72);
    color: var(--header-white);
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    line-height: 32px;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

    .header-user-button:hover {
        border-color: var(--header-light);
        background: var(--header-hover);
        color: var(--header-light);
    }

    .header-user-button:active {
        background: var(--header-pressed);
        transform: translateY(0);
    }

@media (max-width: 1050px) {
    .app-header-container {
        grid-template-columns: auto 1fr auto;
        width: min(100% - 28px, 1430px);
        gap: 18px;
    }

    .app-navigation {
        display: flex;
    }

    .app-navigation a {
        min-width: 112px;
        padding: 0 13px;
    }

    .public-navigation a {
        min-width: 0;
        padding: 0 9px;
        font-size: 11px;
    }

}

@media (max-width: 1150px) {
    .public-app-header .app-header-container {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .public-navigation {
        display: none;
    }

    .public-header-actions {
        grid-column: 2;
    }
}

@media (max-width: 760px) {
    .site-scroll-area {
        top: 64px !important;
    }

    .app-header-container {
        grid-template-columns: 1fr auto;
        grid-template-rows: 64px 45px;
        min-height: 0;
        column-gap: 12px;
        row-gap: 0;
        align-items: center;
    }

    .brand-logo {
        width: 160px;
    }

    .app-user-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .auth-app-header .app-header-container {
        grid-template-rows: 64px;
    }

    .auth-header-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .public-app-header .app-header-container {
        grid-template-rows: 64px;
    }

    .auth-header-action {
        min-height: 32px;
        padding: 0 13px;
    }

    .header-user-button {
        max-width: 145px;
        min-height: 32px;
        padding: 0 13px;
        line-height: 30px;
    }

    .app-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 45px;
        margin: 0 -14px;
        overflow-x: auto;
        justify-content: stretch;
        border-top: 1px solid rgba(65, 202, 232, 0.1);
        scrollbar-width: none;
    }

        .app-navigation::-webkit-scrollbar {
            display: none;
        }

    .app-navigation a {
        min-width: 0;
        padding: 0 16px;
        flex: 1 0 auto;
        font-size: 12px;
    }

    .navigation-icon {
        width: 17px;
        height: 17px;
        flex-basis: 17px;
    }
}

@media (max-width: 420px) {
    .app-header-container {
        width: calc(100% - 20px);
    }

    .brand-logo {
        width: 135px;
    }

    .header-user-button {
        max-width: 115px;
        padding: 0 11px;
        font-size: 10px;
    }

    .auth-header-action {
        padding: 0 11px;
        font-size: 10px;
    }

    .public-header-actions {
        gap: 6px;
    }

    .public-trial-link {
        max-width: 118px;
        padding: 4px 9px;
        white-space: normal;
        line-height: 1.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-logo,
    .app-navigation a,
    .navigation-icon img,
    .header-user-button,
    .auth-header-action {
        transition: none;
    }
}
