/* ==========================================================================
   ViboStream — XVideos-style unified theme (mobile + desktop)
   ========================================================================== */

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

:root {
    --xv-red: #de2600;
    --xv-red-hover: #c02100;
    --xv-red-soft: rgba(222, 38, 0, 0.08);
    --xv-black: #000000;
    --xv-nav: #1b1b1b;
    --xv-bg: #ececec;
    --xv-white: #ffffff;
    --xv-text: #222222;
    --xv-muted: #666666;
    --xv-dim: #999999;
    --xv-border: #d6d6d6;
    --xv-radius: 4px;
    --xv-top-h: 50px;
    --xv-nav-h: 36px;
    --xv-max: 1440px;
    --xv-font: "Roboto", "Helvetica Neue", Arial, sans-serif;
    --xv-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --xv-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--xv-font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--xv-text);
    background: var(--xv-bg);
    -webkit-font-smoothing: antialiased;
}

body.xh-site {
    padding-top: 0 !important;
    background: var(--xv-bg);
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }

/* ---- Layout ---- */
.main-content {
    min-height: 50vh;
    padding: 0;
    background: var(--xv-bg);
}

.xh-main-wrap,
.tube-main,
.yt-main {
    padding: 0 !important;
    background: var(--xv-bg);
}

.xh-page {
    max-width: var(--xv-max);
    margin: 0 auto;
}

.xh-content {
    padding: 0 8px 24px;
}

@media (min-width: 768px) {
    .xh-content { padding: 0 16px 32px; }
}

/* ---- Header ---- */
.site-header,
.xh-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--xv-nav);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.xh-top {
    background: var(--xv-nav);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.xh-top__inner {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    height: var(--xv-top-h);
    padding: 0 6px 0 4px;
    max-width: var(--xv-max);
    margin: 0 auto;
    position: relative;
}

.xh-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.xh-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.xh-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
}

.xh-logo--center { justify-self: center; }

.xh-logo__img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.xh-logo__text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--xv-red);
    letter-spacing: -0.02em;
}

.xh-top__actions--desktop {
    display: none;
}

.xh-top__action-label {
    display: none;
}

@media (min-width: 1024px) {
    .xh-menu-btn {
        display: none !important;
    }

    .xh-top__actions--mobile {
        display: none !important;
    }

    .xh-top__actions--desktop {
        display: flex;
        align-items: center;
        gap: 4px;
        grid-column: 4;
    }

    .xh-top__actions--desktop .xh-top__action {
        width: auto;
        height: auto;
        min-height: 36px;
        padding: 6px 12px;
        border-radius: 20px;
        gap: 6px;
    }

    .xh-top__actions--desktop .xh-top__action-label {
        display: inline;
        font-size: 13px;
        font-weight: 500;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .xh-top__action--register {
        background: var(--xv-red);
        color: #fff !important;
    }

    .xh-top__action--register:hover {
        background: var(--xv-red-hover) !important;
    }
}

@media (max-width: 1023px) {
    .xh-top__actions--mobile {
        display: flex;
        grid-column: 3;
    }
}

.xh-top__action,
.xh-top__action--search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.92);
    border: none;
    background: transparent;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    text-decoration: none;
    flex-shrink: 0;
}

.xh-top__action svg,
.xh-top__action--search-toggle svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.xh-top__action:hover,
.xh-top__action--search-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.xh-top__action--search-toggle[aria-expanded="true"] {
    color: var(--xv-red);
    background: rgba(255, 255, 255, 0.12);
}

.xh-badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: var(--xv-red);
    border-radius: 50%;
    border: 1.5px solid var(--xv-nav);
}

/* Search dropdown — below dark header */
.xh-search--bar {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--xv-nav);
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 210;
}

.xh-search--bar.is-open { display: block; }

.xh-search__wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    overflow: hidden;
}

.xh-search__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    outline: none;
    min-width: 0;
    color: #fff;
}

.xh-search__input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.xh-search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 2px;
    border: none;
    background: var(--xv-red);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
}

.xh-search__btn:hover { background: var(--xv-red-hover); }

.xh-search__btn svg {
    width: 18px;
    height: 18px;
}

/* Category nav */
.xh-nav {
    background: var(--xv-nav);
    height: var(--xv-nav-h);
}

.xh-nav__inner {
    max-width: var(--xv-max);
    margin: 0 auto;
    height: 100%;
}

.xh-nav__scroll {
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 4px;
}

.xh-nav__scroll::-webkit-scrollbar { display: none; }

.xh-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.15s var(--xv-ease), border-color 0.15s var(--xv-ease);
}

.xh-nav__link:hover { color: #fff; }

.xh-nav__link.is-active {
    color: #fff;
    border-bottom-color: var(--xv-red);
    font-weight: 600;
}

/* Header banner */
.sh-header-banner,
.header-banner {
    max-width: var(--xv-max);
    margin: 0 auto;
    overflow: hidden;
    line-height: 0;
}

.sh-header-banner img,
.header-banner img {
    width: 100%;
    height: auto;
}

/* ---- Mobile menu (dark drawer) ---- */
.xh-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 400;
    pointer-events: none;
    visibility: hidden;
}

.xh-mobile-menu.is-open {
    pointer-events: auto;
    visibility: visible;
}

.xh-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.25s var(--xv-ease);
}

.xh-mobile-menu.is-open .xh-mobile-menu__backdrop { opacity: 1; }

.xh-mobile-menu__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(320px, 88vw);
    height: 100%;
    background: #141414;
    transform: translateX(-100%);
    transition: transform 0.28s var(--xv-ease);
    overflow-y: auto;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.xh-mobile-menu.is-open .xh-mobile-menu__panel { transform: translateX(0); }

body.sh-menu-open { overflow: hidden; }

.xh-mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #0d0d0d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.xh-mobile-menu__head .xh-logo__text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

#mobileMenuClose {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
}

.xh-mobile-menu__nav {
    padding: 8px 0 32px;
    flex: 1;
}

.xh-mobile-menu__link,
.sh-mobile-menu__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.xh-mobile-menu__link:hover,
.sh-mobile-menu__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.xh-mobile-menu__link--accent {
    color: #ff6b4a;
    font-weight: 600;
}

.xh-mobile-menu__section {
    padding: 16px 0 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
}

.sh-mobile-menu__section-title {
    display: block;
    padding: 0 18px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
}

.xh-mobile-menu__filter {
    display: block;
    width: calc(100% - 36px);
    margin: 0 18px 12px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 13px;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.xh-mobile-menu__filter::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.xh-mobile-menu__filter:focus {
    border-color: rgba(255, 107, 74, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(222, 38, 0, 0.2);
}

/* Mobile menu — sort dropdown */
.sort-dropdown-wrap--menu {
    margin: 0 18px 4px;
}

.sort-dropdown--menu {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 40px 12px 14px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.sort-dropdown-wrap--menu .sort-dropdown-chevron {
    border-top-color: rgba(255, 255, 255, 0.7);
    right: 16px;
}

.sort-dropdown--menu:focus {
    border-color: rgba(255, 107, 74, 0.6);
    box-shadow: 0 0 0 2px rgba(222, 38, 0, 0.2);
}

.xh-mobile-menu__cat,
.sh-mobile-menu__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.xh-mobile-menu__cat:hover,
.sh-mobile-menu__cat:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.xh-mobile-menu__cat.is-active,
.sh-mobile-menu__cat.is-active {
    color: #ff6b4a;
    font-weight: 600;
    background: rgba(222, 38, 0, 0.12);
}

.sh-mobile-menu__cat-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

.sh-mobile-menu__link--report {
    margin: 12px 18px 0;
    width: calc(100% - 36px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75) !important;
    text-align: center;
    justify-content: center;
}

.sh-mobile-menu__link--report:hover {
    border-color: var(--xv-red) !important;
    color: #ff6b4a !important;
    background: rgba(222, 38, 0, 0.1) !important;
}

/* Sort nav — shared */
.xv-sort-nav__list,
.xh-sidebar__sort__list,
.xh-mobile-menu__sort__list,
.watch-sidebar__sort-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xh-sidebar__sort__item,
.xh-mobile-menu__sort__item,
.watch-sidebar__sort-nav__item,
.xv-sort-nav__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

/* Home desktop sidebar */
.xh-sidebar {
    display: none;
}

.xh-sidebar__block {
    margin-bottom: 20px;
}

.xh-sidebar__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--xv-muted);
    margin: 0 0 10px;
    padding: 0 4px;
}

.xh-sidebar__filter {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
    background: var(--xv-white);
}

.xh-sidebar__filter:focus {
    border-color: var(--xv-red);
    box-shadow: 0 0 0 2px var(--xv-red-soft);
}

.xh-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xh-sidebar__sort__item {
    color: var(--xv-text);
    padding: 10px 12px;
}

.xh-sidebar__sort__item:hover {
    background: var(--xv-bg);
    color: var(--xv-red);
}

.xh-sidebar__sort__item.is-active {
    background: var(--xv-red-soft);
    color: var(--xv-red);
    font-weight: 600;
}

.xh-sidebar__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--xv-text);
    border-radius: 6px;
    text-decoration: none;
}

.xh-sidebar__cat:hover {
    background: var(--xv-bg);
    color: var(--xv-red);
}

.xh-sidebar__cat.is-active {
    background: var(--xv-red-soft);
    color: var(--xv-red);
    font-weight: 600;
}

.xh-sidebar__cat-count {
    font-size: 11px;
    color: var(--xv-dim);
    background: var(--xv-bg);
    padding: 2px 7px;
    border-radius: 10px;
}

/* Mobile menu sort items */
.xh-mobile-menu__sort__item {
    color: rgba(255, 255, 255, 0.85);
    padding: 12px 18px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.xh-mobile-menu__sort__item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.xh-mobile-menu__sort__item.is-active {
    color: #ff6b4a;
    background: rgba(222, 38, 0, 0.12);
    font-weight: 600;
}

/* Home page layout */
.xh-page-layout {
    display: block;
}

@media (min-width: 1024px) {
    .xh-page-layout {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 28px;
        align-items: start;
    }

    .xh-sidebar {
        display: block;
        position: sticky;
        top: calc(56px + var(--xv-nav-h) + 20px);
        max-height: calc(100vh - 56px - var(--xv-nav-h) - 40px);
        overflow-y: auto;
        padding: 0 0 16px;
        scrollbar-width: thin;
    }

    .xh-sidebar__block:first-child {
        margin-top: 0;
    }

    .xh-sidebar__block {
        background: var(--xv-white);
        border: 1px solid var(--xv-border);
        border-radius: 8px;
        padding: 14px 12px;
        margin-bottom: 16px;
    }

    .xh-mobile-menu__section--sort {
        display: none;
    }
}

/* Home: jarak banner ↔ konten; stories sejajar dengan sidebar Urutkan */
.tube-home--banner .xh-page {
    padding-top: 16px;
}

@media (min-width: 768px) {
    .tube-home--banner .xh-page {
        padding-top: 20px;
    }
}

@media (min-width: 1024px) {
    .tube-home--banner .xh-page {
        padding-top: 24px;
    }

    /* Sejajarkan label Urutkan ↔ Video populer sekarang */
    .tube-home .xh-content > .xm-stories:first-child {
        padding-top: 14px;
    }

    .tube-home .xh-sidebar__block:first-child {
        padding-top: 14px;
    }
}

/* ---- Home: stories ---- */
.xm-stories {
    padding: 12px 0 4px;
    border-bottom: 1px solid var(--xv-border);
    margin-bottom: 8px;
    background: var(--xv-white);
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
}

@media (min-width: 768px) {
    .xm-stories {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
        border-radius: var(--xv-radius);
    }
}

.xm-stories__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--xv-muted);
    margin-bottom: 10px;
    padding-left: 2px;
}

.xm-stories__scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 10px;
}

.xm-stories__scroll::-webkit-scrollbar { display: none; }

.xm-story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 68px;
    text-align: center;
}

.xm-story__ring {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--xv-red), #ff6b35);
}

.xm-story__thumb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--xv-white);
}

.xm-story__live {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--xv-red);
    border-radius: 50%;
    border: 2px solid var(--xv-white);
}

.xm-story__name {
    font-size: 11px;
    color: var(--xv-text);
    line-height: 1.2;
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Home: toolbar ---- */
.xm-toolbar {
    padding: 12px 0 8px;
}

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

.xm-toolbar__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--xv-text);
    flex: 1;
    min-width: 0;
}

.xm-toolbar__sort-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--xv-nav);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.xm-toolbar__sort-chip:hover { background: #333; }

.xm-toolbar__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.xm-filter-btn {
    padding: 5px 14px;
    border: 1px solid var(--xv-border);
    border-radius: 20px;
    background: var(--xv-white);
    color: var(--xv-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s var(--xv-ease);
}

.xm-filter-btn.is-active {
    border-color: var(--xv-red);
    color: var(--xv-red);
    background: var(--xv-red-soft);
    font-weight: 600;
}

/* ---- Video grid & cards ---- */
.xh-feed-grid,
.video-grid,
.tube-feed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 8px;
}

@media (min-width: 600px) {
    .xh-feed-grid, .video-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (min-width: 1024px) {
    .xh-feed-grid, .video-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

@media (min-width: 1400px) {
    .xh-feed-grid, .video-grid { grid-template-columns: repeat(5, 1fr); }
}

.video-card,
.xh-card {
    background: transparent;
    animation: xvFadeIn 0.35s var(--xv-ease) both;
}

@keyframes xvFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.xh-card__thumb-link { display: block; }

.xh-card__thumb,
.video-thumb,
.sh-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #ccc;
    border-radius: var(--xv-radius);
    overflow: hidden;
}

.xh-card__thumb img,
.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s var(--xv-ease);
}

.video-card:hover .xh-card__thumb img { transform: scale(1.03); }

.video-duration,
.sh-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 2px;
    line-height: 1.3;
    z-index: 2;
}

.video-quality,
.sh-quality {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
}

.xh-card__info,
.video-info {
    padding: 6px 2px 0;
}

.xm-card-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.xm-card-avatar-link {
    flex-shrink: 0;
    display: block;
    margin-top: 2px;
    text-decoration: none;
}

.xm-card-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--xv-red), #ff6b35);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--xv-white);
    box-shadow: 0 0 0 1px var(--xv-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.xm-card-avatar--img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    background: #ddd;
}

.xm-card-avatar-link:hover .xm-card-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 0 1px var(--xv-red-soft), 0 2px 8px rgba(222, 38, 0, 0.15);
}

.xh-card__channel {
    font-size: 12px;
    margin: 2px 0 4px;
    line-height: 1.3;
}

.xh-card__channel a {
    color: var(--xv-dim);
    font-weight: 500;
}

.xh-card__channel a:hover {
    color: var(--xv-red);
}

.xm-card-body {
    flex: 1;
    min-width: 0;
}

.xh-card__text h3,
.video-info h3 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xh-card__text h3 a:hover,
.video-info h3 a:hover { color: var(--xv-red); }

.xh-card__meta,
.video-meta {
    font-size: 11px;
    color: var(--xv-dim);
    margin-top: 3px;
}

.video-card.is-hd-hidden { display: none; }

/* Skeleton */
.xh-skeleton-grid,
.tube-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 1024px) {
    .xh-skeleton-grid { grid-template-columns: repeat(4, 1fr); }
}

.tube-skeleton__thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(90deg, #ddd 25%, #eee 50%, #ddd 75%);
    background-size: 200% 100%;
    animation: xvShimmer 1.2s infinite;
    border-radius: var(--xv-radius);
}

.tube-skeleton__line {
    height: 12px;
    margin-top: 8px;
    background: #ddd;
    border-radius: 2px;
    animation: xvShimmer 1.2s infinite;
}

.tube-skeleton__line--short { width: 60%; }

@keyframes xvShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty & loader */
.xh-empty,
.empty-state {
    text-align: center;
    padding: 48px 20px;
    background: var(--xv-white);
    border-radius: var(--xv-radius);
    margin-top: 12px;
}

.xh-empty h2, .empty-state h2 { font-size: 18px; margin-bottom: 8px; }
.xh-empty p, .empty-state p { color: var(--xv-muted); margin-bottom: 16px; }

.xh-loader,
.home-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px;
    color: var(--xv-muted);
    font-size: 13px;
}

.xh-load-more,
.load-more-wrap {
    text-align: center;
    padding: 20px 0;
}

/* Sort sheet — dark panel, readable text */
.xm-sort-sheet {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s var(--xv-ease);
}

.xm-sort-sheet.is-open { pointer-events: auto; opacity: 1; }

.xm-sort-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.xm-sort-sheet__panel {
    position: relative;
    width: 100%;
    background: var(--xv-nav);
    border-radius: 14px 14px 0 0;
    padding: 16px 12px calc(20px + env(safe-area-inset-bottom, 0));
    transform: translateY(100%);
    transition: transform 0.28s var(--xv-ease);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.xm-sort-sheet.is-open .xm-sort-sheet__panel { transform: translateY(0); }

.xm-sort-sheet__title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    padding: 0 8px 8px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.xm-sort-sheet__btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--xv-radius);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.88);
    -webkit-appearance: none;
    appearance: none;
}

.xm-sort-sheet__btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.xm-sort-sheet__btn.is-active {
    background: rgba(222, 38, 0, 0.2);
    color: #ff6b4a;
    font-weight: 700;
}

/* ---- Watch page ---- */
.watch-page {
    max-width: var(--xv-max);
    margin: 0 auto;
    padding: 0 16px 24px;
}

@media (min-width: 768px) {
    .watch-page { padding: 0 16px 32px; }
}

.watch-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Player — full bleed mobile */
.watch-grid__player {
    margin: 0 -16px;
    width: calc(100% + 32px);
}

.watch-grid__player .player-wrapper,
.watch-grid__player .yt-player {
    border-radius: 0;
}

@media (min-width: 768px) {
    .watch-grid__player {
        margin: 12px 0 0;
        width: 100%;
    }
    .watch-grid__player .player-wrapper,
    .watch-grid__player .yt-player { border-radius: var(--xv-radius); }
}

.watch-grid__details {
    padding: 16px 0 0;
    background: transparent;
}

.sh-watch-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.watch-ad-below-player {
    margin: 0 0 12px;
    border-radius: var(--xv-radius);
    overflow: hidden;
}

.watch-grid__sidebar {
    margin-top: 8px;
    padding: 0;
}

@media (min-width: 768px) {
    .watch-grid__sidebar { margin-top: 12px; }
}

.watch-grid__comments {
    margin-top: 12px;
    padding: 0;
}

.yt-video-title,
.sh-watch-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--xv-text);
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .yt-video-title, .sh-watch-title { font-size: 20px; }
}

.xm-watch-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.xm-tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--xv-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.xm-tag:hover {
    border-color: var(--xv-red);
    color: var(--xv-red);
    background: var(--xv-red-soft);
}

.sh-watch-stats,
.video-stats-bar.yt-stats {
    font-size: 12px;
    color: var(--xv-dim);
    margin-bottom: 12px;
}

.video-stats-bar .dot { margin: 0 5px; }

/* Watch page — YouTube-style meta + channel + actions */
.watch-primary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--xv-dim);
    line-height: 1.4;
}

.watch-primary-meta .dot {
    color: var(--xv-dim);
    font-weight: 700;
}

/* Channel + actions toolbar */
.watch-engage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0 0 0;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--xv-border);
}

.watch-engage__channel {
    padding: 0 0 14px;
}

.watch-engage__actions {
    padding: 14px 0 0;
    margin: 0;
    border-top: 1px solid var(--xv-border);
}

.watch-engage .xh-channel--watch {
    margin-bottom: 0;
}

.watch-extra {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.watch-extra .video-description,
.watch-extra .yt-description {
    margin-top: 0;
}

/* Action bar — YouTube-style grey pills */
.watch-actions-bar,
.yt-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding: 0;
    margin: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border: none;
    background: transparent;
}

.watch-actions-bar::-webkit-scrollbar { display: none; }

.watch-action-group {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    background: #f2f2f2;
    border-radius: 999px;
    overflow: hidden;
}

.watch-action-btn,
.watch-actions-bar .yt-action-pill,
.watch-actions-bar .action-btn,
.watch-actions-bar .action-download {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    min-width: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.watch-action-group .watch-action-btn {
    border-radius: 999px;
    background: transparent;
}

.watch-action-btn__icon,
.watch-actions-bar .watch-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex-shrink: 0;
}

.watch-action-btn__icon svg,
.watch-actions-bar .watch-action-icon svg {
    display: block;
}

.watch-action-btn__label,
.watch-actions-bar .watch-action-label {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    border: 0;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
}

.watch-action-count {
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    line-height: 1;
}

.watch-action-btn:hover,
.watch-actions-bar .yt-action-pill:hover,
.watch-actions-bar .action-btn:hover,
.watch-actions-bar .action-download:hover {
    background: #e5e5e5;
}

.watch-action-group .watch-action-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.watch-action-btn:active,
.watch-actions-bar .action-btn:active {
    transform: scale(0.97);
}

.watch-action-btn--like.liked,
.watch-actions-bar .yt-action-pill.liked,
.watch-actions-bar .like-btn.liked {
    color: var(--xv-red);
    background: rgba(222, 38, 0, 0.1);
}

.watch-action-group .watch-action-btn--like.liked {
    background: rgba(222, 38, 0, 0.1);
}

.watch-action-btn--like {
    position: relative;
}

.watch-action-btn--like.liked:hover,
.watch-actions-bar .like-btn.liked:hover {
    background: rgba(222, 38, 0, 0.16);
}

@media (max-width: 767px) {
    .watch-grid__details {
        padding-top: 12px;
    }

    .yt-video-title,
    .sh-watch-title {
        font-size: 18px;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    .watch-primary-meta {
        margin-bottom: 14px;
        font-size: 12px;
    }

    .watch-engage {
        padding-bottom: 14px;
        margin-left: -2px;
        margin-right: -2px;
    }

    .watch-engage__channel {
        padding-bottom: 12px;
    }

    .watch-engage__actions {
        padding-top: 12px;
        margin: 0 -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .watch-actions-bar {
        gap: 8px;
        padding-bottom: 2px;
    }

    .watch-action-btn,
    .watch-actions-bar .action-btn,
    .watch-actions-bar .action-download {
        min-height: 40px;
        min-width: 40px;
        padding: 0 12px;
        border-radius: 999px;
    }

    .watch-action-group {
        border-radius: 999px;
    }

    .watch-action-btn__label,
    .watch-actions-bar .watch-action-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .watch-extra {
        margin-top: 14px;
        gap: 10px;
    }

    .watch-extra .video-description,
    .watch-extra .yt-description {
        padding: 12px 14px;
        font-size: 13px;
        border-radius: 10px;
    }
}

.video-description,
.yt-description {
    margin-top: 0;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--xv-text);
    line-height: 1.6;
    background: #f2f2f2;
    border-radius: 12px;
    border-top: none;
}

/* Player */
.player-wrapper,
.yt-player {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

.player-stage {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.player-stage video,
.player-stage .video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.ad-banner {
    margin: 10px 0;
    overflow: hidden;
    border-radius: var(--xv-radius);
    line-height: 0;
}

/* Related sidebar — professional cards */
.yt-sidebar,
.watch-sidebar {
    background: transparent;
    border-radius: 0;
    padding: 12px 0 0;
    border: none;
    border-top: 1px solid var(--xv-border);
}

@media (min-width: 1024px) {
    .yt-sidebar,
    .watch-sidebar {
        background: var(--xv-white);
        border-radius: 10px;
        padding: 0;
        border: 1px solid var(--xv-border);
        border-top: 1px solid var(--xv-border);
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }

    .yt-sidebar-head {
        padding: 16px 16px 12px;
        border-bottom: 1px solid var(--xv-border);
        background: #fafafa;
    }

    .watch-sidebar__sort {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--xv-border);
    }

    .watch-sidebar__sort-label {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--xv-dim);
        margin: 0 0 8px;
    }

    .watch-sidebar__sort-nav__item {
        display: block;
        padding: 8px 12px;
        font-size: 13px;
        color: var(--xv-text);
        text-decoration: none;
        border-radius: 6px;
        margin-bottom: 2px;
    }

    .watch-sidebar__sort-nav__item:hover {
        background: var(--xv-bg);
        color: var(--xv-red);
    }

    .watch-sidebar__sort-nav__item.is-active {
        background: var(--xv-red-soft);
        color: var(--xv-red);
        font-weight: 600;
    }

    .yt-sidebar-scroll {
        padding: 8px 12px 12px;
        max-height: calc(100vh - 280px);
        overflow-y: auto;
    }
}

.yt-sidebar-head__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
}

.yt-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--xv-text);
}

.yt-sidebar-count {
    font-size: 11px;
    color: var(--xv-dim);
    white-space: nowrap;
    background: var(--xv-bg);
    padding: 3px 8px;
    border-radius: 10px;
}

.watch-sidebar__sort-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--xv-dim);
    margin: 10px 0 6px;
}

.watch-sidebar__sort-nav__item {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    color: var(--xv-text);
    text-decoration: none;
}

.watch-sidebar__sort-nav__item.is-active {
    color: var(--xv-red);
    font-weight: 600;
}

/* Sort dropdown */
.sort-bar--compact {
    margin-bottom: 0;
}

.sort-bar--compact .sort-bar__field {
    margin: 0;
}

.sort-dropdown-wrap {
    position: relative;
    display: block;
}

.sort-dropdown {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 36px 10px 14px;
    background: var(--xv-white);
    color: var(--xv-text);
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sort-dropdown:hover {
    border-color: #ccc;
}

.sort-dropdown:focus {
    border-color: var(--xv-red);
    box-shadow: 0 0 0 2px var(--xv-red-soft);
}

.sort-dropdown-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--xv-muted);
    pointer-events: none;
}

/* Watch sidebar sort */
.watch-sidebar__sort {
    margin-top: 12px;
}

.watch-sidebar__sort .sort-dropdown {
    background: var(--xv-white);
    border-color: var(--xv-border);
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 36px 10px 12px;
}

.yt-sidebar-head .sort-bar {
    margin: 0;
}

/* Home desktop sidebar sort */
.xh-sidebar .sort-dropdown {
    font-size: 13px;
}

.yt-related-list,
.related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yt-related-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    margin: 0;
    border-radius: 8px;
    border-bottom: none;
    transition: background 0.15s;
}

@media (min-width: 768px) {
    .yt-related-item {
        padding: 10px 8px;
        margin: 0 -8px;
    }
}

.yt-related-item:hover {
    background: var(--xv-bg);
}

.yt-related-item:hover .yt-related-title { color: var(--xv-red); }

.yt-related-thumb {
    position: relative;
    flex-shrink: 0;
    width: 148px;
    aspect-ratio: 16/9;
    background: #ddd;
    border-radius: 6px;
    overflow: hidden;
}

@media (max-width: 480px) {
    .yt-related-thumb { width: 128px; }
}

@media (min-width: 1024px) {
    .yt-related-thumb { width: 160px; }
}

.yt-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.yt-related-item:hover .yt-related-thumb img {
    transform: scale(1.03);
}

.yt-related-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 2;
}

.yt-related-thumb .video-quality,
.yt-related-thumb .sh-quality {
    top: 4px;
    left: 4px;
    font-size: 9px;
    padding: 2px 5px;
}

.yt-related-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.yt-related-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--xv-text);
}

.yt-related-meta {
    font-size: 11px;
    color: var(--xv-dim);
    line-height: 1.3;
}

.yt-related-uploader-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 2px;
}

.yt-related-uploader {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--xv-red), #ff6b35);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
}

.yt-related-uploader--img {
    object-fit: cover;
    background: #ddd;
}

.yt-related-uploader-name {
    font-size: 11px;
    color: var(--xv-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.load-more-wrap--sidebar {
    padding: 8px 0 14px;
}

.load-more-wrap--sidebar .btn-load-more {
    width: 100%;
    font-size: 12px;
    padding: 9px;
}

.related-loader {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: var(--xv-muted);
    font-size: 13px;
}

.related-loader[hidden],
.home-loader[hidden],
.xh-loader[hidden],
#relatedLoader[hidden],
#homeLoader[hidden],
#commentsLoader[hidden] {
    display: none !important;
}

/* Comments — clean card */
.comments-section,
.yt-comments {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.comments-section__head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--xv-border);
    background: #fafafa;
}

@media (min-width: 768px) {
    .comments-section__head { padding: 16px 20px; }
}

.comments-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--xv-text);
}

.comment-form {
    padding: 16px;
    border-bottom: 1px solid var(--xv-border);
}

@media (min-width: 768px) {
    .comment-form { padding: 20px; }
}

.comment-form__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 640px) {
    .comment-form__fields { grid-template-columns: 1fr; }
}

.comment-form__row--full {
    margin-bottom: 14px;
}

.comment-form__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--xv-muted);
    margin-bottom: 6px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    outline: none;
    background: #fafafa;
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--xv-red);
    background: var(--xv-white);
    box-shadow: 0 0 0 3px var(--xv-red-soft);
}

.comment-form textarea {
    resize: vertical;
    min-height: 88px;
    line-height: 1.5;
}

.comment-form__actions {
    display: flex;
    justify-content: flex-end;
}

.comment-form__submit {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 8px;
}

.comment-list {
    padding: 8px 16px 16px;
}

@media (min-width: 768px) {
    .comment-list { padding: 8px 20px 20px; }
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child { border-bottom: none; }

.comment-item::before {
    content: attr(data-initial);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--xv-red-soft);
    color: var(--xv-red);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-body { flex: 1; min-width: 0; }

.comment-body strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--xv-text);
}

.comment-body p {
    font-size: 14px;
    color: var(--xv-muted);
    margin-top: 4px;
    line-height: 1.55;
}

.comment-date {
    font-size: 11px;
    color: var(--xv-dim);
    margin-top: 6px;
}

/* ---- Modals ---- */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal[hidden] { display: none; }

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

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

.share-modal-content {
    position: relative;
    background: var(--xv-white);
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.share-modal-header h3 { font-size: 16px; font-weight: 700; }

.share-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--xv-muted);
    line-height: 1;
    padding: 0 4px;
}

.share-modal-title {
    font-size: 13px;
    color: var(--xv-muted);
    margin-bottom: 14px;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.share-option {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: var(--xv-radius);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.share-wa { background: #25d366; }
.share-fb { background: #1877f2; }
.share-tw { background: #000; }
.share-tg { background: #0088cc; }

.share-copy-box {
    display: flex;
    gap: 8px;
}

.share-copy-box input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    font-size: 12px;
    min-width: 0;
}

.report-form .form-group { margin-bottom: 12px; }

.report-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.report-form select,
.report-form textarea,
.report-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    outline: none;
}

.report-form select:focus,
.report-form textarea:focus,
.report-form input:focus { border-color: var(--xv-red); }

/* ---- Auth pages ---- */
.xm-auth-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px 48px;
    min-height: 60vh;
}

.xm-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    padding: 28px 24px;
    box-shadow: var(--xv-shadow);
}

.xm-auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.xm-auth-card p {
    font-size: 13px;
    color: var(--xv-muted);
    margin-bottom: 20px;
}

.xm-auth-card .form-group,
.form-group {
    margin-bottom: 14px;
}

.xm-auth-card label,
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--xv-text);
}

.xm-auth-card input,
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    outline: none;
    background: var(--xv-white);
}

.xm-auth-card input:focus,
.form-group input:focus {
    border-color: var(--xv-red);
    box-shadow: 0 0 0 2px var(--xv-red-soft);
}

.xm-auth-submit {
    width: 100%;
    padding: 12px;
    background: var(--xv-red);
    color: #fff;
    border: none;
    border-radius: var(--xv-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

.xm-auth-submit:hover { background: var(--xv-red-hover); }

.xm-auth-links {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--xv-muted);
}

.xm-auth-links a { color: var(--xv-red); font-weight: 600; }

/* Profile */
.xm-profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--xv-border);
}

.xm-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--xv-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.xm-profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--xv-border);
}

.xm-profile-links a {
    padding: 8px 14px;
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    font-size: 13px;
    font-weight: 500;
}

.xm-profile-links a:hover {
    border-color: var(--xv-red);
    color: var(--xv-red);
}

.xm-profile-avatar--img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.xm-profile-stats-mini {
    font-size: 12px;
    color: var(--xv-dim);
    margin-top: 4px;
}

.xm-profile-public-link {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: var(--xv-bg);
    border-radius: 8px;
    word-break: break-all;
}

.xm-profile-public-link a {
    color: var(--xv-red);
    font-weight: 600;
}

.xm-profile-avatar-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--xv-border);
}

.xm-profile-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.xm-auth-submit--secondary {
    background: var(--xv-white);
    color: var(--xv-text);
    border: 1px solid var(--xv-border);
}

.xm-auth-submit--secondary:hover {
    background: var(--xv-bg);
    color: var(--xv-text);
}

/* Channel card (watch + profile) */
.xh-channel {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    margin: 0 0 14px;
    background: #f7f7f7;
    border: 1px solid var(--xv-border);
    border-radius: 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.xh-channel:hover {
    background: #f2f2f2;
    border-color: #ddd;
}

.xh-channel--compact {
    margin: 0 0 16px;
    padding: 12px 14px;
}

.xh-channel--watch {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.xh-channel--watch:hover {
    background: transparent;
    border-color: transparent;
}

.xh-channel--watch .xh-channel__avatar,
.xh-channel--watch .xh-channel__avatar--img {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border: none;
    box-shadow: none;
}

.xh-channel--watch .xh-channel__name {
    font-size: 14px;
}

.xh-channel--watch .xh-channel__subs {
    font-size: 11px;
}

.xh-channel__subs {
    font-size: 12px;
    color: var(--xv-dim);
    font-weight: 500;
    line-height: 1.3;
}

.xh-channel__avatar-link {
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}

.xh-channel__avatar,
.xh-channel__avatar--img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--xv-red), #ff6b35);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--xv-white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.xh-channel__avatar--img {
    object-fit: cover;
    background: #ddd;
}

.xh-channel__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.xh-channel__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--xv-text);
    display: inline-block;
    line-height: 1.35;
    width: fit-content;
    max-width: 100%;
    text-decoration: none;
}

.xh-channel__name:hover {
    color: var(--xv-red);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.xh-channel__handle {
    font-size: 12px;
    color: var(--xv-dim);
    display: block;
    line-height: 1.3;
}

.xh-channel__handle--site {
    color: var(--xv-muted);
    font-weight: 500;
}

.xh-channel__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--xv-dim);
    margin-top: 6px;
}

.xh-channel__bio {
    font-size: 13px;
    color: var(--xv-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* Public user profile page */
.xh-user-page .xh-page {
    max-width: var(--xv-max);
    margin: 0 auto;
    padding: 0 16px 40px;
}

.xh-user-hero {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 12px;
    margin: 16px 0 20px;
    overflow: hidden;
}

.xh-user-hero__inner {
    display: flex;
    gap: 20px;
    padding: 24px 20px;
    align-items: flex-start;
}

.xh-user-hero__avatar,
.xh-user-hero__avatar--img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--xv-red), #ff6b35);
    color: #fff;
    font-size: 36px;
    font-weight: 700;
}

.xh-user-hero__avatar--img {
    object-fit: cover;
    background: #ddd;
}

.xh-user-hero__name {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.xh-user-hero__handle {
    font-size: 14px;
    color: var(--xv-dim);
    margin: 0 0 10px;
}

.xh-user-hero__bio {
    font-size: 14px;
    color: var(--xv-muted);
    line-height: 1.6;
    margin: 0 0 12px;
}

.xh-user-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    color: var(--xv-dim);
    margin-bottom: 14px;
}

.xh-user-hero__stats strong {
    color: var(--xv-text);
    font-weight: 700;
}

.xh-user-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.xh-user-videos__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.xh-user-videos__head h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.xh-user-videos__count {
    font-size: 12px;
    color: var(--xv-dim);
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    padding: 4px 10px;
    border-radius: 999px;
}

.xh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.xh-pagination__info {
    font-size: 13px;
    color: var(--xv-dim);
}

@media (max-width: 640px) {
    .xh-user-hero__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px;
    }

    .xh-user-hero__actions {
        justify-content: center;
    }
}

/* User dashboard */
.xh-user-dash-body {
    background: var(--xv-bg);
}

.xh-user-dash {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

.xh-user-dash__layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.xh-user-dash__sidebar {
    position: sticky;
    top: calc(56px + var(--xv-nav-h) + 16px);
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 12px;
    padding: 16px 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.xh-user-dash__profile-mini {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 4px 8px 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--xv-border);
}

.xh-user-dash__profile-mini strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
}

.xh-user-dash__profile-mini span {
    font-size: 12px;
    color: var(--xv-dim);
}

.xh-user-dash__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--xv-red), #ff6b35);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.xh-user-dash__avatar--img {
    object-fit: cover;
    background: #ddd;
}

.xh-user-dash__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xh-user-dash__nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--xv-text);
}

.xh-user-dash__nav-link:hover {
    background: var(--xv-bg);
    color: var(--xv-red);
}

.xh-user-dash__nav-link.is-active {
    background: var(--xv-red-soft);
    color: var(--xv-red);
    font-weight: 600;
}

.xh-user-dash__nav-link--muted {
    color: var(--xv-dim);
    margin-top: 8px;
    border-top: 1px solid var(--xv-border);
    border-radius: 0;
    padding-top: 14px;
}

.xh-user-dash__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.xh-user-dash__header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
}

.xh-user-dash__header p {
    margin: 0;
    font-size: 14px;
    color: var(--xv-dim);
}

.xh-user-dash__stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.xh-dash-stat {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}

.xh-dash-stat__value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--xv-text);
    line-height: 1.2;
}

.xh-dash-stat__label {
    display: block;
    font-size: 11px;
    color: var(--xv-dim);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.xh-user-dash__panel {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 12px;
    padding: 18px 16px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.xh-user-dash__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--xv-border);
}

.xh-user-dash__panel-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.xh-user-dash__panel-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--xv-red);
}

.xh-user-dash__empty {
    text-align: center;
    padding: 40px 20px;
}

.xh-user-dash__empty h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.xh-user-dash__empty p {
    margin: 0 0 16px;
    color: var(--xv-dim);
}

.xh-dash-video-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xh-dash-video {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--xv-border);
    border-radius: 10px;
    background: #fafafa;
}

.xh-dash-video__thumb {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #ddd;
}

.xh-dash-video__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xh-dash-video__duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 2;
}

.xh-dash-video__quality {
    top: 6px;
    left: 6px;
    font-size: 9px;
    padding: 2px 5px;
}

.xh-dash-video__body h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.35;
}

.xh-dash-video__body h3 a:hover {
    color: var(--xv-red);
}

.xh-dash-video__meta {
    font-size: 12px;
    color: var(--xv-dim);
    margin-bottom: 8px;
}

.xh-dash-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.xh-dash-badge--live { background: #e8f5e9; color: #2e7d32; }
.xh-dash-badge--pending { background: #fff8e1; color: #f57f17; }
.xh-dash-badge--rejected { background: #ffebee; color: #c62828; }
.xh-dash-badge--muted { background: #f0f0f0; color: #666; }

.xh-dash-video__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.xh-btn--sm {
    padding: 7px 14px;
    font-size: 12px;
}

.xh-btn--danger {
    background: #fff;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.xh-btn--danger:hover {
    background: #ffebee;
    color: #b71c1c;
}

.xh-user-dash__pagination {
    margin-top: 20px;
}

.xh-user-dash__foot {
    margin-top: 16px;
    font-size: 12px;
    color: var(--xv-dim);
    text-align: right;
}

@media (max-width: 900px) {
    .xh-user-dash__layout {
        grid-template-columns: 1fr;
    }

    .xh-user-dash__sidebar {
        position: static;
    }

    .xh-user-dash__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .xh-dash-video {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .xh-dash-video__actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .xh-dash-video {
        grid-template-columns: 1fr;
    }

    .xh-dash-video__thumb {
        max-width: 100%;
    }
}

/* My videos */
.xm-my-videos {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 12px 48px;
}

.xm-my-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.xm-my-head h1 { font-size: 20px; font-weight: 700; }

.xm-my-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    margin-bottom: 10px;
}

.xm-my-thumb {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 16/9;
    border-radius: var(--xv-radius);
    overflow: hidden;
    background: #ccc;
}

.xm-my-thumb img { width: 100%; height: 100%; object-fit: cover; }

.xm-my-info { flex: 1; min-width: 0; }
.xm-my-info h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.xm-my-info h3 a:hover { color: var(--xv-red); }
.xm-my-meta { font-size: 12px; color: var(--xv-dim); }

.xm-my-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.xm-my-actions form { display: inline; }

.xm-empty {
    text-align: center;
    padding: 40px 20px;
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    color: var(--xv-muted);
}

.xm-empty a { color: var(--xv-red); font-weight: 600; }

/* ---- Upload ---- */
.sh-upload-main {
    padding: 16px 12px 48px !important;
}

.sh-upload-wrap,
.yt-upload-container {
    max-width: 820px;
    margin: 0 auto;
}

.sh-upload-card,
.yt-upload-card {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    padding: 24px 20px;
    box-shadow: var(--xv-shadow);
}

.sh-upload-header h1,
.yt-upload-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 8px 0 4px;
}

.sh-upload-header p,
.yt-upload-header p {
    font-size: 13px;
    color: var(--xv-muted);
    margin-bottom: 20px;
}

.sh-upload-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--xv-red);
    background: var(--xv-red-soft);
    padding: 3px 8px;
    border-radius: 3px;
}

.sh-upload-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .sh-upload-layout { flex-direction: row; }
    .sh-upload-col { flex: 1; }
}

.sh-dropzone,
.yt-upload-dropzone {
    border: 2px dashed var(--xv-border);
    border-radius: var(--xv-radius);
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--xv-bg);
}

.sh-dropzone:hover,
.sh-dropzone.is-dragover {
    border-color: var(--xv-red);
    background: var(--xv-red-soft);
}

.sh-dropzone.has-file { border-color: var(--xv-red); border-style: solid; }

.sh-upload-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
}

.sh-upload-form input[type="text"],
.sh-upload-form input[type="file"],
.sh-upload-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    margin-bottom: 14px;
    outline: none;
}

.sh-upload-form input:focus,
.sh-upload-form textarea:focus {
    border-color: var(--xv-red);
}

.sh-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--xv-red);
    color: #fff;
    border: none;
    border-radius: var(--xv-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sh-submit-btn:hover { background: var(--xv-red-hover); }

/* ---- Static pages ---- */
.xh-static-main {
    padding: 20px 16px 48px;
    background: var(--xv-bg);
}

.xh-static-wrap {
    max-width: 760px;
    margin: 0 auto;
}

.xh-static-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--xv-dim);
    line-height: 1.4;
}

.xh-static-breadcrumb a {
    color: var(--xv-dim);
    font-weight: 500;
    text-decoration: none;
}

.xh-static-breadcrumb a:hover {
    color: var(--xv-red);
}

.xh-static-breadcrumb__sep {
    color: var(--xv-border);
    font-size: 12px;
}

.xh-static-breadcrumb [aria-current="page"] {
    color: var(--xv-text);
    font-weight: 600;
}

.xh-static-card {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.xh-static-card__head {
    padding: 24px 22px 18px;
    border-bottom: 1px solid var(--xv-border);
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.xh-static-card__title {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--xv-text);
    margin: 0 0 8px;
}

.xh-static-card__meta {
    margin: 0;
    font-size: 13px;
    color: var(--xv-dim);
    font-weight: 500;
}

.xh-static-card__body {
    padding: 22px 22px 28px;
}

.static-page-content {
    font-size: 15px;
    line-height: 1.75;
    color: var(--xv-text);
    word-wrap: break-word;
}

.static-page-content > *:first-child {
    margin-top: 0;
}

.static-page-content h2,
.static-page-content h3,
.static-page-content h4 {
    margin: 1.5em 0 0.6em;
    font-weight: 700;
    line-height: 1.35;
    color: var(--xv-text);
}

.static-page-content h2 { font-size: 1.35em; }
.static-page-content h3 { font-size: 1.15em; }

.static-page-content a {
    color: var(--xv-red);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.static-page-content a:hover {
    color: var(--xv-red-hover);
}

.static-page-content p {
    margin: 0 0 1em;
}

.static-page-content ul,
.static-page-content ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

.static-page-content li {
    margin-bottom: 0.35em;
}

.static-page-content blockquote {
    margin: 1.2em 0;
    padding: 12px 16px;
    border-left: 3px solid var(--xv-red);
    background: var(--xv-red-soft);
    border-radius: 0 8px 8px 0;
    color: var(--xv-muted);
}

.static-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

.static-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 14px;
}

.static-page-content th,
.static-page-content td {
    border: 1px solid var(--xv-border);
    padding: 8px 10px;
    text-align: left;
}

.static-page-content th {
    background: #f7f7f7;
    font-weight: 600;
}

.xh-static-empty {
    text-align: center;
    padding: 56px 24px;
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.xh-static-empty__code {
    display: block;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    color: var(--xv-red);
    margin-bottom: 12px;
    opacity: 0.9;
}

.xh-static-empty h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}

.xh-static-empty p {
    margin: 0 0 20px;
    color: var(--xv-dim);
    font-size: 14px;
}

.xh-static-empty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border-radius: 999px;
}

@media (min-width: 768px) {
    .xh-static-main {
        padding: 28px 20px 56px;
    }

    .xh-static-breadcrumb {
        margin-bottom: 20px;
    }

    .xh-static-card__head {
        padding: 28px 32px 22px;
    }

    .xh-static-card__body {
        padding: 28px 32px 36px;
    }
}

/* Legacy aliases */
.static-page { padding: 16px 12px 48px; }
.static-page-container { max-width: 820px; margin: 0 auto; }
.static-page-card {
    background: var(--xv-white);
    border: 1px solid var(--xv-border);
    border-radius: 8px;
    padding: 24px 20px;
}
.static-page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--xv-border);
}
.xm-empty.static-page-empty { text-align: center; padding: 48px 20px; }
.xm-empty.static-page-empty h1 { font-size: 48px; color: var(--xv-red); margin-bottom: 8px; }

/* ---- Footer ---- */
.site-footer,
.xh-footer {
    background: var(--xv-nav);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 24px;
    padding: 32px 16px 20px;
}

.xh-footer__inner {
    max-width: var(--xv-max);
    margin: 0 auto;
}

.xh-footer__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .xh-footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

.xh-footer__brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 8px;
}

.xh-footer__brand:hover { color: var(--xv-red); }

.xh-footer__tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

.xh-footer__heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.xh-footer__links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.xh-footer__links a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.xh-footer__links a:hover { color: var(--xv-red); }

.xh-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.xh-footer__copy,
.xh-footer__legal {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    line-height: 1.5;
}

/* ---- Buttons & utilities ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--xv-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
    background: var(--xv-red);
    color: #fff;
    border-color: var(--xv-red);
}

.btn-primary:hover { background: var(--xv-red-hover); border-color: var(--xv-red-hover); }

.btn-outline,
.btn-load-more,
.xh-btn--outline {
    background: var(--xv-white);
    color: var(--xv-text);
    border-color: var(--xv-border);
}

.btn-outline:hover:not(:disabled),
.btn-load-more:hover:not(:disabled) {
    border-color: var(--xv-red);
    color: var(--xv-red);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-danger {
    background: #c62828;
    color: #fff;
    border-color: #c62828;
}

.btn-danger:hover { background: #b71c1c; border-color: #b71c1c; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff8e1; color: #f57f17; }
.badge-muted { background: #f0f0f0; color: #757575; }

.alert {
    padding: 10px 14px;
    border-radius: var(--xv-radius);
    font-size: 13px;
    margin-bottom: 14px;
}

.alert-error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--xv-nav);
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    z-index: 700;
    opacity: 0;
    transition: transform 0.3s var(--xv-ease), opacity 0.3s var(--xv-ease);
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error { background: #c62828; }

.player-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--xv-border);
    border-top-color: var(--xv-red);
    border-radius: 50%;
    animation: xvSpin 0.7s linear infinite;
}

@keyframes xvSpin { to { transform: rotate(360deg); } }

.pagination,
.xm-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border: 1px solid var(--xv-border);
    border-radius: var(--xv-radius);
    font-size: 13px;
    background: var(--xv-white);
}

.pagination a:hover { border-color: var(--xv-red); color: var(--xv-red); }

.pagination .current {
    background: var(--xv-red);
    color: #fff;
    border-color: var(--xv-red);
}

/* ---- Desktop header & layouts ---- */
@media (min-width: 1024px) {
    :root {
        --xv-top-height: 56px;
    }

    .xh-top__inner {
        grid-template-columns: auto minmax(320px, 1fr) auto;
        padding: 0 20px;
        height: 56px;
        gap: 20px;
    }

    .xh-logo--center {
        grid-column: 1;
        justify-self: start;
    }

    .xh-logo__img {
        height: 36px;
    }

    .xh-search--bar {
        display: block !important;
        grid-column: 2;
        position: static;
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        max-width: 640px;
        width: 100%;
        justify-self: center;
    }

    .xh-search__wrap {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .xh-search__input {
        color: #fff;
    }

    .xh-nav__inner {
        padding: 0 20px;
    }

    .xh-nav__link {
        padding: 0 18px;
        font-size: 14px;
    }

    .xh-content {
        padding: 0 20px 40px;
    }

    .xm-stories {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .watch-page {
        padding: 0 20px 40px;
    }

    .watch-grid {
        display: grid;
        grid-template-columns: 1fr 380px;
        grid-template-rows: auto auto auto;
        gap: 20px;
        align-items: start;
    }

    .watch-grid__player {
        grid-column: 1;
        grid-row: 1;
        margin-top: 16px;
    }

    .watch-grid__player .player-wrapper,
    .watch-grid__player .yt-player {
        border-radius: 6px;
    }

    .watch-grid__details {
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        padding: 0;
    }

    .watch-grid__sidebar {
        grid-column: 2;
        grid-row: 1 / span 3;
        margin-top: 16px;
        padding: 0;
        position: sticky;
        top: calc(56px + var(--xv-nav-h) + 16px);
        max-height: calc(100vh - 56px - var(--xv-nav-h) - 32px);
        overflow-y: auto;
    }

    .watch-grid__comments {
        grid-column: 1;
        grid-row: 3;
        margin-top: 0;
        padding: 0;
    }

    .watch-engage {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--xv-border);
    }

    .watch-engage__channel {
        flex: 1;
        min-width: 0;
        padding: 0;
        border: none;
    }

    .watch-engage__actions {
        flex: 0 1 auto;
        padding: 0;
        margin: 0;
        border-top: none;
        max-width: 60%;
    }

    .watch-engage .watch-actions-bar {
        flex-wrap: wrap;
        overflow-x: visible;
        justify-content: flex-end;
    }

    .watch-action-btn,
    .watch-actions-bar .yt-action-pill,
    .watch-actions-bar .action-btn,
    .watch-actions-bar .action-download {
        min-height: 36px;
        min-width: 40px;
        padding: 0 12px;
    }

    .yt-related-thumb {
        width: 168px;
    }

    .xm-sort-sheet__panel {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (min-width: 1200px) {
    .watch-grid {
        grid-template-columns: 1fr 420px;
    }

    .xh-feed-grid,
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1400px) {
    .xh-feed-grid,
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .watch-grid {
        grid-template-columns: 1fr 440px;
    }
}
