
:root {
  color-scheme: dark;
  --bg: #0f1115; --surface: #181b22; --surface-2: #232733; --text: #eef0f4; --muted: #9aa3b2;
  --accent: #7b5bf5; --card-w: 300px; --tile-w: 150px; --cover-h: 169px; --gap: 14px; --pad: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--pad); padding: 14px var(--pad);
  background: rgba(15, 17, 21, .92); backdrop-filter: blur(8px); border-bottom: 1px solid #1f232c; }
header .brand { font-weight: 700; letter-spacing: .02em; }
header nav a { color: var(--muted); margin-right: 18px; }
header nav a:hover { color: var(--text); }
main { padding: 18px 0 40px; }
main.narrow { max-width: 900px; margin: 0 auto; padding: var(--pad); }
h1 { font-size: 1.6em; margin: 0 0 8px; }
.muted { color: var(--muted); }

/* Catalogue rows */
.row { margin: 0 0 30px; position: relative; content-visibility: auto; contain-intrinsic-size: auto 290px; }
.row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--pad) 10px; }
.row-head h2 { font-size: 1.2em; margin: 0; }
.row-head .kind { color: var(--muted); font-size: .85em; text-transform: uppercase; letter-spacing: .06em; }
.row-head .all { margin-left: auto; color: var(--muted); font-size: .9em; }
.row-head .all:hover { color: var(--text); }
.scroller { display: flex; gap: var(--gap); overflow-x: auto; padding: 4px var(--pad) 12px 0; scrollbar-width: thin; scrollbar-color: #333a48 transparent; }
.scroller::-webkit-scrollbar { height: 8px; }
.scroller::-webkit-scrollbar-thumb { background: #333a48; border-radius: 4px; }

/* Pinned first column: performer photo / studio logo */
.tile { position: sticky; left: 0; z-index: 3; flex: 0 0 var(--tile-w);
  background: var(--bg); box-shadow: 12px 0 14px -6px var(--bg); padding-left: var(--pad); box-sizing: content-box; }
.tile .pic { width: var(--tile-w); height: var(--cover-h); border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.tile.studio .pic { background: linear-gradient(135deg, #9ca3af, #6b7280); padding: 14px; }
.tile.studio .pic img { object-fit: contain; object-position: center; }
.tile.favorites .pic { background: linear-gradient(135deg, var(--accent), #3b82f6); font-size: 2.6em; }
.tile.saved .pic { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.tile.played .pic { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.tile.popular .pic { background: linear-gradient(135deg, #f43f5e, #f59e0b); }
.tile.uploads .pic { background: linear-gradient(135deg, #22c55e, #84cc16); }
.uploads-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 0 var(--pad) 18px; }
.uploads-status .btn { padding: 9px 16px; }
.unmatched { padding: 0 var(--pad) 18px; }
.unmatched li { margin: 4px 0; color: var(--muted); word-break: break-all; }
.unmatched a { color: #c4b5fd; }
.tile.links .pic { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.links-form textarea, .links-help textarea { width: 100%; margin: 6px 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #2a2f3a; background: var(--surface); color: var(--text); font: inherit; font-size: .85em; }
.links-help { margin-top: 30px; padding-top: 10px; border-top: 1px solid #1f232c; }
.links-help h2 { font-size: 1.1em; }
.links-added li { margin: 6px 0; } .links-added a { color: #c4b5fd; }
.links-manage { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 0 var(--pad) 18px; }
.links-manage ul { list-style: none; padding: 0; margin: 10px 0 0; }
.links-manage li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; word-break: break-all; }
.links-manage li form { margin-left: auto; } .links-manage li .btn { padding: 7px 12px; min-height: 0; }
.tile.category .pic { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.row.people .scroller { padding-left: var(--pad); }
.row.people .more { height: calc(var(--tile-w) * 1.5); flex-basis: var(--tile-w); }
.grid.people { grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)); }
.grid.people .pic { width: 100%; }
.grid.people .person .pic { height: auto; aspect-ratio: 2 / 3; }
.grid.people .logo .pic { height: auto; aspect-ratio: 16 / 9; }
.row-options { padding: 0 var(--pad) 18px; }
.release .failed { color: #fca5a5; font-size: .8em; margin-left: 8px; }
.watch-later { margin: 4px 0 10px; }
.watch-later .btn { padding: 9px 16px; }
.watch-later .saved { color: #fcd34d; }
.tile .name { margin-top: 8px; font-weight: 600; font-size: .95em; line-height: 1.25; }
.tile .count { color: var(--muted); font-size: .8em; }

/* Scene cards */
.card { flex: 0 0 var(--card-w); width: var(--card-w); min-width: 0; border-radius: 10px; }
.card:focus-visible { outline: none; }
.card .cover { width: var(--card-w); height: var(--cover-h); border-radius: 10px; background: var(--surface-2) center / cover; overflow: hidden; }
.card .cover { position: relative; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; font-size: .75em; font-weight: 700;
  background: rgba(15, 17, 21, .85); color: #fff; }
.badge.none { color: #fca5a5; }
.cover .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); }
.cover .progress i { display: block; height: 100%; background: #ef4444; }
.card.none .cover img { filter: brightness(.3) grayscale(.7); transition: filter .3s; }
.card.none .title, .card.none .sub, .card.none .people { opacity: .5; }
.card.checking .cover::after { content: ""; position: absolute; inset: 0; background: rgba(123, 91, 245, .18); }
#check-all:disabled { opacity: .7; cursor: default; }
.badge.tracker { color: #fcd34d; }
.format.tracker { color: #fcd34d; }
.sent { color: #86efac; font-weight: 600; }
dialog.confirm { max-width: min(92vw, 520px); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 20px 22px;
  background: #18181b; color: inherit; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog.confirm::backdrop { background: rgba(0,0,0,.6); }
dialog.confirm h3 { margin: 0 0 10px; font-size: 1.1em; }
dialog.confirm .ctitle { word-break: break-word; font-size: .9em; margin: 0 0 10px; }
dialog.confirm dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 12px; font-size: .92em; }
dialog.confirm dt { color: var(--muted); }
dialog.confirm .warn { background: rgba(234,179,8,.12); border-left: 3px solid #eab308; padding: 8px 10px; border-radius: 6px; font-size: .9em; margin: 0 0 14px; }
dialog.confirm .buttons { display: flex; gap: 8px; justify-content: flex-end; }
.whatbox-dl { margin: 6px 0 14px; } .whatbox-dl .release { align-items: center; }
.whatbox-dl .bar { width: 160px; height: 8px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin: 4px 0; }
.whatbox-dl .bar span { display: block; height: 100%; background: #22c55e; }
.trackers-head { margin-top: 18px; }
.notice { max-width: 1300px; margin: 16px auto 0; padding: 12px 18px; border-radius: 10px; background: #1e293b; color: #e2e8f0; }
.card:hover .cover, .card:focus-visible .cover { box-shadow: 0 0 0 3px var(--accent); }
.card .title { margin-top: 8px; font-size: .92em; font-weight: 600; line-height: 1.25; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.people { font-size: .8em; margin-top: 2px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plink { color: #c4b5fd; cursor: pointer; }
.plink:hover { text-decoration: underline; color: #ddd6fe; }
.plink + .plink::before { content: ", "; color: var(--muted); }
.entity-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.entity-controls .vr-switch { margin-top: 0; }
.fav { margin: 0; }
.fav .btn { padding: 9px 16px; }
.fav-on { color: #fcd34d; }
.vr-switch { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); color: var(--muted); font-weight: 600; font-size: .9em; }
.vr-switch .knob { width: 38px; height: 22px; border-radius: 999px; background: #374151; position: relative; }
.vr-switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #9ca3af; transition: left .15s; }
.vr-switch.on { color: #fff; }
.vr-switch.on .knob { background: var(--accent); }
.vr-switch.on .knob::after { left: 19px; background: #fff; }
.card .sub { color: var(--muted); font-size: .8em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { flex: 0 0 160px; height: var(--cover-h); border-radius: 10px; background: var(--surface); display: flex;
  align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.more:hover { background: var(--surface-2); color: var(--text); }

/* Arrow buttons for when the thumbstick doesn't scroll sideways */
.arrow { position: absolute; top: calc(38px + var(--cover-h) / 2); transform: translateY(-50%); z-index: 4; width: 48px; height: 48px;
  border-radius: 50%; border: 0; background: rgba(24, 27, 34, .9); color: var(--text); font-size: 1.6em; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.arrow:hover { background: var(--accent); }
.arrow[hidden] { display: none; }
.arrow.left { left: calc(var(--pad) + var(--tile-w) + 8px); }
.arrow.right { right: 12px; }

/* "See all" grid */
.hero-row { display: flex; gap: 22px; align-items: center; padding: 8px var(--pad) var(--pad); }
.hero-row .tile { position: static; box-shadow: none; margin: 0; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 22px var(--gap); padding: 0 var(--pad); }
.grid .card { flex: none; width: auto; }
.grid .card .cover { width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* Scene page */
.backdrop { position: relative; overflow: hidden; min-height: 380px; padding: 40px var(--pad) var(--pad); background: var(--bg) center / cover; }
.backdrop::before { content: ""; position: absolute; inset: 0; background: inherit; filter: blur(18px) brightness(.35); transform: scale(1.1); }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, var(--bg)); }
.backdrop > * { position: relative; z-index: 1; }
.scene { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 28px; max-width: 1300px; margin: 0 auto; }
.scene .poster { width: 100%; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.scene .details { color: #cfd4dd; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; cursor: pointer; }
.scene .details.open { -webkit-line-clamp: unset; }
.releases { max-width: 1300px; margin: 0 auto; padding: 8px var(--pad); }
/* Scene page player */
.scene.watch { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000 center / cover;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.player .poster { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; display: block; }
.player .video-js { position: absolute; inset: 0; width: 100%; height: 100%; }
.bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px;
  border-radius: 50%; border: 0; background: rgba(123, 91, 245, .92); color: #fff; font-size: 2.2em; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5); padding-left: 6px; }
.bigplay:disabled { background: rgba(55, 65, 81, .85); cursor: default; }
.bigplay[hidden] { display: none; }
.player-msg { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; align-items: center;
  gap: 10px; padding: 10px 14px; border-radius: 8px; background: rgba(15, 17, 21, .88); color: #e5e7eb; font-size: .9em; }
.player-msg[hidden] { display: none; }
.now { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.now:empty { display: none; }
.resume-note { flex-basis: 100%; color: var(--muted); font-size: .85em; }
.vr-hint { flex-basis: 100%; padding: 10px 14px; border-radius: 10px; background: #1e293b; color: #e2e8f0; font-size: .9em; }
.resume-note:empty { display: none; }
.resume-note a { color: #c4b5fd; text-decoration: underline dotted; }
.now-label { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.now-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.now-actions .btn, .release .ext .btn { padding: 10px 14px; font-size: .9em; }
.release .ext { display: contents; }
.grade { display: inline-flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 46px; padding: 6px 9px;
  border-radius: 8px; font-weight: 800; font-size: 1.15em; color: #0f1115; flex: none; }
.grade small { font-size: .6em; font-weight: 700; opacity: .75; }
.grade.g-A { background: #4ade80; } .grade.g-B { background: #a3e635; } .grade.g-C { background: #facc15; }
.grade.g-D { background: #fb923c; } .grade.g-E { background: #f87171; }
.release .why { color: #c4b5fd; font-size: .8em; margin-top: 4px; }
.ready-pill { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #065f46;
  color: #6ee7b7; font-size: .75em; font-weight: 700; }
.cached-note { margin: 0 0 10px; }
.cached-note a { color: #c4b5fd; text-decoration: underline dotted; }
.best-pill { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: .75em; font-weight: 700; }
.source.selected { box-shadow: 0 0 0 2px var(--accent); }
.more-toggle { display: block; width: 100%; margin: 4px 0 10px; padding: 11px; }
.more-sources[hidden] { display: none; }
.source.broken { opacity: .6; }
.releases h2 { font-size: 1.2em; }
.release { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; background: var(--surface); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; }
.release .meta { flex: 1 1 360px; min-width: 0; }
.grab-steps li { margin: 0 0 14px; line-height: 1.6; }
.downloads .dl-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
  background: var(--surface); border-radius: 10px; padding: 12px 14px; margin: 8px 0 16px; line-height: 1.6; }
.downloads .ok { color: #4ade80; } .downloads .bad { color: #f87171; }
.dl-table { border-collapse: collapse; width: 100%; font-size: .92em; }
.dl-table th, .dl-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
.dl-table tr.busy .state { color: #93c5fd; } .dl-table tr.bad .state { color: #fca5a5; }
.dl-table .bar { width: 120px; height: 8px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin-bottom: 3px; }
.dl-table .bar span { display: block; height: 100%; background: #22c55e; }
.dl-table details summary { color: var(--muted); font-size: .85em; cursor: pointer; }
.dl-table details ul { margin: 4px 0 0 16px; padding: 0; font-size: .85em; color: var(--muted); }
.dl-actions { display: flex; gap: 3px; } .dl-actions button { padding: 2px 7px; border-radius: 5px; border: 0;
  background: rgba(255,255,255,.1); color: inherit; cursor: pointer; }
.dl-table.log td:first-child { white-space: nowrap; color: var(--muted); } .dl-table.log tr.error td { color: #fca5a5; }
.dl-table .path { font-family: ui-monospace, monospace; font-size: .85em; word-break: break-all; }
.setup summary h2 { display: inline; } .setup { margin-top: 24px; }
.grab-script { background: var(--surface); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: .85em; }
.grab-queue { border-collapse: collapse; width: 100%; } .grab-queue td, .grab-queue th { text-align: left; padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.ssg-demo { background: #16a34a; color: #fff; padding: 1px 8px; border-radius: 999px; }
.release .rtitle { color: var(--muted); font-size: .8em; word-break: break-all; margin-top: 4px; }
.release .format { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-size: .8em; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; border: 0;
  font-size: 1em; cursor: pointer; }
.btn:hover { filter: brightness(1.15); }
.btn.alt { background: var(--surface-2); }
.speed .release { display: block; }
.loading-rows { padding: 0 var(--pad) 30px; }
.home-controls { display: flex; align-items: center; gap: 12px; padding: 0 var(--pad) 16px; }
.home-controls .vr-switch, .search-scope .vr-switch { margin-top: 0; }
.direct-list { max-width: none; padding: 0 var(--pad) 30px; }
header form.search { display: flex; gap: 8px; }
header form.search select { padding: 0 12px; border-radius: 999px; border: 1px solid #2a2f3a; background: var(--surface);
  color: var(--text); font-size: .95em; }
.search-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 var(--pad) 22px; }
.search-scope .btn { padding: 9px 16px; }
.small { font-size: .8em; }
.tabs.sort { padding: 0; }
.tabs.sort a { padding: 7px 14px; }

/* Sign out + login */
header form.signout { flex: none; max-width: none; margin-left: 0; order: 3; }
header form.signout button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px; }
header form.signout button:hover { color: var(--text); }
.login { max-width: 380px; margin: 12vh auto 0; padding: 32px 28px; background: var(--surface); border-radius: 14px; }
.login h1 { margin-bottom: 18px; }
.login label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .9em; }
.login input[type=text], .login input[type=password] { width: 100%; padding: 12px 14px; border-radius: 8px;
  border: 1px solid #2a2f3a; background: var(--bg); color: var(--text); font-size: 1em; }
.login input:focus { outline: none; border-color: var(--accent); }
.login .remember { display: flex; align-items: center; gap: 8px; margin: 16px 0 20px; color: var(--muted); }
.login .btn { width: 100%; }
.login .error { color: #fca5a5; margin: 0 0 8px; }

/* Hover actions: StashDB / Copy link */
.has-acts { position: relative; }
.pic { position: relative; }
.acts { display: none; gap: 6px; z-index: 5; }
.pic > .acts, .cover > .acts { position: absolute; top: 6px; left: 6px; }
.has-acts:hover .acts, .has-acts:focus-within .acts { display: flex; }
.inline-acts { display: inline-block; }
h1.inline-acts { display: block; width: fit-content; }  /* own line: kind above, count below */
.inline-acts .acts { position: absolute; left: 0; top: 100%; padding-top: 4px; font-size: 1rem; font-weight: 400; }
.act { padding: 5px 9px; border-radius: 6px; background: rgba(15, 17, 21, .9); color: #fff; font-size: .75rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.act:hover { background: var(--accent); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 18px; border-radius: 8px;
  background: #1e293b; color: #fff; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toast.on { opacity: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2);
  color: #d1d5db; font-size: .85em; cursor: pointer; }
.tag:hover { background: #374151; }
.tags.folded:not(.open) { max-height: 76px; overflow: hidden; }
.tags-more { display: inline-block; margin: -4px 0 10px; color: var(--muted); font-size: .85em; cursor: pointer;
  text-decoration: underline dotted; }
a.tag { color: #d1d5db; }
.tag .acts .act { font-size: .7rem; padding: 3px 7px; }
.tag-row { padding: 0 var(--pad) var(--pad); }
.meta-line a { color: inherit; text-decoration: underline dotted; }

/* Refresh status */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; padding: 8px var(--pad) 20px; }
.stat { background: var(--surface); border-radius: 10px; padding: 16px; }
.stat .n { font-size: 1.8em; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85em; }
.tabs { display: flex; gap: 10px; padding: 0 var(--pad) 20px; flex-wrap: wrap; }
.tabs a { padding: 10px 18px; border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 600; }
.tabs a.on { background: var(--accent); color: #fff; }
.table-wrap { padding: 0 var(--pad) 22px; overflow-x: auto; }
.table-wrap h2 { font-size: 1.1em; margin: 0 0 4px; }
.table-wrap p { margin: 0 0 10px; }
table.data { border-collapse: collapse; min-width: 520px; background: var(--surface); border-radius: 10px; overflow: hidden; }
table.data th, table.data td { padding: 10px 16px; text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: .85em; background: var(--surface-2); }
table.data tr + tr td { border-top: 1px solid var(--surface-2); }
.recheck-all { grid-column: 1 / -1; margin-bottom: 6px; }
.status-card .where { font-size: .8em; margin-top: 4px; color: #c4b5fd; font-weight: 600; }
.status-card .times { color: var(--muted); font-size: .8em; margin-top: 4px; }
.status-card form { margin-top: 8px; }
.status-card .btn { padding: 9px 16px; font-size: .9em; }
.performers { font-weight: 600; }
.person-link + .person-link::before { content: ", "; }
.performers a:hover { color: var(--accent); }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-2); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search */
header form { flex: 1; max-width: 560px; margin-left: auto; }
header input[type=search] { width: 100%; padding: 11px 16px; border-radius: 999px; border: 1px solid #2a2f3a; background: var(--surface);
  color: var(--text); font-size: 1em; outline: none; }
header input[type=search]:focus { border-color: var(--accent); }
.results .row-head .count { color: var(--muted); font-size: .9em; }
.empty { padding: 0 var(--pad); color: var(--muted); }
.results .scroller { padding-left: var(--pad); }
.person, .logo { flex: 0 0 var(--tile-w); }
.person .pic, .logo .pic { width: var(--tile-w); border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-size: 2.4em; color: var(--muted); }
.person .pic { height: calc(var(--tile-w) * 1.5); }
.person .pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.logo .pic { height: var(--cover-h); background: linear-gradient(135deg, #9ca3af, #6b7280); padding: 14px; }
.logo .pic img { width: 100%; height: 100%; object-fit: contain; }
.person:hover .pic, .logo:hover .pic { box-shadow: 0 0 0 3px var(--accent); }
.person .name, .logo .name { margin-top: 8px; font-weight: 600; font-size: .92em; line-height: 1.25; }
.person .note, .logo .note { color: var(--muted); font-size: .8em; }

/* Performer / studio page */
.hero-row .tile.performer, .hero-row .tile.studio { flex-basis: 200px; }
.hero-row .tile.performer .pic { width: 200px; height: 300px; }
.hero-row .tile.studio .pic { width: 200px; height: 112px; }
.hero-row .pic .zoom { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.hero-row .pic .zoom img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.hero-row .tile.studio .pic .zoom img { object-fit: contain; }
.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .9); cursor: zoom-out; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox button { position: absolute; border: 0; border-radius: 50%; width: 52px; height: 52px; background: rgba(24, 27, 34, .85);
  color: #fff; font-size: 1.8em; cursor: pointer; }
.lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 999px; background: rgba(24, 27, 34, .85); color: #e5e7eb; font-size: .85em; }
.photo-count { position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 3px 9px; border-radius: 999px;
  background: rgba(15, 17, 21, .85); color: #fff; font-size: .75em; font-weight: 700; }
.pager { display: flex; gap: 12px; justify-content: center; padding: 28px var(--pad) 0; }
/* Card chips (VR, length), top-left like VR video apps */
.chips { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; z-index: 1; }
.chip { padding: 2px 8px; border-radius: 6px; background: rgba(15, 17, 21, .82); color: #fff; font-size: .72em; font-weight: 700; }
.chip.vr { background: rgba(123, 91, 245, .92); }
.has-acts:hover .chips { visibility: hidden; }  /* StashDB / Copy link take that corner on hover */
.bigplay .bp-label { display: none; }

/* ---------------------------------------------------------------- Quest
   The Meta Quest browser window (~1280x720, laser pointer): icon rail on the left,
   slim top bar, big targets, cards that light up on hover, a scene page that fits
   the window. html.quest is set from the User-Agent (OculusBrowser). */
.rail { display: none; }
html.quest { --rail: 92px; --pad: 22px; --card-w: 320px; --cover-h: 180px; --tile-w: 150px; }
html.quest body { font-size: 18px; padding-left: var(--rail); }
html.quest .rail { display: flex; flex-direction: column; gap: 4px; position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
  width: var(--rail); padding: 12px 0; overflow-y: auto; background: #0b0d11; border-right: 1px solid #1f232c; }
.rail a, .rail button { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 8px; padding: 11px 4px;
  border: 0; border-radius: 14px; background: none; color: var(--muted); font: inherit; font-size: .68em; font-weight: 600;
  cursor: pointer; text-align: center; }
.rail a:hover, .rail button:hover { background: var(--surface-2); color: #fff; }
.rail a.on { background: var(--accent); color: #fff; }
.rail .i svg { width: 28px; height: 28px; display: block; }
.rail .rail-brand { font-size: 1.05em; font-weight: 800; color: #fff; letter-spacing: .04em; margin-bottom: 8px; }
.rail form { margin-top: auto; }
html.quest header { gap: 14px; padding: 10px var(--pad); }
html.quest header .brand, html.quest header nav, html.quest header form.signout { display: none; }
html.quest header form.search { flex: 1; max-width: 820px; margin-left: 0; }
html.quest header input[type=search] { padding: 13px 20px; font-size: 1em; }
html.quest header form.search select { padding: 0 16px; font-size: .95em; }
html.quest main { padding-top: 14px; }
html.quest .btn { min-height: 48px; }
html.quest .row { margin-bottom: 26px; }
html.quest .row-head h2 { font-size: 1.3em; }
html.quest .arrow { width: 64px; height: 64px; font-size: 2em; }
html.quest .card .cover, html.quest .person .pic, html.quest .logo .pic, html.quest .tile .pic { transition: transform .15s, box-shadow .15s; }
html.quest .card:hover .cover, html.quest .person:hover .pic, html.quest .logo:hover .pic, html.quest a.tile:hover .pic {
  transform: scale(1.04); box-shadow: 0 0 0 4px var(--accent), 0 14px 30px rgba(0, 0, 0, .6); }
html.quest .scroller { padding-top: 10px; padding-bottom: 16px; }  /* room for the hover zoom */
html.quest .card .title { font-size: .95em; }
html.quest .chip { font-size: .78em; padding: 3px 9px; }
html.quest .backdrop { min-height: 0; padding: 16px var(--pad) 8px; }
html.quest .scene.watch { max-width: none; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 24px; }
html.quest .player { max-width: calc((100vh - 190px) * 16 / 9); }
html.quest .bigplay { width: auto; height: auto; padding: 18px 34px 18px 30px; border-radius: 999px; font-size: 1.25em;
  display: flex; align-items: center; gap: 12px; font-weight: 700; }
html.quest .bigplay .bp-label { display: inline; }
html.quest .bigplay:not(:disabled):hover { filter: brightness(1.15); transform: translate(-50%, -50%) scale(1.05); }
html.quest .now-actions .btn, html.quest .release .ext .btn { padding: 12px 16px; font-size: .9em; }
html.quest .scene h1 { font-size: 1.45em; }
html.quest .releases { max-width: none; padding: 6px var(--pad); }
html.quest .release { padding: 12px 16px; }
html.quest .release:hover { background: var(--surface-2); }
html.quest .grid { gap: 26px var(--gap); }
html.quest .lightbox button { width: 68px; height: 68px; }
html.quest .layout-switch { padding-bottom: 20px; }

/* Bottom tab bar: phones only */
.tabbar { display: none; }

/* ---------------------------------------------------------------- phones
   html.phone is set by the server from the User-Agent (or by a tiny script
   when the browser is narrow and touch-only); ?layout switches override it. */
html.phone { --pad: 16px; --gap: 10px; --card-w: min(64vw, 280px); --cover-h: calc(var(--card-w) * .5625); --tile-w: 92px; }
html.phone body { font-size: 16px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
html.phone header { position: static; flex-wrap: wrap; gap: 10px 12px; padding: calc(10px + env(safe-area-inset-top)) var(--pad) 12px; }
html.phone header nav { display: none; }
html.phone header form.signout { margin-left: auto; order: 0; }
html.phone header form.search { order: 1; flex: 1 1 100%; max-width: none; margin: 0; }
html.phone header form.search select { padding: 0 8px; font-size: 16px; }
html.phone header input[type=search] { font-size: 16px; padding: 10px 14px; }
html.phone h1 { font-size: 1.35em; }
html.phone main { padding-top: 12px; }
html.phone .row { margin-bottom: 22px; contain-intrinsic-size: auto 250px; }
html.phone .row-head { padding-bottom: 8px; }
html.phone .row-head h2 { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.phone .row-head .all { flex: none; }
html.phone .scroller { scroll-snap-type: x proximity; scroll-padding-left: var(--pad); scrollbar-width: none; padding-right: var(--pad); }
html.phone .scroller::-webkit-scrollbar { display: none; }
html.phone .scroller > * { scroll-snap-align: start; }
html.phone .tile { position: static; box-shadow: none; padding-left: var(--pad); }
html.phone .tile .name { font-size: .85em; }
html.phone .results .scroller { padding-left: var(--pad); }
html.phone .arrow { display: none; }
/* Taps leave :hover stuck on touch screens: no hover ring there. */
html.phone .card:hover .cover, html.phone .person:hover .pic, html.phone .logo:hover .pic { box-shadow: none; }
html.phone .more { flex-basis: 110px; }
html.phone .card .title { font-size: .88em; }
html.phone .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px var(--gap); }
html.phone .grid .card .title { font-size: .82em; }
html.phone .grid.people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.phone .hero-row { gap: 14px; padding-top: 4px; padding-bottom: 16px; align-items: flex-start; }
html.phone .hero-row .tile { flex: 0 0 120px; padding-left: 0; }
html.phone .hero-row .tile .pic { width: 120px; height: 68px; }
html.phone .hero-row .tile.performer .pic { height: 180px; }
html.phone .entity-controls .btn, html.phone .fav .btn { padding: 8px 12px; font-size: .9em; }
html.phone .home-controls, html.phone .search-scope { flex-wrap: wrap; gap: 8px 12px; }
/* No hover on touch screens: card/tile actions stay hidden, title actions are always shown. */
html.phone .card .acts, html.phone .tile .acts, html.phone .person .acts, html.phone .logo .acts, html.phone .tag .acts { display: none !important; }
html.phone h1.inline-acts { display: block; }
html.phone h1.inline-acts > .acts { display: flex; position: static; padding-top: 6px; }
html.phone .backdrop { min-height: 0; padding: 14px var(--pad) 8px; }
html.phone .scene { gap: 14px; }
html.phone .scene.watch { grid-template-columns: 1fr; }
html.phone .backdrop { padding-left: 0; padding-right: 0; }
html.phone .player { border-radius: 0; }
html.phone .now, html.phone .scene.watch .info { padding: 0 var(--pad); }
html.phone .bigplay { width: 68px; height: 68px; font-size: 1.8em; }
html.phone .scene .details { -webkit-line-clamp: 3; font-size: .92em; }
html.phone .releases { padding: 4px var(--pad); }
html.phone .release { padding: 12px; gap: 10px; }
html.phone .release .meta { flex-basis: 100%; }
html.phone .release .btn, html.phone .release form { flex: 1 1 0; text-align: center; padding: 11px 8px; font-size: .88em;
  white-space: nowrap; }
html.phone .release .more-toggle { flex: none; }
html.phone .release form .btn { width: 100%; }
html.phone .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.phone .stat .n { font-size: 1.4em; }
html.phone .tabs a { padding: 8px 14px; }
html.phone .login { margin-top: 6vh; width: calc(100% - 2 * var(--pad)); padding: 24px 20px; }
html.phone .notice { margin: 12px var(--pad) 0; }
html.phone #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
html.phone .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(15, 17, 21, .96); backdrop-filter: blur(8px);
  border-top: 1px solid #1f232c; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--muted);
  font-size: .7em; font-weight: 600; }
.tabbar a .i svg { width: 24px; height: 24px; display: block; }
.tabbar a.on { color: #fff; }
.tabbar a.on .i { color: #c4b5fd; }
.layout-switch { text-align: center; padding: 18px var(--pad) 8px; font-size: .85em; }
.layout-switch a { color: var(--muted); text-decoration: underline dotted; margin: 0 8px; }
@media (max-width: 760px) {
  :root { --card-w: 220px; --tile-w: 110px; --cover-h: 1var(--pad); }
  .scene, .scene.watch { grid-template-columns: 1fr; }
}
