/* Junior Tablet – Web. Farben kommen aus dem gewählten Design (common.js). */
:root {
  --bgTop: #FFF7EA; --bgBottom: #FFEBCF; --surface: #FFFFFF; --soft: #F1E9DC;
  --ink: #2D2A4A; --inkSoft: #6E6A8F; --primary: #FF6B4A; --onPrimary: #FFFFFF; --volume: #2EC4A6;
  --error: #D7263D; --ok: #2E7D32; --sun: #FFC23D;
  --font: "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--bgBottom); }
body {
  font-family: var(--font); color: var(--ink);
  background: linear-gradient(var(--bgTop), var(--bgBottom)) fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
.hidden { display: none !important; }

/* ---------- Kopfleiste (Verwaltung + Tablet-Ansicht) ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; text-decoration: none; color: var(--ink); }
.topbar .brand img { width: 36px; height: 36px; }
.topbar nav { display: flex; gap: 6px; margin-left: 12px; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
  padding: 8px 14px; border-radius: 999px; border: 0; background: transparent;
  color: var(--inkSoft); font-weight: 700; text-decoration: none;
}
.topbar nav a.active, .topbar nav button.active { background: var(--primary); color: var(--onPrimary); }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--inkSoft); font-weight: 600; font-size: 14px; }

/* ---------- Allgemeine Bedienelemente ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 10px 18px; font-weight: 800;
  background: var(--primary); color: var(--onPrimary);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 30%, transparent);
  transition: transform .1s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--soft); color: var(--ink); box-shadow: none; }
.btn.danger { background: var(--error); color: #fff; box-shadow: none; }
.btn.small { padding: 6px 12px; border-radius: 10px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--inkSoft); box-shadow: none; }

input[type=text], input[type=password], input[type=number], input[type=url], input[type=time], select, textarea {
  border: 2px solid var(--soft); background: var(--surface); border-radius: 12px; padding: 9px 12px; outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 14px; color: var(--inkSoft); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--primary); }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--bgTop); padding: 12px 20px; border-radius: 14px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.toast.err { background: var(--error); color: #fff; }

/* ---------- Modals ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: min(460px, 92vw); width: 100%; color: var(--ink); }
dialog.modal::backdrop { background: rgba(20, 18, 40, .45); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-card { background: var(--surface); border-radius: 22px; padding: 22px 24px 18px; box-shadow: 0 18px 50px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; }
.modal-card h3 { margin: 0 0 2px; font-size: 20px; font-weight: 800; }
.modal-card p { margin: 0; color: var(--inkSoft); line-height: 1.45; overflow-wrap: anywhere; }
.modal-card label.field > input { width: 100%; }
.modal-err { color: var(--error); font-weight: 700; font-size: 14px; }
.modal-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
dialog.modal.danger .modal-card { border-top: 6px solid var(--error); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); background: var(--surface); border-radius: 32px; padding: 36px 32px;
  box-shadow: 0 16px 48px rgba(45,42,74,.15); display: flex; flex-direction: column; gap: 16px;
}
.login-card .logo { width: 96px; height: 96px; align-self: center; filter: drop-shadow(0 8px 16px rgba(255,94,77,.35)); }
.login-card h1 { margin: 0; text-align: center; font-size: 26px; font-weight: 900; }
.login-card p.sub { margin: -8px 0 6px; text-align: center; color: var(--inkSoft); }
.login-card .btn { padding: 14px; font-size: 17px; margin-top: 6px; }
.login-card .error { color: var(--error); font-weight: 700; text-align: center; min-height: 1.3em; }

/* ============================================================
   Tablet-Ansicht (sieht aus wie die App)
   ============================================================ */
.tablet-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.tablet-page .topbar { flex: none; }
.tablet { flex: 1; min-height: 0; display: flex; }
.kind-rail {
  width: 136px; flex: none; overflow-y: auto; padding: 16px 12px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.tablet-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tablet-head { padding: 14px 20px 0 8px; }
.tablet-head h2 { margin: 0; font-size: 32px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  display: inline-flex; align-items: center; margin-top: 6px; padding: 8px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--inkSoft); font-weight: 700; font-size: 18px;
}
.chip.low { background: color-mix(in srgb, var(--sun) 45%, transparent); color: #2D2A4A; }
.chip.locked { background: color-mix(in srgb, var(--error) 18%, transparent); color: var(--error); margin-left: 8px; }

.cat-row { display: flex; gap: 14px; overflow-x: auto; padding: 12px 20px 8px 8px; flex: none; scrollbar-width: thin; }
.cat-row .choice { width: 124px; flex: none; }

/* Bereichs-/Kategorie-Kachel */
.choice {
  border: 0; border-radius: 28px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.08); transform: scale(.95); transition: transform .15s, box-shadow .15s, background .15s;
}
.dark .choice { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.choice:hover { transform: scale(.98); }
.choice:active { transform: scale(.93); }
.choice.selected { background: var(--c); color: #fff; transform: scale(1); box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 50%, transparent); }
.choice .circle {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; position: relative;
  background: color-mix(in srgb, var(--c) 18%, transparent); font-size: 34px; color: var(--c);
}
.dark .choice .circle { background: color-mix(in srgb, var(--c) 30%, transparent); }
.choice.selected .circle { background: rgba(255,255,255,.25); color: #fff; }
.choice .circle img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.choice .label { font-weight: 900; font-size: 18px; line-height: 21px; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.grid {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 18px 20px 24px 8px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; align-content: start;
}
.tile {
  border: 0; border-radius: 28px; padding: 10px; background: var(--surface); color: var(--ink); text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.10); transition: transform .12s, box-shadow .12s;
}
.tile:active { transform: scale(.95); }
.tile.current { background: var(--c); color: #fff; box-shadow: 0 10px 28px color-mix(in srgb, var(--c) 55%, transparent); }
.thumb {
  position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-size: 64px;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .badge {
  position: absolute; right: 10px; bottom: 10px; width: 56px; height: 56px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; color: var(--c);
}
.tile .title {
  font-weight: 800; font-size: 20px; line-height: 24px; height: 48px; margin: 10px 4px 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--inkSoft); font-size: 26px; }
.empty .big { font-size: 72px; }

/* Equalizer */
.eq { display: flex; align-items: flex-end; gap: 6px; height: 30px; }
.eq i { width: 6px; background: currentColor; border-radius: 3px; animation: eq .42s linear infinite alternate; }
.eq i:nth-child(2) { animation-delay: .18s; } .eq i:nth-child(3) { animation-delay: .36s; }
@keyframes eq { from { height: 25%; } to { height: 100%; } }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 4px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Player-Leiste */
.player {
  margin: 0 16px 16px; padding: 12px 16px; border-radius: 36px; background: var(--surface);
  box-shadow: 0 8px 32px rgba(0,0,0,.16); display: flex; align-items: center; gap: 14px; flex: none;
}
.player .pthumb { width: 84px; height: 84px; border-radius: 22px; font-size: 40px; flex: none; --c: var(--primary); }
.player .info { flex: 1; min-width: 0; }
.player .info .t { font-weight: 900; font-size: 24px; line-height: 28px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.player .info .s { font-size: 15px; color: var(--inkSoft); margin-top: 2px; }
.player .info .s.err { color: var(--error); }
.round {
  border: 0; border-radius: 50%; display: grid; place-items: center; flex: none;
  width: 72px; height: 72px; background: var(--soft); color: var(--ink); transition: transform .1s;
}
.round:active { transform: scale(.92); }
.round:disabled { opacity: .35; cursor: default; }
.round.big { width: 96px; height: 96px; background: var(--primary); color: var(--onPrimary); }
.round.vol { width: 60px; height: 60px; background: var(--surface); }
.round svg { width: 42%; height: 42%; fill: currentColor; }
.volume { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 999px; background: var(--soft); flex: none; }
.steps { display: flex; align-items: flex-end; gap: 5px; height: 44px; }
.steps i { width: 12px; border-radius: 6px; background: var(--surface); }
.steps i.on { background: var(--volume); }

.speaker-pick { display: flex; align-items: center; gap: 8px; }
.speaker-pick select { padding: 7px 10px; font-weight: 700; }
.design-pick { display: flex; gap: 4px; }
.design-pick button { border: 0; background: transparent; font-size: 20px; padding: 4px 6px; border-radius: 10px; opacity: .55; }
.design-pick button.active { opacity: 1; background: var(--soft); }

@media (max-width: 760px) {
  .tablet { flex-direction: column-reverse; }
  .kind-rail { width: auto; flex-direction: row; overflow-x: auto; padding: 8px 10px; gap: 10px; }
  .kind-rail .choice { width: 92px; flex: none; padding: 8px 4px; border-radius: 20px; }
  .kind-rail .circle { width: 40px; height: 40px; font-size: 22px; }
  .kind-rail .label { font-size: 14px; line-height: 16px; }
  .tablet-head { padding: 12px 12px 0; } .tablet-head h2 { font-size: 24px; }
  .cat-row { padding-left: 12px; gap: 10px; } .cat-row .choice { width: 96px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px 12px 16px; }
  .tile .title { font-size: 16px; line-height: 20px; height: 40px; }
  .player { flex-wrap: wrap; margin: 0 10px 10px; border-radius: 28px; padding: 12px; gap: 10px; }
  .player .pthumb { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; }
  .player .info { flex-basis: calc(100% - 70px); }
  .player .info .t { font-size: 18px; line-height: 22px; }
  .round { width: 52px; height: 52px; } .round.big { width: 68px; height: 68px; } .round.vol { width: 44px; height: 44px; }
  .volume { margin-left: auto; }
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 6px 10px; }
  .topbar .brand { font-size: 0; gap: 0; } .topbar .brand img { width: 30px; height: 30px; }
  .topbar nav { margin-left: 0; flex-wrap: nowrap; }
  .topbar nav a { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .tablet-page .topbar nav a.active { display: none; }
  .speaker-pick { min-width: 0; flex: 1 1 auto; } .speaker-pick select { width: 100%; max-width: 160px; padding: 5px 6px; font-size: 13px; }
  .topbar .spacer { display: none; }
  .design-pick { display: none; }
  .topbar .btn.small { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
  .tablet-head h2 { font-size: 20px; } .chip { font-size: 14px; padding: 4px 10px; margin-top: 2px; }
  .tablet-head { padding-top: 6px; }
  .cat-row { padding-top: 8px; padding-bottom: 10px; } .cat-row .choice { width: 84px; }
  .choice .circle { width: 44px; height: 44px; font-size: 24px; } .choice .label { font-size: 13px; line-height: 15px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thumb { font-size: 44px; } .thumb .badge { width: 40px; height: 40px; right: 6px; bottom: 6px; }
  .player { padding: 8px 10px; gap: 8px; margin-bottom: 6px; }
  .player .info { flex-basis: calc(100% - 66px); }
  .player .info .t { font-size: 16px; line-height: 20px; -webkit-line-clamp: 1; }
  .player > .round, .player .round { width: 46px; height: 46px; } .player .round.big { width: 60px; height: 60px; } .player .round.vol { width: 38px; height: 38px; }
  .player > #bPrev { margin-left: 4px; }
  .steps { height: 32px; } .steps i { width: 8px; }
  .album-view { padding: 4px 12px 16px; } .album-head .thumb { width: 100px; } .album-head h3 { font-size: 22px; }
  .album-head { gap: 12px; } .album-head .info { min-width: 0; }
  .track .t { font-size: 16px; }
  .kind-rail { flex: none; } .kind-rail .choice { width: 84px; }
}

/* ============================================================
   Verwaltung
   ============================================================ */
.admin { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
.admin h1 { font-size: 28px; font-weight: 900; margin: 6px 0 18px; }
.card {
  background: var(--surface); border-radius: 24px; padding: 20px 22px; margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(45,42,74,.07);
}
.card h3 { margin: 0 0 14px; font-size: 19px; font-weight: 900; }
.card .hint { color: var(--inkSoft); font-size: 14px; margin: -6px 0 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .grow { flex: 1; min-width: 220px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }

.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--soft);
}
.item:first-child { border-top: 0; }
.item .ithumb { width: 56px; height: 56px; border-radius: 14px; flex: none; font-size: 26px; --c: var(--primary); }
.item .main { flex: 1; min-width: 0; }
.item .main .name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main .meta { font-size: 13px; color: var(--inkSoft); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.item .main .meta a { color: var(--inkSoft); }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.item.off { opacity: .55; }
.item select { max-width: 190px; padding: 6px 8px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.ready { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.pending, .pill.downloading { background: color-mix(in srgb, var(--sun) 35%, transparent); color: #7A5500; }
.pill.error { background: color-mix(in srgb, var(--error) 15%, transparent); color: var(--error); }
.pill.off { background: var(--soft); color: var(--inkSoft); }
.errtext { color: var(--error); font-size: 13px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.filters input[type=text] { flex: 1; min-width: 200px; }

.kind-group { margin-top: 8px; }
.kind-group > .kh { font-weight: 900; font-size: 17px; margin: 12px 0 2px; display: flex; align-items: center; gap: 8px; }

.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.device h3 { display: flex; align-items: center; gap: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--error); display: inline-block; }
.dot.on { background: var(--ok); }
.device .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.device .usage { background: var(--soft); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-weight: 700; }
.bar { height: 10px; border-radius: 5px; background: var(--surface); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--volume); }
.token { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--soft); padding: 8px 10px; border-radius: 10px; word-break: break-all; }
.windows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.win { display: flex; gap: 6px; align-items: center; }
.win select { width: 70px; } .win input { width: 110px; }
details summary { cursor: pointer; font-weight: 800; color: var(--inkSoft); margin: 6px 0; }
.lockbtn.locked { background: var(--error); color: #fff; }

/* Feinschliff */
label.field > input, label.field > select, label.field > textarea { width: 100%; }
.choice .label { max-width: 100%; overflow-wrap: break-word; }
.kind-rail .choice .label { hyphens: auto; -webkit-hyphens: auto; }
.cat-row { padding-top: 14px; padding-bottom: 18px; padding-left: 12px; margin-left: -4px; }
.cat-row .choice.selected { box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 45%, transparent); }
.cat-row .choice { width: 132px; padding-left: 4px; padding-right: 4px; }
.cat-row .choice .label { hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 760px) { .cat-row .choice { width: 100px; } }

/* ---------- Sammlungen (Verwaltung) ---------- */
.album-wrap { border-top: 1px solid var(--soft); }
.album-wrap:first-child { border-top: 0; }
.album-wrap > .item { border-top: 0; }
.tracks { margin: 0 0 12px 68px; border-left: 3px solid var(--soft); padding-left: 12px; }
.tracks .item { padding: 6px 0; }
.tracks .no { width: 30px; flex: none; text-align: right; font-weight: 900; color: var(--inkSoft); }
.pill.album { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
@media (max-width: 700px) { .tracks { margin-left: 8px; } }

/* ---------- App / QR ---------- */
dialog.modal.wide { max-width: min(560px, 96vw); }
.qrbox { display: flex; justify-content: center; padding: 8px 0; overflow: auto; }
.qrbox svg { background: #fff; border-radius: 10px; flex: none; }
.apk-current { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.apk-current .facts { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.apk-current .facts b { display: inline-block; min-width: 130px; color: var(--inkSoft); font-weight: 700; }
.progress { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
ol.steps-list { margin: 0; padding-left: 22px; line-height: 1.6; }
.pill.warn { background: color-mix(in srgb, var(--sun) 35%, transparent); color: #7A5500; }

/* ---------- Sammlungen (Tablet-Ansicht) ---------- */
.thumb .stack {
  position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.62); color: #fff; font-size: 15px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; line-height: 1.4;
}
.tile .resume { font-size: 14px; font-weight: 800; color: var(--inkSoft); margin: -2px 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.current .resume { color: rgba(255,255,255,.85); }
.album-view { flex: 1; min-height: 0; overflow: auto; padding: 4px 20px 20px 8px; }
.album-head { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.album-head .thumb { width: 150px; flex: none; font-size: 54px; }
.album-head .info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.album-head h3 { margin: 0; font-size: 28px; font-weight: 900; }
.album-head .sub { color: var(--inkSoft); font-weight: 700; }
.back-btn { border: 0; background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: 18px; padding: 10px 18px; border-radius: 999px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.08); margin-bottom: 14px; }
.resume-btn { border: 0; background: var(--c); color: #fff; font: inherit; font-weight: 900; font-size: 22px; padding: 16px 26px; border-radius: 999px; cursor: pointer; align-self: flex-start; box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 45%, transparent); }
.resume-btn .small { display: block; font-size: 15px; font-weight: 700; opacity: .9; }
.track-list { display: flex; flex-direction: column; gap: 8px; }
.track { display: flex; align-items: center; gap: 14px; border: 0; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border-radius: 18px; padding: 12px 16px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.track .n { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.track .t { flex: 1; font-weight: 800; font-size: 19px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .d { color: var(--inkSoft); font-weight: 700; font-size: 15px; }
.track.current { background: var(--c); color: #fff; }
.track.current .n { background: rgba(255,255,255,.25); color: #fff; }
.track.current .d { color: rgba(255,255,255,.85); }
.track .eq { height: 22px; } .track .eq i { background: #fff; }

/* Mobil: muss nach den Feinschliff-Regeln stehen */
@media (max-width: 760px) { .cat-row .choice { width: 84px; } .cat-row { padding-left: 12px; margin-left: 0; } }

/* ---------- Geräte: Läuft gerade / Fernbedienung ---------- */
.grid3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.usage-line + .usage-line { margin-top: 8px; }
.nowbox { background: var(--soft); border-radius: 18px; padding: 12px 14px; margin: 6px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.now-idle { color: var(--inkSoft); font-weight: 700; font-size: 14px; }
.now-top { display: flex; gap: 14px; align-items: center; }
.now-thumb { width: 112px; aspect-ratio: 16 / 9; border-radius: 12px; flex: none; font-size: 30px; --c: var(--primary); }
.now-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.now-main .name { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-label { font-size: 13px; font-weight: 800; color: var(--inkSoft); }
.now-bat { margin-left: auto; align-self: flex-start; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--inkSoft); white-space: nowrap; }
.now-bat .bat-icon { position: relative; width: 26px; height: 13px; border: 2px solid currentColor; border-radius: 3px; padding: 1px; box-sizing: border-box; }
.now-bat .bat-icon::after { content: ""; position: absolute; right: -5px; top: 3px; width: 3px; height: 5px; background: currentColor; border-radius: 0 2px 2px 0; }
.now-bat .bat-icon i { display: block; height: 100%; border-radius: 1px; }
.now-bat.ok .bat-icon i { background: #2e7d32; }
.now-bat.mid .bat-icon i { background: #ef8f00; }
.now-bat.low .bat-icon i { background: #d32f2f; }
.now-bat.low { color: #d32f2f; }
.now-prog { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--inkSoft); font-weight: 700; }
.now-prog .bar { flex: 1; margin: 0; }
.now-ctl { gap: 8px; }
.now-ctl .btn[disabled] { opacity: .4; cursor: default; }
.now-vol { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.now-vol input[type=range] { flex: 1; accent-color: var(--volume); }
.now-vol-label { min-width: 70px; text-align: right; font-size: 14px; color: var(--inkSoft); }
.tracks .ithumb { width: 80px; height: 45px; border-radius: 10px; flex: none; font-size: 20px; --c: var(--primary); }
.track .tthumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 12px; flex: none; font-size: 26px; }
.track { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 700px) { .track .tthumb { width: 72px; } }

/* ---------- Verwaltung: mobil ---------- */
.acts-toggle { display: none; }
#tabs { overflow-x: auto; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
#tabs nav { margin-left: 0; flex-wrap: nowrap; }
#tabs nav a { white-space: nowrap; background: var(--surface); }
#tabs nav a.active { background: var(--primary); }
@media (max-width: 760px) {
  .admin { padding: 12px 10px 60px; }
  .card { padding: 16px 14px; border-radius: 20px; }
  #who { display: none; }
  .row > .grow { min-width: 0; flex-basis: 100%; }
  .row > .btn { width: 100%; }
  .filters input[type=text] { min-width: 0; flex-basis: 100%; }
  .filters select { flex: 1; min-width: 0; }
  .device .grid2 { grid-template-columns: 1fr; }
  .win { flex-wrap: wrap; } .win input { width: 100px; }
  .now-top { flex-wrap: wrap; } .now-thumb { width: 88px; }

  .item { flex-wrap: wrap; gap: 10px; }
  .item .ithumb { width: 48px; height: 48px; }
  .item .main { flex: 1 1 0; }
  .item .main .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .acts-toggle { display: inline-block; flex: none; }
  .item .acts { display: none; flex: 1 1 100%; justify-content: flex-start; }
  .item.open .acts { display: flex; }
  .item .acts select { max-width: 100%; flex: 1 1 100%; }
  .item .acts input[type=text] { width: 100%; }
}

/* Teile einer Sammlung als Kacheln */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; align-content: start; }
@media (max-width: 760px) { .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .track-grid .tile .title { font-size: 16px; line-height: 20px; height: 40px; } }

/* ---------- Verwaltung: Seitennavigation mit aufklappbaren Gruppen (1.9.0) ---------- */
.admin-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; max-width: 1440px; margin: 0 auto; }
.admin-layout .admin { max-width: none; margin: 0; width: 100%; }
.sidenav {
  position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow-y: auto;
  padding: 20px 10px 30px 16px; display: flex; flex-direction: column; gap: 8px;
}
.sidenav-account { font-weight: 900; font-size: 15px; color: var(--inkSoft); padding: 0 10px 6px; overflow-wrap: anywhere; }
.navgroup { background: color-mix(in srgb, var(--surface) 75%, transparent); border-radius: 18px; padding: 4px 6px 6px; }
.navgroup > summary {
  list-style: none; cursor: pointer; font-weight: 900; font-size: 15px; padding: 9px 10px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; user-select: none;
}
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary::after { content: "▾"; color: var(--inkSoft); transition: transform .15s; }
.navgroup:not([open]) > summary::after { transform: rotate(-90deg); }
.navgroup > summary:hover { background: var(--soft); }
.navgroup a {
  display: block; padding: 8px 12px 8px 16px; border-radius: 12px; text-decoration: none;
  color: var(--ink); font-weight: 700; font-size: 15px;
}
.navgroup a:hover { background: var(--soft); }
.navgroup a.active { background: var(--primary); color: var(--onPrimary); }
.nav-toggle { display: none; font-size: 22px; padding: 4px 10px; }
.nav-backdrop { display: none; }
.acting {
  background: color-mix(in srgb, var(--sun) 45%, var(--surface)); padding: 10px 20px; font-weight: 700;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center;
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-block; }
  .topbar .topnav { display: none; }
  .sidenav {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); max-height: none; z-index: 40;
    background: var(--bgTop); box-shadow: 6px 0 30px rgba(0,0,0,.25); padding-top: 18px;
    transform: translateX(-105%); transition: transform .2s ease-out;
  }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20,18,40,.35); }
}

/* ---------- Geräte zuklappbar ---------- */
.device .dev-head { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; user-select: none; }
.device .dev-head h3 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .dev-head .chev { font-size: 20px; color: var(--inkSoft); transition: transform .15s; }
.device.collapsed .dev-head .chev { transform: rotate(-90deg); }
.device .dev-sum { font-size: 13px; color: var(--inkSoft); font-weight: 700; margin: 6px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.device .dev-body { margin-top: 14px; }
.device.collapsed .dev-body { display: none; }
.devices { align-items: start; }
.devices .device:not(.collapsed) { grid-column: 1 / -1; }
.extend-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.extend-row .lbl { font-weight: 800; min-width: 92px; }
.app-rows { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.app-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--soft); border-radius: 12px; padding: 8px 10px; }
.app-row .aname { font-weight: 800; flex: 1; min-width: 140px; }
.app-row input[type=number] { width: 110px; }

/* ---------- Geräte-Auswahl (Chips) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid var(--soft); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.pill.purged { background: color-mix(in srgb, #6f5cff 15%, transparent); color: #5a48d6; }
.pill.dev { background: var(--soft); color: var(--ink); }

/* ---------- Superadmin ---------- */
.inst { border-top: 1px solid var(--soft); padding: 12px 0; }
.inst-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inst-head .name { font-weight: 900; font-size: 17px; flex: 1; min-width: 180px; }
.inst .list { margin: 8px 0 0 18px; }
.reg-link { text-align: center; margin-top: 14px; font-weight: 700; color: var(--inkSoft); }

/* ---------- Kopfleiste: Familie unter dem Namen ---------- */
.topbar .brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.topbar .brand-text small { font-size: 12px; font-weight: 700; color: var(--inkSoft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.topbar .brand-text small:empty { display: none; }
.navsingle { padding: 4px 6px; }

/* ---------- Dashboard ---------- */
.dash-sum { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; font-weight: 800; }
.dash-sum .hint { margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.dash-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.dash-card .dash-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--inkSoft); font-weight: 700; margin: 4px 0 10px; }
.dash-card .dash-state { margin: 0 0 8px; font-weight: 800; }
.dash-card .dash-state.bad { color: var(--error); }
.dash-card .dash-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.now-vol-btns { display: flex; gap: 6px; margin-top: 8px; }
.now-vol-btns .btn { min-width: 56px; }
@media (max-width: 480px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Spenden ---------- */
.donate-box { text-align: center; background: var(--soft); border-radius: 18px; padding: 18px 12px; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.donate-box .twint { font-weight: 900; letter-spacing: .12em; font-size: 22px; }
.donate-num { font-weight: 900; font-size: 26px; letter-spacing: .02em; user-select: all; }

/* ---------- Konto: 2FA, Einladungen ---------- */
.tfa-qr { display: flex; justify-content: center; margin: 10px 0; }
.recovery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; background: var(--soft); border-radius: 12px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-weight: 700; }

/* ---------- Inhalte: Gruppen, Aktionen-Menü (11/2026) ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.filters select { padding: 7px 10px; }
.cat-group { margin-top: 6px; }
.cat-head {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: var(--soft); color: var(--ink);
  border-radius: 14px; padding: 10px 14px; font-weight: 900; font-size: 16px; text-align: left; margin-top: 8px;
}
.cat-head .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-head .ccount { background: var(--surface); border-radius: 999px; padding: 1px 10px; font-size: 13px; color: var(--inkSoft); }
.cat-head .chev { color: var(--inkSoft); transition: transform .15s; }
.cat-head.closed .chev { transform: rotate(-90deg); }
.cat-group > .list { padding: 0 4px; }
.item .acts.keep { flex-wrap: nowrap; }
.menu-btn { white-space: nowrap; }
.menu-pop {
  position: absolute; z-index: 60; min-width: 230px; max-width: calc(100vw - 16px); background: var(--surface);
  border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.22); padding: 6px; display: flex; flex-direction: column;
}
.menu-item { border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--soft); outline: none; }
.menu-item.danger { color: var(--error); }
.menu-sep { height: 1px; background: var(--soft); margin: 4px 6px; }
.pill.upload { background: color-mix(in srgb, var(--volume) 18%, transparent); color: #0f7a66; }
.bar.thin { height: 6px; margin-top: 6px; background: var(--soft); max-width: 420px; }
.check-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.check-row { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--soft); cursor: pointer; font-weight: 700; }
.check-row input { width: 18px; height: 18px; accent-color: var(--error); }
.up-row.ok .up-state { color: var(--ok); font-weight: 700; }
.up-row.err .up-state { color: var(--error); font-weight: 700; }
.xfer-dev { border-top: 1px solid var(--soft); padding: 12px 0; }
.xfer-dev:first-child { border-top: 0; padding-top: 0; }
.xfer-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.xfer-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--inkSoft); font-weight: 700; margin-top: 6px; }
.xfer-dev .bar { background: var(--soft); }
.xfer-dev details { margin-top: 8px; }
.xfer-dev summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.xfer-list { max-height: 320px; overflow-y: auto; margin-top: 6px; }
.xfer-item { display: flex; gap: 8px; align-items: center; padding: 5px 2px; border-top: 1px solid var(--soft); font-size: 14px; }
.xfer-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .item.crow { flex-wrap: nowrap; }
  .item.crow .acts.keep { display: flex; flex: none; }
  .item.crow .menu-btn { font-size: 0; padding: 6px 12px; }
  .item.crow .menu-btn::before { content: "⋯"; font-size: 18px; line-height: 1; }
  .cat-head { font-size: 15px; }
}
@media (max-width: 760px) {
  .filters select { flex: 1 1 calc(50% - 5px); }
  .filters .btn { flex: 1 1 100%; }
}
/* Fortschritt ohne Prozent (z. B. Umwandeln): laufender Streifen */
.bar.indet > i { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
