:root {
  --bg: #14110f;
  --panel: #1d1916;
  --panel-2: #26201c;
  --line: #3a312a;
  --grid: #2f2823;
  --text: #f3e9dc;
  --muted: #a8998a;
  --accent: #e8a33d;
  --accent-ink: #1a1208;
  --ok: #7cc68a;
  --warn: #f0b35a;
  --bad: #e5776b;
  --spotify: #1ed760;
  --cue: #3d6fd1; /* Kopfhörer */
  --cap: #e9dfd2; /* Fader-Kappe */
  --cap-dark: #a89a8a;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 11px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.link { background: none; border: none; padding: 4px 0; color: var(--muted); text-decoration: underline; }
button.link.inline { padding: 0; color: var(--accent); }
button.spotify-btn { border-color: var(--spotify); }
button.spotify-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--spotify) 18%, var(--panel-2)); }

input[type="text"], input[type="search"], input[type="number"], textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  width: 100%;
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; user-select: all; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.warn { color: var(--warn); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Kopfzeile */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; }
.brand small { font-size: 11px; font-weight: 400; letter-spacing: 0; }
a { color: var(--accent); }
.folder-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand span { color: var(--accent); }
.toolbar { display: flex; gap: 8px; }
.status { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }


.list-controls { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.filters button span { color: var(--muted); margin-left: 3px; font-variant-numeric: tabular-nums; }
.filters button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filters button.active span { color: var(--accent-ink); opacity: 0.7; }

/* overflow-anchor: Chrome soll beim Austausch der Platzhalterzeilen nicht selbst nachscrollen. */
.table-wrap { flex: 1; overflow: auto; min-height: 0; overflow-anchor: none; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
thead th.sorted { color: var(--text); }
thead th.sorted::after { content: " " attr(data-dir); font-size: 9px; }
th.num, td.num { text-align: right; }
tbody td { padding: 5px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
tbody tr { cursor: pointer; }
/* Feste Zeilenhöhe: Die Liste zeichnet nur sichtbare Zeilen (lib/virtual-list.js). */
tbody tr[data-id] { height: 43px; }
tbody tr.vr-pad { cursor: default; }
tbody tr.vr-pad:hover td { background: none; }
tbody tr:hover td { background: var(--panel); }
tbody tr.selected td { background: #3a2a17; }
tbody tr.st-missing td { opacity: 0.5; }
td.strong { font-weight: 700; font-size: 15px; }
.c-cover { width: 44px; padding-right: 0; }
.c-cover img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; display: block; }
td.c-cover:empty::before { content: ""; display: block; width: 32px; height: 32px; border-radius: 4px; background: var(--panel-2); }

.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.b-verified { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.b-unverified { color: var(--text); }
.b-uncertain, .b-error { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.b-missing { color: var(--bad); }
.b-running { color: var(--accent); border-color: var(--accent); }

.empty { padding: 80px 30px; text-align: center; }
.empty p { font-size: 16px; }
.empty .hint { font-size: 13px; color: var(--muted); max-width: 460px; margin: 18px auto; }

/* Detailansicht */
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.detail-head { display: flex; gap: 14px; align-items: center; }
.cover-lg { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; flex: none; background: var(--panel-2); }
.detail-title { min-width: 0; }
.detail-title h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.detail-title p { margin: 3px 0 0; }

.player-row { display: flex; align-items: center; gap: 8px; }
.player-row + .player-row { margin-top: 8px; flex-wrap: wrap; }
.player-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.player-row .check { margin-left: auto; }
button.round { width: 38px; height: 38px; border-radius: 50%; padding: 0; background: var(--accent); color: var(--accent-ink); border: none; font-size: 14px; }

.bpm-card { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.bpm-main { display: flex; flex-direction: column; gap: 6px; }
.bpm-input {
  font-size: 54px !important;
  font-weight: 800;
  line-height: 1;
  padding: 4px 8px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.bpm-card.verified .bpm-input { border-color: var(--ok); }
.bpm-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.bpm-buttons button { padding: 4px 0; }
.verify { font-weight: 600; margin-top: 2px; }
.bpm-analysis { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#a-curve { width: 100%; height: 120px; background: var(--bg); border-radius: 6px; }

.tap-card { display: flex; gap: 14px; align-items: center; }
button.tap {
  width: 110px; height: 110px; border-radius: 50%; flex: none;
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  background: var(--bg); border: 3px solid var(--accent); color: var(--accent);
}
button.tap.flash { animation: flash 0.18s ease-out; }
@keyframes flash { from { background: var(--accent); color: var(--accent-ink); } to { background: var(--bg); color: var(--accent); } }
.tap-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tap-result { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }

.meta-card { display: flex; flex-direction: column; gap: 8px; }
.meta-card label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.images { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.image-slot { display: flex; flex-direction: column; gap: 5px; }
.img-box { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--bg); border: 1px dashed var(--line); overflow: hidden; }
.img-box::before { content: attr(data-empty); position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.img-box img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.spotify-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }

/* Dialoge */
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  width: 520px;
  max-width: calc(100vw - 32px);
}
dialog.wide { width: 640px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog h3 { margin: 0 0 10px; }
dialog h4 { margin: 18px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
dialog label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
dialog .row label { flex-direction: row; align-items: center; gap: 6px; }
dialog .row input[type="number"] { width: 90px; }
dialog .row input[type="search"] { flex: 1; width: auto; }

.sp-results { list-style: none; margin: 8px 0; padding: 0; max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sp-results li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.sp-results li:hover { background: var(--panel-2); }
.sp-results li.chosen { border-color: var(--spotify); background: color-mix(in srgb, var(--spotify) 10%, var(--panel)); }
.sp-results img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--bg); }
.sp-results .match { color: var(--spotify); font-weight: 600; }

/* Decks und Mischpult */
.deck {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.deck.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.deck.playing { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.deck.is-empty .deck-mid, .deck.is-empty .deck-progress { opacity: 0.35; }
.deck-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.deck-letter {
  width: 28px; height: 28px; flex: none; border-radius: 6px;
  display: grid; place-items: center; font-weight: 800;
  background: var(--bg); color: var(--accent); border: 1px solid var(--line);
}
.deck-cover { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; flex: none; }
.deck-titles { min-width: 0; flex: 1; }
.deck-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onair { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 4px; background: #c8402f; color: #fff; }
.deck-mid { display: flex; align-items: center; gap: 10px; }
.deck-bpm { flex: 1; min-width: 0; }
.deck-bpm { display: flex; flex-direction: column; }
.bpm-big { font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.deck.unverified .bpm-big { color: var(--warn); }
.deck-eq { display: flex; flex-direction: column; gap: 0; }
.deck-eq label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.deck-eq input { width: 128px; }
.deck-progress { display: flex; align-items: center; gap: 8px; }
.deck-progress .bar { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; cursor: pointer; overflow: hidden; }
.deck-progress .fill { height: 100%; width: 0; background: var(--accent); }
.deck.ending .fill { background: #c8402f; }
.deck-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.deck-controls button { padding: 5px 9px; }
.deck-controls button.round { width: 34px; height: 34px; padding: 0; }
.d-cue[aria-pressed="true"] { background: var(--cue); border-color: var(--cue); color: #fff; font-weight: 700; }
.d-tempo { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 110px; }
.d-rate { flex: 1; min-width: 70px; }
.d-rate-label { width: 62px; text-align: right; white-space: nowrap; }

.mixer {
  width: 190px;
  height: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.faders { display: flex; justify-content: space-around; align-items: stretch; gap: 6px; flex: 1; min-height: 100px; }
.vfader { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); min-height: 0; }
.master-col { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); min-height: 0; }
.master-row { display: flex; align-items: stretch; gap: 5px; flex: 1; min-height: 0; }
.master-row .vfader { gap: 0; }
.m-gr-label { font-size: 10px; white-space: nowrap; color: var(--muted); }
.m-gr-label.active { color: var(--bad); font-weight: 700; }
.m-gr-label.off { color: var(--warn); }
.xfader { display: flex; flex-direction: column; align-items: stretch; text-align: center; gap: 0; }
.hp { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.hp label { display: flex; flex-direction: column; color: var(--muted); font-size: 11px; min-width: 0; white-space: nowrap; }
.hp input { width: 100%; }
.mixer-warn { line-height: 1.3; }

/*
 * Regler wie an einem Mischpult (sliders.js setzt die Klasse „fader“ und --lo/--hi).
 * Bahn 10 px mit Füllung, rechteckige Kappe mit Griffrille; das Eingabefeld selbst
 * ist 32 px hoch bzw. breit, damit man es gut trifft.
 */
input.fader {
  -webkit-appearance: none; appearance: none;
  --lo: 0; --hi: 0; --fill: var(--accent);
  --along: 16px; /* Kappe in Laufrichtung */
  --across: 28px; /* Kappe quer dazu */
  height: 32px; margin: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 6px;
  touch-action: none;
}
input.fader:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input.fader:disabled { opacity: 0.4; cursor: default; }
input.fader::-webkit-slider-runnable-track {
  height: 12px; border-radius: 6px; border: 1px solid var(--line);
  background: linear-gradient(to right,
    var(--bg) calc(var(--along) / 2 + var(--lo) * (100% - var(--along))),
    var(--fill) 0, var(--fill) calc(var(--along) / 2 + var(--hi) * (100% - var(--along))),
    var(--bg) 0);
}
input.fader::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--along); height: var(--across); margin-top: calc((10px - var(--across)) / 2);
  border-radius: 3px; border: 1px solid #000;
  background:
    linear-gradient(to right, transparent calc(50% - 1px), var(--accent-ink) calc(50% - 1px), var(--accent-ink) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to bottom, var(--cap), var(--cap-dark));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
input.fader:hover::-webkit-slider-thumb, input.fader:active::-webkit-slider-thumb { background:
    linear-gradient(to right, transparent calc(50% - 1px), var(--accent-ink) calc(50% - 1px), var(--accent-ink) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to bottom, #fff, var(--cap)); }
/* Neutrale Stellung: Marke über und unter der Bahn; die Kappe färbt ihre Rille, wenn sie dort steht. */
input.fader.has-neutral { background: linear-gradient(var(--muted), var(--muted)) center / 2px 100% no-repeat; }
input.fader.has-neutral.at-neutral { background: linear-gradient(var(--accent), var(--accent)) center / 2px 100% no-repeat; }

/* Senkrechte Fader: wachsen mit der Höhe des Panels, Skala daneben. */
.vf-rail { position: relative; flex: 1; min-height: 76px; width: 52px; }
.vf-rail::before, .vf-rail::after {
  content: ""; position: absolute; top: 9px; bottom: 9px; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--muted) 0 1px, transparent 1px calc((100% - 1px) / 10));
  opacity: 0.7; pointer-events: none;
}
.vf-rail::before { left: 0; }
.vf-rail::after { right: 0; }
.vfader input.fader {
  writing-mode: vertical-lr; direction: rtl;
  /* Aus dem Fluss genommen: Die Höhe folgt dem Panel und bestimmt sie nicht. */
  position: absolute; top: 0; bottom: 0; left: 9px; width: 34px; height: 100%;
  --along: 18px; --across: 30px;
}
.vfader input.fader::-webkit-slider-runnable-track {
  width: 12px; height: 100%;
  background: linear-gradient(to top,
    var(--bg) calc(var(--along) / 2 + var(--lo) * (100% - var(--along))),
    var(--fill) 0, var(--fill) calc(var(--along) / 2 + var(--hi) * (100% - var(--along))),
    var(--bg) 0);
}
.vfader input.fader::-webkit-slider-thumb {
  width: var(--across); height: var(--along); margin-top: 0; margin-left: calc((10px - var(--across)) / 2);
  background:
    linear-gradient(to bottom, transparent calc(50% - 1px), var(--accent-ink) calc(50% - 1px), var(--accent-ink) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to right, var(--cap), var(--cap-dark));
}
/* Crossfader: über die volle Breite, größere Kappe. */
.xfader input.fader { width: 100%; height: 38px; --along: 24px; --across: 36px; }
/* Kopfhörer: blau. */
.hp input.fader { --fill: var(--cue); --along: 14px; --across: 24px; height: 30px; }
.hp input.fader:focus-visible { outline-color: var(--cue); }
.deck-eq input.fader { --along: 14px; --across: 22px; height: 26px; }
.d-rate.fader { --along: 16px; --across: 26px; }

/* Pegelanzeigen */
.meter {
  position: relative; width: 9px; flex: none; border-radius: 3px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(to top, var(--ok) 0 70%, var(--warn) 70% 90%, var(--bad) 90%);
}
.meter-cover { position: absolute; top: 0; left: 0; right: 0; height: 100%; background: var(--bg); }
.meter-hold { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--text); opacity: 0.85; }
.meter.hot .meter-hold { background: var(--bad); opacity: 1; }
.deck-meter { align-self: stretch; min-height: 60px; width: 11px; }
.gr-meter { background: var(--bg); width: 7px; }
.gr-fill { position: absolute; top: 0; left: 0; right: 0; height: 0; background: var(--bad); }

/* Panel „Klang“ */
.sound-card { display: flex; flex-direction: column; gap: 8px; }
.k-loud { font-size: 13px; }
.k-loud strong { font-variant-numeric: tabular-nums; }
.k-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.k-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); min-width: 0; }
.k-grid select { width: 100%; min-width: 0; }
.k-slider { display: grid; grid-template-columns: 118px 1fr 44px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.k-slider input.fader { width: 100%; --along: 16px; --across: 24px; height: 30px; }
.k-slider output { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.sound-card p { margin: 0; }
.sound-card .row { margin-top: 2px; }
#settings .sound-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; margin: 6px 0; }
#settings .sound-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
#settings .sound-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0; }
#settings .sound-line input[type="number"] { width: 80px; }

.now-playing {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, #c8402f 25%, var(--panel));
  border: 1px solid #c8402f;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
.now-playing:not([hidden]) + .status { margin-left: 12px; }
.player-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.player-head h3 { margin: 0; }
.out-row { display: grid; grid-template-columns: 150px 1fr 120px auto; gap: 6px; align-items: center; margin: 4px 0; font-size: 13px; }
.out-row select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; min-width: 0; }
dialog { max-height: calc(100vh - 40px); overflow-y: auto; }
dialog#settings { width: 640px; }

/* Seitenleiste und Ansichten */
.browser-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sidebar {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 6px 6px 10px; display: flex; flex-direction: column; gap: 2px;
}
.side-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; text-align: left; background: none; border: 1px solid transparent;
  padding: 5px 8px; border-radius: 6px; font-size: 13px;
}
.side-item:hover:not(:disabled) { background: var(--panel-2); border-color: transparent; }
.side-item.active { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); color: var(--text); }
.side-item.live .side-label { color: #ff8a7a; font-weight: 700; }
.side-item.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--panel)); }
.side-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-head {
  margin: 12px 4px 4px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; justify-content: space-between; align-items: center;
}
.side-add { padding: 0 7px; font-size: 14px; line-height: 18px; }
.side-empty { margin: 2px 8px; font-size: 12px; color: var(--muted); }
.view-head { display: flex; align-items: baseline; gap: 10px; }
.view-head h2 { margin: 0; font-size: 17px; }
.view-head .spacer, .row .spacer { flex: 1; }
#view-info { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Tabelle: Position, Favorit, gespielt */
.c-fav { width: 26px; padding-left: 2px !important; padding-right: 2px !important; text-align: center; }
.star { background: none; border: none; padding: 0 2px; color: var(--muted); font-size: 15px; line-height: 1; }
.star.on { color: var(--accent); }
.mini-rating { color: var(--accent); font-size: 10px; letter-spacing: -1px; }
tbody tr.played td:not(.c-fav) { opacity: 0.55; }
tbody tr.played.selected td { opacity: 0.85; }
.b-played { color: #ff8a7a; border-color: color-mix(in srgb, #ff8a7a 45%, transparent); }
tbody tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }

/* Detailansicht: Favorit, Bewertung, Playlist */
.d-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.d-actions button, .d-actions select { font-size: 12px; padding: 4px 8px; }
.d-actions select { font: inherit; font-size: 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; }
.fav-btn.on { color: var(--accent); border-color: var(--accent); }
.rating { display: inline-flex; }
.rating button { background: none; border: none; padding: 0 1px; color: var(--line); font-size: 16px; }
.rating button.on { color: var(--accent); }
.played-note { color: #ff8a7a; font-weight: 600; }

/* Party-Knopf */
.party-btn.running { background: #c8402f; border-color: #c8402f; color: #fff; font-weight: 700; }

/* Regeln für intelligente Playlisten */
.rules { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.rules li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.rules select, .rules input, #pl-dialog select, #pl-dialog input[type="number"] {
  font: inherit; font-size: 13px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; width: auto;
}
#pl-dialog .rules input[type="number"] { width: 80px; }
#pl-dialog .rules input[type="text"] { width: 200px; }
label.inline { flex-direction: row !important; align-items: center; gap: 6px !important; }
#pl-dialog #pl-limit { width: 80px; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }

/* Autoplay */
.autoplay-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  min-width: 0;
}
.autoplay-bar .spacer { flex: 1; }
#ap-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
#ap-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32%; color: #7fb2ff; }
.ap-toggle { font-weight: 700; }
.autoplay-bar.on .ap-toggle { background: #3d6fd1; border-color: #3d6fd1; color: #fff; }
.deck-note { color: #7fb2ff; margin-top: -4px; }
.ap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 6px; }
.ap-grid select, .ap-grid input {
  font: inherit; font-size: 13px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px;
}
.ap-grid label > span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
#ap-dialog .ap-grid input[type="number"] { width: 80px; }
#ap-dialog .check { flex-direction: row; font-size: 13px; color: var(--text); margin: 4px 0; }
.autoplay-bar button { flex: none; white-space: nowrap; }

/* Fortschrittsbalken für Einlesen und Analyse */
.progress { background: var(--panel); border-bottom: 1px solid var(--line); padding: 6px 18px 8px; }
.progress-track { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.progress-fill.indeterminate { width: 30% !important; animation: indeterminate 1.2s ease-in-out infinite; }
@keyframes indeterminate { from { margin-left: -30%; } to { margin-left: 100%; } }
.progress-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13px; min-width: 0; }
.progress-row .spacer { flex: 1; }
.progress-label { font-weight: 600; white-space: nowrap; }
#progress-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#progress-eta { white-space: nowrap; color: var(--accent); }
.small-btn { padding: 2px 10px; font-size: 12px; }
/* Zweite Meinung: leise Zeile unter dem Analyse-Balken, ohne eigenen Balken */
.progress-second { padding: 2px 18px 4px; opacity: 0.85; }
.progress-second .progress-row { margin-top: 0; font-size: 12px; }
.progress-second .progress-label { font-weight: 500; }
#ps-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#ps-pct { white-space: nowrap; }
.second-note { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.second-note button { font-size: 12px; padding: 3px 7px; }
.second-note .ok { color: var(--ok); }

/* ---------- Panels und Zonen (panels.js) ---------- */
.workspace { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 6px; gap: 0; }
.middle { flex: 1; display: flex; min-height: 0; }
.zone { display: flex; gap: 6px; min-width: 0; min-height: 0; }
.zone-row { flex-direction: row; flex: none; max-height: 70vh; }
.zone-col { flex-direction: column; flex: none; overflow-y: auto; max-width: 50vw; }
.zone[data-zone="center"] { flex: 1; overflow: hidden; max-width: none; }
.zone[data-zone="center"] > .panel:only-child { flex: 1 1 0px !important; }
.zone.is-empty:not([data-zone="center"]) { display: none; }
.zone-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 30px;
  border: 1px dashed var(--line); border-radius: 8px; }

.splitter { flex: none; position: relative; z-index: 2; }
.splitter-h { height: 6px; cursor: row-resize; }
.splitter-v { width: 6px; cursor: col-resize; }
.zone > .splitter-h { height: 0; margin: -3px 0; padding: 3px 0; box-sizing: content-box; }
.zone > .splitter-v { width: 0; margin: 0 -3px; padding: 0 3px; box-sizing: content-box; }
.splitter::after { content: ""; position: absolute; inset: 0; border-radius: 3px; transition: background 0.15s; }
.splitter-h::after { inset: 2px 30%; }
.splitter-v::after { inset: 30% 2px; }
.splitter:hover::after, .splitter.active::after { background: var(--accent); }
.zone > .splitter-h::after { inset: 2px 40%; }
.zone > .splitter-v::after { inset: 40% 2px; }

.panel {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.panel.dragging { opacity: 0.45; outline: 2px dashed var(--accent); }
.panel-head {
  flex: none; display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 10px;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  cursor: grab; user-select: none; touch-action: none;
}
.panel-head:active { cursor: grabbing; }
.panel-title { flex: 1; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-close { background: none; border: none; padding: 0 6px; color: var(--muted); font-size: 12px; line-height: 20px; opacity: 0.6; }
.panel-close:hover:not(:disabled) { opacity: 1; color: var(--text); }
.panel-body { flex: 1; min-height: 0; overflow: auto; zoom: var(--panel-zoom, 1); }
.panel[data-nozoom] .panel-body { zoom: 1; }
.panel-body.noscroll { overflow: hidden; display: flex; flex-direction: column; }
.panel-parking { display: none; }
.zone-row > .panel { height: auto; }

/* Leere Zonen: beim Ziehen Ablagestreifen über dem Inhalt (panels.js). */
.zone-band { position: fixed; z-index: 49; display: grid; place-items: center; text-align: center; padding: 4px;
  font-size: 12px; font-weight: 600; color: var(--accent); pointer-events: none;
  border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); }
.zone-band.over { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, var(--bg)); color: var(--text); }
.drop-indicator { position: fixed; z-index: 50; background: var(--accent); border-radius: 2px; pointer-events: none; }
.drop-indicator.fill { background: color-mix(in srgb, var(--accent) 18%, transparent); border: 2px solid var(--accent); }
.panel-ghost { position: fixed; z-index: 51; pointer-events: none; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 5px; box-shadow: 0 4px 14px rgba(0,0,0,0.5); }

/* Inhalte in Panels: Rahmen kommt vom Panel */
.panel-body > .card { background: none; border: none; border-radius: 0; }
.panel-body > .deck { border: none; border-radius: 0; height: 100%; background: var(--panel); }
.panel-body > .deck.playing { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.panel-body > .deck.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.panel-body > .mixer { border: none; border-radius: 0; width: auto; min-width: 170px; }
.info-card { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.info-card .d-actions { margin-top: 0; }
.info-card p { margin: 0; }
.shortcuts { margin: 8px 0 0; line-height: 1.6; }
.shortcuts summary { cursor: pointer; width: max-content; }
.shortcuts p { margin: 4px 0 0; }

/* Panels passen sich ihrer Breite an (Container-Abfragen). */
.panel[data-panel="info"] .panel-body, .panel[data-panel="meta"] .panel-body,
.panel[data-panel="preview"] .panel-body, .panel[data-panel="bpm"] .panel-body { container-type: inline-size; }
@container (max-width: 360px) {
  .info-card .cover-lg { width: 64px; height: 64px; }
  .info-card .detail-title h2 { font-size: 17px; }
  .info-card .detail-head { align-items: flex-start; }
  .bpm-card { grid-template-columns: 1fr; }
  .player-row + .player-row { gap: 5px; }
  .player-row.small button { padding: 4px 8px; }
  .player-row .check { margin-left: 0; }
}
.meta-fields { display: flex; flex-direction: column; gap: 8px; }
@container (min-width: 600px) {
  .meta-card { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
  .meta-card .img-box { aspect-ratio: auto; height: 110px; }
}
.bpm-card { grid-template-columns: minmax(130px, 160px) minmax(0, 1fr); }

/* Kein Stück gewählt: Hinweis statt leerer Felder */
body:not(.has-detail) .panel[data-needs-track] .panel-body > * { display: none; }
body:not(.has-detail) .panel[data-needs-track] .panel-body::after {
  content: "Kein Stück gewählt."; display: block; padding: 14px 12px; color: var(--muted); font-size: 13px;
}

/* Große Bedienelemente (Layout „Auflegen“): die Liste wird nicht gezoomt, damit die feste Zeilenhöhe bleibt */
.big-ui #tracks tbody td { font-size: 15px; }
.big-ui #tracks tbody td.strong { font-size: 17px; }

/* Menü „Ansicht“ */
.view-menu {
  position: fixed; z-index: 60; width: 340px; max-height: calc(100vh - 70px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55); font-size: 13px;
}
.vm-head { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 6px 0 6px; }
.vm-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.vm-layouts { display: flex; flex-direction: column; gap: 3px; }
.vm-layout { display: flex; gap: 4px; }
.vm-pick { flex: 1; display: flex; align-items: center; gap: 6px; text-align: left; padding: 5px 9px; }
.vm-pick .vm-name { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-pick .vm-key { margin-left: auto; }
.vm-pick.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel-2)); }
.vm-del { padding: 4px 9px; color: var(--muted); }
.vm-save { display: flex; gap: 6px; margin-top: 8px; }
.vm-save input { flex: 1; min-width: 0; }
.vm-msg { margin: 4px 0 0; min-height: 0; }
.vm-msg:empty { display: none; }
.vm-opts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.vm-note { margin: 6px 0 0; }

/* Soundkarte weg */
.device-alert {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px;
  background: color-mix(in srgb, var(--bad) 30%, var(--panel)); border-bottom: 2px solid var(--bad);
  font-weight: 600; font-size: 14px;
}
.device-alert .spacer { flex: 1; }
.device-note { padding: 6px 18px; background: color-mix(in srgb, var(--ok) 22%, var(--panel)); border-bottom: 1px solid var(--ok); font-size: 13px; }

/* Sicherungen in den Einstellungen */
.backups { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.backups li { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 3px 0; }
.backups li span { flex: 1; }
.backups .empty-note { color: var(--muted); }

/* Spaltenbreiten kommen aus dem Layout (listhead.js, <colgroup>); Spalten ohne Breite teilen sich den Rest. */
#tracks { table-layout: fixed; }
#tracks tbody td { max-width: none; }
#settings .sound-line label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }

/* ---------- Spalten der Liste ---------- */
#tracks thead th { position: sticky; padding-right: 12px; }
#tracks thead th .th-label { display: block; overflow: hidden; text-overflow: ellipsis; }
#tracks thead th.sorted .th-label::after { content: " " attr(data-dir); }
#tracks thead th.sorted::after { content: none; }
#tracks thead th.sorted .th-label { color: var(--text); }
.col-resize { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.col-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; width: 1px; background: var(--line); }
th:hover .col-resize::after, th.resizing .col-resize::after { background: var(--accent); width: 2px; }
th.col-dragging { opacity: 0.5; outline: 1px dashed var(--accent); }
.col-drop { position: fixed; z-index: 55; width: 3px; background: var(--accent); border-radius: 2px; pointer-events: none; }
/* BPM nie abschneiden: Die Spalte ist mindestens so breit wie „123,4“ in großer Schrift. */
#tracks td.c-bpm { text-overflow: clip; }
#tracks td.num, #tracks th.num { padding-left: 4px; }
td.c-duration.long { color: var(--warn); }
td.c-duration.long::before { content: "●"; font-size: 7px; vertical-align: 2px; margin-right: 4px; opacity: 0.8; }
td.c-rating .stars-on { color: var(--accent); letter-spacing: -1px; font-size: 12px; }
td.c-energy { font-weight: 600; }
td.c-pos { padding-left: 4px; }
tbody tr.lead td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
body.multi tbody tr.selected td { background: #3a2a17; }
.b-played-other { color: #ffb38a; border-color: color-mix(in srgb, #ffb38a 45%, transparent); }
tbody tr.played-other td:not(.c-fav):not(.c-status) { opacity: 0.7; }

/* ---------- Suche ---------- */
.search-row { display: flex; gap: 6px; align-items: center; }
.search-row input { flex: 1; min-width: 0; }
.search-row button { flex: none; white-space: nowrap; font-size: 12px; padding: 5px 9px; }
.search-marks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: -4px; }
.mark { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 6px 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.mark .mark-x { font-size: 10px; color: var(--muted); padding: 0 2px; }
.mark:hover .mark-x { color: var(--text); }
.mark.inactive { background: var(--panel-2); border-style: dashed; color: var(--muted); }
.mark-relative { background: color-mix(in srgb, var(--cue) 28%, var(--panel)); border-color: color-mix(in srgb, var(--cue) 60%, transparent); }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-row .spacer { flex: 1; }
.quick { display: flex; gap: 4px; }
.quick button { border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.quick button[aria-pressed="true"] { background: var(--cue); border-color: var(--cue); color: #fff; }
.list-controls { gap: 8px; padding: 10px 14px; }

/* ---------- Menü an der Maus ---------- */
.ctx-menu { position: fixed; z-index: 70; min-width: 210px; max-width: 340px; max-height: calc(100vh - 12px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 10px 28px rgba(0,0,0,0.6); font-size: 13px; }
.ctx-item { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 5px; padding: 5px 8px; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); border-color: transparent; outline: none; }
.ctx-check { width: 14px; flex: none; color: var(--accent); }
.ctx-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-hint { color: var(--muted); font-size: 11px; }
.ctx-arrow { color: var(--muted); font-size: 11px; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-head { font-size: 11px; color: var(--muted); padding: 5px 8px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---------- Tanz-Tags ---------- */
.dance-card { display: flex; flex-direction: column; gap: 4px; padding-top: 6px !important; padding-bottom: 6px !important; }
.dance-card p { margin: 0; }
.dt-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px; align-items: center; }
.dt-key { font: inherit; font-size: 10px; padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--bg); }
.dt-label { font-size: 12px; color: var(--muted); }
.dt-chips, .dt-scale { display: flex; flex-wrap: wrap; gap: 4px; }
.dt-btn { font-size: 12px; padding: 1px 7px; border-radius: 999px; line-height: 1.35; }
.dt-scale .dt-btn { min-width: 28px; text-align: center; }
/* Schmale Stück-Info (Layout „Vorbereiten“): kleineres Cover, damit alles ohne Rollen passt. */
@container (max-width: 520px) {
  .info-card .cover-lg { width: 60px; height: 60px; }
}
.dt-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.dt-btn.mixed { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, var(--panel-2)) 50%, var(--panel-2) 50%); border-color: var(--accent); }
.dt-btn.dt-none { color: var(--muted); }
.dt-btn.dt-none.on { background: var(--panel-2); color: var(--text); border-color: var(--muted); font-weight: 400; }
.dance-card[data-prefix] { box-shadow: inset 0 0 0 2px var(--accent); }
.dt-keys { margin: 0 !important; }
/* Ziffer der Taste S+Ziffer klein vor dem Stil */


/* Mehrere Stücke gewählt: Stück-Panels zeigen eine Zusammenfassung (Text aus app.js). */
body.multi .panel[data-needs-track]:not([data-multi-ok]) .panel-body > * { display: none; }
body.multi .panel[data-needs-track]:not([data-multi-ok]) .panel-body::after {
  content: attr(data-summary); display: block; padding: 12px; color: var(--text); font-size: 13px; white-space: pre-line; line-height: 1.5;
}

/* Anzeige-Daten: Album und Jahr nebeneinander */
.meta-pair { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 8px; }
.d-find { display: flex; gap: 6px; flex-wrap: wrap; }
.d-find button { font-size: 12px; padding: 4px 8px; }

/* Rückgängig in der Kopfzeile und im Menü „Ansicht“ */
.undo-btn { padding: 6px 9px; font-size: 15px; line-height: 1; }
.vm-undo { display: flex; flex-direction: column; gap: 4px; }
.vm-undo button { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-columns { margin-bottom: 2px; }
#settings .time-input { width: 70px; }
#settings .sound-line input[type="number"] { width: 80px; }

/* Zählebene unsicher (BPM-Prüfung) */
.octave-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--warn); }
.octave-note button { font-size: 12px; padding: 3px 8px; }

/* Schmale rechte Spalte (Layout „Vorbereiten“ mit Tanz-Tags): Tap und Tempokurve etwas flacher. */
.panel[data-panel="tap"] .panel-body { container-type: inline-size; }
@container (max-width: 520px) {
  button.tap { width: 92px; height: 92px; font-size: 19px; }
  .tap-info .row button { font-size: 12px; padding: 4px 8px; }
  .tap-result { font-size: 34px; }
  #a-curve { height: 96px; }
}

/* ---------- Hilfe (helpview.js, lib/help.js) ---------- */
.help-btn { font-weight: 600; }
/* Schwebt unter der Kopfzeile, damit die Knöpfe daneben nicht verdrängt werden. */
.help-hint { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,0.5); display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border: 1px solid var(--accent); color: var(--text); }
.help-hint[hidden] { display: none; }
.panel-help { background: none; border: 1px solid transparent; padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 18px; opacity: 0.6; border-radius: 999px; }
.panel-help:hover:not(:disabled) { opacity: 1; color: var(--accent); border-color: var(--line); }
dialog.help-dialog { width: min(820px, calc(100vw - 40px)); height: min(760px, calc(100vh - 40px)); padding: 0; overflow: hidden; }
dialog.help-dialog form { display: flex; flex-direction: column; height: 100%; }
.help-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px 8px; }
.help-head h3 { margin: 0; }
.help-search { flex: 1; }
.help-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 18px 10px; border-bottom: 1px solid var(--line); }
.help-chip { padding: 2px 9px; font-size: 12px; border-radius: 999px; }
.help-chip.active { border-color: var(--accent); color: var(--accent); }
.help-body { flex: 1; overflow-y: auto; padding: 4px 18px 18px; position: relative; }
.help-section { padding: 10px 12px; margin: 8px 0; border-radius: 8px; border: 1px solid transparent; }
.help-section.current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.help-section h4 { margin: 0 0 4px; }
.help-section p { margin: 0 0 6px; line-height: 1.5; }
.help-keylist { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; }
.help-keylist dt { white-space: nowrap; }
.help-keylist dd { margin: 0; color: var(--muted); }
.help-keys kbd, .help-table kbd { font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; background: var(--bg); color: var(--text); }
.help-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.help-table td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
.help-table td:first-child { white-space: nowrap; width: 1%; }
.help-empty { padding: 20px 12px; }

/* ---------- Daten im Netz (metadata-ui.js) ---------- */
td.c-year.suspicious { color: var(--warn); }
td.c-year.suspicious::after { content: "?"; font-size: 10px; margin-left: 2px; vertical-align: 3px; opacity: 0.8; }
.credit { margin: 4px 0 0; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit.r-ungeklärt { color: var(--warn); }
.md-sources { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 0 22px; }
#settings .md-sources .check, #settings .check:has(#s-md-on) { flex-direction: row; font-size: 13px; color: var(--text); }
dialog.md-dialog { width: min(860px, calc(100vw - 40px)); }
.md-query input { flex: 1; min-width: 0; }
.md-msg { min-height: 1.4em; }
.md-cands { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.md-cand { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.md-cand.best { border-color: var(--ok); }
.md-cand:has(input:checked) { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border-color: var(--accent); }
dialog .md-cand label { display: grid; grid-template-columns: auto 52px 1fr auto; align-items: center; gap: 10px; color: var(--text); font-size: 13px; cursor: pointer; }
.md-year { font-size: 18px; font-weight: 700; }
.md-main { display: flex; flex-direction: column; min-width: 0; }
.md-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-info { white-space: nowrap; }
.md-info .match { color: var(--ok); font-weight: 600; }
.md-score { color: var(--warn); }
.md-score.sure { color: var(--ok); }
.md-why { margin: 4px 0 0 30px; }
.md-links a { color: var(--accent); }
.md-apply h4, .md-images h4 { margin-top: 12px; }
dialog .md-field { flex-direction: row; align-items: baseline; gap: 4px; font-size: 13px; color: var(--text); margin: 3px 0; flex-wrap: wrap; }
.md-sus, .md-extra { margin: 2px 0 6px 24px; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.md-img { border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.md-img img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--bg); }
.md-cap { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.md-rights { align-self: flex-start; font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); }
.md-rights.r-frei { color: var(--ok); border-color: var(--ok); }
.md-rights.r-namensnennung { color: var(--accent); border-color: var(--accent); }
.md-rights.r-ungeklärt { color: var(--warn); border-color: var(--warn); }
.md-img a { color: var(--accent); }
.md-batch { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(520px, calc(100vw - 32px)); display: grid;
  grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: 6px 8px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); font-size: 13px; }
.md-batch-label { grid-column: 1 / -1; font-weight: 600; }
.md-batch .progress-track { grid-column: 1 / -1; }
.md-batch[data-status="paused"] .progress-fill, .md-batch[data-status="offline"] .progress-fill { background: var(--muted); }
dialog.md-review { width: min(920px, calc(100vw - 40px)); }
.md-review-wrap { max-height: min(520px, calc(100vh - 260px)); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.md-review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-review-table th { position: sticky; top: 0; background: var(--panel-2); text-align: left; font-size: 11px; color: var(--muted); padding: 5px 8px; }
.md-review-table td { padding: 5px 8px; border-top: 1px solid var(--grid); vertical-align: top; }
.md-review-table td.suspicious { color: var(--warn); }
.md-review-table a { color: var(--accent); }
/* Mit dem Knopf „Hilfe“ wird die Kopfzeile voller: Knöpfe nicht umbrechen, lieber die Statuszeile kürzen. */
.toolbar { flex: none; }
.toolbar > button { white-space: nowrap; }
.status { min-width: 0; }
