/* Shared app shell, navigation, and footer layout styles. */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-frame {
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.app-sidebar {
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    width: var(--sidebar-width-expanded);
    position: sticky;
    top: 0;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
    border-inline-end: 1px solid var(--border-soft);
    background: rgba(252, 249, 242, 0.92);
    transition: width 0.2s ease;
}

/* Subtle scrollbars for shell panels (Firefox + Chromium/WebKit). */
.app-sidebar .app-shell-nav--sidebar,
.app-shell-nav--drawer,
.app-nav-episodes-flyout__panel,
.app-nav-series-block .app-nav-series-tree {
    scrollbar-width: thin;
    scrollbar-color: var(--shell-scrollbar-thumb) var(--shell-scrollbar-track);
}

.app-sidebar .app-shell-nav--sidebar::-webkit-scrollbar,
.app-shell-nav--drawer::-webkit-scrollbar,
.app-nav-episodes-flyout__panel::-webkit-scrollbar,
.app-nav-series-block .app-nav-series-tree::-webkit-scrollbar {
    width: 8px;
}

.app-sidebar .app-shell-nav--sidebar::-webkit-scrollbar-track,
.app-shell-nav--drawer::-webkit-scrollbar-track,
.app-nav-episodes-flyout__panel::-webkit-scrollbar-track,
.app-nav-series-block .app-nav-series-tree::-webkit-scrollbar-track {
    background: var(--shell-scrollbar-track);
}

.app-sidebar .app-shell-nav--sidebar::-webkit-scrollbar-thumb,
.app-shell-nav--drawer::-webkit-scrollbar-thumb,
.app-nav-episodes-flyout__panel::-webkit-scrollbar-thumb,
.app-nav-series-block .app-nav-series-tree::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background-color: var(--shell-scrollbar-thumb);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.app-sidebar .app-shell-nav--sidebar::-webkit-scrollbar-thumb:hover,
.app-shell-nav--drawer::-webkit-scrollbar-thumb:hover,
.app-nav-episodes-flyout__panel::-webkit-scrollbar-thumb:hover,
.app-nav-series-block .app-nav-series-tree::-webkit-scrollbar-thumb:hover {
    background-color: var(--shell-scrollbar-thumb-hover);
}

.app-sidebar--collapsed {
    width: var(--sidebar-width-collapsed);
}

.app-nav-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.5rem;
    margin-top: 0.25rem;
    padding: 0.45rem 0.65rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-nav-collapse-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.app-nav-collapse-toggle__label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.app-nav-collapse-toggle:hover,
.app-nav-collapse-toggle:focus-visible {
    background: rgba(31, 122, 118, 0.1);
    color: var(--brand-ink);
    outline: none;
}

.app-nav-collapse-toggle:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
}

.app-sidebar--collapsed .app-nav-collapse-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-sidebar--collapsed .app-nav-collapse-toggle {
    justify-content: center;
    padding: 0.45rem;
}

.app-shell-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 0.55rem 0.35rem;
}

.app-nav-section-label {
    margin: 0.65rem 0 0.2rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.app-shell-nav > .app-nav-section-label:first-child {
    margin-top: 0;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    color: var(--ink-muted);
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.app-nav-link__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

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

.app-nav-link__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--brand-cool);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.app-nav-link:hover {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.1);
}

.app-nav-link:focus-visible {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.1);
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
}

.app-nav-link.active {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.18);
    box-shadow: inset 0 0 0 1px rgba(20, 60, 58, 0.18);
    font-weight: 700;
}

.app-sidebar--collapsed .app-nav-section-label,
.app-sidebar--collapsed .app-nav-link__label,
.app-sidebar--collapsed .app-nav-link__badge {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-sidebar--collapsed .app-nav-link {
    justify-content: center;
    padding: 0.45rem;
}

.app-nav-series-block {
    margin: 0.1rem 0 0.35rem 0;
}

.app-nav-series-tree-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 2.25rem;
    margin: 0;
    padding: 0.4rem 0.55rem 0.4rem 0.45rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-nav-series-tree-toggle:hover,
.app-nav-series-tree-toggle:focus-visible {
    background: rgba(31, 122, 118, 0.1);
    color: var(--brand-ink);
    outline: none;
}

.app-nav-series-tree-toggle:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
}

.app-nav-series-tree-toggle__label {
    flex: 1 1 auto;
}

.app-nav-series-tree-toggle__count {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-muted);
    background: rgba(31, 122, 118, 0.12);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.app-nav-series-tree {
    margin: 0.15rem 0 0.5rem 0.35rem;
    padding-left: 0.35rem;
    border-left: 2px solid rgba(31, 122, 118, 0.15);
}

.app-nav-series-block .app-nav-series-tree {
    max-height: min(38vh, 20rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.15rem;
    scrollbar-gutter: stable;
}

.app-nav-series-tree__status {
    margin: 0.25rem 0 0.35rem 0.65rem;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.app-nav-series-group {
    margin-bottom: 0.15rem;
}

.app-nav-series-group__header {
    display: flex;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
}

.app-nav-series-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    min-height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-nav-series-toggle:hover,
.app-nav-series-toggle:focus-visible {
    background: rgba(31, 122, 118, 0.1);
    color: var(--brand-ink);
    outline: none;
}

.app-nav-series-toggle:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
}

.app-nav-series-toggle__chevron {
    display: flex;
    transition: transform 0.2s ease;
}

.app-nav-series-toggle__chevron--expanded {
    transform: rotate(90deg);
}

.app-nav-series-group__header .app-nav-link--nested {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.25rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
    align-items: flex-start;
}

.app-nav-series-group__header .app-nav-link__label {
    white-space: normal;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.app-nav-series-seasons {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0.1rem 0 0.25rem 1.65rem;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(31, 122, 118, 0.12);
}

.app-nav-link--nested {
    min-height: 2.15rem;
    padding: 0.38rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.app-nav-episodes-flyout {
    position: relative;
}

.app-nav-flyout-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--sidebar-width-collapsed);
    z-index: 14;
    background: transparent;
    cursor: default;
}

.app-nav-episodes-flyout__panel {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 15;
    width: min(20rem, calc(100vw - var(--sidebar-width-collapsed) - 1.5rem));
    max-height: min(75vh, calc(100vh - 1.5rem));
    overflow-y: auto;
    padding: 0.5rem 0.55rem 0.65rem;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(252, 249, 242, 0.98);
    box-shadow: var(--shadow-soft), 0 8px 24px rgba(20, 60, 58, 0.12);
}

.app-nav-episodes-flyout__panel:focus {
    outline: none;
}

.app-nav-episodes-flyout__panel:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
}

.app-nav-episodes-flyout__browse {
    margin-bottom: 0.35rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border-soft);
}

.app-nav-series-flyout-block {
    margin: 0;
}

.app-sidebar--collapsed .app-nav-episodes-flyout__panel .app-nav-link__label,
.app-sidebar--collapsed .app-nav-episodes-flyout__panel .app-nav-series-tree-toggle__label,
.app-sidebar--collapsed .app-nav-episodes-flyout__panel .app-nav-series-tree-toggle__count {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
}

.app-sidebar--collapsed .app-nav-episodes-flyout__panel .app-nav-link {
    justify-content: flex-start;
    padding: 0.45rem 0.65rem;
}

@media (prefers-reduced-motion: reduce) {
    .app-nav-series-toggle__chevron {
        transition: none;
    }
}

.app-main {
    flex: 1;
    min-width: 0;
}

/* Landmark focus after “Skip to main content” */
#main-content:focus {
    outline: none;
}

#main-content:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 0.25rem;
}

.content {
    padding: 1.5rem 1.5rem 3rem;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-soft);
    /* Slightly less transparent so scrolling page content does not shout through the bar. */
    background: rgba(246, 241, 231, 0.92);
    /* `backdrop-filter` is applied on .app-header__backdrop only so it does not create a
       fixed-position containing block for header descendants. Sign-in modal is hosted at
       app-shell root (SignInModal), not inside this stacking context. */
}

/* Blur of content behind the bar; not an ancestor of interactive header content in the DOM. */
.app-header__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.app-header__content {
    position: relative;
    z-index: 1;
}

.header-inner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.55rem 1.5rem 0.85rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.55rem 0.75rem;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.header-actions__menu {
    display: none;
}

/* Skip link: after brand in tab order; off-screen until focus (does not consume a grid track) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    z-index: 20;
}

.skip-link:focus,
.skip-link:focus-visible {
    position: fixed;
    top: 0.65rem;
    left: 0.65rem;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    color: var(--brand-ink);
    background: #fff;
    border: 2px solid var(--brand-cool);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.header-search-stack {
    min-width: 0;
    max-width: min(26rem, 100%);
    align-self: center;
}

.header-search-combobox {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.header-search__suggest-panel {
    position: absolute;
    z-index: 60;
    left: 0;
    right: 0;
    top: calc(100% + 1.05rem);
    max-height: min(18rem, 55vh);
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    padding: 0.25rem;
}

.header-search__suggest-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.55rem;
    text-align: left;
    font: inherit;
    color: var(--brand-ink);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.header-search__suggest-option:hover,
.header-search__suggest-option:focus-visible {
    background: rgba(31, 122, 118, 0.1);
    outline: none;
}

.header-search__suggest-option--active,
.header-search__suggest-option--active:hover {
    background: rgba(227, 146, 43, 0.22);
}

.header-search__suggest-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
}

.header-search__suggest-series {
    font-size: 0.78rem;
    color: var(--ink-muted);
    line-height: 1.2;
}

.header-search__hint {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.1rem);
    margin: 0;
    padding: 0 0.25rem;
    font-size: 0.74rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* Screen-reader-only: visible focus when tabbing into header search */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-search {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    min-height: 2.5rem;
    box-sizing: border-box;
    padding: 0.15rem 0.3rem 0.15rem 0.45rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.header-search__input {
    min-width: 0;
    flex: 1 1 auto;
    border: none;
    background: transparent;
    padding: 0.32rem 0.25rem 0.32rem 0.15rem;
    font-size: 0.9rem;
    color: var(--brand-ink);
    border-radius: 999px;
}

.header-search__input::placeholder {
    color: #888;
    font-style: italic;
}

.header-search__input:focus {
    outline: none;
}

/* Avoid duplicate clear: we use a custom × button; native search cancel is hidden. */
.header-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.header-search__input::-moz-search-clear-button {
    display: none;
}

.header-search:focus-within {
    border-color: var(--brand-cool);
    box-shadow: var(--shadow-soft), 0 0 0 2px rgba(31, 122, 118, 0.18);
}

.header-search__submit,
.header-search__icon-btn {
    flex: 0 0 auto;
    min-width: 2.35rem;
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(31, 122, 118, 0.1);
    color: var(--brand-ink);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    gap: 0;
    padding: 0 0.35rem;
}

.header-search__icon-btn {
    font-weight: 700;
    font-size: 1.1rem;
}

.header-search__submit:hover,
.header-search__icon-btn:hover,
.header-search__submit:focus-visible,
.header-search__icon-btn:focus-visible {
    background: rgba(227, 146, 43, 0.2);
    color: var(--brand-ink);
}

.header-search__submit-icon {
    display: block;
    flex-shrink: 0;
    color: inherit;
}

/* Inline SVG: inherits text colour / button colour */
.header-inline-icon {
    display: block;
    flex-shrink: 0;
    vertical-align: middle;
}

.brand {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    font-family: "Space Grotesk", "Outfit", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--brand-ink);
}

.site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.32rem 0.4rem;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    justify-self: end;
}

.nav-link {
    font-weight: 600;
    text-decoration: none;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    color: var(--ink-muted);
    transition: all 0.2s ease;
}

.nav-cta {
    color: #fff;
    background: var(--brand-ink);
    font-weight: 700;
}

.nav-cta:hover {
    color: #fff;
    background: var(--brand-cool);
}

.nav-link:hover {
    color: var(--brand-ink);
    background: rgba(227, 146, 43, 0.15);
}

.nav-link:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
    color: var(--brand-ink);
}

.nav-link.active {
    color: var(--brand-ink);
    background: rgba(227, 146, 43, 0.25);
}

.secondary-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.15rem 1.5rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
}

.secondary-header-mobile-tools {
    display: none;
    align-items: center;
}

.mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-soft);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--brand-ink);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background: rgba(31, 122, 118, 0.12);
    border-color: var(--brand-cool);
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 122, 118, 0.2);
}

.mobile-menu-toggle__icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 1.1rem;
    height: 0.95rem;
}

.mobile-menu-toggle__bar {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: var(--brand-ink);
}

.mobile-menu-toggle__text {
    letter-spacing: 0.02em;
}

.mobile-tools-backdrop {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(20, 18, 14, 0.45);
    animation: mobile-tools-backdrop-in 0.2s ease forwards;
}

.mobile-tools-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 401;
    width: min(22rem, 92vw);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1rem 1.5rem;
    background: rgba(252, 249, 242, 0.98);
    border-right: 1px solid var(--border-soft);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.12);
    animation: mobile-tools-panel-in 0.22s ease forwards;
}

.app-shell-nav--drawer {
    padding: 0 0.25rem 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.mobile-tools-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-soft);
}

.mobile-tools-panel__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-ink);
}

.mobile-tools-panel__close {
    flex: 0 0 auto;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(31, 122, 118, 0.12);
    color: var(--brand-ink);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-tools-panel__close:hover,
.mobile-tools-panel__close:focus-visible {
    background: rgba(227, 146, 43, 0.25);
    outline: none;
}

.mobile-tools-panel__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mobile-panel-section-label {
    margin: 0.75rem 0 0.25rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.mobile-tools-panel__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    color: var(--ink-muted);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-tools-panel__link:hover {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.1);
}

.mobile-tools-panel__link:focus-visible {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.1);
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
}

.mobile-tools-panel__link.active {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.18);
    box-shadow: inset 0 0 0 1px rgba(20, 60, 58, 0.18);
    font-weight: 700;
}

@keyframes mobile-tools-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mobile-tools-panel-in {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-tools-backdrop,
    .mobile-tools-panel,
    .app-sidebar {
        animation: none;
        transition: none;
    }
}

@media (min-width: 961px) {
    .app-sidebar {
        display: flex;
    }

    .app-sidebar .app-shell-nav--sidebar {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .header-actions__menu {
        display: none !important;
    }
}

.sub-nav-desktop-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sub-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
}

.sub-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    color: var(--ink-muted);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sub-nav-link__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
    color: inherit;
}

.sub-nav-link__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--brand-cool, #1f7a76);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.sub-nav-link:hover {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.12);
}

.sub-nav-link:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
    color: var(--brand-ink);
}

.sub-nav-link.active {
    color: var(--brand-ink);
    background: rgba(31, 122, 118, 0.2);
    box-shadow: inset 0 0 0 1px rgba(20, 60, 58, 0.2);
    font-weight: 700;
}

.header-auth {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    /* Let long signed-in greetings shrink and ellipsize instead of forcing row overflow. */
    min-width: 0;
    max-width: 100%;
}

footer {
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.95rem;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid var(--border-soft);
}

footer a {
    color: var(--brand-ink);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
    margin-bottom: 0.75rem;
}

.footer-nav-link {
    color: var(--brand-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-nav-link:hover {
    text-decoration: underline;
}

.footer-attribution {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

footer .footer-inline-action {
    color: var(--brand-ink);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}

footer .footer-inline-action:hover {
    text-decoration: underline;
}

footer .footer-inline-action:focus-visible {
    outline: 2px solid var(--brand-cool);
    outline-offset: 2px;
    border-radius: 2px;
}

button.sub-nav-link {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}

button.mobile-tools-panel__link {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

@media (max-width: 960px) {
    .app-header__content {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .header-inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand brand"
            "search search"
            "actions actions";
        text-align: center;
        gap: 0.75rem;
        padding: 0.65rem 1.5rem 0.85rem;
    }

    .brand {
        grid-area: brand;
        justify-self: center;
    }

    .header-search-stack {
        grid-area: search;
        width: 100%;
        max-width: 28rem;
        justify-self: center;
    }

    .header-actions {
        grid-area: actions;
        width: 100%;
        justify-content: space-between;
    }

    .header-actions__menu {
        display: inline-flex;
    }

    .header-search-combobox {
        padding-bottom: 0;
    }

    .header-search {
        width: 100%;
    }

    .header-auth {
        justify-content: flex-end;
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    .app-header__content {
        gap: 0.55rem;
    }

    .content {
        padding-top: 1.5rem;
    }

    .header-inner {
        padding-bottom: 0.75rem;
    }
}

/* Back to Top floating button */
.back-to-top-btn {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    z-index: 200;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    background: var(--brand-cool);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.back-to-top-btn:hover {
    background: var(--brand-ink);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.back-to-top-btn:active {
    transform: translateY(0);
}

/* Episode card grid — shared responsive layout (see frontend-blazor.mdc) */
.episodes-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .episodes-grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 1025px) {
    .episodes-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

