.page-shell {
    margin: 0 auto;
    max-width: 96rem;
    min-height: 100vh;
}

.masthead {
    backdrop-filter: blur(16px);
    background: rgba(8, 22, 29, 0.92);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    padding: 2.5rem clamp(1.2rem, 3vw, 3rem) 1.2rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.masthead.is-condensed {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.masthead.is-condensed .nav-copy {
    display: none;
}

.content-shell {
    padding: 0 clamp(1.2rem, 3vw, 3rem) 3rem;
}

@media (max-width: 900px) {
    .masthead {
        padding-top: 1.5rem;
        padding-bottom: 1rem;
    }

    .content-shell {
        padding-bottom: 2rem;
    }
}

@media (max-width: 640px) {
    .masthead {
        padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 0.85rem;
    }

    .content-shell {
        padding: 0 1rem 1.5rem;
    }
}

.nav-shell {
    align-items: flex-end;
    display: flex;
    gap: 0.9rem;
    width: 100%;
}

.nav-primary {
    flex: 0 1 auto;
    min-width: 0;
}

.nav-home {
    color: #f3f7f0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.nav-home.active {
    color: #f3f7f0;
}

.nav-category-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.45rem;
}

.nav-category-links a {
    color: rgba(243, 247, 240, 0.78);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-category-links a:hover,
.nav-category-links a:focus-visible,
.nav-category-links a[aria-current="page"] {
    color: #8de1ce;
}

.nav-copy {
    margin: 0.75rem 0 0;
    max-width: 34rem;
    color: rgba(243, 247, 240, 0.84);
}

.nav-actions {
    align-items: flex-end;
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
    margin-left: auto;
}

.nav-brand-filter {
    background: rgba(243, 247, 240, 0.93);
    border: 0;
    border-radius: 14px;
    color: #102028;
    font: inherit;
    min-height: 2.8rem;
    padding: 0.7rem 0.85rem;
    width: 14rem;
}

.culture-picker,
.currency-picker {
    align-items: flex-start;
    display: grid;
    gap: 0.45rem;
    min-width: min(14rem, 100%);
}

.nav-actions .culture-picker,
.nav-actions .currency-picker {
    min-width: 8rem;
}

.culture-label {
    color: rgba(243, 247, 240, 0.72);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.culture-select {
    background: rgba(243, 247, 240, 0.93);
    border: 0;
    border-radius: 14px;
    color: #102028;
    font: inherit;
    min-height: 2.8rem;
    padding: 0.7rem 0.85rem;
}

.theme-toggle {
    align-self: end;
    background: rgba(243, 247, 240, 0.1);
    border: 1px solid rgba(173, 219, 208, 0.28);
    border-radius: 14px;
    color: #f3f7f0;
    cursor: pointer;
    font: inherit;
    font-size: 1.2rem;
    height: 2.8rem;
    line-height: 1;
    min-width: 2.8rem;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: rgba(141, 225, 206, 0.2);
    outline: 2px solid #8de1ce;
    outline-offset: 2px;
}

@media (min-width: 641px) and (max-width: 900px) {
    .nav-shell {
        flex-wrap: wrap;
    }

    .nav-primary {
        flex: 1 0 100%;
    }

    .nav-actions {
        margin-left: 0;
        width: 100%;
    }

    .nav-actions .culture-picker,
    .nav-actions .currency-picker {
        flex: 1 1 0;
        min-width: 0;
    }

    .culture-select,
    .nav-brand-filter {
        border-radius: 10px;
        min-height: 2.65rem;
        padding: 0.55rem 0.6rem;
        width: 100%;
    }

    .nav-brand-filter {
        flex: 1 1 0;
    }
}

@media (max-width: 640px) {
    .nav-shell {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.6rem;
    }

    .nav-home {
        font-size: 1.2rem;
        line-height: 1.15;
    }

    .nav-copy {
        font-size: 0.95rem;
        margin-top: 0.55rem;
    }

    .nav-category-links {
        margin-top: 0.35rem;
    }

    .nav-actions .culture-picker,
    .nav-actions .currency-picker {
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
    }

    .culture-select {
        width: 100%;
    }

    .nav-actions {
        margin-left: 0;
        width: 100%;
    }

    .nav-brand-filter {
        flex: 1 1 auto;
        width: auto;
    }

    .culture-picker,
    .currency-picker {
        min-width: 0;
    }

    .culture-label {
        font-size: 0.62rem;
        letter-spacing: 0.07em;
        white-space: nowrap;
    }

    .culture-select {
        border-radius: 10px;
        min-height: 2.65rem;
        padding: 0.55rem 0.6rem;
    }

    .theme-toggle {
        height: 2.65rem;
        min-width: 2.65rem;
    }

    .masthead.is-condensed {
        padding-bottom: 0.55rem;
        padding-top: calc(0.55rem + env(safe-area-inset-top, 0px));
    }

    .masthead.is-condensed .nav-shell {
        align-items: center;
        flex-direction: row;
        gap: 0.5rem;
    }

    .masthead.is-condensed .culture-label {
        display: none;
    }

    .masthead.is-condensed .nav-home {
        display: block;
        font-size: 1rem;
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    .masthead.is-condensed .nav-category-links {
        display: none;
    }

    .masthead.is-condensed .nav-actions {
        flex: 1 1 auto;
        gap: 0.35rem;
        width: auto;
        min-width: 0;
    }

    .masthead.is-condensed .nav-actions .culture-picker,
    .masthead.is-condensed .nav-actions .currency-picker {
        min-width: 0;
        flex: 1 1 0;
    }

    .masthead.is-condensed .nav-brand-filter {
        width: 5rem;
    }

    .masthead.is-condensed .culture-select,
    .masthead.is-condensed .nav-brand-filter {
        font-size: 0.82rem;
        min-height: 2.4rem;
        border-radius: 10px;
        padding: 0.4rem;
    }

    .masthead.is-condensed .theme-toggle {
        height: 2.4rem;
        min-width: 2.4rem;
    }
}
