/* =============================================================================
   redesign.css — tgtube.com-style dark theme for KVS 6.4.0
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. CSS Custom Properties (Design System)
   --------------------------------------------------------------------------- */
:root {
  /* Our design tokens */
  --bg:           #1a1a1a;
  --surface:      #222222;
  --surface-alt:  #2d2d2d;
  --border:       #383838;
  --text:         #f0f0f0;
  --text-muted:   #999999;
  --accent:       #b84fff;
  --accent-hover: #9e3de0;
  --header-bg:    #111111;
  --sidebar-bg:   #1a1a1a;

  --radius:       6px;
  --radius-sm:    4px;
  --transition:   0.18s ease;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;

  --header-height: 44px;
  --sidebar-width: 220px;

  /* Override dark-theme.css variables so all its rules inherit our palette.
     dark-theme.css sets these on :root; since redesign.css loads after, our
     values win and every component using var(--dark-accent) etc. turns purple. */
  --dark-bg:              #1a1a1a;
  --dark-surface:         #222222;
  --dark-surface-alt:     #2d2d2d;
  --dark-surface-soft:    #1a1a1a;
  --dark-border:          #383838;
  --dark-border-soft:     #444444;
  --dark-text:            #f0f0f0;
  --dark-text-muted:      #999999;
  --dark-text-soft:       #777777;
  --dark-accent:          #b84fff;
  --dark-accent-strong:   #9e3de0;
  --dark-shadow:          rgba(0, 0, 0, 0.55);
  --workspace-bg:         #1a1a1a;
  --workspace-surface:    #222222;
  --workspace-surface-alt:#2d2d2d;
  --workspace-surface-soft:#1a1a1a;
  --workspace-border:     #383838;
  --workspace-border-soft:#444444;
  --workspace-text:       #f0f0f0;
  --workspace-muted:      #999999;
  --workspace-accent:     #b84fff;
  --workspace-accent-strong: #9e3de0;
  --workspace-success:        #b84fff;
  --workspace-success-strong: #9e3de0;
  --workspace-success-soft:   rgba(184, 79, 255, 0.18);
  --workspace-success-border: rgba(184, 79, 255, 0.4);
  --workspace-danger:         #ff5a5a;
  --workspace-danger-strong:  #e04040;
  --workspace-danger-soft:    rgba(255, 90, 90, 0.18);
  --workspace-danger-border:  rgba(255, 90, 90, 0.4);
  --workspace-shadow:         rgba(0, 0, 0, 0.4);
  --workspace-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Override the frontpage filter panel's own scoped variables */
.frontpage-filters-panel {
  --fp-bg:           #1a1a1a;
  --fp-surface:      #2d2d2d;
  --fp-surface-soft: #222222;
  --fp-border:       #383838;
  --fp-border-soft:  #444444;
  --fp-text:         #f0f0f0;
  --fp-muted:        #999999;
  --fp-accent:       #b84fff;
  --fp-accent-strong:#9e3de0;
}

/* frontpage-filters-panel is replaced by inline-filters-bar — keep hidden as fallback */
.frontpage-filters-panel {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   2. Base Overrides
   --------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 15px !important;
  scroll-behavior: smooth;
}

html,
body {
  background: var(--bg) !important;
  background-color: var(--bg) !important;
}

body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text) !important;
}

a:hover,
.no-touchevents a:hover {
  color: var(--accent) !important;
}

.page__wrapper {
  background-color: var(--bg) !important;
  box-shadow: none !important;
}

.page__wrapper.js-filter-is-visible {
  box-shadow: none !important;
}

a {
  text-decoration: none;
  transition: color var(--transition);
}

img {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page__wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg);
  padding-top: 0 !important;
}

/* ---------------------------------------------------------------------------
   2b. Dark-theme.css neutralizers (these selectors are set by dark-theme.css;
       since we load after it, these plain rules override without !important)
   --------------------------------------------------------------------------- */

/* dark-theme sets .header background to --dark-surface (navy) */
.header {
  background-color: var(--header-bg);
}

/* dark-theme sets .card__footer background */
.card__footer {
  background-color: transparent;
  box-shadow: none;
}

/* dark-theme sets .footer background */
.footer {
  background-color: var(--header-bg);
  border-top: 1px solid var(--border);
}

/* dark-theme makes search__btn teal */
.search__btn {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

/* dark-theme sets toggler background */
.toggler {
  background-color: transparent;
  border: none;
}

/* dark-theme sets card__label--hd to teal */
.card__label--hd {
  background: linear-gradient(135deg, #b84fff, #d84fff);
}

/* dark-theme sets logo__mark to teal */
.logo__mark {
  background: linear-gradient(135deg, #b84fff 0%, #d84fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* dark-theme sets logo__link to dark-text-muted */
.logo__link {
  color: #888888;
  font-size: 1.2rem;
  font-weight: 800;
}

/* ---------------------------------------------------------------------------
   3. Header
   --------------------------------------------------------------------------- */
.page__header {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 100%;
  padding: 0;
}

.header > .container {
  max-width: 1512px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 100%;
}

.navbar {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  flex-wrap: nowrap;
}

/* Logo */
.navbar__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo__link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

/* Gray for the rest of the logo text (e.g. "Gen") */
.logo__suffix,
.logo__link > *:not(.logo__mark) {
  color: #888888;
  -webkit-text-fill-color: #888888;
}

.logo__mark {
  font-weight: 800;
}

/* Search bar */
.navbar__search {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
}

.search,
.navbar__search .search__form {
  display: flex;
  width: 100%;
  position: relative;
}

.search__frame {
  display: flex;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #2a2a2a;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.search__frame:focus-within {
  border-color: var(--accent);
}

.search__field,
.tag-search-bar,
.tag-search-container {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: unset;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  gap: 0;
}

input.field--search,
.tag-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text) !important;
  caret-color: var(--text) !important;
  font-size: 0.85rem;
  height: 32px;
  padding: 0 12px 0 20px;
  outline: none;
  width: 100%;
}

/* Beat tag-search.css `.tag-search-input.field--search` (0,2,0) so typed text stays light */
input.field.field--search.tag-search-input {
  color: #ffffff !important;
  caret-color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

input.field--search::placeholder,
.tag-search-input::placeholder {
  color: var(--text-muted) !important;
}

input.field.field--search.tag-search-input::placeholder {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
}

.search__btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.search__btn:hover {
  color: var(--text);
  background: rgba(184, 79, 255, 0.12);
}

.search__btn .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Search prebutton (AI slot) — hidden so it doesn't crowd the search bar */
.search__prebutton,
.navbar__toggler--mobile-ai {
  display: none !important;
}

/* Tag search chips */
.tag-search-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  max-width: 40%;
  overflow: hidden;
}

.tag-search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Horizontal nav (tgtube-style: Videos, Categories, Models, More) */
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.navbar__nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.navbar__nav-link:hover,
.navbar__nav-link:focus {
  background: var(--surface-alt);
  color: var(--text);
}

.navbar__nav-link .nav-arrow {
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 1px;
}

/* More dropdown */
.navbar__nav-item {
  position: relative;
}

.navbar__nav-item > .navbar__nav-link {
  cursor: pointer;
  user-select: none;
}

.navbar__nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 300;
  overflow: hidden;
}

.navbar__nav-item--more:hover .navbar__nav-dropdown,
.navbar__nav-item--more:focus-within .navbar__nav-dropdown {
  display: block;
}

.navbar__nav-dropdown-link {
  display: block;
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.navbar__nav-dropdown-link:hover {
  background: var(--surface-alt);
  color: var(--accent) !important;
}

/* Right-side togglers */
.navbar__toggler {
  flex-shrink: 0;
}

.navbar__toggler--menu {
  display: none !important;
}

.navbar__toggler--search {
  display: none;
}

.toggler {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.toggler:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.toggler__icon svg {
  fill: currentColor;
}

/* ---------------------------------------------------------------------------
   4. Site Body Layout — no sidebar, full width
   --------------------------------------------------------------------------- */
.page__main {
  flex: 1;
  width: 100%;
}

.site-body {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 1512px;
  margin: 0 auto;
  padding: 0;
}

/* ---------------------------------------------------------------------------
   5. Sidebar — hidden on all sizes (tgtube has no persistent sidebar)
   --------------------------------------------------------------------------- */
.site-sidebar {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   6. Main Content Wrapper — full width
   --------------------------------------------------------------------------- */
.site-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 16px 20px 32px;
}

.site-content h1,
.site-content .section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Video list heading row (title + optional sort buttons) */
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.heading__item {
  display: flex;
  align-items: center;
}

.heading__title,
.site-content .heading__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  border: none;
  padding: 0;
}

/* ---------------------------------------------------------------------------
   7. Card Grid — 6 columns (tgtube-style)
   Tight gutters + taller thumbs (see .card__content height)
   --------------------------------------------------------------------------- */
.cards__list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 0;
  margin: 0;
}

/* Higher specificity + !important: main.min.css uses padding-bottom:69%;height:0 for thumbs.
   Without this, some builds/caches still apply the old aspect-ratio box and our height is ignored. */
.cards .cards__list {
  gap: 3px !important;
}

/* Fill grid tracks: main.css sets .cards__item { width: 25% } for legacy flex
   layout — without overriding, grid items stay narrow strips inside each cell. */
.cards__item {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Lift the whole card above later grid items so kebab + dropdown aren’t covered by the row below */
.cards__item:hover,
.cards__item:focus-within {
  z-index: 25;
}

/* The card itself — no frame; thumb + text sit on page background */
.card {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  border: none;
  border-radius: var(--radius);
  /* Must not clip the kebab menu (dropdown extends below the title row) */
  overflow: visible;
  width: 100%;
  transition: transform var(--transition), opacity var(--transition);
  cursor: default;
  box-shadow: none;
}

.card:hover {
  border: none;
  transform: translateY(-2px);
  box-shadow: none;
  text-decoration: none;
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   8. Card Thumbnail Area
   --------------------------------------------------------------------------- */
/* Explicit height so absolutely positioned .card__thumb-footer anchors to the thumb,
   not to a collapsed/zero-height box (which pushes badges below the image). */
.card__media {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  min-height: 190px;
  height: 190px;
  overflow: hidden;
}

.cards .card .card__media {
  min-height: 190px !important;
  height: 190px !important;
}

.card__content {
  position: relative;
  width: 100%;
  /* Taller than main.min’s padding-box thumb (was 138px in redesign before) */
  height: 190px;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
  background-color: #111;
}

.cards .card .card__content {
  height: 190px !important;
  min-height: 190px !important;
  padding-bottom: 0 !important;
  padding-top: 0 !important;
  box-sizing: border-box !important;
}

.card__content img,
.card__content .card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card__content img,
.card:hover .card__content .card__image {
  transform: scale(1.05);
}

/* Dark gradient at bottom of thumbnail (badges sit above this) */
.card__content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Bottom bar: rating + votes (left), duration (right), matching chip sizing */
.card__thumb-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  box-sizing: border-box;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 10px 10px;
  pointer-events: none;
}

.cards .card .card__thumb-footer {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
}

/* Same outer “pill” as .card__quality-dur (height + padding + radius) */
.card__thumb-footer-main,
.card__quality-dur {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.1;
  box-sizing: border-box;
  min-height: 30px;
  min-width: 0;
}

.card__thumb-footer-main {
  justify-content: flex-start;
  gap: 6px;
  flex: 0 1 auto;
}

.card__quality-dur {
  justify-content: flex-end;
  flex: 0 0 auto;
}

/* Whole chips capture clicks; buttons sit above the thumb link (see theme.js block target). */
.card__thumb-footer--interactive .card__thumb-footer-main,
.card__thumb-footer--interactive .card__quality-dur {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.card__thumb-footer--interactive .card__rating-interactive,
.card__thumb-footer--interactive .card__rate-btns {
  pointer-events: auto;
}

.card__rating-interactive {
  display: inline-flex;
  align-items: center;
}

.card__rate-btns {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.card__rate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e8f1fb;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.card__rate-btn:hover,
.card__rate-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

.card__rate-btn--up:hover,
.card__rate-btn--up:focus-visible {
  color: #4ade80;
}

.card__rate-btn--down:hover,
.card__rate-btn--down:focus-visible {
  color: #f87171;
}

.card__rate-btn.disabled,
.card__rate-btn.voted {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}

.card__rate-icon {
  display: block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

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

.card__rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  color: #4ade80;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.card__rating-icon {
  flex-shrink: 0;
  opacity: 0.95;
  width: 12px;
  height: 12px;
}

/* Duration chip: base styles shared with .card__thumb-footer-main above */
.card__quality-dur {
  color: #fff;
}

.card__quality {
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #fff;
  opacity: 0.95;
}

.card__dur {
  font-style: normal;
  font-weight: 600;
  color: #fff;
}

/* Play icon: subtle until hover (reference focuses on bottom badges) */
.cards .card__content .card__icon {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 4;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

.cards .card:hover .card__content .card__icon,
.cards .card:focus-visible .card__content .card__icon {
  opacity: 0.92;
}

/* Legacy / native-ad labels on thumb */
.card__label {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
}

.card__label--primary {
  bottom: 7px;
  left: 7px;
  background-color: rgba(0, 0, 0, 0.82);
}

.card__label--hd {
  top: 7px;
  right: 7px;
  background: linear-gradient(135deg, #b84fff, #d84fff);
  color: #fff;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.card__label--count,
.card__label--views {
  top: 7px;
  left: 7px;
}

/* ---------------------------------------------------------------------------
   9. Card Footer
   --------------------------------------------------------------------------- */
.card__footer {
  /* Edge-align with thumbnail: main.css legacy .card__title had padding — cleared below */
  padding: 3px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: transparent;
}

/* Title + kebab row — stack above .card__meta-row so the dropdown isn’t painted under source/date */
.card__title-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.card__thumb-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  cursor: pointer;
  height: 100%;
}

.cards .card .card__thumb-link {
  height: 100%;
}

.card__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
}

.card__menu {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}

.card__kebab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  line-height: 0;
  transition: color var(--transition), background var(--transition);
}

.card__kebab:hover,
.card__kebab:focus-visible {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.card__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 210px;
  padding: 6px 0;
  background: var(--surface, #222);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  z-index: 400;
}

.card__dropdown[hidden] {
  display: none !important;
}

.card__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.card__dropdown-item:hover,
.card__dropdown-item:focus-visible {
  background: var(--surface-alt);
  color: var(--accent);
  outline: none;
}

.card__dropdown-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

.card:hover .card__title {
  color: var(--accent);
}

.card-flag-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

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

.card-flag-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.card-flag-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface, #1e1e1e);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.card-flag-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.card-flag-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-flag-modal__close {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.card-flag-modal__close:hover,
.card-flag-modal__close:focus-visible {
  color: var(--text);
  background: var(--surface-alt);
  outline: none;
}

.card-flag-modal__form {
  padding: 16px;
}

.report--card-modal .report__row {
  margin-bottom: 8px;
}

/* Source + date row (reference: verified + channel left, date right) */
.card__meta-row {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  min-width: 0;
}

.card__meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.card__verified {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4ade80;
  opacity: 0.95;
}

.card__source-name {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.card__source-name--muted {
  color: var(--text-muted);
  font-weight: 400;
}

.card__meta-time {
  flex-shrink: 0;
  margin: 0;
}

/* Native ad / legacy extra meta (hidden when empty) */
.card__footer > .card__info:empty {
  display: none !important;
}

.card__footer > .card__info:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #383838);
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card__info .card__views {
  min-width: 0;
}

.card__info .card__time {
  margin-left: auto;
}

.card__info .card__source {
  flex: 1 1 100%;
  max-width: 100%;
}

.card__text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__source {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color var(--transition);
}

.card__source a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.card__source a:hover {
  color: var(--accent);
}

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

.card__time {
  font-size: 0.72rem;
  line-height: 1.15;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Hide star/rating rows */
.card__stars,
.card__rating,
.card .rating,
.card .stars {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   10. Filter / Sort Panel
   --------------------------------------------------------------------------- */
.filter-panel,
.content-filter,
.sort-bar,
.list_sortby {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.filter-panel a,
.sort-bar a,
.list_sortby a,
.filter-panel .btn,
.sort-bar .btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 5px 12px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.filter-panel a:hover,
.sort-bar a:hover,
.list_sortby a:hover,
.filter-panel a.active,
.sort-bar a.active,
.list_sortby a.active,
.filter-panel .btn.active {
  background: var(--surface-alt);
  border-color: var(--accent);
  color: var(--text);
}

/* Pagination */
.pagination,
.paginator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}

.pagination a,
.paginator a,
.pagination span,
.paginator span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pagination a:hover,
.paginator a:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
  color: var(--text);
}

.cards .pagination .active,
.cards .paginator .current,
.cards .pagination span.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------------------------------------------------------------------
   11. Footer
   --------------------------------------------------------------------------- */
.page__footer {
  background-color: var(--header-bg);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1512px;
  margin: 0 auto;
  padding: 16px 20px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.footer__nav,
.footer .footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.footer__nav a,
.footer .footer-links a,
.footer__link {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color var(--transition);
}

.footer__nav a:hover,
.footer .footer-links a:hover,
.footer__link:hover {
  color: var(--accent);
}

.footer__copyright {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0;
}

/* Footer category directory (alphabetical — tgtube-style) */
.footer-categories {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 4px;
}

.footer-categories__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.footer-categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 16px;
}

.footer-categories__grid a {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-categories__grid a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   12. Side Drawer / Mobile Filter Panel (KVS built-in)
   --------------------------------------------------------------------------- */
.side-drawer,
#side_drawer_panel {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.side-drawer.js-filter-is-visible,
#side_drawer_panel.js-filter-is-visible {
  pointer-events: auto;
}

/* KVS uses .js-filter-is-visible / .js-filter-is-hidden for drawer state */
.js-filter {
  /* base state handled by JS */
}

/* Sidebar section inside KVS drawer */
.sidebar-section {
  padding: 12px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.sidebar-section__title {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 16px 8px;
  margin: 0;
}

.sidebar-section__more {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  padding: 6px 16px;
  transition: opacity var(--transition);
}

.sidebar-section__more:hover {
  opacity: 0.8;
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   13. KVS Filter Drawer (the overlay side panel)
   --------------------------------------------------------------------------- */
.js-filter-is-visible .page__wrapper,
.js-filter-is-visible body {
  overflow: hidden;
}

/* The drawer panel itself rendered by KVS */
[id="side_drawer_panel"],
.filter {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--header-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 450;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  padding: 16px 0;
}

.js-filter-is-visible [id="side_drawer_panel"],
.js-filter-is-visible .filter {
  transform: translateX(0);
}

/* Overlay behind drawer */
.page__wrapper.js-filter-is-visible::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 440;
}

/* Links in mobile drawer */
.sidebar-nav {
  padding: 0;
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 9px 16px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.sidebar-nav__link:hover,
.sidebar-nav__link.active {
  background-color: var(--surface-alt);
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   14. Miscellaneous KVS components
   --------------------------------------------------------------------------- */

/* Video page */
.trailer {
  background-color: #000;
}

.trailer__wrap {
  display: flex;
  gap: 16px;
  padding: 16px 0;
}

.trailer__player {
  flex: 1;
  min-width: 0;
}

.trailer__videos {
  width: 300px;
  flex-shrink: 0;
}

/* Container widths */
.container {
  width: 100%;
  padding: 0 20px;
}

.container--big {
  max-width: 1512px;
  margin: 0 auto;
}

.container--small {
  max-width: 960px;
  margin: 0 auto;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs__separator {
  color: var(--border);
}

/* Tags */
.tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.tags__item a,
.tag-link {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 3px 10px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.tags__item a:hover,
.tag-link:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 7px 14px;
  transition: background var(--transition), border-color var(--transition);
}

.btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--text);
}

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

.btn--primary:hover,
.btn--accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* Spots / ad containers */
.spots--cards .spots__list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Back to top */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), background var(--transition);
  text-decoration: none;
}

#back-to-top.visible,
#back-to-top:not([style*="display: none"]) {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* ---------------------------------------------------------------------------
   14b. Subnav bar (tgtube secondary category/sort nav)
   --------------------------------------------------------------------------- */
.subnav {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.subnav::-webkit-scrollbar {
  display: none;
}

.subnav__inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  min-height: 32px;
  white-space: nowrap;
  max-width: 1512px;
  margin: 0 auto;
  width: 100%;
}

.subnav__link {
  color: var(--text-muted) !important;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.subnav__link:hover {
  color: var(--text) !important;
  background: var(--surface-alt);
}

.subnav__link--cat {
  font-size: 0.79rem;
}

.subnav__link--active {
  color: var(--text) !important;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.subnav__sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   14c. tgtube-style Category Grid
   --------------------------------------------------------------------------- */
.tg-categories-page {
  padding: 0;
}

.tg-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tg-section-title,
.site-content .tg-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  border: none;
  padding: 0;
}

.tg-browse-all {
  font-size: 0.82rem;
  color: var(--accent);
  transition: opacity var(--transition);
}

.tg-browse-all:hover {
  opacity: 0.8;
  color: var(--accent) !important;
}

.tg-category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.tg-cat-card {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}

.tg-cat-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 62%;
  overflow: hidden;
  background: #111;
}

.tg-cat-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tg-cat-card:hover .tg-cat-card__thumb img {
  transform: scale(1.06);
}

.tg-cat-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
}

.tg-cat-card__count {
  position: absolute;
  top: 7px;
  left: 7px;
  background: rgba(230, 126, 34, 0.88);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.tg-cat-card__name {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}

.tg-categories-footer {
  text-align: center;
  padding: 28px 0 8px;
}

.tg-see-all-btn {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 9px 28px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.tg-see-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: var(--surface);
}

.tg-empty {
  color: var(--text-muted);
  padding: 40px 0;
  text-align: center;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------------------
   14d. Override hardcoded navy colors from inline <style> in KVS blocks
   --------------------------------------------------------------------------- */
.cards .cards__item {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.cards .cards__item > .card {
  border: none !important;
  background: transparent !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

.card__processing-placeholder {
  background: var(--surface-alt) !important;
}

.card__processing-spinner {
  border-top-color: var(--accent) !important;
}

.artist-page-hero {
  --artist-bg: linear-gradient(145deg, #222 0%, #2d2d2d 55%, #1a1a1a 100%);
  --artist-stroke: var(--border);
  --artist-stroke-soft: #444;
  --artist-text: var(--text);
  --artist-muted: var(--text-muted);
  --artist-accent: var(--accent);
}

/* Remove the container width constraint on video listing so it uses full width */
.cards > .container.container--small {
  max-width: 100% !important;
  padding: 0 !important;
}

/* ---------------------------------------------------------------------------
   15. Mobile Responsive
   --------------------------------------------------------------------------- */

/* 5 columns at 1400px */
@media (max-width: 1400px) {
  .cards__list {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 4 columns at 1100px */
@media (max-width: 1100px) {
  .cards__list {
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }

  .cards .cards__list {
    gap: 3px !important;
  }

  .trailer__videos {
    width: 240px;
  }

  .navbar__nav {
    display: none;
  }
}

/* Show hamburger below 900px */
@media (max-width: 900px) {
  /* Hide the search toggle — search is always visible */
  .navbar__toggler--search {
    display: none;
  }

  /* Header grows to fit two rows */
  .page__header {
    height: auto;
  }

  .header > .container {
    flex-wrap: wrap;
    padding: 6px 14px;
    gap: 0;
    height: auto;
  }

  /* First row: hamburger + logo + right icons */
  .navbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
  }

  /* Search bar drops to its own full-width row */
  .navbar__search {
    display: flex;
    order: 10;
    width: 100%;
    max-width: 100%;
    margin: 6px 0 2px;
  }

  .site-content {
    padding: 12px 12px 24px;
  }

  .cards__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }

  .cards .cards__list {
    gap: 3px !important;
  }
}

/* 2 columns on small phones */
@media (max-width: 540px) {
  .cards__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
  }

  .cards .cards__list {
    gap: 3px !important;
  }

  .card__title {
    font-size: 0.76rem;
  }

  .trailer__wrap {
    flex-direction: column;
  }

  .trailer__videos {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-content {
    padding: 10px 10px 20px;
  }

  .header > .container {
    padding: 5px 10px;
  }

  .navbar {
    gap: 8px;
  }

  .tg-category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  .subnav__inner {
    padding: 0 10px;
  }
}

/* Category grid responsive breakpoints */
@media (max-width: 1400px) {
  .tg-category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1100px) {
  .tg-category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .tg-category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* ---------------------------------------------------------------------------
   16. Logo icon (butterfly SVG)
   --------------------------------------------------------------------------- */
.logo__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: url(#logo-gradient) var(--accent);
  /* Fallback: use accent color via CSS filter to tint the SVG purple */
  fill: var(--accent);
}

/* Purple gradient fill on the logo SVG via a filter trick */
.logo__link .logo__icon {
  background: linear-gradient(135deg, #b84fff 0%, #d84fff 100%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 2C9.4 2 4 7.4 4 14c0 3.6 1.6 6.8 4.1 9L16 30l7.9-7c2.5-2.2 4.1-5.4 4.1-9 0-6.6-5.4-12-12-12zm0 3c2.2 0 4.2.7 5.8 1.9L16 12 10.2 6.9C11.8 5.7 13.8 5 16 5zm-7.6 3.3L14 13.1V22c-1.8-.4-3.4-1.3-4.7-2.6L6.1 16.9C5.4 15.9 5 14.9 5 14c0-2.3.9-4.3 2.4-5.7zM18 22v-8.9l5.6-4.8C25.1 9.7 26 11.8 26 14c0 .9-.4 1.9-1.1 2.9l-3.2 2.5C20.4 20.7 18.8 21.6 18 22z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 2C9.4 2 4 7.4 4 14c0 3.6 1.6 6.8 4.1 9L16 30l7.9-7c2.5-2.2 4.1-5.4 4.1-9 0-6.6-5.4-12-12-12zm0 3c2.2 0 4.2.7 5.8 1.9L16 12 10.2 6.9C11.8 5.7 13.8 5 16 5zm-7.6 3.3L14 13.1V22c-1.8-.4-3.4-1.3-4.7-2.6L6.1 16.9C5.4 15.9 5 14.9 5 14c0-2.3.9-4.3 2.4-5.7zM18 22v-8.9l5.6-4.8C25.1 9.7 26 11.8 26 14c0 .9-.4 1.9-1.1 2.9l-3.2 2.5C20.4 20.7 18.8 21.6 18 22z'/%3E%3C/svg%3E") center / contain no-repeat;
  fill: none;
}

/* ---------------------------------------------------------------------------
   17. HD badge — green to match tgtube.com
   --------------------------------------------------------------------------- */
.card__label--hd,
.dark-theme .card__label--hd {
  background: #4caf50 !important;
  background: linear-gradient(135deg, #43a047, #66bb6a) !important;
  color: #fff;
}

/* ---------------------------------------------------------------------------
   18. Artists / Models page — A-Z directory
   --------------------------------------------------------------------------- */
.models-az {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  color: var(--text);
  font-family: var(--font, "Montserrat", "Trebuchet MS", Arial, sans-serif);
}

.models-az__head {
  margin-bottom: 16px;
}

.models-az__title {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.models-az__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* A–Z quick-nav */
.models-az__alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.models-az__alpha-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition, 0.15s), color var(--transition, 0.15s), border-color var(--transition, 0.15s);
}

.models-az__alpha-link:hover,
.models-az__alpha-link.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.models-az__alpha-link--all {
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

/* Letter sections */
.models-az__section {
  margin-bottom: 24px;
  scroll-margin-top: 80px;
}

.models-az__letter-head {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Multi-column name list */
.models-az__list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 4;
  column-gap: 12px;
}

.models-az__item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 0;
  break-inside: avoid;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.models-az__link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition, 0.15s);
}

.models-az__link:hover {
  color: var(--accent);
}

.models-az__count {
  font-size: 0.73rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.models-az__empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 6px;
}

@media (max-width: 900px) {
  .models-az__list {
    columns: 3;
  }
}

@media (max-width: 600px) {
  .models-az {
    padding: 14px 16px;
  }
  .models-az__list {
    columns: 2;
  }
  .models-az__alpha-link {
    min-width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

@media (max-width: 380px) {
  .models-az__list {
    columns: 1;
  }
}

/* ---------------------------------------------------------------------------
   19. Mobile side drawer — restyle for new palette
   --------------------------------------------------------------------------- */
#side_drawer_panel,
.js-filter-is-visible #side_drawer_panel {
  background-color: var(--header-bg) !important;
  border-right: 1px solid var(--border) !important;
}

/* All links inside the drawer */
#side_drawer_panel a,
#side_drawer_panel .sidebar-nav__link {
  color: var(--text-muted) !important;
  font-size: 0.88rem;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
}

#side_drawer_panel a:hover,
#side_drawer_panel a.active,
#side_drawer_panel .sidebar-nav__link:hover {
  color: var(--text) !important;
  background: var(--surface-alt) !important;
  border-left-color: var(--accent);
}

/* Category/model names inside the drawer */
#side_drawer_panel .card__title,
#side_drawer_panel .item__title {
  color: var(--text) !important;
}

/* Section headings inside the drawer */
#side_drawer_panel h3,
#side_drawer_panel .sidebar-section__title,
#side_drawer_panel .block_header {
  color: var(--text-muted) !important;
  font-size: 0.7rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px 6px;
  margin: 0;
  border-top: 1px solid var(--border);
}

/* Close button in drawer */
#side_drawer_panel .toggler,
#side_drawer_panel .filter__close {
  color: var(--text-muted) !important;
  background: transparent !important;
  border: none !important;
}

#side_drawer_panel .toggler:hover,
#side_drawer_panel .filter__close:hover {
  color: var(--text) !important;
  background: var(--surface-alt) !important;
}

/* ---------------------------------------------------------------------------
   20. Footer category directory — handle ul/li output from KVS global block
   --------------------------------------------------------------------------- */
.footer-categories__grid ul,
.footer-categories .block_content ul,
.footer-categories .list_categories ul {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-categories__grid li,
.footer-categories .block_content li,
.footer-categories .list_categories li {
  display: contents;
}

.footer-categories__grid .item,
.footer-categories__grid .card,
.footer-categories__grid .tg-cat-card {
  display: contents;
}

/* All category links in the footer, regardless of nesting depth */
.footer-categories a,
.footer-categories__grid a {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  padding: 1px 0;
}

.footer-categories a:hover,
.footer-categories__grid a:hover {
  color: var(--accent) !important;
}

/* Hide category card thumbnails/counts inside footer — only want text links */
.footer-categories .card__content,
.footer-categories .tg-cat-card__thumb,
.footer-categories .card__label {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   21. Pagination — broaden selectors to cover KVS output variants
   --------------------------------------------------------------------------- */
.cards .pagination__link,
.cards .pagination .pagination__link,
.cards .paginator .page-link {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  color: var(--text-muted) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.no-touchevents .cards .pagination__link:hover,
.cards .paginator .page-link:hover {
  background: var(--surface-alt) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

.cards .pagination__link--active,
.cards .pagination .active .pagination__link,
.cards .paginator .active .page-link,
.cards .pagination__link.is-active,
.cards .pagination__item--active .pagination__link {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* KVS uses span.current for active page in some themes */
.cards .pagination span.current,
.cards .paginator span.current,
.cards .pagination__item.active,
.cards .paginator .current-page {
  background: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  color: #fff !important;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------
   22. Categories page — section header count & meta
   --------------------------------------------------------------------------- */
.tg-section-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

.tg-section-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Override the container--small constraint on the categories hub page */
.container--small > .categories-hub,
.container > .categories-hub {
  max-width: 100%;
}

/* Also ensure the categories-page wrapper inside container--small is full width */
.container--small > .tg-categories-page,
.container > .tg-categories-page {
  max-width: 100%;
  padding: 0;
}

/* Force categories page container to full width (categories.tpl wraps in container--small) */
.site-content > .container.container--small,
.site-content > .container--small {
  max-width: 100% !important;
  padding: 0 !important;
}

/* ---------------------------------------------------------------------------
   23. Footer categories — alphabetical multi-column directory
   --------------------------------------------------------------------------- */

.footer-categories__grid {
  display: block;
}

.footer-alpha {
  columns: 6 160px;
  column-gap: 24px;
  padding: 4px 0;
}

.footer-alpha__group {
  break-inside: avoid;
  margin-bottom: 14px;
}

.footer-alpha__letter {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}

.footer-alpha__link {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-alpha__link:hover {
  color: var(--accent);
}

.footer-alpha__count {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* ---------------------------------------------------------------------------
   24. Native AD card — force same dimensions as video cards
   --------------------------------------------------------------------------- */
.cards__item[data-item-id="spot"] {
  display: flex !important;
}

.cards__item[data-item-id="spot"] .card {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Force the ad card image area to match video card thumb height */
.cards__item[data-item-id="spot"] .card__content,
.cards__item[data-item-id="spot"] .card a:first-child,
.cards__item[data-item-id="spot"] img,
.cards__item[data-item-id="spot"] .card__image {
  width: 100% !important;
  position: relative !important;
}

.cards__item[data-item-id="spot"] .card__content {
  height: 190px !important;
  min-height: 190px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

.cards__item[data-item-id="spot"] .card__content img,
.cards__item[data-item-id="spot"] .card__content .card__image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* ---------------------------------------------------------------------------
   25. Video card container — ensure full width even without .cards wrapper
   --------------------------------------------------------------------------- */
/* Broaden the container override to catch all variants */
.cards .container,
.cards .container--small,
.cards > div > .cards__list {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Ensure the site-content doesn't double-pad the cards */
.site-content .cards .container,
.site-content .cards .container--small {
  padding: 0 !important;
  max-width: 100% !important;
}

/* ---------------------------------------------------------------------------
   26. Inline Filters Bar (.inline-filters-bar) — tgtube-style horizontal row
   --------------------------------------------------------------------------- */
.inline-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--surface, #222222);
  border: 1px solid var(--border, #383838);
  border-radius: 8px;
}

.inline-filters-bar__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-filters-bar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Inline filter dropdown (.ifd) */
.ifd {
  position: relative;
  display: inline-block;
}

.ifd__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border, #383838);
  border-radius: 6px;
  color: var(--text-muted, #999999);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  line-height: 1.3;
}

.ifd__trigger:hover {
  border-color: #555555;
  color: #e0e0e0;
  background: rgba(255,255,255,0.04);
}

.ifd.is-open > .ifd__trigger {
  border-color: #555555;
  color: #e0e0e0;
  background: rgba(255,255,255,0.05);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: var(--surface, #222222);
}

.ifd__label-prefix {
  color: var(--text-muted, #999999);
  font-weight: 400;
}

.ifd__caret {
  opacity: 0.55;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.ifd.is-open > .ifd__trigger .ifd__caret {
  transform: rotate(180deg);
}

/* Dropdown menu */
.ifd__menu {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 1200;
  min-width: 160px;
  background: var(--surface, #222222);
  border: 1px solid #555555;
  border-top: none;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

.ifd__menu--right {
  left: auto;
  right: 0;
}

.ifd.is-open > .ifd__menu {
  display: block;
}

/* Menu options */
.ifd__option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border, #383838);
  color: var(--text-muted, #999999);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}

.ifd__option:last-child {
  border-bottom: none;
}

.ifd__option:hover {
  background: rgba(255,255,255,0.06);
  color: #e0e0e0;
}

.ifd__option.is-active {
  color: #ffffff;
  background: rgba(184, 79, 255, 0.15);
}

.ifd__option.is-active::before {
  content: "✓";
  margin-right: 6px;
  color: var(--accent, #b84fff);
  font-size: 11px;
}

/* Mobile: stack dropdowns */
@media (max-width: 640px) {
  .inline-filters-bar {
    padding: 8px;
  }
  .inline-filters-bar__left,
  .inline-filters-bar__right {
    width: 100%;
    flex-wrap: wrap;
  }
  .inline-filters-bar__right {
    margin-left: 0;
  }
  .ifd__trigger {
    font-size: 11px;
    padding: 5px 8px;
  }
}

/* =====================================================
   TGTube-style multi-column footer panel
   ===================================================== */

.footer-panel {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 40px 32px;
  width: 100%;
  padding: 32px 0 24px;
  border-top: 1px solid var(--border);
}

.footer-panel__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-panel__col--badges {
  align-items: flex-start;
  gap: 12px;
}

/* Brand column: same text + SVG logo as header (.logo / .logo__link) */
.footer-panel__col--brand .logo {
  line-height: 1;
}

/* Description */
.footer-panel__desc {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
}

/* Parents / RTA notice box */
.footer-panel__parents {
  border: 1px solid rgba(255, 200, 80, 0.45);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 4px;
  background: rgba(255, 200, 80, 0.05);
}

.footer-panel__parents-title {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: 0.03em;
}

.footer-panel__parents-text {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.5;
  margin: 0;
}

/* Column headings */
.footer-panel__heading {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.footer-panel__heading--spaced {
  margin-top: 16px;
}

/* Link lists */
.footer-panel__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-panel__links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-panel__links a:hover {
  color: var(--accent);
}

/* Trust badges */
.footer-panel__badge-link {
  display: inline-block;
  line-height: 0;
}

.footer-panel__badge {
  display: block;
  max-height: 36px;
  width: auto;
  opacity: 0.75;
  transition: opacity var(--transition);
}

.footer-panel__badge--rta {
  max-height: 44px;
}

.footer-panel__badge:hover {
  opacity: 1;
}

/* Bottom copyright bar */
.footer-bottom {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 14px 0 4px;
}

.footer-bottom__copyright {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0;
}

/* Responsive: 2-col on tablet */
@media (max-width: 900px) {
  .footer-panel {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
  }
  .footer-panel__col--brand {
    grid-column: 1 / -1;
  }
  .footer-panel__col--badges {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
}

/* Responsive: 1-col on mobile */
@media (max-width: 560px) {
  .footer-panel {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-panel__col--brand {
    grid-column: auto;
  }
}
