/* Listing header + filter controller. Loaded after gold.min.css on purpose. */
:root {
  --lt-gold: #d4a853;
  --lt-surface: #171717;
  --lt-surface-2: #202020;
  --lt-border: #303030;
  --lt-text: #f2f2f2;
  --lt-muted: #909090;
  --lt-shadow: 0 18px 55px rgba(0, 0, 0, .42);
}

html.light {
  --lt-gold: #b8860b;
  --lt-surface: #fff;
  --lt-surface-2: #f5f5f5;
  --lt-border: #dedede;
  --lt-text: #252525;
  --lt-muted: #777;
  --lt-shadow: 0 18px 45px rgba(35, 28, 15, .16);
}

.listing-heading {
  min-width: 0;
  gap: 12px;
  margin-bottom: 16px;
}

.listing-heading > .title,
.listing-heading .category-heading__top > .title {
  min-width: 0;
  margin: 0;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.15;
}

.video-list-heading > .listing-filters,
.mv-toolbar__filters .listing-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 7px;
  width: auto;
  min-width: 0;
  margin-left: auto;
  padding: 0;
  overflow: visible;
}

.listing-filters > .sort,
.models-heading__actions > .sort {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

.listing-filters .sort-title,
.models-heading__actions .sort-title {
  box-sizing: border-box;
  min-width: 0;
  max-width: 180px;
  min-height: 36px;
  padding: 7px 12px;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--lt-border);
  border-radius: 10px;
  background: var(--lt-surface);
  color: var(--lt-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.listing-filters > .sort:first-of-type .sort-title,
.models-heading__actions > .sort:first-child .sort-title {
  min-width: 118px;
}

.listing-filters .sort-title i,
.models-heading__actions .sort-title i {
  flex: 0 0 auto;
  margin-left: 1px;
}

.listing-filters .sort-title svg,
.models-heading__actions .sort-title svg {
  width: 14px;
  height: 14px;
}

.listing-filters .filter-icon-btn .sort-title[data-tooltip]::after {
  display: none;
}

.listing-filters .sort-title:hover,
.models-heading__actions .sort-title:hover,
.listing-filters .sort-title:focus-visible,
.models-heading__actions .sort-title:focus-visible,
.listing-filters .sort.sort-open > .sort-title,
.models-heading__actions .sort.sort-open > .sort-title {
  border-color: rgba(212, 168, 83, .72);
  border-radius: 10px;
  background: var(--lt-surface-2);
  color: var(--lt-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, .09);
}

.listing-filters .sort-drop,
.models-heading__actions .sort-drop {
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  box-sizing: border-box;
  width: max-content;
  min-width: max(100%, 172px);
  max-width: min(270px, calc(100vw - 24px));
  max-height: min(430px, 62vh);
  margin: 0;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--lt-border);
  border-radius: 12px;
  background: var(--lt-surface);
  box-shadow: var(--lt-shadow);
  transform: translate3d(0, -5px, 0);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
  z-index: 120;
}

.listing-filters > .sort:nth-last-of-type(-n+2) .sort-drop,
.models-heading__actions > .sort:last-child .sort-drop {
  right: 0;
  left: auto;
}

.listing-filters .sort-drop::before,
.models-heading__actions .sort-drop::before {
  display: none;
}

.listing-filters .sort.sort-open > .sort-drop,
.models-heading__actions .sort.sort-open > .sort-drop {
  border: 1px solid rgba(212, 168, 83, .42);
  border-radius: 12px;
  transform: translate3d(0, 0, 0);
}

.listing-filters .sort-drop a,
.models-heading__actions .sort-drop a {
  box-sizing: border-box;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--lt-text);
  text-align: left;
  cursor: pointer;
}

.listing-filters .sort-drop a:hover,
.listing-filters .sort-drop a:focus-visible,
.models-heading__actions .sort-drop a:hover,
.models-heading__actions .sort-drop a:focus-visible {
  background: var(--lt-surface-2);
  color: var(--lt-gold);
}

.listing-filters .sort-drop a.active {
  background: var(--lt-gold);
  color: #090909;
}

.vf-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 30px;
  margin-left: 4px;
  padding: 0 3px;
  color: var(--lt-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.listing-filters.is-vf-ready > .filter-icon-btn,
.listing-filters.is-vf-ready > .vf-reset {
  display: none !important;
}

.vf-filter-trigger,
.vf-mobile-sort-trigger {
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 12px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--lt-border);
  border-radius: 10px;
  background: var(--lt-surface);
  color: var(--lt-text);
  font: 650 13px/20px 'Quicksand', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.vf-filter-trigger {
  display: inline-flex;
}

.vf-mobile-sort-trigger {
  display: none;
}

.vf-filter-trigger svg,
.vf-mobile-sort-trigger svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vf-filter-trigger:hover,
.vf-filter-trigger:focus-visible,
.vf-filter-trigger[aria-expanded="true"],
.vf-mobile-sort-trigger:focus-visible,
.vf-mobile-sort-trigger[aria-expanded="true"] {
  border-color: rgba(212, 168, 83, .72);
  background: var(--lt-surface-2);
  color: var(--lt-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, .09);
}

.vf-filter-trigger.has-filters {
  border-color: rgba(212, 168, 83, .55);
  color: var(--lt-gold);
}

.vf-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--lt-gold);
  color: #090909;
  font-size: 10px;
  font-weight: 800;
}

.models-heading__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 7px;
  margin-left: auto;
}

.mv-toolbar__filters {
  display: flex;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.mv-toolbar__filters .listing-filters {
  width: 100%;
}

.listing-filters-cache-copy {
  display: none !important;
}

.mv-toolbar__filters:empty {
  display: none;
}

/* Keep the original heading usable until its controls are actually mounted. */
.mv-toolbar:not(.is-listing-toolbar-ready) ~ .mv-panel .box-content > .heading {
  display: flex !important;
}

.mv-toolbar--with-tabs .mv-toolbar__filters .vf-count {
  display: none;
}

.mv-layout .heading .filters-row > .sort ~ .sort {
  display: block !important;
}

.mv-layout .listing-filters.is-vf-ready > .filter-icon-btn {
  display: none !important;
}

.mv-layout .mv-panel .box-content > .video-list-heading {
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.mv-layout .box-content > .video-list-heading .listing-filters {
  width: 100%;
}

/* Category identity: Follow stays immediately after the title. */
.heading.heading--category-follow .category-heading__top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 1 auto;
  min-width: 0;
  gap: 8px;
}

.heading.heading--category-follow .category-heading__top > .title {
  flex: 0 1 auto;
}

.heading.heading--category-follow .category-heading__top > .cat-follow {
  flex: 0 0 auto;
}

.cat-follow__button {
  min-height: 34px;
  height: 34px;
  border-radius: 17px;
}

/* Shared desktop popover / mobile sheet. JS positions the desktop layer. */
.vf-sheet-layer[hidden] {
  display: none !important;
}

.vf-sheet-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(420px, calc(100vw - 24px));
  z-index: 1300;
  visibility: hidden;
  pointer-events: none;
}

.vf-sheet-layer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.vf-sheet__backdrop,
.vf-sheet__handle {
  display: none;
}

.vf-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(620px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid rgba(212, 168, 83, .34);
  border-radius: 16px;
  background: var(--lt-surface);
  box-shadow: var(--lt-shadow);
  color: var(--lt-text);
  opacity: 0;
  transform: translateY(-6px) scale(.985);
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease;
}

.vf-sheet-layer.opens-above .vf-sheet {
  transform-origin: bottom right;
}

.vf-sheet-layer.is-open .vf-sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.vf-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 54px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--lt-border);
}

.vf-sheet__title {
  margin: 0;
  color: var(--lt-text);
  font-size: 15px;
  font-weight: 800;
}

.vf-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--lt-surface-2);
  color: var(--lt-muted);
  font: 700 12px/1 'Quicksand', sans-serif;
  cursor: pointer;
}

.vf-sheet__close:hover,
.vf-sheet__close:focus-visible {
  color: var(--lt-gold);
}

.vf-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.vf-sheet__section {
  padding: 11px;
  border: 1px solid var(--lt-border);
  border-radius: 12px;
  background: var(--lt-surface-2);
  background: color-mix(in srgb, var(--lt-surface-2) 58%, transparent);
}

.vf-sheet__section + .vf-sheet__section {
  margin-top: 10px;
}

.vf-sheet__section--sort,
.vf-sheet__section--mode {
  display: none;
}

.vf-sheet__section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.vf-sheet__section-title {
  color: var(--lt-text);
  font-size: 12px;
  font-weight: 800;
}

.vf-sheet__selection {
  min-width: 0;
  overflow: hidden;
  color: var(--lt-muted);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf-sheet__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 7px;
}

.vf-sheet__option,
.vf-sheet__current {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--lt-border);
  border-radius: 9px;
  background: var(--lt-surface);
  color: var(--lt-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.vf-sheet__option:hover,
.vf-sheet__option:focus-visible {
  border-color: rgba(212, 168, 83, .52);
  color: var(--lt-gold);
}

.vf-sheet__option.is-selected,
.vf-sheet__current {
  border-color: var(--lt-gold);
  background: var(--lt-gold);
  color: #090909;
}

.vf-sheet__current {
  cursor: default;
}

.vf-sheet__footer {
  display: flex;
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--lt-border);
  background: var(--lt-surface);
}

.vf-sheet__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(212, 168, 83, .36);
  border-radius: 10px;
  background: rgba(212, 168, 83, .09);
  color: var(--lt-gold);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

/* Existing /models/ sheet: same mobile ergonomics and safe area. */
.sheet-overlay[aria-hidden="true"] {
  visibility: hidden;
}

.sheet-overlay.open[aria-hidden="false"] {
  visibility: visible;
}

.sheet {
  max-height: min(84dvh, 760px);
  overscroll-behavior: contain;
}

.sheet-sort-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sheet-sort-current,
.sheet-sort-option {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--lt-border);
  border-radius: 9px;
  background: var(--lt-surface-2);
  color: var(--lt-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.sheet-sort-option {
  cursor: pointer;
}

.sheet-sort-option:hover,
.sheet-sort-option:focus-visible {
  border-color: rgba(212, 168, 83, .55);
  color: var(--lt-gold);
}

.sheet-sort-current {
  border-color: var(--lt-gold);
  background: rgba(212, 168, 83, .12);
  color: var(--lt-gold);
}

.sheet-sort-current,
.sheet-sort-option,
.sheet-opt {
  min-height: 44px;
  padding: 9px 14px;
  font-family: inherit;
  text-align: center;
}

.sheet-clear,
.sheet-btn-reset,
.sheet-btn-apply,
.m-filter-btn {
  min-height: 44px;
}

.sheet-footer {
  padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
}

.sheet-sort-option:focus-visible,
.sheet-opt:focus-visible,
.sheet-clear:focus-visible,
.sheet-btn-reset:focus-visible,
.sheet-btn-apply:focus-visible,
.m-filter-btn:focus-visible {
  outline: 2px solid var(--lt-gold);
  outline-offset: 2px;
}

.fd-trigger:focus-visible,
.fd-opt:focus-visible,
.cp:focus-visible,
.af-chip:focus-visible,
.af-clear:focus-visible,
.mv-toolbar__tab:focus-visible {
  outline: 2px solid var(--lt-gold);
  outline-offset: 2px;
}

@media (max-width: 1100px) and (min-width: 768px) {
  .video-list-heading {
    flex-wrap: wrap;
  }

  .video-list-heading > .listing-filters {
    flex: 1 0 100%;
    width: 100%;
  }

  .mv-toolbar__filters {
    flex-basis: 100%;
  }
}

@media (max-width: 767px) {
  .listing-heading.listing-heading--with-filters,
  .models-list-heading,
  .heading.heading--category-follow {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 9px;
    margin-bottom: 14px;
  }

  .listing-heading > .title {
    width: 100%;
    font-size: 20px;
    line-height: 1.2;
  }

  .video-list-heading > .listing-filters,
  .mv-toolbar__filters .listing-filters {
    display: flex !important;
    justify-content: flex-start;
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0;
    gap: 7px;
    overflow: visible !important;
  }

  .listing-filters.is-vf-ready > .sort,
  .listing-filters.is-vf-ready > .vf-reset {
    display: none !important;
  }

  .vf-mobile-sort-trigger {
    display: inline-flex;
    max-width: min(46vw, 160px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vf-filter-trigger,
  .vf-mobile-sort-trigger {
    min-height: 44px;
    padding: 10px 11px;
  }

  .vf-mobile-sort-trigger .vf-trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .listing-filters .vf-count {
    order: 20;
    min-height: 44px;
    margin-right: 0;
    margin-left: auto;
    padding-right: 1px;
  }

  .heading.heading--category-follow .category-heading__top {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 7px;
  }

  .heading.heading--category-follow .category-heading__top > .title {
    flex: 0 1 auto !important;
    width: auto;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .heading.heading--category-follow .category-heading__top > .cat-follow {
    margin: 0;
  }

  .cat-follow__button {
    min-height: 44px;
    height: 44px;
    padding: 0 13px;
    border-radius: 22px;
    font-size: 12px;
  }

  .main .container .heading.heading--category-follow > .listing-filters {
    display: flex !important;
    grid-template-columns: none;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0;
    overflow: visible;
    gap: 7px;
  }

  .main .container .heading.heading--category-follow .vf-count {
    display: inline-flex;
  }

  .models-list-heading {
    align-items: stretch;
  }

  .is-model-sheet-ready .models-heading__actions {
    display: none;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    overflow: visible;
  }

  .models-heading__actions > .sort {
    flex: 1 1 0;
    min-width: 0;
  }

  .models-heading__actions .sort-title {
    width: 100%;
    min-width: 0 !important;
    max-width: none;
    min-height: 44px;
    padding: 9px 10px;
  }

  .models-heading__actions .sort-drop {
    right: auto;
    left: 0;
    min-width: 100%;
  }

  .models-heading__actions > .sort:last-child .sort-drop {
    right: 0;
    left: auto;
  }

  .mv-toolbar {
    align-items: center;
    gap: 9px;
  }

  .mv-toolbar__filters {
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
  }

  body.vf-sheet-open {
    overflow: hidden;
  }

  .vf-sheet-layer {
    inset: 0 !important;
    display: flex;
    align-items: flex-end;
    width: auto !important;
  }

  .vf-sheet__backdrop {
    position: absolute;
    inset: 0;
    display: block;
    background: rgba(0, 0, 0, .66);
    opacity: 0;
    transition: opacity .24s ease;
  }

  .vf-sheet-layer.is-open .vf-sheet__backdrop {
    opacity: 1;
  }

  .vf-sheet {
    position: relative;
    width: 100%;
    max-height: min(84dvh, 760px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    opacity: 1;
    transform: translateY(102%);
    transform-origin: bottom center;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  }

  .vf-sheet-layer.is-open .vf-sheet {
    transform: translateY(0);
  }

  .vf-sheet__handle {
    display: block;
    flex: 0 0 auto;
    width: 38px;
    height: 4px;
    margin: 9px auto 0;
    border-radius: 2px;
    background: #555;
  }

  .vf-sheet__header {
    min-height: 52px;
    padding-top: 5px;
  }

  .vf-sheet__close {
    min-width: 44px;
    min-height: 44px;
  }

  .vf-sheet__body {
    padding: 10px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  }

  .vf-sheet__section--sort,
  .vf-sheet__section--mode {
    display: block;
  }

  .vf-sheet__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vf-sheet__option,
  .vf-sheet__current {
    min-height: 44px;
  }

  .vf-sheet__footer {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .vf-sheet__body:last-child {
    padding-bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  }

  .vf-sheet__reset {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .vf-filter-trigger,
  .vf-mobile-sort-trigger {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 12px;
  }

  .video-list-heading > .listing-filters,
  .mv-toolbar__filters .listing-filters {
    flex-wrap: wrap;
  }

  .listing-filters .vf-count {
    flex: 1 0 100%;
    justify-content: flex-end;
    min-height: 20px;
    margin-top: -4px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vf-sheet,
  .vf-sheet__backdrop,
  .listing-filters .sort-drop,
  .models-heading__actions .sort-drop {
    transition-duration: .01ms !important;
  }
}

/* Compatibility for cached one-result blocks: controls have no decision value. */
.listing-filters--single-result > .sort,
.listing-filters--single-result .vf-filter-trigger,
.listing-filters--single-result .vf-mobile-sort-trigger,
.listing-filters--single-result > .vf-reset,
.listing-heading--single-result .listing-filters > .sort,
.listing-heading--single-result .vf-filter-trigger,
.listing-heading--single-result .vf-mobile-sort-trigger,
.listing-heading--single-result .vf-reset {
  display: none !important;
}

.listing-filters--single-result,
.listing-heading--single-result > .listing-filters {
  width: 100%;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .is-model-sheet-ready .models-heading__actions {
    display: none;
  }

  .active-filters {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .active-filters::-webkit-scrollbar {
    display: none;
  }
}
