@charset "UTF-8";
:root {
	--bg: #141414;
	--bg-2: #1b1b1b;
	--surface: #242424;
	--surface-2: #303030;
	--border: rgba(255, 255, 255, 0.08);
	--border-2: rgba(255, 255, 255, 0.14);
	/* Liquid Glass material: fill + blur(saturate 180%) + light rim + soft shadow, always together. */
	--glass-bg: rgba(44, 44, 44, 0.42);
	--glass-border: rgba(255, 255, 255, 0.2);
	--glass-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
	--glass-strong: rgba(26, 26, 26, 0.86);
	/* One spring for all geometry (damped overshoot, peaks at 1.05). Opacity uses plain easing. */
	--spring: linear(0, .04, .16, .36, .6, .82, .97, 1.04, 1.05, 1.04, 1.02, 1.007, 1);
	--text: #f4f4f6;
	--muted: #bababa;
	--accent: #e8252b;
	--accent-2: #ff5a36;
	--accent-text: #ffffff;
	--danger: #ff6b7d;
	--focus: #ff9a86;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	--gutter: clamp(16px, 4vw, 48px);
	color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font: 16px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 14px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

/* ---------- Ambient backdrop ----------
   Two stacked layers crossfade when the artwork changes (hero, opened title). Heavy blur + low brightness
   turns any poster into a soft colour field, which gives every glass surface something to refract. */
.ambient {
	position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
	background: linear-gradient(160deg, #2a2a2a 0%, #141414 48%, #241018 100%);
}
.ambient-layer {
	position: absolute; inset: -12%; background: center / cover no-repeat;
	filter: blur(70px) saturate(185%) brightness(1); opacity: 0; transition: opacity 0.9s ease-out;
}
.ambient-layer.on { opacity: 1; }
.ambient::after {
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(70% 60% at 0% 0%, rgba(86, 86, 86, 0.32), transparent 70%),
		radial-gradient(60% 55% at 100% 100%, rgba(232, 37, 43, 0.22), transparent 72%),
		linear-gradient(to bottom, rgba(18, 18, 18, 0), rgba(18, 18, 18, 0.3));
}

/* Shared glass surfaces (blur tracks elevation: 8 nested · 16 chrome · 20 floating · 24 menus · 44 dialogs). */
.glass, .topbar, .tabs, .search input, #source-picker, .avatar, .btn:not(.primary):not(.ghost):not(.link) {
	-webkit-backdrop-filter: blur(16px) saturate(180%);
	backdrop-filter: blur(16px) saturate(180%);
}

/* ---------- Buttons & fields ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 1px solid var(--glass-border); border-radius: 999px; padding: 10px 18px; cursor: pointer;
	background: var(--glass-bg); box-shadow: var(--glass-shadow); color: var(--text); font-weight: 700;
	transition: background 0.15s, opacity 0.06s ease; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .btn:hover { background: rgba(69, 69, 69, 0.45); } }
.btn:active, .tile:active, .channel:active, .episode:active, .tabs button:active { opacity: 0.6; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text); border-color: rgba(255, 255, 255, 0.22); }
@media (hover: hover) { .btn.primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, var(--accent), var(--accent-2)); } }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
@media (hover: hover) { .btn.ghost:hover { background: var(--glass-bg); color: var(--text); } }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.block { width: 100%; padding: 13px 18px; }
.btn.danger { color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); font-weight: 700; cursor: pointer; }

.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.field input, select {
	width: 100%; padding: 11px 13px; border-radius: 12px;
	background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border-2); color: var(--text); font-weight: 400;
}
.field input:focus { border-color: var(--accent); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
.advanced[open] summary { margin-bottom: 12px; }
.advanced .field + .field { margin-top: 12px; }

/* ---------- Logo ---------- */
.logo-mark {
	width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
	background: url("/icon-rounded.png?v=2") center / contain no-repeat;
}
.logo-word { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }

/* ---------- Auth ---------- */
.auth {
	min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
	padding: 32px 16px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .logo-mark { width: 38px; height: 38px; }
.auth-brand .logo-word { font-size: 30px; }
.auth-card {
	width: 100%; max-width: 440px; display: grid; gap: 16px;
	background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 22px; padding: 28px 24px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
	-webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%);
}
.auth-card h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.auth-card p { margin: 0; }
.auth-note { color: var(--danger); max-width: 440px; text-align: center; }
.source-fields { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 16px; margin: 0; display: grid; gap: 12px; }
.source-fields legend { padding: 0 6px; font-weight: 800; font-size: 14px; }

/* ---------- App shell ---------- */
.topbar {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; gap: 20px; padding: 12px var(--gutter);
	background: rgba(36, 36, 36, 0.3); border-bottom: 0.5px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.tabs {
	display: flex; gap: 3px; position: relative; padding: 4px; border-radius: 999px;
	background: rgba(255, 255, 255, 0.06); border: 0.5px solid var(--glass-border);
}
.tabs button {
	position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted); font-weight: 700;
	padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: color 0.15s, opacity 0.06s ease;
	-webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .tabs button:hover { color: var(--text); } }
.tabs button[aria-current="page"] { color: var(--text); }
/* The pill is ONE element that travels between tabs (glass.js), so it reads as an object moving. */
.seg-pill {
	position: absolute; left: 0; top: 0; z-index: 0; border-radius: 999px;
	background: var(--glass-bg); border: 0.5px solid var(--border-2); box-shadow: var(--glass-shadow);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
	opacity: 0; pointer-events: none; will-change: left, top, width, height, transform;
	transition: left 0.32s var(--spring), top 0.32s var(--spring), width 0.32s var(--spring), height 0.32s var(--spring);
}
.seg-pill.show { opacity: 1; }
.seg-pill.moving { animation: seg-pill-squish 0.32s ease-out; }
@keyframes seg-pill-squish {
	0% { transform: scaleX(1) scaleY(1); }
	35% { transform: scaleX(1.06) scaleY(0.94); }
	70% { transform: scaleX(0.98) scaleY(1.02); }
	100% { transform: scaleX(1) scaleY(1); }
}
.pill-measure button { transition: none !important; animation: none !important; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search input {
	width: 220px; padding: 9px 14px 9px 36px; border-radius: 999px; border: 1px solid var(--glass-border);
	background: var(--glass-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239d93ab' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px center / 16px no-repeat;
}
.search input:focus { border-color: var(--accent); outline: none; }
#source-picker { width: auto; max-width: 180px; padding: 8px 12px; border-radius: 999px; background: var(--glass-bg); border: 1px solid var(--glass-border); }
.avatar {
	width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-weight: 800;
	background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); color: var(--text);
}
.banner {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	margin: 14px var(--gutter) 0; padding: 12px 16px; border-radius: var(--radius);
	background: rgba(255, 107, 125, 0.14); border: 1px solid rgba(255, 107, 125, 0.35); box-shadow: var(--glass-shadow);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.status { padding: 0 var(--gutter); }
.status:empty { display: none; }

/* ---------- Hero ---------- */
.hero {
	position: relative; min-height: min(62vh, 560px); display: flex; align-items: flex-end;
	padding: 48px var(--gutter) 56px; overflow: hidden; isolation: isolate;
}
.hero-art { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 25%; filter: saturate(1.05); }
.hero::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(to top, var(--bg) 2%, rgba(18, 18, 18, 0.4) 40%, rgba(18, 18, 18, 0.05) 75%),
		linear-gradient(to right, rgba(18, 18, 18, 0.7), transparent 60%);
}
.hero-content { max-width: 560px; display: grid; gap: 14px; }
.hero-kicker { color: var(--accent-2); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.hero p { margin: 0; color: #dcdce2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Shelves ---------- */
.browse { padding-bottom: 48px; }
#shelves { display: grid; gap: 30px; padding-top: 18px; }
.shelf-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--gutter); margin-bottom: 12px; }
.shelf-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.shelf-head .btn { margin-left: auto; }
.shelf-row {
	list-style: none; margin: 0; padding: 4px var(--gutter) 10px; display: flex; gap: 14px;
	overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > li { flex: 0 0 auto; scroll-snap-align: start; }
.shelf-row.posters > li { width: clamp(124px, 13vw, 176px); }
.shelf-row.wide > li { width: clamp(220px, 24vw, 320px); }

.tile {
	display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
.tile .art {
	position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: translate 0.32s var(--spring), box-shadow 0.2s;
	border: 0.5px solid var(--glass-border);
}
@media (hover: hover) { .tile:hover .art { translate: 0 -4px; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5); } }
.tile:focus-visible .art { translate: 0 -4px; }
.tile:focus-visible { outline: none; }
.tile:focus-visible .art { outline: 3px solid var(--focus); outline-offset: 3px; }
.tile .art img { width: 100%; height: 100%; object-fit: cover; }
.tile.poster .art { aspect-ratio: 2 / 3; }
.tile.landscape .art { aspect-ratio: 16 / 9; }
.tile .placeholder {
	position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
	font-weight: 800; color: var(--muted); background: var(--glass-bg);
	-webkit-backdrop-filter: blur(8px) saturate(180%); backdrop-filter: blur(8px) saturate(180%);
}
.tile .label { margin-top: 8px; font-size: 14px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile .progress { position: absolute; left: 10px; right: 10px; bottom: 10px; }
.tile .fav-dot { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-bg); border: 0.5px solid var(--glass-border); color: var(--accent-2); font-size: 14px;
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); }
.progress { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Grid view ---------- */
.grid-view { padding: 22px var(--gutter) 48px; }
.grid-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.grid-head h2 { margin: 0; font-size: 24px; font-weight: 800; }
.poster-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* ---------- Live ---------- */
.live { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 62px); }
.live-rail {
	border-right: 0.5px solid var(--glass-border); padding: 16px 12px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
	background: rgba(36, 36, 36, 0.22); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
.live-rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.live-rail li button {
	width: 100%; text-align: left; border: 0; background: transparent; color: var(--muted); cursor: pointer;
	padding: 9px 12px; border-radius: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (hover: hover) { .live-rail li button:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); } }
.live-rail li button[aria-current="true"] { background: var(--glass-bg); color: var(--text); box-shadow: inset 0 0 0 0.5px var(--glass-border); }
.live-rail .rail-divider { height: 1px; background: var(--border); margin: 8px 6px; }
.live-rail .rail-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 12px 12px 4px; }
.rail-toggle { display: none; }
.live-list { padding: 18px var(--gutter) 48px 24px; }
.live-title { margin: 0 0 14px; font-size: 22px; font-weight: 800; }
.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.channel {
	width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 14px; cursor: pointer; text-align: left;
	background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); color: inherit;
	box-shadow: var(--glass-shadow); transition: background 0.15s, opacity 0.06s ease;
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
@media (hover: hover) { .channel:hover { background: rgba(69, 69, 69, 0.45); } }
.channel .logo { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: rgba(255, 255, 255, 0.06); flex-shrink: 0; padding: 4px; }
.channel .logo-fallback { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); font-weight: 800; color: var(--muted); }
.channel .info { min-width: 0; flex: 1; }
.channel .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel .tags { display: flex; gap: 6px; margin-top: 3px; }
.tag { font-size: 11px; font-weight: 800; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }
.tag.accent { color: var(--accent-2); border-color: rgba(255, 90, 54, 0.45); }
.channel .star { color: var(--accent-2); }

/* ---------- Sheets (details, settings) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px 16px; }
.sheet-backdrop {
	position: absolute; inset: 0; background: rgba(149, 149, 149, 0.1);
	-webkit-backdrop-filter: blur(12px) saturate(150%); backdrop-filter: blur(12px) saturate(150%);
}
.sheet-card {
	position: relative; width: min(860px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
	background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 22px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
	-webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%);
}
.sheet-close {
	position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); font-size: 22px; line-height: 1;
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
.details-art { aspect-ratio: 16 / 7; background: var(--surface) center 25% / cover no-repeat; position: relative; }
.details-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--glass-strong), transparent 70%); }
.details-body { padding: 0 28px 28px; margin-top: -60px; position: relative; display: grid; gap: 12px; }
.details-body h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.details-body p { margin: 0; }
.details-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.details-plot { color: #dcdce2; max-width: 70ch; }
.season-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 12px; }
.season-tabs button { border: 0.5px solid var(--glass-border); padding: 7px 14px; border-radius: 999px; cursor: pointer; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-weight: 700; }
.season-tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.episode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.episode {
	width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-align: left; cursor: pointer;
	padding: 12px 14px; border-radius: var(--radius); border: 0.5px solid var(--glass-border); background: rgba(255, 255, 255, 0.04); color: inherit;
	transition: background 0.15s, opacity 0.06s ease;
}
@media (hover: hover) { .episode:hover { background: rgba(255, 255, 255, 0.08); } }
.episode .num { font-weight: 800; color: var(--muted); font-size: 18px; }
.episode .ep-title { font-weight: 700; }
.episode .progress { margin-top: 6px; }

.settings-card { width: min(620px, 100%); padding: 28px; display: grid; gap: 6px; }
.settings-card h2 { margin: 0; font-size: 26px; font-weight: 800; }
.settings-section { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 14px; display: grid; gap: 12px; }
.section-head { display: flex; align-items: center; gap: 12px; }
.section-head h3 { margin: 0; font-size: 18px; }
.section-head .btn { margin-left: auto; }
.settings-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.settings-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.04); border: 0.5px solid var(--glass-border); }
.settings-list .grow { flex: 1; min-width: 0; }
.settings-list .title { font-weight: 700; }
.settings-list .detail { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-form { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.source-form h4 { margin: 0; }
.form-actions { display: flex; gap: 8px; }
.settings-footer { display: flex; gap: 10px; flex-wrap: wrap; }
.settings-footer .danger { margin-left: auto; }

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; }
.player-bar {
	display: flex; align-items: center; gap: 12px; padding: 10px 16px;
	background: rgba(28, 28, 28, 0.5); border-bottom: 0.5px solid var(--glass-border);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.player-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.player-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
.player-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
#player-fav[aria-pressed="true"] { color: var(--accent-2); }
.player-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.player video { flex: 1; width: 100%; min-height: 0; background: #000; }
.catchup-panel {
	width: 340px; max-width: 85vw; overflow-y: auto; padding: 16px 12px;
	background: var(--glass-bg); border-left: 0.5px solid var(--glass-border);
	-webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
}
.catchup-panel h3 { margin: 0 0 6px; }
.catchup-panel ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.catchup-panel button { width: 100%; text-align: left; display: grid; gap: 2px; background: transparent; border: 0; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: inherit; }
.catchup-panel button:hover { background: var(--surface); }
.catchup-panel .day { font-size: 12px; color: var(--muted); padding: 12px 10px 2px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.resume-prompt, .player-error {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0;
	max-width: min(460px, calc(100% - 32px)); padding: 22px; border-radius: 18px; text-align: center;
	background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
	-webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%);
}
.resume-prompt { display: grid; gap: 10px; min-width: 280px; }
.resume-prompt p { margin: 0 0 4px; font-weight: 800; font-size: 18px; }

.toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
	padding: 14px 22px; border-radius: 22px; background: var(--glass-bg); border: 1px solid var(--glass-border);
	box-shadow: var(--glass-shadow); font-weight: 700;
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
	.topbar { flex-wrap: wrap; gap: 10px 14px; }
	.topbar-right { margin-left: auto; }
	/* Logo + search/avatar fill the first line, so the tabs wrap to their own line, centred at their own width. */
	.topbar-right { flex: 1 1 auto; justify-content: flex-end; }
	.tabs { order: 3; width: max-content; margin: 0 auto; }
	.search input { width: 150px; }
	.live { grid-template-columns: 1fr; }
	.live-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px var(--gutter); }
	.live-rail:not(.open) ul { display: none; }
	.rail-toggle { display: inline-flex; width: 100%; justify-content: flex-start; }
	.live-list { padding: 16px var(--gutter) 40px; }
	.channels { grid-template-columns: 1fr; }
	.field-row { grid-template-columns: 1fr; }
	.details-body { padding: 0 18px 22px; }
	.player-bar { flex-wrap: wrap; }
	.catchup-panel { position: absolute; right: 0; top: 0; bottom: 0; }
}
@media (max-width: 480px) {
	.logo-word { display: none; }
	.search input { width: 120px; }
	.poster-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 16px 10px; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
	.seg-pill.moving { animation: none; }
}

/* ---------- Guided setup ---------- */
.setup-card { max-width: 600px; gap: 20px; }
/* Grid and flex children default to min-width:auto, which lets long commands stretch the whole card. */
.auth-card > *, .setup-steps, .setup-step, .step-row > div, .step-body, .relay-instructions, .relay-instructions li, .code-line { min-width: 0; }
.code-line .btn { flex-shrink: 0; }
.setup-head { display: grid; gap: 8px; }
.setup-progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.setup-progress > span {
	display: block; height: 100%; width: 0; border-radius: 999px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	transition: width 0.6s var(--spring);
}
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setup-step {
	border-radius: 16px; padding: 14px 16px; border: 0.5px solid var(--glass-border);
	background: rgba(255, 255, 255, 0.03); transition: background 0.2s;
}
.setup-step.current { background: rgba(255, 255, 255, 0.06); }
.step-row { display: flex; gap: 14px; align-items: flex-start; }
.step-row h2 { margin: 0; font-size: 17px; font-weight: 800; }
.step-row p { margin: 2px 0 0; }
.step-dot {
	flex-shrink: 0; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
	display: grid; place-items: center; font-size: 13px; font-weight: 800;
	border: 2px solid var(--border-2); color: var(--muted);
}
.setup-step.done .step-dot { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.setup-step.done .step-dot::before { content: "checkmark"; font-family: "Framework7 Icons"; font-feature-settings: "liga"; }
.setup-step.current .step-dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 37, 43, 0.18); }
.setup-step.skipped .step-dot::before { content: "minus"; font-family: "Framework7 Icons"; font-feature-settings: "liga"; }
.setup-step:not(.current) .step-body { display: none; }
.step-body { display: grid; gap: 14px; margin: 14px 0 2px 40px; }
.seg-lite { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 0.5px solid var(--glass-border); width: max-content; }
.seg-lite button { border: 0; background: transparent; color: var(--muted); font-weight: 700; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg-lite button[aria-pressed="true"] { background: var(--glass-bg); color: var(--text); box-shadow: inset 0 0 0 0.5px var(--glass-border); }
.relay-instructions { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.relay-instructions p { margin: 0 0 6px; }
.code-line { display: flex; gap: 8px; align-items: flex-start; }
.code-line code {
	flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere;
	font: 12.5px/1.5 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
	background: rgba(10, 10, 12, 0.4); border: 0.5px solid var(--glass-border); color: #e8e8ec;
}
.relay-live { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.relay-live.ok { color: #6ee7b7; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; animation: pulse 1.4s ease-in-out infinite; }
.relay-live.ok .pulse { background: #34d399; animation: none; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (max-width: 560px) { .step-body { margin-left: 0; } .code-line { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Source type choice (setup step 3) */
.source-types { display: grid; gap: 8px; }
.source-type {
	display: grid; gap: 2px; text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 14px;
	background: rgba(255, 255, 255, 0.04); border: 0.5px solid var(--glass-border); color: inherit;
	transition: background 0.15s, opacity 0.06s ease;
}
@media (hover: hover) { .source-type:not(:disabled):hover { background: rgba(255, 255, 255, 0.08); } }
.source-type:active { opacity: 0.6; }
.source-type[aria-pressed="true"] { background: var(--glass-bg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.source-type:disabled { opacity: 0.45; cursor: default; }
.source-form-inline { display: grid; gap: 14px; }
.empty-state { margin: 12vh auto; max-width: 420px; text-align: center; display: grid; gap: 12px; justify-items: center; padding: 0 16px; }
.empty-state h2 { margin: 0; font-size: 24px; font-weight: 800; }
.empty-state p { margin: 0; }

/* Going back to a finished setup step */
.setup-step.reopenable .step-row { cursor: pointer; }
@media (hover: hover) { .setup-step.reopenable:hover { background: rgba(255, 255, 255, 0.06); } }
.setup-step.reopenable .step-row h2::after { content: "  \2192  Show again"; font-size: 13px; font-weight: 700; color: var(--muted); }
.step-back { justify-self: start; padding-left: 0; }

/* Relay step failed while connecting the source */
.setup-step.failed { border-color: rgba(255, 107, 125, 0.45); background: rgba(255, 107, 125, 0.06); }
.setup-step.failed .step-dot { border-color: transparent; background: var(--danger); color: #fff; }
.relay-error {
	margin: 0; padding: 10px 12px; border-radius: 12px; font-weight: 700;
	background: rgba(255, 107, 125, 0.12); border: 0.5px solid rgba(255, 107, 125, 0.4); color: #ffc2cb;
}

/* Settings sheet: let everything shrink to the sheet's width (grid/flex children default to min-width:auto). */
.settings-card > *, .settings-section, .section-head, .settings-list, .settings-list li, .settings-list .grow, .source-form, .source-form > * { min-width: 0; }
.section-head h3 { flex: 1; min-width: 0; }
.section-head .btn { margin-left: 0; flex-shrink: 0; }
#relay-status, .settings-list .detail { overflow-wrap: anywhere; }
.settings-list .detail { white-space: normal; }
@media (max-width: 560px) {
	.sheet { padding: 12px 10px; }
	.settings-card { padding: 22px 18px; }
	.settings-list li { flex-wrap: wrap; row-gap: 8px; }
	.settings-list li .grow { flex: 1 1 100%; }
	.settings-footer .danger { margin-left: 0; }
}

/* Shelves: a grid track defaults to its content's width, so one long row widened the whole page.
   minmax(0, 1fr) keeps each row at page width and lets it scroll horizontally inside itself. */
#shelves { grid-template-columns: minmax(0, 1fr); }
.shelf, .shelf-head, .shelf-row, .browse, .grid-view, .live-list, .content { min-width: 0; }
html, body { overflow-x: clip; }

/* Hero as an inset card (same rounded, edged language as the tiles), not an edge-to-edge band. */
.hero {
	margin: 16px var(--gutter) 0; border-radius: 22px; overflow: hidden;
	padding: 48px clamp(20px, 4vw, 44px) 36px; min-height: min(56vh, 520px);
	border: 0.5px solid var(--glass-border); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}
.hero::after {
	background:
		linear-gradient(to top, rgba(18, 18, 18, 0.92) 4%, rgba(18, 18, 18, 0.45) 45%, rgba(18, 18, 18, 0.05) 80%),
		linear-gradient(to right, rgba(18, 18, 18, 0.6), transparent 65%);
}
@media (max-width: 560px) {
	.hero { margin-top: 12px; padding: 28px 20px 22px; min-height: 420px; }
}

/* Top bar: no divider line; the glass tint alone separates it from the content. */
.topbar { border-bottom: 0; }

/* Posters sit ABOVE their placeholder, so a loaded image shows even if the browser never fires its load
   event (iOS Safari can skip it for images it already had cached), instead of staying hidden under it. */
.tile .art img { position: absolute; inset: 0; z-index: 1; }
.tile .art .placeholder { z-index: 0; }
.tile .art .fav-dot, .tile .art .progress { z-index: 2; }

/* Version chooser */
.chooser-card { width: min(520px, 100%); padding: 26px 22px 22px; display: grid; gap: 6px; }
.chooser-card h2 { margin: 0; font-size: 22px; font-weight: 800; padding-right: 44px; }
.chooser-card > * { min-width: 0; }
.chooser-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.chooser-option {
	width: 100%; display: grid; gap: 6px; text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 14px;
	background: rgba(255, 255, 255, 0.04); border: 0.5px solid var(--glass-border); color: inherit; min-width: 0;
	transition: background 0.15s, opacity 0.06s ease;
}
@media (hover: hover) { .chooser-option:hover { background: rgba(255, 255, 255, 0.09); } }
.chooser-option:active { opacity: 0.6; }
.chooser-option strong { overflow-wrap: anywhere; }
.chooser-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chooser-option .progress { margin-top: 2px; }

/* Search results grouped by type */
.search-group .shelf-head { align-items: center; }
.search-channels { padding: 0 var(--gutter); }

/* ---------- Header icon button (phones) ---------- */
.icon-btn {
	display: none; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; cursor: pointer; place-items: center;
	color: var(--text); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
	transition: opacity 0.06s ease;
}
.icon-btn:active { opacity: 0.6; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .icon-close { display: none; }
.topbar.searching .icon-btn .icon-search { display: none; }
.topbar.searching .icon-btn .icon-close { display: block; }

/* Phones: one row — logo (opens Settings) · tabs · magnifier. Search replaces the tabs while open. */
@media (max-width: 820px) {
	.topbar { flex-wrap: nowrap; gap: 10px; }
	.tabs { order: 0; margin: 0 auto; }
	.topbar-right { flex: 0 0 auto; margin-left: 0; }
	.avatar, .search { display: none; }
	.icon-btn { display: grid; }
	.topbar.searching .tabs { display: none; }
	.topbar.searching .topbar-right { flex: 1 1 auto; }
	.topbar.searching .search { display: block; flex: 1 1 auto; min-width: 0; }
	.topbar.searching .search input { width: 100%; }
	#source-picker { display: none; }
}
@media (max-width: 380px) {
	.tabs button { padding: 7px 12px; }
}

/* ---------- iPhone safe areas ----------
   The installed app draws under a translucent status bar (and above the home indicator), so anything
   touching the top or bottom edge reserves that space. env() is 0 everywhere else, so desktop is unchanged. */
.topbar { padding-top: calc(12px + env(safe-area-inset-top)); padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.auth { padding-top: calc(32px + env(safe-area-inset-top)); padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.player-bar { padding-top: calc(10px + env(safe-area-inset-top)); }
.player-stage { padding-bottom: env(safe-area-inset-bottom); }
.sheet { padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sheet-card { max-height: calc(100vh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
.browse, .grid-view, .live-list { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
@media (max-width: 560px) {
	.sheet { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* Source forms show only the fields for the chosen type. */
form[data-kind="chilllink"] [data-kind="xtream"],
form[data-kind="xtream"] [data-kind="chilllink"],
form:not([data-kind]) [data-kind="chilllink"] { display: none !important; }

/* ChillLink sources have no live TV. */
body.source-clp .tabs [data-section="live"] { display: none; }

/* iOS Safari zooms the page when a text field under 16px gets focus. Keep fields at 16px on touch screens
   instead of disabling zoom (which would also block pinch-zoom for people who need it). */
@media (pointer: coarse) {
	input, select, textarea { font-size: 16px !important; }
}

/* ---------- Full-screen details page (movies & shows) ---------- */
#details { padding: 0; place-items: stretch; }
#details .sheet-backdrop { display: none; }
#details .sheet-card {
	width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0;
	background: var(--bg); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
	overflow-y: auto; overscroll-behavior: contain;
}
#details .details-art { aspect-ratio: auto; height: min(62vh, 640px); background-position: center 20%; }
#details .details-art::after { background: linear-gradient(to top, var(--bg) 2%, rgba(20, 20, 20, 0.35) 45%, rgba(20, 20, 20, 0) 75%); }
#details .details-body { max-width: 1100px; margin: -120px auto 0; padding: 0 var(--gutter) calc(48px + env(safe-area-inset-bottom)); gap: 14px; }
#details .details-body h2 { font-size: clamp(30px, 5vw, 54px); }
#details .sheet-close { position: fixed; top: calc(16px + env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 44px; height: 44px; }
@media (max-width: 560px) {
	#details .details-art { height: 46vh; }
	#details .details-body { margin-top: -80px; }
}

/* ---------- Phone search: grows out of the magnifier instead of popping in ----------
   Geometry (width) rides the spring; opacity uses a plain fast ease (Liquid Glass rule 5). The tabs stay in
   the layout and fade/shrink with `scale` (not transform, rule 6) so nothing jumps. */
@media (max-width: 820px) {
	.topbar .search {
		display: block !important; position: absolute; z-index: 3;
		right: calc(max(var(--gutter), env(safe-area-inset-right)) + 50px);
		top: calc(12px + env(safe-area-inset-top)); height: 46px;
		width: 40px; opacity: 0; pointer-events: none;
		transition: width 0.42s var(--spring), opacity 0.18s ease;
	}
	.topbar .search input { width: 100%; height: 100%; }
	.topbar.searching .search {
		width: calc(100% - max(var(--gutter), env(safe-area-inset-left)) - max(var(--gutter), env(safe-area-inset-right)) - 30px - 10px - 50px - 10px);
		opacity: 1; pointer-events: auto;
	}
	.topbar .tabs { transition: opacity 0.18s ease, scale 0.32s var(--spring); }
	.topbar.searching .tabs { display: flex !important; opacity: 0; scale: 0.92; pointer-events: none; }
	.topbar.searching .topbar-right { flex: 0 0 auto; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
	.topbar .search, .topbar .tabs { transition: none; }
}

/* Text fields: no red ring while typing; a slightly brighter glass edge shows focus instead. */
.search input:focus, .search input:focus-visible { border-color: rgba(255, 255, 255, 0.32); outline: none; }
.field input:focus, .field input:focus-visible, select:focus-visible { border-color: rgba(255, 255, 255, 0.32); outline: none; }



/* Full-screen player: video fills the screen; Couch's bar floats over it instead of taking space. */
.player:fullscreen { background: #000; }
.player:fullscreen .player-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent); border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.player:fullscreen .player-stage { position: absolute; inset: 0; }

/* Installed iPhone app: iOS fades the area just below the status bar, which the page can't paint over, so
   everything that touches the top starts below that fade. Browsers and desktop are unchanged. */
@media (display-mode: standalone) {
	:root { --ios-fade: 20px; }
	.topbar { padding-top: calc(12px + env(safe-area-inset-top) + var(--ios-fade)); }
	.auth { padding-top: calc(32px + env(safe-area-inset-top) + var(--ios-fade)); }
	.player-bar { padding-top: calc(10px + env(safe-area-inset-top) + var(--ios-fade)); }
	.sheet { padding-top: calc(24px + env(safe-area-inset-top) + var(--ios-fade)); }
	#details .sheet-close { top: calc(16px + env(safe-area-inset-top) + var(--ios-fade)); }
	@media (max-width: 820px) {
		.topbar .search { top: calc(12px + env(safe-area-inset-top) + var(--ios-fade)); }
	}
	@media (max-width: 560px) {
		.sheet { padding-top: calc(12px + env(safe-area-inset-top) + var(--ios-fade)); }
	}
}

/* ---------- Starting playback ---------- */
.spinner {
	display: inline-block; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
	border: 2.5px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.8s linear infinite;
}
.spinner.large { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { rotate: 360deg; } }
.details-starting { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; }
.player-starting { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; overflow: hidden; background: #000; }
.player-starting-art { position: absolute; inset: -10%; background: center / cover no-repeat; filter: blur(40px) saturate(150%) brightness(0.55); }
.player-starting-inner { position: relative; display: grid; justify-items: center; gap: 10px; padding: 0 24px; text-align: center; }
.player-starting-inner strong { font-size: clamp(20px, 4vw, 30px); font-weight: 800; }
/* iPhone from a details page: Couch's player stays out of sight; Apple's full-screen player opens over the page. */
.player.behind-details { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* Loading bar for starting playback (replaces the spinners). Width rides the spring; the shimmer is opacity-free. */
.start-bar { position: relative; display: block; width: 180px; height: 6px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.14); }
.start-bar.wide { width: min(320px, 70vw); }
.start-bar > span {
	position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	transition: width 0.6s var(--spring);
}
.start-bar > span::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
	translate: -100% 0; animation: start-shimmer 1.2s ease-in-out infinite;
}
@keyframes start-shimmer { to { translate: 100% 0; } }
.details-starting { display: grid; gap: 6px; justify-items: start; }
@media (prefers-reduced-motion: reduce) { .start-bar > span { transition: none; } .start-bar > span::after { animation: none; } }

/* ---------- Rich details sections ---------- */
.details-extra { display: grid; gap: 26px; margin-top: 10px; min-width: 0; }
.details-extra > * { min-width: 0; }
.details-tagline { margin: 0; font-style: italic; color: var(--muted); font-size: 17px; }
.extra-section { display: grid; gap: 12px; min-width: 0; }
.extra-section h3 { margin: 0; font-size: 19px; font-weight: 800; }
.rating-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rating-chip { display: inline-flex; align-items: baseline; gap: 2px; padding: 8px 14px; border-radius: 999px; background: var(--glass-bg); border: 0.5px solid var(--glass-border); }
.rating-chip strong { font-size: 18px; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.cast-row, .video-row { list-style: none; margin: 0; padding: 2px 0 8px; display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.cast-row::-webkit-scrollbar, .video-row::-webkit-scrollbar { display: none; }
.cast-card { flex: 0 0 96px; text-align: center; min-width: 0; }
.cast-face { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 6px; background: var(--surface-2); border: 0.5px solid var(--glass-border); }
.cast-initials { display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.cast-card .label, .video-tile .label { font-size: 13px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cast-card .sub, .video-tile .sub { font-size: 12px; color: var(--muted); }
.video-row > li { flex: 0 0 clamp(200px, 26vw, 280px); }
.video-tile { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.video-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--surface) center / cover no-repeat; border: 0.5px solid var(--glass-border); display: grid; place-items: center; }
.video-play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); font-size: 16px; padding-left: 3px; }
.video-tile:active, .cast-card:active { opacity: 0.6; }
.similar-row { padding-left: 0; padding-right: 0; }
.similar-row > li { width: clamp(118px, 13vw, 160px); }
/* Trailer sheet */
.trailer-card { width: min(960px, 100%); padding: 0; overflow: hidden; background: #000; }
.trailer-frame { aspect-ratio: 16 / 9; width: 100%; }
.trailer-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
#trailer { z-index: 25; }

/* Backdrop reaches every edge in the installed iPhone app, including under the home indicator (the
   "safe area"), and the page base matches it so no strip of a different colour can show. */
/* On the body (not html): the browser then paints it as the whole canvas, edge to edge and behind the
   backdrop. A background on html would make the body paint its own solid box over the backdrop instead. */
body { background: linear-gradient(160deg, #2a2a2a 0%, #141414 48%, #241018 100%) #141414; }
.ambient {
	top: calc(-1 * env(safe-area-inset-top)); bottom: calc(-1 * env(safe-area-inset-bottom));
	left: calc(-1 * env(safe-area-inset-left)); right: calc(-1 * env(safe-area-inset-right));
	min-height: 100lvh;
}

/* ---------- Details header (under the artwork): logo, year • length, Rating / Genre / Origin, big Play ---------- */
#details .details-body { justify-items: center; text-align: center; }
#details .details-plot, #details .details-extra, #details #details-episodes, #details .details-starting { justify-self: stretch; text-align: left; }
.details-logo { display: block; max-width: min(340px, 72vw); max-height: 130px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); }
.details-meta { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.details-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(520px, 100%); margin: 10px 0 4px; }
.info-col { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.info-label { font-size: 14px; color: var(--muted); }
.info-value { font-size: 26px; font-weight: 800; line-height: 1.1; color: #e8e8ec; min-height: 34px; display: grid; place-items: center; }
.info-value svg { width: 34px; height: 34px; }
.info-sub { font-size: 14px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#details .details-actions { justify-content: center; width: min(420px, 100%); }
#details .details-actions .btn.primary {
	flex: 1 1 100%; padding: 15px 22px; font-size: 20px; border-radius: 999px; color: #fff;
	background: linear-gradient(rgba(232, 37, 43, 0.32), rgba(232, 37, 43, 0.2));
	border: 1px solid rgba(255, 255, 255, 0.26); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.details-play-sub { margin: -2px 0 0; font-size: 15px; }
@media (max-width: 560px) {
	.info-value { font-size: 22px; }
	.info-label, .info-sub { font-size: 13px; }
}

.chooser-looking { padding: 10px 4px; }
.chooser-looking:empty { display: none; }

/* =====================================================================================================
   Liquid Glass audit: every control that floats over content gets the material; nested surfaces use the
   lighter 8px blur; press = dim; hover only with a mouse; touch targets at least 44 px (Apple HIG).
   ===================================================================================================== */
:root { --text3: #989898; --purple: var(--accent-2); --border2: var(--border-2); }

/* Shared nested-glass surface (inside an already-glass sheet or over the backdrop). */
.chooser-option, .settings-list li, .source-type, .episode, .catchup-panel button, .rating-chip {
	background: rgba(255, 255, 255, 0.06); border: 0.5px solid var(--glass-border);
	-webkit-backdrop-filter: blur(8px) saturate(180%); backdrop-filter: blur(8px) saturate(180%);
}
@media (hover: hover) {
	.chooser-option:hover, .source-type:not(:disabled):hover, .episode:hover, .catchup-panel button:hover { background: rgba(255, 255, 255, 0.11); }
}
.chooser-option:active, .source-type:active, .episode:active, .catchup-panel button:active, .settings-list button:active,
.live-rail li button:active, .season-tabs button:active, .seg-lite button:active, .link:active, .avatar:active, .glass-circle:active,
.glass-pill-group button:active, .cast-card:active, .glass-sel-btn:active { opacity: 0.6; transition: opacity 0.06s ease; }

/* Text fields: inset glass. */
.field input, .search input {
	background: rgba(255, 255, 255, 0.07); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
	-webkit-backdrop-filter: blur(8px) saturate(180%); backdrop-filter: blur(8px) saturate(180%);
}

/* Glass select (replaces native dropdowns, which can't take the material). */
.glass-sel-btn {
	display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
	text-align: left; color: var(--text); font-weight: 600; background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
.glass-sel-btn .gsb-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glass-sel-btn .gsb-chev { color: var(--muted); font-size: 18px; line-height: 1; }

/* Liquid Glass pop-up menu (from the design system). */
.ai-assist-menu { position: fixed; z-index: 8000; box-sizing: border-box; }
.ai-assist-menu * { box-sizing: border-box; }
.ai-assist-menu.ios-menu {
	padding: 9px; min-width: 220px; border-radius: 26px; border: 1px solid var(--glass-border); background: rgba(34, 34, 34, 0.82);
	-webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); overflow: hidden; touch-action: none;
	transition: transform 0.13s ease-out;
	animation: ios-menu-in 0.22s var(--spring) backwards, ios-menu-fade 0.1s ease-out backwards;
}
.ai-assist-menu.ios-menu.ios-menu-out { animation: ios-menu-close 0.16s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes ios-menu-in { from { scale: 0.4; } to { scale: 1; } }
@keyframes ios-menu-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ios-menu-close { from { opacity: 1; scale: 1; } to { opacity: 0; scale: 0.4; } }
.ai-assist-menu.ios-menu .ai-assist-opt { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; font-size: 16px; border-radius: 16px; cursor: pointer; color: var(--text); }
.ai-assist-opt .ai-assist-opt-lbl { flex: 1; }
.ai-assist-opt.is-selected { font-weight: 700; }
.ai-opt-check { color: var(--accent-2); font-weight: 800; }
@media (hover: hover) { .ai-assist-menu.ios-menu .ai-assist-opt:hover { background: rgba(127, 127, 127, 0.15); } }
.ai-assist-opt.kbd-hl { background: rgba(127, 127, 127, 0.2); }
.ai-assist-menu.ios-menu .ios-hl {
	position: absolute; border-radius: 999px; background: rgba(127, 127, 127, 0.2); opacity: 0; pointer-events: none; z-index: 0;
	will-change: transform; transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.12s ease;
}
@media (prefers-reduced-motion: reduce) { .ai-assist-menu.ios-menu, .ai-assist-menu.ios-menu.ios-menu-out { animation: none; } }

/* Segmented controls with the sliding glass pill: season tabs, show versions, OS picker. */
.season-tabs, .seg-lite {
	position: relative; display: inline-flex; flex-wrap: nowrap; gap: 3px; padding: 4px; border-radius: 999px; max-width: 100%;
	overflow-x: auto; scrollbar-width: none; background: rgba(255, 255, 255, 0.06); border: 0.5px solid var(--glass-border);
}
.season-tabs::-webkit-scrollbar { display: none; }
.season-tabs button, .seg-lite button {
	position: relative; z-index: 1; flex-shrink: 0; min-height: 36px; border: 0; padding: 7px 14px; border-radius: 999px; cursor: pointer;
	background: transparent !important; color: var(--muted) !important; font-weight: 700; white-space: nowrap; box-shadow: none !important;
}
.season-tabs button[aria-pressed="true"], .seg-lite button[aria-pressed="true"] { color: var(--text) !important; }
.version-tabs > .muted { align-self: center; padding: 0 6px 0 8px; }
.season-tabs .seg-pill, .seg-lite .seg-pill { background: rgba(255, 255, 255, 0.14); }

/* Player chrome over the video: glass pills, not flat text. */
.player-actions .btn.ghost, .player-bar > .btn.ghost {
	background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); box-shadow: var(--glass-shadow);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
/* Small text actions get glass chrome too ("See all", rail toggle). */
.shelf-head .btn.ghost, .rail-toggle, .grid-head .btn.ghost {
	background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}

/* Touch targets (Apple HIG: 44 pt). */
@media (pointer: coarse) {
	.btn, .btn.small, .tabs button, .icon-btn, .avatar, .sheet-close, .glass-circle, .glass-pill-group button, .live-rail li button { min-height: 44px; }
	.icon-btn, .avatar, .sheet-close { min-width: 44px; }
}

/* ---------- Details page, tuned to a native iOS media page's scale ---------- */
.details-topbar {
	position: fixed; z-index: 3; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top));
	display: flex; justify-content: space-between; align-items: center; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
	pointer-events: none;
}
@media (display-mode: standalone) { .details-topbar { top: calc(14px + env(safe-area-inset-top) + var(--ios-fade, 0px)); } }
.details-topbar > * { pointer-events: auto; }
.glass-circle, .glass-pill-group {
	background: rgba(40, 40, 46, 0.32); border: 1px solid rgba(255, 255, 255, 0.24); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); color: #fff;
}
.glass-circle { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; }
.glass-pill-group { display: flex; border-radius: 999px; padding: 0 4px; }
.glass-pill-group button { width: 46px; height: 46px; display: grid; place-items: center; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.glass-pill-group button[hidden] { display: none; }
.glass-circle svg, .glass-pill-group svg { width: 22px; height: 22px; }
#details-fav[aria-pressed="true"] .heart { fill: var(--accent); stroke: var(--accent); }
#details .sheet-close { display: none; }

#details .details-art { height: min(56vh, 600px); }
#details .details-body { margin-top: calc(-1 * min(26vh, 260px)); gap: 10px; }
.details-logo { max-width: min(46vw, 300px); max-height: 74px; }
#details .details-body h2 { font-size: clamp(26px, 6vw, 40px); }
.details-meta { font-size: 15px; font-weight: 600; }
.details-info { width: min(400px, 100%); gap: 8px; margin: 8px 0 2px; }
.info-label { font-size: 13px; }
.info-value { font-size: 19px; min-height: 26px; }
.info-value svg { width: 24px; height: 24px; }
.info-sub { font-size: 13px; }
#details .details-actions { width: min(300px, 62%); margin-top: 4px; }
#details .details-actions .btn.primary {
	padding: 11px 18px; font-size: 18px; font-weight: 700;
	background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(232, 37, 43, 0.14));
	border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
#details .details-actions .btn:not(.primary) { font-size: 14px; padding: 8px 14px; }
.details-play-sub { font-size: 13px; margin-top: -4px; }
#details .details-starting { justify-self: center; justify-items: center; text-align: center; margin-top: 2px; }
#details .details-plot {
	font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--text); margin-top: 10px; cursor: pointer;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#details .details-plot.expanded { -webkit-line-clamp: unset; display: block; }
.extra-section h3 { font-size: 20px; color: rgba(244, 244, 246, 0.72); }
.details-tagline { font-size: 15px; }
@media (max-width: 560px) {
	#details .details-art { height: 58vh; }
	#details .details-body { margin-top: -28vh; }
	.info-value { font-size: 18px; }
	.video-row > li { flex-basis: 64vw; }
}

/* Backdrop always reaches the bottom, even when iOS reports a short viewport on first launch. */
.ambient { min-height: max(100lvh, calc(var(--screen-h, 0px) + env(safe-area-inset-top) + env(safe-area-inset-bottom))); }
body { min-height: max(100lvh, var(--screen-h, 0px)); }
/* No rubber-band past the top or bottom: the backdrop stays put and nothing shows behind it. */
html, body { overscroll-behavior: none; }
#details .details-ready { justify-self: center; width: min(300px, 62%); margin-top: 2px; }
#details-ready[hidden], .details-topbar [hidden] { display: none; }
#details-starting:not([hidden]) ~ #details-play-sub, #details-ready:not([hidden]) ~ #details-play-sub { display: none; }
#details-actions:has(+ #details-starting:not([hidden])) .btn.primary { opacity: 0.55; }

/* ---------- Cast member page ---------- */
.cast-card-btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.cast-card-btn:active { opacity: 0.6; transition: opacity 0.06s ease; }
#person { z-index: 24; padding: 0; place-items: stretch; }
#person .person-card {
	width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0; box-shadow: none; overflow-y: auto; overscroll-behavior: contain;
	padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	background: rgba(20, 20, 20, 0.5); -webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%);
	display: grid; align-content: start; gap: 16px;
}
@media (display-mode: standalone) { #person .person-card { padding-top: calc(14px + env(safe-area-inset-top) + var(--ios-fade, 0px)); } }
.person-topbar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; gap: 10px; }
.person-title { margin: 0; text-align: center; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-head { display: grid; justify-items: center; text-align: center; gap: 8px; max-width: 720px; justify-self: center; width: 100%; }
.person-face .cast-face { width: 120px; height: 120px; margin: 0; font-size: 34px; }
.person-head p { margin: 0; }
.person-known:empty, #person-known:empty, #person-status:empty { display: none; }
.person-bio { font-size: 15px; line-height: 1.45; text-align: left; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.person-bio:empty { display: none; }
.person-bio.expanded { display: block; }
.person-filter { justify-self: center; }
.person-filter[hidden] { display: none; }
.person-grid { width: 100%; max-width: 1200px; justify-self: center; }
.cast-face.cast-initials { display: grid; place-items: center; font-weight: 800; color: var(--muted); }
@media (max-width: 560px) { .person-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; } }

/* ---------- Pop-up sheets (source picker, settings, resume): Liquid Glass panels ---------- */
.sheet:not(#details):not(#person):not(#trailer) .sheet-card {
	background: rgba(36, 36, 36, 0.52); border: 1px solid rgba(255, 255, 255, 0.18);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
	-webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%); border-radius: 28px;
}
.sheet:not(#details) .sheet-close {
	background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
.chooser-option { background: rgba(255, 255, 255, 0.08); border: 0.5px solid rgba(255, 255, 255, 0.2); border-radius: 16px; }
.chooser-tags .tag { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }
.person-filter { overflow: visible; min-height: 46px; }

/* Backdrop already blurred in a canvas (see preblur in app.js): no live filter for iOS to drop. */
.ambient-layer.preblurred { filter: none; inset: -4%; }

/* No added colour: plain dark base, and only the poster backdrop gives the page colour. */
body { background: #111111; }
.ambient { background: #111111; }
.ambient::after { background: linear-gradient(to bottom, rgba(17, 17, 17, 0.1), rgba(17, 17, 17, 0.45)); }

/* ---------- Seasons: glass picker, then the season's episodes as a vertical list of cards ---------- */
.season-picker {
	display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 18px; border-radius: 999px; cursor: pointer;
	font: inherit; font-size: 18px; font-weight: 700; color: var(--text);
	background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
.season-picker .chev { font-size: 20px; line-height: 1; margin-top: -6px; }
.season-picker:active, .ep-card:active { opacity: 0.6; transition: opacity 0.06s ease; }
.ep-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.ep-card {
	display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 14px; align-items: center; width: 100%;
	padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.ep-thumb {
	position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
	background: rgba(255, 255, 255, 0.07); border: 0.5px solid var(--glass-border);
}
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-check {
	position: absolute; right: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
	font-size: 13px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.25); border: 1px solid rgba(255, 255, 255, 0.4);
	-webkit-backdrop-filter: blur(8px) saturate(180%); backdrop-filter: blur(8px) saturate(180%);
}
.ep-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.ep-progress > span { display: block; height: 100%; background: var(--accent); }
.ep-text { display: grid; gap: 4px; min-width: 0; }
.ep-card .ep-title { font-size: 17px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) { .ep-card:hover .ep-thumb { border-color: rgba(255, 255, 255, 0.4); } }
@media (min-width: 900px) { .ep-card { grid-template-columns: 260px minmax(0, 1fr); } }

/* Long menus (16 seasons) scroll inside the panel instead of running off screen. */
.ai-assist-menu.ios-menu.ios-scroll { max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }

/* Backdrop poster at its natural fit: no overscan zoom. */
.ambient-layer, .ambient-layer.preblurred { inset: 0; background-position: center top; }

/* At the very top nothing tints or blurs behind the top bar; scrolling brings the glass in. */
.topbar { transition: background-color 0.25s ease, -webkit-backdrop-filter 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease; }
.topbar:not(.scrolled) { background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ---------- "Select Stream" picker: a tall glass sheet from the bottom, grouped by source ---------- */
#chooser { place-items: end center; padding: 0; }
#chooser .chooser-card {
	width: min(640px, 100%); height: calc(100% - env(safe-area-inset-top) - 14px); max-height: none; margin: 0;
	border-radius: 36px 36px 0 0; border-bottom: 0; overflow-y: auto; overscroll-behavior: contain;
	padding: 16px max(18px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
	display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-content: start; column-gap: 10px; row-gap: 0;
	animation: chooser-up 0.38s var(--spring) backwards;
}
@media (display-mode: standalone) { #chooser .chooser-card { height: calc(100% - env(safe-area-inset-top) - var(--ios-fade, 0px) - 6px); } }
@media (min-width: 700px) { #chooser { place-items: center; padding: 24px; } #chooser .chooser-card { height: auto; max-height: min(720px, 88vh); border-radius: 32px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); } }
@keyframes chooser-up { from { translate: 0 40px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #chooser .chooser-card { animation: none; } }
#chooser .sheet-close { position: static; grid-column: 1; grid-row: 1 / span 2; align-self: center; width: 46px; height: 46px; font-size: 26px; }
#chooser .chooser-card h2 { grid-column: 2; grid-row: 1; padding: 0; text-align: center; font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chooser #chooser-sub { grid-column: 2; grid-row: 2; margin: 2px 0 0; text-align: center; font-size: 17px; color: rgba(244, 244, 246, 0.72); }
#chooser .chooser-list { grid-column: 1 / -1; margin-top: 18px; gap: 10px; }
.chooser-group { font-size: 18px; font-weight: 800; color: rgba(244, 244, 246, 0.6); padding: 12px 2px 2px; }
.chooser-group:first-child { padding-top: 0; }
#chooser .chooser-option {
	display: grid; gap: 3px; width: 100%; text-align: left; padding: 13px 22px; border-radius: 999px; min-height: 56px; align-content: center;
	background: rgba(255, 255, 255, 0.1); border: 0.5px solid rgba(255, 255, 255, 0.18); color: var(--text);
	-webkit-backdrop-filter: blur(8px) saturate(180%); backdrop-filter: blur(8px) saturate(180%);
}
#chooser .chooser-option strong { font-size: 18px; font-weight: 700; }
.chooser-line { font-size: 13px; color: rgba(244, 244, 246, 0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chooser .chooser-option .progress { margin-top: 4px; }
#chooser .chooser-option:has(.progress) { border-radius: 24px; }
.chooser-looking { padding: 6px 4px; }

/* Backdrop: the plain poster (no blur, no zoom) with a dark gradient over it for legibility. */
.ambient-layer, .ambient-layer.preblurred { filter: none; inset: 0; background-size: cover; background-position: center top; }
.ambient::after {
	background: linear-gradient(to bottom, rgba(17, 17, 17, 0.45) 0%, rgba(17, 17, 17, 0.62) 40%, rgba(17, 17, 17, 0.9) 75%, #111111 100%);
}

/* Blur over the backdrop poster, faded in once content has loaded (a backdrop-filter layer: iOS keeps
   painting these, unlike a large filter: blur() on the image itself). */
.ambient-blur {
	position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease-out;
	-webkit-backdrop-filter: blur(40px) saturate(160%); backdrop-filter: blur(40px) saturate(160%);
}
.content-ready .ambient-blur { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ambient-blur { transition: none; } }

/* A little less blur on the loaded backdrop. */
.ambient-blur { -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); }
.ambient-blur { -webkit-backdrop-filter: blur(12px) saturate(150%); backdrop-filter: blur(12px) saturate(150%); }

/* Same blur from the start, loading included. */
.ambient-blur { opacity: 1; transition: none; }

/* Episodes: vertical cards (full-width still on top, title and details below), stacked down the page. */
.ep-card, .ep-card:is(*) { grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.ep-list { gap: 20px; }
@media (min-width: 900px) {
	.ep-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px 18px; }
	.ep-card { grid-template-columns: minmax(0, 1fr); }
}

/* Episodes: a horizontal carousel of cards (still on top, "N. Title" and year below), swiped sideways. */
.ep-list, .ep-list:is(*) {
	display: flex; grid-template-columns: none; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
	margin-left: calc(-1 * var(--gutter, 16px)); margin-right: calc(-1 * var(--gutter, 16px));
	padding-left: var(--gutter, 16px); padding-right: var(--gutter, 16px); scroll-padding-left: var(--gutter, 16px);
}
.ep-list::-webkit-scrollbar { display: none; }
.ep-list > li { flex: 0 0 min(66vw, 320px); scroll-snap-align: start; min-width: 0; }
.ep-list > li.muted, .ep-list > li.error { flex-basis: 100%; }

/* Carousel stays inside the page width (the grid column must not grow to fit it); smaller cards. */
#details .details-body { grid-template-columns: minmax(0, 1fr); }
#details #details-episodes { min-width: 0; max-width: 100%; width: 100%; }
.ep-list > li { flex: 0 0 min(52vw, 250px); }
.ep-card .ep-title { font-size: 15px; }
.ep-thumb { border-radius: 12px; }

/* Backdrop gradient in the poster's own colour (--tint, sampled in app.js) instead of neutral charcoal. */
:root { --tint: 18, 18, 18; }
.ambient::after {
	background: linear-gradient(to bottom, rgba(var(--tint), 0.45) 0%, rgba(var(--tint), 0.62) 40%, rgba(var(--tint), 0.9) 75%, rgb(var(--tint)) 100%);
	transition: background 0.6s ease;
}
body, .ambient { background-color: rgb(var(--tint)); }

/* Details page: its fade and page colour follow the title's sampled colour too. */
#details .details-art::after { background: linear-gradient(to top, rgb(var(--tint)) 2%, rgba(var(--tint), 0.4) 45%, rgba(var(--tint), 0) 75%); }
#details .sheet-card { background: rgb(var(--tint)); transition: background-color 0.6s ease; }

/* Details Play: clear Liquid Glass (no gradient). It shows the backdrop through it, blurred and saturated. */
#details .details-actions .btn.primary {
	background: rgba(255, 255, 255, 0.12); color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
@media (hover: hover) { #details .details-actions .btn.primary:hover { background: rgba(255, 255, 255, 0.18); } }

/* Loading screen: artwork fills the whole screen and the top bar floats over it, fully transparent. */
.player.starting .player-bar {
	position: absolute; top: 0; left: 0; right: 0; z-index: 3;
	background: transparent !important; border: 0 !important; box-shadow: none !important;
	-webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.player.starting .player-starting { position: fixed; inset: 0; z-index: 2; }

/* ---------- Header row: logo, tabs, magnifier and search field share one height and one glass ---------- */
:root { --bar-h: 53px; }
.topbar .logo-mark { width: var(--bar-h); height: var(--bar-h); border-radius: 15px; }
.topbar .tabs { min-height: var(--bar-h); box-sizing: border-box; }
#search-toggle, .topbar .search input {
	background: rgba(255, 255, 255, 0.06); border: 0.5px solid rgba(255, 255, 255, 0.2); box-shadow: none;
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
#search-toggle { width: var(--bar-h); height: var(--bar-h); min-width: var(--bar-h); border-radius: 50%; }
/* No band behind the header in any state: only the controls are glass (iOS's own status-bar fade stays). */
.topbar, .topbar.scrolled { background: transparent !important; box-shadow: none !important; border: 0 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* Phone search: faster, and it grows like liquid (width on the spring, a brief squash-and-settle via `scale`). */
@media (max-width: 820px) {
	.topbar .search {
		height: var(--bar-h); right: calc(max(var(--gutter), env(safe-area-inset-right)) + var(--bar-h) + 8px);
		transition: width 0.3s var(--spring), opacity 0.12s ease;
		transform-origin: right center;
	}
	.topbar .search input { border-radius: 999px; }
	.topbar.searching .search {
		width: calc(100% - max(var(--gutter), env(safe-area-inset-left)) - max(var(--gutter), env(safe-area-inset-right)) - var(--bar-h) - 8px - var(--bar-h) - 8px);
		animation: search-liquid 0.34s var(--spring);
	}
	.topbar .tabs { transition: opacity 0.12s ease, scale 0.24s var(--spring); }
}
@keyframes search-liquid { 0% { scale: 0.9 1.06; } 55% { scale: 1.02 0.98; } 100% { scale: 1 1; } }
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
	.topbar.searching .search { animation: none; }
}

/* ---------- Skeleton while the catalog loads: the page's shapes, with a soft shimmer sweeping across ---------- */
.skeleton { display: grid; gap: 26px; padding-top: 4px; }
.sk { background: rgba(255, 255, 255, 0.07); border-radius: 12px; position: relative; overflow: hidden; }
.sk::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.09) 45%, transparent 70%);
	translate: -100% 0; animation: sk-shimmer 1.4s ease-in-out infinite;
}
@keyframes sk-shimmer { to { translate: 100% 0; } }
.sk-hero { height: clamp(300px, 52vw, 460px); border-radius: 26px; }
.sk-shelf { display: grid; gap: 14px; }
.sk-title { width: 42%; max-width: 240px; height: 22px; border-radius: 8px; }
.sk-row { display: flex; gap: 14px; overflow: hidden; }
.sk-tile { flex: 0 0 clamp(118px, 31vw, 170px); display: grid; gap: 8px; }
.sk-poster { aspect-ratio: 2 / 3; border-radius: 16px; }
.sk-line { height: 13px; border-radius: 6px; width: 85%; }
.sk-line.short { width: 45%; }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* First-paint skeleton (before any script runs); gone as soon as a real view is shown. */
.boot-skeleton {
	position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none;
	padding: calc(12px + env(safe-area-inset-top)) max(var(--gutter, 16px), env(safe-area-inset-right)) 0 max(var(--gutter, 16px), env(safe-area-inset-left));
	display: grid; align-content: start; gap: 18px;
}
@media (display-mode: standalone) { .boot-skeleton { padding-top: calc(12px + env(safe-area-inset-top) + var(--ios-fade, 0px)); } }
.sk-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sk-logo { width: var(--bar-h, 53px); height: var(--bar-h, 53px); border-radius: 15px; }
.sk-tabs { width: min(260px, 58vw); height: var(--bar-h, 53px); border-radius: 999px; }
.sk-circle { width: var(--bar-h, 53px); height: var(--bar-h, 53px); border-radius: 50%; }
body:has(#app-view:not([hidden])) .boot-skeleton,
body:has(#auth-view:not([hidden])) .boot-skeleton,
body:has(#onboard-view:not([hidden])) .boot-skeleton { display: none; }

/* Skeleton built from the real layout classes: only the fill is different. */
.sk-t { pointer-events: none; }
.sk-t .art { background: rgba(255, 255, 255, 0.07); border-color: transparent; }
.sk-text { display: inline-block; vertical-align: middle; height: 0.85em; width: 80%; border-radius: 6px; }
.sk-text.short { width: 45%; }
.sk-text.title { width: 9em; height: 0.8em; }
.sk-shelf-real .shelf-head { min-height: 44px; }
.sk-shelf-real .shelf-row { overflow: hidden; }
#hero-skeleton { background: rgba(255, 255, 255, 0.07); box-shadow: none; }
#hero-skeleton[hidden] { display: none; }
.hero.sk::after { background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.09) 45%, transparent 70%); }

/* Header controls ~15% slimmer: 45 px instead of 53. */
:root { --bar-h: 45px; }
.topbar .logo-mark { border-radius: 13px; }
.topbar .tabs { padding: 3px; height: var(--bar-h); align-items: stretch; }
.topbar .tabs button { min-height: 0 !important; padding-top: 0; padding-bottom: 0; font-size: 15px; }
#search-toggle svg { width: 18px; height: 18px; }
.sk-pill { color: transparent !important; border-color: transparent !important; background: rgba(255, 255, 255, 0.07) !important; pointer-events: none; }
.sk-shelf-real .shelf-head { min-height: 0; }

/* Desktop header: search field and account button share the same 45 px height. */
.topbar .search input { height: var(--bar-h); box-sizing: border-box; }
.topbar .avatar { width: var(--bar-h); height: var(--bar-h); }

/* ---------- Logo menu (Liquid Glass) ---------- */
.app-menu {
	position: fixed; z-index: 40; width: min(300px, calc(100vw - 24px)); padding: 10px 8px; border-radius: 30px;
	background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 22px 54px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
	-webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
	animation: ios-menu-in 0.26s var(--spring) backwards, ios-menu-fade 0.1s ease-out backwards;
}
.app-menu.closing { animation: ios-menu-close 0.16s cubic-bezier(0.4, 0, 1, 1) forwards; pointer-events: none; }
.app-menu-name { padding: 8px 18px 6px; font-size: 14px; font-weight: 600; color: rgba(244, 244, 246, 0.6); }
.app-menu-sep { height: 0.5px; margin: 6px 18px; background: rgba(255, 255, 255, 0.18); }
.app-menu-item {
	display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 18px; border: 0; border-radius: 18px;
	background: none; color: var(--text); font: inherit; font-size: 17px; font-weight: 600; text-align: left; cursor: pointer;
}
.app-menu-item svg { width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-menu-item:active { opacity: 0.6; transition: opacity 0.06s ease; }
.app-menu-item:focus-visible { outline: none; background: rgba(255, 255, 255, 0.12); }
@media (hover: hover) { .app-menu-item:hover { background: rgba(255, 255, 255, 0.1); } }
@media (prefers-reduced-motion: reduce) { .app-menu, .app-menu.closing { animation: none; } }

/* ---------- Settings: full-screen page of grouped Liquid Glass cards (like iOS Settings) ---------- */
#settings { padding: 0; place-items: stretch; z-index: 22; }
#settings .settings-card {
	width: 100%; max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; overflow-y: auto; overscroll-behavior: contain;
	background: rgba(17, 17, 17, 0.55); -webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%);
	padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	display: block;
}
@media (display-mode: standalone) { #settings .settings-card { padding-top: calc(14px + env(safe-area-inset-top) + var(--ios-fade, 0px)); } }
#settings .settings-card > * { max-width: 680px; margin-left: auto; margin-right: auto; }
#settings .sheet-close { display: none; }
.settings-top { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; gap: 10px; margin-bottom: 18px; }
.settings-top h2 { margin: 0; text-align: center; font-size: 22px; font-weight: 700; padding: 0; }
.settings-section { margin: 22px auto 0; padding: 0; border: 0; }
.set-label { margin: 0 0 8px; padding: 0 18px; font-size: 17px; font-weight: 700; color: rgba(244, 244, 246, 0.55); }
.set-group {
	border-radius: 26px; overflow: hidden;
	background: rgba(255, 255, 255, 0.08); border: 0.5px solid rgba(255, 255, 255, 0.16);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.set-hero { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.set-hero .logo-mark { width: 58px; height: 58px; border-radius: 16px; flex: 0 0 58px; }
.set-hero strong { font-size: 19px; }
.set-rows { list-style: none; margin: 0; padding: 0; display: block; }
.set-rows > li { display: flex; align-items: center; background: none !important; border: 0 !important; padding: 0 !important; margin: 0; border-radius: 0 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.set-row {
	display: flex; align-items: center; gap: 16px; width: 100%; min-height: 58px; padding: 10px 18px; margin: 0;
	border: 0; background: none; color: var(--text); font: inherit; font-size: 17px; font-weight: 600; text-align: left; cursor: pointer; position: relative;
}
.set-row.static { cursor: default; }
.set-item .set-row { flex: 1; min-width: 0; }
/* Hairline separators between rows, starting after the icon (iOS style). */
.set-group .set-row + .set-row::before, .set-rows > li + li::before, .set-rows:not(:empty) + .set-row::before {
	content: ""; position: absolute; left: 58px; right: 18px; top: 0; height: 0.5px; background: rgba(255, 255, 255, 0.14);
}
.set-rows > li { position: relative; }
.set-rows > li + li::before { left: 58px; }
.set-ico { width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.set-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.set-text > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-sub { font-size: 13px; font-weight: 500; color: rgba(244, 244, 246, 0.6); overflow-wrap: anywhere; }
.set-sub.error { color: #ff8a80; }
.set-chev { color: rgba(244, 244, 246, 0.4); font-size: 24px; line-height: 1; margin-left: auto; }
.set-row.danger { color: #ff6b62; }
.set-row:disabled { opacity: 0.5; cursor: default; }
.set-row:active:not(:disabled):not(.static), .set-remove:active { opacity: 0.6; transition: opacity 0.06s ease; }
@media (hover: hover) { .set-row:hover:not(.static):not(:disabled) { background: rgba(255, 255, 255, 0.06); } }
.set-remove { flex: 0 0 auto; width: 44px; height: 44px; margin-right: 8px; border: 0; border-radius: 50%; background: none; color: rgba(255, 120, 110, 0.9); cursor: pointer; display: grid; place-items: center; }
.set-remove svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.set-remove:disabled { opacity: 0.3; cursor: default; }
.set-empty { padding: 14px 18px !important; }
#settings .source-form { margin-top: 12px; }
#passkey-error:empty { display: none; }
#settings .settings-card { border-radius: 0 !important; border: 0 !important; box-shadow: none !important; }

/* Settings and cast pages: the backdrop shows through (its own sampled colour), no fixed navy/purple tint. */
#settings .settings-card, #person .person-card { background: rgba(var(--tint), 0.35) !important; }

/* Top-left: initials in a round glass button, the same size and material as the magnifier. */
.topbar .logo-mark {
	width: var(--bar-h); height: var(--bar-h); border-radius: 50%; background: rgba(255, 255, 255, 0.06) !important;
	border: 0.5px solid rgba(255, 255, 255, 0.2); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
	display: grid; place-items: center; color: var(--text); font-size: 16px; font-weight: 800; letter-spacing: 0.02em;
}
/* The initials button opens the account menu, so the separate avatar and the "Couch" word next to it go. */
.topbar .logo-word, .topbar #open-settings { display: none !important; }

/* No grey rectangle on tap (iOS's default tap highlight): buttons dim instead. Keyboard focus gets a ring that
   follows the button's own shape. */
button, a, .tile, [role="button"] { -webkit-tap-highlight-color: transparent; }
.glass-pill-group button, .glass-circle { border-radius: 50%; outline: none; }
.glass-pill-group button:active { opacity: 0.6; transition: opacity 0.06s ease; }
.glass-pill-group button:focus-visible, .glass-circle:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
/* Skeleton rows sit in one wrapper: give it the same row spacing as #shelves. */
.skeleton-rows { display: grid; gap: 30px; grid-template-columns: minmax(0, 1fr); }

/* ---------- Details: pinned artwork that grows and blurs as the page scrolls over it ---------- */
#details { --art-h: min(56vh, 600px); --art-overlap: min(26vh, 260px); --p: 0; background: rgb(var(--tint)); }
@media (max-width: 560px) { #details { --art-h: 58vh; --art-overlap: 28vh; } }
#details .sheet-card { background: transparent !important; }
#details .details-art {
	position: fixed; z-index: 0; top: 0; left: 0; right: 0; aspect-ratio: auto;
	/* From its own height at the top to the whole screen once scrolled. */
	height: calc(var(--art-h) + (100lvh - var(--art-h)) * var(--p));
	background-size: cover; background-position: center 20%;
}
/* The fade into the page colour softens to a full wash as it fills the screen. */
#details .details-art::after {
	background: linear-gradient(to top, rgb(var(--tint)) calc(2% * (1 - var(--p))), rgba(var(--tint), calc(0.4 + 0.15 * var(--p))) 45%, rgba(var(--tint), calc(0.45 * var(--p))) 75%);
}
.details-art-blur {
	position: fixed; z-index: 0; inset: 0; pointer-events: none; opacity: var(--p);
	-webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}
#details .details-body { position: relative; z-index: 1; margin-top: calc(var(--art-h) - var(--art-overlap)); }

/* Loading bar: solid red, no orange. */
.start-bar > span { background: var(--accent); }

/* ---------- Icons: Framework7 Icons (MIT), drawn to match Apple's SF Symbols and named like them. Self-hosted;
   font-display: block so a name never shows as text while the font loads; clipped to a 1em box. ---------- */
@font-face {
	font-family: "Framework7 Icons"; font-style: normal; font-weight: 400; font-display: block;
	src: url("/fonts/Framework7Icons-Regular.woff2") format("woff2");
}
.f7 {
	font-family: "Framework7 Icons"; font-style: normal; font-weight: normal; letter-spacing: normal; text-transform: none;
	white-space: nowrap; direction: ltr; line-height: 1; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
	-webkit-font-smoothing: antialiased; display: inline-flex; align-items: center; justify-content: center;
	width: 1.1em; height: 1.1em; overflow: hidden; font-size: 1.15em; vertical-align: -0.2em; flex-shrink: 0;
}
.btn .f7, .set-row .f7, .app-menu-item .f7 { margin-right: 0.35em; }
.btn .f7:only-child, .icon-btn .f7, .glass-circle .f7, .glass-pill-group .f7, .sheet-close .f7 { margin: 0; }
.icon-btn .f7, .glass-circle .f7, .glass-pill-group .f7 { font-size: 22px; }
.sheet-close .f7 { font-size: 20px; }
.set-row .set-ico, .app-menu-item .f7 { font-size: 24px; width: 26px; height: 26px; margin-right: 0; }
.set-row .set-chev { font-size: 16px; color: rgba(244, 244, 246, 0.4); margin-left: auto; margin-right: 0; }
.set-remove .f7 { font-size: 20px; margin: 0; }
#details-fav .when-on, #details-fav[aria-pressed="true"] .when-off { display: none; }
#details-fav[aria-pressed="true"] .when-on { display: inline-flex; color: var(--accent); }
.fav-dot .f7, .star .f7 { font-size: 14px; color: var(--accent); margin: 0; }
.ep-check .f7 { font-size: 14px; margin: 0; }
.inline-star { font-size: 0.95em; margin: 0 0.2em 0 0; color: #ffd36a; }
.season-picker .chev, .gsb-chev { font-size: 16px; margin: 0; }
.video-play .f7 { font-size: 22px; margin: 0; }
.ai-opt-check { color: var(--accent); }
.info-value .f7 { font-size: 26px; width: 28px; height: 28px; }

/* iOS-style switch (a styled checkbox: keyboard and screen readers keep working). */
.ios-switch {
	appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; width: 51px; height: 31px; margin: 0 4px 0 0;
	border-radius: 999px; background: rgba(120, 120, 128, 0.36); cursor: pointer; transition: background-color 0.2s ease;
}
.ios-switch::after {
	content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: translate 0.25s var(--spring);
}
.ios-switch:checked { background: #34c759; }
.ios-switch:checked::after { translate: 20px 0; }
.ios-switch:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
.ios-switch:disabled { opacity: 0.5; }
.set-item.is-off .set-row { opacity: 0.5; }
@media (prefers-reduced-motion: reduce) { .ios-switch::after { transition: none; } }

/* ---------- Profiles ---------- */
.topbar .logo-mark { background: color-mix(in srgb, var(--pcolor, #e8252b) 55%, rgba(255, 255, 255, 0.06)) !important; }
.profiles-sheet { z-index: 30; padding: 0; place-items: center; background: rgba(var(--tint), 0.5); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); }
.profiles-card { display: grid; justify-items: center; gap: 26px; padding: 24px; width: min(640px, 100%); }
.profiles-card h2 { margin: 0; font-size: 28px; font-weight: 700; }
.profile-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 26px; }
.profile-pick { display: grid; justify-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.profile-pick:active { opacity: 0.6; transition: opacity 0.06s ease; }
.profile-face {
	display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; font-size: 32px; font-weight: 800; color: #fff;
	background: color-mix(in srgb, var(--pcolor, #e8252b) 70%, rgba(255, 255, 255, 0.08)); border: 1px solid rgba(255, 255, 255, 0.25);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.profile-face.small { width: 30px; height: 30px; font-size: 12px; box-shadow: none; flex: 0 0 30px; }
.profile-name { font-size: 16px; font-weight: 600; }
#profiles-manage .f7 { margin-right: 0.3em; }

/* Page headers scroll away with the page (no text overlapping the rows underneath); swipe from the left edge goes back. */
.settings-top, .person-topbar { position: relative; }

/* Stream picker header: the title gets its full line height (no clipped tops) and sits clear of "Select Stream". */
#chooser .chooser-card h2 { line-height: 1.3; padding: 2px 0; }
#chooser #chooser-sub { margin-top: 0; line-height: 1.3; }

/* Rating / Genre / Origin: always centred, whether there are one, two or three. */
.details-info { display: flex !important; justify-content: center; gap: 8px; }
.details-info .info-col { flex: 0 1 33.333%; max-width: 33.333%; }

/* Liquid touch reaction for the account menu (pill that follows the finger; panel squash). */
.app-menu { transition: transform 0.13s ease-out; touch-action: none; }
.app-menu .liquid-hl {
	position: absolute; z-index: 0; border-radius: 18px; background: rgba(127, 127, 127, 0.22); opacity: 0; pointer-events: none;
	transition: top 0.1s cubic-bezier(0.2, 0.8, 0.3, 1), height 0.1s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.12s ease;
}
.app-menu .app-menu-item, .app-menu .app-menu-name, .app-menu .app-menu-sep { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .app-menu { transition: none; } .app-menu .liquid-hl { transition: opacity 0.12s ease; } }

/* =====================================================================================================
   Motion pass (Liquid Glass rules): geometry springs (--spring), opacity uses a short plain ease, presses dim
   instead of moving, and Reduce Motion keeps the look but drops the movement.
   ===================================================================================================== */
@keyframes rise-in { from { translate: 0 18px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes push-in { from { translate: 48px 0; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes pop-in { from { scale: 0.7; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes pop { 0% { scale: 1; } 40% { scale: 1.3; } 100% { scale: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Pages opening: details rise in, settings and cast pages push in from the right (like iOS). */
#details:not([hidden]) .details-body { animation: rise-in 0.42s var(--spring) backwards, fade-in 0.2s ease-out backwards; }
#details:not([hidden]) .details-art { animation: fade-in 0.3s ease-out backwards; }
#settings:not([hidden]) .settings-card, #person:not([hidden]) .person-card { animation: push-in 0.38s var(--spring) backwards, fade-in 0.18s ease-out backwards; }
#profiles:not([hidden]) .profile-grid > li { animation: pop-in 0.42s var(--spring) backwards, fade-in 0.18s ease-out backwards; }
#profiles .profile-grid > li:nth-child(2) { animation-delay: 0.05s; }
#profiles .profile-grid > li:nth-child(3) { animation-delay: 0.1s; }
#profiles .profile-grid > li:nth-child(n + 4) { animation-delay: 0.15s; }

/* Content arriving: rows ease in, staggered; a season's episodes fade in. */
#shelves > .shelf, #shelves > .clp-rows > .shelf { animation: rise-in 0.45s var(--spring) backwards, fade-in 0.22s ease-out backwards; }
#shelves > .shelf:nth-child(2) { animation-delay: 0.04s; }
#shelves > .shelf:nth-child(3) { animation-delay: 0.08s; }
#shelves > .shelf:nth-child(n + 4) { animation-delay: 0.12s; }
#shelves > .skeleton-rows .shelf { animation: none; }
.ep-list.fade-in > li { animation: rise-in 0.36s var(--spring) backwards, fade-in 0.18s ease-out backwards; }

/* Small reactions. */
#details-fav[aria-pressed="true"] .when-on { animation: pop 0.38s var(--spring); }
.toast:not([hidden]) { animation: rise-in 0.36s var(--spring), fade-in 0.15s ease-out; }
@media (hover: hover) {
	.tile .art { transition: scale 0.3s var(--spring), box-shadow 0.3s ease; }
	.tile:hover .art { scale: 1.03; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); }
	.ep-card .ep-thumb, .cast-card-btn .cast-face { transition: scale 0.3s var(--spring); }
	.ep-card:hover .ep-thumb, .cast-card-btn:hover .cast-face { scale: 1.03; }
}

/* Closing pages: a short crossfade (View Transitions). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; animation-timing-function: ease-out; }

@media (prefers-reduced-motion: reduce) {
	#details .details-body, #details .details-art, #settings .settings-card, #person .person-card, #profiles .profile-grid > li,
	#shelves .shelf, .ep-list > li, #details-fav .when-on, .toast { animation: none !important; }
	.tile .art, .ep-card .ep-thumb, .cast-card-btn .cast-face { transition: none !important; }
}

/* Settings opened for one part (from the account menu): only that section, no account card. */
#settings[data-part]:not([data-part=""]) .set-hero,
#settings[data-part="sources"] .settings-section:not([data-part="sources"]),
#settings[data-part="relay"] .settings-section:not([data-part="relay"]),
#settings[data-part="passkeys"] .settings-section:not([data-part="passkeys"]),
#settings[data-part="profiles"] .settings-section:not([data-part="profiles"]),
#settings[data-part="hidden"] .settings-section:not([data-part="hidden"]) { display: none; }
#settings[data-part]:not([data-part=""]) .settings-section .set-label { display: none; }

/* ---------- Live: TV guide grid ---------- */
#live-view .live-rail { display: none !important; }
#live-view { display: block; }
#live-view .live-list { padding: 0; min-width: 0; }
.epg-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px var(--gutter) 6px; }
.epg-head .live-title { margin: 0; font-size: 26px; font-weight: 700; text-align: center; padding-left: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epg-head .glass-circle { width: 46px; height: 46px; }
.epg {
	--chan-w: clamp(112px, 30vw, 170px); --row-h: 66px; --tl-w: 1440px; --now-x: 0px;
	position: relative; overflow-x: auto; overflow-y: visible; scrollbar-width: none; overscroll-behavior-x: contain;
	padding: 0 0 calc(32px + env(safe-area-inset-bottom));
}
.epg::-webkit-scrollbar { display: none; }
.epg-ruler { position: relative; height: 34px; margin-left: calc(var(--gutter) + var(--chan-w) + 8px); width: var(--tl-w); }
.epg-tick { position: absolute; top: 6px; font-size: 15px; font-weight: 600; color: rgba(244, 244, 246, 0.6); translate: -50% 0; white-space: nowrap; }
.epg-tick:first-child { translate: 0 0; }
/* The "now" line runs down through every row. */
.epg-now {
	position: absolute; z-index: 3; top: 34px; bottom: 0; width: 2px; border-radius: 1px; pointer-events: none;
	left: calc(var(--gutter) + var(--chan-w) + 8px + var(--now-x)); background: rgba(255, 255, 255, 0.7);
}
.epg-now::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.epg-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: calc(var(--gutter) + var(--chan-w) + 8px + var(--tl-w)); }
.epg-row { display: grid; grid-template-columns: var(--chan-w) var(--tl-w); gap: 8px; height: var(--row-h); padding-left: var(--gutter); }
/* Channel tile stays put while the timeline scrolls sideways. */
.epg-chan {
	position: sticky; left: var(--gutter); z-index: 4; display: grid; place-items: center; height: 100%; padding: 8px; border-radius: 20px; cursor: pointer;
	border: 0.5px solid rgba(255, 255, 255, 0.16); color: var(--text); font: inherit;
	background: rgba(var(--tint), 0.72); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
}
.epg-chan .star { position: absolute; top: 6px; right: 8px; }
.epg-logo { display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; }
.epg-logo img { max-width: 72%; max-height: 80%; object-fit: contain; }
.epg-chname { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.epg-lane { position: relative; height: 100%; border-radius: 20px; background: rgba(255, 255, 255, 0.05); cursor: pointer; }
.epg-prog {
	position: absolute; top: 0; bottom: 0; display: grid; align-content: center; gap: 2px; padding: 0 16px; border-radius: 20px; overflow: hidden;
	background: rgba(255, 255, 255, 0.08); border: 0.5px solid rgba(255, 255, 255, 0.12);
}
.epg-prog.now { background: rgba(255, 255, 255, 0.55); border-color: rgba(255, 255, 255, 0.6); color: #111; }
.epg-prog.now .epg-ptime { color: rgba(17, 17, 17, 0.55); }
.epg-ptitle { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-ptime { font-size: 13px; color: rgba(244, 244, 246, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-empty { position: absolute; top: 50%; translate: 0 -50%; left: calc(var(--now-x) + 0px); font-size: 15px; color: rgba(244, 244, 246, 0.45); white-space: nowrap; padding-left: 4px; }
.epg-chan:active, .epg-lane:active { opacity: 0.6; transition: opacity 0.06s ease; }
@media (min-width: 900px) { .epg { --row-h: 72px; } }

/* Live categories list (first screen of Live). */
.epg-head { grid-template-columns: 46px minmax(0, 1fr) 46px; }
.epg-head .live-title { padding-left: 0; }
.epg-head > [hidden] { display: block !important; visibility: hidden; }
.live-cats {
	list-style: none; margin: 8px var(--gutter) calc(32px + env(safe-area-inset-bottom)); padding: 0; border-radius: 26px; overflow: hidden;
	background: rgba(255, 255, 255, 0.08); border: 0.5px solid rgba(255, 255, 255, 0.16);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.live-cats[hidden] { display: none; }
.live-cats > li { position: relative; }
.live-cats > li + li::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 0.5px; background: rgba(255, 255, 255, 0.12); }
.live-cats .set-row { min-height: 54px; }
.live-cat-n { font-size: 15px; color: rgba(244, 244, 246, 0.5); margin-left: auto; padding-right: 6px; }
.live-cats .set-chev { margin-left: 0; }

/* A programme that started off-screen keeps its title readable just right of the channel tile. */
.epg-prog > span { position: sticky; left: calc(var(--gutter) + var(--chan-w) + 24px); max-width: 100%; }

/* Guide rows: fixed heights everywhere (Safari otherwise lets logos grow to their image size and overlap rows). */
.epg-row { grid-template-rows: var(--row-h); align-items: stretch; overflow: visible; }
.epg-chan, .epg-lane { height: var(--row-h); min-height: 0; box-sizing: border-box; }
.epg-logo { height: calc(var(--row-h) - 16px); overflow: hidden; }
.epg-logo img { width: auto; height: auto; max-width: 72%; max-height: calc(var(--row-h) - 24px); display: block; }
.epg-prog { height: var(--row-h); box-sizing: border-box; }

/* Guide fixes: solid channel tiles (no programme text showing through), and programme titles that stay readable
   beside the tile (overflow: clip, unlike hidden, doesn't stop the title from sticking). */
.epg-chan { background: color-mix(in srgb, rgb(var(--tint)) 86%, #ffffff) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.epg-prog { overflow: clip; }
.epg-prog > span { min-width: 0; }
.epg-prog > span { justify-self: start; width: max-content; max-width: none; overflow: visible; text-overflow: clip; }

/* ---------- Ratings row: each source's mark, the score, and what it is; scrolls sideways ---------- */
.rating-row { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.rating-row::-webkit-scrollbar { display: none; }
.rating-item { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.rating-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; }
.rating-mark svg { width: 100%; height: 100%; }
.rating-text { display: grid; line-height: 1.15; }
.rating-text strong { font-size: 24px; font-weight: 600; }
.rating-text span { font-size: 13px; color: rgba(244, 244, 246, 0.6); white-space: nowrap; }

/* Native-app feel: no double-tap zoom (taps also respond without the zoom delay); scrolling still works. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Player header on phones: back and actions on one row, the channel name and "Now / Next" on a full-width row
   below (instead of a narrow column squeezed between the buttons). */
@media (max-width: 560px) {
	.player-bar { display: grid !important; grid-template-columns: auto 1fr; grid-template-areas: "back actions" "title title"; align-items: center; gap: 10px 8px; }
	.player-bar #player-close { grid-area: back; }
	.player-bar .player-actions { grid-area: actions; justify-self: end; display: flex; flex-wrap: nowrap; gap: 8px; }
	.player-bar .player-title { grid-area: title; display: grid; gap: 4px; min-width: 0; }
	.player-bar .player-title strong { font-size: 20px; }
	.player-bar #player-epg { font-size: 14px; line-height: 1.35; }
}

/* Play / Resume always one line; the time left sits underneath, like the runtime under Play. */
#details .details-actions .btn { white-space: nowrap; }
#details .details-actions .resume-left { flex-basis: 100%; text-align: center; font-size: 13px; color: rgba(244, 244, 246, 0.65); margin-top: -4px; }

/* ---------- Phones: bigger posters, about two and a bit per screen like Chillio ---------- */
@media (max-width: 600px) {
	.shelf-row { gap: 18px; }
	.shelf-row.posters > li { width: 41vw; }
	.shelf-row.wide > li { width: 64vw; }
}

/* ---------- Stream filters over "Select Stream" ---------- */
.chooser-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; margin-top: 10px; }
.chooser-filters::-webkit-scrollbar { display: none; }
.filter-chip {
	flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap;
	background: rgba(255, 255, 255, 0.08); border: 0.5px solid rgba(255, 255, 255, 0.18);
	-webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.06s ease; -webkit-tap-highlight-color: transparent;
}
.filter-chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); color: #111; border-color: transparent; }
.filter-chip:active { opacity: 0.6; }
.chooser-count { margin: 8px 0 4px; }
.chooser-count .linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-decoration: underline; cursor: pointer; }
.chooser-option .chooser-warn { display: block; margin-top: 4px; font-size: 13px; color: #ff9f8f; }
.chooser-list > li[hidden] { display: none; }
#chooser .chooser-filters { grid-column: 1 / -1; margin: 16px -18px 0; padding: 4px 18px; }
#chooser .chooser-count { grid-column: 1 / -1; margin: 10px 2px 0; }
#chooser .chooser-filters + .chooser-count + .chooser-list { margin-top: 4px; }
/* Safari shrinks a scrolling row inside a fixed-height grid to nothing; rows keep their content's height. */
#chooser .chooser-card { grid-auto-rows: max-content; }
#chooser .chooser-filters {
	position: sticky; top: -16px; z-index: 2; min-height: 50px; flex: none; align-items: center;
	margin: 14px -18px 0; padding: 8px 18px;
	background: linear-gradient(to bottom, rgba(var(--tint, 30, 30, 32), 0.92) 70%, rgba(var(--tint, 30, 30, 32), 0));
}
#chooser .filter-chip { height: 36px; }
#chooser .chooser-count { position: relative; z-index: 1; margin: 6px 2px 0; }
/* Filters: no band behind them; Quality / Language / Size open a glass menu. */
#chooser .chooser-filters { background: none; }
.filter-select { display: inline-flex; align-items: center; gap: 6px; }
.filter-select .gsb-chev { font-size: 12px; opacity: 0.7; }
.filter-select.is-set { background: rgba(255, 255, 255, 0.92); color: #111; border-color: transparent; }

/* ---------- Continue watching cards (like Chillio's): everything on the picture ---------- */
.continue-shelf .shelf-row.wide > li { width: clamp(250px, 26vw, 380px); }
@media (max-width: 600px) { .continue-shelf .shelf-row.wide > li { width: 58vw; } }
.cw-card .art { aspect-ratio: 16 / 9; border-radius: 24px; }
.cw-over {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; gap: 6px; padding: 34px 14px 12px;
	background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.8)); text-align: left;
}
.cw-title {
	font-size: 17px; font-weight: 800; line-height: 1.15; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cw-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.cw-meta .f7 { font-size: 12px; }
.cw-bar { width: 44px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); overflow: hidden; flex: none; }
.cw-bar > span { display: block; height: 100%; background: #fff; border-radius: 3px; }
/* Phones, measured against Chillio side by side: posters ~38% of the screen, ~26px apart. */
@media (max-width: 600px) {
	.shelf-row { gap: 26px; }
	.shelf-row.posters > li { width: 38.5vw; }
}

/* ---------- Hold menu: the tile lifts over a dimmed page, with a glass menu under it ---------- */
.holdable { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.hold-scrim {
	position: fixed; inset: 0; z-index: 38; background: rgba(0, 0, 0, 0.35);
	-webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
	animation: hold-fade 0.2s ease-out backwards;
}
.hold-preview {
	position: fixed; z-index: 39; margin: 0; pointer-events: none; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
	animation: hold-lift 0.32s var(--spring) forwards;
}
.hold-menu { z-index: 40; width: min(280px, calc(100vw - 24px)); }
.hold-scrim.closing { animation: hold-fade 0.16s ease-in reverse forwards; }
.hold-preview.closing { animation: hold-drop 0.16s ease-in forwards; }
@keyframes hold-fade { from { opacity: 0; } }
@keyframes hold-lift { from { scale: 1; } to { scale: 1.04; } }
@keyframes hold-drop { from { scale: 1.04; } to { scale: 1; opacity: 0; } }
.hold-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; padding: 4px 6px 2px; }
.hold-action {
	display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 18px; background: none;
	color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hold-action .f7 { font-size: 22px; }
.hold-action:active { opacity: 0.6; transition: opacity 0.06s ease; }
@media (hover: hover) { .hold-action:hover { background: rgba(255, 255, 255, 0.1); } }
.app-menu-item.danger { color: #ff6b6b; }
.watched-badge {
	position: absolute; right: 8px; top: 8px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
	background: rgba(0, 0, 0, 0.55); border: 0.5px solid rgba(255, 255, 255, 0.3); color: #fff; font-size: 13px;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
@media (prefers-reduced-motion: reduce) { .hold-scrim, .hold-preview, .hold-scrim.closing, .hold-preview.closing { animation: none; } }
.hold-preview { display: block; padding: 0; border-radius: 16px; }
.hold-preview > .art { width: 100%; height: 100%; aspect-ratio: auto; }
.cw-card.hold-preview, .cw-card.hold-preview > .art { border-radius: 24px; }

/* Like a native app: no text selection or iOS copy/look-up callout from long presses, except in text fields. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }
/* The row scrolls sideways, which clips anything drawn outside it: room below for the cards' full shadow
   (otherwise it ends in a hard line), taken back with a negative margin so the spacing doesn't change. */
.continue-shelf .shelf-row { padding-bottom: 30px; margin-bottom: -20px; }

/* iPhone / iPad: a real select laid invisibly over a dropdown button, so Apple's own menu opens. */
.native-wrap { position: relative; display: inline-flex; flex: 0 0 auto; justify-self: start; width: max-content; max-width: 100%; }
.native-wrap.native-block { display: flex; width: 100%; }
.native-wrap > button { flex: 1 1 auto; }
.native-menu {
	position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
	font-size: 16px; -webkit-appearance: none; appearance: none; border: 0; background: transparent; color: transparent;
}
.native-wrap:has(.native-menu:active) > button { opacity: 0.6; }

/* Header controls get the same light glass edge as the details page's Play button. */
.topbar .tabs, .topbar .logo-mark, #search-toggle, .topbar .search input {
	border: 1px solid rgba(255, 255, 255, 0.28) !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
}
.brand.has-native-menu { position: relative; }
/* Dark only, on the page and on each select itself: iOS draws a select's menu in the select's own scheme. */
:root { color-scheme: dark only; }
select, .native-menu { color-scheme: dark only; }
/* Rows a bit closer: 32px between rows (was 40), 12px from a heading to its posters (was 16). */
#shelves { gap: 22px; }
.clp-rows { display: grid; gap: 22px; }
.shelf-head { margin-bottom: 8px; }
/* Phones, like Chillio: posters only, no title or year/rating under them (a poster that fails to load still
   shows its title). Room below for the shadow, which the sideways-scrolling row would otherwise cut off. */
@media (max-width: 600px) {
	.tile.poster > .label, .tile.poster > .sub { display: none; }
	.shelf-row.posters { padding-bottom: 30px; margin-bottom: -20px; }
}

/* Continue watching: the title's logo in place of its name (like Chillio). */
.cw-logo { display: block; max-width: 72%; max-height: 48px; width: auto; height: auto; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55)); }
.cw-title.waiting { visibility: hidden; }
/* Not a cover picture: the poster rule (absolute, filling the card) mustn't apply to the logo. */
.tile .art .cw-over img.cw-logo {
	position: static; inset: auto; width: auto; height: auto; max-width: 72%; max-height: 48px;
	object-fit: contain; object-position: left bottom; border-radius: 0; opacity: 1;
}

/* ---------- avbridge player (AVI/DivX, WMV, FLV…): fills the stage in place of the <video> ---------- */
.player.av-mode #video { display: none; }
.av-player { display: block; flex: 1; width: 100%; min-height: 0; background: #000; }
.av-controls { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.av-controls[hidden] { display: none; }
.av-bar {
	position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); pointer-events: auto;
	display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
	background: rgba(20, 20, 22, 0.45); border: 1px solid rgba(255, 255, 255, 0.22);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
	transition: opacity 0.25s ease, translate 0.32s var(--spring);
}
.av-bar button {
	display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 0; border-radius: 50%;
	background: none; color: #fff; font-size: 22px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.av-bar button:active, .av-big-play:active { opacity: 0.6; transition: opacity 0.06s ease; }
@media (hover: hover) { .av-bar button:hover { background: rgba(255, 255, 255, 0.12); } }
.av-time { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9); font-variant-numeric: tabular-nums; }
#av-seek { flex: 1 1 auto; min-width: 60px; accent-color: #fff; height: 28px; cursor: pointer; }
.av-big-play {
	position: absolute; left: 50%; top: 50%; translate: -50% -50%; pointer-events: auto;
	display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; color: #fff; font-size: 32px; cursor: pointer;
	background: rgba(20, 20, 22, 0.4); border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
	-webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.av-big-play[hidden] { display: none; }
.av-controls.idle .av-bar { opacity: 0; translate: 0 12px; pointer-events: none; }
.av-controls.idle .av-big-play { opacity: 0; pointer-events: none; }
@media (max-width: 600px) {
	.av-bar { left: 8px; right: 8px; gap: 2px; padding: 4px 8px; }
	.av-bar button { width: 36px; height: 36px; flex-basis: 36px; font-size: 20px; }
	#av-full { display: none; }
}
@media (prefers-reduced-motion: reduce) { .av-bar { transition: opacity 0.2s ease; } }
/* "Select Stream" can open from the player ("Next episode"): it must sit above the player, not behind it. */
#chooser { z-index: 35; }
.toast { z-index: 40; }

/* The episode a show page lands on (in progress, or up next): a light ring around its picture. */
.ep-card.ep-focus .ep-thumb { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 10px 26px rgba(0, 0, 0, 0.35); }

/* Stremio manifest help: only on a Stremio addon form, opened with the ? button. */
form:not([data-type="stremio"]) .stremio-help { display: none !important; }
/* The button sits in the form's top-right corner; the steps open in place under the link field. */
#source-form, #onboard-form { position: relative; }
.stremio-help { display: contents; }
.stremio-help .help-toggle { position: absolute; top: 12px; right: 12px; z-index: 1; }
.help-short { display: none; }
@media (max-width: 520px) {
	.help-long { display: none; }
	.help-short { display: inline; }
}
.help-toggle {
	justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
	background: rgba(255, 255, 255, 0.08); border: 0.5px solid rgba(255, 255, 255, 0.18); color: var(--text, #f4f4f6);
	font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.06s;
}
.help-toggle:active { opacity: 0.6; }
.help-toggle .f7 { font-size: 17px; }
.help-steps {
	margin: 0; padding: 12px 16px 12px 34px; border-radius: 14px; background: rgba(255, 255, 255, 0.06);
	border: 0.5px solid rgba(255, 255, 255, 0.12); display: grid; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--text2, rgba(244, 244, 246, 0.8));
}
.help-steps a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.help-steps strong { color: var(--text, #f4f4f6); }

/* Home relay setup, shown inside the Xtream form (or Settings) until a relay is connected. */
.relay-block { display: grid; gap: 14px; padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 0.5px solid rgba(255, 255, 255, 0.14); }
.relay-block[hidden] { display: none; }
.relay-block h4 { margin: 0; }
.relay-block > p { margin: 0; }

/* Hidden titles: a row in Settings that opens its own page with the list. */
#settings:not([data-part="hidden"]) .hidden-list-group,
#settings[data-part="hidden"] .hidden-open-group { display: none; }

/* "Add this device": pick a profile (or a new one), then create a passkey. */
.device-profiles { display: grid; gap: 8px; }
.device-pick {
	display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 14px; text-align: left;
	background: rgba(255, 255, 255, 0.06); border: 0.5px solid rgba(255, 255, 255, 0.14); color: inherit; font: inherit; cursor: pointer;
}
.device-pick[aria-checked="true"] { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); }
.device-pick:active { opacity: 0.6; }
.device-pick .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--pcolor, #e8252b); color: #fff; flex-shrink: 0; }
.device-pick .f7 { margin-left: auto; opacity: 0; }
.device-pick[aria-checked="true"] .f7 { opacity: 1; }
.device-link { display: grid; gap: 8px; padding: 12px 16px 14px; }
.device-link p { margin: 0; }
.device-link code { word-break: break-all; }
