/* ==========================================================================
   FILE: tiktok-videos.css
   ROLE: tiktok
   TikTok feed and grid pages: video cards, grids, header offsets and the
   shared media tiles.
   Loaded on: /videos/, /latest-videos/, /onlyfans-videos/, /realgirls-videos/,
   /video/<jid>, /tag/<name>, /tags/, /flair/<name>, /u/<name>.
   ========================================================================== */

/* Design: see new-design-php/docs/design-system.md + page-patterns.md */
/* ==========================================================================
   HOTPIC — /videos/ (TikTok-style feed) — new design
   Loaded by tiktok/head.php after pages.css. Restyles the existing feed
   markup without changing its JS/layout behaviour.
   ========================================================================== */

/* ---------- sponsored promo strip ---------- */
.hp-promo-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(var(--hp-color-overlay-mid-rgb), 0.92), rgba(var(--hp-color-overlay-bottom-rgb), 0.92));
    border-bottom: 1px solid rgba(var(--hp-color-white-rgb), 0.08);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
}

.hp-promo-bar:hover {
    background: linear-gradient(180deg, rgba(var(--hp-color-overlay-strong-rgb), 0.94), rgba(var(--hp-color-overlay-bottom-rgb), 0.94));
}

.hp-promo-cta {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--hp-color-accent) 0%, var(--hp-color-accent-mid) 48%, var(--hp-color-accent-deep) 100%);
    color: var(--hp-color-white);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(var(--hp-color-accent-deep-rgb), 0.3);
}

.hp-promo-bar:hover .hp-promo-cta {
    box-shadow: 0 8px 20px rgba(var(--hp-color-accent-deep-rgb), 0.45);
}

.hp-promo-text {
    color: rgba(var(--hp-color-white-rgb), 0.68);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* ---------- floating filter row ---------- */
.header .header__topbar {
    gap: 10px;
    padding: 4px 10px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    padding: 7px 14px !important;
    border-radius: 999px !important;
    border: 1px solid var(--hp-color-border) !important;
    background: rgba(var(--hp-color-white-rgb), 0.05) !important;
    color: var(--hp-color-white) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(var(--hp-color-white-rgb), 0.08);
}

.filter-btn:hover,
.filter-btn:focus {
    background: var(--hp-color-border-soft) !important;
    border-color: rgba(var(--hp-color-white-rgb), 0.2) !important;
    color: var(--hp-color-white) !important;
}

.filter-btn img {
    width: 15px !important;
    height: 15px !important;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.filter-btn .menu-text {
    font-size: 13px;
    font-weight: 600;
}

.filter-btn::after {
    margin-left: 6px;
    border-top-color: rgba(var(--hp-color-white-rgb), 0.7);
}

.simple-menu {
    min-width: 180px;
    margin-top: 6px !important;
    padding: 8px !important;
    border-radius: 16px !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-top-rgb), 0.78) 0%,
            rgba(var(--hp-color-overlay-mid-rgb), 0.88) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.94) 100%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%);
    backdrop-filter: blur(28px) saturate(135%);
    box-shadow: 0 18px 48px rgba(var(--hp-color-black-rgb), 0.45) !important;
}

.simple-menu .dropdown-item,
.simple-menu .menu-text {
    padding: 9px 12px !important;
    border-radius: 9px !important;
    color: rgba(var(--hp-color-white-rgb), 0.7) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: transparent !important;
}

.simple-menu .dropdown-item:hover,
.simple-menu .dropdown-item:focus {
    background: rgba(var(--hp-color-accent-rgb), 0.16) !important;
    color: var(--hp-color-white) !important;
}

/* kill the old red hover filter from the header inline styles */
.nav_hover:hover {
    filter: none !important;
}

/* ---------- feed stage ---------- */
.hp-videos-list {
    background: var(--hp-color-black);
}

.hp-video-card {
    background: var(--hp-color-black);
}

/* fullscreen button — same circular badge treatment as the action rail icon
   (44px, rgba black .42, white icon). `position` is what makes the top/right
   offsets land top-right of the video. */
.fullscreen-button {
    position: absolute;
    top: 12px !important;
    right: 12px !important;
    /* above the ad click-overlay (z 1001) injected by the page ad script */
    z-index: 1002 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.12) !important;
    background: rgba(var(--hp-color-black-rgb), 0.42) !important;
    -webkit-backdrop-filter: blur(6px) saturate(130%);
    backdrop-filter: blur(6px) saturate(130%);
    color: var(--hp-color-white);
}

.fullscreen-icon {
    width: 23px !important;
    height: 23px !important;
    color: var(--hp-color-white);
    opacity: 1;
}

/* progress line — violet.
   Must be the positioned 3px track: the ::after fill is inset:0 + width:var(--progress),
   so without this it resolves against .hp-video-card__stage and floods the whole video. */
.progress-bar-line {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px !important;
    background: rgba(var(--hp-color-white-rgb), 0.16) !important;
}

.progress-bar-line::after {
    content: "";
    position: absolute;
    inset: 0;
    right: auto;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--hp-color-accent), var(--hp-color-accent-soft));
    border-radius: 999px;
}

/* loading spinner — the markup element is an empty div, so the whole visual is
   CSS (no icon file; /assets/img/icons/loading.svg that the legacy sheet used is
   not shipped). Centred with inset/margin, not transform, because the shared
   spinner-border keyframes rotate via `transform` and would cancel a translate(). */
.loading-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 2;
    width: 56px;
    height: 56px;
    box-sizing: border-box;
    border: 3px solid rgba(var(--hp-color-white-rgb), 0.24);
    border-top-color: var(--hp-color-white);
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

/* pagination.js toggles these: `hide` once the video plays, `show` again while it
   re-buffers. `hide` is never removed, so show must win when both are present. */
.loading-icon.hide {
    display: none !important;
}

.loading-icon.show {
    display: block !important;
}

/* paused state: centred circular play badge (the legacy sheet's data-URI glyph
   was malformed and never loaded, leaving an empty box) */
.pause_icon {
    position: absolute !important;
    inset: 0 !important;
    margin: auto !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    /* hidden by default — JS adds .is-visible while the video is paused */
    display: none;
    place-items: center;
    width: 68px;
    height: 68px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.14);
    background: rgba(var(--hp-color-black-rgb), 0.42);
    -webkit-backdrop-filter: blur(6px) saturate(130%);
    backdrop-filter: blur(6px) saturate(130%);
    background-image: none !important;
    filter: none !important;
    opacity: 1;
    z-index: 3;
    pointer-events: none;
}

.pause_icon svg {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    color: var(--hp-color-white) !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-left: 3px; /* optical centring of the triangle */
}

.pause_icon svg path {
    fill: none !important;
    stroke: currentColor !important;
}

.pause_icon.is-visible {
    display: grid;
}

/* the fixed bottom nav covers the lower part of the feed, so the paused
   badge is centred in the visible video area on phones, not the full card */
@media screen and (max-width: 767px) {
    .pause_icon {
        bottom: var(--hp-nav-height, 64px) !important;
    }
}

/* ---------- overlay ---------- */
.hp-video-overlay__content {
    padding: 3.2rem 1rem 1.1rem !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-black-rgb), 0) 0%,
            rgba(var(--hp-color-black-rgb), 0.35) 38%,
            rgba(var(--hp-color-black-rgb), 0.78) 100%);
}

.hp-video-overlay__title {
    font-size: 14.5px !important;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 10px rgba(var(--hp-color-black-rgb), 0.6);
}

.hp-video-overlay__title a {
    color: var(--hp-color-white) !important;
    text-decoration: none;
}

.hp-video-overlay__user {
    margin-top: 6px;
}

.hp-video-overlay__user a {
    color: var(--hp-color-accent-soft) !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

/* tag chips — .hp-tags is the stable hook on the wrapper (PHP cards + the AJAX
   cards built by tiktok/pagination.js); the .row .col chain is kept for
   templates that do not carry the hook yet */
.hp-video-overlay__content .row .col a,
.hp-video-overlay__content .hp-tags a {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 9px !important;
    margin: 0 6px 6px 0 !important;
    border-radius: 999px !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    background: rgba(var(--hp-color-white-rgb), 0.08) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgba(var(--hp-color-white-rgb), 0.82) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.hp-video-overlay__content .row .col a:hover,
.hp-video-overlay__content .hp-tags a:hover {
    background: rgba(var(--hp-color-accent-rgb), 0.22) !important;
    border-color: rgba(var(--hp-color-accent-rgb), 0.45) !important;
    color: var(--hp-color-white) !important;
}

.hp-video-overlay__content .row .col a img,
.hp-video-overlay__content .hp-tags a img {
    width: 11px !important;
    height: 11px !important;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* page-1 PHP cards draw the chip's hash icon as an inline hp_icon SVG (18px
   attribute), which `a img` cannot reach; size it to match. The SVG strokes
   with currentColor, so it takes the chip colour — no invert filter needed. */
.hp-video-overlay__content .row .col a svg,
.hp-video-overlay__content .hp-tags a svg {
    width: 11px !important;
    height: 11px !important;
}

/* tag chips row: one swipeable line (same pattern as the feed/photo cards) */
.hp-video-overlay__content .hp-tags.row {
    flex-wrap: nowrap !important;
    overflow: hidden;
}

.hp-video-overlay__content .hp-tags .col {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
}

.hp-video-overlay__content .hp-tags .col::-webkit-scrollbar {
    display: none;
}

.hp-video-overlay__content .hp-tags a {
    flex: 0 0 auto;
}

/* video counter top-left */
.hp-video-overlay .position-absolute.top-0.start-0 > div {
    padding: 5px 11px !important;
    border-radius: 999px !important;
    border: 1px solid var(--hp-color-border-strong) !important;
    background: rgba(var(--hp-color-canvas-rgb), 0.5) !important;
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    font-size: 10.5px !important;
    letter-spacing: 0.02em;
}

/* ---------- action rail (right-side buttons) ----------
   YouTube-Shorts style: each action is a dark translucent circle with the icon
   inside and its label underneath. The rail sits above the tag row so the last
   action (share) is never hidden behind the chips. */
.hp-action-rail {
    position: absolute !important;
    top: auto !important;
    right: 8px !important;
    bottom: calc(var(--hp-nav-height, 64px) + 78px) !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    overflow: visible !important;
    z-index: 3;
}

/* one action = circle + label underneath */
.hp-action-rail .hp-action-rail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 !important;
    cursor: pointer;
    background: none;
}

/* the circular badge */
.hp-action-rail__icon,
.share-button a {
    display: grid !important;
    place-items: center;
    width: 44px !important;
    height: 44px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.12) !important;
    border-radius: 50% !important;
    background: rgba(var(--hp-color-black-rgb), 0.42) !important;
    -webkit-backdrop-filter: blur(6px) saturate(130%);
    backdrop-filter: blur(6px) saturate(130%);
    box-shadow: none !important;
    color: var(--hp-color-white);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* icons: white, crisp on the circle */
.hp-action-rail__icon img,
.share-button a img {
    display: block !important;
    width: 23px !important;
    height: 23px !important;
    filter: brightness(0) invert(1);
    opacity: 1;
}

.hp-action-rail__icon svg,
.share-button a svg {
    display: block !important;
    width: 23px !important;
    height: 23px !important;
    color: var(--hp-color-white);
    opacity: 1;
    filter: none;
}

.share-button a {
    color: var(--hp-color-white);
}

/* optical size matching inside the circle */
.hp-action-rail__icon.mute-button svg {
    width: 24px !important;
    height: 24px !important;
}

.share-button a svg {
    width: 24px !important;
    height: 24px !important;
}

/* label / count under the circle */
.hp-action-rail__count {
    margin-top: 0 !important;
    color: var(--hp-color-white) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(var(--hp-color-black-rgb), 0.85);
}

/* share is icon-only in the markup — give it the same label */
.share-button .hp-action-rail__count {
    margin-top: 0 !important;
    line-height: 0 !important;
}

.hp-action-rail .share-button::after {
    content: "Share";
    color: var(--hp-color-white);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 1px 3px rgba(var(--hp-color-black-rgb), 0.85);
}

/* hover / press */
@media (hover: hover) {
    .hp-action-rail__icon:hover,
    .share-button a:hover {
        background: rgba(var(--hp-color-black-rgb), 0.58) !important;
        border-color: rgba(var(--hp-color-white-rgb), 0.22) !important;
    }
}

.hp-action-rail__icon:active,
.share-button a:active {
    transform: scale(0.94);
}

/* liked state: red heart like Shorts, no filled circle */
.like-btn.liked svg,
.like-btn.is-liked svg,
.like-btn.liked img,
.like-btn.is-liked img {
    color: var(--hp-color-accent) !important;
    filter: drop-shadow(0 1px 2px rgba(var(--hp-color-black-rgb), 0.5));
    opacity: 1 !important;
}

.share-button a:focus-visible,
.hp-action-rail__icon:focus-visible {
    outline: 2px solid var(--hp-color-accent);
    outline-offset: 3px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    .hp-action-rail__icon,
    .share-button a {
        transition: none;
    }
}

/* desktop: floating glass bottom nav instead of the legacy full-width bar */

/* desktop filter row: shrink to content instead of a full-width bar */
@media screen and (min-width: 768px) {
    .header .header__topbar {
        width: fit-content;
        min-width: 0;
        padding: 6px 14px;
    }
}
/* desktop: keep the video inside the centered column (fixes the split look) */
@media screen and (min-width: 768px) {
    .hp-video-card .hp-video-card__stage {
        width: 100%;
        height: 100%;
    }

    .hp-video-card .hp-video-card__video {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }

    .hp-video-card .hp-media-thumb {
        opacity: 0.35;
    }
}
/* ==========================================================================
   /videos/ bottom nav — the main mobile footer menu, shown on ALL widths
   (Albums · Photos · Upload FAB · Videos · Search)
   ========================================================================== */
.hp-videos-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin-inline: auto;
    width: 100%;
    max-width: 30rem;
    height: auto;
    padding: 0 16px max(10px, env(safe-area-inset-bottom));
    display: block;
    pointer-events: none;
    background: none;
    border: 0;
    box-shadow: none;
    z-index: 1030;
}

.hp-videos-bottom::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(7.25rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(transparent 0%,
            rgba(var(--hp-color-black-rgb), 0.62) 48%,
            rgba(var(--hp-color-black-rgb), 0.92) 100%);
    pointer-events: none;
    z-index: 0;
}

.hp-videos-bottom .nav__list {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    margin: 0;
    padding: 4px 8px;
    min-height: 64px;
    border-radius: 27px;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-top-rgb), 0.66) 0%,
            rgba(var(--hp-color-overlay-mid-rgb), 0.76) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.84) 100%);
    -webkit-backdrop-filter: blur(28px) saturate(135%);
    backdrop-filter: blur(28px) saturate(135%);
    border: 1px solid var(--hp-color-border-on-glass);
    box-shadow: 0 18px 48px rgba(var(--hp-color-black-rgb), 0.42);
    pointer-events: auto;
    isolation: isolate;
    overflow: visible;
    column-gap: 0;
}

.hp-videos-bottom .nav__item {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.hp-videos-bottom .nav__item--albums { order: 1; }
.hp-videos-bottom .nav__item--photos { order: 2; }
.hp-videos-bottom .nav__item--upload { order: 3; }
.hp-videos-bottom .nav__item--videos { order: 4; }
.hp-videos-bottom .nav__item--search { order: 5; }

.hp-videos-bottom .nav__link {
    position: relative;
    top: -2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    max-width: 4.5rem;
    min-height: 56px;
    min-width: 0;
    margin: 0 auto;
    padding: 0 2px;
    border-radius: 16px;
    color: rgba(var(--hp-color-white-rgb), 0.4);
    text-decoration: none;
}

.hp-videos-bottom .nav__link img {
    display: block;
    box-sizing: content-box;
    width: 24px;
    height: 24px;
    padding: 4px 0;
    filter: brightness(0) invert(1);
    opacity: 0.4;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

/* inline SVG icons (hp_icon) — the /videos/ bottom nav is visible at every width,
   so it must override chrome.css's desktop rule that hides .nav__icon in the
   site header nav */
.hp-videos-bottom .nav__list .nav__link .hp-icon {
    display: block !important;
    box-sizing: content-box;
    width: 24px;
    height: 24px;
    padding: 4px 0;
    color: var(--hp-color-white);
    opacity: 0.4;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.hp-videos-bottom .nav__list .nav__item.is-active > .nav__link .hp-icon {
    opacity: 1;
}

.hp-videos-bottom .nav__list .nav__item--upload .nav__link .hp-icon {
    position: absolute;
    top: 4px;
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    padding: 0;
    box-sizing: border-box;
    opacity: 1;
    z-index: 1;
}

.hp-videos-bottom .nav__name {
    display: block;
    max-width: 100%;
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-videos-bottom .nav__item.is-active > .nav__link {
    color: var(--hp-color-white);
}

.hp-videos-bottom .nav__item.is-active > .nav__link img {
    opacity: 1;
}

.hp-videos-bottom .nav__thumb {
    display: none;
}

/* upload FAB in the centre slot */
.hp-videos-bottom .nav__item--upload .nav__link {
    gap: 0;
    padding: 0;
}

.hp-videos-bottom .nav__item--upload .nav__link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -10px);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--hp-color-accent) 0%, var(--hp-color-accent-mid) 48%, var(--hp-color-accent-deep) 100%);
    box-shadow:
        0 4px 8px rgba(var(--hp-color-black-rgb), 0.28),
        0 10px 22px rgba(var(--hp-color-accent-deep-rgb), 0.22),
        0 18px 36px rgba(var(--hp-color-accent-rgb), 0.12);
}

.hp-videos-bottom .nav__item--upload .nav__link img {
    position: absolute;
    top: 4px;
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    padding: 0;
    box-sizing: border-box;
    opacity: 1;
    z-index: 1;
}

.hp-videos-bottom .nav__item--upload .nav__name {
    display: none;
}

@media screen and (min-width: 768px) {
    .hp-videos-bottom {
        max-width: 26rem;
        bottom: 14px;
        padding: 0 8px;
    }

    .hp-videos-bottom .nav__list {
        min-height: 60px;
    }
}

/* keep the video text/tags above the floating nav */
.hp-video-overlay__content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}

/* compact, solid filter pill */
.header .header__topbar {
    min-height: 44px !important;
    padding: 4px 8px !important;
}

.filter-btn {
    height: 36px;
    padding: 0 14px !important;
    background: rgba(var(--hp-color-canvas-rgb), 0.62) !important;
    border: 1px solid var(--hp-color-border-strong) !important;
}
/* ---------- desktop: app-like centered feed column ---------- */
@media screen and (min-width: 768px) {
    .header .header__topbar {
        position: relative;
        isolation: isolate;
        max-width: 860px;
        margin: 10px auto 0;
        padding: 6px 12px;
        border-radius: 999px;
    }

    .header .header__topbar::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 999px;
        background: linear-gradient(180deg,
                rgba(var(--hp-color-overlay-top-rgb), 0.72) 0%,
                rgba(var(--hp-color-overlay-mid-rgb), 0.84) 60%,
                rgba(var(--hp-color-overlay-bottom-rgb), 0.92) 100%);
        -webkit-backdrop-filter: blur(28px) saturate(135%);
        backdrop-filter: blur(28px) saturate(135%);
        border: 1px solid var(--hp-color-border-on-glass);
        box-shadow: 0 18px 48px rgba(var(--hp-color-black-rgb), 0.42);
        pointer-events: none;
        z-index: -1;
    }

    .header .header__topbar > * {
        position: relative;
        z-index: 1;
    }

    .hp-video-card {
        width: 100%;
        max-width: 860px;
        margin: 0 auto;
    }

    .hp-video-card .hp-video-overlay__content {
        padding: 4.5rem 1.6rem 1.6rem !important;
    }

    /* the rail is positioned by the shared rule above (right 16px, clears the
       floating bottom nav), so no desktop-specific offset is needed here */

    .hp-video-overlay__title {
        font-size: 16px !important;
        max-width: 26rem;
    }
}
/* force the main mobile nav layout on desktop (desktop chrome rules target the same classes) */
.hp-videos-bottom .nav__list {
    display: grid !important;
}

.hp-videos-bottom .nav__link {
    height: auto !important;
    padding: 0 2px !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.hp-videos-bottom .nav__link img {
    display: block !important;
}

.hp-videos-bottom .nav__item--upload .nav__link::before {
    display: block !important;
}
/* video filter menu — match the main feed filter menu */
.simple-menu.fd-menu {
    min-width: 200px;
    padding: 8px !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-top-rgb), 0.78) 0%,
            rgba(var(--hp-color-overlay-mid-rgb), 0.88) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.94) 100%) !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%);
    backdrop-filter: blur(28px) saturate(135%);
    box-shadow: 0 18px 48px rgba(var(--hp-color-black-rgb), 0.45) !important;
}

.simple-menu.fd-menu .fd-menu__head {
    list-style: none;
    padding: 4px 10px 9px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(var(--hp-color-white-rgb), 0.08);
    color: var(--hp-color-accent-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.simple-menu.fd-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px !important;
    border-radius: 9px !important;
    color: rgba(var(--hp-color-white-rgb), 0.72) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: rgba(var(--hp-color-white-rgb), 0.035) !important;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.06) !important;
    margin-bottom: 6px;
}

.simple-menu.fd-menu li:last-child .dropdown-item {
    margin-bottom: 0;
}

.simple-menu.fd-menu .dropdown-item::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--hp-color-accent-soft-rgb), 0.65);
}

.simple-menu.fd-menu .dropdown-item:hover,
.simple-menu.fd-menu .dropdown-item:focus {
    background: rgba(var(--hp-color-accent-rgb), 0.18) !important;
    border-color: rgba(var(--hp-color-accent-rgb), 0.4) !important;
    color: var(--hp-color-white) !important;
}

/* full-bleed video stage: fill the viewport, header + nav float above it */
html,
body {
    height: 100%;
    overflow: hidden !important;
}

.hp-videos-list {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1 !important;
}

.hp-video-card,
.hp-video-card__stage {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
}

.hp-video-card__video {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
}

.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1040 !important;
    background: transparent !important;
}

.hp-videos-bottom {
    z-index: 1050 !important;
}

/* keep overlay text above the floating nav on desktop too */
.hp-video-card .hp-video-overlay__content {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
}
/* desktop: show the WHOLE video inside the centred column (contain, not crop) —
   the blurred .post_thumbnail backdrop fills the letterbox area */
@media screen and (min-width: 768px) {
    .hp-video-card .hp-video-card__video {
        object-fit: contain !important;
    }

    .hp-video-card .hp-media-thumb {
        opacity: 0.45;
    }
}
/* The floating header row is only a transparent wrapper around the Filter pill, but
   as a fixed element it used to sit on top of the video's top-corner controls (the
   "1/117.8k" counter and the fullscreen button) — they looked dimmed and the
   fullscreen button was not clickable. Make the chrome hit/paint-neutral and keep
   only the real controls interactive. */
.header,
.header .header__topbar,
.header .container {
    pointer-events: none;
}

.header .header__topbar > *,
.header .filter-btn,
.header .simple-menu,
.header .dropdown-menu {
    pointer-events: auto;
}

/* counter + fullscreen: same foreground weight as the Filter pill (they were
   .opacity-75 / very translucent, so they read as if they were behind it) */
.hp-video-overlay > .position-absolute.top-0.start-0 {
    opacity: 1 !important;
}

.hp-video-overlay > .position-absolute.top-0.start-0 > div {
    background: rgba(var(--hp-color-canvas-rgb), 0.62) !important;
    border: 1px solid var(--hp-color-border-strong) !important;
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    color: var(--hp-color-white) !important;
}

/* fullscreen button styling lives with the rail badge block above */
.fullscreen-button .fullscreen-icon {
    opacity: 1;
}

/* header on /videos/: only a centered Filter (no login/account actions) */
.header__actions {
    display: none !important;
}

.header .header__topbar {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: none !important;
    margin: 8px 0 0 !important;
    padding: 0 16px !important;
    min-height: 44px !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

.header .header__topbar::before {
    display: none !important;
}

.header .header__topbar .filter-btn {
    margin: 0 auto !important;
}

/* desktop: same floating mobile footer menu as mobile */
.hp-videos-bottom {
    max-width: 30rem !important;
    bottom: 0 !important;
    padding: 0 16px max(10px, env(safe-area-inset-bottom, 0px)) !important;
}

.hp-videos-bottom .nav__list {
    width: 100% !important;
    min-height: 64px !important;
    padding: 4px 8px !important;
    border-radius: 27px !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-top-rgb), 0.66) 0%,
            rgba(var(--hp-color-overlay-mid-rgb), 0.76) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.84) 100%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%) !important;
    backdrop-filter: blur(28px) saturate(135%) !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    box-shadow: 0 18px 48px rgba(var(--hp-color-black-rgb), 0.42) !important;
}

.hp-videos-bottom .nav__link {
    height: 56px !important;
    min-height: 56px !important;
    max-width: 4.5rem !important;
    gap: 2px !important;
}

.hp-videos-bottom .nav__link img {
    width: 24px !important;
    height: 24px !important;
    padding: 4px 0 !important;
}

.hp-videos-bottom .nav__name {
    font-size: 10px !important;
}

@media screen and (min-width: 768px) {
    .hp-videos-bottom {
        max-width: 30rem !important;
        bottom: 0 !important;
        padding: 0 16px max(10px, env(safe-area-inset-bottom, 0px)) !important;
    }

    .hp-videos-bottom .nav__list {
        min-height: 64px !important;
    }
}
/* transparent nav stage — the glass pill is the only surface (no dark rectangle) */
.hp-videos-bottom {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

@media screen and (min-width: 768px) {
    .hp-videos-bottom::before {
        display: none !important;
    }
}
/* mute/no-audio: the hidden 0x0 volume icon must stay hidden */
.hp-action-rail__icon img[height="0"],
.hp-action-rail__icon img[width="0"] {
    display: none !important;
}

/* upload FAB icon: same as the main footer menu (18px, centred in the 52px circle) */
.hp-videos-bottom .nav__item--upload .nav__link img {
    position: absolute !important;
    top: -3px !important;
    left: calc(50% - 9px) !important;
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* keep the generic 24px icon rule away from the FAB slot */
.hp-videos-bottom .nav__item:not(.nav__item--upload) .nav__link img {
    width: 24px !important;
    height: 24px !important;
    padding: 4px 0 !important;
}
/* hidden 0x0 audio icon (markup uses 0px) */
.hp-action-rail__icon img[height="0px"],
.hp-action-rail__icon img[width="0px"] {
    display: none !important;
}
/* videos filter menu: width under the button + readable dark hover */
.simple-menu.fd-menu {
    min-width: 200px !important;
    margin-top: 0 !important;
}

.filter-btn:hover,
.filter-btn:focus {
    background: rgba(var(--hp-color-surface-rgb), 0.82) !important;
    border-color: rgba(var(--hp-color-white-rgb), 0.24) !important;
    color: var(--hp-color-white) !important;
}
/* filter pill: dark glass so it never washes out over bright video */
.filter-btn {
    background: linear-gradient(180deg, rgba(var(--hp-color-surface-rgb), 0.78) 0%, rgba(var(--hp-color-canvas-rgb), 0.88) 100%) !important;
    border-color: rgba(var(--hp-color-white-rgb), 0.16) !important;
}

.filter-btn:hover,
.filter-btn:focus {
    background: linear-gradient(180deg, rgba(var(--hp-color-overlay-strong-rgb), 0.88) 0%, rgba(var(--hp-color-overlay-bottom-rgb), 0.94) 100%) !important;
    border-color: rgba(var(--hp-color-white-rgb), 0.24) !important;
}
/* compact dropdown for the videos filter */
.simple-menu.fd-menu {
    min-width: 168px !important;
    padding: 6px !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-strong-rgb), 0.96) 0%,
            rgba(var(--hp-color-overlay-soft-rgb), 0.98) 100%) !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    box-shadow: 0 14px 34px rgba(var(--hp-color-black-rgb), 0.45) !important;
}

.simple-menu.fd-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 10px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: rgba(var(--hp-color-white-rgb), 0.78) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.simple-menu.fd-menu .dropdown-item::before {
    content: none !important;
}

.simple-menu.fd-menu .dropdown-item:hover,
.simple-menu.fd-menu .dropdown-item:focus {
    background: rgba(var(--hp-color-white-rgb), 0.08) !important;
    border: 0 !important;
    color: var(--hp-color-white) !important;
}

.simple-menu.fd-menu li + li {
    margin-top: 0;
}
/* shadcn-style dropdown for the videos filter */
.simple-menu.fd-menu {
    min-width: 0 !important;
    width: max-content !important;
    max-width: calc(100vw - 24px) !important;
    padding: 4px !important;
    border-radius: 8px !important;
    background: var(--hp-color-surface-2) !important;
    border: 1px solid var(--hp-color-border) !important;
    box-shadow: 0 10px 30px rgba(var(--hp-color-black-rgb), 0.5) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.simple-menu.fd-menu .dropdown-item {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 8px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: rgba(var(--hp-color-white-rgb), 0.78) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    white-space: nowrap;
}

.simple-menu.fd-menu .dropdown-item:hover,
.simple-menu.fd-menu .dropdown-item:focus {
    background: rgba(var(--hp-color-white-rgb), 0.06) !important;
    color: var(--hp-color-white) !important;
}
/* center the dropdown labels in the trigger-width menu */
.simple-menu.fd-menu .dropdown-item {
    justify-content: center !important;
    text-align: center !important;
    padding: 0 4px !important;
}
/* brand glass styling for the videos dropdown (keeps trigger width + centred labels) */
.simple-menu.fd-menu {
    padding: 5px !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-top-rgb), 0.78) 0%,
            rgba(var(--hp-color-overlay-mid-rgb), 0.88) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.94) 100%) !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%) !important;
    backdrop-filter: blur(28px) saturate(135%) !important;
    box-shadow:
        0 18px 48px rgba(var(--hp-color-black-rgb), 0.45),
        inset 0 1px 0 rgba(var(--hp-color-white-rgb), 0.06) !important;
}

.simple-menu.fd-menu .dropdown-item {
    height: 34px !important;
    border-radius: 9px !important;
    color: rgba(var(--hp-color-white-rgb), 0.72) !important;
    font-weight: 500 !important;
}

.simple-menu.fd-menu .dropdown-item:hover,
.simple-menu.fd-menu .dropdown-item:focus {
    background: linear-gradient(180deg,
            rgba(var(--hp-color-accent-rgb), 0.26) 0%,
            rgba(var(--hp-color-accent-mid-rgb), 0.16) 100%) !important;
    color: var(--hp-color-white) !important;
    box-shadow: inset 0 1px 0 var(--hp-color-border-on-glass);
}
/* filter button glass — matches the nav/modal design */
.filter-btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-top-rgb), 0.66) 0%,
            rgba(var(--hp-color-overlay-mid-rgb), 0.76) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.84) 100%) !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%) !important;
    backdrop-filter: blur(28px) saturate(135%) !important;
    box-shadow:
        inset 0 1px 0 rgba(var(--hp-color-white-rgb), 0.08),
        0 8px 20px rgba(var(--hp-color-black-rgb), 0.25) !important;
    color: var(--hp-color-white) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.filter-btn:hover,
.filter-btn:focus {
    background: linear-gradient(180deg,
            rgba(var(--hp-color-overlay-hover-rgb), 0.80) 0%,
            rgba(var(--hp-color-overlay-strong-rgb), 0.88) 60%,
            rgba(var(--hp-color-overlay-bottom-rgb), 0.94) 100%) !important;
    border-color: rgba(var(--hp-color-white-rgb), 0.22) !important;
    box-shadow:
        inset 0 1px 0 var(--hp-color-border-on-glass),
        0 10px 26px rgba(var(--hp-color-black-rgb), 0.30) !important;
}

.filter-btn:focus-visible {
    outline: 2px solid rgba(var(--hp-color-accent-rgb), 0.6);
    outline-offset: 2px;
}

.filter-btn[aria-expanded="true"] {
    border-color: rgba(var(--hp-color-accent-rgb), 0.45) !important;
    box-shadow:
        inset 0 1px 0 var(--hp-color-border-on-glass),
        0 8px 24px rgba(var(--hp-color-accent-deep-rgb), 0.25) !important;
}

.filter-btn img {
    opacity: 0.85;
    filter: brightness(0) invert(1);
}


/* liked heart: inline hp_icon svg must fill like the old heart-like.svg did */
.like-btn.liked svg.hp-icon,
.like-btn.is-liked svg.hp-icon {
    fill: currentColor;
}

/* semantic tag chip used by the TikTok templates */
.hp-tag-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 4px 9px !important;
    border-radius: 999px !important;
    border: 1px solid var(--hp-color-border-on-glass) !important;
    background: rgba(var(--hp-color-white-rgb), 0.08) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgba(var(--hp-color-white-rgb), 0.82) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    text-decoration: none;
    white-space: nowrap;
}

.hp-tag-chip:hover {
    background: rgba(var(--hp-color-accent-rgb), 0.22) !important;
    border-color: rgba(var(--hp-color-accent-rgb), 0.45) !important;
    color: var(--hp-color-white) !important;
}

.hp-tag-chip img,
.hp-tag-chip svg {
    width: 11px !important;
    height: 11px !important;
}

/* sound toggle sits at the end of the rail */
.hp-action-rail__item--sound {
    order: 10;
}

.hp-mute-label {
    color: var(--hp-color-white) !important;
}
/* the feed must stay above the ad click-overlay the ad script injects (body > [data-cl-overlay], z 1001);
   otherwise that invisible layer swallows every hover/click on the video
   controls (fullscreen, action rail, like/views). Nav (1050) stays on top. */
.hp-videos-list {
    z-index: 1002 !important;
}
/* top bar (Filter pill) must stay above the raised feed — it is a fixed stacking context,
   so the inner .header z-index (1040) cannot escape it; nav stays at 1050. */
.hp-videos-topbar {
    z-index: 1003 !important;
}

/* shared video-tile grid (TikTok-style profile / tag pages) */
/* grid pages scroll normally; the video feeds keep their y-mandatory snap */
.hp-tags-page .hp-videos-list,
.hp-tag-page .hp-videos-list,
.hp-user-page .hp-videos-list {
    scroll-snap-type: none !important;
}

.tu-video-grid {
    display: grid;
    max-width: 860px;
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    background: none;
}

@media screen and (min-width: 768px) {
    .tu-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
        gap: 6px;
        /* no grid padding: spacing comes from the head and the end note */
    }
}

.tu-video-tile {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 5px;
    background: var(--hp-color-surface);
    text-decoration: none;
}

.tu-video-tile__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tu-video-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(var(--hp-color-black-rgb), 0) 0%, rgba(var(--hp-color-black-rgb), 0.6) 100%);
    pointer-events: none;
}

.tu-video-tile__play {
    position: absolute;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    color: var(--hp-color-white);
    pointer-events: none;
    filter: drop-shadow(0 1px 4px rgba(var(--hp-color-black-rgb), 0.75));
}

.tu-video-tile__play svg {
    width: 30px;
    height: 30px;
    margin-left: 2px;
}

.tu-video-tile__views {
    position: absolute;
    left: 6px;
    bottom: 7px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--hp-color-white);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(var(--hp-color-black-rgb), 0.85);
}

.tu-video-tile__views svg {
    width: 12px;
    height: 12px;
}

.tu-video-tile__sep {
    opacity: 0.6;
    margin: 0 2px;
}

.tu-grid-sentinel {
    height: 1px;
}

.tu-grid-end {
    grid-column: 1 / -1;
    margin: 18px 0 calc(96px + env(safe-area-inset-bottom, 0px));
    color: var(--hp-color-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.tu-grid-end[hidden] {
    display: none;
}

/* compact tag page head */
.tu-tag-head {
    max-width: 860px;
    margin: 0 auto;
    padding: 16px 12px 16px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.tu-tag-head__title {
    margin: 0;
    color: var(--hp-color-white);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.tu-tag-head__count {
    color: var(--hp-color-text-muted);
    font-size: 13px;
    font-weight: 600;
}
/* /tag/: filter pill sits on the right instead of the centre */
.hp-tag-page .header .header__topbar {
    justify-content: flex-end !important;
    /* stay inside the grid column instead of the viewport edge */
    max-width: 860px !important;
    margin: 8px auto 0 !important;
}

.hp-tag-page .header .header__topbar .filter-btn {
    margin: 0 !important;
}
/* /tag/ head must clear the fixed Filter bar on small screens,
   and leave room for the pill on wide ones. */
.hp-tag-page .tu-tag-head {
    padding-right: 120px;
    padding-bottom: 16px;
}

@media screen and (max-width: 767px) {
    .hp-tag-page .tu-tag-head {
        padding-top: 16px;
    }
}

/* the fixed top-bar scrim is for the full-screen feed; disable it here so
   the tag head stays pure white */
.hp-tag-page .hp-videos-topbar::before {
    display: none !important;
}

/* /tags/ browse-all-tags page */
.hp-tags-browse {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 12px calc(96px + env(safe-area-inset-bottom, 0px));
}

.hp-tags-page .hp-tag-head {
    /* same vertical rhythm as /tag/ */
    padding: 16px 120px 16px 0;
}

/* no dark scrim over the heading on the browse page */
.hp-tags-page .hp-videos-topbar::before {
    display: none !important;
}

.hp-tag-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 16px;
}

.hp-tag-head__title {
    margin: 0;
    color: var(--hp-color-white);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.hp-tag-head__count {
    color: var(--hp-color-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.hp-tags-browse__search {
    width: 100%;
    height: 42px;
    margin-bottom: 0;
    padding: 0 16px;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.14);
    border-radius: 999px;
    background: var(--hp-color-surface);
    color: var(--hp-color-white);
    font-size: 14px;
    outline: none;
}

.hp-tags-browse__search::placeholder {
    color: var(--hp-color-text-muted);
}

.hp-tags-browse__search:focus {
    border-color: rgba(var(--hp-color-accent-rgb), 0.55);
}

.hp-tags-browse__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hp-tags-browse__chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.12);
    border-radius: 999px;
    background: rgba(var(--hp-color-white-rgb), 0.06);
    color: var(--hp-color-white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.hp-tags-browse__chip:hover {
    background: rgba(var(--hp-color-accent-rgb), 0.22);
    border-color: rgba(var(--hp-color-accent-rgb), 0.45);
}

.hp-tags-browse__sentinel {
    height: 1px;
}

.hp-tags-browse__empty {
    margin: 24px 0;
    color: var(--hp-color-text-muted);
    font-size: 13px;
    text-align: center;
}

/* /tags/ grid with per-tag thumbnails */
.hp-tag-grid {
    /* same tile rhythm as the /tag/ video grid */
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
}

@media screen and (min-width: 768px) {
    .hp-tag-grid {
        grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
        gap: 6px;
    }
}

.hp-tag-tile {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 5px;
    background:
        radial-gradient(120% 90% at 20% 0%, rgba(var(--hp-color-accent-rgb), 0.30) 0%, rgba(var(--hp-color-accent-rgb), 0) 60%),
        var(--hp-color-surface);
    text-decoration: none;
}

.hp-tag-tile__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hp-tag-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(var(--hp-color-black-rgb), 0) 0%, rgba(var(--hp-color-black-rgb), 0.72) 100%);
    pointer-events: none;
}

.hp-tag-tile__hash {
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 1;
    color: rgba(var(--hp-color-white-rgb), 0.55);
    font-size: 15px;
    font-weight: 800;
    pointer-events: none;
}

.hp-tag-tile__name {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 8px;
    z-index: 1;
    color: var(--hp-color-white);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(var(--hp-color-black-rgb), 0.85);
    pointer-events: none;
}

.hp-tag-tile:hover .hp-tag-tile__name {
    color: var(--hp-color-accent-soft);
}

.hp-tags-browse__searchform {
    margin: 0 0 16px;
}

.hp-tags-browse .hp-pagination-row {
    margin: 22px 0 0;
}

/* /tags/: filter pill right-aligned like /tag/ */
.hp-tags-page .header .header__topbar {
    justify-content: flex-end !important;
    max-width: 860px !important;
    margin: 8px auto 0 !important;
}

.hp-tags-page .header .header__topbar .filter-btn {
    margin: 0 !important;
}

/* /tags/: subreddit tiles with meta line + sort chips */
.hp-tag-tile__meta {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 26px;
    z-index: 1;
    color: rgba(var(--hp-color-white-rgb), 0.72);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(var(--hp-color-black-rgb), 0.85);
    pointer-events: none;
}

.hp-tags-browse__sort {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
}

.hp-tags-browse__sortbtn {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid rgba(var(--hp-color-white-rgb), 0.12);
    border-radius: 999px;
    background: rgba(var(--hp-color-white-rgb), 0.05);
    color: var(--hp-color-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.hp-tags-browse__sortbtn:hover {
    color: var(--hp-color-white);
    border-color: rgba(var(--hp-color-white-rgb), 0.22);
}

.hp-tags-browse__sortbtn.is-active {
    background: rgba(var(--hp-color-accent-rgb), 0.22);
    border-color: rgba(var(--hp-color-accent-rgb), 0.5);
    color: var(--hp-color-white);
}

/* ==========================================================================
   Grid pages (/tags/, /tag/*, /flairs/*, /user/*) now use the main site
   header instead of the old Filter bar: account controls visible again and
   the scrolling list starts below the fixed header.
   ========================================================================== */

.hp-tag-page .header__actions,
.hp-tags-page .header__actions,
.hp-user-page .header__actions {
    display: flex !important;
}

.hp-tag-page .hp-videos-list,
.hp-tags-page .hp-videos-list,
.hp-user-page .hp-videos-list {
    padding-top: 92px;
    padding-bottom: 32px;
}

/* the old "clear the Filter pill" padding is no longer needed */
.hp-tag-page .tu-tag-head {
    padding-right: 0;
}

.hp-tags-page .hp-tag-head {
    padding: 16px 0;
}

@media screen and (max-width: 767px) {
    .hp-tag-page .hp-videos-list,
    .hp-tags-page .hp-videos-list,
    .hp-user-page .hp-videos-list {
        padding-top: 76px;
        padding-bottom: calc(var(--hp-nav-height, 64px) + 28px);
    }
}

/* ==========================================================================
   Unified layout for the four grid pages (/tags/, /tag/*, /flairs/*, /user/*):
   the media grids run full-bleed with a 1px side padding, while headings,
   search and sort controls keep a 16px gutter.
   ========================================================================== */

.hp-tags-browse {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.hp-tag-grid,
.tu-video-grid {
    padding-left: 1px;
    padding-right: 1px;
}

.hp-tags-page .hp-tag-head,
.hp-tag-page .tu-tag-head,
.hp-tags-browse__searchform,
.hp-tags-browse__sort,
.hp-tags-browse .hp-pagination-row {
    padding-left: 16px;
    padding-right: 16px;
}

/* headings line up with the 860px grid column on desktop */
.hp-tag-page .tu-tag-head {
    max-width: 860px;
    margin: 0 auto;
    padding: 16px;
}

.hp-tags-page .hp-tag-head {
    padding: 16px;
}

/* ==========================================================================
   Grid pages: normal document scrolling (so the site footer sits in the flow
   and the page gets the standard themed scrollbar) instead of the fixed
   full-viewport feed stage.
   ========================================================================== */

html:has(body.hp-tag-page),
html:has(body.hp-tags-page),
html:has(body.hp-user-page) {
    height: auto !important;
    overflow: auto !important;
    scrollbar-gutter: stable;
}

body.hp-tag-page,
body.hp-tags-page,
body.hp-user-page {
    height: auto !important;
    min-height: 100vh;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
}

.hp-tag-page #__next,
.hp-tags-page #__next,
.hp-user-page #__next {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
}

.hp-tag-page .hp-videos-list,
.hp-tags-page .hp-videos-list,
.hp-user-page .hp-videos-list {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    flex: 1 0 auto;
}

/* footer joins the flow under the content */
.hp-tag-page .hp-site-footer,
.hp-tags-page .hp-site-footer,
.hp-user-page .hp-site-footer {
    flex: 0 0 auto;
}

@media screen and (max-width: 767px) {
    .hp-tag-page .hp-site-footer,
    .hp-tags-page .hp-site-footer,
    .hp-user-page .hp-site-footer {
        padding-bottom: calc(var(--hp-nav-height, 64px) + 24px);
    }
}

/* tiktok-components.css sets html/body/#__next to #000 with height 100% and
   20px bottom padding (feed stage). On the grid pages the document scrolls and
   ends with the site footer, so cancel that and use the site canvas colour so
   the footer matches the rest of the site and sits flush on the page bottom. */
html:has(body.hp-tag-page),
html:has(body.hp-tags-page),
html:has(body.hp-user-page) {
    padding-bottom: 0 !important;
    background-color: var(--hp-color-canvas) !important;
}

body.hp-tag-page,
body.hp-tags-page,
body.hp-user-page {
    padding-bottom: 0 !important;
    background-color: var(--hp-color-canvas) !important;
}

.hp-tag-page #__next,
.hp-tags-page #__next,
.hp-user-page #__next {
    padding-bottom: 0 !important;
    background-color: var(--hp-color-canvas) !important;
}

/* the site footer already has a border-top; drop its 44px top margin on the
   grid pages so no extra colour band appears between content and footer */
.hp-tag-page .hp-site-footer,
.hp-tags-page .hp-site-footer,
.hp-user-page .hp-site-footer {
    margin-top: 0;
}

/* tiktok-videos.css makes the floating feed header hit-neutral (pointer-events: none)
   so the video controls underneath stay clickable. On the grid pages the same
   header is the real site navigation, so restore pointer events there. */
.hp-tag-page .header,
.hp-tags-page .header,
.hp-user-page .header,
.hp-tag-page .header .container,
.hp-tags-page .header .container,
.hp-user-page .header .container,
.hp-tag-page .header *,
.hp-tags-page .header *,
.hp-user-page .header * {
    pointer-events: auto !important;
}

/* Desktop: give the grid pages the normal site header behaviour — header in
   the document flow, so the header search field opens below it and pushes the
   content down instead of floating over the page heading. */
@media screen and (min-width: 768px) {
    .hp-tag-page .hp-videos-topbar,
    .hp-tags-page .hp-videos-topbar,
    .hp-user-page .hp-videos-topbar {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* full-bleed header band like the rest of the site */
    .hp-tag-page .hp-videos-header,
    .hp-tags-page .hp-videos-header,
    .hp-user-page .hp-videos-header {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .hp-tag-page .header,
    .hp-tags-page .header,
    .hp-user-page .header {
        position: relative !important;
    }

    /* search field is anchored to this wrapper, not the viewport */
    .hp-tag-page .hp-videos-header,
    .hp-tags-page .hp-videos-header,
    .hp-user-page .hp-videos-header {
        position: relative !important;
    }

    /* the in-flow header already separates the content from itself */
    .hp-tag-page .hp-videos-list,
    .hp-tags-page .hp-videos-list,
    .hp-user-page .hp-videos-list {
        padding-top: 0 !important;
    }

    .hp-tag-page #search-input,
    .hp-tags-page #search-input,
    .hp-user-page #search-input {
        margin-top: 24px !important;
    }
}

/* Grid/profile pages: the tiktok feed sets .hp-videos-list to pure #000, but the
   header/search area sits on the page canvas (#0a0a0c). That two-tone edge
   showed up as a "background band" behind the open search field — use the
   canvas colour for the whole page instead. */
.hp-tag-page .hp-videos-list,
.hp-tags-page .hp-videos-list,
.hp-user-page .hp-videos-list {
    background-color: var(--hp-color-canvas) !important;
}

/* tiktok grid/profile pages: keep the search field inside the same 860px
   content column as the hero and grids */
@media screen and (min-width: 768px) {
    .hp-tag-page #search-input,
    .hp-tags-page #search-input,
    .hp-user-page #search-input {
        width: 100% !important;
        max-width: 860px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* search open on tiktok pages: the field's own 24px bottom margin already
   separates it from the content, so drop the section's extra top margin —
   otherwise the gap below the field was larger than the gap above it */
body.hp-search-open.hp-user-page .hp-videos-list > .tu-hero-slide,
body.hp-search-open.hp-tag-page .hp-videos-list > .hp-collection-hero,
body.hp-search-open.hp-tags-page .hp-videos-list > .hp-collection-hero {
    margin-top: 0 !important;
}

body.hp-search-open.hp-tags-page .hp-tags-browse {
    padding-top: 0 !important;
}

/* tiktok like button: same heart pop + expanding ring as the album/feed cards */
.like-btn {
    position: relative;
}

.like-btn svg.hp-icon {
    transform-origin: center;
}

.like-btn svg.hp-icon.heart-animated {
    animation: hpCardHeartPop 0.66s cubic-bezier(0.2, 0.9, 0.3, 1.35);
}

.hp-like-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--hp-color-accent-rgb), 0.75);
    background: rgba(var(--hp-color-accent-rgb), 0.18);
    pointer-events: none;
    animation: hpLikeBurst 0.62s ease-out forwards;
}

@keyframes hpCardHeartPop {
    0% { transform: scale(1); }
    16% { transform: scale(1.7) rotate(-8deg); }
    34% { transform: scale(0.86) rotate(4deg); }
    52% { transform: scale(1.24) rotate(-2deg); }
    72% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

@keyframes hpLikeBurst {
    0% { transform: scale(0.4); opacity: 0.9; }
    55% { opacity: 0.45; }
    100% { transform: scale(3.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .like-btn svg.hp-icon.heart-animated,
    .hp-like-burst {
        animation: none !important;
    }
}

