:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --panel: #171717;
  --panel-soft: #1f1f1f;
  --line: #2b2b2b;
  --text: #eeeeee;
  --muted: #9d9d9d;
  --soft: #707070;
  --accent: #d2a15f;
  --danger: #e07171;
  --sidebar: 248px;
  --radius: 6px;
  --font-sans: "Helvetica Neue", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.mobile-header {
  display: none;
}

.page-shell {
  min-height: 100vh;
}

.browse-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.browse-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 22px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #111111;
}

.sidebar-brand {
  margin-bottom: 2px;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0;
}

.primary-rail,
.filter-strip,
.tag-cloud {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.primary-rail a,
.filter-pill,
.tag {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.25;
}

.primary-rail a:hover,
.filter-pill:hover,
.tag:hover,
.primary-rail a.is-active,
.filter-pill.is-active,
.tag.is-active {
  background: var(--panel-soft);
  color: var(--text);
}

.browse-rail h2 {
  margin: 0 0 9px;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.browse-main {
  min-width: 0;
  padding: 34px clamp(18px, 4vw, 54px) 54px;
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.page-title p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-panel {
  flex: 0 0 min(340px, 38vw);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121212;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 10px 12px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #141414;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.section-heading span {
  color: var(--soft);
  font-size: 0.88rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.video-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #090909;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

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

.duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  font-size: 0.75rem;
}

.play-dot {
  display: none;
}

.video-card__body {
  padding: 12px;
}

.video-card h2 {
  display: -webkit-box;
  min-height: 2.45em;
  margin: 0 0 9px;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft);
  font-size: 0.8rem;
}

.video-card__meta a,
.creator-link {
  color: var(--muted);
}

.creator-link {
  display: inline-flex;
  margin-top: 7px;
  font-size: 0.82rem;
}

.video-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.video-card__tags a {
  color: var(--soft);
  font-size: 0.78rem;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 54px);
}

.watch-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}

.watch-copy h1 {
  margin: 16px 0 12px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.watch-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.category-link {
  display: inline-flex;
  margin: 0 7px 7px 0;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
}

.watch-copy__stats,
.admin-list__top,
.admin-item__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watch-copy__stats {
  justify-content: space-between;
  color: var(--soft);
  font-size: 0.88rem;
}

.player-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050505;
  aspect-ratio: 16 / 9;
}

.player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
  color: var(--muted);
}

.pager a {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--panel);
}

.empty-state,
.admin-login {
  width: min(560px, 100%);
  margin: 80px auto;
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 54px);
}

.admin-form,
.admin-list,
.admin-login form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-login form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 12px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.admin-list__top {
  justify-content: space-between;
  margin-bottom: 12px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.analytics-summary article,
.analytics-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141414;
}

.analytics-summary article {
  padding: 12px;
}

.analytics-summary span,
.analytics-panel p,
.analytics-row small {
  color: var(--soft);
  font-size: 0.8rem;
}

.analytics-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 1.35rem;
}

.analytics-panel {
  margin-bottom: 14px;
  padding: 12px;
}

.analytics-panel h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.analytics-video {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.analytics-video:first-of-type {
  border-top: 0;
}

.analytics-video img {
  width: 72px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: #090909;
}

.analytics-video h4 {
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.analytics-video p {
  margin: 0;
}

.analytics-video > strong,
.analytics-row strong {
  color: var(--text);
  font-size: 0.9rem;
}

.analytics-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.analytics-row:first-of-type {
  border-top: 0;
}

.analytics-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-section-title {
  margin: 20px 0 10px;
  font-size: 1rem;
}

.admin-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-item img {
  width: 120px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: #090909;
}

.admin-item h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.admin-item p {
  margin-bottom: 8px;
  color: var(--muted);
}

.admin-item__actions {
  flex-wrap: wrap;
}

.admin-item__actions a,
.admin-item__actions button,
.button-ghost {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
}

.validation,
[data-valmsg-for] {
  color: var(--danger);
  font-size: 0.84rem;
}

.site-footer {
  display: none;
}

@media (max-width: 1280px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #111111;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .brand__mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--panel-soft);
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
  }

  .brand__text small {
    color: var(--soft);
    font-size: 0.7rem;
  }

  .site-nav {
    display: flex;
    gap: 8px;
  }

  .site-nav a {
    color: var(--muted);
    font-size: 0.9rem;
  }

  .browse-layout,
  .watch-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .browse-rail {
    position: static;
    height: auto;
    padding: 16px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    display: none;
  }

  .primary-rail,
  .filter-strip,
  .tag-cloud {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .browse-main,
  .watch-layout,
  .admin-grid {
    padding: 22px 14px 36px;
  }

  .page-title {
    flex-direction: column;
  }

  .search-panel {
    flex: auto;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .form-row,
  .admin-item,
  .analytics-columns {
    grid-template-columns: 1fr;
  }

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

  .admin-item img {
    width: 100%;
  }
}

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

  .analytics-summary,
  .analytics-video,
  .analytics-row {
    grid-template-columns: 1fr;
  }
}

/* Tube-style ScatArchive redesign overrides */
:root {
  --bg: #08090a;
  --panel: #121416;
  --panel-soft: #1a1d20;
  --panel-raised: #202429;
  --line: #2a3036;
  --line-soft: #1c2025;
  --text: #f2f4f6;
  --muted: #a2abb4;
  --soft: #707b86;
  --accent: #c99a45;
  --accent-strong: #e0b764;
  --sidebar: 244px;
  --radius: 4px;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 210px),
    var(--bg);
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 244px minmax(260px, 560px) auto;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px clamp(14px, 2vw, 26px);
  border-bottom: 1px solid #252b31;
  background: rgba(8, 9, 10, 0.96);
  backdrop-filter: blur(12px);
}

.mobile-menu-toggle,
.mobile-search-toggle {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(224, 183, 100, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #2a2418, #171410);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.08;
}

.brand__text strong {
  font-size: 1.16rem;
  letter-spacing: 0;
}

.brand__text small {
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-search {
  position: relative;
  display: flex;
  justify-self: center;
  width: min(100%, 560px);
  min-width: 0;
}

.site-search::before {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  width: 13px;
  height: 13px;
  border: 2px solid #a8b0b8;
  border-radius: 50%;
  content: "";
  transform: translateY(-56%);
  pointer-events: none;
}

.site-search::after {
  position: absolute;
  top: 50%;
  left: 27px;
  z-index: 1;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #a8b0b8;
  content: "";
  transform: translateY(5px) rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}

.site-search input {
  flex: 1 1 auto;
  height: 42px;
  min-height: 42px;
  min-width: 0;
  padding-left: 42px;
  border-color: #30363d;
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: #202020;
  color: #eef1f4;
  font-size: 0.93rem;
}

.site-search button {
  flex: 0 0 86px;
  width: 86px;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  color: #090909;
  font-size: 0.86rem;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-nav a:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.site-nav .partner-link {
  color: var(--accent-strong);
}

.page-shell {
  min-height: calc(100vh - 64px);
  max-width: 100vw;
  overflow-x: hidden;
}

.browse-layout {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  max-width: 100vw;
  overflow-x: hidden;
}

.browse-rail {
  top: 64px;
  height: calc(100vh - 64px);
  gap: 18px;
  padding: 18px 14px 24px;
  border-right: 1px solid #2b323a;
  background: #090a0b;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.025);
  scrollbar-width: thin;
  scrollbar-color: #343b43 transparent;
}

.sidebar-brand {
  display: none;
}

.primary-rail a,
.filter-pill,
.tag {
  min-height: 31px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #9ca6b0;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.primary-rail a:hover,
.filter-pill:hover,
.tag:hover,
.primary-rail a.is-active,
.filter-pill.is-active,
.tag.is-active {
  border-color: #26303a;
  background: #15191e;
  color: #ffffff;
}

.primary-rail a.is-active,
.filter-pill.is-active,
.tag.is-active {
  border-color: rgba(224, 183, 100, 0.36);
  background: linear-gradient(90deg, rgba(201, 154, 69, 0.18), #15191e 68%);
  box-shadow: inset 3px 0 0 var(--accent);
}

.browse-rail h2 {
  margin: 0 0 8px;
  padding: 14px 2px 0;
  border-top: 1px solid #1b2025;
  color: #7f8a95;
  font-size: 0.69rem;
}

.browse-rail > div:first-of-type h2 {
  padding-top: 0;
  border-top: 0;
}

.filter-strip,
.tag-cloud {
  gap: 5px;
}

.browse-main {
  padding: 24px clamp(16px, 3vw, 38px) 46px;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  overflow-x: hidden;
}

.page-title {
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.quick-category-strip {
  display: flex;
  gap: 8px;
  margin: -2px 0 18px;
  padding-bottom: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}

.quick-category-strip::-webkit-scrollbar {
  display: none;
}

.quick-category-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #232a31;
  border-radius: 999px;
  background: #121518;
  color: #b4bec8;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.quick-category-strip a:hover,
.quick-category-strip a.is-active {
  border-color: rgba(224, 183, 100, 0.44);
  background: #1b2025;
  color: #fff;
}

h1 {
  margin-bottom: 7px;
  font-size: clamp(1.65rem, 2.7vw, 2.55rem);
  line-height: 1.05;
}

.page-title p {
  max-width: 760px;
  color: #99a3ad;
  font-size: 0.95rem;
}

.search-panel {
  display: none;
}

.section-heading {
  min-height: 42px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading > span {
  color: var(--soft);
  font-size: 0.84rem;
}

.sort-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.sort-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-bottom: 2px solid transparent;
  color: #98a2ad;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.sort-tabs a:hover,
.sort-tabs a.is-active {
  color: #ffffff;
}

.sort-tabs a.is-active {
  border-bottom-color: var(--accent);
}

.mobile-sort-menu {
  display: none;
}

.video-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px 16px;
}

.video-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
}

.video-card__thumb {
  aspect-ratio: 16 / 9;
  border: 1px solid #15191d;
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  max-width: 100%;
}

.video-card__thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.48));
  opacity: 0;
  transition: opacity 160ms ease;
}

.video-card:hover .video-card__thumb::after {
  opacity: 1;
}

.duration {
  z-index: 2;
  right: 7px;
  bottom: 7px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.video-card__body {
  padding: 9px 0 0;
  min-width: 0;
}

.video-card h2 {
  min-height: 2.55em;
  margin-bottom: 7px;
  color: #eef1f4;
  font-size: 0.94rem;
  font-weight: 800;
}

.video-card h2 a {
  overflow-wrap: anywhere;
}

.video-card h2 a:hover {
  color: var(--accent-strong);
}

.video-card__meta,
.video-card__submeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #77818c;
  font-size: 0.78rem;
  line-height: 1.35;
}

.video-card__meta a,
.creator-link {
  color: #a6b0ba;
}

.creator-link {
  display: inline-flex;
  margin-top: 0;
}

.video-card__tags {
  gap: 5px;
  margin-top: 8px;
}

.video-card__tags a {
  color: #737d88;
  font-size: 0.75rem;
}

.watch-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "player copy"
    "related related";
  gap: 22px;
  padding: 24px clamp(16px, 3vw, 38px) 30px;
  max-width: 100vw;
  overflow-x: hidden;
}

.player-shell {
  grid-area: player;
  border-color: #161a1e;
  border-radius: var(--radius);
}

.watch-copy {
  grid-area: copy;
  align-self: start;
  border-color: var(--line);
  border-radius: var(--radius);
  background: #101214;
}

.watch-copy h1 {
  margin-top: 14px;
  font-size: clamp(1.45rem, 2vw, 2.05rem);
  line-height: 1.08;
}

.watch-copy p {
  color: #9ca6b0;
  font-size: 0.94rem;
}

.category-link {
  background: #1b2025;
  color: #c1c8d0;
  font-size: 0.78rem;
  font-weight: 800;
}

.related-section {
  padding: 0 clamp(16px, 3vw, 38px) 54px;
}

.related-section .section-heading {
  margin-bottom: 16px;
  padding-top: 20px;
}

.video-grid--related {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 3vw, 38px);
  border-top: 1px solid var(--line-soft);
  color: var(--soft);
  font-size: 0.78rem;
}

.directory-page {
  padding: 24px clamp(16px, 3vw, 38px) 54px;
  max-width: 100vw;
  overflow-x: hidden;
}

.directory-title {
  margin-bottom: 22px;
}

.directory-heading {
  margin-top: 8px;
}

.category-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.category-card {
  position: relative;
  display: block;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid #171c21;
  border-radius: var(--radius);
  background: #121416;
}

.category-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
  transition: transform 180ms ease;
}

.category-card:hover img {
  transform: scale(1.035);
}

.category-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.78));
}

.category-card__copy {
  position: absolute;
  right: 12px;
  bottom: 11px;
  left: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.category-card__copy strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1.08;
}

.category-card__copy small {
  color: #c3ccd6;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.category-list-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.category-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #232a31;
  border-radius: var(--radius);
  background: #101214;
}

.category-list-item:hover {
  border-color: rgba(224, 183, 100, 0.38);
  background: #171b20;
}

.category-list-item strong {
  color: #eef1f4;
  font-size: 0.92rem;
}

.category-list-item span {
  color: #77818c;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1440px) {
  .video-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: auto minmax(220px, 1fr);
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .browse-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  :root {
    --sidebar: 210px;
  }

  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .watch-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "player"
      "copy";
  }

  .category-card-grid,
  .category-list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .site-header {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    min-height: 52px;
    padding: 6px 52px;
    max-width: 100vw;
    overflow: visible;
  }

  .mobile-menu-toggle,
  .mobile-search-toggle {
    position: relative;
    z-index: 3;
    display: inline-grid;
    width: 36px;
    height: 36px;
    min-height: 36px;
    place-items: center;
    align-self: center;
    border: 1px solid #3a4652;
    border-radius: 999px;
    background: #15191e;
    color: #eef1f4;
  }

  .mobile-menu-toggle {
    position: absolute;
    top: 8px;
    left: 12px;
    padding: 0;
  }

  .mobile-search-toggle {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 0;
  }

  .mobile-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
  }

  .mobile-icon--close {
    display: none;
  }

  .site-header.is-menu-open .mobile-menu-toggle .mobile-icon--menu,
  .site-header.is-search-open .mobile-search-toggle .mobile-icon--search {
    display: none;
  }

  .site-header.is-menu-open .mobile-menu-toggle .mobile-icon--close,
  .site-header.is-search-open .mobile-search-toggle .mobile-icon--close {
    display: block;
  }

  .site-header > .brand {
    align-items: center;
    max-width: 100%;
    text-align: center;
  }

  .site-header > .brand .brand__wordmark {
    font-size: clamp(1.16rem, 5.4vw, 1.48rem);
  }

  .site-header > .brand .brand__tagline {
    display: none;
  }

  .site-search {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    z-index: 70;
    display: flex;
    width: 100%;
    max-width: none;
    padding: 10px 12px 12px;
    border-bottom: 1px solid #252b31;
    background: rgba(8, 9, 10, 0.98);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 140ms ease, transform 140ms ease;
  }

  .site-header.is-search-open .site-search {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-search input {
    height: 42px;
    min-height: 42px;
  }

  .site-search button {
    min-height: 42px;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    z-index: 65;
    display: none;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 58px);
    padding: 12px;
    overflow-y: auto;
    border-bottom: 1px solid #252b31;
    background: #08090a;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.44);
  }

  .site-header.is-menu-open .site-nav {
    display: flex;
  }

  .site-nav > a,
  .nav-menu__trigger {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #20272e;
    background: #111418;
  }

  .site-nav .partner-link {
    color: var(--accent-strong);
  }

  .browse-layout,
  .watch-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .browse-rail {
    display: none;
  }

  .browse-main {
    order: 1;
    max-width: 100vw;
    margin-right: auto;
    margin-left: auto;
  }

  .primary-rail,
  .filter-strip,
  .tag-cloud {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .browse-main,
  .watch-layout,
  .admin-grid {
    padding: 18px 14px 34px;
  }

  .related-section {
    padding: 0 14px 38px;
  }

  .page-title {
    align-items: start;
    max-width: 100%;
    overflow: hidden;
  }

  .page-title p,
  .page-title h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .directory-page {
    padding: 18px 14px 38px;
  }

  .category-card-grid,
  .category-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .browse-main,
  .page-title,
  .section-heading,
  .video-grid,
  .video-card,
  .video-card__thumb {
    width: 100%;
    max-width: calc(100vw - 28px);
  }

  .browse-main {
    justify-self: center;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px 12px;
  }

  .video-grid--related {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    overflow: visible;
  }

  .sort-tabs {
    display: none;
  }

  .mobile-sort-menu {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
  }

  .section-heading > span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .mobile-sort-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid #242b33;
    border-radius: 999px;
    background: #111418;
    color: #aeb8c2;
    font-size: 0.86rem;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
  }

  .mobile-sort-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-sort-menu summary::after {
    width: 0;
    height: 0;
    margin-left: auto;
    border-top: 5px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    content: "";
    opacity: 0.8;
  }

  .mobile-sort-menu[open] summary {
    border-color: rgba(224, 183, 100, 0.44);
    color: #fff;
  }

  .mobile-sort-menu[open] summary::after {
    transform: rotate(180deg);
  }

  .mobile-sort-menu div {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 25;
    display: grid;
    width: min(230px, calc(100vw - 28px));
    padding: 6px;
    border: 1px solid #27313a;
    border-radius: var(--radius);
    background: #0d1013;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  }

  .mobile-sort-menu a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: #aeb8c2;
    font-size: 0.88rem;
    font-weight: 800;
  }

  .mobile-sort-menu a:hover,
  .mobile-sort-menu a.is-active {
    background: #171c21;
    color: #fff;
  }

  .quick-category-strip {
    margin-right: -14px;
    margin-left: -14px;
    padding: 0 14px 12px;
  }

  .category-card-grid,
  .category-list-grid,
  .category-card,
  .category-list-item {
    width: 100%;
    max-width: calc(100vw - 28px);
  }

  .category-card-grid,
  .category-list-grid {
    grid-template-columns: 1fr;
  }

  .site-search input,
  .site-search button {
    min-height: 40px;
  }

  .site-search input {
    border-radius: 999px 0 0 999px;
  }

  .site-search button {
    flex-basis: 82px;
    width: 82px;
    border-radius: 0 999px 999px 0;
  }
}

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

.site-nav {
  overflow: visible;
}

.nav-menu {
  position: relative;
  display: inline-flex;
}

.nav-menu::after {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 14px;
  content: "";
}

.nav-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-menu__trigger::after {
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  opacity: 0.78;
}

.nav-menu:hover .nav-menu__trigger,
.nav-menu.is-open .nav-menu__trigger {
  background: var(--panel-soft);
  color: var(--text);
}

.nav-menu__panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 60;
  display: grid;
  gap: 6px;
  min-width: 240px;
  max-width: min(760px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 92px));
  padding: 12px;
  overflow-y: auto;
  border: 1px solid #2b323a;
  border-radius: var(--radius);
  background: #101214;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-menu:first-of-type .nav-menu__panel {
  left: 0;
  right: auto;
}

.nav-menu.is-open .nav-menu__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-menu__panel--compact {
  grid-template-columns: 1fr;
  width: 280px;
}

.nav-menu__panel--wide {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  width: min(620px, calc(100vw - 28px));
}

.nav-menu__panel--wide .nav-menu__featured {
  grid-column: 1 / -1;
  min-height: 52px;
  border: 1px solid rgba(224, 183, 100, 0.26);
  background: #171512;
}

.nav-menu__panel a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: #c4ccd4;
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-menu__panel a:hover,
.nav-menu__panel a:focus {
  background: #1b2025;
  color: #fff;
}

.nav-menu__panel a span {
  margin-top: 3px;
  color: #77818c;
  font-size: 0.76rem;
  font-weight: 700;
}

@media (max-width: 920px) {
  .site-nav {
    flex-wrap: nowrap;
  }

  .nav-menu {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .nav-menu__panel {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    display: none;
    width: auto;
    max-width: none;
    max-height: none;
    padding: 8px;
    border-color: #20272e;
    background: #0f1215;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .nav-menu.is-open .nav-menu__panel {
    display: grid;
  }

  .nav-menu__panel--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .nav-menu__panel--wide,
  .nav-menu__panel--compact {
    grid-template-columns: 1fr;
  }
}

.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.brand__mark,
.brand__text {
  display: none;
}

.brand__wordmark {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  color: #fff;
  font-size: clamp(1.55rem, 2.1vw, 2.05rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand__wordmark-main {
  color: #f4f6f8;
}

.brand__wordmark-accent {
  display: inline-flex;
  align-items: center;
  min-height: 1.1em;
  margin-left: 3px;
  padding: 0 7px 2px;
  border: 1px solid rgba(224, 183, 100, 0.38);
  border-radius: 5px;
  background: linear-gradient(180deg, #d7a64c, #b98229);
  color: #090909;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand__tagline {
  display: block;
  margin-left: 2px;
  margin-top: -3px;
  color: #858f99;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .brand {
    gap: 4px;
  }

  .brand__wordmark {
    font-size: 1.35rem;
  }

  .brand__tagline {
    margin-left: 0;
    font-size: 0.62rem;
  }
}
