/* Insane TV in the browser. Colours and shapes follow the TV app. */
:root {
    --bg: #0A0D14;
    --panel: #10141F;
    --surface: #171D2B;
    --hi: #242C40;
    --accent: #7C5CFF;
    --accent-soft: #A892FF;
    --text: #F2F4F8;
    --dim: #A3ABBD;
    --faint: #6B7385;
    --live: #FF4D5E;
    --gold: #FFC542;
    --ok: #3DDC97;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
h4 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-soft); margin-top: 18px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: var(--accent-soft); }
small { font-size: 13px; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.error { color: var(--live); }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hi); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

#app { height: 100%; }
.boot, .loading { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--dim); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--hi); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ico { fill: currentColor; flex: none; display: block; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; height: 100%; }
.rail { width: 86px; flex: none; background: var(--panel); display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; overflow-y: auto; }
.rail-brand { font-weight: 800; font-size: 18px; text-align: center; color: var(--accent-soft); padding: 6px 0 14px; letter-spacing: .02em; }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border-radius: 12px; color: var(--dim); font-size: 11.5px; }
.rail button:hover { background: var(--surface); color: var(--text); }
.rail button.on { background: var(--accent); color: #fff; }
.main { flex: 1; min-width: 0; height: 100%; position: relative; }
.screen { height: 100%; min-height: 0; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.fill { flex: 1; min-height: 0; position: relative; }
.scroll { overflow: auto; }
.pad { padding: 22px 26px; }
.pad-x { padding-left: 26px; padding-right: 26px; }
.spacer { flex: 1; }
.empty { padding: 60px 20px; text-align: center; color: var(--dim); }

.toolbar { display: flex; align-items: center; gap: 12px; padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap; }
.col > .toolbar:not(.pad-x) { padding-left: 18px; padding-right: 18px; }
.toolbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.toolbar .field { width: auto; min-width: 150px; }
.toolbar input.field { flex: 1; max-width: 320px; }
.toolbar .status { font-size: 13.5px; }

/* ---------------------------------------------------------------- buttons, fields, pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface); color: var(--text); border-radius: 10px; padding: 9px 16px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .12s; }
.btn:hover { background: var(--hi); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #8d70ff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.btn.round { padding: 9px; border-radius: 50%; background: transparent; }
.btn.round:hover { background: rgba(255, 255, 255, .12); }
.btn.gold { color: var(--gold); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.row-actions.center { justify-content: center; }
.field { background: var(--surface); color: var(--text); border: 1px solid var(--hi); border-radius: 10px; padding: 9px 12px; font: inherit; width: 100%; outline: none; }
.field:focus { border-color: var(--accent); }
.field.big { font-size: 18px; padding: 12px 16px; max-width: 640px !important; }
select.field { cursor: pointer; }
.pill { display: inline-block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--dim); background: var(--hi); border-radius: 20px; padding: 2px 10px; margin-left: 8px; white-space: nowrap; }
.pill.live { background: var(--live); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 14px; }
.chip { background: var(--surface); border-radius: 20px; padding: 7px 16px; font-weight: 600; color: var(--dim); }
.chip:hover { background: var(--hi); }
.chip.on { background: var(--accent); color: #fff; }
.bar { display: block; height: 3px; background: rgba(255, 255, 255, .16); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-soft); border-radius: 2px; }
.bar.wide { height: 4px; margin: 10px 0; }
.panel { background: var(--panel); border-radius: 16px; padding: 20px 22px; }

/* ---------------------------------------------------------------- pictures */
.pic { position: relative; overflow: hidden; background: var(--hi); display: flex; align-items: center; justify-content: center; flex: none; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic.has-img .pic-txt { visibility: hidden; }
.pic-txt { color: var(--faint); font-weight: 700; text-align: center; padding: 6px; overflow: hidden; }
.logo { width: 44px; height: 44px; border-radius: 10px; font-size: 14px; }
.logo img { object-fit: contain; padding: 4px; }
.logo.small { width: 34px; height: 34px; border-radius: 8px; font-size: 12px; }
.logo.big { width: 68px; height: 68px; border-radius: 14px; font-size: 20px; }
.logo.huge { width: 180px; height: 180px; border-radius: 28px; font-size: 48px; }
.poster-pic { width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; font-size: 13px; }
.poster-pic.large { width: 230px; flex: none; box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.still { width: 168px; aspect-ratio: 16 / 9; border-radius: 10px; font-size: 16px; }

/* ---------------------------------------------------------------- virtual lists */
.v-list, .v-grid, .g-box { position: absolute; inset: 0; overflow: auto; }
.v-grid { padding: 4px 18px 18px; }
.v-inner { position: relative; }
.v-list .v-inner > * { position: absolute; left: 0; right: 0; }

/* ---------------------------------------------------------------- cards and shelves */
.card { position: relative; display: block; border-radius: 12px; }
.card:hover .pic, .card:focus-visible .pic { outline: 3px solid var(--accent); }
.card-name { display: block; margin-top: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card small { display: block; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; }
.card .badge { position: absolute; top: 8px; right: 8px; background: rgba(5, 7, 11, .8); color: var(--gold); font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.card.poster .bar { position: absolute; left: 8px; right: 8px; top: calc((100% - 28px) - 12px); }
/* A card with a second line of text under the name is that much taller, and the bar stays on the picture. */
.card.poster.noted .bar { top: calc((100% - 48px) - 12px); }
.card.channel { width: 150px; flex: none; background: var(--surface); padding: 14px; }
.card.channel:hover { background: var(--hi); }
.card.channel .logo { width: 56px; height: 56px; }
.shelf { margin-top: 26px; }
.shelf h3 { margin-bottom: 12px; }
.shelf-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x proximity; }
.shelf-row .poster { width: 150px; flex: none; }

/* ---------------------------------------------------------------- home */
.home { overflow: auto; padding: 26px 30px 40px; }
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.home-head h1 { font-size: 32px; }
.home-time { text-align: right; }
.home-clock { font-size: 32px; font-weight: 700; line-height: 1.1; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { border-radius: 18px; padding: 22px 22px 20px; min-height: 124px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; color: #fff; transition: transform .12s; }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); outline: 3px solid #fff; }
.tile strong { font-size: 22px; margin-top: 6px; }
.tile span { opacity: .92; }
.t-live { background: linear-gradient(120deg, #7C5CFF, #4F35D9); }
.t-guide { background: linear-gradient(120deg, #1E9BFF, #1560C8); }
.t-movies { background: linear-gradient(120deg, #FF6B8B, #C8325F); }
.t-series { background: linear-gradient(120deg, #2EC98A, #167A55); }

/* ---------------------------------------------------------------- live, movies, series: columns */
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(300px, 34%); grid-template-rows: minmax(0, 1fr); }
.split.two { grid-template-columns: 250px minmax(0, 1fr); }
.cats { overflow: auto; background: var(--panel); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--bg); }
.cat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--dim); flex: none; }
.cat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat small { color: var(--faint); }
.cat:hover { background: var(--surface); color: var(--text); }
.cat.on { background: var(--accent); color: #fff; }
.cat.on small { color: rgba(255, 255, 255, .8); }

.ch-row { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 8px; }
.ch-main { flex: 1; min-width: 0; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 12px; border-radius: 12px; }
.ch-row:hover .ch-main, .ch-main:focus-visible { background: var(--surface); }
.num { width: 42px; flex: none; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ch-text b, .ch-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-text small { color: var(--dim); }
.ch-text .bar { max-width: 420px; margin-top: 3px; }

.details { background: var(--panel); padding: 22px 24px; overflow: auto; }
.details-head { display: flex; gap: 16px; align-items: center; }
.details h3 { margin-top: 4px; }
.plot { color: var(--dim); line-height: 1.6; white-space: pre-line; margin-top: 10px; max-width: 760px; }
.later { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.later div { display: flex; gap: 18px; }
.later time { color: var(--faint); font-variant-numeric: tabular-nums; width: 46px; flex: none; }

/* ---------------------------------------------------------------- catch-up */
.prog-list { display: flex; flex-direction: column; gap: 6px; max-width: 900px; padding-bottom: 30px; }
.prog { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--panel); }
.prog:hover { background: var(--surface); }
.prog time { color: var(--accent-soft); font-weight: 700; font-variant-numeric: tabular-nums; width: 50px; flex: none; }
.prog > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prog small { color: var(--dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------------------------------------------------------------- guide */
.guide-day { min-width: 110px; text-align: center; }
.g-inner { position: relative; }
.g-ruler { position: sticky; top: 0; z-index: 6; background: var(--panel); }
.g-ruler span { position: absolute; top: 0; bottom: 0; padding: 9px 0 0 8px; font-size: 12.5px; color: var(--dim); border-left: 1px solid var(--hi); font-variant-numeric: tabular-nums; }
.g-corner { position: sticky; left: 0; height: 100%; background: var(--panel); z-index: 7; }
.g-row { position: absolute; left: 0; border-bottom: 1px solid var(--bg); }
.g-ch { position: sticky; left: 0; z-index: 4; height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-right: 1px solid var(--bg); }
.g-ch:hover { background: var(--surface); }
.g-ch span { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-prog { position: absolute; top: 4px; bottom: 4px; background: var(--surface); border-radius: 9px; overflow: clip; }
.g-prog:hover, .g-prog:focus-visible { background: var(--hi); }
.g-prog.now { background: #2f2766; }
.g-prog.now:hover { background: #3b3180; }
.g-prog.past { opacity: .62; }
.g-prog > span { position: sticky; left: 228px; display: inline-block; max-width: 100%; padding: 8px 10px; vertical-align: top; }
.g-prog b, .g-prog small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog b { font-size: 13.5px; font-weight: 600; }
.g-prog small { color: var(--dim); font-size: 12px; }
.g-none { position: absolute; top: 4px; bottom: 4px; color: var(--faint); font-size: 13px; line-height: 54px; }
.g-none span { position: sticky; left: 236px; }
.g-now { position: absolute; width: 2px; background: var(--live); z-index: 3; pointer-events: none; }

/* ---------------------------------------------------------------- movie and series pages */
.detail { position: relative; overflow: auto; }
.backdrop { position: absolute; inset: 0 0 auto 0; height: 460px; background-size: cover; background-position: center 20%; opacity: .28; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); pointer-events: none; }
.detail-inner { position: relative; padding: 20px 30px 50px; max-width: 1240px; }
.detail-main { display: flex; gap: 30px; margin: 16px 0 26px; align-items: flex-start; }
.detail-text { flex: 1; min-width: 0; }
.detail-text h1 { font-size: 32px; line-height: 1.2; margin-bottom: 6px; }
.people { margin-top: 16px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.people b { color: var(--text); }
.tagline { font-style: italic; color: var(--dim); font-size: 16px; margin-bottom: 8px; }
.detail .shelf { margin-bottom: 4px; }
.person { width: 124px; flex: none; }
.person b { display: block; margin-top: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; }
.face { width: 124px; aspect-ratio: 2 / 3; border-radius: 12px; font-size: 26px; }
.episodes { display: flex; flex-direction: column; gap: 8px; }
.episode { display: flex; gap: 16px; padding: 10px; border-radius: 14px; background: var(--panel); align-items: flex-start; }
.episode:hover { background: var(--surface); }
.episode.next { box-shadow: inset 0 0 0 2px var(--accent); }
.episode-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.episode-text small { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--dim); }
.episode-text .bar { max-width: 320px; }

/* ---------------------------------------------------------------- settings */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.settings .panel h3 { margin-bottom: 8px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 0; border-top: 1px solid var(--surface); }
.setting > div:first-child { min-width: 0; }
.setting b { display: block; }
.setting small { color: var(--dim); display: block; }
.setting .field { width: auto; flex: none; }
.setting .row-actions { margin: 0; flex: none; }

/* ---------------------------------------------------------------- sign-in and first sync */
.signin, .sync { min-height: 100%; height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 30px 20px; text-align: center; }
.brand { font-size: 38px; font-weight: 800; background: linear-gradient(120deg, #A892FF, #7C5CFF 60%, #1E9BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signin header { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.signin-cards { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; align-items: stretch; }
.signin-card { width: 380px; max-width: 100%; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.signin-card label { display: flex; flex-direction: column; gap: 5px; color: var(--dim); font-size: 13px; }
.code { font-size: 54px; font-weight: 800; letter-spacing: .06em; text-align: center; padding: 22px 0 10px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- dialogs and messages */
.scrim { position: fixed; inset: 0; background: rgba(5, 7, 11, .8); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialog { background: var(--surface); border-radius: 18px; padding: 24px 26px 18px; width: 520px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.dialog-body { overflow: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.dialog-actions .btn:not(.primary) { background: var(--hi); }
.options { display: flex; flex-direction: column; gap: 4px; }
.option { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 10px; }
.option:hover, .option:focus-visible { background: var(--hi); }
.option.on { background: var(--accent); color: #fff; }
#toast { position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); background: #fff; color: #0A0D14; font-weight: 600; padding: 11px 20px; border-radius: 12px; z-index: 2147483647; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: min(90vw, 640px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- player */
.player { position: fixed; inset: 0; background: #000; z-index: 50; outline: none; user-select: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.idle { cursor: none; }
.p-top, .p-bottom { position: absolute; left: 0; right: 0; transition: opacity .25s; z-index: 3; }
.player.idle .p-top, .player.idle .p-bottom { opacity: 0; pointer-events: none; }
.p-top { top: 0; display: flex; align-items: center; gap: 14px; padding: 16px 22px 50px; background: linear-gradient(rgba(0, 0, 0, .78), transparent); }
.p-titles { flex: 1; min-width: 0; }
.p-title { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-clock { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-bottom { bottom: 0; padding: 60px 22px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .86)); display: flex; flex-direction: column; gap: 8px; }
.p-buttons { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-group { display: flex; align-items: center; gap: 4px; }
.player .btn.big { padding: 12px; background: rgba(255, 255, 255, .14); margin: 0 6px; }
.player.is-live .file-only, .player.is-file .live-only, .player.is-live .p-seekrow, .player.is-file .p-live { display: none; }
.p-seekrow { display: flex; align-items: center; gap: 14px; }
.p-time { font-variant-numeric: tabular-nums; font-size: 13.5px; min-width: 52px; text-align: center; }
.p-live { max-width: 640px; }
.p-now-title { font-size: 18px; font-weight: 600; }
.p-now-times, .p-next-line { color: var(--dim); font-size: 13.5px; }
.p-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.p-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.p-bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; width: 110px; height: 110px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.p-message { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; background: var(--surface); border-radius: 18px; padding: 26px 28px 14px; width: 520px; max-width: calc(100% - 32px); text-align: center; font-size: 16px; user-select: text; }
.p-message-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.p-keys { color: var(--dim); font-size: 14px; margin: 8px 0 0; }
.mpv-bar { width: 180px; flex: none; }
.setting small.warn { color: #ffb4a9; }
.p-hint { text-align: left; margin-top: 14px; font-size: 14px; color: var(--dim); }
.p-hint summary { cursor: pointer; color: var(--accent-soft); }
.p-hint p { margin: 8px 0; }
.p-hint .field { margin-bottom: 8px; font-size: 12px; }
.p-nextcard { position: absolute; right: 26px; bottom: 150px; z-index: 5; background: var(--surface); border-radius: 16px; padding: 18px 20px 6px; width: 360px; max-width: calc(100% - 32px); display: flex; flex-direction: column; gap: 4px; }
.p-nextcard small { color: var(--dim); }
.p-panel { position: absolute; top: 0; bottom: 0; left: 0; width: 380px; max-width: 90%; background: rgba(16, 20, 31, .96); z-index: 6; display: flex; flex-direction: column; }
.p-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px 20px; font-size: 17px; }
.p-panel-list { flex: 1; min-height: 0; position: relative; }
.p-row { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 4px; }
.p-row:hover { background: var(--surface); }
.p-row.on { background: var(--accent); }
.p-row .num { width: 44px; }
.p-row.on .num { color: #fff; }
.p-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-row-text b, .p-row-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row-text small { color: var(--dim); }
.p-row.on small { color: rgba(255, 255, 255, .85); }

.p-subs { position: absolute; left: 6%; right: 6%; bottom: 7%; z-index: 2; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: bottom .2s; }
.player:not(.idle) .p-subs { bottom: 150px; }
.p-subs span { background: rgba(0, 0, 0, .62); color: #fff; font-size: clamp(17px, 2.5vw, 44px); line-height: 1.3; padding: 2px 14px; border-radius: 6px; text-align: center; text-shadow: 0 1px 3px #000; white-space: pre-wrap; }
.p-timing { position: absolute; top: 78px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--surface); border-radius: 14px; padding: 8px 10px 8px 18px; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center; }
.p-timing b { min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.p-timing > span { color: var(--dim); margin-right: 8px; }
.sub-search { display: flex; gap: 8px; margin-bottom: 10px; }
.sub-results { min-height: 180px; }
.sub-results .loading { height: auto; padding: 40px 0; }
.sub-results .empty { padding: 40px 10px; }
.sub-results .option > span { display: flex; flex-direction: column; min-width: 0; }
.sub-results .option small { color: var(--dim); overflow-wrap: anywhere; }
.sub-results .option.on small { color: rgba(255, 255, 255, .85); }
.option small { color: var(--dim); }
.option.on small { color: rgba(255, 255, 255, .85); }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; height: 22px; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--accent-soft) var(--fill, 0%), rgba(255, 255, 255, .28) var(--fill, 0%)); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .28); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent-soft); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #fff; margin-top: -5px; }
input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #fff; }
.p-seek { flex: 1; }
.p-vol { width: 90px; --fill: 100%; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1100px) {
    .split { grid-template-columns: 210px minmax(0, 1fr); }
    .split .details { display: none; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .shell { flex-direction: column-reverse; }
    .rail { width: auto; flex-direction: row; justify-content: space-between; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow-x: auto; }
    .rail-brand { display: none; }
    .rail button { flex: 1 1 0; min-width: 0; padding: 7px 0; font-size: 10px; }
    .rail button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .main { height: auto; min-height: 0; }
    .split, .split.two { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .cats { flex-direction: row; padding: 8px; border-left: 0; }
    .cat small { display: none; }
    .home { padding: 18px 16px 30px; }
    .home-head h1, .home-clock { font-size: 24px; }
    .pad { padding: 16px; }
    .pad-x, .detail-inner { padding-left: 16px; padding-right: 16px; }
    .detail-main { flex-direction: column; }
    .poster-pic.large { width: 150px; }
    .still { width: 112px; }
    .num { width: 30px; }
    .p-vol, .p-clock { display: none; }
    .p-top { padding: 10px 12px 40px; }
    .p-bottom { padding: 40px 12px 10px; }
    .btn.ghost span { display: none; }
    .player .btn.ghost.file-only span { display: inline; }
    .setting { flex-direction: column; align-items: flex-start; }
}
