/* Header and category navigation */
.wrap { width: min(1240px, calc(100% - 48px)); }
header { position: static; border: 0; background: transparent; backdrop-filter: none; }

.top {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto auto;
    min-height: 68px;
    gap: 18px;
}

.top .search { width: min(100%, 560px); justify-self: center; }
.search { padding: 4px; border-radius: 12px; }
.search input { padding: 8px 10px; }
.search button { padding: 8px 14px; border-radius: 8px; }
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--purple); }

.category-bar .categories {
    flex-wrap: wrap;
    gap: 10px 12px;
    margin: 0;
    padding: 14px 0 16px;
    overflow: visible;
}

.category-bar .categories a {
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    background: transparent;
    overflow-wrap: anywhere;
}

.category-bar .categories a:hover,
.category-bar .categories a[aria-current="page"] {
    background: #312540;
    color: #e4d4ff;
}

/* Catalog */
.home-dashboard { --home-gap: clamp(24px, 2.8vw, 40px); }
.home-dashboard > * + * { margin-top: var(--home-gap); }
.home-dashboard > .home-banner { margin-top: 8px; }
.home-dashboard > * { margin-bottom: 0; }

.intro, .intro.compact { display: block; padding: 22px 0 12px; }
.intro .eyebrow { margin-bottom: 5px; }
.intro h1 {
    font-size: clamp(27px, 3vw, 42px);
    line-height: 1.2;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.intro p:last-child { margin-top: 6px; font-size: 14px; }

.dashboard-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 4px;
    border-radius: 14px;
    box-shadow: none;
}
.dashboard-stats > div { padding: 12px 12px; border-radius: 0; background: transparent; }
.dashboard-stats > div + div { border-left: 1px solid var(--line); }
.dashboard-stats strong, .dashboard-stats .status-online { font-size: 18px; }

.home-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px clamp(14px, 2vw, 28px);
    padding: clamp(20px, 2.2vw, 32px) clamp(14px, 1.5vw, 24px);
    border: 1px solid #4a3a63;
    border-radius: 14px;
    background: linear-gradient(110deg, #2b2239, var(--panel) 70%);
}

.home-banner__label {
    display: grid;
    justify-items: center;
    padding: 7px 12px;
    border: 1px solid #654a91;
    border-radius: 11px;
    background: #382852;
    color: #eee5ff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.home-banner__label small { font-size: 10px; font-weight: 400; }
.home-banner h2 {
    font-size: clamp(17px, 2vw, 23px);
    line-height: 1.25;
    letter-spacing: -.025em;
}
.home-banner__features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
}
.home-banner__features li {
    padding: 2px 8px;
    border: 1px solid #4a3a63;
    border-radius: 999px;
    color: #e4d4ff;
    font-size: 12px;
}
.home-banner__features li::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 7px;
    margin-inline-end: 6px;
    border: solid var(--purple);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.home-banner .button {
    min-height: 40px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #d6baff;
    color: #231735;
}
.home-banner .button:hover { background: #e5d1ff; }

.resource-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: clamp(20px, 2.2vw, 32px) clamp(14px, 1.5vw, 24px);
    border: 1px solid #4a3a63;
    border-radius: 14px;
    background: radial-gradient(ellipse at top left, #332342, transparent 55%), var(--panel);
}
.resource-info > .collection-header,
.resource-info > .endpoint,
.resource-info > .collection-notice {
    padding: 11px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #171719;
    box-shadow: none;
}
.resource-info > div::after { content: none; }
.resource-info > .collection-header { padding: 0 2px 4px; border: 0; background: none; }
.collection-header h2 {
    margin: 0;
    padding-inline-start: 10px;
    border-inline-start: 3px solid var(--purple);
    line-height: 1.2;
}
.collection-header p { margin: 5px 0 0; }
.resource-info > p { margin: 0; }
.resource-info .endpoint {
    grid-template-columns: 88px minmax(0, 1fr) 76px;
    gap: 10px;
    margin: 0;
}
.resource-info .endpoint > span {
    padding: 5px;
    border-radius: 8px;
    background: #382852;
    color: #eee5ff;
    text-align: center;
    font-weight: 700;
}
.resource-info .endpoint code { font-size: 12px; }
.resource-info .endpoint button {
    min-height: 36px;
    padding: 5px 6px;
    border: 1px solid #654a91;
    border-radius: 8px;
    background: #302044;
    color: #f3ebff;
}
.resource-info .endpoint button:hover { background: #493465; }
.resource-info > .collection-notice { background: #231c2e; }
.collection-notice a { color: #e4d4ff; font-weight: 700; }
.collection-notice p { margin: 0; font-size: 13px; }
.collection-link {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border: 1px solid #4a3a63;
    border-radius: 9px;
    background: #292137;
    color: #e4d4ff;
    font-size: 13px;
}
.collection-link:hover { background: #382852; }

.section-head { align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.home-dashboard .section-head { margin-bottom: 16px; }
.home-dashboard .resource-toolbar { margin-bottom: 20px; padding-block: 13px; }
.section-head h1, .section-head h2, .detail-grid h2, .detail-info h2 {
    font-size: clamp(19px, 2vw, 25px);
    letter-spacing: -.025em;
}

.resource-toolbar {
    grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)) auto;
    padding: 9px;
    border-radius: 12px;
}
.resource-toolbar label { min-width: 0; }
.resource-toolbar label > span { font-size: 12px; }
.resource-toolbar input, .resource-toolbar select { height: 36px; border-radius: 8px; }
.filter-result { align-self: end; padding: 7px 2px; }

.catalog-results .resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.home-dashboard .catalog-results .resource-grid { row-gap: clamp(22px, 2.4vw, 34px); }

.catalog-results .resource-row {
    width: auto;
    min-width: 0;
    padding: 6px;
    border-radius: 14px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.catalog-results .resource-row:hover { transform: none; box-shadow: none; border-color: #34343a; }
.catalog-results .resource-row:focus-visible { border-color: var(--purple); outline-offset: 2px; }
.catalog-results .resource-poster { aspect-ratio: 16 / 9; border-radius: 10px; }
.catalog-results .resource-poster img { transition: transform .25s ease; }

@media (hover: hover) and (pointer: fine) {
    .catalog-results .resource-row:hover {
        z-index: 1;
        transform: translateY(-3px);
        border-color: var(--purple);
        box-shadow: 0 9px 24px rgba(0, 0, 0, .4);
    }
    .catalog-results .resource-row:hover .resource-poster img { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-results .resource-row:hover,
    .catalog-results .resource-row:hover .resource-poster img { transform: none; }
}
.catalog-results .resource-copy { padding: 8px 5px 4px; }
.catalog-results .resource-copy strong { font-size: 15px; }
.catalog-results .resource-meta { align-items: center; gap: 4px 8px; }
.resource-category {
    display: block !important;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resource-badge {
    top: 5px;
    right: 5px;
    max-width: calc(100% - 10px);
    padding: 3px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paging { flex-wrap: wrap; justify-content: center; gap: 8px 12px; padding: 18px 0 0; }
.paging div { align-items: center; gap: 6px; }
.paging a { padding: 7px 9px; }
.catalog-results .empty { margin-top: 10px; padding: 24px 12px; }

/* Resource summary, addresses, and player */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin: 16px 0 12px;
}
.breadcrumb a:hover, .detail-links a:not(.button):hover { color: #e4d4ff; }
.breadcrumb [aria-current="page"] { color: var(--text); }
.catalog-layout .catalog-query { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.breadcrumb + .catalog-layout .section-head { margin-bottom: 16px; }
.detail-heading {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    border-radius: 16px;
}
.detail-cover {
    flex: none;
    width: 40%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    background: var(--panel);
}
.detail-summary { min-width: 0; }
.detail-heading h1, .play-title {
    font-size: clamp(23px, 3.1vw, 38px);
    line-height: 1.2;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
}
.detail-heading .eyebrow, .play-heading .eyebrow { margin-bottom: 5px; }
.meta, .play-heading .meta { display: flex; gap: 5px; margin-top: 9px; }
.meta span { padding: 3px 8px; overflow-wrap: anywhere; }
.detail-info { margin-top: 12px; overflow-wrap: anywhere; }
.detail-info dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 6px 0; }
.detail-info dt { color: var(--muted); }
.detail-info dd { margin: 0; }
.detail-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; }

.detail-grid { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
.detail-grid > section, .play-episodes {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}
.batch-tools { margin: 8px 0 12px; }
.batch-tools .secondary { padding: 5px 9px; border: 0; border-radius: 8px; }
.line-title { margin-top: 12px; overflow-wrap: anywhere; }
.episode {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
    border-radius: 9px;
}
.episode strong { overflow-wrap: anywhere; }
.episode code { font-size: 11px; }
.episode-check { display: grid; place-items: center; min-width: 25px; min-height: 32px; }
.episode .episode-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.episode-actions .button { margin: 0; padding: 6px 9px; border-radius: 7px; }
.episode-actions .secondary:hover { background: #494950; }

.play-layout .play-surface, .play-layout .empty { margin: 0; border-radius: 12px 12px 0 0; }
.play-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: var(--panel);
}
.play-caption > div { min-width: 0; }
.play-caption p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.play-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.play-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 5px 10px;
    border-radius: 8px;
    background: #30243e;
    color: #e4d4ff;
    font-size: 13px;
}
.play-nav a:hover { background: #443159; }
.episode-source + .episode-source { border-top: 1px solid var(--line); }
.play-surface iframe { display: block; }
.play-title { margin: 0; }
.play-episodes { margin: 0; }
.play-episodes .section-head { flex-wrap: wrap; }
.episode-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 86px), 1fr));
    gap: 6px;
    margin: 8px 0 12px;
}
.episode-link { padding: 7px 10px; border-radius: 8px; text-align: center; overflow-wrap: anywhere; }
.episode-link.active, .episode-link:hover { background: #382852; color: #f0e5ff; }
.episode-link.active { box-shadow: inset 0 0 0 1px var(--purple); }
.play-heading {
    grid-template-columns: clamp(74px, 16vw, 152px) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 14px;
}
.play-cover { border-radius: 8px; box-shadow: none; }
.play-blurb { margin: 8px 0 0; overflow-wrap: anywhere; }
footer.wrap { margin-top: 36px !important; }

@media (max-width: 900px) {
    .top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
    .top .test { display: none; }
    .resource-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-result { grid-column: 1 / -1; justify-self: start; padding: 0; }
}

@media (max-width: 760px) {
    body { padding-bottom: 14px; }
    .wrap { width: calc(100% - 28px); }
    .top { grid-template-columns: auto minmax(0, 1fr); padding: 8px 0; gap: 6px; }
    .top .search { grid-column: 1 / -1; grid-row: 2; width: 100%; }
    .top nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 0; }
    .top nav a { padding: 6px; font-size: 12px; }
    .category-bar .categories { gap: 8px 6px; padding: 12px 0 10px; }
    .category-bar .categories a { padding: 6px 9px; }
    .intro, .intro.compact { padding: 12px 0; }
    .dashboard-stats > div { padding-inline: 6px; }
    .dashboard-stats .status-online::before { width: 5px; height: 5px; margin-right: 4px; }
    .home-banner, .resource-info { padding: 18px 12px; }
    .home-banner { grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; }
    .home-banner .button { grid-column: 1 / -1; justify-self: start; min-height: 44px; }
    .resource-info .endpoint {
        grid-template-columns: 68px minmax(0, 1fr) 62px;
        gap: 6px;
        padding: 6px;
    }
    .resource-info .endpoint > span { grid-column: auto; }
    .resource-info .endpoint code { font-size: 11px; }
    .resource-info .endpoint button { min-height: 44px; }
    .catalog-results .resource-grid { gap: 8px; }
    .catalog-results .resource-poster { aspect-ratio: 3 / 4; }
    .catalog-results .resource-copy strong { font-size: 14px; }
    .detail-heading { flex-direction: column; align-items: stretch; gap: 12px; }
    .detail-cover { width: 100%; }
    .detail-grid > section, .play-episodes { padding: 12px; }
    .mobile-nav {
        position: static;
        width: calc(100% - 28px);
        margin: 0 auto;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .resource-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
    .resource-toolbar label:first-child { grid-column: 1 / -1; }
    .episode { grid-template-columns: auto minmax(0, 1fr); }
    .episode .episode-actions { grid-column: 2; }
}
