/* The same shell on every route; playback never reparents the search field. */
body.unified-shell #site-header {
  position:relative; top:auto; z-index:30;
  display:grid; grid-template-columns:auto minmax(180px, 440px) 1fr;
  align-items:center; gap:24px;
  width:calc(100% - 48px); max-width:1400px;
  min-height:72px; margin:0 auto 24px; padding:14px 0;
  background:var(--paper); border-bottom:1px solid var(--line);
}
body.unified-shell #site-header .identity {display:flex; flex-direction:row; align-items:center; gap:8px; margin:0;}
body.unified-shell #site-header .identity img {display:block; width:28px; height:32px;}
body.unified-shell #site-header .identity h1 {font-size:29px; line-height:1; letter-spacing:-1.4px; margin:0;}
body.unified-shell #player-search-slot {width:100%; max-width:none; min-width:0;}
body.unified-shell #hero-search {position:relative; width:100%; max-width:none; height:38px; margin:0; padding:0 5px 0 14px; gap:0;}
body.unified-shell #hero-search #query {font-size:14px; padding:6px 0; min-height:0;}
body.unified-shell #hero-search .search-button {flex:0 0 30px; min-width:30px; min-height:30px; margin:3px 0 3px 6px; padding:0;}
body.unified-shell #site-header nav {width:auto; min-width:0; margin:0; justify-content:flex-end; flex-wrap:nowrap; gap:15px; font-size:12px; white-space:nowrap;}
body.unified-shell #site-header nav > span {display:none;}
body.unified-shell #site-header nav button {min-height:32px; padding:5px 0; text-decoration:none; color:var(--muted);}
body.unified-shell #site-header nav button:hover {color:var(--ink);}
body.unified-shell #site-header nav .active {color:var(--ink); text-decoration:underline; text-decoration-color:var(--red); text-underline-offset:7px;}
body.unified-shell #site-header #player-button:disabled {visibility:hidden;}
body.unified-shell #site-header #theme-toggle {width:28px; min-width:28px; padding:5px;}
body.unified-shell .masthead {display:none; padding:0; margin:0;}
body.unified-shell:is([data-view="search"],[data-view="browse"]) .masthead {display:block;}
body.unified-shell .masthead .category-bar {display:flex; justify-content:center; flex-wrap:wrap; margin:0 0 24px; gap:8px 20px;}
@media(max-width:1100px) {
  body.unified-shell #site-header {grid-template-columns:auto minmax(0,1fr); gap:10px 20px; padding:12px 0;}
  body.unified-shell #site-header nav {grid-column:1/-1; justify-content:center; gap:24px;}
}
@media(max-width:600px) {
  body.unified-shell #site-header {width:calc(100% - 28px); margin-bottom:18px; gap:8px 12px; padding:10px 0 4px;}
  body.unified-shell #site-header .identity {gap:5px;}
  body.unified-shell #site-header .identity img {width:22px;height:26px;}
  body.unified-shell #site-header .identity h1 {font-size:25px;}
  body.unified-shell #hero-search {height:40px;padding-left:12px;}
  body.unified-shell #hero-search #query {font-size:16px;}
  body.unified-shell #site-header nav {justify-content:space-between; gap:12px; overflow-x:auto; max-width:100%; font-size:12px;}
  body.unified-shell #site-header nav button {min-height:40px; flex-shrink:0;}
  body.unified-shell #player-search-slot #hero-search #suggestions {max-height:55dvh; margin-top:0;}
}
body.unified-shell[data-view="home"] #site-header {display:flex;justify-content:flex-end;border:0;margin-bottom:0;}
body.unified-shell[data-view="home"] #home-view {padding:clamp(60px,14vh,150px) 0 28px;text-align:center;}
#home-brand-slot .identity {flex-direction:row;gap:15px;margin:0 0 30px;}
#home-brand-slot .identity img {width:58px;height:68px;}
#home-brand-slot .identity h1 {font-size:60px;letter-spacing:-3px;margin:0;}
#home-search-slot {position:relative;max-width:600px;margin:0 auto;}
body.unified-shell #home-search-slot #hero-search {height:48px;padding-left:20px;}
body.unified-shell #home-search-slot #query {font-size:17px;}
body.unified-shell[data-view="home"] .masthead {display:block;}
body.unified-shell .category-bar a {font-size:12px;text-underline-offset:3px;}
body.unified-shell .category-bar a.active {color:var(--red);font-weight:bold;text-decoration:none;}
@media(max-width:600px){
 body.unified-shell[data-view="home"] #site-header nav {gap:14px;}
 #home-brand-slot .identity h1 {font-size:50px;}
 #home-brand-slot .identity img {width:48px;height:56px;}
 body.unified-shell[data-view="home"] #home-view {padding-top:70px;}
}
@media(max-width:600px){
 body.unified-shell[data-view="home"] #site-header nav {width:100%;flex:1;gap:8px;font-size:11px;}
 body.unified-shell[data-view="home"] .category-bar {display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:0;}
 body.unified-shell[data-view="home"] .category-bar a {min-height:32px;display:grid;place-items:center;padding:0;}
}
body.unified-shell[data-view="home"] #site-header nav [data-view="browse"],
body.unified-shell[data-view="home"] #site-header nav [data-view="search"] {display:none;}
body.unified-shell[data-view="home"] #player-brand-slot,
body.unified-shell[data-view="home"] #player-search-slot {display:none;}
/* Shared surfaces settle together; content fades without a second slide. */
.identity {view-transition-name:site-brand;}
#hero-search {view-transition-name:site-search;}
.category-bar {view-transition-name:site-categories;}
::view-transition-group(site-brand),::view-transition-group(site-search),
::view-transition-group(site-categories) {
 animation-duration:260ms;
 animation-timing-function:cubic-bezier(.25,.1,.25,1);
}
::view-transition-old(root) {animation:route-fade-out 180ms ease-out both;}
::view-transition-new(root) {animation:route-fade-in 240ms ease-out both;}
::view-transition-group(root) {animation:none;}
::view-transition,::view-transition-group(*),::view-transition-image-pair(*),
::view-transition-old(*),::view-transition-new(*) {pointer-events:none;}
@keyframes route-fade-out {to{opacity:0;}}
@keyframes route-fade-in {from{opacity:0;}to{opacity:1;}}
@media(prefers-reduced-motion:reduce){
 ::view-transition-group(*) {animation-duration:0s;}
 ::view-transition-old(*),::view-transition-new(*) {animation:none;}
}
/* Discovery uses the same understated text navigation as the rest of the site. */
.discovery-controls .discovery-modes {border:0; border-radius:0; padding:0; gap:18px;}
.discovery-controls .discovery-modes button {
 background:transparent; border:0; border-radius:0; box-shadow:none;
 color:var(--muted); font-size:12px; font-weight:normal;
 padding:8px 0; min-height:36px; text-decoration:none;
 transition:color .12s ease;
}
.discovery-controls .discovery-modes button:hover {background:transparent;color:var(--ink);}
.discovery-controls .discovery-modes button[aria-pressed="true"] {
 background:transparent; color:var(--ink); text-decoration:underline;
 text-decoration-color:var(--red); text-underline-offset:7px; text-decoration-thickness:1px;
}
@media(max-width:600px){
 .discovery-controls .discovery-modes {gap:18px;}
 .discovery-controls .discovery-modes button {min-height:44px;padding:8px 0;}
}

.library-grid[data-category="Books"] .poster-link {aspect-ratio:2/3;}
.library-grid .poster-link img {width:100%;height:100%;}

/* A single collection shell for titles and optional release bookmarks. */
.utility-page { width:100%; max-width:1200px; margin:28px auto 48px; }
.utility-page > .results-heading { display:flex; align-items:center; min-height:46px; padding:0 0 16px; margin:0 0 20px; border-bottom:1px solid var(--line); }
.utility-page > .results-heading h2 { font-size:24px; line-height:30px; font-weight:400; margin:0; }
.utility-section-heading { font-size:15px; font-weight:400; line-height:24px; margin:0 0 12px; }
.utility-page #storage-summary { font-size:14px; margin:0 0 10px; }
.utility-page #storage-meter { height:8px; }
.collection-tabs { display:flex; gap:24px; border-bottom:1px solid var(--theme-line,#ded8ce); margin-bottom:16px; }
.collection-tabs .nav-link { padding:0 0 10px; border:0; border-bottom:2px solid transparent; background:none; text-decoration:none; color:var(--muted); }
.collection-tabs .nav-link.active { border-bottom-color:var(--red); color:var(--ink); }
.collection-tabs span { font-size:11px; margin-left:4px; color:var(--muted); }
.collection-meta { display:flex; justify-content:space-between; align-items:center; min-height:28px; margin-bottom:12px; font-size:12px; color:var(--muted); }
.collection-meta .text-button { font-size:12px; padding:4px 0; }
#collection-view[hidden], #collection-tabs[hidden] { display:none; }

/* Identical compact icon targets in search, saved releases and title sources. */
.result-table .col-actions,
#title-release-results .source-results .col-actions { width:76px; padding-left:6px; padding-right:6px; box-sizing:border-box; }
.result-table .row-actions,
#title-release-results .source-results .row-actions { display:flex; flex-direction:row; justify-content:flex-end; align-items:center; gap:4px; white-space:nowrap; }
.result-table .row-actions > *,
#title-release-results .source-results .row-actions > * { display:grid; place-items:center; flex:0 0 30px; width:30px; height:32px; min-width:30px; min-height:32px; margin:0; padding:0; border:0; border-radius:3px; background:transparent; text-decoration:none; box-sizing:border-box; font-size:10px; }
.result-table .row-actions svg,
#title-release-results .source-results .row-actions svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; }
.result-table .row-actions .save-button { color:var(--muted); }
.result-table .row-actions .save-button.is-saved { color:var(--red); }
.result-table .save-button.is-saved svg { fill:currentColor; }
.result-table .row-actions > *:hover { background:var(--control-hover,var(--theme-line,#eee9e1)); }
.result-table .row-actions > *:focus-visible { outline:2px solid var(--red); outline-offset:1px; }
@media (max-width:600px) {
  .utility-page { margin:20px auto 40px; }
  .result-table .col-actions,
  #title-release-results .source-results .col-actions { width:92px; padding-left:2px; padding-right:2px; }
  .result-table .row-actions,
  #title-release-results .source-results .row-actions { gap:0; }
  .result-table .row-actions > *,
  #title-release-results .source-results .row-actions > * { flex-basis:44px; width:44px; height:44px; min-width:44px; min-height:44px; }
}
.collection-tabs { justify-content:flex-start; }

/* Shared movie-card rhythm, with artwork kept in its natural format. */
.library-grid .poster-link, .library-grid .poster-placeholder { aspect-ratio:2/3; }
.library-grid[data-category="Music"] .poster-link { aspect-ratio:1; background:var(--theme-surface,var(--paper)); }
.library-grid[data-category="Music"] .poster-link img { object-fit:contain; padding:0; }
.library-grid .poster-placeholder { height:100%; background:var(--theme-surface,var(--paper)); }

.library-grid .poster-meta span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#browse-view:has(.library-grid) #continue-watching { display:none; }

.discovery-period[hidden] { display:none; }

@font-face { font-family:'IM Fell English'; src:url('/assets/fonts/knockturn-wordmark.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
/* One composition everywhere. Only the scale changes between hero and navbar. */
body.unified-shell .identity { --brand-size:40px; display:inline-flex; flex-direction:row; align-items:center; gap:calc(var(--brand-size)*.12); }
body.unified-shell .identity img {content:normal;display:block;object-fit:contain;width:var(--brand-size);height:var(--brand-size);flex-shrink:0;}
[data-theme="dark"] body.unified-shell .identity img, body.unified-shell[data-theme="dark"] .identity img {content:normal;filter:invert(1);}
body.unified-shell .identity h1 {font-family:'IM Fell English',Georgia,serif;font-size:calc(var(--brand-size)*.44);font-weight:400;line-height:.98;letter-spacing:calc(var(--brand-size)*-.012);text-align:center;margin:0;}
body.unified-shell .identity h1 span {color:var(--ink);display:block;}
body.unified-shell .identity .brand-prefix {font:400 calc(var(--brand-size)*.1)/1 Georgia,serif;letter-spacing:calc(var(--brand-size)*.022);margin-bottom:calc(var(--brand-size)*.045);}
body.unified-shell .identity .brand-name {white-space:nowrap;}
body.unified-shell .identity .brand-alley {font-size:calc(var(--brand-size)*.23);letter-spacing:calc(var(--brand-size)*.065);padding-left:calc(var(--brand-size)*.065);margin-top:calc(var(--brand-size)*.05);}
body.unified-shell #site-header .identity {--brand-size:52px;gap:6px;}
body.unified-shell #home-brand-slot .identity {--brand-size:133px;margin-bottom:30px;gap:18px;}
@media(max-width:600px) {
 body.unified-shell #site-header {column-gap:12px;grid-template-columns:auto minmax(0,1fr);}
 body.unified-shell #site-header .identity {--brand-size:43px;gap:4px;}
 body.unified-shell #home-brand-slot .identity {--brand-size:89px;gap:9px;margin-bottom:28px;}
}

body.unified-shell :is(#site-header,#home-brand-slot) .identity img {width:var(--brand-size);height:var(--brand-size);}
body.unified-shell :is(#site-header,#home-brand-slot) .identity h1 {font-size:calc(var(--brand-size)*.44);letter-spacing:calc(var(--brand-size)*-.012);line-height:.98;}
body.unified-shell .identity .brand-prefix {font-size:max(7px,calc(var(--brand-size)*.1));}

/* Release details: essentials first, index metadata on demand. */
#details-dialog {width:min(540px,calc(100% - 28px));max-height:calc(100dvh - 32px);padding:26px;overflow:auto;}
#details-dialog .dialog-close {width:32px;height:32px;min-width:32px;min-height:32px;top:9px;right:9px;padding:0;}
.release-summary .dialog-category {font-size:11px;padding-right:30px;}
.release-summary .dialog-title {font-size:19px;font-weight:400;line-height:1.4;margin:10px 24px 12px 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;}
.release-origin {display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted);}
.release-origin .source-icon {width:14px;height:14px;flex-basis:14px;}
.release-tags {font-size:12px;line-height:1.5;margin:10px 0 0;color:var(--muted);}
.release-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:20px 0;padding:15px 0;border-block:1px solid var(--line);gap:12px;}
.release-stats dt {font-size:11px;color:var(--muted);margin-bottom:5px;}
.release-stats dd {font-size:18px;font-variant-numeric:tabular-nums;margin:0;}
.release-actions {gap:8px 16px;}
.release-actions .primary {border:1px solid var(--line);border-radius:3px;background:var(--theme-surface,var(--paper));padding:8px 12px;color:var(--ink);text-decoration:none;}
.release-actions .primary:hover {background:var(--control-hover);border-color:var(--muted);}
.release-technical {margin-top:20px;border-top:1px solid var(--line);padding-top:12px;font-size:12px;color:var(--muted);}
.release-technical summary {cursor:pointer;width:fit-content;padding:4px 0;}
.release-technical dl {margin:12px 0 0;}
.release-technical dl>div {display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px;padding:7px 0;}
.release-technical dt {font-size:11px;}
.release-technical dd {margin:0;color:var(--ink);overflow-wrap:anywhere;line-height:1.5;}
@media(max-width:600px) {
 #details-dialog {padding:22px 18px;}
 .release-summary .dialog-title {font-size:18px;}
 .release-actions a,.release-actions button {min-height:40px;display:inline-flex;align-items:center;box-sizing:border-box;}
 .release-technical dl>div {grid-template-columns:95px minmax(0,1fr);gap:10px;}
}

/* Player is a destination; source tools remain optional during playback. */
.player-page-heading {display:none;}
body[data-view="player"] #watch-player {width:100%;max-width:1200px;margin:28px auto 48px;padding:0;}
body[data-view="player"] .player-page-heading {display:flex;border-bottom:1px solid var(--line);margin:0 0 20px;padding:0 0 16px;min-height:46px;}
body[data-view="player"] .player-page-heading h2 {font-size:24px;line-height:30px;font-weight:400;}
body[data-view="player"] #watch-player.player-empty > :not(.player-page-heading):not(#playback-advanced) {display:none;}
body[data-view="player"] #playback-advanced > summary {display:none;}
#playback-advanced {background:var(--paper);color:var(--ink);border:0;border-top:1px solid var(--line);border-radius:0;padding:14px 0;margin:20px 0 0;}
body[data-view="player"] #playback-advanced {border:0;margin:0;padding:0;}
#playback-advanced > summary {color:var(--muted);font-size:12px;padding:4px 0;}
#playback-advanced .advanced-grid {display:block;margin:18px 0 0;max-width:620px;}
#playback-advanced .advanced-card {padding:0;border:0;background:transparent;border-radius:0;}
#playback-advanced .advanced-card[hidden] {display:none;}
.player-tool-tabs {display:flex;gap:24px;border-bottom:1px solid var(--line);margin-top:12px;}
.player-tool-tabs button {padding:10px 0;border:0;border-bottom:2px solid transparent;background:none;color:var(--muted);font:inherit;font-size:12px;}
.player-tool-tabs button[aria-selected="true"] {color:var(--ink);border-bottom-color:var(--red);}
#playback-advanced input:not([type=file]):not([type=checkbox]),#playback-advanced select {background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:3px;min-width:0;padding:10px;font:inherit;font-size:12px;box-sizing:border-box;width:100%;}
#playback-advanced label {font-size:12px;color:var(--muted);}
#playback-advanced .advanced-card button,#playback-advanced .file-button {background:var(--theme-surface,var(--paper));color:var(--ink);border:1px solid var(--line);border-radius:3px;padding:8px 12px;font-size:12px;}
#playback-advanced .advanced-card button:hover,#playback-advanced .file-button:hover {background:var(--control-hover);border-color:var(--muted);}
#magnet-play-form {display:grid;gap:10px;}
#magnet-play-form > button {justify-self:start;min-width:76px;}
.magnet-next {margin:0 0 6px;font-size:12px;color:var(--muted);}
.magnet-next summary {cursor:pointer;padding:6px 0;}
.magnet-next label {display:block;margin:8px 0;}
#playback-advanced #player-diagnostics:empty {display:none;}
@media(max-width:600px) {body[data-view="player"] #watch-player {margin:20px auto 40px;} .player-tool-tabs {gap:20px;} .player-tool-tabs button {min-height:44px;} #playback-advanced input:not([type=file]):not([type=checkbox]),#playback-advanced select {font-size:16px;} }
#playback-advanced .offline-library {background:transparent;border:0;border-top:1px solid var(--line);border-radius:0;padding:20px 0 0;margin-top:24px;}
#playback-advanced .offline-library h3 {font-size:14px;font-weight:400;}
#playback-advanced .offline-library button[hidden] {display:none;}

#playback-advanced .offline-cleanup {justify-content:flex-start;}
#playback-advanced .offline-cleanup input {width:14px;min-width:14px;height:14px;min-height:14px;margin:0;}

.mobile-nav-icon {display:none;}
/* Phone shell: thumb-accessible navigation and compact, scrollable shelves. */
@media(max-width:700px) {
 body.unified-shell {padding-bottom:calc(72px + env(safe-area-inset-bottom));}
 body.unified-shell main {width:calc(100% - 32px);margin-inline:auto;}
 body.unified-shell #site-header {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;width:calc(100% - 32px);padding:12px 0;margin:0 auto 12px;border-bottom:0;}
 body.unified-shell #site-header .identity {--brand-size:38px;justify-self:start;gap:5px;}
 body.unified-shell #player-search-slot {width:100%;min-width:0;}
 body.unified-shell #site-header #hero-search {width:100%;max-width:none;height:44px;box-sizing:border-box;margin:0;}
 body.unified-shell #site-header #hero-search #query {font-size:16px;}
 body.unified-shell #site-header nav {position:fixed;inset:auto 0 0;z-index:45;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;width:100%;box-sizing:border-box;padding:6px 8px calc(6px + env(safe-area-inset-bottom));margin:0;border-top:1px solid var(--line);background:var(--paper);overflow:visible;}
 body.unified-shell #site-header nav .nav-link {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:48px;margin:0;padding:4px 0;border:0;font-size:11px;line-height:1.1;text-decoration:none;color:var(--muted);}
 body.unified-shell #site-header nav .nav-link.active {color:var(--red);text-decoration:none;}
 .mobile-nav-icon {display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;}
 body.unified-shell #site-header #theme-toggle {position:fixed;right:12px;top:8px;width:44px;min-height:44px;padding:12px;background:var(--paper);border-radius:50%;}
 body.unified-shell[data-view="home"] #site-header {height:44px;padding:0;margin-bottom:0;}
 body.unified-shell[data-view="home"] #home-view {padding:clamp(48px,12vh,100px) 0 32px;}
 body.unified-shell .masthead .category-bar {justify-content:flex-start;flex-wrap:nowrap;gap:20px;overflow-x:auto;white-space:nowrap;margin:0 -16px 20px;padding:0 16px;scrollbar-width:none;}
 body.unified-shell .category-bar .category {flex:0 0 auto;display:flex;align-items:center;min-height:44px;padding:0;font-size:14px;text-decoration:none;}
 body.unified-shell .category-bar .category.active {border-bottom:2px solid var(--red);}
 #continue-watching {margin:0 0 22px;}
 #continue-watching h2 {font-size:18px;margin:0 0 12px;}
 .continue-strip {gap:12px;margin-inline:-16px;padding-inline:16px;scroll-padding-inline:16px;scrollbar-width:none;}
 .continue-card {flex-basis:112px;min-width:0;}
 .continue-play img {width:112px;height:160px;}
 .continue-play strong {font-size:12px;line-height:1.25;}
 .continue-play small {font-size:11px;line-height:1.3;}
 .discovery-heading {display:block;margin:0 0 16px;padding:0 0 8px;}
 .discovery-heading h2 {font-size:22px;margin:0 0 10px;}
 .discovery-controls {display:flex;flex-wrap:wrap;gap:0 12px;min-height:0;}
 .discovery-modes {flex:1;gap:18px;}
 .discovery-controls .discovery-modes button {font-size:14px;min-height:44px;padding:8px 0;}
 .discovery-period {order:3;flex-basis:100%;min-height:0;}
 .discovery-controls .time-filters {justify-content:flex-start;gap:20px;}
 .discovery-controls .time-filters button {font-size:12px;min-height:38px;padding:6px 0;}
 #browse-refresh {width:44px;height:44px;}
 #poster-grid,.poster-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 12px;}
 .poster-card h3 {font-size:12px;line-height:1.3;margin-top:7px;}
 .poster-card p {font-size:11px;}
 body.unified-shell .results-heading h2 {font-size:22px;}
 body.unified-shell .title-page {margin-top:8px;}
 body.unified-shell footer {margin:24px 16px 0;}
 body.unified-shell #watch-player.player-docked {bottom:calc(76px + env(safe-area-inset-bottom));}
 :fullscreen #site-header nav {display:none;}
}
@media(max-width:360px) {
 #poster-grid,.poster-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:700px) {
 .continue-play strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
 .continue-play small {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 #browse-status:empty {min-height:0;padding:0;}
}

/* Artwork and its fallback share one bounded frame. */
.library-grid .poster-link .poster-placeholder {width:100%;height:100%;min-height:0;aspect-ratio:auto;box-sizing:border-box;overflow:hidden;display:grid;place-items:center;padding:12px;}
.library-grid .library-symbol {display:grid;place-items:center;font-size:32px;line-height:1;}
.library-grid .library-symbol svg {width:36px;height:36px;}
.result-updates:empty,.title-releases .result-updates:empty {display:none;min-height:0;margin:0;padding:0;}
#playback-advanced :is(#player-message,#player-diagnostics):empty,
#watch-player :is(#download-status,#next-status):empty {display:none;margin:0;padding:0;}
@media(max-width:700px) {
 #playback-advanced {padding:8px 0;margin-top:12px;}
 #playback-advanced > summary {display:flex;align-items:center;min-height:44px;padding:0;}
 #playback-advanced .player-tool-tabs {margin-top:0;gap:20px;}
 #playback-advanced .advanced-grid {margin-top:12px;}
 #playback-advanced .advanced-card .player-source {gap:8px;}
 #playback-advanced .offline-library {margin-top:16px;padding-top:12px;}
 body[data-view="player"] #watch-player {margin:12px auto 20px;}
 body[data-view="player"] .player-page-heading {margin-bottom:8px;padding-bottom:10px;min-height:0;}
 .library-grid .poster-card h3 {font-size:14px;font-weight:400;line-height:1.35;margin:8px 0 0;}
 .library-grid .poster-meta:has(> span:empty):not(:has(> span:not(:empty))) {display:none;}
}
@media(max-width:700px) {
 #panel-files .player-source {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;}
 #panel-files .file-button {grid-column:1/-1;justify-self:start;}
 #panel-files #player-library {grid-column:1;grid-row:2;order:0;}
 #panel-files #player-start {grid-column:2;grid-row:2;order:0;}
}

/* Compact shared rhythm; keep mobile inputs legible and touch targets usable. */
body.unified-shell[data-view="home"] #site-header nav .nav-link {display:none;}
body.unified-shell[data-view="home"] #site-header nav {position:static;display:flex;justify-content:flex-end;width:auto;border:0;padding:0;background:transparent;}
body.unified-shell[data-view="home"] {padding-bottom:0;}
#home-brand-slot {display:flex;justify-content:center;}
body.unified-shell #home-brand-slot .identity {justify-content:center;gap:15px;margin-bottom:26px;}
body.unified-shell #home-search-slot {max-width:560px;}
body.unified-shell #home-search-slot #hero-search {height:42px;padding-left:17px;border-color:var(--line);box-shadow:none;}
body.unified-shell #home-search-slot #query {font-size:15px;font-weight:400;}
body.unified-shell #hero-search:hover,body.unified-shell #hero-search:focus-within {box-shadow:none;}
body.unified-shell #hero-search .search-button svg {width:18px;height:18px;}
#poster-grid,.poster-grid {gap:18px 12px;}
.title-loading-shell {display:grid;grid-template-columns:126px minmax(0,560px);gap:24px;min-height:260px;padding:20px 0;}
.title-loading-poster,.title-loading-lines i {display:block;background:var(--theme-surface,var(--line));border-radius:3px;}
.title-loading-poster {aspect-ratio:2/3;}
.title-loading-lines {padding-top:16px;}
.title-loading-lines i {height:12px;margin:0 0 16px;width:85%;}
.title-loading-lines i:first-child {height:24px;width:65%;margin-bottom:28px;}
.title-loading-lines i:last-child {width:45%;}
@media(max-width:700px){
 body.unified-shell[data-view="home"] #site-header #theme-toggle {position:static;}
 body.unified-shell #home-search-slot #hero-search {height:44px;}
 body.unified-shell #home-search-slot #query {font-size:16px;}
 body.unified-shell #home-brand-slot .identity {gap:8px;}
 #poster-grid,.poster-grid {gap:16px 10px;grid-template-columns:repeat(2,minmax(0,1fr));}
 .title-loading-shell {grid-template-columns:100px minmax(0,1fr);gap:16px;}
}

/* Keep the entire inline picture and its HUD inside the first viewport. */
body.unified-shell.player-view #site-header {min-height:56px;padding:6px 0;margin-bottom:12px;}
body.unified-shell.player-view #site-header .identity {--brand-size:42px;}
body.player-view #watch-player:not(.player-docked):not(:fullscreen) .player-frame:not(:fullscreen):not(.dialogue-workspace) .video-stage {
  width:100%;max-height:var(--inline-player-height,calc(100dvh - 100px));min-height:0;
}
body.player-view #watch-player:not(.player-docked):not(:fullscreen) .player-frame:not(:fullscreen):not(.dialogue-workspace) #player-video {
  max-height:var(--inline-player-height,calc(100dvh - 100px));object-fit:contain;
}
@media(max-width:700px) {
  body.unified-shell.player-view #site-header {gap:6px;padding:6px 0;margin-bottom:8px;}
  body.unified-shell.player-view #site-header .identity {--brand-size:32px;}
  body.unified-shell .masthead .category-bar,
  body.unified-shell[data-view="home"] .masthead .category-bar {
    display:flex;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;white-space:nowrap;gap:20px;
  }
  body.unified-shell .masthead .category-bar a {flex:0 0 auto;}
}

/* Theme control belongs to the scrolling header, outside the mobile tab bar. */
body.unified-shell #site-header nav {padding-right:42px;}
body.unified-shell #site-header #theme-toggle {position:absolute;right:0;top:50%;transform:translateY(-50%);}
@media(max-width:1100px) and (min-width:701px) {
 body.unified-shell #site-header {padding-right:40px;}
 body.unified-shell #site-header nav {padding-right:0;}
 body.unified-shell #site-header #theme-toggle {top:16px;transform:none;}
}
@media(max-width:700px) {
 body.unified-shell #site-header nav {padding-right:8px;}
 body.unified-shell #site-header #theme-toggle,
 body.unified-shell[data-view="home"] #site-header #theme-toggle {position:absolute;top:0;right:0;transform:none;}
 body.unified-shell #site-header #player-brand-slot .identity {--brand-size:30px;}
 body.unified-shell .masthead .category-bar,
 body.unified-shell[data-view="home"] .masthead .category-bar {justify-content:safe center;gap:16px;}
}
