.search-page { padding: 1.25rem 0 2rem; display: grid; gap: 1.75rem; }
.search-page h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.4rem); letter-spacing: -.04em; }
.search-combobox { position: relative; }
.search-input-wrap { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); padding: .85rem 1rem; }
.search-input-wrap__icon { width: 22px; height: 22px; color: #9a9a9a; display: grid; place-items: center; }
.search-input-wrap__icon svg { width: 20px; height: 20px; fill: currentColor; }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 1rem; }
.search-input::placeholder { color: #777; }
.search-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + .45rem); margin: 0; padding: .35rem; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: rgba(12,12,14,.98); box-shadow: var(--shadow); max-height: min(60vh, 360px); overflow: auto; }
.search-results [role="option"] { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: .75rem; align-items: center; padding: .55rem .6rem; border-radius: 8px; cursor: pointer; }
.search-results [role="option"][aria-selected="true"],
.search-results [role="option"]:hover { background: rgba(255,255,255,.06); }
.search-result__poster { width: 44px; aspect-ratio: 9/16; object-fit: cover; border-radius: 4px; background: #222; }
.search-result__poster--empty { display: block; background: linear-gradient(145deg, #333, #171717); }
.search-result__meta { min-width: 0; display: grid; gap: .15rem; }
.search-result__meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result__meta small { color: #888; font-size: .75rem; }
.search-status { margin: .65rem 0 0; color: #999; font-size: .85rem; }
.search-status--error { color: #f3a4a4; }

.search-ai-cta {
  margin-top: .35rem;
  padding: 1.75rem 1.25rem;
  display: grid;
  justify-items: center;
  gap: .7rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(229,9,20,.14), transparent 55%),
    rgba(255,255,255,.03);
}
.search-ai-cta h2 { margin: 0; font-size: clamp(1.2rem, 3.6vw, 1.45rem); letter-spacing: -.03em; max-width: 22ch; }
.search-ai-cta p { margin: 0; color: #a3a3a3; max-width: 34ch; line-height: 1.5; }
.search-ai-cta .button { margin-top: .35rem; min-width: min(100%, 16.5rem); }
.search-ai-cta--unavailable { background: rgba(255,255,255,.025); }
.search-ai-cta--unavailable p { color: #888; }

.discovery-chat { display: grid; grid-template-rows: 1fr auto auto; min-height: calc(100dvh - 9.5rem); gap: .75rem; padding-bottom: .5rem; }
.discovery-chat__messages { overflow: auto; display: grid; gap: .85rem; align-content: start; padding: .25rem 0 1rem; }
.discovery-msg { display: flex; }
.discovery-msg--user { justify-content: flex-end; }
.discovery-msg--assistant { justify-content: flex-start; }
.discovery-msg__bubble { max-width: min(92%, 34rem); padding: .85rem 1rem; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.discovery-msg--user .discovery-msg__bubble { background: #1f6b4a; color: #fff; border-bottom-right-radius: 6px; }
.discovery-msg--assistant .discovery-msg__bubble { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-bottom-left-radius: 6px; }
.discovery-msg__bubble--typing { display: inline-flex; gap: .35rem; align-items: center; min-width: 3.2rem; }
.discovery-msg__bubble--typing span { width: .45rem; height: .45rem; border-radius: 50%; background: #bbb; animation: discovery-pulse 1s infinite ease-in-out; }
.discovery-msg__bubble--typing span:nth-child(2) { animation-delay: .15s; }
.discovery-msg__bubble--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes discovery-pulse { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.discovery-rec { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: .9rem; padding: .9rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); max-width: min(92%, 34rem); }
.discovery-rec__poster { width: 72px; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; background: #222; }
.discovery-rec__poster--empty { background: linear-gradient(145deg, #333, #171717); }
.discovery-rec__body { display: grid; gap: .45rem; align-content: start; }
.discovery-rec__body h3 { margin: 0; font-size: 1.05rem; }
.discovery-rec__body p { margin: 0; color: #bdbdbd; font-size: .9rem; }
.discovery-rec__meta { color: #888 !important; font-size: .78rem !important; }

.discovery-chat__composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .65rem; align-items: end; border: 1px solid var(--line); border-radius: 14px; padding: .65rem; background: rgba(255,255,255,.03); }
.discovery-input { width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; line-height: 1.4; max-height: 140px; padding: .35rem .45rem; }
.discovery-error { margin: 0; color: #f3a4a4; font-size: .85rem; }
.text-button { background: transparent; border: 0; color: #bbb; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; padding: .35rem .5rem; }
.text-button:hover { color: #fff; }
.topbar .text-button { margin-left: auto; }

@media (min-width: 760px) {
  .search-page { padding-top: 1.75rem; }
  .discovery-chat { min-height: calc(100dvh - 8rem); }
}
