:root {
  --r-card: 18px; --r-box: 14px; --r-field: 12px;
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #677085; --line: #dfe3ea;
  --accent: #2f6fde; --ok-bg: #e5f5ea; --ok: #1d6b35; --err-bg: #fde8e8; --err: #a12a2a;
  --warn-bg: #fff3cd; --warn: #7a5b00;
  color-scheme: light;
}
/* Farbschema: data-theme am <html> (Cookie je Gerät, siehe theme.go);
   ohne Wahl folgt es dem System. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --bg: #14171d; --card: #1d222b; --text: #e7eaf0; --muted: #98a1b3; --line: #2d3440;
    --accent: #6d9cf0; --ok-bg: #173323; --ok: #8fd6a4; --err-bg: #3a1c1c; --err: #f0a0a0;
    --warn-bg: #3b3218; --warn: #f0d58a; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #14171d; --card: #1d222b; --text: #e7eaf0; --muted: #98a1b3; --line: #2d3440;
  --accent: #6d9cf0; --ok-bg: #173323; --ok: #8fd6a4; --err-bg: #3a1c1c; --err: #f0a0a0;
  --warn-bg: #3b3218; --warn: #f0d58a; color-scheme: dark; }
/* AMOLED: echtes Schwarz (Pixel aus), Karten nur durch Linien getrennt. */
:root[data-theme="amoled"] { --bg: #000; --card: #000; --text: #e4e7ed; --muted: #8b93a3; --line: #262b33;
  --accent: #6d9cf0; --ok-bg: #0c2416; --ok: #8fd6a4; --err-bg: #2b0f0f; --err: #f0a0a0;
  --warn-bg: #261f0a; --warn: #f0d58a; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--text); }
header nav { display: flex; flex: 1; }
.logout { margin: 0; }
main { max-width: none; margin: 1.5rem 0; padding: 0 clamp(1rem, 2.5vw, 2.5rem); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.2rem 1.35rem; margin-bottom: 1rem; }
.card.narrow { max-width: 380px; margin: 3rem auto; }
label { display: block; margin-bottom: .8rem; font-weight: 600; font-size: .9rem; }
input { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-field); padding: .55rem .8rem; }
button { font: inherit; padding: .5rem 1.15rem; border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer; }
button.link { background: none; color: var(--accent); padding: 0; }
.flash { padding: .7rem 1rem; border-radius: var(--r-box); }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.muted { color: var(--muted); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
@media (max-width: 600px) { header.top { gap: .8rem; } }
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.titlebar h1, .titlebar h2 { margin-bottom: .4rem; }
a.button, button { display: inline-block; }
a.button { padding: .5rem 1.15rem; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; }
button.secondary, a.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: #c0392b; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.actions form { margin: 0; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
form.inline input { margin: 0; width: auto; }
select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-field); }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.badge { font-size: .8rem; border-radius: 99px; background: var(--line); color: var(--text); white-space: nowrap; }
.state-active { background: var(--ok-bg); color: var(--ok); }
.state-error { background: var(--err-bg); color: var(--err); }
.small { font-size: .85rem; }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.nowrap { white-space: nowrap; }
.row-dry td { opacity: .7; }
pre { overflow-x: auto; font-size: .8rem; background: var(--bg); padding: .8rem 1rem; border-radius: var(--r-box); white-space: pre-wrap; word-break: break-all; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .85rem; word-break: break-all; }
details summary { cursor: pointer; color: var(--accent); margin-top: .6rem; }
ol { padding-left: 1.2rem; }
[hidden] { display: none !important; }
input, select, textarea { font-weight: 400; }
@media (max-width: 600px) {
  header.top { flex-wrap: wrap; row-gap: .4rem; padding: .6rem 1rem; }
  header nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: .9rem; white-space: nowrap; }
  /* eine Zeile für Logo, Schema, Nutzer und Abmelden: Abmelden nur als Symbol.
     header.top vorn, weil die allgemeinen Regeln weiter unten in der Datei stehen. */
  header.top { column-gap: .5rem; }
  header.top .themepick { margin-left: auto; }
  header.top .themebtn { width: 1.75rem; height: 1.75rem; }
  header.top .whoami { padding: .3rem .4rem; }
  header.top .logout .icon { display: inline-block; }
  header.top .logout-text { display: none; }
}

fieldset.checks { border: 1px solid var(--line, #8884); border-radius: var(--r-box); padding: .5rem .8rem; margin: .6rem 0; }
fieldset.checks legend { padding: 0 .3rem; font-size: .9em; }

/* Kopfzeile: aktive Seite */
header nav a { color: var(--muted); padding: .2rem 0; border-bottom: 2px solid transparent; }
header nav a:hover { color: var(--text); text-decoration: none; }
header nav a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* Reiter */
.tabbar { display: flex; gap: .3rem; margin: .3rem 0 1rem; padding: .3rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a { flex: 0 0 auto; padding: .38rem .95rem; line-height: 1.4; color: var(--muted); white-space: nowrap; border-radius: 999px; transition: background .15s, color .15s; }
.tabbar a:hover { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tabbar a[aria-selected="true"] { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tabbar .count { display: inline-block; min-width: 1.4em; margin-left: .3rem; padding: 0 .35em; line-height: 1.35; border-radius: 99px; background: var(--line); font-size: .75rem; font-weight: 600; text-align: center; }
.tabbar a.warn::after { content: "•"; color: var(--err); margin-left: .3rem; }
.tabpanel > .card:last-child { margin-bottom: 0; }

/* Raster */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.whoami { color: var(--muted); font-size: .9rem; padding: .2rem 0; border-bottom: 2px solid transparent; }
.whoami::before { content: "👤 "; }
.whoami.active { color: var(--text); border-bottom-color: var(--accent); }
/* Schema-Umschaltung links neben dem Nutzernamen */
.themepick { display: flex; align-items: center; gap: .1rem; margin: 0; }
.themebtn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
  background: none; color: var(--muted); border-radius: 999px; }
.themebtn .icon { margin: 0; }
.themebtn:hover, .themebtn:focus-visible { color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.themebtn.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.logout .icon { display: none; margin: 0; }
.mt { margin-top: 1rem; }
.icon { display: inline-block; vertical-align: -3px; margin-right: .4rem; flex: 0 0 auto; }
.tabbar a { display: inline-flex; align-items: center; }
.tabbar a .icon { opacity: .75; }
.tabbar a[aria-selected="true"] .icon { opacity: 1; color: var(--accent); }
.otpsetup { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .6rem 0 1rem; }
.qr { background: #fff; padding: 10px; border-radius: var(--r-box); image-rendering: pixelated; }
pre.codes { font-size: 1rem; line-height: 1.7; background: var(--card); columns: 2; }
.inline-label { display: flex; align-items: center; gap: .5rem; margin: 0; flex: 1; min-width: 14rem; }
.inline-label input { margin: 0; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.passkeybox { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.passkeybox button { width: 100%; display: inline-flex; justify-content: center; align-items: center; }

/* runderes Design: Menü, Knöpfe, Fokus */
header nav a, .whoami { padding: .3rem .75rem; border-radius: 999px; border-bottom: 0; }
header nav a.active, .whoami.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-bottom: 0; }
header nav { gap: .35rem; }
button, a.button { transition: filter .15s, background .15s, box-shadow .15s; }
button:hover:not(:disabled), a.button:hover { filter: brightness(1.08); text-decoration: none; }
button.secondary:hover:not(:disabled), a.button.secondary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); filter: none; }
button:focus-visible, a.button:focus-visible, input:focus-visible, select:focus-visible, .tabbar a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
input:focus, select:focus { border-color: var(--accent); }
.tablewrap { border-radius: var(--r-box); }
.badge { padding: .2rem .65rem; }
.passkeybox button { border-radius: 999px; }
label.check input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

/* Zeile unter dem Menü: Reiter links, Aktionen rechts (statt Seitentitel) */
main > .tabs:first-child > .tabbar, main > .flash + .tabs > .tabbar, main > .tabbar:first-child, main > .flash + .tabbar { margin-top: 0; }

.spinner { width: .9rem; height: .9rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- media ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
textarea { display: block; width: 100%; margin-top: .25rem; padding: .55rem .8rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-field); resize: vertical; }
header nav a { display: inline-flex; align-items: center; }
header nav a .icon { margin-right: .35rem; opacity: .8; }
body.loading main { opacity: .6; transition: opacity .2s .15s; }
.mb { margin-bottom: 1rem; }
.icon { width: 16px; height: 16px; }

/* Senderlisten */
.slist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.slist.compact { border: 0; background: none; }
.srow { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.srow.dim .sname strong { opacity: .6; }
.srow.dragging { background: color-mix(in srgb, var(--accent) 12%, var(--card)); box-shadow: 0 4px 18px rgba(0,0,0,.15); position: relative; z-index: 2; }
.slogo { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.sname { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.sname:hover { text-decoration: none; }
.sname strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sname small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sname small.note { font-style: italic; }
.grip { flex: 0 0 auto; color: var(--muted); cursor: grab; touch-action: none; padding: .3rem 0; display: inline-flex; }
.grip .icon { margin: 0; width: 18px; height: 18px; }
.srow.dragging .grip { cursor: grabbing; }

/* Knöpfe */
.playbtn, .playmain { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; }
.playbtn .icon, .playmain .icon, .playbig .icon { margin: 0; }
.playbtn .icon:has(.i-stop), .playbig .icon:has(.i-stop), .playmain .icon:has(.i-stop) { display: none; }
.playbtn.playing .icon:has(.i-play), .playbig.playing .icon:has(.i-play) { display: none; }
.playbtn.playing .icon:has(.i-stop), .playbig.playing .icon:has(.i-stop) { display: inline-block; }
.playbtn.playing { background: var(--ok); }
.playbig { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.4rem; font-weight: 600; }
.playbig.playing { background: var(--ok); }
.playbig.playing span { display: none; }
.playbig.playing::after { content: "Stopp"; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%; background: none; color: var(--muted); border: 0; cursor: pointer; }
.iconbtn .icon { margin: 0; width: 18px; height: 18px; }
.iconbtn:hover, .iconbtn:focus-visible { color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent); text-decoration: none; }
.favbtn.on, .iconbtn.on { color: #e3a008; }
.favbtn.on .icon polygon, .iconbtn.on .icon polygon { fill: currentColor; }
.favbtn.big { width: 2.6rem; height: 2.6rem; border: 1px solid var(--line); }
.danger .icon, .button .icon, button .icon { vertical-align: -3px; }

/* Ordneransicht */
.library { display: grid; grid-template-columns: 250px 1fr; gap: 1.2rem; align-items: start; }
.foldertree { position: sticky; top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: .5rem; }
.foldertree ul { list-style: none; margin: 0; padding: 0; }
.foldertree li a { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border-radius: 10px; color: var(--text); }
.foldertree li a span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foldertree li a .icon { margin: 0; color: var(--muted); }
.foldertree li a:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.foldertree li a.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 600; }
.foldertree li a.active .icon { color: var(--accent); }
.foldertree .count { font-size: .75rem; color: var(--muted); background: var(--line); border-radius: 99px; padding: 0 .45rem; }
.foldertree li.sep { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .35rem; }
.d1 { padding-left: 1.1rem; } .d2 { padding-left: 2.2rem; } .d3 { padding-left: 3.3rem; } /* d0–d3: Ebene im Ordnerbaum (d{{.Depth}}) */
label.check.d1, label.check.d2, label.check.d3 { padding-left: 0; margin-left: 1.3rem; }
label.check.d2 { margin-left: 2.6rem; } label.check.d3 { margin-left: 3.9rem; }
.newfolder { margin-top: .4rem; border-top: 1px solid var(--line); padding: .4rem .3rem 0; }
.newfolder summary { list-style: none; display: flex; align-items: center; gap: .3rem; padding: .35rem .3rem; color: var(--accent); margin: 0; }
.newfolder summary::-webkit-details-marker { display: none; }
.newfolder form { padding: .5rem .3rem .3rem; }
.foldermain h1 { display: flex; align-items: center; gap: .5rem; }
.foldermain h1 .icon { width: 22px; height: 22px; margin: 0; color: var(--muted); }
.folderedit summary { margin: 0; }
.empty p { margin: .3rem 0; }
.empty .icon { margin: 0 .1rem; }
@media (max-width: 760px) {
  .library { grid-template-columns: 1fr; }
  .foldertree { position: static; padding: .4rem; }
  .foldertree ul { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
  .foldertree li { flex: 0 0 auto; }
  .foldertree li.sep { border: 0; margin: 0; padding: 0; }
  .foldertree .d1, .foldertree .d2, .foldertree .d3 { padding-left: 0; }
  .foldertree li a { white-space: nowrap; }
}

/* Suche */
.searchform { padding: .9rem 1rem; }
.searchline { display: flex; gap: .6rem; flex-wrap: wrap; }
.searchfield { position: relative; flex: 1 1 18rem; margin: 0; }
.searchfield .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); margin: 0; color: var(--muted); }
.searchfield input { margin: 0; padding-left: 2.4rem; font-size: 1.05rem; height: 2.8rem; border-radius: 999px; }
.countrysel { flex: 0 1 14rem; margin: 0; }
.countrysel select { margin: 0; height: 2.8rem; border-radius: 999px; }
.filters { margin-top: .6rem; }
.filters summary { display: inline-flex; align-items: center; gap: .2rem; margin: 0; }
.filtergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 0 1rem; margin-top: .7rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
.chips.inline { margin: 0; }
.chip { display: inline-block; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .85rem; }
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.reshead { margin-top: .4rem; }
#results.busy { opacity: .55; transition: opacity .15s .1s; }
.more { text-align: center; margin: 1rem 0; }
a.busy { opacity: .6; pointer-events: none; }

/* Senderseite */
.stationhead { display: flex; gap: 1.2rem; align-items: flex-start; }
.biglogo { width: 96px; height: 96px; border-radius: 20px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: 0 0 auto; }
.stinfo { flex: 1; min-width: 0; }
.stinfo h1 { margin-bottom: .2rem; overflow-wrap: anywhere; }
.stinfo p { margin: .2rem 0; }
.card h2 { display: flex; align-items: center; gap: .1rem; }
.titlelist { list-style: none; margin: 0; padding: 0; }
.titlelist li { display: flex; align-items: center; gap: .7rem; padding: .4rem 0; border-top: 1px solid var(--line); }
.titlelist li:first-child { border-top: 0; }
.titlelist .when { color: var(--muted); font-size: .8rem; flex: 0 0 4.6rem; font-variant-numeric: tabular-nums; }
.titlelist .tt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.titlelist .tt small { display: block; font-size: .8rem; }
.titlelist .tlinks { display: flex; gap: .6rem; font-size: .8rem; }
@media (max-width: 560px) {
  .stationhead { flex-direction: column; align-items: center; text-align: center; }
  .stationhead .actions { justify-content: center; }
  .titlelist li { flex-wrap: wrap; }
  .titlelist .tt { flex-basis: calc(100% - 6rem); }
  .titlelist .tlinks { margin-left: 5.3rem; }
}

/* Player-Leiste */
body.player-on { padding-bottom: 5.5rem; }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: .8rem;
  padding: .55rem max(1rem, env(safe-area-inset-right)) calc(.55rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.08); }
.plogo-link { flex: 0 0 auto; }
.plogo { width: 48px; height: 48px; border-radius: 11px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: block; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pname { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptitle { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptitle:empty { display: none; }
.pstate { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstate:empty { display: none; }
.pctl { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; }
.playmain { width: 3rem; height: 3rem; }
.playmain .icon { width: 20px; height: 20px; }
.player[data-state="playing"] .playmain .icon:has(.i-play), .player[data-state="loading"] .playmain .icon:has(.i-play) { display: none; }
.player[data-state="playing"] .playmain .icon:has(.i-stop), .player[data-state="loading"] .playmain .icon:has(.i-stop) { display: inline-block; }
.player[data-state="loading"] .playmain { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.pvol { margin: 0; width: 6.5rem; }
.pvol input { margin: 0; padding: 0; height: 2rem; accent-color: var(--accent); background: none; border: 0; }
.psleep { position: relative; }
.psleep > summary { list-style: none; width: auto; min-width: 2.2rem; padding: 0 .4rem; border-radius: 999px; margin: 0; color: var(--muted); }
.psleep > summary::-webkit-details-marker { display: none; }
.psleep > summary span { font-size: .8rem; font-weight: 600; color: var(--accent); }
.psleep .menu { position: absolute; right: 0; bottom: calc(100% + .6rem); display: flex; flex-direction: column; gap: .3rem; min-width: 11rem; padding: .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.psleep .menu strong { font-size: .85rem; padding: 0 .2rem .2rem; }
.psleep .menu button { text-align: left; }
@media (max-width: 640px) {
  .player { gap: .55rem; }
  .plogo { width: 42px; height: 42px; }
  .pvol { display: none; }
}

/* Ablage-Fenster */
.folderpop { position: fixed; z-index: 40; width: 18rem; max-height: 70vh; overflow-y: auto; padding: .9rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: 0 16px 40px rgba(0,0,0,.22); }
.folderpop.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: var(--r-card) var(--r-card) 0 0; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
.folderpop strong { display: block; margin-bottom: .5rem; }
.folderpop label.check { margin-bottom: .45rem; }
.folderpop label.check .icon { margin-right: .2rem; }
label.check.fav .icon { color: #e3a008; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 6.5rem; transform: translateX(-50%); max-width: calc(100% - 2rem);
  padding: .55rem 1.1rem; border-radius: 999px; background: var(--text); color: var(--bg); font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.library > *, .two > *, .grid2 > * { min-width: 0; }

/* Fernsehen: Bild über der Player-Leiste */
.pvideo { position: fixed; z-index: 31; right: 1rem; bottom: 5.4rem; width: min(420px, calc(100vw - 2rem)); aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--r-box); overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.pvideo video { width: 100%; height: 100%; display: block; background: #000; }
.pvbtns { position: absolute; top: .4rem; right: .4rem; display: flex; gap: .2rem; opacity: 0; transition: opacity .2s; }
.pvideo:hover .pvbtns, .pvideo:focus-within .pvbtns { opacity: 1; }
.pvbtns .iconbtn { background: rgba(0,0,0,.55); color: #fff; }
.pvbtns .iconbtn:hover { background: rgba(0,0,0,.8); color: #fff; }
.areatabs { margin-top: 0; }
@media (max-width: 640px) {
  .pvideo, .pvideo.big { left: 0; right: 0; width: 100%; border-radius: 0; bottom: calc(4.1rem + env(safe-area-inset-bottom)); }
  .pvbtns { opacity: 1; }
  body.video-on { padding-bottom: calc(4.5rem + 56.25vw); }
  .pvbtns [data-p="big"] { display: none; }
}

/* ---------- Podcasts ---------- */
.podonly { display: none !important; }
body.pod-on .podonly { display: inline-flex !important; }
.podgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.podcard { display: flex; flex-direction: column; gap: .35rem; color: var(--text); }
.podcard:hover { text-decoration: none; }
.podcard .cover { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-box); overflow: hidden; background: var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.podcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.podcard:hover .cover img { transform: scale(1.03); }
.podcard strong { font-size: .92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.podcard small { color: var(--muted); font-size: .78rem; }
.newbadge { position: absolute; top: .4rem; right: .4rem; min-width: 1.5rem; padding: .1rem .45rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.foldertree .count.hot { background: var(--accent); color: #fff; }
.refreshall { margin: .5rem .3rem .2rem; }
button.small, a.button.small { padding: .3rem .8rem; font-size: .85rem; }
.eprow.played .sname strong { color: var(--muted); font-weight: 500; }
.eprow .slogo { background: var(--line); object-fit: cover; }
.dotnew { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); margin-right: .4rem; vertical-align: 1px; }
progress.epprog { display: block; width: 100%; max-width: 14rem; height: 4px; margin-top: .3rem; border: 0; border-radius: 99px; background: var(--line); accent-color: var(--accent); appearance: none; }
progress.epprog::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress.epprog::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress.epprog::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
progress.epprog.wide { max-width: 22rem; margin: .4rem 0; }
.epmenu { position: relative; }
.epmenu > summary { list-style: none; font-size: 1.2rem; line-height: 1; color: var(--muted); margin: 0; }
.epmenu > summary::-webkit-details-marker { display: none; }
.epmenu .menu { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 25; display: flex; flex-direction: column; min-width: 13rem; padding: .35rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.epmenu .menu button { display: flex; align-items: center; gap: .1rem; width: 100%; text-align: left; background: none; color: var(--text); border-radius: 10px; padding: .45rem .6rem; }
.epmenu .menu button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); filter: none; }
.epmenu .menu button.on .icon { color: var(--ok); }
.stationhead .cover { object-fit: cover; width: 160px; height: 160px; border-radius: 18px; }
.inline-select { width: auto; display: inline-block; margin: 0; }
.notes { overflow-wrap: anywhere; }
.notes p:first-child { margin-top: 0; }
.notes a[data-seek] { font-variant-numeric: tabular-nums; font-weight: 600; }
.notes h4 { margin: 1rem 0 .4rem; }
.chapterlist { margin: 0; padding-left: 1.2rem; columns: 2 18rem; }
.chapterlist li { break-inside: avoid; padding: .15rem 0; }
.chapterlist a { white-space: pre-wrap; }
.podsettings summary { margin: 0; }
/* Player: Zeitleiste und Podcast-Knöpfe */
.player { flex-wrap: wrap; row-gap: .25rem; }
.pseek { flex-basis: 100%; display: flex; align-items: center; gap: .6rem; order: -1; }
.pseek input { flex: 1; margin: 0; padding: 0; height: 1.2rem; accent-color: var(--accent); background: none; border: 0; }
.ptime { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2rem; }
.ptime:last-child { text-align: right; }
.skipn { font-size: .6rem; font-weight: 700; margin-left: -.15rem; }
.speedbtn { background: none; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .55rem; font-size: .8rem; font-weight: 600; min-width: 2.8rem; }
.speedbtn:hover { border-color: var(--accent); filter: none; }
.pchapter { background: none; color: var(--accent); padding: 0; font-size: .8rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
body.pod-on.player-on { padding-bottom: 7.5rem; }
@media (max-width: 640px) {
  .podgrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .7rem; }
  .pctl [data-p="fav"] { display: none; }
  .stationhead .cover { width: 140px; height: 140px; }
}

/* Ansicht Liste/Kacheln */
.titleactions { display: flex; align-items: center; gap: .6rem; }
.viewbar { display: flex; justify-content: flex-end; margin: -.4rem 0 -.6rem; }
.viewtoggle { display: inline-flex; gap: .1rem; padding: .15rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.viewtoggle .iconbtn { width: 2rem; height: 2rem; }
.viewtoggle .iconbtn[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
ul.slist.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; background: none; border: 0; overflow: visible; border-radius: 0; }
ul.slist.grid > .srow { position: relative; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-box); }
ul.slist.grid > .srow + .srow { border-top: 1px solid var(--line); }
ul.slist.grid > .srow:hover { background: var(--card); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
ul.slist.grid .slogo { order: -2; flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; padding: 8%; }
ul.slist.grid .sname { order: -1; flex: 0 0 100%; }
ul.slist.grid .sname strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; min-height: 2.5em; }
ul.slist.grid .sname small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
ul.slist.grid .playbtn { margin-right: auto; }
ul.slist.grid .grip { position: absolute; top: .9rem; left: .9rem; z-index: 2; background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 8px; padding: .15rem; }
ul.slist.grid form.inline { position: absolute; top: .9rem; right: .9rem; z-index: 2; }
ul.slist.grid form.inline .iconbtn { background: color-mix(in srgb, var(--card) 85%, transparent); }
@media (max-width: 640px) {
  ul.slist.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
  .titlebar .titleactions .secondary { display: none; }
}
.iconbtn:disabled { opacity: .35; cursor: default; background: none; }
.titlestar:not(:disabled) { color: var(--accent); }

/* schwebendes Fenster */
dialog.modal { width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 1.2rem 1.35rem; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
dialog.modal::backdrop { background: rgba(10, 14, 22, .55); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: popin .16s ease-out; }
@keyframes popin { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modalhead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modalhead h2 { margin: 0; display: flex; align-items: center; gap: .2rem; }
@media (max-width: 640px) {
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-card) var(--r-card) 0 0; }
}

/* Fernsehfenster: Griffe */
.pvdrag { position: absolute; top: 0; left: 1.6rem; right: 7.5rem; height: 2.4rem; cursor: move; touch-action: none; }
.pvresize { position: absolute; top: 0; left: 0; width: 1.6rem; height: 1.6rem; cursor: nwse-resize; touch-action: none; z-index: 3;
  background: linear-gradient(135deg, rgba(255,255,255,.75) 0 2px, transparent 2px 5px, rgba(255,255,255,.75) 5px 7px, transparent 7px); opacity: 0; transition: opacity .2s; border-top-left-radius: var(--r-box); }
.pvideo:hover .pvresize, .pvideo.dragging .pvresize { opacity: 1; }
.pvideo.dragging { user-select: none; }
.pvideo.dragging video { pointer-events: none; }
@media (max-width: 640px) { .pvdrag, .pvresize { display: none; } }
.titlestar.off { opacity: .5; }
.titlestar.off:hover { opacity: 1; }
dialog.modal.small { width: min(460px, calc(100vw - 2rem)); }

/* Kontrast: Schrift auf Akzent- und Erfolgsfarben im Dunkel- und AMOLED-Modus */
:root { --on-accent: #fff; --ok-strong: #1d6b35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --on-accent: #0b1220; --ok-strong: #2f8a50; } }
:root[data-theme="dark"], :root[data-theme="amoled"] { --on-accent: #0b1220; --ok-strong: #2f8a50; }
button, a.button, .dropdown > summary, .newbadge, .foldertree .count.hot { color: var(--on-accent); }
button.secondary, a.button.secondary, button.link, .iconbtn, .themebtn, .speedbtn, .epmenu .menu button, .psleep .menu button.secondary, .pchapter { color: inherit; }
button.secondary, a.button.secondary, button.link { color: var(--accent); }
.iconbtn, .themebtn { color: var(--muted); }
.speedbtn, .epmenu .menu button { color: var(--text); }
.pchapter { color: var(--accent); }
button.danger { color: #fff; }
.playbtn.playing, .playbig.playing { background: var(--ok-strong); color: #fff; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tabbar a[aria-current="page"] .icon { opacity: 1; color: var(--accent); }
header nav { scrollbar-width: none; }
header nav::-webkit-scrollbar { display: none; }
#main:focus { outline: none; }

[data-p="recognize"].busy { color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }

.updatebar { position: fixed; z-index: 45; top: .6rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .7rem;
  padding: .45rem .5rem .45rem 1rem; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: .9rem; max-width: calc(100% - 2rem); }
.updatebar button { padding: .3rem .9rem; }

.brandtext { display: flex; flex-direction: column; line-height: 1.05; }
.brandver { font-size: .62rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
main { padding-bottom: 2rem; }
