.app-shell {
    --shell-header-height: 5.75rem;
    --shell-mobile-nav-height: 0rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 80;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: var(--accent-5);
    color: var(--text-on-accent);
    text-decoration: none;
    box-shadow: var(--shadow-1);
    transition: top 140ms ease;
}

.skip-link:focus {
    top: 1rem;
}

.skip-link:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.app-shell-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0.9rem 1rem 0;
}

.app-shell-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(14rem, 20rem) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-default);
    border-radius: 24px;
    background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(18px);
}

.app-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: inherit;
    text-decoration: none;
}

.app-shell-brand:hover {
    color: inherit;
}

.app-shell-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--accent-3), var(--accent-5));
    color: var(--text-on-accent);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-on-accent) 22%, transparent);
}

.app-shell-brand-copy {
    display: grid;
    gap: 0.1rem;
}

.app-shell-brand-copy strong {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
}

.app-shell-brand-copy span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.app-shell-header-nav {
    min-width: 0;
}

.app-shell-header-omnibox {
    min-width: 0;
    overflow: hidden;
}

.app-shell-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-height: 2.75rem;
}

.app-shell-menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.24rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--border-default);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-2) 84%, transparent);
    color: var(--text-primary);
    padding: 0;
}

.app-shell-menu-toggle-bar {
    width: 1rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.app-shell-menu-toggle:focus-visible,
.app-shell-drawer-close:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.app-shell-shortcuts {
    margin-top: 0.75rem;
}

.app-shell-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 0 5.75rem;
    scroll-margin-top: calc(var(--shell-header-height, 5.75rem) + 1rem);
}

.content-shell {
    width: min(1600px, 100%);
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.app-shell-mobile-nav {
    position: sticky;
    bottom: 0;
    z-index: 35;
    padding: 0 0.75rem 0.75rem;
    margin-top: auto;
}

.app-shell-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    border: none;
    background: var(--bg-overlay);
    padding: 0;
}

.app-shell-drawer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    width: min(24rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--border-default);
    border-radius: 24px;
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(18px);
}

.app-shell-drawer .shell-primary-nav {
    flex-direction: column;
    align-items: stretch;
}

.app-shell-drawer .shell-primary-nav-link {
    justify-content: flex-start;
}

.app-shell-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.app-shell-drawer-close {
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-2) 84%, transparent);
    color: var(--text-primary);
    min-height: 2.75rem;
    padding: 0.45rem 0.85rem;
}

@media (max-width: 767.98px) {
    .app-shell {
        --shell-header-height: 5.1rem;
        --shell-mobile-nav-height: 5.5rem;
    }

    .app-shell-header {
        padding: 0.65rem 0.75rem 0;
    }

    .app-shell-bar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        gap: 0.75rem;
        padding: 0.7rem 0.85rem;
    }

    .app-shell-brand-copy span {
        display: none;
    }

    .app-shell-header-nav {
        display: none;
    }

    .app-shell-header-actions {
        gap: 0.5rem;
    }
}

@media (min-width: 768px) {
    .app-shell-main {
        padding-bottom: 1.25rem;
    }

    .app-shell-mobile-nav {
        display: none;
    }
}

@media (max-width: 1023.98px) {
    .app-shell-bar {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .app-shell-header-nav {
        display: none;
    }

    .app-shell-menu-toggle {
        display: inline-flex;
    }
}

@media (min-width: 1024px) {
    .app-shell-drawer,
    .app-shell-drawer-backdrop {
        display: none;
    }
}
