/* Search room: Hearth's charcoal / brass tokens, painted icons, one list and
   one preview. Raycast's surface ladder informs density, not brand styling. */
.hearth-search {
  --hsr-bg: var(--cinema-bg); --hsr-panel: var(--cinema-panel);
  --hsr-text: var(--cinema-ink); --hsr-muted: var(--cinema-muted);
  --hsr-brass: var(--cinema-accent); --hsr-line: var(--cinema-line);
  --hsr-wash: color-mix(in srgb, var(--hsr-brass) 9%, transparent);
  --hsr-edge: color-mix(in srgb, var(--hsr-brass) 40%, transparent);
  box-sizing: border-box; color: var(--hsr-text); background: var(--hsr-bg);
  width: min(1140px, calc(100vw - 48px)); max-width: none;
  height: min(820px, calc(100dvh - 64px)); max-height: none;
  margin: auto; padding: 0; border: 1px solid var(--hsr-edge); border-radius: 20px;
  box-shadow: 0 32px 110px #0009; font-family: inherit; overflow: hidden;
}
.hearth-search[open] { display: flex; flex-direction: column; }
.hearth-search::backdrop { background: #080a10ba; backdrop-filter: blur(12px); }
.hearth-search *, .hearth-search *::before, .hearth-search *::after { box-sizing: border-box; }
.hearth-search [hidden] { display: none !important; }
.hearth-search button, .hearth-search input { font: inherit; }
.hearth-search button { cursor: pointer; touch-action: manipulation; }
.hearth-search :focus-visible { outline: 2px solid var(--hsr-brass); outline-offset: 3px; }
.hsr-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px 10px; }
.hsr-title { display: flex; gap: 12px; align-items: center; }
.hsr-title h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.hsr-title img { object-fit: contain; }
.hsr-close { border: 1px solid var(--hsr-line); border-radius: 50%; width: 44px; height: 44px; flex: none; background: transparent; color: var(--hsr-muted); font-size: 26px !important; }
.hsr-query { display: flex; align-items: center; margin: 0 24px 18px; padding: 6px 10px 6px 18px; border: 1px solid var(--hsr-edge); border-radius: 12px; background: var(--hsr-panel); box-shadow: inset 0 1px 0 #ffffff09; }
.hsr-query:focus-within { border-color: var(--hsr-brass); box-shadow: 0 0 0 3px var(--hsr-wash); }
.hsr-query input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--hsr-text); font-size: 23px; padding: 10px 0; height: 54px; outline: none; }
.hsr-query input::placeholder { font-size: 18px; color: var(--hsr-muted); }
.hsr-query input::-webkit-search-cancel-button { display: none; }
.hearth-search .hsr-query input:focus-visible { outline: none; }
.hsr-clear { padding: 0 12px; min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--hsr-brass); font-size: 13px !important; }
.hsr-scopes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; flex: none; margin: 0 24px 18px; padding: 4px; border: 1px solid var(--hsr-line); border-radius: 11px; }
.hsr-scope { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 44px; padding: 6px 12px; color: var(--hsr-muted); background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: 14px !important; white-space: nowrap; }
.hsr-scope img { object-fit: contain; flex: none; }
.hsr-scope[aria-pressed=true] { color: var(--hsr-text); border-color: var(--hsr-edge); background: var(--hsr-wash); }
.hsr-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); flex: 1; min-height: 0; border-top: 1px solid var(--hsr-line); }
.hsr-listing { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.hsr-status { color: var(--hsr-muted); font-size: 12px; line-height: 1.6; min-height: 44px; padding: 12px 24px; margin: 0; }
.is-busy .hsr-status { color: var(--hsr-brass); }
.hsr-results { overflow: auto; overscroll-behavior: contain; padding: 0 12px 18px; flex: 1; scrollbar-width: thin; }
.hsr-result { display: flex; align-items: center; gap: 14px; min-height: 94px; border: 1px solid transparent; border-radius: 10px; padding: 12px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.hsr-result[aria-selected=true] { background: var(--hsr-wash); border-color: var(--hsr-edge); }
.hsr-result { content-visibility: auto; contain-intrinsic-size: auto 94px; }
.hsr-cover { width: 48px; height: 66px; object-fit: cover; border-radius: 5px; background: var(--hsr-panel); flex: none; }
.hsr-cover.is-fallback { object-fit: contain; padding: 8px; }
.hsr-result-copy { min-width: 0; flex: 1; }
.hsr-result-copy strong { display: block; font-size: 16px; line-height: 1.35; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hsr-result-copy small { display: block; color: var(--hsr-muted); font-size: 12px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.hsr-format { display: block; margin-top: 3px; font-size: 11px; color: var(--hsr-brass); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hsr-open-mark { color: var(--hsr-brass); opacity: 0; flex: none; }
[aria-selected=true] > .hsr-open-mark { opacity: 1; }
.hsr-preview { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--hsr-line); background: color-mix(in srgb, var(--hsr-panel) 55%, var(--hsr-bg)); overflow: hidden; }
.hsr-preview-scroll { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hsr-preview-art { height: 164px; position: relative; overflow: hidden; background: var(--hsr-panel); }
.hsr-preview-art > img:first-child { width: 100%; height: 100%; object-fit: cover; opacity: .54; }
.hsr-preview-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, var(--hsr-panel), transparent 65%); pointer-events: none; }
.hsr-preview-art > .hsr-preview-poster { position: absolute; height: 132px; width: 88px; object-fit: cover; left: 24px; bottom: 0; border: 1px solid var(--hsr-edge); border-radius: 7px; z-index: 1; box-shadow: 0 8px 24px #0006; }
.hsr-preview-copy { padding: 20px 24px 28px; }
.hsr-location { font-size: 12px; color: var(--hsr-brass); }
.hsr-preview h3 { margin: 8px 0 10px; font-size: 28px; letter-spacing: -.035em; line-height: 1.12; text-wrap: balance; overflow-wrap: anywhere; }
.hsr-meta { color: var(--hsr-muted); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.hsr-rating { color: var(--hsr-brass); font-size: 13px; font-variant-numeric: tabular-nums; }
.hsr-synopsis { font-size: 14px; line-height: 1.65; color: var(--hsr-text); margin: 12px 0 18px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.hsr-format-line { color: var(--hsr-brass); font-size: 13px; line-height: 1.5; }
.hsr-playback-notes { border-left: 2px solid var(--hsr-edge); padding: 2px 0 2px 14px; margin: 18px 0; }
.hsr-playback-notes h4 { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
.hsr-playback-notes p { margin: 8px 0 0; font-size: 12px; color: var(--hsr-muted); line-height: 1.6; }
.hsr-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; flex: none; padding: 14px 24px; border-top: 1px solid var(--hsr-line); }
.hsr-button { min-height: 46px; padding: 10px 16px; border: 1px solid var(--hsr-edge); border-radius: 8px; color: var(--hsr-text); background: var(--hsr-wash); font-weight: 650 !important; font-size: 14px !important; }
.hsr-button.is-primary { background: var(--hsr-brass); color: var(--hsr-bg); }
.hsr-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; min-height: 280px; height: 100%; }
.hsr-empty img { object-fit: contain; margin-bottom: 20px; opacity: .8; }
.hsr-empty h3 { font-size: 22px; line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
.hsr-empty p { max-width: 30ch; color: var(--hsr-muted); font-size: 14px; line-height: 1.65; margin: 0; overflow-wrap: anywhere; }
.hsr-preview > .hsr-empty img { width: 56px; height: 56px; }
.hsr-footer { display: flex; gap: 24px; padding: 14px 24px; color: var(--hsr-muted); font-size: 11px; border-top: 1px solid var(--hsr-line); flex: none; }
.hsr-error { padding: 16px 12px; font-size: 13px; line-height: 1.6; color: var(--hsr-muted); }
.hsr-link { background: transparent; border: 0; color: var(--hsr-brass); text-decoration: underline; padding: 12px; min-height: 44px; }
@media (hover: hover) {
  .hsr-close:hover, .hsr-clear:hover, .hsr-scope:hover, .hsr-button:not(.is-primary):hover { color: var(--hsr-text); background: var(--hsr-wash); }
  .hsr-button.is-primary:hover { filter: brightness(1.08); }
}
.hsr-button:active, .hsr-close:active { transform: translateY(1px); }
@media (max-width: 700px) {
  .hearth-search { width: calc(100vw - 16px); height: calc(100dvh - 20px); border-radius: 15px; }
  .hsr-top { padding: 12px 16px 8px; }
  .hsr-query { margin: 0 16px 12px; padding-left: 12px; }
  .hsr-query input { font-size: 20px; height: 48px; }
  .hsr-query input::placeholder { font-size: 16px; }
  .hsr-scopes { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 16px 12px; }
  .hsr-body { grid-template-columns: minmax(0, 1fr); overflow: auto; display: block; }
  .hsr-listing { max-height: 48%; min-height: 170px; }
  .hsr-status { padding: 10px 16px; }
  .hsr-results { padding-inline: 8px; }
  .hsr-result { min-height: 84px; gap: 12px; }
  .hsr-cover { width: 40px; height: 56px; }
  .hsr-preview { border-left: 0; border-top: 1px solid var(--hsr-line); overflow: visible; }
  .hsr-preview-scroll { overflow: visible; }
  .hsr-preview-art { height: 140px; }
  .hsr-preview-art > .hsr-preview-poster { width: 74px; height: 111px; left: 20px; }
  .hsr-preview-copy { padding: 16px 20px 24px; }
  .hsr-preview h3 { font-size: 25px; }
  .hsr-footer { display: none; }
  .hsr-empty { min-height: 190px; padding: 24px 20px; }
  .hsr-preview > .hsr-empty { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hearth-search * { transition: none !important; } }
