/* SCHRAMME Radio – Design-System */
:root {
  --bg: #0a0a10;
  --bg-2: #101018;
  --surface: #15151f;
  --surface-2: #1c1c29;
  --surface-3: #262636;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f4f4f8;
  --text-2: #a9a9bc;
  --text-3: #6e6e84;
  --brand: #ff2d55;
  --brand-2: #ff9500;
  --grad: linear-gradient(135deg, #ff2d55 0%, #ff5a36 50%, #ff9500 100%);
  --deck-a: #ff7a1a;
  --deck-b: #19d3ff;
  --ok: #30d158;
  --warn: #ffd60a;
  --err: #ff453a;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 248px;
  --player: 84px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
::selection { background: rgba(255, 45, 85, 0.4); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

svg.ic { width: 20px; height: 20px; flex: none; display: block; }
i[data-icon] { display: contents; }

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: 1fr var(--player);
  grid-template-areas: 'side main' 'player player';
  height: 100dvh;
}
.sidebar {
  grid-area: side;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 14px;
  gap: 24px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark svg { width: 42px; height: 42px; display: block; filter: drop-shadow(0 6px 18px rgba(255, 45, 85, 0.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.04em; }
.brand-text small { font-size: 11px; letter-spacing: 0.45em; color: var(--text-2); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad);
}
.nav a.active svg { color: var(--brand); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.install-btn {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 10px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; font-weight: 500;
}
.install-btn:hover { background: var(--surface-2); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-chip .user-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-form { display: flex; flex-direction: column; gap: 14px; }
.user-badge { font-size: 11px; font-weight: 700; color: var(--brand-2); border: 1px solid rgba(255,149,0,0.4); border-radius: 6px; padding: 1px 6px; }
.server-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); padding: 0 8px; }
.server-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.server-status.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.server-status.err .dot { background: var(--err); }

.main {
  grid-area: main;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px clamp(16px, 3vw, 40px) 48px;
  scroll-behavior: smooth;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 45, 85, 0.10), transparent 60%),
    radial-gradient(700px 400px at 0% 0%, rgba(255, 149, 0, 0.06), transparent 60%),
    var(--bg);
}
.view { display: none; flex-direction: column; gap: 24px; max-width: 1400px; margin: 0 auto; animation: fade 0.25s ease; }
.view.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-2); }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin-top: 8px; }
.head-actions { display: flex; gap: 10px; }

/* ---------- Bausteine ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head.spaced { margin-top: 12px; }
.card-tools { display: flex; gap: 6px; }
.hint { font-size: 12px; color: var(--text-3); }
.count { font-size: 13px; font-weight: 500; color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(255, 45, 85, 0.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.live { background: var(--surface-2); border-color: rgba(255,45,85,0.5); box-shadow: 0 0 0 4px rgba(255,45,85,0.1); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: none; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2);
  transition: background 0.15s, color 0.15s; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--brand); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 17px; height: 17px; }

.search { position: relative; display: flex; align-items: center; min-width: min(420px, 100%); }
.search svg { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 46px; padding: 0 16px 0 44px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-2); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input:focus { border-color: rgba(255, 45, 85, 0.6); box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.12); }
.search-sm { min-width: 220px; }
.search-sm input { height: 38px; border-radius: 10px; font-size: 14px; }
.search-lg { flex: 1; min-width: 0; }
.search-lg input { height: 50px; }

.input, .select {
  width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--bg-2);
  border: 1px solid var(--line-2); outline: none; resize: vertical;
}
.input:focus, .select:focus { border-color: rgba(255, 45, 85, 0.6); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a9a9bc' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-2); }
.field b { color: var(--text); }

input[type='range'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
  --p: 50%;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 5px; border-radius: 5px;
  background: linear-gradient(90deg, var(--brand) 0, var(--brand-2) var(--p), var(--surface-3) var(--p));
}
input[type='range']::-moz-range-track { height: 5px; border-radius: 5px; background: var(--surface-3); }
input[type='range']::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--grad); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -5.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: #fff; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; border-radius: 24px; background: var(--surface-3); position: relative; transition: background 0.2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2);
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); transition: all 0.15s;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.filters .select { width: auto; min-width: 200px; height: 38px; padding-top: 0; padding-bottom: 0; border-radius: 999px; }

/* ---------- Sender-Kacheln ---------- */
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.station {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.station:hover { background: var(--surface-2); transform: translateY(-2px); border-color: var(--line-2); }
.station.playing { border-color: rgba(255, 45, 85, 0.6); box-shadow: 0 0 0 1px rgba(255,45,85,0.3), 0 10px 30px rgba(255,45,85,0.12); }
.station-art {
  aspect-ratio: 1; border-radius: 12px; background: var(--surface-3); overflow: hidden;
  display: grid; place-items: center; position: relative;
}
.station-art img { width: 78%; height: 78%; object-fit: contain; }
.station-art .fallback { font-family: var(--font-display); font-size: 42px; font-weight: 700; color: rgba(255,255,255,0.9); }
.station-art .play-overlay {
  position: absolute; inset: auto 10px 10px auto; width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; color: #fff;
  opacity: 0; transform: translateY(6px); transition: all 0.2s; box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.station:hover .play-overlay, .station.playing .play-overlay { opacity: 1; transform: none; }
.station-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.station .fav {
  position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(10,10,16,0.65); backdrop-filter: blur(8px); border: none; cursor: pointer;
  display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity 0.15s;
}
.station .fav svg { width: 16px; height: 16px; }
.station:hover .fav, .station .fav.on { opacity: 1; }
.station .fav.on { color: var(--brand); }
.station .fav.on svg { fill: currentColor; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); aspect-ratio: 0.8; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.load-more { display: flex; justify-content: center; }

/* ---------- Studio ---------- */
.studio-hero {
  display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 40px; align-items: center;
  padding: 28px; border-radius: 24px; border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 20% 50%, rgba(255,45,85,0.18), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--surface);
  overflow: hidden;
}
.studio-visual { position: relative; aspect-ratio: 1; width: 100%; max-width: 420px; }
.studio-visual canvas { width: 100%; height: 100%; display: block; }
.studio-logo { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.studio-logo svg { width: 44%; height: 44%; filter: drop-shadow(0 10px 40px rgba(255,45,85,0.55)); transition: transform 0.08s; }
.onair-badge {
  position: absolute; top: 9%; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; background: var(--surface-3); color: var(--text-3);
  border: 1px solid var(--line-2);
}
.onair-badge span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.onair-badge.live { background: rgba(255, 45, 85, 0.18); color: #ff6b85; border-color: rgba(255,45,85,0.5); }
.onair-badge.live span { animation: blink 1.2s infinite; background: var(--brand); box-shadow: 0 0 10px var(--brand); }
@keyframes blink { 50% { opacity: 0.25; } }
.studio-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.studio-title {
  font-size: clamp(28px, 3.6vw, 52px); line-height: 1.08; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.studio-sub { margin: 0; color: var(--text-2); font-size: 17px; }
.studio-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.studio-progress { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.studio-progress .bar { flex: 1; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.studio-progress .bar div { height: 100%; width: 0; background: var(--grad); border-radius: 5px; }
.studio-stats { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.studio-stats b { color: var(--text); font-family: var(--font-display); font-size: 18px; display: block; }
.studio-stats .jingle-meter { display: flex; gap: 4px; margin-top: 6px; }
.studio-stats .jingle-meter i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-3); display: block; }
.studio-stats .jingle-meter i.on { background: var(--grad); }

.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.queue li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.queue li:hover { background: var(--surface-2); }
.queue li .n { width: 20px; text-align: center; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.queue li.jingle-marker { padding: 4px 8px; font-size: 12px; color: var(--brand-2); gap: 8px; }
.queue li.jingle-marker svg { width: 14px; height: 14px; }
.queue li.jingle-marker:hover { background: transparent; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 28px; align-items: center; }

.pads { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pad {
  position: relative; aspect-ratio: 1.15; border-radius: 14px; border: 1px solid var(--line-2);
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2); user-select: none; touch-action: manipulation;
  transition: transform 0.06s, box-shadow 0.15s, color 0.15s;
  --c: var(--brand);
}
.pad svg { width: 22px; height: 22px; color: var(--c); }
.pad kbd { position: absolute; top: 6px; left: 8px; font-family: var(--font); font-size: 10px; color: var(--text-3); }
.pad:hover { color: var(--text); }
.pad.hit { transform: scale(0.94); box-shadow: 0 0 0 2px var(--c), 0 0 30px color-mix(in srgb, var(--c) 50%, transparent); color: var(--text); }
.pad.custom { --c: var(--deck-b); }
#studioPads { display: flex; flex-direction: column; gap: 10px; }
.pad-group-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--brand-2); }
.pad-group-title.small { font-size: 12px; color: var(--text-3); margin-top: 6px; letter-spacing: 0.08em; text-transform: uppercase; }
.pads-fx { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.pads-fx .pad { aspect-ratio: 1.3; font-size: 11px; opacity: 0.85; }
.pads-fx .pad svg { width: 18px; height: 18px; }
.pad.active { box-shadow: 0 0 0 2px var(--c), 0 0 24px color-mix(in srgb, var(--c) 40%, transparent); color: var(--text); }
.pads-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pads-compact .pad { aspect-ratio: 1; font-size: 10px; border-radius: 10px; gap: 3px; min-width: 0; padding: 2px; }
.pad span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pads-compact .pad svg { width: 16px; height: 16px; }
.pads-compact .pad kbd { display: none; }

/* ---------- Track-Tabellen ---------- */
.track-table { display: flex; flex-direction: column; }
.track-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 0.7fr) 60px auto; gap: 14px; align-items: center;
  padding: 8px 10px; border-radius: 12px; transition: background 0.12s;
}
.track-row:hover { background: var(--surface-2); }
.track-row.playing .t-title { color: var(--brand-2); }
.track-row .cover, .queue .cover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; flex: none; }
.queue .cover { width: 38px; height: 38px; }
.track-row .cover img, .queue .cover img { width: 100%; height: 100%; object-fit: cover; }
.t-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dur { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.t-actions { display: flex; gap: 2px; }
.t-main { min-width: 0; }
.deck-load { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: 12px; }
.deck-load.a:hover { border-color: var(--deck-a); color: var(--deck-a); }
.deck-load.b:hover { border-color: var(--deck-b); color: var(--deck-b); }
.track-table.compact { max-height: 420px; overflow-y: auto; }
.track-table.compact .track-row { grid-template-columns: 44px minmax(0, 1fr) 60px auto; }
.track-table.compact .cover { width: 40px; height: 40px; }

/* ---------- YouTube ---------- */
.yt-form { display: flex; gap: 10px; }
.legal { margin: -6px 0 0; font-size: 12px; color: var(--text-3); }
.yt-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.yt-item { background: var(--surface-2); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.yt-thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-3); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.75); padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.yt-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.yt-title { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-channel { font-size: 12px; color: var(--text-3); }
.yt-body .btn { margin-top: auto; }
.jobs { display: flex; flex-direction: column; gap: 8px; }
.jobs:empty { display: none; }
.job { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.job-label { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-status { font-size: 12px; color: var(--text-3); text-transform: capitalize; }
.job.done .job-status { color: var(--ok); }
.job.error .job-status { color: var(--err); text-transform: none; }
.job-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.job-bar div { height: 100%; background: var(--grad); transition: width 0.3s; }
.job.converting .job-bar div { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: 0.4; } }

/* ---------- Mixer ---------- */
.mixer { display: grid; grid-template-columns: minmax(0, 1fr) 260px minmax(0, 1fr); gap: 18px; }
.deck {
  --dc: var(--deck-a);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; overflow: hidden;
}
.deck[data-deck='B'] { --dc: var(--deck-b); }
.deck::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--dc); opacity: 0.8; }
.deck.live { border-color: color-mix(in srgb, var(--dc) 45%, transparent); }
.deck-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.deck-letter { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--dc); width: 28px; flex: none; }
.platter {
  width: 64px; height: 64px; border-radius: 50%; flex: none; position: relative;
  background: repeating-radial-gradient(circle, #111 0 2px, #1b1b22 2px 4px); border: 2px solid var(--surface-3);
  overflow: hidden;
}
.platter img { position: absolute; inset: 30%; width: 40%; height: 40%; border-radius: 50%; object-fit: cover; }
.platter::after { content: ''; position: absolute; left: 50%; top: 4px; width: 2px; height: 14px; background: var(--dc); transform: translateX(-50%); border-radius: 2px; }
.deck.spinning .platter { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.deck-info { min-width: 0; flex: 1; }
.deck-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-artist { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-time { font-family: var(--font-display); font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.deck-time b { display: block; font-size: 22px; }
.deck-time small { color: var(--text-3); font-size: 12px; }
.deck-time.warn b { color: var(--err); animation: blink 0.6s infinite; }
.wave { position: relative; height: 84px; border-radius: 12px; background: var(--bg-2); cursor: pointer; overflow: hidden; }
.wave canvas { width: 100%; height: 100%; display: block; }
.deck-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deck-btn {
  height: 44px; min-width: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2);
  cursor: pointer; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.deck-btn:hover { background: var(--surface-3); }
.deck-btn.play { background: color-mix(in srgb, var(--dc) 18%, var(--surface-2)); border-color: color-mix(in srgb, var(--dc) 55%, transparent); color: var(--dc); min-width: 64px; }
.deck-btn.on { background: var(--dc); color: #000; border-color: var(--dc); }
.deck-body { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.knobs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.knob-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); text-transform: uppercase; }
.knob {
  width: 52px; height: 52px; border-radius: 50%; position: relative; cursor: ns-resize; touch-action: none;
  background: radial-gradient(circle at 35% 30%, #3a3a4c, #1a1a24 70%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 10px rgba(0,0,0,0.5);
}
.knob svg { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); }
.knob .ptr { position: absolute; inset: 0; }
.knob .ptr::after { content: ''; position: absolute; left: 50%; top: 6px; width: 3px; height: 12px; border-radius: 2px; background: #fff; transform: translateX(-50%); }
.fader-col { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; }
.vfader { writing-mode: vertical-lr; direction: rtl; width: 30px !important; height: 130px !important; }
.vfader::-webkit-slider-runnable-track { width: 5px !important; height: auto !important; background: var(--surface-3) !important; }
.vfader::-webkit-slider-thumb { width: 28px !important; height: 14px !important; border-radius: 4px !important; margin-top: 0 !important; margin-left: -11.5px !important; background: linear-gradient(#eee, #aaa) !important; }
.tempo-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tempo-row input { flex: 1; }
.tempo-row b { color: var(--text); width: 54px; text-align: right; }
.mixer-center {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  display: flex; flex-direction: column; gap: 18px; justify-content: space-between;
}
.master { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vu-pair { display: flex; gap: 6px; height: 150px; }
.vu { width: 12px; height: 100%; border-radius: 4px; background: var(--bg-2); }
.mini-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; }
.xfader-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.xfader-labels span:first-child { color: var(--deck-a); }
.xfader-labels span:last-child { color: var(--deck-b); }
#crossfader::-webkit-slider-runnable-track { height: 8px; background: linear-gradient(90deg, var(--deck-a), var(--surface-3) 50%, var(--deck-b)); }
#crossfader::-webkit-slider-thumb { width: 22px; height: 30px; border-radius: 5px; margin-top: -11px; background: linear-gradient(#f5f5f5, #9c9cab); }
.mixer-mode { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.mixer-mode .pill { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 600; }
.mixer-mode .pill.auto { color: var(--brand-2); border-color: rgba(255,149,0,0.5); }

/* ---------- Einstellungen ---------- */
.eleven-opts, .browser-opts { display: flex; flex-direction: column; gap: 16px; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; font-size: 14px; }
.file-list li:hover { background: var(--surface-2); }
.file-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .empty-line { color: var(--text-3); font-size: 13px; }
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sys div { padding: 12px 14px; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.sys b { display: block; color: var(--text); font-size: 14px; margin-top: 2px; word-break: break-word; }
.sys .bad b { color: var(--err); }

/* ---------- Player ---------- */
.player {
  grid-area: player; position: relative; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px;
  padding: 0 20px; background: rgba(16, 16, 24, 0.92); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.np { display: flex; align-items: center; gap: 14px; min-width: 0; }
.np-art { width: 54px; height: 54px; border-radius: 10px; background: var(--surface-3); flex: none; overflow: hidden; display: grid; place-items: center; }
.np-art img { width: 100%; height: 100%; object-fit: cover; }
.np-art img.contain { object-fit: contain; padding: 6px; background: #fff; }
.np-art svg.logo { width: 100%; height: 100%; }
.np-text { min-width: 0; }
.np-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.live-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: #fff; background: var(--brand); padding: 2px 6px; border-radius: 4px; flex: none; }
.transport { display: flex; align-items: center; gap: 10px; }
.play-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center;
  background: var(--text); color: var(--bg); transition: transform 0.1s;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn svg { width: 24px; height: 24px; }
.play-btn.loading svg { animation: spin 0.9s linear infinite; }
.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0; }
#barViz { width: 160px; height: 36px; }
.volume { display: flex; align-items: center; gap: 6px; width: 170px; }
.player-progress { position: absolute; top: -1px; left: 0; right: 0; height: 3px; }
.player-progress div { height: 100%; width: 0; background: var(--grad); transition: width 0.25s linear; }
.np-fav-on svg { fill: var(--brand); color: var(--brand); }

.tabbar { display: none; }

/* ---------- Toasts & Dialog ---------- */
.toasts { position: fixed; right: 20px; bottom: calc(var(--player) + 16px); display: flex; flex-direction: column; gap: 10px; z-index: 50; pointer-events: none; }
.toast {
  background: var(--surface-2); border: 1px solid var(--line-2); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; font-size: 14px; max-width: 360px; animation: toastIn 0.25s ease; pointer-events: auto;
}
.toast.err { border-color: rgba(255, 69, 58, 0.5); }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.modal { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.modal form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .studio-hero { grid-template-columns: minmax(220px, 300px) 1fr; gap: 28px; }
  .mixer { grid-template-columns: 1fr 1fr; }
  .mixer-center { grid-column: 1 / -1; order: 3; display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .mixer-center .xfader { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  :root { --sidebar: 76px; }
  .brand-text, .nav a span, .install-btn span, .server-status span:last-child { display: none; }
  .brand, .nav a, .server-status { justify-content: center; }
  .nav a.active::before { left: -14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .studio-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .studio-info { align-items: center; }
  .studio-actions, .studio-stats { justify-content: center; }
  .studio-progress { width: 100%; }
}
@media (max-width: 720px) {
  :root { --player: 72px; }
  body { font-size: 14px; }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto;
    grid-template-areas: 'main' 'player' 'tabs';
  }
  .sidebar { display: none; }
  .main { padding: 20px 16px 32px; }
  .tabbar {
    grid-area: tabs; display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--bg-2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; font-size: 10px; color: var(--text-3); font-weight: 500; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active svg { color: var(--brand); }
  .player { grid-template-columns: minmax(0, 1fr) auto; height: var(--player); padding: 0 12px; gap: 10px; }
  .player-right, #npStop { display: none; }
  .play-btn { width: 44px; height: 44px; }
  .np-art { width: 46px; height: 46px; }
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .station { padding: 10px; }
  .search { min-width: 100%; }
  .view-head { align-items: stretch; flex-direction: column; }
  .view-head .search { width: 100%; }
  .yt-form { flex-direction: column; }
  .mixer { grid-template-columns: 1fr; }
  .mixer-center { grid-template-columns: 1fr; }
  .deck-body { grid-template-columns: 1fr; }
  .fader-col { flex-direction: row; }
  .vfader { writing-mode: horizontal-tb; direction: ltr; width: 100% !important; height: 22px !important; }
  .track-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .track-row .t-artist-col, .track-row .t-dur { display: none; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--player) + 70px); }
  .toast { max-width: none; }
  .studio-hero { padding: 20px 16px; gap: 20px; }
  .studio-visual { max-width: 300px; }
  .studio-actions .btn { flex: 1 1 auto; }
  .search-sm { min-width: 0; width: 100%; }
  .filters .select { width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* ---------- Rechte: Admin-Steuerung nur für Admins ---------- */
body:not(.is-admin) .admin-only { display: none !important; }

/* ---------- Live-Pult ---------- */
.live-card { border-color: rgba(255, 45, 85, 0.25); background: radial-gradient(500px 200px at 0% 0%, rgba(255,45,85,0.10), transparent 70%), var(--surface); }
.live-card.is-live { border-color: rgba(255, 45, 85, 0.7); box-shadow: 0 0 0 1px rgba(255,45,85,0.35), 0 0 40px rgba(255,45,85,0.18); }
.live-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 28px; align-items: start; }
.live-main { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.go-live {
  height: 74px; border-radius: 18px; border: 2px solid rgba(255,45,85,0.6); cursor: pointer;
  background: linear-gradient(180deg, rgba(255,45,85,0.18), rgba(255,45,85,0.06)); color: #fff;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 0.12em;
  display: flex; align-items: center; justify-content: center; gap: 14px; transition: all 0.2s;
}
.go-live:hover { background: rgba(255,45,85,0.28); }
.go-live .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(255,45,85,0.25); }
.go-live.on { background: var(--brand); border-color: var(--brand); animation: livePulse 1.6s infinite; }
.go-live.on .dot { background: #fff; animation: blink 1s infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 10px rgba(255,45,85,0.15); } }
.live-meter { width: 100%; height: 14px; border-radius: 4px; background: var(--bg-2); }
.live-timer { font-family: var(--font-display); font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.live-opts { display: flex; flex-direction: column; gap: 14px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--line); }
.seg button { flex: 1; padding: 10px 12px; border-radius: 9px; border: none; background: transparent; color: var(--text-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* ---------- Jingle-Board & KI-Studio ---------- */
.small-switch { font-size: 12px; gap: 8px; }
.small-switch span { width: 34px; height: 20px; }
.small-switch span::after { width: 14px; height: 14px; }
.small-switch input:checked + span::after { transform: translateX(14px); }
.pad.ki { background: linear-gradient(160deg, rgba(255,45,85,0.22), var(--surface-2)); }
.ki-badge { position: absolute; top: 6px; right: 7px; font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: 0.06em; color: #fff; background: var(--grad); border-radius: 5px; padding: 1px 5px; }
.ki-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ki-grid .mini-label { display: block; margin-bottom: 10px; }
.stream-link { display: flex; gap: 10px; }
.stream-link .input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

@media (max-width: 980px) {
  .live-grid, .ki-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  #studioPads .pads:not(.pads-fx) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #studioPads .pad { aspect-ratio: 1; font-size: 11px; }
  .stream-link { flex-direction: column; }
}

/* ---------- Gäste (ohne Login): nur Zuhören ---------- */
body.is-guest .member-only { display: none !important; }
body:not(.is-guest) .guest-only { display: none !important; }
#loginLink { text-decoration: none; }
@media (max-width: 720px) {
  .tabbar { display: flex; }
  .tabbar a { flex: 1; }
}

/* ---------- Nachrichten ---------- */
.news-preview { margin: 0; padding: 14px 14px 14px 34px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.news-preview li::marker { color: var(--brand-2); font-weight: 700; }

/* ---------- Downloads abbrechen ---------- */
.jobs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.job-status { display: flex; align-items: center; gap: 4px; }
.job-status .icon-btn { width: 26px; height: 26px; }
.job.error .job-status { color: var(--text-3); }
@media (max-width: 720px) { #ytFirst { order: 2; } }

/* ---------- Listen-Download ---------- */
.batch { border: 1px dashed var(--line-2); border-radius: 12px; padding: 4px 14px; }
.batch[open] { padding-bottom: 14px; }
.batch summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 0; font-weight: 600; font-size: 14px; color: var(--text-2); list-style: none; }
.batch summary::-webkit-details-marker { display: none; }
.batch summary:hover { color: var(--text); }
.batch[open] summary { color: var(--text); }
.batch textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; margin: 8px 0 10px; }
.job-bar.total { height: 6px; }
