/* Search — a full-screen view on mobile, a centred two-column page on desktop */

.page-search .page { gap: 0; }

.sx-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.sx-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 12px 10px 4px; background: var(--bg); border-bottom: 1px solid var(--line2); }
.sx-form { flex: 1; min-width: 0; }
.sx-field { height: 52px; padding: 0 4px 0 14px; border-width: 1.5px; }
.sx-field > svg { flex: none; }
.sx-field input { font-size: 17px; }
.sx-field .search-field__clear { flex: none; width: 44px; height: 44px; }

.sx-body { padding: 4px var(--gutter) 40px; }

/* ---------- Idle: recent, popular, genres ---------- */
.sx-sec { margin-top: 18px; }
.sx-sec--recent { margin-top: 12px; }
.sx-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sx-h { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.sx-sec > .sx-h { display: flex; align-items: center; min-height: 44px; margin-bottom: 4px; }
.sx-textbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 600; color: var(--gold-ink); }

.sx-recent > li { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.sx-recent__icon { flex: none; color: var(--tx3); }
.sx-recent__use { flex: 1; min-width: 0; min-height: 48px; text-align: left; font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-recent__rm { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--tx3); }
.sx-recent__rm:active { background: var(--s2); }

/* ---------- Rows ---------- */
.sx-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 8px; margin: 0 -8px; border-radius: 12px; }
.sx-row .thumb { flex: none; width: 88px; border-radius: 8px; }
.sx-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sx-row__title { font-size: 16px; font-weight: 700; }
.sx-row__meta { font-size: 13px; color: var(--tx3); }
.sx-row__go { flex: none; color: var(--tx3); }
.sx-row .avatar { --size: 48px; font-size: 18px; }
.sx-row .avatar__paisley { display: none; }
.sx-row:focus-visible { background: var(--s2); outline-offset: 0; }

.sx mark { background: var(--gold-soft); color: var(--gold-ink); border-radius: 3px; padding: 0 1px; }

/* ---------- Results ---------- */
.sx-results { transition: opacity var(--dur-2); }
.sx-results[aria-busy="true"] { opacity: .55; }
.sx-summary { margin: 12px 0 4px; font-size: 14px; color: var(--tx3); }
.sx-shortcuts { margin: 10px 0 4px; }
.sx-shortcuts .chip svg { flex: none; color: var(--gold-ink); }
.sx-group { margin-top: 12px; }
.sx-group + .sx-group { margin-top: 16px; }
.sx-all { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--gold-ink); }
.sx-results .sx-row { min-height: 68px; }
.sx-results .sx-row .thumb { width: 100px; border-radius: 9px; }
.sx-results .sx-row__title { font-weight: 600; }
.sx-results .empty { padding-top: 40px; }
.sx-skel { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.sx-skel .skel:first-child { flex: none; width: 100px; aspect-ratio: 16 / 9; border-radius: 9px; }
.sx-skel span + span { flex: 1; height: 14px; max-width: 60%; }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .sx-head { padding-left: max(4px, calc((100vw - 760px) / 2)); padding-right: max(12px, calc((100vw - 760px) / 2)); }
  .sx-body { max-width: 760px; margin: 0 auto; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .sx { max-width: 1080px; margin: 0 auto; padding: 40px 32px 0; }
  .sx-title { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; margin-bottom: 18px; font-family: var(--disp); font-weight: 400; font-size: 44px; line-height: 1.05; }
  .sx-head { position: static; padding: 0; border: 0; background: none; }
  .sx-back { display: none; }
  .sx-field { height: 60px; padding-left: 20px; }
  .sx-field input { font-size: 19px; }
  .sx-body { max-width: none; padding: 8px 0 0; }

  .sx-idle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 56px; align-items: start; }
  .sx-sec { margin-top: 24px; }
  .sx-sec:has(.chips) { grid-column: 1 / -1; }

  .sx-results { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 56px; align-items: start; }
  .sx-results > .sx-summary, .sx-results > .sx-shortcuts, .sx-results > .empty { grid-column: 1 / -1; }
  .sx-summary { margin-top: 20px; font-size: 15px; }
  .sx-group, .sx-group + .sx-group { margin-top: 20px; }
  .sx-results .sx-row .thumb { width: 136px; border-radius: 10px; }
  .sx-results .sx-row { min-height: 88px; }
  .sx-results .sx-row--cast { min-height: 64px; }
  .sx-row__title { font-size: 17px; }
  .sx-row__meta { font-size: 14px; }
}
