/* SpicyTube - Modern Dark Theme */
:root {
    --bg-primary: #0d0d0f;
    --bg-secondary: #16161a;
    --bg-card: #1c1c22;
    --bg-hover: #252530;
    --accent: #ff3366;
    --accent-hover: #ff4d7a;
    --text-primary: #f0f0f5;
    --text-secondary: #9898a8;
    --text-muted: #686878;
    --border: #2a2a35;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --header-height: 64px;
    --max-width: 1400px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}
.breadcrumbs a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 15, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.22s ease;
}

.site-header:has(.header-search-panel:not([hidden])),
.site-header:has(.header-filter-panel:not([hidden])) {
    border-bottom-color: transparent;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    display: block;
    width: auto;
    height: 36px;
}

.main-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-menu-tools {
    display: none;
}

.nav-menu-section {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.nav-menu-label {
    padding: 8px 14px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.nav-menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.nav-menu-item:hover,
.nav-menu-item.is-active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-menu-item.is-active {
    color: var(--accent);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.header-tool-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.header-tool-btn:hover,
.header-tool-btn.is-active,
.header-tool-btn.has-active-filters {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.header-tool-btn.has-active-filters {
    color: var(--accent);
}

.header-tool-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent);
    border-radius: 999px;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

.header-tool-icon {
    width: 22px;
    height: 22px;
}

.header-popover-wrap {
    position: relative;
}

.header-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 120;
}

.header-popover[hidden] {
    display: none;
}

.header-popover-title {
    padding: 6px 12px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.header-popover-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.header-popover-item:hover,
.header-popover-item.is-active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.header-popover-item.is-active {
    color: var(--accent);
}

.header-search-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-height);
    padding: 16px 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 99;
}

.header-search-panel[hidden] {
    display: none;
}

.header-filter-panel {
    --filter-footer-height: 72px;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-height);
    height: min(72vh, 680px);
    max-height: min(72vh, 680px);
    overflow: hidden;
    padding: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 99;
}

.header-filter-panel[hidden] {
    display: none;
}

.header-filter-scroll {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--filter-footer-height);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 8px;
}

.filter-popup-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: var(--filter-footer-height);
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.filter-popup-footer-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 0 16px;
    box-sizing: border-box;
}

.filter-close-btn,
.filter-apply-btn {
    flex: 1;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.filter-close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.filter-close-btn:hover {
    border-color: var(--text-secondary);
    background: var(--bg-hover);
}

.filter-apply-btn {
    background: var(--accent);
    border: none;
    color: #fff;
}

.filter-apply-btn:hover {
    background: var(--accent-hover);
}

.header-search-form {
    display: flex;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.header-search-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.header-search-input:focus {
    border-color: var(--accent);
}

.header-search-submit {
    flex-shrink: 0;
    padding: 12px 24px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.header-search-submit:hover {
    background: var(--accent-hover);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #1a0a12 0%, var(--bg-primary) 50%, #0a0a1a 100%);
    padding: 60px 0 50px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 28px;
}

.hero-search {
    display: flex;
    max-width: 640px;
    margin: 0 auto;
    gap: 0;
}

.hero-search.compact { max-width: 560px; }

.hero-search input {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.hero-search input:focus { border-color: var(--accent); }

.hero-search button {
    padding: 16px 28px;
    background: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.hero-search button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Sections */
.site-main { flex: 1; padding-bottom: 40px; }

.video-section { padding: 32px 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.see-all {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.see-all:hover { opacity: 0.8; }

.page-header {
    padding: 32px 0 0;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
}

.search-summary {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 0.95rem;
}

.search-catalog-note {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.search-section { padding: 20px 0 0; }

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.video-grid.view-single {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.video-grid.view-double {
    grid-template-columns: repeat(2, 1fr);
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.video-thumb-link { display: block; }

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-secondary);
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumb img { transform: scale(1.05); }

.duration-badge,
.quality-badge {
    position: absolute;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}

.duration-badge { bottom: 8px; right: 8px; }
.quality-badge { top: 8px; right: 8px; background: var(--accent); }

/* In-feed Outstream ad (3rd thumb) — lock to same 16:9 thumb box */
.video-card--ad {
    position: relative;
}

.video-card--outstream .video-thumb--ad {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-secondary);
}

.video-card--outstream .infeed-ad-slot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 200px;
    overflow: hidden;
}

.video-card--outstream .infeed-ad-slot ins,
.video-card--outstream .infeed-ad-slot iframe,
.video-card--outstream .infeed-ad-slot > div,
.video-card--outstream .infeed-ad-slot video {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
}

.video-title--ad {
    color: var(--text-muted);
    font-weight: 500;
}

.video-meta--ad {
    opacity: 0.85;
}

.video-card--ad.is-adfree-hidden,
.video-card--ad.is-ad-empty {
    display: none;
}

.video-title {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 12px 14px 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    gap: 12px;
    padding: 4px 14px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Video Page */
.video-page { padding: 24px 0; }

.video-layout {
    display: block;
    width: 100%;
}

.video-primary {
    min-width: 0;
    width: 100%;
}

.video-sidebar {
    min-width: 0;
    margin-top: 1.5rem;
}

.video-article {
    display: block;
}

/* Desktop / tablet landscape: 2/3 player+details, 1/3 related */
@media (min-width: 769px) {
    .video-page.container {
        max-width: min(1600px, 100%);
    }

    .video-layout--split {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    .video-layout--split .video-primary {
        grid-column: 1;
        grid-row: 1;
    }

    .video-layout--split .video-sidebar {
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
        position: sticky;
        top: calc(var(--header-height) + 12px);
        max-height: calc(100vh - var(--header-height) - 24px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 4px;
    }

    .video-layout--split .player-wrapper,
    .video-layout--split .player-wrapper.is-sticky-player {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: var(--radius);
        box-shadow: none;
        z-index: auto;
    }

    .video-layout--split .player-sticky-sentinel {
        display: none !important;
        height: 0 !important;
    }

    .video-layout--split .related-section {
        margin-top: 1rem;
        padding-top: 0;
        border-top: none;
    }

    .video-layout--split .related-section h2 {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }

    .video-layout--split .video-sidebar .video-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .video-layout--split .video-sidebar .video-card:hover {
        transform: none;
    }

    .video-layout--split .video-sidebar .video-title {
        font-size: 0.88rem;
        padding: 8px 10px 2px;
    }

    .video-layout--split .video-sidebar .video-meta {
        padding: 2px 10px 10px;
        font-size: 0.75rem;
    }

    .video-layout--split .sidebar-outstream,
    .video-layout--split .video-outstream {
        margin: 12px 0 4px;
    }
}

.sidebar-outstream,
.video-outstream {
    margin: 0 0 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.sidebar-outstream-label,
.video-outstream-label {
    margin: 0;
    padding: 6px 10px 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.video-page .player-wrapper {
    margin-bottom: 12px;
}

.video-quality-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0 0 12px;
}

.player-wrapper {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.player-sticky-sentinel {
    display: block;
    width: 100%;
    pointer-events: none;
}

/* Fixed pin — more reliable than sticky on mobile browsers */
.video-page .player-wrapper.is-sticky-player {
    position: fixed;
    top: var(--header-height);
    z-index: 80;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    max-width: none;
    transition: top 0.22s ease;
}

@media (max-width: 768px) {
    body.video-chrome-hidden .site-header {
        transform: translateY(-100%);
        pointer-events: none;
    }

    body.video-chrome-hidden .video-page .player-wrapper.is-sticky-player {
        top: 0;
    }
}

.player-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.quality-picker {
    position: relative;
}

.quality-picker-btn {
    appearance: none;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 28px 4px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239898a8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.quality-picker-btn:hover,
.quality-picker-btn:focus {
    border-color: var(--accent);
    outline: none;
}

.quality-picker-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 100%;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 20;
}

.quality-picker-option {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.quality-picker-option:hover,
.quality-picker-option.is-selected {
    background: var(--bg-hover);
    color: var(--accent);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.quality-selector-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.quality-select {
    appearance: none;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 28px 4px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239898a8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.quality-select:hover,
.quality-select:focus {
    border-color: var(--accent);
    outline: none;
}

.quality-select option {
    background: #1a1a1a;
    color: #fff;
}

.embed-responsive {
    position: relative;
    width: 100%;
    height: 100%;
}

.player-content {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.player-content video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.embed-responsive iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.no-player {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-player img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.external-link {
    position: absolute;
    padding: 14px 28px;
    background: var(--accent);
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}

.external-link:hover { background: var(--accent-hover); }

.video-info {
    margin-top: 12px;
}

.video-info h1 {
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.video-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.video-stats > span:not(:last-child)::after {
    content: '·';
    margin-left: 6px;
    margin-right: 2px;
    color: var(--text-muted);
    font-weight: 600;
}

.quality-tag {
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: inherit;
    color: inherit;
}

.video-page .video-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0 0 2px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.video-page .video-tags::-webkit-scrollbar {
    display: none;
    height: 0;
}

.video-page .video-tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    max-width: none;
    padding: 3px 8px;
    border: 0;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none;
}

.video-page .video-tag:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.video-desc-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
}

.video-desc-box__clamp {
    position: relative;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.video-desc-box.is-collapsible:not(.is-expanded) .video-desc-box__clamp {
    max-height: 4.5em;
    overflow: hidden;
}

.video-desc-box.is-collapsible:not(.is-expanded) .video-desc-box__clamp::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.4em;
    background: linear-gradient(to bottom, transparent, var(--bg-secondary) 85%);
    pointer-events: none;
}

.video-desc-box__toggle {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.4;
}

.video-desc-box__toggle[hidden] {
    display: none;
}

.video-desc-box__toggle:hover {
    color: var(--accent);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag-list--compact {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin-bottom: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    max-width: 100%;
}

.tag-list--compact::-webkit-scrollbar {
    display: none;
}

.tag-list--compact:last-child {
    margin-bottom: 0;
}

.tag {
    padding: 5px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s;
}

.tag--sm {
    flex: 0 0 auto;
    padding: 1px 7px;
    font-size: 0.68rem;
    line-height: 1.4;
    border-radius: 999px;
    background: var(--bg-hover);
    border-color: transparent;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tag--sm:hover {
    border-color: transparent;
    background: var(--bg-card);
    color: var(--text-primary);
}

.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tag-category {
    background: var(--bg-card);
    border-color: rgba(255, 51, 102, 0.35);
    color: var(--text-primary);
    font-weight: 500;
}

.tag-category:hover {
    background: rgba(255, 51, 102, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

.category-nav-section {
    padding-top: 0;
}

.tag-cloud-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-hover);
}

.video-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.55;
    padding-top: 0;
    border-top: none;
}

.video-description p {
    margin: 0;
}

.related-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.related-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.featured-video {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
}
.featured-video:hover {
    border-color: var(--accent);
    text-decoration: none;
}
.featured-video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}
.featured-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.featured-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1.4rem;
    padding-left: 4px;
}
.featured-video-body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .45rem;
}
.featured-kicker {
    color: var(--accent);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.featured-video-body h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}
.featured-video-body p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .92rem;
}
.related-tags-top {
    padding-top: 0;
    margin-bottom: .5rem;
}
.related-tags-top .related-tags-heading {
    font-size: 1rem;
    margin-bottom: .65rem;
}
.tag-demand {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.search-page-form {
    margin: .85rem 0 0;
    max-width: 560px;
}
.search-recovery-tags {
    margin-top: 1rem;
}
.up-next {
    margin: 0 0 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
}
.up-next.is-counting {
    border-color: var(--accent);
}
.up-next-label {
    padding: .45rem .85rem 0;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.up-next-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: .75rem;
    padding: .65rem .85rem .85rem;
    color: inherit;
    text-decoration: none;
}
.up-next-card:hover { text-decoration: none; }
.up-next-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}
.up-next-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.up-next-meta {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}
.up-next-meta strong {
    font-size: .95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.up-next-meta span { color: var(--text-secondary); font-size: .82rem; }
.up-next-cta {
    color: var(--accent) !important;
    font-weight: 650;
}
.tap-to-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    border: 0;
    border-radius: 999px;
    padding: .85rem 1.25rem;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
}
.tap-to-play[hidden] { display: none !important; }
.tap-to-play-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--accent);
    padding-left: 2px;
}
@media (max-width: 760px) {
    .featured-video { grid-template-columns: 1fr; }
    .up-next {
        margin-bottom: 0.65rem;
    }
    .up-next-card {
        grid-template-columns: 110px 1fr;
        padding: .55rem .75rem .55rem;
    }
    .up-next-cta {
        display: none;
    }
    .up-next.is-counting .up-next-cta {
        display: block;
    }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.page-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s;
}

.page-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.page-current {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Empty / Error */
.empty-state,
.error-page {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.error-page h1 {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.btn-primary {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 28px;
    background: var(--accent);
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary:hover { background: var(--accent-hover); }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-inner > p,
.footer-inner > nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.footer-tags {
    max-width: 720px;
}

.footer-tags a {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.footer-inner a:hover { color: var(--text-secondary); }

.footer-partner-links {
    margin: 4px 0 0;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--text-muted);
    opacity: 0.75;
}

.footer-partner-links a {
    color: inherit;
    text-decoration: none;
}

.footer-partner-links a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.page-seo-intro {
    max-width: 720px;
    margin: 8px 0 4px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Browse & filters */
.hero-browse {
    margin-top: 16px;
    font-size: 0.95rem;
}

.hero-browse a {
    color: var(--accent);
    font-weight: 500;
}

.hero-browse a:hover { opacity: 0.85; }

.tags-section {
    padding: 0 0 24px;
    border-bottom: 1px solid var(--border);
}

.homepage-tags,
.filter-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.browse-section {
    padding: 0 0 40px;
}

.browse-section .video-grid {
    margin-top: 24px;
}

.browse-section .pagination {
    margin-top: 32px;
}

/* Filter bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.filter-bar--header {
    margin-bottom: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.filter-bar--header .filter-zone:first-child {
    border-top: none;
}

.filter-bar-panel {
    /* zones handle inner spacing */
}

.filter-zone {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

.filter-zone:first-child {
    border-top: none;
}

.filter-zone-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* Active filter chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: border-color 0.2s, background 0.2s;
}

.filter-chip:hover {
    border-color: var(--accent);
    background: rgba(255, 51, 102, 0.08);
    color: var(--text-primary);
}

.filter-chip-x {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    transition: color 0.2s;
}

.filter-chip:hover .filter-chip-x {
    color: var(--accent);
}

.filter-chip-clear {
    color: var(--text-secondary);
    border-style: dashed;
}

.filter-chip-clear:hover {
    color: var(--accent);
}

/* Segmented sort control */
.filter-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-segment {
    position: relative;
    flex: 1 1 auto;
    min-width: fit-content;
    padding: 12px 20px;
    border-radius: calc(var(--radius-sm) + 2px);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.filter-segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-segment:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.filter-segment.is-active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(255, 51, 102, 0.35);
}

.filter-segment.is-active:hover {
    background: var(--accent-hover);
}

/* Filter toolbar */
.filter-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-cell {
    min-width: 0;
    transition: background 0.2s;
}

.filter-cell.is-active {
    /* highlight via checklist border instead of full cell on checklist groups */
}

.filter-cell-checklist.is-active .filter-checklist {
    border-color: rgba(255, 51, 102, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 51, 102, 0.12);
}

.filter-cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-cell-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.filter-cell-checklist.is-active .filter-cell-label,
.filter-cell.is-active > .filter-cell-label {
    color: var(--accent);
}

.filter-selected-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-cell-checklist.is-active .filter-selected-count {
    color: var(--accent);
}

/* Checkbox multiselect lists */
.filter-checklist-wrap {
    position: relative;
}

.filter-checklist-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 12px;
    bottom: 1px;
    height: 28px;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    pointer-events: none;
}

.filter-checklist-wrap:has(.filter-checklist-compact)::after {
    display: none;
}

.filter-checklist {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: 6px;
}

.filter-checklist-scroll {
    max-height: 180px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.filter-checklist-scroll::-webkit-scrollbar {
    width: 10px;
}

.filter-checklist-scroll::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
}

.filter-checklist-scroll::-webkit-scrollbar-thumb {
    background: #52525f;
    border-radius: 999px;
    border: 2px solid var(--bg-secondary);
    min-height: 40px;
}

.filter-checklist-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.filter-checklist-scroll {
    scrollbar-width: thin;
    scrollbar-color: #52525f var(--bg-secondary);
}

.filter-checklist-compact {
    overflow: visible;
}

.filter-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.filter-check-item:hover {
    background: var(--bg-hover);
}

.filter-check-item input {
    position: absolute;
    opacity: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.filter-check-item input:focus-visible + .filter-check-box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.filter-check-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #505060;
    border-radius: 5px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.filter-check-item input:checked + .filter-check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-check-item input:checked + .filter-check-box::after {
    content: '';
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.filter-check-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.filter-check-count {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-check-item input:checked ~ .filter-check-text .filter-check-label {
    color: var(--text-primary);
}

.filter-check-item:has(input:checked) {
    background: rgba(255, 51, 102, 0.1);
}

.filter-check-item:has(input:checked) .filter-check-count {
    color: var(--accent);
}

.filter-select {
    width: 100%;
    min-height: 48px;
    padding: 12px 40px 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.filter-select:hover {
    border-color: #404050;
    background-color: var(--bg-hover);
}

.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.2);
}

.filter-cell-category.is-active .filter-select {
    border-color: rgba(255, 51, 102, 0.5);
}

.filter-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-input:hover {
    border-color: #404050;
    background: var(--bg-hover);
}

.filter-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.2);
}

.filter-cell-wide.is-active .filter-input {
    border-color: rgba(255, 51, 102, 0.5);
}

.filter-cell-wide {
    grid-column: 1 / -1;
}

.filter-cell-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.filter-cell-reset {
    grid-column: 1 / -1;
    padding-top: 4px;
}

.filter-apply {
    min-height: 48px;
    padding: 12px 24px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
}

.filter-apply:hover {
    background: var(--accent-hover);
}

.filter-apply:active {
    transform: scale(0.98);
}

.filter-reset {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    transition: color 0.2s;
}

.filter-reset:hover {
    color: var(--accent);
}

/* Tags row */
.filter-zone-tags .filter-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-zone-tags .tag {
    padding: 9px 16px;
    font-size: 0.88rem;
}

/* Mobile */
@media (max-width: 768px) {
    .header-inner {
        position: relative;
        gap: 6px;
    }

    .logo {
        flex: 0 0 auto;
    }

    /* Crop wordmark — show chili/play icon only */
    .logo-img {
        height: 32px;
        width: 32px;
        object-fit: cover;
        object-position: left center;
    }

    .header-tools {
        gap: 2px;
        flex-shrink: 0;
        margin-left: auto;
    }

    .header-tool-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .header-tool-icon {
        width: 20px;
        height: 20px;
    }

    .mobile-menu-btn {
        display: block;
        flex-shrink: 0;
        padding: 6px;
        margin-left: 2px;
    }

    .header-adfree-badge {
        padding: 5px 7px;
        font-size: 0.65rem;
        gap: 4px;
    }

    .header-adfree-label {
        display: none;
    }

    .header-adfree-btn--inactive {
        padding: 8px 10px;
        font-size: 0.72rem;
        letter-spacing: 0;
        text-transform: none;
        max-width: none;
        white-space: nowrap;
        line-height: 1.15;
        text-align: center;
    }

    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
        z-index: 120;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        box-shadow: var(--shadow);
    }
    .main-nav.open .nav-menu-tools {
        display: block;
    }
    .header-tool-desktop {
        display: none !important;
    }
    .header-popover {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        bottom: auto;
        min-width: 200px;
    }
    .header-search-panel {
        padding: 12px 0;
        overflow: hidden;
    }
    .header-search-panel .container {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .header-search-form {
        flex-direction: column;
        gap: 8px;
        max-width: 100%;
    }
    .header-search-input {
        width: 100%;
        box-sizing: border-box;
    }
    .header-search-submit {
        width: 100%;
        box-sizing: border-box;
    }
    .video-grid.view-double { grid-template-columns: repeat(2, 1fr); }
    .video-grid.view-single,
    .video-grid.view-auto,
    .video-grid:not(.view-double) {
        grid-template-columns: 1fr;
        max-width: none;
        gap: 12px;
    }
    .hero { padding: 40px 0 32px; }
    .hero-search { flex-direction: column; gap: 8px; }
    .hero-search input { border-radius: var(--radius); border-right: 2px solid var(--border); }
    .hero-search input:focus { border-right-color: var(--accent); }
    .hero-search button { border-radius: var(--radius); }
    .footer-inner { flex-direction: column; text-align: center; }

    .header-filter-panel {
        --filter-footer-height: calc(68px + env(safe-area-inset-bottom, 0px));
        height: calc(100dvh - var(--header-height));
        max-height: calc(100dvh - var(--header-height));
    }

    .header-filter-scroll {
        padding-top: 8px;
    }

    .filter-popup-footer-inner {
        padding: 0 12px env(safe-area-inset-bottom, 0px);
    }

    .video-page {
        padding-top: 12px;
    }

    .video-page .breadcrumbs {
        margin-top: 0;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
    }

    .filter-zone {
        padding: 16px;
    }

    .filter-segmented {
        flex-direction: column;
        gap: 4px;
    }

    .filter-segment {
        text-align: left;
        padding: 12px 16px;
    }

    .filter-toolbar {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }

    .filter-checklist-scroll {
        max-height: 160px;
    }

}

@media (max-width: 480px) {
    .video-grid.view-double { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .video-grid:not(.view-double) { grid-template-columns: 1fr; gap: 10px; }
    .video-title { font-size: 0.82rem; padding: 8px 10px 2px; }
    .video-meta { padding: 2px 10px 8px; font-size: 0.75rem; }
}

/* ── Video Ads ── */
.player-content--gated {
    display: none !important;
}

.external-player-wait {
    position: absolute;
    inset: auto 0 24px;
    margin: 0;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.external-player.external-player {
    position: relative;
}

.ad-preroll {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #000;
}

.player-wrapper {
    position: relative;
}

.video-page .player-wrapper.is-sticky-player {
    position: fixed;
}

.ad-preroll-video,
.reward-ad-video {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

.ad-preroll-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.ad-preroll-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.ad-preroll-skip {
    position: absolute;
    bottom: 16px;
    right: 16px;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.ad-preroll-adfree {
    position: absolute;
    bottom: 16px;
    left: 12px;
    right: auto;
    max-width: calc(100% - 140px);
    pointer-events: auto;
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.ad-preroll-adfree:hover {
    background: #15803d;
}

.ad-preroll-adfree[hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    .ad-preroll-adfree {
        left: 8px;
        bottom: 12px;
        max-width: calc(100% - 120px);
        padding: 7px 10px;
        font-size: 0.72rem;
    }

    .ad-preroll-skip {
        bottom: 12px;
        right: 8px;
        padding: 7px 12px;
        font-size: 0.8rem;
    }
}

.ad-preroll-skip[hidden] {
    display: none !important;
}

.ad-preroll-skip:disabled {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-weight: 500;
    cursor: default;
    opacity: 1;
}

.ad-preroll-skip:not(:disabled):hover {
    background: #fff;
}

.ad-preroll-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.6);
}

.ad-preroll-loading[hidden] {
    display: none !important;
}

.header-adfree-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #16a34a;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.header-adfree-badge[hidden],
.header-adfree-btn[hidden] {
    display: none !important;
}

.header-adfree-label {
    line-height: 1;
}

.header-adfree-time {
    font-weight: 600;
    font-size: 0.7rem;
    opacity: 0.95;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    min-width: 5ch;
    display: inline-block;
    text-align: right;
    line-height: 1;
}

.header-adfree-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: opacity 0.2s;
}

.header-adfree-btn--inactive {
    background: #16a34a;
    color: #fff;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-transform: none;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.35);
}

.header-adfree-btn--inactive:hover {
    background: #15803d;
    opacity: 1;
}

.reward-modal[hidden] {
    display: none !important;
}

.reward-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reward-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.reward-modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface, #1a1a2e);
    border: 1px solid var(--border, #333);
    border-radius: var(--radius, 12px);
    padding: 24px;
    max-width: min(960px, calc(100vw - 32px));
    max-height: min(92vh, 900px);
    overflow-y: auto;
    width: 100%;
    z-index: 1;
}

.reward-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.reward-modal-dialog h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.reward-modal-desc {
    color: var(--text-secondary, #aaa);
    margin: 0 0 16px;
    font-size: 0.9rem;
}

.reward-ad-stage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.reward-ad-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(58vh, 520px);
    background: #000;
    border-radius: var(--radius, 8px);
    overflow: hidden;
}

.reward-ad-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reward-ad-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.reward-ad-progress-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reward-ad-progress-value {
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.reward-modal-start {
    width: 100%;
    padding: 12px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: var(--radius, 8px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.reward-modal-start:hover {
    background: #15803d;
    opacity: 1;
}

.reward-modal-start:disabled {
    opacity: 0.7;
    cursor: default;
}

body.reward-modal-open {
    overflow: hidden;
}

.ad-banner-slot,
.ad-native-slot {
    margin: 16px auto;
    text-align: center;
    min-height: 90px;
}

.ad-native-slot {
    min-height: 120px;
    margin-bottom: 24px;
}

.static-page .prose {
    max-width: 720px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.static-page .prose h2 {
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
    font-size: 1.15rem;
}

.static-page .prose ul {
    margin: 0.5rem 0 1rem 1.25rem;
}

.related-tags-section {
    padding-bottom: 32px;
}

.related-tags-heading {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.category-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--surface-2, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.category-card:hover {
    border-color: var(--accent, #e85d04);
    background: rgba(232, 93, 4, 0.08);
}

.category-card span {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.faq-section {
    padding-bottom: 40px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 820px;
}

.faq-item {
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    background: var(--surface-2, rgba(255, 255, 255, 0.03));
    padding: 12px 16px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-item p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Mobile sticky bottom banner (300x50) — 1 or 2 ads */
.sticky-mobile-ad {
    display: none;
}

@media (max-width: 768px) {
    .sticky-mobile-ad {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        height: 50px;
        max-height: 50px;
        padding: 0 26px 0 2px;
        background: rgba(10, 10, 12, 0.96);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
        overflow: visible;
    }

    .sticky-mobile-ad[hidden],
    .sticky-mobile-ad.is-collapsed,
    .sticky-mobile-ad.is-adfree-hidden,
    .sticky-mobile-ad.is-ad-empty {
        display: none !important;
    }

    .sticky-mobile-ad.is-awaiting-fill {
        opacity: 0;
        pointer-events: none;
    }

    .sticky-mobile-ad.is-visible:not([hidden]) {
        display: flex;
    }

    body.has-sticky-mobile-ad {
        padding-bottom: 50px;
    }

    .sticky-mobile-ad-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100%;
        height: 50px;
        max-width: 100%;
    }

    .sticky-mobile-ad-inner {
        flex: 0 0 auto;
        width: 300px;
        height: 50px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sticky-mobile-ad-inner--extra {
        display: none !important;
    }

    /* JS toggles .is-dual after measuring available width */
    .sticky-mobile-ad.is-dual .sticky-mobile-ad-inner--extra {
        display: flex !important;
    }

    .sticky-mobile-ad-inner iframe {
        display: block !important;
        width: 300px !important;
        height: 50px !important;
        border: 0 !important;
        overflow: hidden !important;
        background: transparent;
    }

    .sticky-mobile-ad-close {
        position: absolute;
        top: 2px;
        right: 4px;
        z-index: 2;
        width: 22px;
        height: 22px;
        border: 0;
        border-radius: 4px;
        background: rgba(0, 0, 0, 0.65);
        color: #fff;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }

    .sticky-mobile-ad-close:hover,
    .sticky-mobile-ad-close:focus-visible {
        background: rgba(0, 0, 0, 0.85);
    }
}
