/*
 * ClipScout search-results refinement layer.
 *
 * This file intentionally contains only the result hierarchy and presentation
 * adjustments approved after the August 13 review. Keeping these overrides
 * separate from the base layout makes ranking labels, atmosphere, filter glass,
 * and card typography independently reversible and easier to tune.
 */

.view-results {
  --results-header-height: 112px;
  --results-content-gutter: 44px;
  --results-group-gap: 62px;
  --results-row-gap: 38px;
}

/*
 * Page-wide artwork atmosphere
 * ----------------------------
 * Thumbnail palettes are sampled once in app.js and composed into broad radial
 * fields here. No full-screen filter, card-shaped glow, or global veil sits
 * above the results; artwork and text remain naturally vivid at rest.
 */
.results-page-atmosphere {
  display: none;
}

.view-results .results-page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  background: var(--results-atmosphere,
    radial-gradient(ellipse 62% 54% at 10% 24%, rgba(48, 145, 158, 0.25), transparent 72%),
    radial-gradient(ellipse 60% 52% at 88% 68%, rgba(125, 82, 149, 0.23), transparent 72%),
    linear-gradient(145deg, #263846 0%, #385462 48%, #6b7982 100%));
  background-color: #304754;
  opacity: 0.9;
  pointer-events: none;
  transform: translateZ(0);
  transition: opacity 240ms ease;
}

.view-results .results-page-atmosphere::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(21, 39, 49, 0.2), transparent 18%, transparent 84%, rgba(26, 38, 45, 0.12));
}

.view-results .results-page-atmosphere.is-populated {
  opacity: 1;
}

body.view-results::after {
  content: none;
}

.view-results .app-shell {
  position: relative;
  z-index: 1;
}

/* Keep the sticky controls compact and terminate their glass at a deliberate
 * edge. The former 160px masked fade washed over the first result heading and
 * made the header appear much taller than its actual controls. */
.view-results .topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--results-header-height);
}

.view-results .topbar::before {
  inset: 0;
  background:
    linear-gradient(112deg, rgba(35, 56, 68, 0.72), rgba(47, 62, 72, 0.6) 58%, rgba(39, 50, 62, 0.68)),
    rgba(31, 49, 60, 0.34);
  -webkit-backdrop-filter: blur(20px) saturate(0.96);
  backdrop-filter: blur(20px) saturate(0.96);
  -webkit-mask-image: none;
  mask-image: none;
  box-shadow: 0 10px 24px rgba(5, 14, 21, 0.12);
}

.view-results .results-shell,
.view-results .results-layout,
.view-results .results-content {
  min-height: calc(100vh - var(--results-header-height));
}

.view-results .filters-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--results-header-height) + 10px);
  z-index: 20;
  max-height: calc(100vh - var(--results-header-height) - 20px);
  transform: none;
  padding-top: 10px;
  gap: 26px;
}

.view-results .results-content {
  padding: 10px var(--results-content-gutter) 180px;
}

.channel-page-heading {
  margin: 2px 0 34px;
}

.channel-page-back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: rgba(230, 237, 243, .68);
  text-decoration: none;
}

.channel-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-page-follow {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .75rem .95rem;
  border: 1px solid rgba(183, 225, 237, .16);
  color: #f7f9fb;
  background: rgba(5, 17, 24, .3);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
}

.channel-page-follow svg {
  width: var(--interface-icon-size, 20px);
  height: var(--interface-icon-size, 20px);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--interface-icon-stroke, 1.5);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-page-follow:hover,
.channel-page-follow:focus-visible,
.channel-page-follow[aria-pressed="true"] {
  border-color: rgba(176, 149, 255, .55);
  color: #fff;
  background: rgba(104, 73, 170, .3);
}

.channel-page-follow[aria-pressed="true"] svg {
  fill: currentColor;
}

.channel-page-back {
  margin-bottom: 14px;
  font-size: .82rem;
  font-weight: 680;
}

.channel-page-back svg,
.channel-page-icon svg {
  width: var(--interface-icon-size, 20px);
  height: var(--interface-icon-size, 20px);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--interface-icon-stroke, 1.5);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.channel-page-back:hover,
.channel-page-back:focus-visible {
  color: white;
}

.channel-page-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  padding: clamp(20px, 2.5vw, 34px);
  border: 1px solid rgba(183, 225, 237, .16);
  border-radius: 18px;
  background: linear-gradient(118deg, rgba(11, 34, 45, .72), rgba(34, 39, 59, .56));
  box-shadow: 0 22px 54px rgba(3, 12, 18, .2);
  backdrop-filter: blur(18px) saturate(115%);
}

.channel-page-icon {
  width: clamp(56px, 6vw, 78px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #c2afff;
  border: 1px solid rgba(176, 149, 255, .5);
  border-radius: 50%;
  background: rgba(104, 73, 170, .2);
  box-shadow: inset 7px 7px 16px rgba(3, 12, 18, .32), inset -6px -6px 18px rgba(159, 132, 234, .1);
}

.channel-page-icon svg {
  width: var(--interface-icon-size-identity, 28px);
  height: var(--interface-icon-size-identity, 28px);
}

.channel-page-copy {
  min-width: 0;
}

.channel-page-copy p,
.channel-page-copy h1,
.channel-page-copy span {
  margin: 0;
}

.channel-page-copy p {
  color: #a98bff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.channel-page-copy h1 {
  overflow: hidden;
  margin-top: .25rem;
  color: #f7f9fb;
  font-size: clamp(2rem, 4vw, 4.25rem);
  line-height: 1;
  letter-spacing: -.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-page-copy span {
  display: block;
  margin-top: .55rem;
  color: rgba(225, 234, 240, .58);
}

.view-channel .filter-group-focus {
  display: none;
}

.view-channel .result-group-channel .result-group-heading {
  color: rgba(231, 236, 242, .86);
}

/* Content wrappers stay open so edge-card shadows and menus are never clipped.
 * The fixed atmosphere cannot affect layout geometry; only the document root
 * owns the final horizontal-overflow safeguard. */
.view-results .app-shell,
.view-results .results-shell,
.view-results .results-layout,
.view-results .results-content,
.view-results .results-sections {
  overflow: visible;
}

/* Provider-neutral hierarchy: one focused answer group, then discoveries. */
.unified-results-grid {
  gap: var(--results-group-gap);
}

.result-group {
  position: relative;
  min-width: 0;
}

.result-group-heading {
  position: relative;
  z-index: 2;
  min-height: 26px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 18px;
  color: rgba(224, 231, 238, 0.78);
}

.result-group-heading h2 {
  margin: 0;
  color: inherit;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.result-group-count {
  margin-left: 7px;
  color: rgba(214, 222, 228, 0.58);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-group-mark {
  color: #a88dff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
  line-height: 0.8;
  text-shadow: 0 0 8px rgba(157, 128, 255, 0.68);
}

.result-group-best .result-group-heading {
  color: rgba(248, 250, 252, 0.97);
  text-shadow: 0 2px 14px rgba(3, 10, 15, 0.54);
}

.result-group-discovery .result-group-heading {
  color: rgba(221, 229, 234, 0.78);
}

.result-group-rows {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--results-row-gap);
}

/* Loading keeps the production hierarchy instead of predicting a generic
 * card mix. The first slab reserves the recommendation canvas, its two peers
 * occupy the supporting stack, and discovery slabs use the normal feed grid. */
@media (min-width: 1201px) {
  .loading-results .result-group-best .loading-best-row {
    height: clamp(440px, 52vh, 620px);
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 24px 38px;
  }

  .loading-results .result-group-best .loading-best-row .result-card {
    height: 100%;
    aspect-ratio: auto;
  }

  .loading-results .result-group-best .loading-best-row .is-featured {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .loading-results .result-group-best .loading-best-row .result-card:not(.is-featured) {
    grid-column: 2;
  }
}

.loading-results .loading-discovery-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.loading-results .result-group-discovery .result-card:nth-of-type(n + 4) {
  margin-top: 2px;
}

/* The lead result receives more canvas, but every best-match upload remains visible. */
@media (min-width: 1201px) {
  .result-group-best .result-row:first-child {
    height: clamp(440px, 52vh, 620px);
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 24px 38px;
    align-items: stretch;
  }

  .result-group-best .result-row:first-child .result-card {
    height: 100%;
    aspect-ratio: auto;
  }

  .result-group-best .result-row:first-child .is-featured {
    grid-column: 1;
    grid-row: 1 / span 2;
    aspect-ratio: auto;
  }

  .result-group-best .result-row:first-child .result-card:not(.is-featured) {
    grid-column: 2;
  }

  .result-group-best.result-group-count-1 .result-row:first-child {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .result-group-best.result-group-count-2 .result-row:first-child .result-card:not(.is-featured) {
    grid-row: 1 / span 2;
  }

  .result-group-best .is-featured .result-title {
    max-width: 82%;
    font-size: clamp(28px, 2.15vw, 38px);
    font-weight: 620;
    line-height: 1.08;
  }

  .result-group-best .is-featured .card-body {
    padding: 128px 104px 54px 34px;
  }

  .result-group-best .is-featured .view-count,
  .result-group-best .is-featured .duration {
    bottom: 21px;
    font-size: 13px;
  }

  .result-group-best .is-featured .view-count {
    left: 34px;
  }

  .result-group-best .result-card:not(.is-featured) .result-title {
    font-size: clamp(16px, 1.18vw, 19px);
  }

  .result-group-best .result-card:not(.is-featured) .card-body {
    padding: 54px 60px 38px 18px;
  }
}

@media (min-width: 1201px) and (max-height: 850px) {
  .result-group-best .result-row:first-child {
    height: clamp(400px, 49vh, 450px);
  }

  .view-results .results-content {
    padding-top: 12px;
  }
}

/* Supporting controls deliberately recede behind the artwork. The pane keeps
 * enough atmospheric translucency to read as glass, while its neutral base is
 * opaque enough that artwork color never competes with filter labels. */
.view-results .filter-group {
  flex: 0 0 auto;
  overflow: hidden;
  padding: 22px 20px 24px;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(226, 239, 244, 0.1), rgba(49, 70, 83, 0.12) 48%, rgba(10, 23, 33, 0.18)),
    rgba(19, 38, 51, 0.62);
  -webkit-backdrop-filter: blur(7px) saturate(1.02);
  backdrop-filter: blur(7px) saturate(1.02);
  box-shadow:
    inset 0 1px rgba(243, 249, 251, 0.08),
    inset 1px 0 rgba(225, 239, 244, 0.025),
    inset 0 -1px rgba(5, 13, 19, 0.08),
    0 8px 20px rgba(2, 9, 14, 0.06);
}

.view-results .filter-group::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(244, 250, 252, 0.035), transparent 28%, transparent 74%, rgba(138, 114, 226, 0.018));
  pointer-events: none;
}

.view-results .filter-button {
  position: relative;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 4px;
  font-size: 14px;
  color: rgba(220, 226, 235, 0.68);
  font-weight: 500;
}

.view-results .filter-options {
  gap: 1px;
}

.view-results .filter-count {
  min-width: 2ch;
  color: rgba(214, 222, 229, 0.54);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  text-align: right;
}

.view-results .filter-button.is-unavailable {
  color: rgba(210, 217, 225, 0.34);
}

.view-results .filter-button:disabled {
  cursor: default;
  text-decoration: none;
  text-shadow: none;
}

.view-results .filter-button.is-active {
  padding-left: 12px;
  color: rgba(247, 249, 251, 0.9);
  font-weight: 640;
}

.view-results .filter-button.is-active::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 2px;
  height: 15px;
  content: "";
  border-radius: 4px;
  background: rgba(177, 154, 255, 0.78);
  box-shadow: 0 0 6px rgba(151, 122, 255, 0.4);
  transform: translateY(-50%);
}

.view-results .filter-group h2 {
  color: rgba(236, 241, 244, 0.78);
  border-bottom-color: rgba(143, 166, 177, 0.22);
  font-size: 19px;
  font-weight: 670;
  text-shadow: none;
}

.view-results .filter-group h2::after {
  width: 54%;
  background: rgba(168, 141, 255, 0.7);
  box-shadow: 0 0 8px rgba(145, 112, 255, 0.34);
}

.view-results .filter-heading-slash {
  color: rgba(168, 141, 255, 0.72);
  font-weight: 720;
}

/* Editorial card type: less weight, better edge rhythm, quieter metadata. */
.unified-results-grid .card-body {
  padding: 76px 76px 44px 25px;
}

.unified-results-grid .is-short .card-body {
  padding: 104px 62px 46px 23px;
}

.unified-results-grid .result-title {
  font-size: clamp(20px, 1.42vw, 24px);
  font-weight: 620;
  line-height: 1.14;
  letter-spacing: -0.026em;
  overflow-wrap: normal;
  text-wrap: pretty;
}

.unified-results-grid .result-description {
  max-width: calc(100% - 12px);
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: rgba(226, 231, 238, 0.72);
  font-size: 11.5px;
  font-weight: 560;
  line-height: 1.24;
  letter-spacing: -0.012em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  text-shadow: 0 2px 7px rgba(4, 10, 15, 0.78);
}

.unified-results-grid .result-badges {
  position: absolute;
  top: 16px;
  left: 17px;
  z-index: 3;
  max-width: calc(100% - 78px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.unified-results-grid .result-badges span {
  padding: 5px 8px;
  overflow: hidden;
  color: rgba(248, 247, 255, 0.9);
  background: rgba(8, 20, 31, 0.42);
  border: 1px solid rgba(213, 203, 255, 0.16);
  border-radius: 8px;
  -webkit-backdrop-filter: blur(8px) saturate(1.08);
  backdrop-filter: blur(8px) saturate(1.08);
  font-size: 9.5px;
  font-weight: 720;
  letter-spacing: 0.035em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 5px 13px rgba(3, 10, 16, 0.18);
}

@media (min-width: 1201px) {
  .result-group-best .is-featured .result-description {
    margin-top: 9px;
    font-size: 13px;
  }

  .result-group-best .is-featured .result-badges {
    top: 22px;
    left: 24px;
  }

  .result-group-best .is-featured .result-badges span {
    padding: 6px 9px;
    font-size: 10px;
  }
}

.unified-results-grid .is-short .result-title {
  font-size: clamp(18px, 1.2vw, 21px);
}

.unified-results-grid .view-count,
.unified-results-grid .duration {
  bottom: 16px;
  color: rgba(247, 249, 251, 0.88);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.005em;
  text-shadow: 0 2px 7px rgba(4, 10, 15, 0.82);
}

.unified-results-grid .view-count {
  left: 25px;
}

.unified-results-grid .duration {
  right: 20px;
}

/* Actions remain available, but artwork leads until the user engages a card. */
.unified-results-grid .card-action {
  width: 35px;
  height: 35px;
  opacity: 0.7;
  transition: opacity 140ms ease, color 140ms ease, background-color 140ms ease;
}

.unified-results-grid .card-action svg {
  width: var(--interface-icon-size, 20px);
  height: var(--interface-icon-size, 20px);
}

.unified-results-grid .result-card:hover .card-action,
.unified-results-grid .result-card:focus-within .card-action,
.unified-results-grid .card-action:hover,
.unified-results-grid .card-action:focus-visible,
.unified-results-grid .card-action.is-active {
  opacity: 1;
}

/* Best Matches keeps the complete tool stack. Smaller discovery cards expose
 * only Favorite and a viewport-positioned overflow trigger; the same action
 * elements and handlers move Comment, Save, and Share into the menu. */
.unified-results-grid .card-actions-full {
  flex-direction: column;
}

.unified-results-grid .card-actions-compact {
  flex-direction: column;
  gap: 7px;
}

.unified-results-grid .card-actions-compact .card-action {
  width: 42px;
  height: 42px;
  opacity: 0.9;
}

.unified-results-grid .card-overflow-trigger[aria-expanded="true"] {
  color: #fff;
  background: rgba(103, 81, 215, 0.68);
}

.unified-results-grid .result-card.is-menu-open {
  z-index: 80;
}

.unified-results-grid .thumbnail-glass {
  opacity: 0.84;
  filter: saturate(1.08) contrast(1.1) brightness(1.02);
}

.unified-results-grid .thumbnail-neon {
  opacity: 0.24;
}

.card-action-menu {
  position: absolute;
  z-index: 90;
  min-width: 184px;
  max-width: calc(100vw - 24px);
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(222, 231, 239, 0.18);
  border-radius: 13px;
  color: rgba(248, 250, 252, 0.94);
  background: rgba(29, 45, 57, 0.96);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
  box-shadow: 0 18px 42px rgba(4, 10, 16, 0.42), inset 0 1px rgba(255, 255, 255, 0.06);
}

.card-action-menu[hidden],
.card-menu-action[hidden] {
  display: none;
}

.card-menu-action {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.card-menu-action svg {
  width: var(--interface-icon-size, 20px);
  height: var(--interface-icon-size, 20px);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--interface-icon-stroke, 1.5);
  vector-effect: non-scaling-stroke;
}

.card-menu-action:hover,
.card-menu-action:focus-visible {
  color: #fff;
  background: rgba(130, 105, 244, 0.25);
  outline: 1px solid rgba(203, 190, 255, 0.7);
  outline-offset: -1px;
}

.view-results .results-content,
.view-results .results-sections,
.unified-results-grid,
.result-group,
.result-group-rows,
.unified-results-grid .result-row {
  min-width: 0;
  max-width: none;
  overflow: visible;
}

.view-results .results-content {
  width: 100%;
  padding-inline: clamp(30px, 3.25vw, 64px);
}

.unified-results-grid .result-row {
  gap: clamp(24px, 2.7vw, 54px);
}

.unified-results-grid .short-row {
  column-gap: clamp(20px, 2.5vw, 48px);
}

@media (hover: none) {
  .unified-results-grid .card-action {
    opacity: 0.9;
  }
}

@media (max-width: 1500px) {
  .view-results {
    --results-content-gutter: 38px;
    --results-row-gap: 36px;
  }
}

@media (max-width: 1100px) {
  .view-results {
    --results-header-height: 108px;
    --results-content-gutter: 28px;
    --results-group-gap: 58px;
    --results-row-gap: 30px;
  }

  .view-results .filters-sidebar {
    top: calc(var(--results-header-height) + 8px);
    max-height: calc(100vh - var(--results-header-height) - 16px);
    padding-top: 8px;
  }

  .view-results .filter-button {
    font-size: 14px;
  }

  .view-results .results-content {
    padding-inline: 30px;
  }

  .unified-results-grid .result-card:hover,
  .unified-results-grid .result-card:focus-within {
    box-shadow:
      0 6px 16px rgba(4, 11, 17, 0.23),
      0 18px 38px rgba(4, 11, 17, 0.3),
      0 0 0 1px rgba(var(--card-hover-rgb), 0.82),
      0 0 16px rgba(var(--card-hover-rgb), 0.58),
      0 0 24px rgba(var(--card-hover-secondary-rgb), 0.34);
  }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .result-group-best .result-row:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .result-group-best .result-row:first-child .is-featured {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .result-group-best .result-row:first-child .result-card:not(.is-featured) {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 760px) {
  .view-results {
    --results-header-height: 88px;
    --results-content-gutter: 22px;
    --results-group-gap: 42px;
    --results-row-gap: 22px;
  }

  .view-results .filters-sidebar {
    position: fixed;
    left: 0;
    top: 88px;
    max-height: calc(100vh - 88px);
    transform: none;
    padding-top: 18px;
  }

  /* Mobile places the filter drawer over results, so its blocks use a stronger
   * neutral base than desktop while retaining the same glass highlights. */
  .view-results .filter-group {
    background:
      linear-gradient(145deg, rgba(226, 239, 244, 0.12), rgba(49, 70, 83, 0.14) 48%, rgba(10, 23, 33, 0.2)),
      rgba(17, 34, 46, 0.86);
  }

  .view-results .results-content {
    padding-inline: 22px;
    padding-top: 16px;
    padding-bottom: 110px;
  }

  .channel-page-heading {
    margin-bottom: 26px;
  }

  .channel-page-identity {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .channel-page-actions {
    grid-column: 1 / -1;
    justify-content: center;
    flex-wrap: wrap;
  }

  .result-group-heading {
    margin-bottom: 12px;
  }

  .result-group-best .result-row:first-child {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-group-best .result-row:first-child .result-card {
    aspect-ratio: 16 / 9;
  }

  .unified-results-grid .card-body,
  .unified-results-grid .is-short .card-body {
    padding-right: 54px;
  }

  .unified-results-grid .card-actions-compact .card-action {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 520px) {
  .view-results {
    --results-header-height: 124px;
    --results-content-gutter: 14px;
    --results-group-gap: 34px;
    --results-row-gap: 16px;
  }

  .view-results .filters-sidebar {
    top: 124px;
    max-height: calc(100vh - 124px);
  }

  .view-results .results-content {
    padding-inline: 14px;
    padding-top: 18px;
  }

  .channel-page-identity {
    padding: 18px;
    border-radius: 14px;
  }

  .channel-page-icon {
    width: 50px;
  }

  .channel-page-copy h1 {
    font-size: 1.8rem;
  }

  .result-group-heading h2 {
    font-size: 10px;
  }

  .result-group-count {
    font-size: 9px;
  }

  .result-group-mark {
    font-size: 16px;
  }

  .unified-results-grid .card-body,
  .unified-results-grid .is-short .card-body {
    padding: 42px 50px 38px 12px;
  }

  .unified-results-grid .result-title,
  .unified-results-grid .is-short .result-title {
    font-size: 15px;
  }

  .unified-results-grid .result-description {
    display: none;
  }

  .unified-results-grid .result-badges {
    top: 9px;
    left: 9px;
    max-width: calc(100% - 60px);
  }

  .unified-results-grid .result-badges span {
    padding: 4px 6px;
    font-size: 8px;
  }

  .unified-results-grid .view-count,
  .unified-results-grid .duration {
    right: 10px;
    bottom: 10px;
    font-size: 11px;
  }

  .unified-results-grid .view-count {
    right: auto;
    left: 12px;
  }

  .unified-results-grid .result-card:hover,
  .unified-results-grid .result-card:focus-within {
    box-shadow:
      0 5px 13px rgba(4, 11, 17, 0.24),
      0 13px 24px rgba(4, 11, 17, 0.28),
      0 0 0 1px rgba(var(--card-hover-rgb), 0.76),
      0 0 10px rgba(var(--card-hover-rgb), 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-results .results-page-atmosphere,
  .unified-results-grid .card-action,
  .card-menu-action {
    transition: none;
  }
}

/* Progressive disclosure keeps a deep ranked search pool from becoming a
 * heavy initial DOM. The button is an accessible fallback; the observer
 * activates the same action before it reaches the viewport. */
.result-continuation {
  display: flex;
  min-height: 128px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 34px 20px 70px;
  color: rgba(224, 230, 235, 0.58);
}

.result-continuation button {
  padding: 10px 14px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 640;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.result-continuation button:hover,
.result-continuation button:focus-visible {
  color: rgba(247, 249, 252, 0.9);
}

.result-continuation-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(174, 146, 255, 0.8);
  box-shadow: 0 0 12px rgba(151, 120, 255, 0.5);
}

@media (prefers-reduced-motion: no-preference) {
  .result-continuation-beacon {
    animation: result-continuation-breathe 1.8s ease-in-out infinite;
  }
}

@keyframes result-continuation-breathe {
  50% { opacity: 0.45; transform: scale(0.72); }
}
.search-recovery-note {
  margin: 0 0 1rem;
  color: rgba(225, 231, 241, 0.64);
  font-size: 0.76rem;
  letter-spacing: 0.035em;
}

.search-recovery-note strong {
  color: rgba(242, 244, 249, 0.88);
  font-weight: 650;
}
