:root {
  --bg: #0b0d12;
  --bg2: #10131a;
  --panel: #161a23;
  --panel2: #1d2230;
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f6;
  --muted: #9aa3b2;
  --accent: #ff3d5a;
  --accent2: #ff8a3d;
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --radius: 10px;
  --top-h: 68px;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--top-h);
  display: flex; align-items: center; gap: 28px; padding: 0 var(--gutter);
  background: linear-gradient(to bottom, rgba(11, 13, 18, .92), rgba(11, 13, 18, 0));
  transition: background .25s;
}
.top.solid { background: rgba(11, 13, 18, .97); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; }
.nav a { color: #c9cfda; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-color: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 999px; cursor: text;
}
.search:focus-within { border-color: rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .5); }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.search input { width: 220px; background: none; border: 0; outline: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: #dfe3ea; transition: background .15s;
}
.icon-btn:hover, .icon-btn.active { background: rgba(255, 255, 255, .1); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 50; display: none;
  background: rgba(14, 16, 22, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; color: var(--muted); }
.tabbar a.active { color: #fff; }
.tabbar a.active svg { color: var(--accent); }

/* ---------- algemeen ---------- */
.view { min-height: 100vh; padding: calc(var(--top-h) + 12px) 0 60px; }
.view-home { padding-top: 0; }
.view-auth { display: grid; place-items: center; padding: 24px 16px; }
.page { padding: 0 var(--gutter); }
.page-title { font-size: clamp(24px, 3vw, 34px); margin: 8px 0 18px; letter-spacing: -.02em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 8px; font-weight: 650; white-space: nowrap;
  background: rgba(255, 255, 255, .12); transition: transform .1s, background .15s, filter .15s;
}
.btn:hover { background: rgba(255, 255, 255, .2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); }
.btn-light { background: #fff; color: #0b0d12; }
.btn-light:hover { background: #e6e8ec; }
.btn-small { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .fill { fill: currentColor; stroke: none; }

.spinner {
  width: 38px; height: 38px; border-radius: 50%; margin: 18vh auto;
  border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner.small { width: 22px; height: 22px; margin: 20px auto; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 14vh 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin: 0 0 8px; }
.empty .btn { margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 20px);
  max-width: min(90vw, 520px); padding: 12px 18px; border-radius: 10px;
  background: #2a3040; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- hero ---------- */
.hero { position: relative; height: min(80vh, 720px); min-height: 440px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: #151924 center 20% / cover no-repeat; transition: filter .6s, opacity .6s; }
.hero-bg.blur { filter: blur(28px) saturate(1.2); transform: scale(1.15); opacity: .7; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(11, 13, 18, .95) 0%, rgba(11, 13, 18, .6) 40%, rgba(11, 13, 18, 0) 75%),
    linear-gradient(to top, var(--bg) 0%, rgba(11, 13, 18, 0) 45%);
}
.hero-body { position: relative; padding: 0 var(--gutter) clamp(40px, 9vh, 90px); max-width: 760px; }
.hero-kicker { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); margin-bottom: 8px; }
.hero h1 { font-size: clamp(30px, 5vw, 58px); line-height: 1.05; margin: 0 0 12px; letter-spacing: -.03em; text-shadow: 0 2px 20px rgba(0, 0, 0, .5); }
.hero-plot { color: #d5dae3; font-size: 16px; max-width: 620px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 0; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: #c4cad5; font-size: 14px; }
.meta .star { color: #ffc94a; }
.meta .pill { border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; padding: 0 6px; font-size: 12px; }

/* ---------- rijen ---------- */
.rows { position: relative; margin-top: -40px; display: flex; flex-direction: column; gap: 30px; }
.view-home .rows:first-child { margin-top: calc(var(--top-h) + 10px); }
.row-head { display: flex; align-items: baseline; gap: 14px; padding: 0 var(--gutter); margin-bottom: 10px; }
.row-head h2 { font-size: 19px; margin: 0; letter-spacing: -.01em; }
.row-more { color: var(--muted); font-size: 14px; font-weight: 600; }
.row-more:hover { color: #fff; }
.row-wrap { position: relative; }
.row-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(118px, 13vw, 180px); gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 4px var(--gutter) 8px; scroll-padding: 0 var(--gutter);
}
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; }
.row-track.wide { grid-auto-columns: clamp(220px, 24vw, 320px); }
.row-track.chans { grid-auto-columns: clamp(120px, 11vw, 160px); }
.row-arrow {
  position: absolute; top: 4px; bottom: 50px; z-index: 2; width: var(--gutter); min-width: 36px;
  display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .2s;
  background: linear-gradient(to right, rgba(11, 13, 18, .85), rgba(11, 13, 18, 0));
}
.row-arrow.next { right: 0; transform: scaleX(-1); }
.row-arrow.prev { left: 0; }
.row-arrow svg { width: 30px; height: 30px; }
.row-wrap:hover .row-arrow { opacity: 1; }
@media (hover: none) { .row-arrow { display: none; } }

/* ---------- kaarten ---------- */
.card { display: block; text-align: left; width: 100%; min-width: 0; }
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #262c3b, #151923); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: transform .2s, box-shadow .2s;
}
.card:hover .poster, .card:focus-visible .poster { transform: translateY(-4px) scale(1.03); box-shadow: 0 12px 28px rgba(0, 0, 0, .55); }
.poster img, .wide-img img, .chan-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 700; color: #aab2c2; font-size: 14px; line-height: 1.25; overflow: hidden; }
img.noimg { display: none; }
.badge { position: absolute; top: 8px; left: 8px; padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; background: rgba(0, 0, 0, .7); color: #ffc94a; }
.card-title { margin-top: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12.5px; color: var(--muted); min-height: 1.2em; }
.prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); }
.prog i { display: block; height: 100%; background: var(--accent); }
.fav-dot { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .65); color: var(--accent); }
.fav-dot svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

.wide-card { display: block; text-align: left; }
.wide-img { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: linear-gradient(160deg, #262c3b, #151924); transition: transform .2s; }
.wide-card:hover .wide-img { transform: translateY(-3px); }
.wide-img .play-ic { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(0, 0, 0, .35); transition: opacity .2s; }
.wide-card:hover .play-ic { opacity: 1; }
.play-ic svg { width: 46px; height: 46px; fill: #fff; stroke: none; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .6)); }

.chan-tile { display: block; text-align: center; }
.chan-logo {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #222838, #161a24); border: 1px solid var(--line); transition: transform .2s, border-color .2s;
}
.chan-logo img { object-fit: contain; padding: 14%; }
.chan-tile:hover .chan-logo { transform: translateY(-3px); border-color: rgba(255, 255, 255, .25); }
.chan-name { margin-top: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d6dbe4; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 14vw, 170px), 1fr)); gap: 22px 14px; }
.grid.chans { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.sentinel { grid-column: 1 / -1; height: 1px; }

/* ---------- browse ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.toolbar .page-title { margin: 0 12px 0 0; }
.toolbar .count { color: var(--muted); font-size: 14px; margin-left: auto; }
.select, .input {
  height: 40px; padding: 0 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); outline: 0; max-width: 100%;
}
.select:focus, .input:focus { border-color: rgba(255, 255, 255, .35); }
select.select { padding-right: 30px; }
select option { background: #1b2030; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: rgba(4, 5, 8, .75); backdrop-filter: blur(6px); padding: 5vh 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; max-width: 980px; margin: 0 auto; background: var(--bg2); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: rise .25s; }
@keyframes rise { from { transform: translateY(20px); opacity: .5; } }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(0, 0, 0, .6); }
.d-hero { position: relative; min-height: 360px; display: flex; align-items: flex-end; }
.d-hero .hero-bg { opacity: .9; }
.d-hero .hero-shade { background: linear-gradient(to top, var(--bg2) 5%, rgba(16, 19, 26, .5) 55%, rgba(16, 19, 26, .15)); }
.d-head { position: relative; display: flex; gap: 24px; align-items: flex-end; padding: 80px 32px 8px; width: 100%; }
.d-poster { width: 150px; flex: none; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); aspect-ratio: 2 / 3; position: relative; background: #1d2230; }
.d-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-title h2 { font-size: clamp(24px, 3.4vw, 38px); margin: 0 0 8px; line-height: 1.1; letter-spacing: -.02em; }
.d-body { padding: 18px 32px 32px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.d-plot { color: #d2d7e0; max-width: 760px; margin: 0 0 16px; }
.d-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.d-facts b { color: #c9cfda; font-weight: 600; }
.seasons { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 14px; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.chip.active { background: #fff; color: #0b0d12; }
.episodes { display: flex; flex-direction: column; gap: 4px; }
.ep { display: grid; grid-template-columns: 34px 160px 1fr; gap: 16px; align-items: center; text-align: left; padding: 12px; border-radius: 10px; }
.ep:hover { background: var(--panel); }
.ep-num { font-size: 20px; font-weight: 700; color: var(--muted); text-align: center; }
.ep-img { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #1d2230; }
.ep-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-title { font-weight: 650; display: flex; gap: 10px; justify-content: space-between; }
.ep-title small { color: var(--muted); font-weight: 500; white-space: nowrap; }
.ep-plot { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.ep .seen { color: #4cd38a; font-size: 12px; font-weight: 700; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 200; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.player-top {
  position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; gap: 12px; padding: 16px 20px 40px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0)); transition: opacity .3s;
}
.player-top .icon-btn svg { width: 28px; height: 28px; }
#player-title { font-weight: 700; font-size: 18px; }
#player-sub { color: #c4cad5; font-size: 14px; }
.player.idle .player-top, .player.idle .player-next { opacity: 0; pointer-events: none; }
.player.idle { cursor: none; }
.player-msg, .live-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: min(90%, 520px);
  padding: 18px 22px; border-radius: 12px; background: rgba(20, 23, 32, .92); text-align: center; line-height: 1.5;
}
.player-spinner { position: absolute; left: 50%; top: 50%; margin: -19px 0 0 -19px; pointer-events: none; }
.player-next { position: absolute; right: 24px; bottom: 80px; transition: opacity .3s; }

/* ---------- live ---------- */
.view-live { padding-bottom: 0; }
.live { display: grid; grid-template-columns: 220px 340px 1fr; height: calc(100vh - var(--top-h) - 12px); border-top: 1px solid var(--line); }
.live-cats, .live-list { overflow-y: auto; border-right: 1px solid var(--line); }
.live-cats { padding: 10px 8px; }
.live-cats button { display: flex; width: 100%; justify-content: space-between; gap: 8px; text-align: left; padding: 8px 12px; border-radius: 8px; color: #c9cfda; font-size: 14px; }
.live-cats button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-cats button small { color: var(--muted); }
.live-cats button:hover { background: var(--panel); color: #fff; }
.live-cats button.active { background: var(--panel2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.live-list { display: flex; flex-direction: column; }
.live-list-head { position: sticky; top: 0; z-index: 2; padding: 10px; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.live-list-head .input, .live-list-head .select { width: 100%; }
.live-cat-select { display: none; }
.chan-rows { padding: 6px; }
.chan-row { display: grid; grid-template-columns: 34px 52px 1fr 28px; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 8px; }
.chan-row:hover { background: var(--panel); }
.chan-row.active { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.chan-row .n { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.chan-row .lg { position: relative; height: 34px; border-radius: 6px; background: #1d2230; overflow: hidden; }
.chan-row .lg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.chan-row .lg .ph { font-size: 11px; padding: 2px; }
.chan-row .nm { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-btn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #5c6476; }
.star-btn:hover { color: #fff; }
.star-btn.on { color: #ffc94a; }
.star-btn.on svg { fill: currentColor; }
.star-btn svg { width: 17px; height: 17px; }
.live-main { overflow-y: auto; padding: 16px 20px 30px; }
.live-player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.live-player video { width: 100%; height: 100%; display: block; background: #000; }
.live-player .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.live-player .player-spinner { margin: -19px 0 0 -19px; }
.live-info { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.live-info .lg { position: relative; width: 74px; height: 46px; border-radius: 8px; background: #1d2230; overflow: hidden; flex: none; }
.live-info .lg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.live-info h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.live-info .now-line { color: var(--muted); font-size: 14px; }
.live-info .btns { margin-left: auto; display: flex; gap: 4px; }
.epg { margin-top: 12px; }
.epg-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.epg-item .t { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.epg-item .ti { font-weight: 600; }
.epg-item .ds { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.epg-item.now .t { color: var(--accent2); font-weight: 700; }
.epg-bar { height: 3px; background: rgba(255, 255, 255, .15); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.epg-bar i { display: block; height: 100%; background: var(--grad); }

/* ---------- formulieren / instellingen ---------- */
.auth-card { width: min(420px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.auth-card .brand { margin-bottom: 22px; }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; }
.auth-card p { margin: 0 0 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13.5px; font-weight: 600; color: #c9cfda; }
.field small { color: var(--muted); font-size: 12.5px; }
.field .input { width: 100%; height: 44px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: #ff7d8f; min-height: 1.2em; margin: 0 0 10px; font-size: 14px; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.panel h3 { margin: 0 0 14px; font-size: 17px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel); margin-bottom: 16px; }
.seg button { height: 34px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.active { background: var(--panel2); color: #fff; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.ok { color: #4cd38a; }
.bad { color: #ff7d8f; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; }

.section-title { font-size: 19px; margin: 34px 0 12px; }
.section-title:first-child { margin-top: 0; }

/* ---------- responsief ---------- */
@media (max-width: 1180px) {
  .live { grid-template-columns: 320px 1fr; }
  .live-cats { display: none; }
  .live-cat-select { display: block; }
  .nav { gap: 16px; }
  .search input { width: 150px; }
}
@media (max-width: 860px) {
  :root { --top-h: 58px; }
  .nav { display: none; }
  .tabbar { display: flex; }
  .view { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .top { gap: 12px; }
  .brand span { display: none; }
  .search { flex: 1; }
  .top-right { flex: 1; }
  .search input { width: 100%; min-width: 0; }
  .live { display: flex; flex-direction: column; height: auto; border: 0; }
  .live-main { order: -1; position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding: 0 0 8px; overflow: visible; }
  .live-player { border-radius: 0; }
  .live-info { padding: 0 12px; margin-top: 8px; }
  .live-info h2 { font-size: 16px; }
  .epg { display: none; }
  .live-list { border: 0; overflow: visible; }
  .live-list-head { top: auto; position: static; }
  .hero { min-height: 380px; height: 62vh; }
  .hero-plot { -webkit-line-clamp: 2; font-size: 14.5px; }
  .d-head { padding: 60px 18px 8px; gap: 14px; }
  .d-poster { width: 96px; }
  .d-body { padding: 14px 18px 24px; }
  .ep { grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 4px; }
  .ep-num { display: none; }
  .modal { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100%; }
  .player-next { bottom: 70px; right: 14px; }
}

/* ---------- gebruikersbeheer ---------- */
.user-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.user-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--grad); color: #fff; }
.user-main { min-width: 0; }
.user-name { font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-name .pill { border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; padding: 0 6px; font-size: 11.5px; font-weight: 600; color: var(--accent2); border-color: rgba(255, 138, 61, .45); }
.user-sub { font-size: 12.5px; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-actions .btn-small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-danger { color: #ff8b9a; }
.btn-danger:hover { background: rgba(255, 61, 90, .18); }
.user-add h4 { margin: 0 0 12px; font-size: 15px; }
@media (max-width: 560px) {
  .user-row { grid-template-columns: 40px 1fr; }
  .user-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Logo/poster geladen: placeholder-tekst erachter niet meer tonen */
.img-ok > .ph { visibility: hidden; }

/* ---------- casten ---------- */
.cast-slot { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.airplay-btn svg { width: 22px; height: 22px; }
.airplay-btn .fill { fill: currentColor; stroke: none; }

/* ---------- tv-bediening (Android-app of ?tv=1) ---------- */
body.tv { cursor: none; }
body.tv :focus { outline: none; }
body.tv .card:focus .poster,
body.tv .wide-card:focus .wide-img,
body.tv .chan-tile:focus .chan-logo { transform: scale(1.07); box-shadow: 0 0 0 4px var(--accent2), 0 14px 30px rgba(0, 0, 0, .6); }
body.tv .card:focus .card-title, body.tv .chan-tile:focus .chan-name { color: #fff; }
body.tv .btn:focus, body.tv .chip:focus, body.tv .icon-btn:focus, body.tv .select:focus, body.tv .input:focus,
body.tv .row-more:focus, body.tv .seg button:focus, body.tv .search:focus-within {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent2); transform: scale(1.04);
}
body.tv .nav a:focus { color: #fff; border-color: var(--accent2); }
body.tv .brand:focus { box-shadow: 0 0 0 3px #fff; border-radius: 8px; }
body.tv .chan-row:focus, body.tv .live-cats button:focus, body.tv .ep:focus, body.tv .user-row button:focus {
  background: var(--panel2); box-shadow: inset 0 0 0 2px var(--accent2);
}
body.tv .row-arrow { display: none; }
body.tv .row-track { padding-top: 12px; padding-bottom: 16px; }
body.tv .check input:focus { box-shadow: 0 0 0 3px #fff; }
.tv-preview { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tv-preview .lg { position: relative; width: 220px; height: 120px; }
.tv-preview .lg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tv-preview .lg .ph { font-size: 28px; }
.tv-hint { color: var(--muted); font-size: 15px; }
.apk-steps { padding-left: 20px; color: #c9cfda; font-size: 14px; line-height: 1.7; margin: 8px 0 16px; }
.apk-code { font: 600 22px/1.4 ui-monospace, Consolas, monospace; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; word-break: break-all; }
.apk-code b { color: var(--accent2); letter-spacing: .08em; }
body.tv .row-more { display: none; }
.more-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; align-self: start;
  aspect-ratio: 2 / 3; border-radius: var(--radius); border: 2px dashed rgba(255, 255, 255, .18);
  color: var(--muted); font-weight: 650; text-align: center; transition: transform .2s;
}
.row-track.wide .more-tile { aspect-ratio: 16 / 9; }
.row-track.chans .more-tile { aspect-ratio: 16 / 10; }
.more-tile svg { transform: scaleX(-1); width: 26px; height: 26px; }
body.tv .more-tile:focus { color: #fff; border: 2px solid var(--accent2); transform: scale(1.07); }
body.tv .live-info .btns > :not(.star-btn) { display: none; }

/* Label "NL ondertiteld" op posters en in de filminfo */
.badge-nl {
  position: absolute; left: 8px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px 2px 5px; border-radius: 5px; font-size: 12px; font-weight: 800; letter-spacing: .03em;
  background: rgba(0, 0, 0, .75); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 138, 61, .7);
}
.badge-nl svg { width: 15px; height: 15px; color: var(--accent2); }
.meta .pill-nl { border-color: rgba(255, 138, 61, .6); color: #ffc49a; }
.apk-builder { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.build-log { max-height: 180px; overflow: auto; background: #07090d; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 12px/1.45 ui-monospace, Consolas, monospace; color: #9aa3b2; white-space: pre-wrap; }

/* ---------- inlogscherm: posterwand + glazen venster ---------- */
.view-auth { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; overflow: hidden; }
.auth-bg {
  position: fixed; inset: -25vh -15vw; display: flex; gap: 18px; justify-content: center;
  transform: rotate(-11deg); opacity: 0; transition: opacity 1.4s ease; pointer-events: none;
}
.auth-bg.ready { opacity: .55; }
.auth-col { display: flex; flex-direction: column; gap: 18px; width: clamp(110px, 11vw, 170px); flex: none; animation: authDrift 90s linear infinite; }
.auth-col img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .55); }
@keyframes authDrift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .auth-col { animation: none; } }
.auth-shade {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 12% 18%, rgba(255, 61, 90, .22), transparent 70%),
    radial-gradient(ellipse 50% 55% at 88% 90%, rgba(255, 138, 61, .14), transparent 70%),
    linear-gradient(90deg, rgba(11, 13, 18, .96) 0%, rgba(11, 13, 18, .72) 42%, rgba(11, 13, 18, .62) 70%, rgba(11, 13, 18, .82) 100%);
}
.auth-wrap { position: relative; z-index: 1; width: min(1120px, 100%); display: grid; grid-template-columns: 1fr minmax(320px, 420px); gap: 72px; align-items: center; }
.auth-hero .auth-logo { display: flex; align-items: center; gap: 14px; font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.auth-hero .auth-logo img { width: 54px; height: 54px; filter: drop-shadow(0 8px 24px rgba(255, 61, 90, .45)); }
.auth-hero h2 { font-size: clamp(36px, 4.8vw, 64px); line-height: 1.03; letter-spacing: -.035em; margin: 28px 0 14px; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.auth-hero p { font-size: 19px; color: #cfd5df; max-width: 520px; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: #e3e7ee; font-size: 16px; }
.auth-points li::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--grad); margin-right: 12px; vertical-align: 2px; box-shadow: 0 0 12px rgba(255, 90, 74, .7); }
.view-auth .auth-card {
  background: rgba(16, 19, 26, .72); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px; padding: 36px 32px;
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 40px 100px rgba(0, 0, 0, .65);
}
.view-auth .auth-card .input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); height: 48px; }
.view-auth .auth-card .btn-primary { height: 50px; font-size: 16px; margin-top: 6px; box-shadow: 0 10px 30px rgba(255, 61, 90, .35); }
@media (min-width: 901px) { .view-auth .auth-card .brand { display: none; } }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 26px; justify-items: center; }
  .auth-hero { text-align: center; }
  .auth-hero .auth-logo { justify-content: center; }
  .auth-hero h2 { font-size: 30px; margin: 18px 0 8px; }
  .auth-hero p { font-size: 16px; }
  .auth-points, .view-auth .auth-card .brand { display: none; }
  .auth-shade { background: linear-gradient(180deg, rgba(11, 13, 18, .7), rgba(11, 13, 18, .92)); }
}

/* ---------- profielfoto rechtsboven ---------- */
.avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icon-btn.avatar-btn:hover .avatar, .icon-btn.avatar-btn.active .avatar { box-shadow: 0 0 0 2px var(--accent2); }
.user-avatar { position: relative; overflow: hidden; }
.user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.profile-row .avatar { width: 56px; height: 56px; font-size: 22px; }
.user-actions .user-content { height: 30px; padding: 0 26px 0 10px; font-size: 13px; border-radius: 7px; }

/* ---------- TV-gids ---------- */
.view-gids { padding-bottom: 0; }
.guide { padding: 0 var(--gutter); }
.guide-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; }
.guide-head h1 { margin: 0; font-size: 28px; }
.guide-day { color: var(--muted); font-weight: 600; text-transform: capitalize; }
.guide-btns { margin-left: auto; display: flex; gap: 8px; }
.guide-btns .btn { height: 36px; padding: 0 14px; font-size: 14px; }
.guide-scroll {
  display: grid; grid-template-columns: 96px auto; grid-template-rows: 34px auto;
  overflow: auto; max-height: calc(100vh - var(--top-h) - 90px); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg2); overscroll-behavior: contain; scrollbar-width: thin;
}
.guide-corner { position: sticky; top: 0; left: 0; z-index: 4; background: var(--panel); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.guide-ruler-wrap { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); }
.guide-ruler { position: relative; height: 33px; }
.guide-ruler span { position: absolute; top: 0; height: 100%; padding: 7px 0 0 6px; border-left: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.guide-chans { position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--line); }
.guide-ch { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 4px; height: 62px; padding: 0 8px 0 4px; border-bottom: 1px solid var(--line); }
.guide-ch .n { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.guide-ch .lg, .guide-detail-ch .lg { position: relative; height: 38px; border-radius: 6px; background: #1d2230; overflow: hidden; }
.guide-ch .lg img, .guide-detail-ch .lg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.guide-ch .lg .ph, .guide-detail-ch .lg .ph { font-size: 11px; padding: 2px; }
.guide-ch:hover .lg { box-shadow: 0 0 0 2px var(--accent2); }
.guide-grid { position: relative; }
.guide-row { position: relative; height: 62px; border-bottom: 1px solid var(--line); }
.guide-empty { position: sticky; left: 96px; display: inline-block; padding: 20px 12px; color: var(--muted); font-size: 13px; }
.guide-prog {
  position: absolute; top: 4px; bottom: 4px; padding: 6px 9px; border-radius: 7px; text-align: left; overflow: hidden; overflow: clip; /* clip: titel kan "sticky" blijven */
  background: var(--panel2); color: var(--text); display: flex; flex-direction: column; justify-content: center; gap: 1px;
  transition: background .12s;
}
.guide-prog b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-prog small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.guide-prog:hover { background: #283043; }
.guide-prog.past { opacity: .55; }
.guide-prog.now { background: linear-gradient(135deg, rgba(255, 61, 90, .28), rgba(255, 138, 61, .22)); box-shadow: inset 3px 0 0 var(--accent); }
.guide-prog:focus-visible, body.tv .guide-prog:focus { outline: 3px solid var(--accent2); outline-offset: -1px; z-index: 1; }
.guide-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; box-shadow: 0 0 8px var(--accent); }
.guide-card { max-width: 640px; margin-top: 10vh; }
.guide-detail { padding: 26px 28px 28px; }
.guide-detail h2 { margin: 12px 0 4px; font-size: 24px; }
.guide-detail p { color: #cdd3de; line-height: 1.6; }
.guide-detail .epg-bar { margin: 12px 0 4px; }
.guide-detail-ch { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.guide-detail-ch .lg { width: 64px; height: 40px; flex: none; }
@media (max-width: 700px) {
  .guide-head h1 { font-size: 22px; }
  .guide-btns { margin-left: 0; width: 100%; }
  .guide-btns .btn { flex: 1; }
  .guide-scroll { grid-template-columns: 64px auto; max-height: calc(100vh - var(--top-h) - 190px); }
  .guide-ch { grid-template-columns: 1fr; padding: 0 5px; }
  .guide-ch .n { display: none; }
  .guide-empty { left: 64px; }
  .guide-card { margin-top: 0; }
}
/* Titel blijft zichtbaar als een programma links buiten beeld begon */
.guide-prog .in { position: sticky; left: 104px; display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 100%; width: max-content; align-self: flex-start; }
@media (max-width: 700px) { .guide-prog .in { left: 70px; } }

/* ---------- Openbare app: serienummers ---------- */
.licenses { grid-column: 1 / -1; }
.lic-new { display: grid; grid-template-columns: 1.4fr 90px 1.4fr auto; gap: 10px; margin: 16px 0 6px; }
.lic-list { display: grid; gap: 10px; margin-top: 14px; }
.lic { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .02); }
.lic.off { opacity: .65; }
.lic.fresh { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(255, 138, 61, .18); }
.lic-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lic-serial { font: 600 15px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; padding: 7px 10px; border-radius: 7px; background: #07090d; border: 1px solid var(--line); color: var(--text); cursor: copy; }
.lic-name { flex: 1; min-width: 160px; }
.lic-count { font-size: 13px; color: var(--muted); }
.lic-count.full { color: var(--accent2); }
.lic-devs { margin-top: 10px; display: grid; gap: 6px; }
.lic-dev { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .03); font-size: 14px; }
.lic-dev .muted { font-size: 12.5px; }
.lic-none { margin: 8px 0 0; font-size: 13.5px; }
.lic-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn.danger { color: #ff7d8f; }
@media (max-width: 700px) { .lic-new { grid-template-columns: 1fr 80px; } .lic-new .btn { grid-column: 1 / -1; } }
.auth-more { display: inline-block; margin-top: 18px; color: #ffb38a; font-weight: 600; text-decoration: none; }
.auth-more:hover { text-decoration: underline; }
/* Castknop: altijd zichtbaar; oranje zolang er naar een tv wordt gecast */
.cast-any svg { width: 22px; height: 22px; }
.cast-any .fill { fill: currentColor; stroke: currentColor; stroke-width: 3; }
body.casting .cast-any { color: var(--accent2); }

/* ---------- demo-omgeving ---------- */
.demo-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(920px, calc(100% - 24px));
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 14px; border-radius: 12px;
  background: rgba(22, 26, 35, .94); border: 1px solid rgba(255, 138, 61, .45); box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13.5px; line-height: 1.4;
}
.demo-bar b { flex: none; padding: 3px 9px; border-radius: 6px; background: var(--grad); color: #fff; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.demo-bar span { flex: 1; color: #c9cfda; }
.demo-bar a { flex: none; color: #fff; font-weight: 650; text-decoration: none; padding: 6px 10px; border-radius: 7px; background: rgba(255, 255, 255, .08); }
.demo-bar a:hover { background: rgba(255, 255, 255, .16); }
.demo-x { flex: none; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); font-size: 20px; line-height: 1; }
.demo-x:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.player:not(.hidden) ~ .demo-bar { display: none; }
@media (max-width: 860px) {
  .demo-bar { bottom: calc(70px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px 10px; }
  .demo-bar span { flex-basis: calc(100% - 90px); font-size: 12.5px; }
}

/* ---------- opnames ---------- */
.rec-c { fill: #ff3d5a; stroke: none; }
.icon-btn.rec-btn .rec-c { fill: #c9ced8; }
.icon-btn.rec-btn.on .rec-c { fill: #ff3d5a; animation: rec-pulse 1.6s ease-in-out infinite; }
.btn-rec.on { background: rgba(255, 61, 90, .18); color: #ffb3bf; }
@keyframes rec-pulse { 50% { opacity: .35; } }
.guide-prog.rec .in b::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.rec-list { display: flex; flex-direction: column; gap: 12px; }
.rec-item { display: grid; grid-template-columns: 168px 1fr auto; gap: 16px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--panel); }
.rec-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--panel2); }
.rec-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px 22px; }
.rec-thumb .play-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.rec-thumb:hover .play-ic, .rec-thumb:focus-visible .play-ic { opacity: 1; }
.rec-thumb[disabled] { cursor: default; }
.rec-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rec-title { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: rec-pulse 1.6s ease-in-out infinite; }
.rec-status { font-size: 13px; color: var(--accent2); }
.rec-error { font-size: 13px; color: #ff8b9a; }
.rec-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-btns { display: flex; gap: 8px; }
.rec-failed .rec-thumb { opacity: .5; }
body.tv .rec-item:focus-within { box-shadow: 0 0 0 3px var(--accent2); }
@media (max-width: 700px) {
  .rec-item { grid-template-columns: 110px 1fr; gap: 12px; }
  .rec-btns { grid-column: 1 / -1; }
  .rec-btns .btn { flex: 1; justify-content: center; }
}
