/* Site-8 Radio v3 - Retro-Radio-Look, mobil zuerst, ohne externe Schriften. */

:root {
  --bg: #120f24;
  --bg-2: #1a1633;
  --panel: #1f1a3d;
  --panel-2: #282150;
  --line: #3a3170;
  --line-strong: #5a4ca8;
  --text: #f3efff;
  --muted: #b3a9dc;
  --faint: #8378b8;
  --accent: #ff4fa3;
  --accent-ink: #1a0614;
  --cyan: #38e8ff;
  --live: #9cff57;
  --warn: #ffc94d;
  --danger: #ff6b6b;
  --shadow: 4px 4px 0 #05030d;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --bar-h: 76px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f1ff;
    --bg-2: #ebe6ff;
    --panel: #ffffff;
    --panel-2: #f1edff;
    --line: #d4cbf5;
    --line-strong: #9d8ee0;
    --text: #1b1535;
    --muted: #4f4680;
    --faint: #7a70a8;
    --accent: #d61f7c;
    --accent-ink: #ffffff;
    --cyan: #0b7f99;
    --live: #2f8a00;
    --warn: #a86b00;
    --danger: #c22a2a;
    --shadow: 4px 4px 0 #cfc5f5;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 40%),
    radial-gradient(circle at 110% 10%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 35%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.boot { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- Rahmen */

.shell { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .08em; color: var(--text); text-transform: uppercase; }
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.brand small { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); margin-left: auto; }
@media (max-width: 759px) {
  .topbar { padding: 8px 12px; gap: 6px 12px; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}
main { width: min(1180px, 100%); margin: 0 auto; padding: 16px; flex: 1; }

/* ---------------------------------------------------------------- Bausteine */

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.eyebrow { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .35rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide-mobile { display: none; }
@media (min-width: 760px) { .hide-mobile { display: initial; } }

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 960px) { .grid.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px;
  border: 2px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel-2); color: var(--text);
  font-weight: 700; cursor: pointer; white-space: nowrap;
  box-shadow: 2px 2px 0 #05030d;
  transition: transform .05s ease;
}
.btn:hover { border-color: var(--cyan); text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.live { background: var(--live); border-color: var(--live); color: #0d1a00; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn.icon { width: 44px; padding: 0; }
.btn.big { min-height: 56px; min-width: 56px; font-size: 1.3rem; border-radius: 50%; }
.btn.on { border-color: var(--cyan); color: var(--cyan); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  border: 1.5px solid var(--line-strong); color: var(--muted);
}
.badge.live { color: var(--live); border-color: var(--live); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.off { color: var(--faint); border-color: var(--line); }
.badge.accent { color: var(--accent); border-color: var(--accent); }
@keyframes pulse { 50% { opacity: .25; } }

input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px;
  background: var(--bg-2); border: 2px solid var(--line); border-radius: var(--radius); color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; }
label.field { display: block; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.check.toggle-row { align-items: flex-start; }
.check.toggle-row input { flex: none; margin-top: 2px; }

.seg { display: inline-flex; border: 2px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 36px; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg { flex-wrap: wrap; }

/* Start-Dialog: dauerhaft oder nur solange wir hoeren (v3.1). */
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
.choice.on { border-color: var(--accent); box-shadow: var(--shadow); }
@media (max-width: 640px) { .choice-row { grid-template-columns: 1fr; } }

.notice { padding: 10px 12px; border-radius: var(--radius); border: 2px dashed var(--line-strong); color: var(--muted); }
.notice.warn { border-color: var(--warn); color: var(--warn); }
.notice.err { border-color: var(--danger); color: var(--danger); }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }

/* ---------------------------------------------------------------- Cover, Titel */

.cover {
  aspect-ratio: 1; width: 100%; border-radius: 4px; object-fit: cover;
  background: linear-gradient(135deg, var(--panel-2), var(--bg-2));
  border: 2px solid var(--line);
}
.cover.sm { width: 44px; height: 44px; flex: none; }
.cover.md { width: 64px; height: 64px; flex: none; }
.cover.placeholder { display: grid; place-items: center; color: var(--faint); font-size: 1.4rem; }

.track { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius); min-width: 0; }
.track:hover { background: var(--panel-2); }
.track .meta { flex: 1; min-width: 0; }
.track .title { font-weight: 700; }
.track .sub { font-size: .85rem; color: var(--muted); }
.track .actions { display: flex; gap: 4px; flex: none; }
.track.current { background: color-mix(in srgb, var(--accent) 16%, transparent); outline: 2px solid var(--accent); }
.track.played { opacity: .55; }
.track .handle { cursor: grab; color: var(--faint); padding: 0 4px; user-select: none; }
.track-list { display: flex; flex-direction: column; gap: 2px; }
.who { font-size: .72rem; color: var(--cyan); font-weight: 700; }

/* ---------------------------------------------------------------- Senderkarten */

.station-card { display: flex; flex-direction: column; gap: 10px; }
.station-card .head { display: flex; gap: 12px; align-items: center; }
.station-card .name { font-size: 1.15rem; font-weight: 800; }
.station-card .now { min-height: 2.9em; }
.station-card .foot { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.person-card .foot { flex-wrap: wrap; }
.userbox .btn.on { color: var(--accent); }

.hero { display: grid; gap: 16px; align-items: center; margin-bottom: 16px; }
@media (min-width: 760px) { .hero { grid-template-columns: 1fr auto; } }

.np-title { font-size: clamp(1.3rem, 3.4vw, 2rem); font-weight: 900; margin: 0; }
.np-artist { font-size: 1.1rem; color: var(--muted); }

.progress { position: relative; height: 10px; background: var(--bg-2); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.progress .ab { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--warn) 35%, transparent); border-left: 2px solid var(--warn); border-right: 2px solid var(--warn); }
input[type=range].seek { width: 100%; accent-color: var(--accent); }
.times { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------------- Player-Leiste */

.playerbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  min-height: var(--bar-h);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--line-strong);
}
.playerbar .meta { flex: 1; min-width: 0; }
.playerbar .src { font-size: .72rem; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.playerbar .vol { width: 110px; accent-color: var(--accent); }
.playerbar .idle { color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------------- Jam */

.members { display: flex; flex-wrap: wrap; gap: 8px; }
.member { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 2px solid var(--line); border-radius: 999px; font-size: .85rem; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 900; font-size: .8rem; color: #120f24; background: var(--cyan);
}
.avatar.sm { width: 20px; height: 20px; font-size: .6rem; }
.member.listening { border-color: var(--live); }
.member.buffering { border-color: var(--warn); }
.qr { background: #fff; padding: 8px; border-radius: 4px; width: 168px; }
.qr svg { width: 100%; height: auto; display: block; }
.sync { font-family: var(--mono); font-size: .78rem; color: var(--muted); }

/* ---------------------------------------------------------------- Dialoge, Toasts */

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 3, 13, .7); display: grid; place-items: center; padding: 16px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 20px); display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100% - 24px)); }
.toast { padding: 10px 14px; border-radius: var(--radius); background: var(--panel-2); border: 2px solid var(--line-strong); box-shadow: var(--shadow); }
.toast.err { border-color: var(--danger); }
.toast.ok { border-color: var(--live); }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 12px; color: var(--muted); font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.table-wrap { overflow-x: auto; }
pre.log { max-height: 420px; overflow: auto; background: var(--bg-2); padding: 10px; border-radius: var(--radius); font-size: .75rem; white-space: pre-wrap; word-break: break-all; }

.help h2 { margin-top: 1.4rem; }
.help li { margin: .3rem 0; }
.kbd { font-family: var(--mono); background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }

/* ---------------------------------------------------------------- Rewind, Rangliste, Zeitachse (v2.8) */

select.select.small { width: auto; min-height: 36px; padding: 4px 8px; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.tile .eyebrow { margin: 0; }
.tile-value { font-size: 1.5rem; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.rewind h3 { margin: 0 0 8px; }
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.barlist li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.barlist .rank { width: 1.6em; text-align: right; color: var(--faint); flex: none; }
.barlist .grow { min-width: 0; }
.bar { height: 6px; background: var(--bg-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 3px; }
.columns { margin: 0; }
.columns svg { width: 100%; height: 110px; display: block; }
.columns rect { fill: color-mix(in srgb, var(--cyan) 55%, transparent); }
.columns rect.hi { fill: var(--accent); }
.col-labels { display: flex; font-size: .7rem; color: var(--faint); }
.col-labels span { text-align: center; overflow: visible; white-space: nowrap; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; }
.heatmap span { aspect-ratio: 1; min-width: 9px; border-radius: 2px; background: var(--bg-2); }
.heatmap .l1 { background: color-mix(in srgb, var(--accent) 30%, var(--bg-2)); }
.heatmap .l2 { background: color-mix(in srgb, var(--accent) 55%, var(--bg-2)); }
.heatmap .l3 { background: color-mix(in srgb, var(--accent) 80%, var(--bg-2)); }
.heatmap .l4 { background: var(--accent); }
.heatmap .lx { background: transparent; }
.album-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.album img, .album .cover { width: 100%; aspect-ratio: 1; border-radius: var(--radius); margin-bottom: 4px; }

.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leaderboard li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.leaderboard li.self { border-color: var(--accent); }
.leaderboard .rank { width: 2em; text-align: center; font-weight: 900; font-size: 1.1rem; flex: none; }
.leaderboard .grow { min-width: 0; }
.timeline .tl-day { margin: 14px 0 6px; color: var(--muted); font-size: .95rem; }
.timeline .track { align-items: center; }
.tl-time { width: 3.2em; flex: none; }

.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: 100%; z-index: 40; min-width: 220px; background: var(--panel); border: 2px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.menu-item { background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 4px; cursor: pointer; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--panel-2); }
.btn-row { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; }
.btn-row:hover { background: var(--panel-2); }

.story { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 48px 20px 32px; user-select: none;
  background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 45%, var(--bg)), var(--bg) 60%),
    radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--cyan) 35%, transparent), transparent 50%); }
.story-progress { position: absolute; top: 12px; left: 12px; right: 56px; display: flex; gap: 4px; }
.story-progress span { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 25%, transparent); overflow: hidden; position: relative; }
.story-progress span.done { background: var(--text); }
.story-progress span.on::after { content: ""; position: absolute; inset: 0; background: var(--text); transform-origin: left; animation: story-fill 7s linear forwards; }
.story-progress span.on.hold::after { animation-play-state: paused; }
@keyframes story-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.story-close { position: absolute; top: 4px; right: 8px; }
.story-card { width: min(520px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: story-in .35s ease-out; }
.story-card p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.story-big { font-size: clamp(2rem, 9vw, 3.6rem); line-height: 1.05; margin: 0; overflow-wrap: anywhere; }
.story-cover { width: min(260px, 60vw); aspect-ratio: 1; border-radius: var(--radius); box-shadow: var(--shadow); }
.story-list { text-align: left; font-size: 1.15rem; margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.story-list span { color: var(--muted); font-size: .9rem; }
.story .columns { width: 100%; }
@keyframes story-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .story-card { animation: none; } .story-progress span.on::after { animation: none; transform: scaleX(1); } }

/* ---------------------------------------------------------------- Smartphone (v3.1.1) */

/* Raster- und Flex-Kinder duerfen schmaler werden als ihr Inhalt (sonst schieben lange Titel die Seite seitlich auf). */
.grid > *, .stack > *, .panel { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
.barlist .row.between { flex-wrap: nowrap; }
.barlist .row.between > .ellipsis { flex: 1; min-width: 0; }
.barlist .row.between > .mono { flex: none; }
.modal .panel-head { flex-wrap: nowrap; align-items: flex-start; }
.modal .panel-head h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qr.big { width: min(320px, 100%); margin: 0 auto; }
.track .more { display: none; }

@media (max-width: 759px) {
  main { padding: 12px; }
  .panel { padding: 12px; }
  .nav { flex-wrap: wrap; overflow: visible; gap: 2px; margin: 0; }
  .nav a { padding: 5px 8px; font-size: .9rem; }
  .track .actions { gap: 2px; }
  .track .actions .btn.small { min-height: 30px; padding: 2px 7px; }
  /* Listen mit vielen Knoepfen (Warteschlange): Knoepfe hinter "⋯", aufgeklappt in eigener Zeile. */
  .track.has-more .more { display: inline-flex; }
  .track.has-more { flex-wrap: wrap; }
  .track.has-more .actions { display: none; }
  .track.has-more.open .actions { display: flex; flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; }
  /* Playlists unter "Rewind": Knoepfe unter den Titel. */
  .track.wrap-actions { flex-wrap: wrap; }
  .track.wrap-actions .actions { flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .np-title { font-size: 1.4rem; }
}

/* Eigene Auswahl (ersetzt native <select>, v3.1.1) */
.picker { display: inline-block; max-width: 100%; }
.picker:not(.small) { display: block; width: 100%; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px;
  background: var(--bg-2); border: 2px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.picker.small .picker-btn { min-height: 36px; padding: 4px 10px; font-size: .9rem; }
.picker-btn:focus-visible { border-color: var(--cyan); outline: none; }
.picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.picker-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--panel-2); border: 2px solid transparent; border-radius: var(--radius); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.picker-opt.on { border-color: var(--accent); }
.picker-opt:disabled { opacity: .45; cursor: not-allowed; }

/* Kanal: Mitfahr-Code (v3.1.1) */
.btn.block { display: flex; justify-content: center; width: 100%; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--faint); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.ride { text-align: left; }
@media (max-width: 759px) {
  /* Kopfzeile scrollt mit (sonst kostet sie am Handy ein Siebtel des Bildschirms). */
  .topbar { position: static; }
}
.picker-opt > span:first-child { white-space: normal; overflow: visible; line-height: 1.35; font-weight: 700; }
/* Ziehen per Finger (E6): Griff nimmt Touch-Gesten selbst. */
.track .handle { touch-action: none; padding: 6px 6px; }

/* Tutorial (v3.3): grosse Schrift und Knoepfe; am Handy als Blatt von unten, Daumen-erreichbar. */
.tutorial { width: min(480px, 100%); display: flex; flex-direction: column; gap: 14px; }
.tutorial-top { display: flex; justify-content: space-between; align-items: center; }
.tutorial-body { text-align: center; min-height: 230px; animation: tut-in .2s ease-out; }
.tutorial-body h2 { margin: 6px 0 10px; font-size: 1.45rem; }
.tutorial-body p { margin: 0 auto; max-width: 38ch; line-height: 1.5; }
.tutorial-body ul { text-align: left; margin: 12px auto 0; max-width: 36ch; padding-left: 20px; line-height: 1.5; }
.tutorial-body li + li { margin-top: 6px; }
.tutorial-icon { font-size: 3.2rem; line-height: 1.1; }
.tutorial-dots { display: flex; justify-content: center; gap: 8px; }
.tutorial-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line, #3a3352); cursor: pointer; }
.tutorial-dots button.on { background: var(--accent); width: 22px; border-radius: 5px; }
.tutorial-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.tutorial-nav .btn { min-height: 46px; font-size: 1rem; justify-content: center; }
.tutorial-hide { justify-content: center; }
@keyframes tut-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .tutorial-backdrop { place-items: end stretch; padding: 0; }
  .tutorial { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .tutorial-body { min-height: 360px; }
}
@media (prefers-reduced-motion: reduce) { .tutorial-body { animation: none; } }
.nowrap { white-space: nowrap; }

/* Fernbedienung (v3.4): Vollbild wie ein Musik-Player – Kopf, Inhalt, drei Reiter unten. Am Desktop als schmale Karte. */
body.remote-mode .topbar, body.remote-mode .playerbar { display: none; }
body.remote-mode { overflow: hidden; }
.remote { position: fixed; inset: 0; z-index: 40; margin: 0 auto; width: min(480px, 100%); height: 100dvh; background: var(--bg);
  border-inline: 2px solid var(--line); }
.remote-player { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.remote.wide, .remote.land { width: 100%; border-inline: 0; }
/* Besitzer: zwei Seiten uebereinander (QR-Code, Player), Wischen rastet ein. */
.remote.paged { overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; }
.remote-page { height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; }
.qr-page { display: grid; grid-template-rows: 1fr auto; text-align: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); }
.qr-page-inner { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-page-inner h1 { margin: 0; }
.qr-page .qr.big { width: min(78vw, 52dvh, 420px); }
.qr-page-down { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; padding: 14px; cursor: pointer; animation: qr-bounce 2s ease-in-out infinite; }
@keyframes qr-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .qr-page-down { animation: none; } }
.remote-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 2px solid var(--line); min-width: 0; }
.remote-body { overflow-y: auto; overscroll-behavior: contain; padding: 14px; min-height: 0; }
.remote-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--line); background: var(--bg-2);
  padding-bottom: env(safe-area-inset-bottom); }
.remote-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; }
.remote-tabs button.on { color: var(--accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
.remote-tab-icon { font-size: 1.35rem; line-height: 1; }
.remote-now { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.remote-now.empty-now { justify-content: center; }
.remote-icon { font-size: 3.5rem; }
.remote-cover { width: min(78vw, 36dvh, 340px); aspect-ratio: 1; flex: none; }
.remote-cover img, .remote-cover .cover { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.remote-meta { width: 100%; min-width: 0; }
.remote-meta .np-title { margin: 0; font-size: 1.35rem; }
.remote-meta .np-artist { margin: 2px 0 0; color: var(--muted); }
.remote-progress { width: 100%; }
.remote-progress .times { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.remote-controls { display: flex; align-items: center; justify-content: center; gap: 28px; }
.remote-ctl { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 50%; }
.remote-play { width: 76px; height: 76px; font-size: 1.8rem; }
.remote-next { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; min-width: 0;
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.remote-next .ellipsis { max-width: 100%; }
.remote-wide { width: 100%; min-height: 48px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--accent-ink); }
.remote-search { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.remote-input { width: 100%; min-height: 48px; font-size: 1.05rem; position: sticky; top: 0; z-index: 1; }
.remote-list { display: flex; flex-direction: column; gap: 6px; }
.remote-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); background: var(--panel); min-width: 0; }
.remote-item.mine { box-shadow: inset 3px 0 0 var(--accent); }
.remote-item.as-button { border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.remote-item .meta { min-width: 0; }
.remote-item .avatar { width: 40px; height: 40px; flex: none; }
.remote-add { display: flex; flex-direction: column; gap: 4px; flex: none; }
.remote-add .btn { min-height: 34px; white-space: nowrap; }
.remote-album-head { display: flex; gap: 12px; align-items: center; min-width: 0; margin: 8px 0; }
.remote-request { margin-top: 6px; }
.center { text-align: center; }
@media (max-width: 520px) { .remote { border-inline: 0; } }
@media (max-height: 640px) { .remote-cover { width: min(60vw, 28dvh); } .remote-play { width: 64px; height: 64px; } }
.remote-tabs button.pulse { color: var(--text); animation: remote-pulse 1.6s ease-in-out infinite; }
@keyframes remote-pulse { 0%, 100% { background: transparent; } 50% { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .remote-tabs button.pulse { animation: none; background: color-mix(in srgb, var(--accent) 18%, transparent); } }
.remote-item.sortable { transition: transform .18s ease; }
.remote-item.lifted { background: var(--panel-2); box-shadow: var(--shadow); outline: 2px solid var(--accent); }
.remote-item .grip { flex: none; width: 36px; height: 44px; display: grid; place-items: center; font-size: 1.25rem; color: var(--muted);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.remote-item.lifted .grip { cursor: grabbing; color: var(--accent); }

/* Grosse Bildschirme (Laptop, PC): alle drei Bereiche nebeneinander, grosses Cover. Quer am Handy: zwei Spalten. */
.remote-cols { display: grid; gap: 0; min-height: 0; height: 100%; }
.remote-cols.three { grid-template-columns: minmax(340px, 1.15fr) 1fr 1fr; }
.remote-cols.two { grid-template-columns: 1fr 1fr; }
.remote-col { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; border-right: 2px solid var(--line); }
.remote-col:last-child { border-right: 0; }
.remote-col.side { padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.remote-col.side .remote-tabs { border-top: 0; border-bottom: 2px solid var(--line); }
.remote-col.side .remote-tabs button { min-height: 44px; flex-direction: row; gap: 8px; }
.remote-col-body { overflow-y: auto; padding: 12px; min-height: 0; }
.remote-col-title { margin: 0 0 12px; font-size: 1.05rem; }
.remote.wide .remote-now { justify-content: center; }
.remote.wide .remote-cover { width: min(100%, 58dvh, 560px); }
.remote.wide .remote-meta .np-title { font-size: 1.7rem; }
.remote.land .remote-now { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto auto; align-items: center; text-align: left; gap: 8px 16px; }
.remote.land .remote-cover { width: min(40dvh, 34vw); grid-row: 1 / span 4; }
.remote.land .remote-controls { justify-content: flex-start; gap: 16px; }
.remote.land .remote-play { width: 60px; height: 60px; }
.remote.land .remote-next { grid-column: 1 / -1; }
.remote-title-row { display: flex; align-items: center; gap: 8px; }
.remote.land .remote-title-row, .remote.land .remote-meta { text-align: left; }
.heart { font-size: 1.5rem; color: var(--muted); border-radius: 50%; }
.heart.on { color: var(--accent); }
.owner-menu section h3 { margin: 0 0 8px; font-size: 1rem; }
.owner-menu section + section { border-top: 1px solid var(--line); padding-top: 12px; }
.remote-ended { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.remote.land .remote-next { display: none; }
.remote.land .remote-col { padding: 12px; }
.remote.land .remote-cover { width: min(34dvh, 30vw); }

/* Beitritte (Besitzer): gut sichtbar oben, schliessen sich nach 15 s; Balken zeigt die Restzeit. */
.join-pops { position: fixed; z-index: 55; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.join-pop { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 12px 12px 14px;
  background: var(--panel-2); border: 2px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); animation: join-in .25s ease-out; }
.join-pop .avatar { width: 40px; height: 40px; flex: none; }
.join-pop .meta { min-width: 0; }
.join-pop-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: join-timer 15s linear forwards; }
@keyframes join-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes join-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .join-pop { animation: none; } .join-pop-timer { animation-duration: 15s; } }

/* Einheitlicher Player (v3.5): Kopf mit "← Radio", Titel und Unterzeile; Hoeren, Spulen, Verlauf. */
.remote-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.remote-head .back { padding-inline: 8px; white-space: nowrap; }
.remote-head-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.remote-head-title b, .remote-head-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-modes { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.seg.small button { padding: 4px 10px; font-size: .85rem; min-height: 32px; }
.hear { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hear .muted.small { flex-basis: 100%; }
.remote-link { margin: 0; width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-seek { width: 100%; height: 22px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.remote-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line) var(--p, 0%)); }
.remote-seek::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line) var(--p, 0%)); }
.remote-seek::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--text); border: 0; }
.remote-seek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 0; }
.recent { margin-bottom: 4px; }
.recent-toggle { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 0; cursor: pointer; }
.remote-item.played { opacity: .75; }
.remote-item .meta.tap { cursor: pointer; }
.ask-hear .btn { min-height: 48px; }
.owner-menu hr, .modal hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
.remote-now .notice { width: 100%; text-align: left; }
