/* Real-site overrides on top of app.css (the design stylesheet). */
body { padding: 0; }
.frame { border: 0; border-radius: 0; max-width: 1400px; margin-inline: auto; overflow: visible; }
@media (min-width: 1440px) { .frame { border-inline: 1px solid var(--line); } }
header { position: relative; z-index: 40; }
.thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after { pointer-events: none; }
a.card { color: inherit; text-decoration: none; display: block; }
.card h3 { text-wrap: balance; }
.adslot { display: grid; justify-items: center; gap: 4px; }
.adslot.mb { display: none; }
@container (max-width: 640px) { .adslot.dk { display: none; } .adslot.mb { display: grid; } }
.adlab { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.adbox { max-width: 100%; overflow: hidden; }
.adwrap:empty { display: none; }
.adwrap:not(:has(.adslot)):not(.ad) { margin: 0; }
a.srow, a.vrow { color: inherit; text-decoration: none; }
a.pill { color: inherit; text-decoration: none; }
.flash { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin: 0 0 14px; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: var(--good); } .flash.bad { border-color: var(--bad); color: var(--bad); }
.fmsg { font-size: 13.5px; min-height: 1.3em; } .fmsg.ok { color: var(--good); } .fmsg.bad { color: var(--bad); }
.btn[disabled] { opacity: .55; pointer-events: none; }
button.btn { font: inherit; cursor: pointer; }
.field input, .field select, .field textarea { font-family: inherit; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player.sc-off .play { display: none; }
.like { cursor: pointer; user-select: none; } .like.on { color: var(--fg); background: var(--accent-soft); }
.vbar { position: relative; }
.hs[hidden], [hidden] { display: none !important; }
.thumb .rdots { pointer-events: none; }
.card .thumb img { transition: opacity .15s; }
.ptx { max-width: 760px; }
.prose { max-width: 760px; } .prose img { max-width: 100%; }
.pm-list a { display: flex; }
.empty { color: var(--muted); padding: 18px 0; }
.pill.sel { background: var(--accent); color: var(--accent-fg); }
.mdl { color: inherit; text-decoration: none; display: grid; justify-items: center; gap: 6px; text-align: center; }
.mdl b { font-size: 14px; } .mdl small { color: var(--muted); font-size: 12.5px; }
.ctag { text-decoration: none; color: inherit; }
.pside a { display: block; }
.comment { position: relative; }
.noscript-note { padding: 20px; text-align: center; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.az a { padding: 3px 7px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); } .az a:hover { color: var(--fg); } .az a.on { background: var(--accent); color: var(--accent-fg); }
/* Comfort = one large card per row, Compact = two smaller cards per row (phones) */
.links .extra[hidden] { display: none; }
.links .more { background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); font-size: 16px; line-height: 1; width: 28px; height: 24px; cursor: pointer; padding: 0; }
.favtip { position: absolute; right: 44px; top: 8px; z-index: 3; }
.cf-turnstile { min-height: 0; } .cf-turnstile:not(.ts-open) { height: 0; overflow: hidden; margin: -6px 0 0; } .cf-turnstile.ts-open { overflow: visible; } .cf-turnstile:empty { display: none; }
.cf-turnstile iframe { max-width: 100%; border-radius: 8px; }

/* ---- Safari-safe behaviour ---- */
/* suggestion list: shown by script (class "open"), not by :focus-within */
.dsearch:focus-within .ddrop { display: none; }
.dsearch.open .ddrop { display: block; }
.ddrop .srow.vtl { display: flex; align-items: center; gap: 10px; border-bottom: 0; }
.ddrop .srow.vtl span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddrop .srow.vtl svg { flex: none; }
.ddrop a, .ddrop .srow { -webkit-tap-highlight-color: rgba(128,128,128,.15); touch-action: manipulation; }
/* long titles never pass the poster; the end fades out instead of being cut */
.grid > * { min-width: 0; max-width: 100%; }
.card { min-width: 0; max-width: 100%; overflow: hidden; }
.card h3 { position: relative; display: block; width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: clip; padding-right: 0; -webkit-mask-image: none; mask-image: none; }
.card h3::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,0), var(--bg) 85%); }
.vrow h3::after, .nbt b::after { display: none; }
/* Comfort / Compact */
.smenu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; color: var(--muted); }
.smenu button:hover { background: var(--surface-2); color: var(--fg); } .smenu button.on { color: var(--fg); font-weight: 600; }
button, [role=button], .sortbtn, .addbtn, .like { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@container (max-width: 760px) { #topgrid.one, #catresgrid.one, #favgrid.one, #hisgrid.one, #contgrid.one, #entgrid.one, #srgrid.one, #wlgrid.one { grid-template-columns: minmax(0, 1fr); } }

@media (min-width: 761px) { .vmode { display: none !important; } }

/* view toggle row above grids (phones only), same padding for the category results as the page, tighter tag links, full-width phone player */
.vmrow { display: flex; justify-content: flex-end; margin: 0 0 10px; }
@media (min-width: 761px) { .vmrow { display: none; } }
#catres { padding: 0 18px; }
@container (max-width: 560px) { #catres { padding-inline: 14px; } }
.vsec .links { gap: 4px .4em; }   /* about one space between two tags or categories */
@container (max-width: 560px) {
  #vpage .player { margin-inline: -14px; border-radius: 0; }
}
@container (max-width: 560px) { .grid[data-vm] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; } .grid[data-vm].one { grid-template-columns: minmax(0, 1fr); gap: 22px; } }

/* up next title fades out instead of ending in an ellipsis */
.nbt b { position: relative; display: block; text-overflow: clip; }
.nbt b::after { display: block !important; content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,0), var(--surface) 85%); }

/* filter bar: Added / Duration / Quality on the left, Sort / View on the right */
div.filt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 24px; margin-bottom: 18px; grid-template-columns: none; }
div.filt .fl, div.filt .fr { display: flex; align-items: center; gap: 2px 18px; min-width: 0; }
div.filt .sortwrap { min-width: 0; }
div.filt .sortbtn { width: auto; padding: 8px 0; white-space: nowrap; font-size: 13.5px; }
div.filt .fr .smenu { left: auto; right: 0; }
div.filt .fl .smenu { left: 0; right: auto; }
@container (max-width: 560px) {
  div.filt { gap: 0; }
  div.filt .fl { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: space-between; gap: 0 8px; }
  div.filt .fr { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); }
  div.filt .sortbtn { font-size: 13px; gap: 4px; }
  div.filt .fl .sortwrap:last-child .smenu { left: auto; right: 0; }
}
/* lists without a view switch: two columns on phones */
@container (max-width: 560px) { .grid.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; } }
/* category results header: title left, view right */
#catres .head { flex-wrap: nowrap; align-items: flex-start; }

/* result of saving, next to the Save button */
.box .pills:has(.savenote) { display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: nowrap; }
.savenote { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.savenote:empty { display: none; }
.savenote::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.savenote.ok { color: var(--good, #1a8f4c); } .savenote.bad { color: var(--bad, #c0392b); }
.savenote:not(.ok):not(.bad) { color: var(--muted); }
.savenote { flex: 1 1 0; min-width: 0; line-height: 1.35; }
.box .pills:has(.savenote) .btn { flex: none; }

/* poster size on computers and corner style (Settings > Display) */
@container (min-width: 761px) { html[data-cols="4"] .grid { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); } }
html[data-corners="square"] .thumb, html[data-corners="square"] .mini .thumb, html[data-corners="square"] .vrow .thumb, html[data-corners="square"] .nbth,
html[data-corners="square"] .player, html[data-corners="square"] .thumb video { border-radius: 0; }

/* rotating posters: soft cross-fade, no dots */
.thumb .rdots { display: none !important; }
.thumb img.rfade { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; pointer-events: none; z-index: 1; }
.thumb img.rfade.on { opacity: 1; }

/* poster layout "edge to edge": posters nearly touch, and on phones reach the screen edges */
html[data-style="edge"] .grid { column-gap: 4px; row-gap: 14px; }
html[data-style="edge"] .card h3, html[data-style="edge"] .card .meta { padding-inline: 8px; }
html[data-style="edge"] .card h3 { width: auto; }
@container (min-width: 761px) { html[data-style="edge"] .grid { column-gap: 8px; row-gap: 18px; } }
@container (max-width: 760px) { html[data-style="edge"] .page > .grid, html[data-style="edge"] .vsplit > .grid, html[data-style="edge"] .hs > .grid, html[data-style="edge"] #catres > .grid { margin-inline: -18px; } }
@container (max-width: 560px) { html[data-style="edge"] .page > .grid, html[data-style="edge"] .vsplit > .grid, html[data-style="edge"] .hs > .grid, html[data-style="edge"] #catres > .grid { margin-inline: -14px; column-gap: 3px; } }

/* card info row with icons, like the video page */
.card .meta > span { display: inline-flex; align-items: center; gap: 4px; }
.card .meta svg { width: 14px; height: 14px; flex: none; opacity: .85; }
.card .meta .up svg { opacity: 1; }
.card .meta .mt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@container (max-width: 560px) { .card .meta { gap: 0 7px; font-size: 11.5px; } .card .meta svg { width: 13px; height: 13px; } }

/* short preview clip over the poster */
.thumb { position: relative; }
.thumb video.pvid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; z-index: 1; border-radius: inherit; pointer-events: none; }
.thumb video.pvid.on { opacity: 1; }
.thumb .chip, .thumb .addbtn, .thumb .crank { z-index: 2; }

.fextra { flex-basis: 100%; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; }


/* Up next card: phones only; its title runs to the end of the card and fades out there */
@media (min-width: 761px) { .nextbox { display: none; } }
.nbl .nbt { flex: 1 1 0; min-width: 0; }
.nbt b { display: block; width: 100%; }
