/* ---------- Farben: Dunkel (Standard) und Hell ---------- */
:root, :root[data-theme=dark] {
  color-scheme: dark;
  --bg: #15171a; --panel: #1d2024; --panel2: #24282d; --line: #31363c; --line2: #23272c; --text: #e6e8eb; --muted: #9aa2ac;
  --accent: #4f8cff; --accent2: #2f6be0; --on-accent: #fff; --ok: #2fa66a; --warn: #e0a43a; --bad: #d64a5a; --chip: #2b3036;
  --hover: #1b1e22; --sel: rgba(79,140,255,.14); --logo-bg: #0f1113; --handle: #555c66; --eye-off: #5a616b;
  --ok-text: #7fd8a8; --ok-bg: rgba(47,166,106,.18); --bad-text: #ff8b97; --bad-bg: rgba(214,74,90,.15); --warn-bg: rgba(224,164,58,.15); --run-text: #9dbdff; --run-bg: rgba(79,140,255,.15);
  --q-uhd-bg: #4a2f7a; --q-uhd: #d7c2ff; --q-fhd-bg: #1f4a7a; --q-fhd: #b9d7ff; --q-hd-bg: #1f5a4a; --q-hd: #b6f0dc; --q-sd-bg: #5a3d1f; --q-sd: #ffd9a8;
  --shadow: 0 8px 28px rgba(0,0,0,.45); --backdrop: rgba(0,0,0,.55);
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #f3f5f8; --panel: #ffffff; --panel2: #eef1f5; --line: #d9dee5; --line2: #e8ebf0; --text: #1c2229; --muted: #5f6b78;
  --chip: #e9edf2; --hover: #f5f8fc; --sel: rgba(47,107,224,.12); --logo-bg: #e9edf2; --handle: #a3acb8; --eye-off: #a3acb8;
  --ok-text: #18794a; --ok-bg: rgba(47,166,106,.14); --bad-text: #c0323f; --bad-bg: rgba(214,74,90,.12); --warn-bg: rgba(224,164,58,.18); --run-text: #2357c5; --run-bg: rgba(79,140,255,.14);
  --q-uhd-bg: #ece3ff; --q-uhd: #5b34a8; --q-fhd-bg: #e0ecff; --q-fhd: #1f4f9a; --q-hd-bg: #dcf4ea; --q-hd: #186a4c; --q-sd-bg: #fdebd5; --q-sd: #8a5310;
  --shadow: 0 8px 28px rgba(20,30,50,.16); --backdrop: rgba(20,30,45,.35);
}
:root { --radius: 8px; --row-h: 34px; --row-pad: 6px; font-size: 14px; }
:root[data-density=compact] { --row-h: 28px; --row-pad: 3px; }
:root[data-density=comfortable] { --row-h: 42px; --row-pad: 10px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
button { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent2); border-color: var(--accent2); color: var(--on-accent); }
button.primary:hover { background: var(--accent); }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad-text); }
button.small { padding: 3px 8px; font-size: 12px; }
button.on { background: var(--accent2); border-color: var(--accent2); color: var(--on-accent); }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=email], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent2); }
label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
a { color: var(--accent); }

/* ---------- Icons (Lucide) ---------- */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 1em; height: 1em; vertical-align: -0.15em; }
button .ico { vertical-align: -0.22em; }
.menu .mi .ico { width: 1.1em; height: 1.1em; opacity: .85; }
nav a .ic .ico { width: 18px; height: 18px; vertical-align: -3px; }
.eye .ico { width: 17px; height: 17px; }

/* ---------- Grundgerüst ---------- */
.app { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: 54px 1fr; height: 100vh; height: 100dvh; }
header { grid-column: 1 / 3; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
header .logo { width: 180px; flex: none; display: flex; align-items: center; gap: 8px; }
:root { --brand: #ffc53d; --brand-ink: #3a2a08; }
:root[data-theme=light] { --brand: #e0a100; --brand-ink: #ffffff; }
.brandmark { width: 26px; height: 26px; flex: none; }
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -.4px; line-height: 1; color: var(--text); }
header .grow { flex: 1; }
header button .ic { margin-right: 6px; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--chip); color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.dirty { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--bad-bg); color: var(--bad-text); }
.pill.run { background: var(--run-bg); color: var(--run-text); }
nav { background: var(--panel); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; }
nav a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 6px; color: var(--text); text-decoration: none; margin-bottom: 2px; }
nav a .lb { flex: 1; }
nav a .ls { display: none; }
nav a:hover { background: var(--panel2); }
nav a.active { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
nav .badge { background: var(--accent2); color: var(--on-accent); border-radius: 99px; font-size: 11px; padding: 1px 7px; }
nav .version { margin-top: auto; padding: 8px 12px; font-size: 11px; color: var(--muted); }
main { overflow: hidden; display: flex; min-height: 0; min-width: 0; }
.m-only { display: none !important; }
.view { flex: 1; display: flex; min-width: 0; min-height: 0; }
.col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.col:last-child { border-right: 0; }
.col .bar { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.col .scroll { overflow: auto; flex: 1; }
.cats { flex: none; }
.items { flex: 1; min-width: 0; }
.detail { flex: none; background: var(--panel); }
.detail .dbody { overflow: auto; flex: 1; }
.detail .inner { padding: 14px; }
.search { width: 240px !important; }

/* ---------- Listen ---------- */
.row { display: flex; align-items: center; gap: 8px; padding: var(--row-pad) 10px; border-bottom: 1px solid var(--line2); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--sel); }
.row.hidden .nm { color: var(--muted); text-decoration: line-through; }
.row.dragover { box-shadow: inset 0 2px 0 var(--accent); }
.row .handle { color: var(--handle); cursor: grab; font-size: 13px; }
.row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .cnt { color: var(--muted); font-size: 12px; }
.row img, .logo-ph { width: 34px; height: 22px; object-fit: contain; background: var(--logo-bg); border-radius: 3px; flex: none; }
.eye { background: none; border: 0; padding: 2px 4px; color: var(--muted); font-size: 15px; }
.eye.off { color: var(--eye-off); }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--chip); color: var(--muted); }
.tag.grp { background: var(--ok-bg); color: var(--ok-text); }
.tag.off { background: var(--bad-bg); color: var(--bad-text); }
.tag.ok { background: var(--ok-bg); color: var(--ok-text); }
.tag.q-UHD { background: var(--q-uhd-bg); color: var(--q-uhd); } .tag.q-FHD { background: var(--q-fhd-bg); color: var(--q-fhd); } .tag.q-HD { background: var(--q-hd-bg); color: var(--q-hd); }
.tag.q-SD, .tag.q-MOBILE { background: var(--q-sd-bg); color: var(--q-sd); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.page { flex: 1; overflow: auto; padding: 20px 24px; }
.page h2 { margin: 0 0 4px; font-size: 20px; }
.page .sub { color: var(--muted); margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; max-width: 980px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.hint ol { margin: 6px 0; padding-left: 18px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); padding: 7px 9px; border-radius: 6px; word-break: break-all; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.dupe { display: grid; grid-template-columns: 26px 240px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dupe .members { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.chip.first { outline: 1px solid var(--ok); }
.log { border-bottom: 1px solid var(--line); padding: 10px 0; }
.log summary { cursor: pointer; }
.log .det { color: var(--muted); font-size: 12px; margin: 6px 0 0 16px; white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; bottom: 18px; right: 18px; background: var(--panel2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 8px; max-width: 420px; z-index: 60; box-shadow: var(--shadow); }
.toast.err { border-color: var(--bad); }
.variants .v { display: flex; align-items: center; gap: 6px; padding: 5px 0; font-size: 13px; }
.variants .v .nm { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 8px 0; }
.qorder { display: flex; gap: 6px; flex-wrap: wrap; }
.more { padding: 12px; text-align: center; }

/* ---------- Splitter, Spalten, Filter, Dialoge ---------- */
.splitter { width: 6px; flex: none; cursor: col-resize; background: transparent; position: relative; margin: 0 -3px; z-index: 5; }
.splitter:hover, .splitter.drag { background: var(--accent); opacity: .6; }
.thead { display: grid; position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.thead > div { padding: 6px 8px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.thead .rz { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.thead .rz:hover { background: var(--accent); }
.irow { display: grid; align-items: center; border-bottom: 1px solid var(--line2); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-height: var(--row-h); }
.irow > div { padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow:hover { background: var(--hover); }
.irow.sel { background: var(--sel); }
.irow.hidden .c-name { color: var(--muted); text-decoration: line-through; }
.irow.sepr .c-name { color: var(--muted); font-style: italic; }
.irow.dragover { box-shadow: inset 0 2px 0 var(--accent); }
.irow img, .irow .logo-ph { width: 40px; height: 24px; object-fit: contain; background: var(--logo-bg); border-radius: 3px; display: block; }
.c-handle { color: var(--handle); cursor: grab; }
.c-muted { color: var(--muted); font-size: 12px; }
.vis { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 8px; font-size: 11px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.vis.on { color: var(--ok-text); border-color: rgba(47,166,106,.5); background: transparent; }
.vis.off { color: var(--bad-text); border-color: rgba(214,74,90,.5); background: transparent; }
.filterbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.cchip { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; white-space: nowrap; }
.cchip.on { background: var(--accent2); border-color: var(--accent2); color: var(--on-accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; border-radius: 0; padding: 4px 10px; font-size: 12px; background: var(--bg); }
.seg button.on { background: var(--accent2); color: var(--on-accent); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; padding: 7px 10px; }
.section { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.section h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; max-height: 260px; overflow: auto; }
.logo-grid .lg { background: var(--logo-bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px; cursor: pointer; text-align: center; }
.logo-grid .lg:hover { border-color: var(--accent); }
.logo-grid .lg img { width: 100%; height: 40px; object-fit: contain; }
.logo-grid .lg span { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-list { max-height: 260px; overflow: auto; margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; }
.epg-list div { padding: 6px 8px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.epg-list div:hover { background: var(--accent2); color: var(--on-accent); }
.epg-list img { width: 32px; height: 20px; object-fit: contain; }
.preview { height: 70px; display: flex; align-items: center; justify-content: center; background: var(--logo-bg); border-radius: 6px; margin-bottom: 6px; }
.modal-bg { position: fixed; inset: 0; background: var(--backdrop); z-index: 40; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: min(1100px, 94vw); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal header { position: static; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: transparent; height: auto; grid-column: auto; }
.modal .body { overflow: auto; padding: 0; flex: 1; }
.modal footer { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ptable td, .ptable th { padding: 6px 10px; border-bottom: 1px solid var(--line2); text-align: left; }
.ptable th { position: sticky; top: 0; background: var(--panel2); color: var(--muted); font-weight: 600; z-index: 1; }
.ptable img { width: 44px; height: 26px; object-fit: contain; background: var(--logo-bg); border-radius: 3px; }
.ptable tr.pedit > td { background: var(--panel2); padding: 10px 12px 12px; }
.ptable .picker .logo-grid .lg img { width: 100%; height: 40px; background: none; }
.ptable .picker .epg-list img { width: 32px; height: 20px; }
.badge-src { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--chip); color: var(--muted); }
.src-row { display: grid; grid-template-columns: 24px 180px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.accents { display: flex; gap: 10px; flex-wrap: wrap; }
.accents .acc { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 2px var(--panel); }
.accents .acc.on { border-color: var(--text); }
.seg.tabs { display: flex; flex-wrap: wrap; }

/* ---------- Menüs, Vorschläge als Liste/Detail ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; min-width: 250px; z-index: 30; box-shadow: var(--shadow); padding: 4px 0; max-height: 75vh; overflow: auto; }
.menu .mi { padding: 8px 14px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.menu .mi:hover { background: var(--accent2); color: var(--on-accent); }
.menu .mi.dis { color: var(--muted); cursor: default; }
.menu .mi.dis:hover { background: none; color: var(--muted); }
.menu .mh { padding: 6px 14px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.md { display: flex; flex: 1; min-height: 0; }
.md-list { width: 300px; flex: none; border-right: 1px solid var(--line); overflow: auto; background: var(--panel); }
.md-list .row .cnt { margin-left: auto; }
.md-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.md-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: var(--panel); }
.md-head > div { display: flex; flex-direction: column; }
.md-head label { margin-top: 0; }
.md-body { flex: 1; overflow: auto; }
.page-top { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.page-top h2 { margin: 0 0 4px; font-size: 20px; }
.mbar { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ---------- Regeln, TMDB, Vorschau, Merkliste ---------- */
.rules { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.rules .card { margin: 0; max-width: none; background: var(--bg); padding: 12px; }
.rule-head { display: flex; gap: 6px; align-items: center; }
.rule-head input[type=text] { flex: 1; font-weight: 600; }
.tmdb-cell { display: inline-flex; gap: 8px; align-items: center; }
.ptable .tmdb-cell img, .ptable .tmdb-cell .logo-ph { width: 34px; height: 50px; object-fit: cover; }
.tmdb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; max-height: 320px; overflow: auto; }
.tmdb-grid .tm { display: flex; flex-direction: column; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 12px; background: var(--panel); }
.tmdb-grid .tm:hover { border-color: var(--accent); }
.tmdb-grid .tm img, .tmdb-grid .tm .logo-ph { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; background: var(--logo-bg); }
.ptable .picker .tmdb-grid img { width: 100%; height: 140px; }
.pv-video { width: 100%; max-height: 70vh; background: #000; display: block; }
.watchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--ok-bg); border-bottom: 1px solid var(--line); font-size: 13px; }
.c-now { font-size: 12px; }
a.small-link { font-size: 12px; color: var(--accent); text-decoration: none; padding: 3px 6px; }

/* ---------- Spalten anpassen, Links ---------- */
.c-link { display: flex !important; gap: 4px; align-items: center; }
.c-link .mono-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono-s { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.icon-btn { background: none; border: 0; padding: 2px 4px; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--accent); }
.colpick { padding-bottom: 8px; }
.cp-row { display: flex; gap: 6px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--line2); }
.cp-row:hover { background: var(--hover); }

/* ---------- Smartphone ---------- */
@media (max-width: 760px) {
  :root { --row-h: 48px; --row-pad: 11px; }
  :root[data-density=compact] { --row-h: 40px; --row-pad: 8px; }
  input[type=text], input[type=password], input[type=number], input[type=url], select { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
  .m-only { display: flex !important; }
  .hide-m, .splitter { display: none !important; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  header { grid-column: 1; height: auto; min-height: 50px; gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); flex-wrap: wrap; }
  header .logo { width: auto; }
  header .logo .wordmark { font-size: 18px; }
  header .logo .brandmark { width: 22px; height: 22px; }
  header .grow { display: none; }
  header #hdrStatus { order: 9; flex-basis: 100%; font-size: 11px; padding: 3px 9px; }
  header button { padding: 7px 10px; margin-left: auto; }
  header button ~ button { margin-left: 0; }
  header button .ic { margin: 0; }
  header button .lbl { display: none; }
  nav { grid-row: 3; flex-direction: row; padding: 0; padding-bottom: env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  nav a { flex: 1 0 auto; min-width: 52px; flex-direction: column; gap: 1px; padding: 7px 4px 6px; margin: 0; border-radius: 0; font-size: 10px; position: relative; }
  nav a .ic { font-size: 18px; line-height: 1.2; }
  nav a .ic .ico { width: 22px; height: 22px; }
  nav a .lb { flex: none; }
  nav a:has(.ls) .lb { display: none; }
  nav a .ls { display: block; }
  nav a.active { box-shadow: inset 0 3px 0 var(--accent); }
  nav .badge { position: absolute; top: 3px; left: 54%; font-size: 9px; padding: 0 5px; }
  nav .version { display: none; }
  main { grid-row: 2; }

  /* Editor: Kategorien → Liste → Details als Seitenfolge */
  .view .col { width: 100% !important; flex: 1 1 auto; border-right: 0; }
  .view.m-cats .items, .view.m-cats .detail, .view.m-items .cats, .view.m-items .detail, .view.m-detail .cats, .view.m-detail .items { display: none; }
  .filterbar { padding: 6px 8px; }
  .col .bar { padding: 6px 8px; }
  .search { width: 100% !important; flex: 1 1 100%; }
  .thead { display: none; }
  .irow { grid-template-columns: 50px 1fr auto !important; grid-template-rows: auto auto auto; column-gap: 0; }
  .irow > div { padding: 2px 8px; }
  .irow > [data-col] { display: none; }
  .irow > [data-col=logo] { display: block; grid-column: 1; grid-row: 1 / 4; }
  .irow > [data-col=name] { display: block; grid-column: 2; grid-row: 1; font-size: 15px; padding-top: 6px; }
  .irow > [data-col=tags] { display: block; grid-column: 2; grid-row: 2; padding-bottom: 6px; }
  .irow > [data-col=tags]:empty { display: none; }
  .irow > [data-col=vis] { display: block; grid-column: 3; grid-row: 1 / 4; }
  .irow > [data-col=now] { display: block; grid-column: 2; grid-row: 3; padding-bottom: 6px; }
  .irow > [data-col=now]:empty { display: none; }
  .irow > [data-col=logo] { position: relative; }
  .irow.multi > [data-col=logo] img, .irow.multi > [data-col=logo] .logo-ph { opacity: .3; }
  .irow.multi > [data-col=logo]::after { content: ''; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 2px solid var(--muted); background: var(--panel); box-sizing: border-box; color: var(--on-accent); font-size: 14px; line-height: 20px; text-align: center; font-weight: 700; }
  .irow.multi.sel > [data-col=logo]::after { content: '✓'; background: var(--accent2); border-color: var(--accent2); }
  .vis { padding: 5px 10px; }
  .row { min-height: 46px; }
  .row .handle { display: none; }
  .eye { font-size: 18px; padding: 6px; }
  .detail .inner { padding: 12px 14px 24px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .page { padding: 14px 12px 24px; }
  .card { padding: 14px 12px; }
  .src-row { grid-template-columns: 24px 1fr auto; }
  .src-row > input[type=text]:nth-of-type(2) { grid-column: 2 / 4; }
  .dupe { grid-template-columns: 26px 1fr; }
  .dupe .members, .dupe > .hint { grid-column: 2; }
  .md { flex-direction: column; }
  .md-list { width: 100%; max-height: 32vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .md-head { padding: 10px 12px; }
  .md-head > div { flex: 1 1 100%; }
  .md-head input, .md-head select { width: 100% !important; }
  .page-top { padding: 10px 12px; }
  .ptable { font-size: 13px; }
  .ptable td, .ptable th { padding: 8px 6px; }

  /* Dialoge und Menüs als Blatt von unten */
  .modal-bg { align-items: flex-end; }
  .modal { width: 100vw; max-height: 92dvh; border-radius: 14px 14px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal footer { justify-content: stretch; }
  .modal footer button { flex: 1; padding: 10px; }
  .menu, .menu.ctx { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important; min-width: 0; max-height: 70dvh; border-radius: 14px; z-index: 45; }
  .menu .mi { padding: 13px 16px; font-size: 15px; white-space: normal; }
  .toast { left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); max-width: none; }
  .accents .acc { width: 40px; height: 40px; }
}
@media (min-width: 761px) { .items .thead, .items .irow { min-width: max-content; } }
.epg-now { color: var(--ok-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cp-grip, .grip { color: var(--handle); cursor: grab; padding: 2px 4px; touch-action: none; user-select: none; }
.grip:hover { color: var(--text); }
body.gripping, body.gripping * { cursor: grabbing !important; user-select: none; }
.dragging { opacity: .45; }
.drop-before { box-shadow: inset 0 3px 0 var(--accent) !important; }
.drop-after { box-shadow: inset 0 -3px 0 var(--accent) !important; }
.members .chip.drop-before { box-shadow: -3px 0 0 var(--accent) !important; }
.members .chip.drop-after { box-shadow: 3px 0 0 var(--accent) !important; }
.chip .grip { padding: 0 2px 0 0; font-size: 11px; }
.cp-row.dragover { box-shadow: inset 0 2px 0 var(--accent); }
.page.embedded { padding: 0; overflow: visible; }
/* ---------- Guide ---------- */
.g-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; max-width: 1200px; }
.g-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 0; max-height: 70vh; overflow: auto; position: sticky; top: 0; }
.g-cat { padding: 10px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.g-item { padding: 7px 14px; cursor: pointer; font-size: 13px; border-left: 3px solid transparent; }
.g-item:hover { background: var(--hover); }
.g-item.sel { background: var(--sel); border-left-color: var(--accent); }
.g-snip { margin-top: 2px; }
.g-art { max-width: none; margin: 0; }
.g-body { line-height: 1.6; font-size: 14px; }
.g-body ul { padding-left: 20px; }
.g-body li { margin: 4px 0; }
.g-body code { background: var(--chip); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
mark { background: rgba(224,164,58,.35); color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 760px) { .g-wrap { grid-template-columns: 1fr; } .g-list { position: static; max-height: 40vh; } }
nav a.nav-sub { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 11px; border-radius: 0 0 6px 6px; color: var(--muted); }
nav a.nav-sub.active { color: var(--text); }
.g-body figure { margin: 14px 0; }
.g-body figure img { max-width: 100%; max-height: 560px; width: auto; height: auto; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.g-body figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (max-width: 760px) { nav a.nav-sub { margin-top: 0; border-top: 0; padding-top: 7px; border-radius: 0; } }
/* Eigene Bestätigungsdialoge */
.modal-bg.ask .modal { max-width: 520px; width: calc(100% - 32px); }
.ask-msg { white-space: pre-line; line-height: 1.55; }
.modal-bg.ask .body input[type=text] { width: 100%; }
.modal-bg.ask .modal > .body { padding: 16px 18px; }

/* ---------- Kopfzeile: Modus, Hinweise, Suche ---------- */
.modeseg button { padding: 6px 12px; }
.modeseg button .ico { margin-right: 4px; }
.hdrchips { display: inline-flex; gap: 6px; min-width: 0; overflow: hidden; }
.hdrchips .chip { border: 1px solid transparent; padding: 4px 9px; border-radius: 99px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.hdrchips .chip.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(224,164,58,.35); }
.hdrchips .chip.err { background: var(--bad-bg); color: var(--bad-text); border-color: rgba(214,74,90,.35); }
#btnSearch .kbd-hint { margin-left: 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
body.watching .edit-only, body.watching nav { display: none !important; }
body.watching .app { grid-template-columns: 1fr; }
body.watching #hdrStatus { display: none; }
.toast .toast-btn { margin-left: 12px; }
.tag.arch { background: var(--run-bg); color: var(--run-text); }
.hist-row.undone b { color: var(--muted); text-decoration: line-through; }
.rep-sec h4 { margin: 12px 0 6px; font-size: 13px; }
.rep-sec h4.bad { color: var(--bad-text); } .rep-sec h4.warn { color: var(--warn); } .rep-sec h4.ok { color: var(--ok-text); }
kbd { display: inline-block; min-width: 18px; text-align: center; font: 600 11px ui-monospace, Consolas, monospace; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--panel2); }
.kbd-tbl { border-collapse: collapse; width: 100%; }
.kbd-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.kbd-tbl td:first-child { white-space: nowrap; width: 1%; }

/* ---------- Globale Suche ---------- */
.modal-bg.gsearch { align-items: flex-start; padding-top: 10vh; }
.modal-bg.gsearch .modal { width: min(720px, calc(100% - 24px)); }
.modal-bg.gsearch .body { padding: 0; }
.gs-input { width: 100%; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 14px 16px !important; font-size: 16px; background: transparent; }
.gs-results { max-height: 60vh; overflow: auto; padding-bottom: 6px; }
.gs-group { padding: 10px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 7px 16px; cursor: pointer; }
.gs-item.on { background: var(--sel); }
.gs-item img, .gs-item .logo-ph { width: 34px; height: 22px; object-fit: contain; background: var(--logo-bg); border-radius: 3px; flex: none; }
.gs-ic { width: 34px; text-align: center; color: var(--muted); flex: none; }
.gs-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-s { font-size: 12px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Programm-Raster (TV-Guide) ---------- */
.gridbox, .w-gridbox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gridbox[hidden] { display: none !important; }
.epggrid { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.eg-bar { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.eg-range { font-size: 13px; margin-left: 6px; }
.eg-legend { display: inline-flex; gap: 6px; align-items: center; }
.eg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.eg-dot.now { background: var(--run-bg); border: 1px solid var(--accent); } .eg-dot.arch { background: var(--ok-bg); border: 1px solid var(--ok); }
.eg-scroll { overflow: auto; flex: 1; position: relative; }
.eg-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); height: 30px; }
.eg-corner { position: sticky; left: 0; z-index: 4; width: 220px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 6px 10px; font-size: 12px; font-weight: 600; }
.eg-times { position: relative; flex: none; }
.eg-tick { position: absolute; top: 0; height: 30px; border-left: 1px solid var(--line); padding: 6px 6px; font-size: 12px; color: var(--muted); }
.eg-row { display: flex; height: 52px; border-bottom: 1px solid var(--line2); }
.eg-row.sel .eg-ch { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.eg-row.hidden .eg-name { color: var(--muted); text-decoration: line-through; }
.eg-ch { position: sticky; left: 0; z-index: 2; width: 220px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--panel); border-right: 1px solid var(--line); cursor: pointer; overflow: hidden; }
.eg-ch:hover { background: var(--hover); }
.eg-ch img, .eg-ch .logo-ph { width: 40px; height: 26px; object-fit: contain; background: var(--logo-bg); border-radius: 3px; flex: none; }
.eg-num { width: 30px; color: var(--muted); font-size: 12px; text-align: right; flex: none; }
.eg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.eg-ai { color: var(--ok-text); }
.eg-line { position: relative; flex: none; }
.eg-nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 1; opacity: .8; }
.eg-prog { position: absolute; top: 4px; bottom: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.eg-prog:hover { border-color: var(--accent); z-index: 2; }
.eg-prog.now { background: var(--run-bg); border-color: var(--accent); }
.eg-prog.past { opacity: .55; }
.eg-prog.past.arch { opacity: 1; background: var(--ok-bg); border-color: rgba(47,166,106,.5); }
.eg-pt { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eg-ps { font-size: 11px; color: var(--muted); white-space: nowrap; }
.eg-loading, .eg-empty { position: absolute; left: 10px; top: 16px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Schauen-Modus ---------- */
.watch { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.w-top { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.w-tabs button { padding: 7px 14px; }
.w-search { width: 240px; }
.w-content { flex: 1; min-height: 0; display: flex; }
.w-live, .w-guide, .w-vod { flex: 1; display: flex; min-width: 0; min-height: 0; }
.w-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.w-col:last-child { border-right: 0; }
.w-gcol { width: 230px; flex: none; overflow: auto; background: var(--panel); }
.w-groupsel { display: none; margin: 8px; }
.w-grp { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line2); }
.w-grp:hover { background: var(--hover); }
.w-grp.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.w-lcol { width: 400px; flex: none; }
.w-chlist { overflow: auto; flex: 1; }
.w-ch { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; outline: none; }
.w-ch:hover, .w-ch:focus { background: var(--hover); }
.w-ch.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.w-ch img, .w-ch .logo-ph { width: 48px; height: 30px; object-fit: contain; background: var(--logo-bg); border-radius: 4px; flex: none; }
.w-num-s { width: 34px; color: var(--muted); font-size: 12px; text-align: right; flex: none; }
.w-chm { flex: 1; min-width: 0; }
.w-chn { font-weight: 600; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 6px; }
.w-chname { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.w-chn > :not(.w-chname) { flex: none; }
/* Status: läuft gerade? */
.lv-badge { display: inline-block; font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 4px; letter-spacing: .3px; flex: none; white-space: nowrap; }
.lv-badge.live { background: #e5383b; color: #fff; }
.lv-badge.live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 4px; vertical-align: 1px; animation: lvpulse 1.6s ease-in-out infinite; }
@keyframes lvpulse { 50% { opacity: .25; } }
.lv-badge.soon { background: var(--chip); color: var(--text); font-weight: 600; }
.lv-badge.off { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.lv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lv-dot.ok { background: #2fbf71; box-shadow: 0 0 0 2px rgba(47,191,113,.2); }
.lv-dot.fail { background: #e5383b; box-shadow: 0 0 0 2px rgba(229,56,59,.2); }
.w-ch.ev-off .w-chname, .w-ch.ev-off img, .eg-ch.ev-off .eg-name, .eg-ch.ev-off img { opacity: .55; }
.w-evbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; font-size: 12px; }
.eg-ch .lv-badge { font-size: 9px; padding: 2px 4px; }
.w-fav { color: var(--bad-text); } .w-arch { color: var(--ok-text); }
.w-now { font-size: 12px; color: var(--muted); margin-top: 2px; }
.w-nt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-prog { height: 3px; background: var(--line); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.w-prog i { display: block; height: 100%; background: var(--accent); }
.w-pcol { flex: 1; min-width: 0; overflow: auto; background: var(--bg); container-type: size; }
/* Player passt sich an die Fenstergröße an (Breite UND Höhe) – Sendungsinfo bleibt darunter sichtbar */
.w-stagebox { padding: 12px 12px 0; display: flex; justify-content: center; }
.w-pcol .w-stage { width: min(100%, max(320px, (100cqh - 215px) * 16 / 9)); }
.w-pcol .w-info { max-width: min(100%, max(320px, (100cqh - 215px) * 16 / 9)); margin: 0 auto; width: 100%; box-sizing: border-box; }
.w-stage { position: relative; background: #000; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; outline: none; }
.w-stage:fullscreen { border-radius: 0; aspect-ratio: auto; }
.w-video { width: 100%; height: 100%; display: block; background: #000; }
.w-osd { position: absolute; left: 0; right: 0; top: 0; padding: 10px 14px; background: linear-gradient(rgba(0,0,0,.65), transparent); color: #fff; font-size: 14px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.w-stage:hover .w-osd, .w-stage:fullscreen .w-osd { opacity: 1; }
.w-err { position: absolute; left: 16px; right: 16px; bottom: 56px; background: rgba(20,20,24,.92); color: #fff; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; border: 1px solid var(--bad); }
.w-num { position: absolute; right: 18px; top: 14px; background: rgba(0,0,0,.75); color: #fff; font: 700 34px ui-monospace, Consolas, monospace; padding: 6px 14px; border-radius: 8px; }
.w-info { padding: 12px 14px; display: grid; gap: 8px; }
.w-buf { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.72); color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.w-buf::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 9px; vertical-align: -2px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: wspin .8s linear infinite; }
@keyframes wspin { to { transform: rotate(360deg); } }
.w-buf[hidden] { display: none; }
.w-bufsel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 0; }
.w-bufsel select { width: auto !important; min-width: 0; padding: 3px 6px; font-size: 12px; margin: 0; }
.w-ihead { display: flex; gap: 12px; align-items: center; }
.w-ihead img, .w-ihead .logo-ph { width: 64px; height: 40px; object-fit: contain; background: var(--logo-bg); border-radius: 4px; }
.w-iname { font-size: 17px; font-weight: 700; }
.w-pn { display: grid; gap: 2px; }
.w-gmain, .w-pmain { flex: 1; min-width: 0; }
.w-views[hidden] { display: none !important; }
.w-views button { padding: 7px 12px; }
/* TV-Guide im Live-TV-Reiter: Vorschau oben, Raster darunter */
.w-gtop { flex: none; display: flex; height: clamp(190px, 34vh, 400px); border-bottom: 1px solid var(--line); background: var(--bg); container-type: size; }
.w-gtop .w-stagebox { flex: none; padding: 12px 0 12px 12px; }
.w-gtop .w-stage { width: min(58cqw, (100cqh - 24px) * 16 / 9); }
.w-gtop .w-info { flex: 1; min-width: 0; overflow: auto; align-content: start; }
.v-guide .w-gridbox { flex: 1; min-height: 0; }
/* Kinomodus: nur Bild und Sendungsinfo, passt sich an das Fenster an */
.v-cinema .w-gcol, .v-cinema .w-lcol { display: none; }
.v-cinema .w-pcol { background: #000; }
.v-cinema .w-stagebox { padding: 0; }
.v-cinema .w-pcol .w-stage { border-radius: 0; width: min(100%, max(320px, (100cqh - 84px) * 16 / 9)); }
.v-cinema .w-pcol .w-info { max-width: none; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px; grid-template-columns: auto 1fr 1fr auto; align-items: center; gap: 4px 18px; }
.v-cinema .w-info > .w-prog, .v-cinema .w-info > .hint { display: none; }
.v-cinema .w-info > .actions { grid-column: 4; grid-row: 1; margin: 0; }
.w-pbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px 0; font-size: 13px; color: var(--muted); }
.w-pbar label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.w-psec { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); letter-spacing: .02em; margin: 6px 0 -4px; }
.w-psec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.w-psec:first-child { margin-top: 0; }
.w-pbar select { width: auto !important; min-width: 0; max-width: 240px; margin: 0; padding: 5px 8px; }
.w-pcount { margin-left: auto; font-size: 12px; }
.w-metahint { margin: 8px 14px 0; font-size: 12px; }
.w-metahint[hidden] { display: none; }
.w-cast { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-posters { overflow: auto; flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 14px; align-content: start; }
.w-card { cursor: pointer; outline: none; border-radius: 8px; }
.w-card:focus .w-cover, .w-card:hover .w-cover { box-shadow: 0 0 0 2px var(--accent); }
.w-cover { position: relative; aspect-ratio: 2 / 3; background: var(--panel2); border-radius: 8px; overflow: hidden; display: flex; align-items: flex-end; }
.w-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.w-ctitle { padding: 8px; font-size: 13px; color: var(--muted); }
.w-cfav { position: absolute; top: 6px; right: 8px; color: #ff6b7d; text-shadow: 0 1px 3px #000; }
.w-cprog { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; height: 4px; border-radius: 0; }
.w-cname { font-size: 13px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-cmeta { font-size: 11.5px; }
.w-detail { padding: 14px 16px; display: grid; gap: 12px; max-width: 760px; }
.w-dgrid { display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
.w-dcover { width: 170px; border-radius: 8px; }
.w-last { background: var(--sel); }
.w-dayhead { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: default !important; background: var(--panel) !important; }
.w-mini { position: absolute; right: 16px; bottom: 16px; width: 360px; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.w-mini[hidden], .w-theater[hidden] { display: none !important; }
.w-mini .w-stage { border-radius: 0; }
.w-minibar, .w-thbar { display: flex; gap: 6px; align-items: center; padding: 6px 8px; font-size: 13px; }
.w-minibar b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-theater { position: absolute; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; }
.w-theater .w-thbar { background: var(--panel); color: var(--text); }
.w-theater .w-stage { flex: 1; aspect-ratio: auto; border-radius: 0; }
@media (max-width: 1100px) { .w-lcol { width: 320px; } .w-gcol { width: 190px; } }
@media (max-width: 760px) {
  header .modeseg button { padding: 7px 10px; margin: 0; }
  header .modeseg .lbl { display: none; }
  .hdrchips { order: 8; }
  .hdrchips .lbl { display: none; }
  #btnSearch .kbd-hint { display: none; }
  body.watching .app { grid-template-rows: auto 1fr; }
  .w-top { padding: 6px 8px; }
  .w-tabs { flex: 1 1 100%; }
  .w-tabs button { flex: 1; padding: 7px 4px; font-size: 12px; }
  .w-search { flex: 1; width: auto; }
  .w-gcol { display: none; }
  .w-groupsel { display: block; }
  .w-live { flex-direction: column; overflow: auto; }
  .w-live .w-pcol { order: -1; flex: none; overflow: visible; }
  .w-live .w-lcol { width: 100%; flex: none; border-right: 0; }
  .w-live .w-chlist { overflow: visible; }
  .w-stagebox { padding: 0; position: sticky; top: 0; z-index: 5; display: block; }
  .w-pcol { overflow: visible; container-type: normal; }
  .w-pcol .w-stage, .v-cinema .w-pcol .w-stage, .w-gtop .w-stage { width: 100%; border-radius: 0; }
  .w-pcol .w-info { max-width: none; }
  .w-gtop { height: auto; flex-direction: column; container-type: normal; }
  .w-gtop .w-stagebox { padding: 0; }
  .v-cinema .w-lcol { display: flex; }
  .w-views { flex: 1 1 100%; }
  .w-views button { flex: 1; padding: 6px 4px; font-size: 12px; }
  .w-views button:last-child { display: none; }
  .v-cinema .w-pcol .w-info { grid-template-columns: 1fr; }
  .v-cinema .w-info > .actions { grid-column: auto; }
  .w-stage { border-radius: 0; }
  .w-guide, .w-vod { flex-direction: column; }
  .eg-ch, .eg-corner { width: 150px; }
  .w-posters { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 10px; }
  .w-dgrid { grid-template-columns: 1fr; }
  .w-dcover { width: 140px; }
  .w-mini { left: 8px; right: 8px; width: auto; bottom: 8px; }
}
/* Feinschliff */
header .seg { flex: none; flex-wrap: nowrap; }
header #hdrStatus { flex: 0 1 auto; }
header .hdrchips { flex: 0 1 auto; }
header > button, header > .seg { flex-shrink: 0; }
@media (max-width: 1400px) { header .hint.edit-only { display: none; } #btnSearch .kbd-hint { display: none; } }
@media (max-width: 1250px) { header #btnUpdate .lbl, header #btnPublish .lbl { display: none; } header button .ic { margin-right: 0; } }
.w-top { flex-wrap: nowrap; }
.w-top input.w-search { width: 260px; flex: 0 1 260px; }
.w-top select.w-prof { width: auto; flex: none; }
.w-posters > .empty { grid-column: 1 / -1; }
.eg-body, .eg-head { width: max-content; min-width: 100%; }
.eg-row.sel .eg-ch { background: linear-gradient(var(--sel), var(--sel)), var(--panel); }
.eg-empty, .eg-loading { position: sticky; left: 232px; display: inline-block; margin-top: 17px; }
@media (max-width: 760px) {
  .w-top { flex-wrap: wrap; }
  .w-top input.w-search { flex: 1 1 auto; width: auto; }
  .eg-empty, .eg-loading { left: 160px; }
}
header #hdrStatus { max-width: 260px; }
header .hdrchips { flex: 0 0 auto; overflow: visible; }
.w-groupsel { width: calc(100% - 16px) !important; }
@media (max-width: 1650px) { header .hint.edit-only { display: none !important; } #btnSearch .kbd-hint { display: none; } }
@media (max-width: 1560px) { body:not(.watching) .hdrchips .lbl { display: none; } body:not(.watching) .hdrchips .chip { padding: 4px 8px; } }
.modal footer:empty { display: none; }
.w-dgrid.nocover { grid-template-columns: 1fr; }
@media (max-width: 760px) { .w-top > span[style*="flex"] { display: none; } }
/* PIN-Abfrage */
.pin-box { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 6px 0; }
.pin-box label { margin: 8px 0 0; }
.pin-ic .ico { width: 34px; height: 34px; color: var(--accent); }
.pin-txt { max-width: 380px; font-size: 13px; }
input.pin-in { width: 170px !important; text-align: center; font: 600 26px ui-monospace, Consolas, monospace; letter-spacing: 14px; padding: 8px 0 8px 14px !important; }
.pin-err { min-height: 18px; color: var(--bad-text); font-size: 13px; }

/* ===================== TV-App (Fernbedienung) ===================== */
html.tv body { font-size: 15px; }
.tv #modeSeg, .tv #hdrChips, .tv #hdrStatus, .tv .edit-only, .tv #btnLogout, .tv #btnLock, .tv #btnSearch, .tv nav,
.tv .w-top > button.small, .tv .w-bufsel { display: none !important; }
.tv header { padding: 8px 20px; }
.tv .tvclock { margin-left: auto; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.tv *:focus { outline: none; }
/* deutlich sichtbare Auswahl */
.tv button:focus, .tv select:focus, .tv input:focus, .tv a:focus { box-shadow: 0 0 0 3px var(--accent); border-color: var(--accent); position: relative; z-index: 1; }
.tv .w-grp:focus, .tv .w-ch:focus, .tv .eg-ch:focus { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none; }
.tv .w-ch:focus .c-muted, .tv .w-ch:focus .w-now, .tv .w-grp:focus .c-muted, .tv .eg-ch:focus .eg-num { color: var(--on-accent) !important; opacity: .85; }
.tv .w-ch:focus .w-prog i { background: var(--on-accent); }
.tv .w-card { transition: transform .12s; }
.tv .w-card:focus { transform: scale(1.05); }
.tv .w-card:focus .w-cover { box-shadow: 0 0 0 4px var(--accent); }
.tv .eg-prog:focus { box-shadow: inset 0 0 0 3px var(--accent); background: var(--sel); z-index: 1; }
.tv .w-stage:focus { box-shadow: 0 0 0 4px var(--accent); }
.tv .w-ch { padding: 9px 14px; }
.tv .w-grp { padding: 11px 14px; }
/* Vollbild ohne Browser-Vollbild (die App läuft ohnehin bildschirmfüllend) */
.tvfull .w-pcol, .tvfull .w-gtop, .tvfull .w-stagebox { container-type: normal !important; }
.tvfull .w-stage { position: fixed !important; inset: 0; width: auto !important; height: auto; aspect-ratio: auto; z-index: 300; border-radius: 0 !important; box-shadow: none !important; }
.tvfull .w-video { object-fit: contain; }
.tv .w-osd { top: auto; bottom: 0; padding: 60px 48px 36px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 18px; transition: opacity .25s; }
.tv .w-stage:hover .w-osd { opacity: 0; }
.tv .w-osd.show { opacity: 1 !important; }
html.tv body:not(.tvfull) .w-pcol .w-osd, html.tv body:not(.tvfull) .w-gtop .w-osd { display: none; }
.tv-osdhead { display: flex; align-items: center; gap: 14px; font-size: 26px; }
.tv-osdhead img, .tv-osdhead .logo-ph { width: 72px; height: 44px; object-fit: contain; background: rgba(255,255,255,.08); border-radius: 6px; }
.tv-osdnum { font-size: 22px; opacity: .7; font-variant-numeric: tabular-nums; }
.tv-osdnow { margin-top: 10px; font-size: 20px; }
.tv-osdnext { margin-top: 6px; font-size: 16px; color: #c9ced6 !important; }
.tv .w-osd .w-prog { height: 5px; margin-top: 10px; background: rgba(255,255,255,.25); max-width: 900px; }
.tv-seek { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.tv-seek .w-prog { flex: 1; margin: 0; max-width: none; }
.tv .w-theater { position: fixed; inset: 0; z-index: 300; }
.tv .w-theater .w-thbar { display: none; }
.tv .w-num { font-size: 56px; right: 48px; top: 36px; }
.tv .w-buf { font-size: 18px; padding: 12px 22px; }
/* TV: feste Größen statt Container-Einheiten (ältere Fire-TV-WebViews) und keine runden Ecken –
   abgerundete Videoflächen bleiben in manchen Android-WebViews schwarz */
.tv .w-stage { border-radius: 0 !important; }
.tv .w-pcol { container-type: normal; }
.tv .w-pcol .w-stage, .tv .w-gtop .w-stage { aspect-ratio: auto; flex: none; width: 480px; height: 270px; } /* Größe setzt sizeStage() */
.tv .w-gtop { height: 34vh; container-type: normal; }
html.tv body.tvfull .w-stage { width: auto !important; height: auto !important; }
/* allgemein: Fallback für Browser ohne aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .w-stage { min-height: 200px; }
}
/* Einstellungen im Schauen-Modus */
.w-setwrap { flex: 1; overflow: auto; padding: 16px; }
.w-settings { display: grid; gap: 16px; max-width: 860px; }
.w-settings .card { margin: 0; }
.w-srow { display: grid; gap: 6px; margin-top: 14px; }
.w-srow > label { margin: 0; font-weight: 600; }
.w-srow .seg.wide { flex-wrap: wrap; }
.w-sinfo { display: grid; gap: 4px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.tv .accents .acc:focus { box-shadow: 0 0 0 3px var(--panel), 0 0 0 6px var(--accent); }
.epg-nodata { color: var(--warn) !important; }
.orderlist { display: grid; gap: 6px; margin: 10px 0; max-width: 560px; }
.ol-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.ol-n { width: 22px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.ol-name { flex: 1; }

/* Knöpfe oben rechts nur im Schauen-Modus */
.watch-only { display: none; }
body.watching .watch-only { display: inline-flex; }
#btnViewSettings.on, #btnViewHelp.on { background: var(--accent2); border-color: var(--accent2); color: var(--on-accent); }
/* Umschalter Senderliste / TV-Guide unter „Live-TV“ */
.w-views { margin: 8px 10px 4px; }
.w-views button { flex: 1; padding: 5px 8px; font-size: 12px; }
.w-views.only-m { display: none; }
@media (max-width: 760px) { .w-gcol .w-views { display: none; } .w-views.only-m { display: flex; } }
/* Puffer-Regler */
.w-rangebox { display: flex; align-items: center; gap: 14px; }
.w-range { flex: 1; max-width: 420px; accent-color: var(--accent); }
.w-buflbl { min-width: 190px; }
/* Neue Staffeln */
.w-news { padding: 12px 16px; display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.w-newsrow { display: flex; align-items: center; gap: 12px; }
.w-newsrow img { width: 46px; height: 68px; object-fit: cover; border-radius: 6px; }
.w-help .page { padding: 0; }
/* TV: Auswahl auf Knöpfen und Reitern deutlich sichtbar (hell invertiert statt Rahmen in Akzentfarbe) */
.tv button:not(.acc):focus { background: var(--text) !important; color: var(--bg) !important; border-color: var(--text) !important; box-shadow: 0 0 0 3px var(--text), 0 4px 14px rgba(0,0,0,.45) !important; transform: scale(1.05); position: relative; z-index: 2; }
.tv .seg { overflow: visible; }
.tv .accents .acc:focus { transform: scale(1.25); box-shadow: 0 0 0 3px var(--panel), 0 0 0 6px var(--text) !important; }
.tv input[type=range]:focus { box-shadow: 0 0 0 3px var(--text); border-radius: 6px; }
.tv .g-item:focus { background: var(--accent) !important; color: var(--on-accent); }
.tv .w-ch.ev-off:focus .w-chname { opacity: 1; }
/* ===== Player-Bedienleiste (wie YouTube) ===== */
.w-video { pointer-events: none; }
.w-ctrl { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; opacity: 0; transition: opacity .2s; z-index: 4; }
.w-stage.ui .w-ctrl, .w-stage.paused .w-ctrl, .w-stage:focus-within .w-ctrl:focus-within { opacity: 1; }
.w-stage.ui, .w-stage.paused { cursor: default; }
.w-stage:not(.ui):not(.paused) { cursor: none; }
.w-crow { display: flex; align-items: center; gap: 4px; }
.w-cb { background: transparent !important; border: 0 !important; color: #fff !important; padding: 6px 8px; border-radius: 6px; box-shadow: none !important; }
.w-cb:hover { background: rgba(255,255,255,.15) !important; }
.w-cb svg { width: 22px; height: 22px; }
.w-cb.on { color: var(--accent) !important; }
.w-vol { position: relative; display: inline-flex; }
.w-volpop { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 6px); width: 38px; height: 128px; padding: 10px 0 14px; margin-bottom: 4px;
  background: rgba(18,20,23,.88); border-radius: 19px; box-shadow: 0 6px 20px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.w-vol.open .w-volpop { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.w-volpop::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 10px; } /* Brücke zum Knopf */
.w-cvol { width: 100px; flex: none; transform: rotate(-90deg); margin: 0; }
.w-cseek { width: 100%; margin: 0 0 4px; }
.w-cseek[hidden], .w-clive[hidden], .w-cb[hidden] { display: none !important; }
.w-ctime { font-size: 13px; font-variant-numeric: tabular-nums; margin-left: 6px; color: #eee; }
.w-clive { display: inline-flex; align-items: center; gap: 6px; background: transparent !important; border: 0 !important; color: #fff !important; font-size: 12px; font-weight: 700; letter-spacing: .4px; padding: 4px 8px; }
.w-clive i { width: 8px; height: 8px; border-radius: 50%; background: #e5383b; }
.w-clive.behind i { background: #9aa2ac; }
.w-clive.behind { cursor: pointer; }
.w-osd { z-index: 3; }
.w-mini .w-cvol, .w-mini .w-cth, .w-mini .w-ctime { display: none; }
.tv .w-ctrl { display: none; }
/* Kinomodus beim Live-TV: Bild über die ganze Breite, Gruppen und Senderliste darunter */
.w-live.theater { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto auto; align-content: start; overflow: auto; }
.w-live.theater > .w-gcol, .w-live.theater > .w-lcol { min-height: 360px; }
.w-live.theater > .w-pcol { grid-column: 1 / -1; grid-row: 1; flex: none; display: block; min-height: auto; overflow: visible; container-type: normal; border-right: 0; background: #000; }
.w-live.theater .w-stagebox { padding: 0; }
.w-live.theater .w-pcol .w-stage { height: min(calc(100vh - 190px), 56.25vw); width: auto; max-width: 100%; border-radius: 0; margin: 0 auto; }
.w-live.theater .w-pcol .w-info { max-width: none; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 16px; grid-template-columns: auto 1fr 1fr auto; align-items: center; gap: 4px 18px; }
.w-live.theater .w-info > .w-prog, .w-live.theater .w-info > .hint { display: none; }
.w-live.theater .w-info > .actions { grid-column: 4; grid-row: 1; margin: 0; }
.w-live.theater > .w-gcol { grid-row: 2; grid-column: 1; overflow: visible; }
.w-live.theater > .w-lcol { grid-row: 2; grid-column: 2; width: auto; overflow: visible; }
.w-live.theater .w-chlist { overflow: visible; }
@media (max-width: 760px) { .w-cth { display: none !important; } .w-live.theater { display: flex; } }

/* Schieberegler einheitlich: dünner grauer Balken, kleiner Ball in der Akzentfarbe */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 18px; padding: 0; border: 0 !important; box-shadow: none; cursor: pointer; accent-color: var(--accent); }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--rng-track, var(--line)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rng-track, var(--line)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; margin-top: -5px; transition: transform .12s; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { transform: scale(1.25); }
.w-ctrl input[type=range] { --rng-track: rgba(255,255,255,.3); }
.w-cseek::-webkit-slider-runnable-track { height: 3px; }
.w-cseek::-webkit-slider-thumb { margin-top: -5.5px; transform: scale(0); }
.w-ctrl:hover .w-cseek::-webkit-slider-thumb, .w-cseek:active::-webkit-slider-thumb { transform: scale(1); }

/* Einstellungen: Navigation links in Gruppen (wie Systemeinstellungen), Inhalt rechts */
.set-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { position: sticky; top: 0; display: grid; gap: 14px; padding: 12px 8px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.set-search { width: 100%; box-sizing: border-box; }
.set-groups { display: grid; gap: 14px; }
.set-grp { display: grid; gap: 2px; }
.set-gl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 10px 4px; }
.set-item { display: flex !important; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 7px 10px; border-radius: 8px; color: var(--text) !important; font-weight: 400; }
.set-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.set-item:hover { background: var(--hover) !important; }
.set-item.on { background: var(--sel, var(--hover)) !important; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent) !important; }
.set-item.on svg { color: var(--accent); }
.set-head { margin: 0 0 12px; }
.set-head h3 { margin: 2px 0 0; font-size: 20px; }
.set-crumb { font-size: 12px; color: var(--muted); }
.set-main { min-width: 0; }
.set-main .card { max-width: 980px; }
@media (max-width: 760px) {
  .set-layout { display: block; }
  .set-nav { position: static; gap: 8px; padding: 8px; margin-bottom: 12px; }
  .set-groups { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .set-grp { display: flex; gap: 6px; }
  .set-gl { display: none; }
  .set-item { white-space: nowrap; width: auto; padding: 6px 10px; border: 1px solid var(--line) !important; }
  .set-item.on { box-shadow: none !important; border-color: var(--accent) !important; }
}

/* Spaltenfilter */
.thead > div { display: flex; align-items: center; gap: 4px; }
.thead .th-l { overflow: hidden; text-overflow: ellipsis; }
.colf-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--panel) !important; border: 0 !important; box-shadow: none !important; padding: 2px 3px !important; color: var(--muted) !important; opacity: 0; line-height: 0; }
.thead > div:hover .colf-btn, .colf-on .colf-btn { opacity: 1; }
.colf-on .colf-btn { color: var(--accent) !important; }
.colf-on .th-l { color: var(--text); }
.colf-on { padding-right: 24px !important; }
.colf-btn svg { width: 13px; height: 13px; }
.colf-on .colf-btn svg { fill: currentColor; }
.colf-pop { position: fixed; z-index: 400; width: 260px; display: grid; gap: 8px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 13px; text-transform: none; letter-spacing: 0; }
.colf-t { display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--muted); font-size: 12px; }
.colf-join { display: flex; gap: 16px; justify-content: center; }
.colf-clear { margin-left: 8px; color: var(--accent) !important; }
.colf-clear svg { width: 12px; height: 12px; fill: currentColor; }
@media (hover: none) { .colf-btn { opacity: 1; } }

/* Varianten-Dialog */
.var-list { display: grid; gap: 6px; }
.var-row { display: grid; grid-template-columns: auto 18px 48px minmax(0, 1fr) auto 96px auto auto; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.var-row.first { border-color: var(--accent); }
.var-row .tag { text-align: center; }
.var-n { color: var(--muted); font-size: 12px; text-align: right; }
.var-name { min-width: 0; } .var-name b { overflow-wrap: anywhere; }
@media (max-width: 760px) { .var-row { grid-template-columns: auto 40px minmax(0, 1fr) auto; } .var-n, .var-row .badge-src { display: none; } }

/* Einklappbare Bereiche */
.nav-toggle { display: flex; align-items: center; gap: 8px; background: transparent !important; border: 0 !important; color: var(--muted) !important; padding: 8px 12px; margin-top: auto; border-radius: 6px; text-align: left; }
.nav-toggle:hover { background: var(--panel2) !important; color: var(--text) !important; }
.nav-toggle + .version { margin-top: 0; }
@media (min-width: 761px) {
body.nav-mini .app { grid-template-columns: 56px 1fr; }
body.nav-mini.watching .app { grid-template-columns: 1fr; }
body.nav-mini nav { padding: 10px 6px; }
body.nav-mini nav a { justify-content: center; padding: 10px 0; position: relative; }
body.nav-mini nav a .lb, body.nav-mini nav a .ls, body.nav-mini nav .version, body.nav-mini .nav-toggle .lb { display: none; }
body.nav-mini nav a .badge { position: absolute; top: 2px; right: 2px; font-size: 9px; padding: 0 4px; }
body.nav-mini .nav-toggle { justify-content: center; padding: 8px 0; }
}
.col-strip { display: none; }
@media (min-width: 761px) {
.col.collapsed { width: 34px !important; flex: none; }
.col.collapsed > *:not(.col-strip) { display: none !important; }
}
.col.collapsed > .col-strip { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; width: 100%; padding: 10px 0; background: var(--panel) !important; border: 0 !important; border-radius: 0; color: var(--muted) !important; }
.col.collapsed > .col-strip:hover { color: var(--text) !important; background: var(--panel2) !important; }
.col-strip span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; letter-spacing: .04em; }
.col.detail { position: relative; }
.col-collapse { position: absolute; top: 6px; right: 6px; z-index: 4; padding: 3px 6px !important; background: var(--panel) !important; opacity: .55; }
.col-collapse:hover { opacity: 1; }
.icon-btn { padding: 4px 6px !important; flex: none; }
@media (max-width: 760px) { .col-strip { display: none !important; } }

/* Tonspur & Fassung */
.w-dopts { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 10px 0 2px; }
.w-dopt { display: grid; gap: 4px; margin: 0; min-width: 200px; flex: 1; max-width: 320px; }
.w-dopt[hidden] { display: none; }
.w-optbox { position: relative; display: inline-flex; }
.w-optbox[hidden] { display: none; }
.w-optpop { position: absolute; right: 0; bottom: 100%; margin-bottom: 8px; min-width: 240px; max-height: 60vh; overflow: auto; padding: 6px; background: rgba(18,20,23,.94); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .15s, transform .15s; color: #fff; }
.w-optbox.open .w-optpop { opacity: 1; pointer-events: auto; transform: none; }
.w-opth { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9aa2ac; padding: 8px 10px 4px; }
.w-optitem { display: flex !important; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent !important; border: 0 !important; color: inherit !important; padding: 7px 10px; border-radius: 8px; font-size: 13px; white-space: normal; }
.w-optitem:hover, .w-optitem:focus { background: rgba(255,255,255,.12) !important; }
.w-optitem.on { color: var(--accent) !important; font-weight: 600; }
.w-optitem svg, .w-optsp { width: 14px; height: 14px; flex: none; display: inline-block; }
.w-optlist { padding: 8px; display: grid; gap: 2px; min-width: 320px; }
.w-optlist .w-opth { color: var(--muted); }
.w-optlist .w-optitem { color: var(--text) !important; font-size: 16px; padding: 10px 12px; }
.w-optlist .w-optitem.on { color: var(--accent) !important; }

.w-errx { position: absolute; top: 8px; right: 8px; background: transparent !important; border: 0 !important; color: inherit !important; padding: 4px 6px !important; opacity: .8; }
.w-errx:hover, .w-errx:focus { opacity: 1; background: rgba(255,255,255,.15) !important; }
.w-err b { padding-right: 28px; }

/* Update-Protokoll: Übersichtstabelle + aufklappbare Bereiche */
.logbody { margin: 10px 0 4px 16px; display: grid; gap: 8px; }
.logtbl { border-collapse: collapse; font-size: 13px; width: auto; min-width: min(640px, 100%); }
.logtbl th, .logtbl td { padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.logtbl thead th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.logtbl td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.logtbl td.add { color: var(--ok-text); font-weight: 600; } .logtbl td.chg { color: var(--warn); font-weight: 600; } .logtbl td.del { color: var(--bad-text); font-weight: 600; }
.logtype { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--bg); }
.logtype > summary { cursor: pointer; font-weight: 600; }
.logsec { margin-top: 10px; }
.logsec-t { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.logsec-t.add { color: var(--ok-text); } .logsec-t.chg { color: var(--warn); } .logsec-t.del { color: var(--bad-text); }
.loglist { margin: 0; padding: 0 0 0 18px; columns: 2 280px; column-gap: 24px; font-size: 13px; }
.loglist li { break-inside: avoid; padding: 1px 0; }
@media (max-width: 760px) { .logbody { margin-left: 0; overflow-x: auto; } }
.set-main .page.embedded > h2:first-child { display: none; }

/* Spulen */
.w-cjumps { display: inline-flex; gap: 0; }
.w-cjumps[hidden] { display: none; }
.w-cjump { font-size: 12px; font-weight: 700; padding: 6px 7px !important; font-variant-numeric: tabular-nums; }
.w-jump { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; background: rgba(0,0,0,.55); color: #fff; font-weight: 700; font-size: 20px; padding: 14px 20px; border-radius: 40px; pointer-events: none; }
.w-jump.l { left: 12%; } .w-jump.r { right: 12%; }
@media (max-width: 760px) { .w-cjumps .w-cjump:first-child, .w-cjumps .w-cjump:last-child { display: none; } }
/* Intro überspringen / nächste Folge */
.w-skip { position: absolute; right: 24px; bottom: 76px; z-index: 6; background: rgba(20,20,24,.85) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.5) !important; padding: 10px 18px; font-weight: 600; border-radius: 6px; }
.w-skip:hover, .w-skip:focus { background: #fff !important; color: #111 !important; }
.w-skip[hidden], .w-nextup[hidden] { display: none; }
.w-nextup { position: absolute; right: 24px; bottom: 76px; z-index: 7; background: rgba(20,20,24,.92); color: #fff; padding: 14px 16px; border-radius: 10px; display: grid; gap: 10px; min-width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.w-nexttxt { font-weight: 600; font-size: 15px; }
.w-nextbtns { display: flex; gap: 8px; }
.w-cseen { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.7); color: var(--accent); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.w-epseen { margin-left: 6px; opacity: .45; padding: 2px 6px !important; }
.w-epseen.on { opacity: 1; color: var(--accent) !important; }

.w-restart { display: inline-flex !important; align-items: center; gap: 4px; margin-left: 8px; padding: 0 6px !important; font-size: 11px; background: transparent !important; border: 0 !important; color: var(--muted) !important; opacity: .7; vertical-align: 1px; }
.w-restart span { display: none; }
.w-restart:hover, .w-restart:focus { opacity: 1; color: var(--text) !important; }
.w-restart:hover span, .w-restart:focus span { display: inline; }

/* Mini-Programm im Vollbild */
.w-mg { position: absolute; left: 0; top: 0; bottom: 0; z-index: 8; width: min(440px, 80%); background: linear-gradient(90deg, rgba(10,11,13,.94) 70%, rgba(10,11,13,0)); color: #fff; display: flex; flex-direction: column; padding: 16px 40px 12px 16px; }
.w-mg[hidden] { display: none; }
.w-mg-list { overflow: auto; flex: 1; display: grid; gap: 4px; align-content: start; scrollbar-width: thin; }
.w-mg-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9aa2ac; margin: 8px 4px 2px; }
.w-mg-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.w-mg-row:hover { background: rgba(255,255,255,.08); }
.w-mg-row.sel { background: rgba(255,255,255,.16); box-shadow: inset 3px 0 0 var(--accent); }
.w-mg-row.on b { color: var(--accent); }
.w-mg-row .logo, .w-mg-row img { width: 44px; height: 30px; object-fit: contain; flex: none; }
.w-mg-num { width: 30px; text-align: right; color: #9aa2ac; font-variant-numeric: tabular-nums; flex: none; }
.w-mg-txt { min-width: 0; flex: 1; }
.w-mg-txt b, .w-mg-now, .w-mg-next { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-mg-now { font-size: 13px; color: #dfe3e8; }
.w-mg-next { font-size: 12px; color: #9aa2ac; }
.w-mg .w-prog { margin: 3px 0; }
.w-mg-hint { font-size: 12px; color: #9aa2ac; padding-top: 8px; }
.tv .w-mg { width: min(560px, 60%); }
.eg-rem { color: var(--accent); } .eg-rem svg { width: 11px; height: 11px; vertical-align: -1px; }
.w-remlist { display: grid; gap: 6px; } .w-remrow { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); } .w-remrow svg { color: var(--accent); }

/* Suche für alles */
.w-search-res { flex: 1; overflow: auto; padding: 14px 16px 24px; display: grid; gap: 10px; align-content: start; }
.w-search-res .w-psec { margin-top: 6px; }
.w-srgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.w-sr { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; position: relative; min-width: 0; }
.w-sr:hover, .w-sr:focus { border-color: var(--accent); }
.w-sr .logo, .w-sr img { width: 44px; height: 30px; object-fit: contain; flex: none; }
.w-sr-t { min-width: 0; flex: 1; } .w-sr-t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .w-sr-t .c-muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-sr-prog { position: absolute; left: 10px; right: 10px; bottom: 4px; }
.w-search-res .w-posters { padding: 0; }
.w-mic { flex: none; padding: 6px 10px !important; }

/* Gesundheits-Übersicht */
.h-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.h-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.h-tile.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.h-top { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.h-ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--bad-bg); color: var(--bad-text); }
.h-tile.ok .h-ic { background: var(--ok-bg); color: var(--ok-text); }
.h-ic svg { width: 20px; height: 20px; }
.h-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.h-lbl { color: var(--muted); font-size: 13px; }
.h-list summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.h-list .loglist { columns: 1; max-height: 220px; overflow: auto; margin-top: 6px; }
.h-tile.info .h-ic { background: var(--chip); color: var(--accent); }
/* Konto & Benutzerverwaltung */
.viewas-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: var(--run-bg); color: var(--run-text); font-size: 13px; border-bottom: 1px solid var(--line); }
.viewas-bar button { margin-left: auto; }
.users-tbl td { vertical-align: top; }
.users-tbl select { width: auto; min-width: 110px; }
.acc-modal { min-width: min(640px, 86vw); padding: 2px 14px 4px; }
.acc-modal .card { box-shadow: none; }
.tv .epg-list .w-eprow:focus { background: var(--accent) !important; color: var(--on-accent) !important; }
.tv .epg-list .w-eprow:focus .c-muted { color: var(--on-accent) !important; }
.plan-tbl th.c, .plan-tbl td.c { text-align: center; width: 110px; }
.plan-tbl td.c input[type=checkbox] { width: 18px; height: 18px; }
.locked-card h3 { color: var(--muted); }
.viewas-bar.onboard { background: var(--accent); color: var(--on-accent); }
.viewas-bar.onboard .ico { color: var(--on-accent); }
.nowrap { white-space: nowrap; }
.mail-ed { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr); gap: 18px; margin-top: 10px; align-items: start; }
.mail-ed label { display: block; margin-top: 8px; }
.mail-ed .check { display: inline-flex; }
.mail-pv { position: sticky; top: 10px; }
.mail-subj { font-size: 13px; margin-bottom: 6px; }
.mail-prev { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 8px; background: #eef0f3; }
@media (max-width: 1100px) { .mail-ed { grid-template-columns: 1fr; } }
.tv .w-tabs .w-tabic { padding-left: 14px; padding-right: 14px; }
.w-setbox { margin-top: 14px; }
#modeSeg button.locked { opacity: .45; cursor: not-allowed; }
#modeSeg button.locked:hover { background: transparent; }
.share-list { display: grid; gap: 0; margin-top: 10px; border-top: 1px solid var(--line2); }
.share-row { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line2); }
.share-ed { display: grid; gap: 4px; min-width: 0; }
.modal-bg.ask .modal:has(.share-ed) { max-width: 620px; }
.share-ed input[type=text] { width: 100%; box-sizing: border-box; }
.share-ed .seg { flex-wrap: wrap; }
.share-ed label { margin-top: 8px; }
.share-cats { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; gap: 2px; }
.share-cats .check { margin: 0; }
.share-prev { min-width: min(860px, 90vw); max-height: 70vh; overflow: auto; }
.share-code { text-align: center; display: grid; gap: 10px; padding: 6px 8px; width: min(420px, 80vw); margin: 0 auto; }
.share-code .big { font-family: ui-monospace, Consolas, monospace; font-size: 32px; font-weight: 700; letter-spacing: 3px; padding: 14px; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; user-select: all; }
.share-codebtn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; letter-spacing: 1px; }
