/* Search and title pages: Emby-inspired hierarchy, existing business contracts. */
.search-page,
.emby-watch {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px var(--page-gutter, 4vw) 88px;
  color: var(--text, #f3f6fa);
}
.search-page { --catalog-columns: 7; }
.search-page .search-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.search-page .search-heading { text-align: left; }
.search-page .search-home-link { flex: none; }
.search-page .search-eyebrow {
  margin: 0 0 8px;
  color: var(--accent, #8ab4ff);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
}
.search-page .search-heading h1 { margin: 0; font-size: 23px; letter-spacing: 0; line-height: 1.3; }
.search-page .search-heading p:not(.search-eyebrow) { margin: 0; color: var(--muted, #a9b4c2); font-size: 14px; }
.search-home-link { min-width: 44px; justify-content: center; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted, #a9b4c2); white-space: nowrap; }
.search-home-link:hover { color: var(--text, #f3f6fa); }
.search-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; gap: 9px; width: 100%; margin: 0 0 10px; }
.search-query { min-width: 0; }
.search-query > label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.search-page .page-search {
  display: flex;
  width: 100%;
  height: 46px;
  margin: 0;
  border: 1px solid #354252;
  border-radius: 7px;
  background: var(--surface, #111821);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search-page .page-search:focus-within { border-color: var(--accent, #8ab4ff); box-shadow: 0 0 0 3px #8ab4ff1a; }
.search-page .page-search input[name] { width: 100%; min-width: 0; height: 44px; min-height: 44px; padding: 0 13px; border: 0; border-radius: 0; background: transparent; color: var(--text, #f3f6fa); font-size: 16px; box-shadow: none; }
.search-page .page-search input::placeholder { color: #91a0b2; }
.search-page .page-search button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 7px; width: auto; min-width: 88px; height: 44px; padding: 0 14px; border: 0; border-left: 1px solid #354252; border-radius: 0; background: var(--surface-raised, #19222d); color: var(--text, #f3f6fa); font-size: 13px; font-weight: 600; }
.search-page .page-search button:hover { background: #243540; }
.search-page .search-filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 46px; min-width: 96px; padding: 0 12px; border: 1px solid #354252; background: var(--surface, #111821); color: var(--text, #f3f6fa); border-radius: 7px; font-size: 13px; }
.search-page .search-filter-toggle[aria-expanded="true"] { color: var(--accent, #8ab4ff); border-color: #465774; background: #131b29; }
.search-filter-count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px; background: #8ab4ff22; color: var(--accent, #8ab4ff); font-size: 11px; font-variant-numeric: tabular-nums; }
.search-filter-count[hidden] { display: none; }

.search-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 9px 0 14px; min-height: 0; }
.search-active-filters:empty { display: none; }
.search-filter-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid #354252; border-radius: 6px; background: var(--surface, #111821); color: var(--muted, #a9b4c2); text-align: left; font-size: 11px; transition: background 160ms ease, border-color 160ms ease; }
.search-filter-chip > span { min-width: 0; overflow-wrap: anywhere; }
.search-filter-chip b { margin-left: 7px; color: var(--text, #f3f6fa); font-weight: 500; }
.search-filter-chip svg { flex-shrink: 0; width: 16px; height: 16px; }
.search-filter-chip:hover { background: #212833; border-color: #475977; }
.search-layout { display: grid; grid-template-columns: minmax(180px, 224px) minmax(0, 1fr); align-items: start; gap: 32px; }
.search-page[data-filters-open="false"] .search-layout { grid-template-columns: minmax(0, 1fr); }
.search-filter-panel { min-width: 0; padding: 4px 24px 20px 0; border-right: 1px solid #25313d; animation: search-panel-in 200ms ease both; }
.search-filter-panel[hidden] { display: none; }
.search-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.search-filter-heading h2 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 600; }
.search-filter-close { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; background: transparent; border: 0; border-radius: 8px; color: var(--muted, #a9b4c2); }
.search-filter-close:hover { background: #25313d; color: var(--text, #f3f6fa); }
.search-page .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 19px; padding: 0; margin: 0; background: transparent; border: 0; border-radius: 0; }
.search-page .filter-bar label { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--muted, #a9b4c2); font-size: 12px; }
.search-page .filter-bar select,
.search-page .filter-bar input { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #354252; border-radius: 8px; background: var(--surface, #111821); color: var(--text, #f3f6fa); font-size: 13px; }
.search-page .filter-bar input::placeholder { color: #91a0b2; }
.search-page .filter-clear { width: 100%; margin: 4px 0 0; min-height: 44px; padding: 10px; color: var(--muted, #a9b4c2); background: transparent; border: 1px solid #354252; border-radius: 8px; font-size: 12px; }
.search-page .filter-clear:hover { color: var(--text, #f3f6fa); background: var(--surface-raised, #19222d); }
.search-result-region { min-width: 0; }
.search-update-status { margin: 0; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); position: absolute; white-space: nowrap; }
.search-page .results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; margin: 0 0 20px; }
.search-page .results-head > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.search-page .results-head h2 { margin: 0; color: var(--text, #f3f6fa); font-size: 18px; font-weight: 600; }
.search-page .results-head strong { font-size: 12px; color: var(--muted, #a9b4c2); font-weight: 400; font-variant-numeric: tabular-nums; }
.search-page .view-options { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #354252; background: var(--surface, #111821); border-radius: 9px; }
.search-page .view-options a { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 6px; color: var(--muted, #a9b4c2); font-size: 12px; white-space: nowrap; }
.search-page .view-options a.active { color: var(--text, #f3f6fa); background: #2b3844; box-shadow: none; }
.search-page .search-grid { grid-template-columns: repeat(var(--catalog-columns), minmax(0, 1fr)); gap: 24px 18px; }
.search-page #search-results [data-reveal].reveal-visible { animation-duration: 240ms; }
.emby-watch :is(.watch-title, .creator-row, .description, .watch-aside).reveal-visible { animation-duration: 360ms; }
.search-page #search-results { position: relative; min-height: 280px; }
.search-page #search-results[aria-busy="true"] > :not(.search-skeleton):not([role="alert"]) { opacity: .48; transition: opacity 140ms ease; }
.search-page #search-results[aria-busy="true"]::before { content: "正在更新作品…"; position: absolute; z-index: 3; top: 62px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; padding: 10px 16px; border: 1px solid #495468; border-radius: 8px; color: var(--text, #f3f6fa); background: #141a25; box-shadow: 0 8px 24px #03070a66; font-size: 13px; }
.search-skeleton { display: grid; grid-template-columns: repeat(var(--catalog-columns, 7), minmax(0, 1fr)); gap: 18px 12px; padding-top: 66px; }
.search-skeleton > div { min-width: 0; }
.search-skeleton i,
.search-skeleton b,
.search-skeleton span { display: block; background: var(--surface-raised, #19222d); border-radius: 8px; }
.search-skeleton i { aspect-ratio: 16/9; }
.search-skeleton b { height: 12px; margin-top: 14px; width: 85%; }
.search-skeleton span { height: 9px; margin-top: 10px; width: 58%; background: #141d27; }
.search-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 360px; padding: 40px 24px; border-radius: 14px; background: var(--surface, #111821); text-align: center; }
.search-empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 20px; border-radius: 14px; background: var(--surface-raised, #19222d); color: var(--muted, #a9b4c2); }
.search-empty-icon svg { width: 28px; height: 28px; }
.search-empty h2 { margin: 0 0 10px; font-size: 19px; font-weight: 600; }
.search-empty p { max-width: 38ch; margin: 0 0 24px; color: var(--muted, #a9b4c2); }
.search-page .pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.search-page .pager a,
.search-page .pager > span:not(.page-count) { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid #354252; border-radius: 8px; }
.search-page .pager a.active { color: var(--bg, #080c12); border-color: var(--accent, #8ab4ff); background: var(--accent, #8ab4ff); font-weight: 600; }
.search-page .pager > span[aria-disabled] { color: #84909d; opacity: .65; background: transparent; }
.search-page .page-count { color: var(--muted, #a9b4c2); margin-left: 8px; font-size: 12px; }
.search-page .title-list { display: grid; gap: 0; }
.search-page .list-card { grid-template-columns: 92px minmax(0, 1fr); gap: 20px; padding: 20px 0; border: 0; border-bottom: 1px solid #25313d; border-radius: 0; background: transparent; box-shadow: none; }
.search-page .list-card:first-child { padding-top: 0; }
.search-page .list-cover { aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; }
.search-page .list-cover img { width: 100%; height: 100%; object-fit: contain; background: var(--surface, #111821); }
.search-page .list-copy { min-width: 0; }
.search-page .list-copy h2 { font-size: 17px; line-height: 1.5; margin: 5px 0 8px; }
.search-page .list-copy p { color: var(--muted, #a9b4c2); }
.search-page .episode-label { color: var(--accent, #8ab4ff); font-size: 11px; }
.search-page .list-copy .full-tags { margin-top: 12px; }

/* No transformed/filter/overflow ancestors around video, Plyr or ASS. */
.emby-watch { position: relative; padding-top: 28px; }
.emby-watch .watch-atmosphere { position: absolute; top: 0; right: 0; left: 0; height: min(720px, 70vw); overflow: hidden; pointer-events: none; opacity: .22; }
.emby-watch .watch-atmosphere img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: blur(36px) saturate(.65); }
.emby-watch .watch-atmosphere::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg, #080c12), transparent 90%), linear-gradient(90deg, var(--bg, #080c12), transparent 70%); }
.emby-watch .watch-crumb,
.emby-watch .watch-layout { position: relative; }
.emby-watch .watch-crumb { display: flex; align-items: center; flex-wrap: nowrap; gap: 12px; margin-bottom: 24px; font-size: 12px; color: var(--muted, #a9b4c2); }
.emby-watch .watch-crumb a { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; }
.emby-watch .watch-crumb > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.emby-watch .watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 32px; align-items: start; }
.emby-watch .watch-main { min-width: 0; }
.emby-watch .player-shell { width: 100%; aspect-ratio: 16/9; border: 1px solid #27313b; border-radius: 12px; background: #070b10; box-shadow: 0 16px 48px #03070a55; }
.emby-watch .player-backdrop { background: none; filter: none; }
.emby-watch .player-backdrop > img { width: 100%; height: 100%; object-fit: contain; background: #070b10; }
.emby-watch .player-backdrop::after { background: linear-gradient(0deg,#03070a66,#03070a22); }
.emby-watch .player-shell video:not([src]) { background: transparent; }
.emby-watch .player-start { display: grid; place-items: center; width: 76px; height: 76px; padding: 0; border: 1px solid #ffffff55; border-radius: 50%; color: #0b1218; background: #f3f6fa; box-shadow: 0 8px 32px #03070a66; transition: transform 180ms ease, background 180ms ease; }
.emby-watch .player-start svg { display: block; width: 30px; height: 30px; margin: 0; }
.emby-watch .player-start:hover { background: #fff; transform: translate(-50%,-50%) scale(1.06); }
.emby-watch .player-start:active { transform: translate(-50%,-50%) scale(.98); }
.emby-watch .player-start:disabled { background: #b3bdc5; opacity: .65; cursor: not-allowed; }
.emby-watch .player-start.hidden { display: none; }
.emby-watch .qjy-status { min-height: 34px; padding: 10px 0 0; color: var(--muted, #a9b4c2); font-size: 12px; line-height: 1.6; }
.emby-watch .quality-switcher { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-color: #293540; background: var(--surface, #111821); }
.emby-watch .quality-switcher[hidden] { display: none; }
.emby-watch .quality-switcher button { min-height: 44px; border-radius: 8px; border: 1px solid #354252; color: var(--muted, #a9b4c2); background: var(--surface, #111821); }
.emby-watch .quality-switcher button.selected { border-color: #475d84; color: var(--accent, #8ab4ff); background: #141c2a; }
.emby-watch .watch-title { display: block; margin-top: 22px; }
.emby-watch .watch-kind { display: block; margin-bottom: 8px; color: var(--accent, #8ab4ff); font-size: 12px; font-weight: 500; line-height: 1.6; }
.emby-watch .watch-title h1 { width: 100%; margin: 0 0 12px; max-width: none; font-size: clamp(24px, 2.3vw, 36px); font-weight: 650; letter-spacing: -.025em; line-height: 1.4; text-wrap: wrap; overflow-wrap: break-word; word-break: normal; }
.emby-watch .watch-title p { margin: 0 0 7px; color: var(--muted, #a9b4c2); font-size: 13px; line-height: 1.7; }
.emby-watch .watch-title .watch-subtitle { color: #c5cfd9; font-size: 15px; }
.emby-watch .watch-title .watch-original-title { font-size: 12px; }
.emby-watch .watch-facts { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; font-variant-numeric: tabular-nums; }
.emby-watch .watch-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.emby-watch .watch-tools .engagement-button,
.emby-watch .creator-subscribe { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: auto; min-height: 44px; padding: 10px 13px; border: 1px solid #354252; border-radius: 9px; background: #111b25; color: #d2dbe4; font-size: 12px; font-weight: 500; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.emby-watch .watch-tools .engagement-button.active,
.emby-watch .creator-subscribe.active { color: var(--accent, #8ab4ff); border-color: #465979; background: #162031; }
.emby-watch .watch-tools .engagement-button:hover,
.emby-watch .creator-subscribe:hover { color: var(--text, #f3f6fa); background: #25343d; border-color: #667082; }
.emby-watch .watch-tools .engagement-button[hidden],
.emby-watch .creator-subscribe[hidden] { display: none; }
.emby-watch .watch-tools .engagement-button:active { transform: scale(.98); }
.emby-watch .creator-row { gap: 12px; padding: 22px 0; margin-top: 26px; border-color: #293540; }
.emby-watch .creator-row .avatar { width: 42px; height: 42px; border-radius: 11px; color: #b9c1cf; background: #202631; }
.emby-watch .creator-row strong { font-size: 14px; font-weight: 600; }
.emby-watch .creator-row > .creator-identity span { color: var(--muted, #a9b4c2); font-size: 11px; margin-top: 3px; }
.emby-watch .watch-kind a { color: inherit; text-decoration: none; }
.emby-watch .watch-kind a:hover { text-decoration: underline; }
.emby-watch .watch-kind a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.emby-watch .creator-row > .creator-identity { min-width: 0; flex: 1 1 145px; }
.emby-watch .creator-row > .watch-tools { flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0 0 0 auto; }
.emby-watch .creator-row > .watch-tools .creator-subscribe { margin: 0; }
.emby-watch .creator-link:hover { color: var(--accent, #8ab4ff); }
.emby-watch .description { padding: 0; margin-top: 26px; border: 0; border-radius: 0; background: transparent; }
.emby-watch .description h2 { margin: 0 0 13px; font-size: 16px; font-weight: 600; }
.emby-watch .description .watch-synopsis { max-width: 72ch; margin: 0; color: #b8c4d0; font-size: 14px; line-height: 1.95; white-space: pre-line; overflow-wrap: anywhere; }
.emby-watch .watch-synopsis.is-collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.emby-watch .synopsis-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; margin-top: 4px; border: 0; background: transparent; color: var(--accent, #8ab4ff); font-size: 12px; }
.emby-watch .description .hero-tags { margin-top: 18px; gap: 8px; }
.emby-watch .metadata-grid { margin-top: 24px; border-color: #293540; }
.emby-watch .metadata-item { border-color: #25313d; }
.emby-watch .metadata-item a { color: var(--accent, #8ab4ff); }
.emby-watch .watch-aside { position: static; top: auto; min-width: 0; padding: 22px 18px 18px; margin: 0; border: 1px solid #293540; border-radius: 14px; background: var(--surface, #111821); }
.emby-watch .aside-head { padding-bottom: 16px; border-color: #293540; }
.emby-watch .aside-head h2 { font-size: 18px; font-weight: 600; line-height: 1.5; }
.emby-watch .author-more,
.emby-watch .author-retry { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 2px; border: 0; background: transparent; color: var(--accent, #8ab4ff); font-size: 12px; white-space: nowrap; }
.emby-watch .author-more svg { width: 14px; height: 14px; }
.emby-watch :is(.author-more, .author-retry):focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 2px; }
.emby-watch .watch-author-panel .aside-head { padding-bottom: 8px; }
.emby-watch .watch-author-panel .collection-name { margin: 10px 0 16px; }
.emby-watch .author-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.emby-watch .author-list > .muted { margin: 8px 2px; }
.emby-watch .author-work { display: grid; grid-template-columns: min(54%, 240px) minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; padding: 0; color: var(--text, #f3f6fa); text-decoration: none; border-radius: 7px; background: transparent; transition: color 160ms ease, transform 140ms ease; }
.emby-watch .author-work .author-work-cover { position: relative; display: block; min-width: 0; overflow: hidden; aspect-ratio: 16/9; border-radius: 7px; outline: 1px solid transparent; outline-offset: -1px; background: var(--surface-raised, #19222d); transition: outline-color 180ms, box-shadow 180ms; }
.emby-watch .author-work-cover > .list-cover-link { display: block; width: 100%; height: 100%; }
.emby-watch .author-work-cover img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 420ms cubic-bezier(.16, 1, .3, 1); }
.emby-watch .author-work-copy { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 2px 0; }
.emby-watch .author-work-title { color: inherit; text-decoration: none; }
.emby-watch .author-work strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.emby-watch .author-work time { color: var(--muted, #a9b4c2); font-size: 11px; line-height: 1.5; }
.emby-watch .author-work .author-current { position: absolute; z-index: 3; right: 5px; bottom: 6px; padding: 2px 5px; border-radius: 4px; background: #101014c9; color: #f3f6fa; font-size: 10px; line-height: 1.5; pointer-events: none; }
.emby-watch .author-work[aria-current="page"] .author-work-cover { box-shadow: inset 0 0 0 2px var(--accent, #8ab4ff); outline: 2px solid var(--accent, #8ab4ff); outline-offset: -2px; }
.emby-watch .author-work-title:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 4px; }
.emby-watch .author-work-cover > .list-cover-link:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: -3px; }
.emby-watch .author-work:focus-within { color: var(--accent-text, var(--accent, #8ab4ff)); }
.emby-watch .author-work:focus-within .author-work-cover { outline-color: color-mix(in srgb, var(--accent, #8ab4ff) 60%, transparent); box-shadow: 0 12px 30px #0000002b; }
.emby-watch .author-work:focus-within:not(.is-card-preview-playing) img { transform: scale(1.045); }
.emby-watch .author-work:active { transform: scale(.985); }
@media (hover: hover) {
  .emby-watch .author-work:hover { color: var(--accent-text, var(--accent, #8ab4ff)); }
  .emby-watch .author-work:hover .author-work-cover { outline-color: color-mix(in srgb, var(--accent, #8ab4ff) 60%, transparent); box-shadow: 0 12px 30px #0000002b; }
  .emby-watch .author-work:hover:not(.is-card-preview-playing) img { transform: scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
  .emby-watch .author-work,
  .emby-watch .author-work .author-work-cover,
  .emby-watch .author-work img { transition: none; }
  .emby-watch .author-work:active,
  .emby-watch .author-work:is(:hover,:focus-within):not(.is-card-preview-playing) img { transform: none; }
}
.emby-watch .watch-author-panel .media-episodes[hidden] { display: none !important; }
.emby-watch .collection-name { margin: 16px 0 6px; color: var(--muted, #a9b4c2); font-size: 12px; overflow-wrap: anywhere; }
.emby-watch #collection-episodes { overflow: visible; }
.emby-watch .episode-list { display: grid; gap: 8px; padding: 8px 0 14px; }
.emby-watch #current-media-slot .episode-list { padding-top: 0; }
.emby-watch .media-episode,
.emby-watch .collection-episode { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 80px; margin-bottom: 8px; padding: 10px; border: 1px solid transparent; border-radius: 9px; background: var(--surface-raised, #19222d); text-align: left; transition: border-color 160ms ease, background 160ms ease; }
.emby-watch .media-episode img,
.emby-watch .collection-episode img { width: 46px; height: 61px; aspect-ratio: 3/4; object-fit: contain; border-radius: 5px; background: #101820; }
.emby-watch .media-episode b,
.emby-watch .collection-episode b { display: block; color: var(--accent, #8ab4ff); font-size: 11px; font-weight: 500; line-height: 1.5; }
.emby-watch .media-episode strong,
.emby-watch .collection-episode strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; color: #c6d0db; font-size: 12px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.emby-watch .media-episode small { color: var(--muted, #a9b4c2); font-size: 11px; }
.emby-watch .media-episode.selected,
.emby-watch #current-media-slot .media-episode { border-color: #465979; background: #181f2c; }
.emby-watch .media-episode:hover,
.emby-watch .collection-episode:hover { border-color: #525e74; background: #202631; }
.emby-watch #sequence-nav { font-size: 12px; }
.emby-watch #sequence-nav .text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent, #8ab4ff); }
.emby-watch .sequence-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 12px; }
.emby-watch .sequence-actions .button { flex: 1; min-height: 44px; padding: 10px 12px; }
.emby-watch #sequence-nav .checkbox-row { color: var(--muted, #a9b4c2); font-size: 12px; line-height: 1.6; }
.emby-watch .watch-discussion { grid-column: 1; margin: 12px 0 0; padding-top: 24px; border-top: 1px solid #293540; min-width: 0; }
.emby-watch .section-title { align-items: center; gap: 20px; margin-bottom: 18px; }
.emby-watch .section-title h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; }
.emby-watch .comment { padding: 18px 0; border-color: #293540; }
.emby-watch .comment p { color: #b8c4d0; font-size: 14px; }
.emby-watch .comment time { color: var(--muted, #a9b4c2); }
.emby-watch #comment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; margin-top: 24px; }
.emby-watch #comment-form[hidden] { display: none; }
.emby-watch #comment-form > label { grid-column: 1/-1; color: var(--muted, #a9b4c2); font-size: 12px; }
.emby-watch #comment-form textarea { min-height: 96px; width: 100%; min-width: 0; padding: 14px; border-color: #354252; border-radius: 10px; background: var(--surface, #111821); color: var(--text, #f3f6fa); resize: vertical; }
.emby-watch #comment-form textarea::placeholder { color: #91a0b2; }
.emby-watch #comment-form button { min-height: 44px; }
.emby-watch .watch-recommendations { grid-column: 1/-1; min-width: 0; margin-top: 20px; padding-top: 32px; border-top: 1px solid #293540; }
.emby-watch .watch-recommendations .see-all { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--muted, #a9b4c2); white-space: nowrap; }
.emby-watch .related-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; padding: 0; }
.emby-watch .related-list > .muted { grid-column: 1/-1; }
/* Reset the old compact recommendation rows; new items are shared poster cards. */
.emby-watch .related-list .poster-card a { grid-template-columns: none; font-size: inherit; line-height: inherit; }
.emby-watch .related-list .poster-frame img { width: 100%; height: 100%; border-radius: 0; }
.search-page :is(button, a, input, select):focus-visible,
.emby-watch :is(.engagement-button, .synopsis-toggle, .episode, .watch-crumb a, .player-start):focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 3px; }
.emby-watch :is(.watch-tools .engagement-button, .creator-subscribe, .synopsis-toggle, #comment-form button):focus { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 3px; }

/* Qjy quality and ASS/VTT subtitles live in one player-owned settings surface. */
.player-shell .plyr__video-wrapper { touch-action: manipulation; }
.player-shell .plyr__captions { z-index: 2; pointer-events: none; }
.player-shell .plyr.hana-system-fullscreen video::-webkit-media-text-track-container { display: block; }
.player-shell .plyr.hana-system-fullscreen .plyr__captions,
.player-shell .plyr.hana-system-fullscreen #ass-container { display: none; }
.emby-watch .player-shell:not(.playing) .plyr:has([data-player-settings]) { opacity: 1; background: transparent; }
.emby-watch .player-shell:not(.playing) .plyr:has([data-player-settings]) .plyr__video-wrapper { background: transparent; }
.player-shell:has(.hana-settings-open) > .player-start { visibility: hidden; }
.player-shell .plyr.plyr--fullscreen-fallback { position: fixed; z-index: 10000000; }
.player-shell .plyr.plyr--fullscreen-fallback.hana-fullscreen-viewport {
  inset: auto;
  left: var(--hana-fullscreen-left);
  top: var(--hana-fullscreen-top);
  width: var(--hana-fullscreen-width);
  height: var(--hana-fullscreen-height);
  min-width: 0;
  max-width: none;
  max-height: none;
}
.player-shell .plyr.hana-fullscreen-viewport .plyr__controls {
  padding-left: max(var(--plyr-control-spacing, 10px), env(safe-area-inset-left));
  padding-right: max(var(--plyr-control-spacing, 10px), env(safe-area-inset-right));
  padding-bottom: max(var(--plyr-control-spacing, 10px), env(safe-area-inset-bottom));
}
.player-shell .hana-player-settings { position: absolute; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; width: min(286px, calc(100% - 24px)); max-height: min(390px, calc(100% - 94px - env(safe-area-inset-bottom))); overflow: hidden; overscroll-behavior: contain; padding: 8px; border: 1px solid #ffffff24; border-radius: 12px; background: #10141aee; color: #f3f6fa; box-shadow: 0 18px 48px #0009; backdrop-filter: blur(18px); }
.player-shell .hana-player-settings[hidden] { display: none !important; }
.player-shell .hana-settings-open .plyr__controls { opacity: 1; transform: translateY(0); pointer-events: auto; }
.hana-player-settings__header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; min-height: 38px; padding: 0 5px 7px 10px; border-bottom: 1px solid #ffffff14; }
.hana-player-settings__header strong { font-size: 13px; letter-spacing: .01em; }
.hana-player-settings .hana-player-settings__close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #b9c2cd; font-size: 23px; line-height: 1; }
.hana-player-settings__close:hover { background: #ffffff12; color: #fff; }
.hana-player-settings__home,
.hana-player-settings__section,
.hana-player-settings__choices { display: grid; gap: 3px; }
.hana-player-settings__home,
.hana-player-settings__section { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.hana-player-settings__home { padding-top: 6px; }
.hana-player-settings__section[hidden], .hana-player-settings__home[hidden] { display: none; }
.hana-player-setting-row,
.hana-player-settings__back,
.hana-player-settings__choice { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #edf2f7; text-align: left; transition: background-color 160ms cubic-bezier(.22,.72,.25,1); }
.hana-player-setting-row:hover,
.hana-player-settings__back:hover,
.hana-player-settings__choice:hover { background: #ffffff12; }
.hana-player-setting-row:active,
.hana-player-settings__back:active,
.hana-player-settings__choice:active { background: #ffffff1b; }
.hana-player-setting-row small { min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aeb9c5; font-size: 11px; }
.hana-player-setting-row b { color: #8f9baa; font-size: 19px; font-weight: 400; line-height: 1; }
.hana-player-settings__back { grid-template-columns: 1fr; margin: 5px 0 2px; color: #c9d1da; font-size: 12px; }
.hana-player-settings__choice { grid-template-columns: minmax(0, 1fr) 20px; font-size: 12px; }
.hana-player-settings__choice > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.hana-player-settings__choice b { visibility: hidden; color: var(--media-accent, #a9c9ff); text-align: right; }
.hana-player-settings__choice.selected { color: #fff; background: #ffffff0d; }
.hana-player-settings__choice.selected b { visibility: visible; }
.hana-player-settings__empty { padding: 16px 10px; color: #9ca8b5; font-size: 11px; }
.hana-player-settings__status { margin: 3px 0 0; padding: 6px 10px; color: #c9d1da; font-size: 11px; line-height: 1.5; }
.hana-player-settings__choice:disabled { cursor: wait; opacity: .55; }
.hana-player-settings__close:active { background: #ffffff1b; }
.player-shell [data-player-landscape] { display: none; }
.player-shell [data-player-landscape] svg { width: 19px; height: 19px; }
.player-shell [data-player-settings] svg { width: 18px; height: 18px; }
.player-shell :is([data-player-settings], [data-player-landscape]):focus-visible,
.hana-player-settings :is(button):focus-visible { outline: 2px solid #a9c9ff; outline-offset: -2px; }

@media (hover: hover) and (pointer: fine) {
  .emby-watch .watch-tools .engagement-button:hover,
  .emby-watch .creator-subscribe:hover,
  .emby-watch .synopsis-toggle:hover,
  .emby-watch #comment-form button:hover { color: var(--accent-text, #a9c9ff); border-color: var(--accent, #8ab4ff); background: color-mix(in srgb, var(--accent, #8ab4ff) 16%, var(--surface, #111821)); transform: translateY(-1px); }
  .emby-watch .watch-tools .engagement-button:active,
  .emby-watch .creator-subscribe:active,
  .emby-watch .synopsis-toggle:active,
  .emby-watch #comment-form button:active { transform: translateY(0) scale(.97); background: color-mix(in srgb, var(--accent, #8ab4ff) 25%, var(--surface, #111821)); }
}
@keyframes search-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1536px) {
  .emby-watch .watch-layout { grid-template-columns: minmax(0, 1fr) 324px; gap: 36px; }
}
@media (max-width: 1279px) {
  .search-layout { grid-template-columns: minmax(180px, 208px) minmax(0, 1fr); gap: 24px; }
  .search-filter-panel { padding-right: 20px; }
  .search-page .search-grid,
  .search-skeleton { gap: 18px 12px; }
  .emby-watch .watch-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
  .emby-watch .watch-aside { padding: 18px 14px; }
  .emby-watch .related-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 1023px) {
  .search-page { --catalog-columns: 4; }
  .search-page,
  .emby-watch { padding-top: 30px; }
  .search-layout,
  .search-page[data-filters-open="false"] .search-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .search-filter-panel { padding: 18px 20px 22px; border: 1px solid #293540; border-radius: 12px; background: var(--surface, #111821); }
  .search-page .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .search-page .filter-clear { align-self: end; margin: 0; }
  .emby-watch .watch-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .emby-watch .watch-aside { padding: 22px; }
  .emby-watch .watch-aside .episode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emby-watch .watch-aside #current-media-slot .episode-list { grid-template-columns: minmax(0, 1fr); }
  .emby-watch .watch-discussion { margin: 0; }
  .emby-watch .related-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .search-page,
  .emby-watch { padding: 24px 20px 80px; }
  .search-page .search-heading { gap: 16px; margin-bottom: 26px; }
  .search-page .search-heading h1 { font-size: 30px; }
  .search-page .search-heading p:not(.search-eyebrow) { font-size: 13px; }
  .search-home-link { align-self: flex-start; }
  .search-home-link span { display: none; }
  .search-controls { gap: 10px; }
  .search-page .search-filter-toggle { min-width: 88px; padding: 10px 12px; }
  .search-page .page-search button { min-width: 52px; padding: 0 14px; }
  .search-page .page-search button > span { display: none; }
  .search-active-filters { margin-bottom: 20px; }
  .search-page .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-page .list-card { grid-template-columns: 80px minmax(0, 1fr); gap: 16px; }
  .search-page .list-copy h2 { font-size: 15px; }
  .search-page .page-count { width: 100%; text-align: center; margin: 8px 0 0; }
  .emby-watch .watch-crumb { margin-bottom: 12px; }
  .emby-watch .watch-title h1 { font-size: 28px; }
  .emby-watch .player-start { width: 64px; height: 64px; }
  .emby-watch .watch-aside { padding: 18px 16px; }
  .emby-watch .creator-subscribe { margin-left: 54px; }
  .emby-watch .watch-recommendations { margin-top: 6px; padding-top: 26px; }
  .emby-watch .related-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
}
@media (max-width: 479px) {
  .search-page,
  .emby-watch { padding: 22px 16px 76px; }
  .search-page .search-heading h1 { font-size: 28px; }
  .search-page .search-heading p:not(.search-eyebrow) { max-width: 25ch; line-height: 1.8; }
  .search-controls { gap: 8px; }
  .search-page .search-filter-toggle { min-width: 76px; padding: 10px; gap: 5px; }
  .search-page .search-filter-toggle svg { width: 18px; height: 18px; }
  .search-page .page-search input[name] { padding: 0 12px; }
  .search-page .page-search button { min-width: 44px; padding: 0 10px; }
  .search-filter-panel { padding: 16px 14px; }
  .search-page .filter-bar { gap: 16px 10px; }
  .search-page .filter-bar input,
  .search-page .filter-bar select { font-size: 12px; padding: 10px 8px; }
  .search-page .results-head { gap: 10px; }
  .search-page .results-head > div:first-child { display: block; }
  .search-page .results-head h2 { font-size: 17px; margin-bottom: 5px; }
  .search-page .view-options a { padding: 8px 11px; }
  .search-page .list-card { grid-template-columns: 68px minmax(0, 1fr); gap: 13px; }
  .search-page .list-copy h2 { font-size: 14px; }
  .search-page .list-copy p { font-size: 11px; }
  .search-page .list-copy .full-tags { gap: 6px; }
  .search-page .pager { gap: 6px; }
  .search-page .pager a,
  .search-page .pager > span:not(.page-count) { min-width: 44px; }
  .search-empty { min-height: 320px; padding: 28px 16px; }
  .search-empty h2 { font-size: 17px; }
  .emby-watch .watch-title h1 { font-size: 24px; }
  .emby-watch .watch-title .watch-subtitle { font-size: 14px; }
  .emby-watch .watch-title .watch-facts { font-size: 12px; gap: 4px 14px; }
  .emby-watch .player-shell { border-radius: 9px; }
  .emby-watch .player-start { width: 56px; height: 56px; }
  .emby-watch .player-start svg { width: 24px; height: 24px; }
  .emby-watch .watch-tools { gap: 7px; }
  .emby-watch .watch-tools .engagement-button { padding: 10px 11px; font-size: 12px; }
  .emby-watch .creator-row { padding: 18px 0; }
  .emby-watch .creator-row strong { font-size: 13px; }
  .emby-watch .description .watch-synopsis { font-size: 13px; }
  .emby-watch .watch-aside .episode-list { grid-template-columns: minmax(0, 1fr); }
  .emby-watch .watch-discussion { padding-top: 22px; }
  .emby-watch #comment-form { grid-template-columns: minmax(0, 1fr); }
  .emby-watch #comment-form button { justify-self: end; }
  .emby-watch .related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .emby-watch .section-title h2 { font-size: 19px; }
}
/* Mobile playback is the primary surface; actions stay compact, with 44px hit areas. */
@media (max-width: 767px) {
  body:has(.emby-watch) .category-nav { display: none; }
  body:has(.emby-watch) .topbar { height: 60px; min-height: 60px; }
  .emby-watch { padding: 0 16px 76px; }
  .emby-watch .watch-crumb { display: none; }
  .emby-watch .watch-layout { gap: 20px; }
  .emby-watch .player-shell { width: calc(100% + 32px); max-width: none; margin: 0 -16px; border: 0; border-radius: 0; box-shadow: none; }
  .emby-watch .player-start { width: 48px; height: 48px; }
  .emby-watch .player-start svg { width: 22px; height: 22px; }
  .emby-watch .qjy-status { min-height: 22px; margin-top: 0; padding: 5px 0 0; font-size: 10px; }
  .emby-watch .quality-switcher { gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: 0; margin-top: 4px; border: 0; border-radius: 0; background: transparent; }
  .emby-watch .quality-switcher > span { flex: none; min-width: 42px; font-size: 11px; color: var(--muted); }
  .emby-watch .quality-switcher button { flex: none; min-height: 44px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; font-size: 11px; box-shadow: inset 0 -1px #ffffff18; }
  .emby-watch .quality-switcher button.selected { background: transparent; color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
  .emby-watch .watch-title { margin-top: 14px; }
  .emby-watch .watch-kind { margin-bottom: 4px; font-size: 10px; }
  .emby-watch .watch-title h1 { max-width: none; margin-bottom: 7px; font-size: 20px; line-height: 1.45; }
  .emby-watch .watch-title .watch-subtitle { font-size: 12px; }
  .emby-watch .watch-title .watch-original-title { font-size: 11px; }
  .emby-watch .watch-title .watch-facts { font-size: 11px; gap: 3px 12px; }
  .emby-watch .watch-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 2px; width: 100%; margin-top: 10px; padding-block: 2px; border-block: 1px solid #ffffff0c; overflow: visible; }
  .emby-watch .watch-tools .engagement-button { flex: none; flex-direction: column; width: 100%; min-width: 0; min-height: 44px; max-height: 44px; gap: 2px; padding: 3px 2px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; overflow: hidden; }
  .emby-watch .watch-tools .engagement-button svg { width: 17px; height: 17px; }
  .emby-watch .watch-tools .engagement-button span { display: block; width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: clamp(9px, 2.8vw, 11px); line-height: 1.15; white-space: nowrap; text-align: center; }
  .emby-watch .watch-tools .engagement-button.active { color: var(--accent); background: #8ab4ff0c; }
  .emby-watch .creator-row { display: flex; flex-wrap: nowrap; gap: 10px; padding: 12px 0; margin-top: 8px; }
  .emby-watch .creator-row .avatar { flex: none; width: 32px; height: 32px; border-radius: 8px; }
  .emby-watch .creator-row .avatar svg { width: 18px; height: 18px; }
  .emby-watch .creator-row > .creator-identity { flex: 1; min-width: 0; }
  .emby-watch .creator-row { flex-wrap: wrap; }
  .emby-watch .creator-row > .watch-tools { flex: 0 0 100%; margin: 0; }
  .emby-watch .creator-row strong { font-size: 12px; overflow-wrap: anywhere; }
  .emby-watch .creator-row .creator-subscribe { flex: none; min-height: 44px; margin-left: auto; padding: 0 8px; gap: 4px; border: 0; background: transparent; color: var(--accent); }
  .emby-watch .creator-subscribe svg { width: 16px; height: 16px; }
  .emby-watch .creator-subscribe span { font-size: 11px; }
  .emby-watch .description { margin-top: 12px; }
  .emby-watch .description h2 { margin-bottom: 8px; font-size: 14px; }
  .emby-watch .description .watch-synopsis { font-size: 12px; line-height: 1.8; }
  .emby-watch .watch-aside { padding: 10px 0 14px; border: 0; border-top: 1px solid color-mix(in srgb, var(--muted, #a9b4c2) 20%, transparent); border-radius: 0; background: transparent; }
  .emby-watch .aside-head { padding: 6px 2px 10px; border-bottom-color: color-mix(in srgb, var(--muted, #a9b4c2) 15%, transparent); }
  .emby-watch .aside-head h2 { font-size: 16px; }
  .emby-watch .collection-name { margin: 10px 2px 4px; color: color-mix(in srgb, var(--muted, #a9b4c2) 88%, var(--text, #f3f6fa)); font-size: 11px; letter-spacing: .02em; }
  .emby-watch #collection-episodes { max-height: none; overflow: visible; overscroll-behavior: auto; touch-action: pan-y pinch-zoom; scrollbar-width: auto; }
  .emby-watch .episode-list { gap: 0; padding: 0; touch-action: pan-y pinch-zoom; }
  .emby-watch #current-media-slot .episode-list { padding: 0; }
  .emby-watch .media-episode,
  .emby-watch .collection-episode { position: relative; grid-template-columns: 40px minmax(0, 1fr); min-height: 68px; margin: 0; padding: 9px 4px; gap: 11px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--muted, #a9b4c2) 14%, transparent); border-radius: 0; background: transparent; touch-action: pan-y pinch-zoom; transition: color 140ms ease, background 140ms ease, transform 110ms ease; }
  .emby-watch .media-episode img,
  .emby-watch .collection-episode img { width: 40px; height: 53px; border-radius: 6px; background: color-mix(in srgb, var(--surface-raised, #19222d) 76%, transparent); }
  .emby-watch .media-episode b,
  .emby-watch .collection-episode b { color: color-mix(in srgb, var(--accent, #8ab4ff) 74%, var(--text, #f3f6fa)); font-size: 10px; font-weight: 600; letter-spacing: .02em; }
  .emby-watch .media-episode strong,
  .emby-watch .collection-episode strong { margin-top: 2px; color: color-mix(in srgb, var(--text, #f3f6fa) 88%, var(--muted, #a9b4c2)); font-size: 12px; font-weight: 500; line-height: 1.5; }
  .emby-watch .media-episode.selected,
  .emby-watch #current-media-slot .media-episode { padding-left: 10px; background: color-mix(in srgb, var(--accent, #8ab4ff) 10%, transparent); box-shadow: inset 3px 0 var(--accent, #8ab4ff); }
  .emby-watch :is(.media-episode, .collection-episode):active { background: color-mix(in srgb, var(--accent, #8ab4ff) 15%, transparent); transform: scale(.985); }
  .player-shell [data-player-landscape] { display: inline-flex; }
  .player-shell .plyr:not(:fullscreen):not(.plyr--fullscreen-fallback) .plyr__controls { --plyr-control-spacing: 2px; --plyr-control-icon-size: 17px; column-gap: 0; padding-right: max(3px, env(safe-area-inset-right)); padding-left: max(3px, env(safe-area-inset-left)); }
  .player-shell .plyr:not(:fullscreen):not(.plyr--fullscreen-fallback) .plyr__volume { display: none; }
  .player-shell .plyr:not(:fullscreen):not(.plyr--fullscreen-fallback) .plyr__controls > .plyr__control { flex: 0 0 34px; width: 34px; min-width: 34px; min-height: 36px; margin: 0; padding: 8px; }
  .player-shell .plyr:not(:fullscreen):not(.plyr--fullscreen-fallback) .plyr__progress__container { min-width: 54px; margin: 0 1px; }
  .player-shell .plyr:not(:fullscreen):not(.plyr--fullscreen-fallback) .plyr__time { flex: 0 0 auto; margin: 0 1px; padding: 0; font-size: 10px; font-variant-numeric: tabular-nums; }
  .player-shell .plyr:fullscreen .plyr__control,
  .player-shell .plyr--fullscreen-fallback .plyr__control { min-width: 36px; min-height: 36px; padding: 8px; }
}
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .player-shell .hana-player-settings { right: max(8px, env(safe-area-inset-right)); bottom: calc(52px + env(safe-area-inset-bottom)); width: min(264px, calc(100% - 16px)); max-height: calc(100% - 60px - env(safe-area-inset-bottom)); padding: 4px; border-radius: 9px; }
  .hana-player-settings__header { min-height: 28px; padding: 0 2px 2px 8px; }
  .hana-player-settings[data-settings-view]:not([data-settings-view="home"]) .hana-player-settings__header { display: none; }
  .hana-player-settings__header strong { font-size: 12px; }
  .hana-player-settings .hana-player-settings__close { width: 28px; height: 28px; font-size: 21px; border-radius: 6px; }
  .hana-player-settings__home { padding-top: 3px; }
  .hana-player-settings__home,
  .hana-player-settings__section,
  .hana-player-settings__choices { gap: 2px; }
  .hana-player-settings .hana-player-setting-row,
  .hana-player-settings .hana-player-settings__back,
  .hana-player-settings .hana-player-settings__choice { min-height: 36px; padding: 6px 8px; border-radius: 6px; font-size: 12px; line-height: 1.35; }
  .hana-player-setting-row small { max-width: 140px; }
  .hana-player-settings .hana-player-settings__back { min-height: 30px; margin: 1px 0; padding-block: 4px; }
}
@media (max-width: 359px) {
  .player-shell .plyr:not(:fullscreen):not(.plyr--fullscreen-fallback) [data-plyr="pip"] { display: none; }
}
@media (max-width: 768px) and (orientation: portrait) {
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__controls { --plyr-control-spacing: 2px; --plyr-control-icon-size: 17px; flex-wrap: wrap; justify-content: flex-start; column-gap: 0; row-gap: 0; padding: 8px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__controls > .plyr__controls__item { margin: 0; }
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__controls > .plyr__progress__container { order: -1; flex: 0 0 100%; width: 100%; min-width: 0; margin: 0; padding: 0; }
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__progress input[data-plyr="seek"] { height: 28px; }
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__controls > .plyr__control,
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__volume > .plyr__control { flex: 0 0 32px; width: 32px; min-width: 32px; height: 36px; min-height: 36px; margin: 0; padding: 7px; }
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__controls > .plyr__volume { display: flex; flex: 0 0 auto; width: auto; margin: 0; }
  .player-shell .plyr:not(.hana-landscape-rotated) .plyr__controls > .plyr__time { flex: 0 0 auto; margin: 0 auto 0 2px; padding: 0 3px; font-size: 10px; font-variant-numeric: tabular-nums; }
  .player-shell .plyr.plyr--pip-supported:not(.hana-landscape-rotated) [data-plyr="pip"] { display: inline-block; }
  .player-shell .plyr:not(.hana-landscape-rotated):not(.plyr--hide-controls) .plyr__captions { transform: translateY(calc(-72px - max(4px, env(safe-area-inset-bottom)))); }
}
/* Apply after ordinary inline/fallback player rules. The rotated root keeps
   the existing controls, settings, captions and previews in local coordinates. */
.player-shell .plyr.hana-landscape-rotated {
  position: fixed !important;
  inset: auto !important;
  left: var(--hana-landscape-left) !important;
  top: var(--hana-landscape-top) !important;
  width: var(--hana-landscape-width) !important;
  height: var(--hana-landscape-height) !important;
  min-width: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
  transform: translate(-50%, -50%) rotate(var(--hana-landscape-angle)) !important;
  transform-origin: center;
}
.player-shell .plyr.hana-landscape-rotated .plyr__video-wrapper {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.player-shell .plyr.hana-landscape-rotated input[type="range"] { touch-action: none; }
@media (prefers-reduced-motion: reduce) {
  .search-filter-panel { animation: none; }
  .search-page *,
  .emby-watch .engagement-button,
  .emby-watch .episode,
  .emby-watch .player-start,
  .hana-player-settings *,
  .player-shell [data-hana-player-control] { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .search-page { scroll-behavior: auto; }
}
@media (max-width: 768px) {
  .emby-watch #sequence-next { display: none !important; }
  .emby-watch .author-list { gap: 12px; }
  .emby-watch .author-work { grid-template-columns: min(50%, 240px) minmax(0, 1fr); gap: 10px; }
}

/* Account and moderation controls share the existing library surfaces. */
#auth-invite-label[hidden] { display: none; }
#auth-form .interaction-challenge { width: 100%; min-height: 68px; margin-top: 16px; }
#auth-form [data-interaction-status]:empty { display: none; }
#auth-form .auth-recovery-link { display: inline-flex; align-items: center; min-height: 40px; margin: 8px 0 0; padding: 3px 0; border: 0; background: transparent; color: var(--accent, #8ab4ff); cursor: pointer; }
#auth-form .auth-recovery-link:hover { text-decoration: underline; }
#auth-form :is(.auth-recovery-link,input):focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 2px; }
#auth-modal { box-sizing: border-box; width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 24px; border-radius: 8px; }
#auth-modal .modal-tabs { gap: 20px; margin: -2px 0 16px; padding: 0 42px 0 0; }
#auth-modal .modal-tabs button:not(.active) { color: var(--muted); }
#auth-modal .dialog-close { top: 12px; right: 12px; }
html[data-theme="light"] #auth-modal .dialog-close { color: var(--text); background: var(--surface-raised); border-color: var(--line); }
#auth-form h3 { margin: 0 0 4px; padding-right: 36px; font-size: 21px; line-height: 1.3; }
#auth-form #auth-help { margin: 0 0 10px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#auth-form > label { margin-top: 11px; }
#auth-form > label input { min-height: 44px; margin-top: 5px; }
#auth-form #auth-email-help { margin: 5px 0 0; font-size: 12px; line-height: 1.45; }
#auth-form .auth-recovery-link { min-height: 32px; margin-top: 3px; }
#auth-form .interaction-challenge { min-height: 65px; margin-top: 9px; max-width: 100%; }
#auth-form .interaction-challenge[data-widget-size="compact"] { width: 150px; margin-inline: auto; }
#auth-form .interaction-challenge[data-widget-size="normal"] { width: 300px; margin-inline: auto; }
#auth-form #auth-submit { min-height: 44px; margin-top: 13px; }
.password-control { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; min-width: 0; gap: 6px; }
.password-control input { min-width: 0; width: 100%; min-height: 44px; margin: 0; }
.password-control button { min-width: 48px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface-raised); font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
:is(#auth-form,.account-recovery) :is(button,input) { transition: background 160ms ease,border-color 160ms ease,transform 160ms ease; }
:is(#auth-form,.account-recovery) button:hover:not(:disabled) { border-color: var(--accent); }
:is(#auth-form,.account-recovery) button:active:not(:disabled) { transform: translateY(1px); }
:is(#auth-form,.account-recovery) button:disabled { opacity: .55; cursor: wait; }
.password-control button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft,var(--surface-raised)); }
:is(#auth-form,.account-recovery) :is(button,input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#auth-form :is(#auth-error,[data-interaction-status]) { min-height: 0; margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
#auth-form [data-interaction-status]:not(:empty),#auth-form #auth-error:not(:empty) { margin-top: 7px; }
@media (max-width: 480px) {
  #auth-modal { padding: 18px; }
  #auth-modal .modal-tabs { gap: 17px; margin: 0 0 14px; }
}
@media (max-width: 370px) {
  #auth-modal { width: calc(100vw - 12px); max-width: none; padding: 10px; }
}
@media (max-width: 340px) {
  #auth-modal { width: calc(100vw - 4px); padding: 6px; }
}
.account-recovery { margin-top: 32px; padding-block: 21px; border-block: 1px solid var(--line, #354252); }
.account-recovery h2 { margin: 0 0 8px; font-size: 17px; }
.account-recovery form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; max-width: 840px; }
.account-recovery label { display: grid; gap: 7px; min-width: 0; color: var(--muted, #a9b4c2); font-size: 12px; }
.account-recovery input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line, #354252); border-radius: 6px; background: var(--surface, #111821); color: var(--text, #f3f6fa); }
.account-recovery .form-error { grid-column: 1 / -1; order: 4; }
.account-recovery form>button { grid-column: 3; min-height: 44px; white-space: nowrap; }
.account-password form { grid-template-columns: repeat(3,minmax(0,1fr)); }
.account-recovery>p { max-width: 72ch; line-height: 1.65; font-size: 12px; }
.interaction-mode-label { display: grid; gap: 8px; max-width: 320px; }
.interaction-rows { display: grid; gap: 10px; margin-block: 14px; }
.interaction-rule-row,.interaction-domain-row { display: grid; align-items: end; grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr) auto auto; gap: 10px; padding-block: 8px; border-bottom: 1px solid var(--line, #354252); }
.interaction-domain-row { grid-template-columns: minmax(180px, 1fr) auto auto; }
.interaction-rule-row label,.interaction-domain-row label { min-width: 0; }
.interaction-rule-row .checkbox-row,.interaction-domain-row .checkbox-row { align-self: center; white-space: nowrap; }
.op-comment-row { padding: 16px 0; border-bottom: 1px solid var(--line, #354252); }
.op-comment-row p { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.op-comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; color: var(--muted, #a9b4c2); font-size: 12px; }
.op-comment-meta strong { color: var(--text, #f3f6fa); }
@media (max-width: 768px) {
  .account-recovery form { grid-template-columns: minmax(0, 1fr); }
  .account-recovery label,.account-recovery form>button { grid-column: 1; grid-row: auto; }
  :is(#auth-form,.account-recovery) input { font-size: 16px; }
  .interaction-rule-row,.interaction-domain-row { grid-template-columns: minmax(0, 1fr) auto; }
  .interaction-rule-row label:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .interaction-rule-row label:first-child,.interaction-domain-row label:first-child { grid-column: 1 / -1; }
  .interaction-rule-row button,.interaction-domain-row button { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .emby-watch .watch-tools .engagement-button { transition: none; }
}

.emby-watch #comment-form .comment-cancel-reply[hidden],
.emby-watch #comment-form [data-interaction-status]:empty { display: none; }
.emby-watch #comment-form .comment-cancel-reply { grid-column: 1 / -1; justify-self: start; min-height: 34px; padding: 4px 0; border: 0; background: transparent; color: var(--accent, #8ab4ff); cursor: pointer; }
.emby-watch #comment-form > [data-interaction-challenge] { grid-column: 1 / -1; min-height: 68px; width: 100%; }
.emby-watch #comment-form > [data-interaction-status],
.emby-watch #comment-form > [data-comment-error] { grid-column: 1 / -1; min-height: 0; margin: 0; }
.emby-watch #comment-form > [data-comment-status] { grid-column: 1 / -1; min-height: 18px; margin: 0; color: var(--muted, #a9b4c2); font-size: 12px; line-height: 18px; }
.emby-watch #comment-form[data-submit-state="sent"] > [data-comment-status] { color: var(--accent-text, #a9c9ff); }
.emby-watch #comment-form[data-submit-state="failed"] > [data-comment-status] { color: var(--error, #ffb8c2); }
.emby-watch #comment-form button[type="submit"] { min-width: 100px; white-space: nowrap; }
.emby-watch .comment-thread { margin-left: 23px; border-left: 1px solid var(--line, #354252); padding-left: 14px; }
.emby-watch .comment-reply { padding-block: 10px; }
.emby-watch .comment-byline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.emby-watch .comment-byline span { font-size: 11px; color: var(--muted, #a9b4c2); }
.emby-watch .comment-byline time { margin: 0; }
.emby-watch .comment-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.emby-watch .comment-controls button,.emby-watch .comment-more { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 5px 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted, #a9b4c2); cursor: pointer; font-size: 12px; }
.emby-watch .comment-controls button:hover,.emby-watch .comment-more:hover { color: var(--text, #f3f6fa); background: var(--surface-raised, #19222d); }
.emby-watch .comment-controls button[aria-pressed="true"] { color: var(--accent, #8ab4ff); background: var(--accent-soft, #19222d); }
.emby-watch .comment-controls button:focus-visible,.emby-watch .comment-more:focus-visible,.emby-watch .comment-cancel-reply:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 2px; }
.emby-watch .comment-controls button svg { width: 16px; height: 16px; }
.emby-watch .comment-controls button.is-downvote svg { transform: rotate(180deg); }
.emby-watch .comment-more { border-color: var(--line, #354252); margin-block: 10px; }
.emby-watch #comment-form textarea:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 2px; }
@media (max-width: 479px) {
  .emby-watch .comment-thread { margin-left: 10px; padding-left: 10px; }
  .emby-watch .comment-controls button { min-width: 40px; }
}
@media (min-width: 1024px) {
  /* The author's 36px extra column width comes equally from both gutters,
     preserving the player width of the original episode layout. */
  .emby-watch:has(.watch-author-panel) > :is(.watch-crumb,.watch-layout) { width: calc(100% + 36px); margin-inline: -18px; }
  .emby-watch .watch-layout:has(.watch-author-panel) { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .emby-watch .watch-layout:has(.watch-author-panel) { grid-template-columns: minmax(0, 1fr) 316px; }
}
@media (min-width: 1536px) {
  .emby-watch .watch-layout:has(.watch-author-panel) { grid-template-columns: minmax(0, 1fr) 360px; }
}

/* Sidebar rows are allocated by the watch view without clipping media cards. */
.emby-watch .watch-aside[data-watch-aside] {
  --aside-top: 22px;
  --aside-inline: 18px;
  --aside-bottom: 18px;
  position: relative;
  align-self: start;
  min-width: 0;
  min-height: 0;
  padding: var(--aside-top) var(--aside-inline) var(--aside-bottom);
}
.emby-watch .watch-aside-content { display: grid; align-content: start; gap: 18px; min-width: 0; }
.emby-watch .watch-aside-content [hidden] { display: none !important; }
.emby-watch [data-aside-section] { min-width: 0; }
.emby-watch [data-aside-section] + [data-aside-section] { padding-top: 18px; border-top: 1px solid var(--line); }
.emby-watch [data-aside-section] .aside-head { align-items: center; gap: 10px; padding-bottom: 8px; }
.emby-watch [data-aside-section] .aside-head h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.emby-watch [data-aside-section] .collection-name { margin: 8px 0 12px; }
.emby-watch [data-aside-items] { min-width: 0; overflow: visible; }
.emby-watch [data-aside-toggle] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 10px; margin-top: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer; }
.emby-watch [data-aside-toggle]:hover { border-color: var(--accent); background: var(--surface-raised); }
.emby-watch [data-aside-toggle][aria-expanded="true"] { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.emby-watch [data-aside-toggle]:active { transform: translateY(1px); }
.emby-watch [data-aside-toggle]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.emby-watch [data-aside-toggle]:disabled { cursor: progress; }
@media (min-width: 1024px) {
  .emby-watch .watch-layout:has([data-watch-aside]) > .watch-main { grid-column: 1; grid-row: 1; }
  .emby-watch .watch-aside[data-watch-aside] { grid-column: 2; grid-row: 1 / 3; }
  .emby-watch .watch-layout:has([data-watch-aside]) > .watch-discussion { grid-column: 1; grid-row: 2; }
  .emby-watch .watch-layout:has([data-watch-aside]) > .watch-recommendations { grid-column: 1 / -1; grid-row: 3; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .emby-watch .watch-aside[data-watch-aside] { --aside-top: 18px; --aside-inline: 14px; }
}
@media (max-width: 1023px) {
  .emby-watch .watch-aside[data-watch-aside] { --aside-inline: 22px; --aside-bottom: 22px; }
  .emby-watch .watch-aside[data-watch-aside] > .watch-aside-content { position: static; }
}
@media (max-width: 768px) {
  .emby-watch .watch-aside[data-watch-aside] { --aside-top: 10px; --aside-inline: 0px; --aside-bottom: 14px; }
  .emby-watch .watch-aside-content { gap: 14px; }
  .emby-watch [data-aside-section] + [data-aside-section] { padding-top: 14px; }
  .emby-watch [data-aside-section] .aside-head { padding-inline: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .emby-watch [data-aside-toggle] { transition: none; }
  .emby-watch [data-aside-toggle]:active { transform: none; }
}

/* Search follows the same landscape media shelf as the homepage. Results are
   appended in place so loading another page never resets the route shell. */
.search-page .search-media-grid { display: grid; gap: 18px 12px; align-items: start; }
.search-page .search-media-grid .video-card { min-width: 0; }
.search-page .search-media-grid .video-thumb { border: 1px solid transparent; transition: border-color 180ms, box-shadow 180ms; }
.search-page .search-media-grid .video-card:hover .video-thumb, .search-page .search-media-grid .video-card:focus-within .video-thumb { border-color: color-mix(in srgb, var(--accent, #8ab4ff) 60%, transparent); box-shadow: 0 12px 30px #0000002b; }
.search-page .search-media-grid .video-card:hover .video-thumb img, .search-page .search-media-grid .video-card:focus-within .video-thumb img { transform: scale(1.045); }
.search-more { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 86px; color: var(--muted, #a9b4c2); font-size: 12px; }
.search-more[hidden] { display: none; }
.search-more .button { min-height: 38px; }

/* Stitch-style search hierarchy: filters sit above a full-width result shelf,
   never in a left rail that steals result columns. */
.search-page .search-layout { display: block; }
.search-page .search-filter-panel-top {
  width: 100%;
  padding: 18px 0 22px;
  margin: 0 0 24px;
  border: 0;
  border-bottom: 1px solid #293540;
  background: transparent;
}
.search-page .search-filter-panel-top .filter-bar {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.search-page .search-filter-panel-top .filter-clear { align-self: end; margin: 0; }
.search-page .search-filter-panel-top[hidden] { display: none; }
.search-page .search-filter-backdrop { display: none; }
@media (max-width: 1199px) and (min-width: 769px) {
  .search-page .search-filter-panel-top .filter-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .search-page { --catalog-columns: 2; }
  .search-page .search-heading { text-align: left; }
  .search-page .search-heading > div { margin: 0; }
  .search-page .search-home-link { position: static; margin-top: 10px; }
  .search-controls { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; justify-content: stretch; margin-bottom: 22px; }
  .search-query { grid-column: 1; width: 100%; max-width: none; }
  .search-filter-toggle { grid-column: 1; justify-self: center; }
  .search-page .search-filter-panel-top { padding: 16px 0 18px; margin-bottom: 20px; }
  .search-page .search-filter-panel-top .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .search-page .search-filter-panel-top .filter-clear { grid-column: 1 / -1; }
  .search-more { min-height: 74px; flex-direction: column; gap: 6px; }
}

/* Search density correction: the result shelf is the primary surface. Keep
   filters in a compact top toolbar and give the landscape cards the same
   seven-column rhythm as the reference search view. */
.search-page {
  max-width: none;
  padding-top: 20px;
  padding-inline: clamp(18px, 2.5vw, 52px);
}
.platform-page.search-page { max-width: none; padding-top: 20px; }
.search-page .search-filter-panel-top {
  position: relative;
  z-index: 6;
  overflow: visible;
  animation: none;
  padding: 10px 0 12px;
  margin-bottom: 12px;
  border-bottom-color: color-mix(in srgb, var(--muted, #a9b4c2) 24%, transparent);
}
html[data-theme] .platform-page.search-page .search-filter-panel-top { border: 0; border-bottom: 1px solid var(--line, #354252); border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.search-page .search-filter-heading {
  min-height: 26px;
  margin-bottom: 8px;
}
.search-page .search-filter-heading h2 {
  font-size: 13px;
  letter-spacing: 0;
}
.search-page .search-filter-actions { display: flex; align-items: center; gap: 6px; }
.search-page .search-filter-close {
  width: 40px;
  height: 40px;
  margin-right: 0;
}
.search-page .search-filter-panel-top .filter-bar {
  display: grid;
  grid-template-columns: minmax(130px, 150px) minmax(250px, 285px) minmax(180px, 1fr) minmax(122px, 142px) minmax(122px, 142px);
  align-items: end;
  gap: 10px;
}
.search-page[data-ranking="true"] .search-filter-panel-top .filter-bar {
  grid-template-columns: minmax(250px, 285px) minmax(180px, 1fr) repeat(2, minmax(122px, 142px));
}
.search-page .search-filter-panel-top .filter-bar > label,
.search-page .search-filter-panel-top .filter-bar .search-time-filter > label,
.search-page .search-filter-panel-top .filter-bar .search-author-filter label {
  gap: 5px;
  font-size: 12px;
}
.search-page .search-filter-panel-top .filter-bar :is(input:not([type="checkbox"]), select, summary, button) {
  min-height: 44px;
  height: 44px;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 13px;
}
.search-page .search-filter-actions .filter-clear {
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  margin: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted, #a9b4c2);
  font-size: 12px;
}
.search-page .search-filter-actions .filter-clear:hover { border-color: var(--line, #354252); color: var(--text); background: var(--surface-raised); }
.search-page .search-time-filter { position: relative; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); align-items: end; gap: 5px; min-width: 0; }
.search-page .search-time-filter > label { grid-column: 1 / -1; }
.search-page .search-time-filter > select { grid-column: 1; grid-row: 2; }
.search-page .search-time-filter > button { grid-column: 2; grid-row: 2; border: 1px solid var(--line, #354252); color: var(--text); background: var(--surface, #111821); white-space: nowrap; }
.search-page .search-time-filter > button:hover { border-color: var(--accent); background: var(--surface-raised, #19222d); }
.search-page .search-time-filter > button[aria-pressed="true"], .search-page .search-time-filter > button[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-text, var(--text)); background: var(--accent-soft, var(--surface)); }
.search-page .search-date-range { position: absolute; z-index: 18; top: calc(100% + 7px); left: 0; width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line, #354252); border-radius: 8px; color: var(--text); background: var(--surface-raised, #19222d); box-shadow: 0 14px 32px #080b12a8; }
.search-page .search-date-range[hidden] { display: none; }
.search-page .search-date-range label { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); }
.search-page .search-date-range input[type="date"] { width: 100%; min-width: 0; color-scheme: dark; }
.search-page .search-date-range > p { grid-column: 1 / -1; margin: 0; color: #e99e92; font-size: 11px; }
.search-page .search-date-range > p[hidden] { display: none; }
.search-page .search-date-range > button { grid-column: 1 / -1; border: 1px solid var(--accent); color: var(--on-accent); background: var(--accent); font-weight: 600; }
.search-page .search-date-range > button:hover { filter: brightness(1.07); }
.search-page .search-author-filter { display: flex; align-items: end; gap: 0; min-width: 0; margin: 0; }
.search-page .search-author-filter label { flex: 1 1 auto; min-width: 0; }
.search-page .search-author-filter label input { border-radius: 6px 0 0 6px !important; }
.search-page .search-author-filter button { flex: 0 0 44px; display: grid; place-items: center; margin-left: -1px; border: 1px solid var(--line, #354252); border-radius: 0 6px 6px 0 !important; color: var(--text); background: var(--surface-raised, #19222d); }
.search-page .search-author-filter button:hover { border-color: var(--accent); color: var(--accent-text, var(--text)); }
.platform-page.search-page details.search-type-picker { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.search-page .search-type-picker > summary { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-width: 0; border: 1px solid var(--line, #354252); color: var(--text); background: var(--surface, #111821); cursor: pointer; list-style: none; white-space: nowrap; }
.platform-page.search-page details.search-type-picker[open] > summary { padding: 8px 10px; border: 1px solid var(--line, #354252); }
.search-page .search-type-picker > summary::-webkit-details-marker { display: none; }
.search-page .search-type-picker > summary span { color: var(--muted); font-size: 11px; }
.search-page .search-type-options { position: absolute; z-index: 18; right: 0; top: calc(100% + 7px); width: min(380px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line, #354252); border-radius: 8px; background: var(--surface-raised, #19222d); box-shadow: 0 14px 32px #080b12a8; }
.platform-page.search-page details.search-type-picker:not([open]) .search-type-options { display: none; }
.search-page .search-type-options > div { max-height: min(320px, 52dvh); overflow-y: auto; overscroll-behavior: contain; }
.search-page .search-type-group + .search-type-group { margin-top: 12px; }
.search-page .search-type-group h3 { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.search-page .search-type-chips { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 2px; }
.search-page .filter-bar .search-type-chip { position: relative; display: inline-flex; flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: center; max-width: 100%; min-height: 38px; padding: 7px 13px; border: 1px solid var(--line, #354252); border-radius: 999px; color: var(--text); background: transparent; font-size: 13px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.search-page .search-type-chip:hover { border-color: var(--accent); background: var(--accent-soft, #8ab4ff22); }
.search-page .search-type-chip:has(input:checked) { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 34%, var(--surface)); }
.search-page .search-type-chip:active { transform: scale(.97); }
.search-page .search-type-chip input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.search-page .search-type-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-page .search-type-options button { width: 100%; margin-top: 12px; border: 1px solid var(--accent); color: var(--on-accent); background: var(--accent); font-weight: 600; }
.search-page .search-type-options button:hover { filter: brightness(1.07); }
.search-page .search-tags-open { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; border: 1px solid var(--line, #354252); color: var(--text); background: var(--surface, #111821); white-space: nowrap; }
.search-page .search-tags-open b { color: var(--muted); font-size: 11px; font-weight: 500; }
.search-page .search-tags-open:hover, .search-page .search-type-picker > summary:hover { border-color: var(--accent); background: var(--surface-raised, #19222d); }
.search-page .search-tags-open:focus-visible, .search-page .search-type-picker :focus-visible, .search-page .filter-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-tags-dialog { position: fixed; inset: 0; width: min(740px, calc(100vw - 32px)); max-width: none; max-height: min(690px, calc(100dvh - 32px)); padding: 0; border: 1px solid var(--line, #354252); border-radius: 8px; color: var(--text); background: var(--surface, #111821); box-shadow: 0 30px 60px #0008; }
.search-tags-dialog[open] { display: flex; flex-direction: column; }
.search-tags-dialog::backdrop { background: #0c1119bc; }
.search-tags-dialog .search-tags-heading,.search-tags-dialog .search-tags-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; }
.search-tags-dialog .search-tags-heading h2 { margin: 0; font-size: 18px; }
.search-tags-dialog .search-tags-heading button { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 6px; color: var(--text); background: transparent; }
.search-tags-dialog .search-tags-heading button:hover { background: var(--surface-raised, #19222d); }
.search-tags-dialog .search-tag-search { display: block; padding: 2px 20px 16px; }
.search-tags-dialog .search-tag-search input { display: block; width: 100%; min-height: 44px; padding: 8px 13px; border: 1px solid var(--line, #354252); border-radius: 6px; background: var(--surface-raised, #19222d); color: var(--text); font-size: 14px; }
.search-tags-dialog .search-tags-body { flex: 1 1 auto; min-height: 0; max-height: min(480px, calc(100dvh - 205px)); overflow-y: auto; overscroll-behavior: contain; border-block: 1px solid var(--line, #354252); }
.search-tags-dialog .search-tags-list { padding: 8px 20px 20px; }
.search-tags-dialog .search-tag-group { padding: 17px 0 19px; border-bottom: 1px solid var(--line, #354252); }
.search-tags-dialog .search-tag-group:last-of-type { border-bottom: 0; }
.search-tags-dialog .search-tag-group-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; }
.search-tags-dialog .search-tag-group h3,.search-tags-dialog .search-tag-selected h3 { margin: 0; color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.35; }
.search-tags-dialog .search-tag-total { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.search-tags-dialog .search-tag-group-search { flex: 0 1 160px; min-width: 120px; margin: 0 0 0 auto; }
.search-tags-dialog .search-tag-group-search input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line, #354252); border-radius: 6px; color: var(--text); background: var(--surface-raised, #19222d); font: inherit; font-size: 12px; }
.search-tags-dialog .search-tag-group-search input::placeholder { color: var(--muted); }
.search-tags-dialog .search-tag-selected { padding: 13px 0 16px; border-bottom: 1px solid var(--line, #354252); }
.search-tags-dialog .search-tag-selected h3 { margin-bottom: 10px; }
.search-tags-dialog .search-tag-selected :is([data-tag-selected],[data-editor-remove]) { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--accent); border-radius: 6px; color: var(--text); background: var(--accent-soft, #8ab4ff22); font: inherit; font-size: 12px; overflow-wrap: anywhere; cursor: pointer; }
.search-tags-dialog .search-tag-selected :is([data-tag-selected],[data-editor-remove]) svg { flex: none; width: 14px; height: 14px; }
.search-tags-dialog .search-tag-selected :is([data-tag-selected],[data-editor-remove]):hover { background: var(--surface-raised); }
.search-tags-dialog .search-tag-empty,.search-tags-dialog .search-tag-group-status { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.search-tags-dialog .search-tag-group-status[hidden] { display: none; }
.search-tags-dialog .search-tag-error { display: flex; align-items: center; gap: 8px; margin: 9px 0 0; color: var(--text); font-size: 12px; }
.search-tags-dialog .search-tag-error button { min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface-raised); cursor: pointer; }
.search-tags-dialog .search-tag-chips { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.search-tags-dialog .search-tag-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-height: 38px; padding: 7px 14px; border: 1px solid var(--line, #354252); border-radius: 999px; color: var(--text); background: transparent; font-size: 13px; font-weight: 500; line-height: 1.35; text-align: center; overflow-wrap: anywhere; cursor: pointer; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.search-tags-dialog .search-tag-chip:hover { border-color: var(--accent); background: var(--accent-soft, #8ab4ff22); }
.search-tags-dialog .search-tag-chip:has(input:checked) { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 34%, var(--surface)); }
.search-tags-dialog .search-tag-chip:active { transform: scale(.97); }
.search-tags-dialog .search-tag-chip input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.search-tags-dialog .search-tag-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-tags-dialog .search-tags-list > p { margin: 16px 0; color: var(--muted); font-size: 13px; }
.search-tags-dialog .search-tags-list [data-tag-more] { display: block; width: 100%; min-height: 44px; margin: 18px 0 0; border: 1px solid var(--line, #354252); border-radius: 6px; color: var(--text); background: var(--surface-raised, #19222d); font-size: 13px; }
.search-tags-dialog .search-tags-list [data-tag-more]:hover { border-color: var(--accent); background: var(--accent-soft, #8ab4ff22); }
.search-tags-dialog .search-tags-list [data-tag-more][data-tag-group] { width: auto; max-width: 100%; margin-top: 13px; padding-inline: 14px; text-align: left; }
.search-tags-dialog .search-tags-list [data-tag-more]:disabled { cursor: wait; opacity: .7; }
.search-page .search-tag-match { display: inline-flex; flex-direction: row; align-items: center; gap: 9px; min-height: 40px; margin: 0 auto 0 0; color: var(--text); font-size: 12px; cursor: pointer; }
.search-page .search-tag-match input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.search-tags-dialog .search-tags-footer > span { color: var(--muted); font-size: 12px; }
.search-tags-dialog .search-tags-footer > div { display: flex; gap: 6px; }
.search-tags-dialog .search-tags-footer button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line, #354252); border-radius: 6px; color: var(--text); background: var(--surface-raised, #19222d); font-size: 12px; white-space: nowrap; }
.search-tags-dialog .search-tags-footer button:hover { border-color: var(--accent); }
.search-tags-dialog .search-tags-footer .button-primary { border-color: var(--accent); color: var(--on-accent); background: var(--accent); }
.search-tags-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tag-picker.access-tags-dialog { box-sizing: border-box; width: min(900px,calc(100vw - 24px)); max-height: min(820px,calc(100dvh - 24px)); }
.tag-picker .search-tags-heading { align-items: flex-start; }
.tag-picker .search-tags-heading .muted { margin: 7px 0 0; font-size: 12px; line-height: 1.6; }
.tag-picker .search-tags-body { max-height: none; }
.tag-picker :is(.access-tag-draft,.access-tag-manual) { padding-inline: 20px; }
.tag-picker .access-tag-draft .search-tag-selected { max-height: 25dvh; overflow-y: auto; }
.tag-picker .access-tag-manual { padding-block: 14px 4px; }
.tag-picker .access-tag-manual>label { display: block; margin-bottom: 8px; font-size: 12px; }
.tag-picker .access-tag-manual input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); color: var(--text); font: inherit; font-size: 14px; }
.tag-picker .access-tag-manual .muted { margin: 8px 0; font-size: 12px; }
.tag-picker :is(.access-tag-manual button,[data-editor-retry],[data-editor-more],.access-editor-conflict button) { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.tag-picker :is(button,input) { transition: background 160ms ease,border-color 160ms ease,transform 160ms ease; }
.tag-picker button:hover:not(:disabled) { border-color: var(--accent); }
.tag-picker button:active:not(:disabled) { transform: translateY(1px); }
.tag-picker :is(button,input):disabled { opacity: .55; cursor: wait; }
.tag-picker .access-editor-conflict { flex: none; padding: 12px 20px; max-height: 22dvh; overflow-y: auto; border-bottom: 1px solid var(--line); background: var(--surface-raised); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.tag-picker #access-editor-error { flex: none; margin: 0; padding: 0 20px; color: var(--error); font-size: 12px; line-height: 1.6; }
.tag-picker #access-editor-error:not(:empty) { padding-block: 8px; }
.tag-picker .search-tags-footer { flex: none; padding-bottom: max(12px,env(safe-area-inset-bottom)); flex-wrap: wrap; }
.tag-picker .search-tags-footer>div { margin-left: auto; }
@media(max-width:600px) {
  .tag-picker.access-tags-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: auto; }
  .tag-picker :is(.search-tags-heading,.search-tags-footer,.search-tags-list,.search-tag-search,.access-tag-draft,.access-tag-manual,.access-editor-conflict) { padding-inline: 12px; }
  .tag-picker .search-tags-footer>span { flex-basis: 100%; }
  .tag-picker .search-tags-footer>div { display: grid; grid-template-columns: auto auto auto; width: 100%; margin: 0; }
  .tag-picker .search-tags-footer button { padding-inline: 8px; }
  .tag-picker :is(.search-tag-search input,.access-tag-manual input) { font-size: 16px; }
  .tag-picker .search-tag-group-search { flex: 1 1 140px; }
}
@media(prefers-reduced-motion:reduce) {
  :is(#auth-form,.account-recovery,.tag-picker) :is(button,input) { transition: none; }
  :is(#auth-form,.account-recovery,.tag-picker) button:active:not(:disabled) { transform: none; }
}
.search-page .search-media-grid {
  gap: 18px 12px;
}
.search-page .search-media-grid .card-play {
  width: 34px;
  height: 34px;
  border-color: #ffffff66 !important;
  background: #f3f6fa9e !important;
  color: #19222d !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.search-page .search-media-grid .card-play svg { width: 16px; height: 16px; }
.search-page .search-media-grid .card-favorite {
  width: 32px;
  height: 32px;
  right: 8px;
  bottom: 8px;
  border-radius: 8px;
  border-color: #ffffff4a !important;
  background: #1118219e !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.search-page .search-media-grid .card-favorite svg { width: 16px; height: 16px; }

@media (max-width: 1000px) and (min-width: 769px) {
  .search-page .search-filter-panel-top .filter-bar { grid-template-columns: 140px minmax(245px,285px) minmax(190px,1fr); }
  .search-page[data-ranking="true"] .search-filter-panel-top .filter-bar { grid-template-columns: minmax(245px,285px) minmax(190px,1fr); }
}
@media (max-width: 768px) {
  .platform-page.search-page { padding-top: 17px; padding-inline: 16px; }
  .search-page .search-active-filters:not(:empty) { flex-wrap: nowrap; gap: 6px; width: 100%; padding: 0 0 5px; margin: 8px 0 9px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  .search-page .search-filter-chip { flex: 0 0 auto; max-width: min(66vw, 230px); white-space: nowrap; }
  .search-page .search-filter-chip > span { overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .search-page .search-filter-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 38; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: #05091480; }
  .search-page .search-heading { display: flex; align-items: center; margin-bottom: 12px; }
  .search-page .search-heading h1 { font-size: 21px; }
  .search-page .search-home-link { margin: 0; }
  .search-page .search-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-bottom: 8px; }
  .search-page .search-query, .search-page .search-filter-toggle { grid-column: auto; max-width: none; width: auto; }
  .search-page .search-filter-toggle { justify-self: auto; min-width: 88px; padding-inline: 8px; }
  .search-page .page-search button { min-width: 76px; padding-inline: 9px; }
  .search-page .page-search button > span { display: inline; }
  .search-page .page-search input[name] { padding-inline: 9px; }
  .search-page .search-filter-panel-top { position: fixed; inset: auto 0 calc(66px + env(safe-area-inset-bottom)) 0; z-index: 39; width: 100%; max-height: min(70dvh, 570px); padding: 12px 16px 16px; margin: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; color: var(--text); background: var(--surface); box-shadow: 0 -14px 30px #080b1266; }
  html[data-theme] .platform-page.search-page .search-filter-panel-top.search-filter-panel-top { border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface); box-shadow: 0 -14px 30px #080b1266; }
  .search-page .search-filter-actions .filter-clear, .search-page .search-filter-close { min-height: 44px; }
  .search-page .search-filter-close { width: 44px; height: 44px; }
  .search-page .search-filter-panel-top .filter-bar { grid-template-columns: minmax(100px,128px) minmax(0,1fr); gap: 10px 8px; overflow: visible; }
  .search-page .search-time-filter { grid-column: 2; }
  .search-page[data-ranking="true"] .search-filter-panel-top .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .search-page[data-ranking="true"] .search-time-filter { grid-column: 1 / -1; }
  .search-page .search-author-filter { grid-column: 1 / -1; }
  .search-page .search-date-range { position: relative; top: auto; right: auto; left: auto; grid-column: 1 / -1; grid-row: 3; width: 100%; max-height: min(43dvh,300px); overflow-y: auto; box-shadow: none; }
  .search-page .search-type-options { position: fixed; inset: auto 12px calc(70px + env(safe-area-inset-bottom)) 12px; z-index: 42; width: auto; max-height: min(60dvh,420px); overflow: hidden; display: flex; flex-direction: column; }
  .search-page .search-type-options > div { flex: 1 1 auto; max-height: none; min-height: 0; }
  .search-page .search-type-chip { min-height: 42px; }
  .search-page .search-tags-dialog { width: 100vw; height: min(90dvh,760px); max-height: none; margin: auto 0 0; border-radius: 8px 8px 0 0; }
  .search-page .search-tags-body { max-height: none; }
  .search-page .search-tags-list { padding-inline: 16px; }
  .search-page .search-tag-search { padding-inline: 16px; }
  .search-page .search-tags-heading, .search-page .search-tags-footer { padding-inline: 16px; }
  .search-page .search-tags-footer { flex-wrap: wrap; }
  .search-page .search-tag-match { flex: 1 1 100%; }
  .search-page .search-tags-footer > span { flex: 1 1 auto; }
  .search-page .search-tags-footer > div { margin-left: auto; }
  .search-page .search-media-grid, .search-page .search-skeleton { gap: 16px 10px; }
  /* Blur belongs to a visible surface, never the larger transparent hit target. */
  .search-page .search-media-grid .card-play { width: 44px; height: 44px; border: 0 !important; background: transparent !important; box-shadow: none; isolation: isolate; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .search-page .search-media-grid .card-play::before { content: ""; position: absolute; inset: 6px; z-index: -1; border-radius: 50%; background: #f3f6fa9e; }
  .search-page .search-media-grid .card-play svg { width: 15px; height: 15px; }
  .search-page .search-media-grid .card-favorite { width: 44px; height: 44px; right: 0; bottom: 0; border: 0 !important; border-radius: 50%; background: transparent !important; box-shadow: none; isolation: isolate; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .search-page .search-media-grid .card-favorite::before { content: ""; position: absolute; inset: 7px; z-index: -1; border-radius: 50%; overflow: hidden; pointer-events: none; background: #111821d9; }
  .search-page .search-media-grid :is(.poster-frame,.video-thumb) > .card-favorite::before { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .search-page .search-media-grid .card-favorite svg { width: 15px; height: 15px; }
}
@media (max-width: 768px) and (prefers-reduced-transparency: reduce) {
  .search-page .search-media-grid .card-play::before { background: #f3f6fa; }
  .search-page .search-media-grid .card-favorite::before { background: #111821; }
  html[data-theme="light"] .search-page .search-media-grid .card-favorite::before { background: #ffffff; }
}
@media (prefers-reduced-motion: reduce) {
  .search-page :is(.search-tag-chip,.search-type-chip) { transition: none; }
  .search-page :is(.search-tag-chip,.search-type-chip):active { transform: none; }
}
@media (max-width: 1023px) {
  .search-page .search-filter-panel-top .filter-bar { overflow: visible; }
}
@media (max-width: 480px) {
  .search-page .search-date-range { grid-template-columns: minmax(0,1fr); max-height: calc(100dvh - 160px); overflow-y: auto; }
  .search-page .search-date-range > button { grid-column: 1; }
}
@media (max-width: 360px) {
  .search-page .search-tags-heading { padding-block: 8px; }
  .search-page .search-tag-search { padding-bottom: 10px; }
  .search-page .search-tag-selected { padding-block: 8px 10px; }
  .search-page .search-tag-group { padding-block: 10px 14px; }
  .search-page .search-tag-group-heading { margin-bottom: 8px; }
  .search-page .page-search button { min-width: 44px; width: 44px; padding: 0; }
  .search-page .page-search button > span { display: none; }
  .search-page .search-filter-toggle { min-width: 76px; }
  .search-page .search-filter-panel-top .filter-bar > label { grid-column: 1 / -1; }
  .search-page .search-time-filter { grid-column: 1 / -1; }
}
html[data-theme="light"] .search-page .search-date-range input[type="date"] { color-scheme: light; }

/* Popularity periods share the catalog filters and the existing theme. */
.ranking-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 10px; }
.ranking-toolbar > .ranking-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line, #354252); border-radius: 6px; background: var(--surface, #111821); color: var(--text); font-family: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: border-color 160ms, background 160ms; }
.ranking-toolbar > .ranking-link:hover { border-color: var(--accent); background: var(--surface-raised, #19222d); }
.ranking-toolbar > .ranking-link[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text, var(--text)); background: var(--accent-soft, var(--surface)); }
.ranking-toolbar > .ranking-link:active { transform: translateY(1px); }
.ranking-toolbar nav { display: inline-flex; min-width: 0; padding: 3px; border: 1px solid var(--line, #354252); border-radius: 6px; background: var(--surface, #111821); }
.ranking-toolbar nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 34px; padding: 7px 11px; border-radius: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; transition: background 160ms, color 160ms; }
.ranking-toolbar nav a:hover { color: var(--text); background: var(--surface-raised, #19222d); }
.ranking-toolbar nav a.active { color: var(--accent-text, var(--text)); background: var(--accent-soft, var(--surface-raised)); font-weight: 600; }
.ranking-types { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; max-width: 100%; margin-inline-start: auto; }
.ranking-types-label { margin-inline-end: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.ranking-types button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; cursor: pointer; transition: border-color 160ms, background 160ms; }
.ranking-types button:hover { border-color: var(--accent); background: var(--surface-raised, var(--surface-2)); }
.ranking-types button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text, var(--text)); background: var(--accent-soft, var(--surface-2)); }
.ranking-types button:active { transform: translateY(1px); }
.browse-preference-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.browse-preference-status[data-failed="true"] { color: var(--error, #ffb8c2); }
.browse-preference-status button { min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.browse-preference-status button:hover { border-color: var(--accent); background: var(--surface-raised, var(--surface-2)); }
.browse-preference-status button:active { transform: translateY(1px); }
.browse-preference-status button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.browse-preference-notice { max-width: 1400px; margin: 10px auto; padding-inline: var(--page-gutter, 4vw); }
.ranking-toolbar :is(a,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ranking-toolbar nav a:focus-visible { outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  .ranking-toolbar :is(a,button) { transition: none; }
  .ranking-types button:active, .browse-preference-status button:active { transform: none; }
}

/* A bounded card window keeps a long recommendation feed responsive. */
.emby-watch .related-list.recommendation-feed { display: block; position: relative; overflow-anchor: none; }
.recommendation-spacer { pointer-events: none; height: 0; }
.emby-watch .recommendation-grid { --recommendation-copy-height: 77px; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 16px; align-items: start; }
.emby-watch .recommendation-grid .video-card { min-width: 0; }
.emby-watch .recommendation-grid .video-thumb { aspect-ratio: 16 / 9; }
.emby-watch .recommendation-grid .video-thumb .video-cover-link { display: block; width: 100%; height: 100%; }
.emby-watch .recommendation-grid .video-thumb img { display: block; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.emby-watch .recommendation-grid .video-copy { height: var(--recommendation-copy-height); padding: 12px 0 0; }
.emby-watch .recommendation-grid .video-copy > a { display: block; }
.emby-watch .recommendation-grid .video-copy strong { height: 42px; font-size: 14px; line-height: 21px; white-space: normal; }
.emby-watch .recommendation-grid .video-copy > span { display: block; margin-top: 5px; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; line-height: 18px; }
.emby-watch .recommendation-grid .card-play { grid-template-columns: none; }
.emby-watch .recommendation-grid .recommendation-focus-retained { position: absolute; }
.recommendation-more { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 96px; gap: 12px; padding: 18px 0 6px; }
.recommendation-more .button { min-height: 44px; }
.recommendation-more .button[hidden] { display: none; }
.recommendation-more p { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 1199px) and (min-width: 769px) {
  .emby-watch .recommendation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .ranking-toolbar { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 6px; margin-bottom: 14px; }
  .search-page[data-ranking="true"] .ranking-toolbar { grid-template-columns: max-content minmax(0, 1fr); }
  .ranking-toolbar > .ranking-link { padding-inline: 9px; }
  .ranking-toolbar nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ranking-toolbar nav a { flex: 1 0 auto; min-width: 44px; min-height: 44px; padding-inline: 3px; }
  .ranking-types { grid-column: 1 / -1; flex-wrap: nowrap; width: 100%; margin-inline-start: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ranking-types-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .ranking-types button { flex: 1 0 auto; padding-inline: 4px; }
  .ranking-types button:focus-visible { outline-offset: -2px; }
  .ranking-toolbar nav::-webkit-scrollbar, .ranking-types::-webkit-scrollbar { display: none; }
  .emby-watch .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .emby-watch .recommendation-grid .video-copy strong { font-size: 13px; }
  .recommendation-more { flex-direction: column; gap: 8px; text-align: center; }
}
.comment-recent{border-inline-start:2px solid var(--accent,#a7b3fc);padding-inline-start:12px;margin-block:12px 20px}
.comment-recent>strong{display:block;font-size:12px;font-weight:600;margin-bottom:6px}
