:root {
  --bg: #14161a;
  --panel: #1d2026;
  --panel-2: #262a32;
  --line: #333844;
  --text: #eceef2;
  --muted: #9aa1ad;
  --accent: #f2b84b;
  --accent-ink: #14161a;
  --wave: #6f7a8c;
  --wave-active: #f2b84b;
  --dim: rgba(10, 11, 14, 0.5);
  --loop: rgba(92, 170, 255, 0.22);
  --loop-edge: #5caaff;
  --marker: #5caaff;
  --comment: #e58bd0;
  --danger: #ff6b6b;
  --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f3; --panel: #ffffff; --panel-2: #efefea; --line: #dcdcd4; --text: #1b1c1f; --muted: #646872;
    --wave: #9aa3b2; --wave-active: #c98a12; --dim: rgba(246, 246, 243, 0.7); --accent: #e0a12c;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: 0.02em; text-decoration: none; color: var(--accent); font-size: 18px; }
/* live connection: green = changes of the others show up right away */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted, #7a808c); opacity: 0.5; margin-left: -6px; flex: none; transition: background 0.3s, opacity 0.3s; }
.live-dot.on { background: #4fd07a; opacity: 1; }
.topnav { display: flex; gap: 12px; flex: 1; }
.topnav a { text-decoration: none; color: var(--muted); }
.namefield { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.namefield input {
  width: 9em; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
}
.namefield input.missing { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

main { max-width: 900px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.on { background: var(--loop-edge); color: #08111d; border-color: var(--loop-edge); }
.btn:disabled { opacity: 0.45; cursor: default; }
.iconbtn { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); line-height: 1; }
.iconbtn:hover { color: var(--text); }
.star { font-size: 20px; color: var(--muted); }
.star.on { color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 14px;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.add { color: var(--muted); border-style: dashed; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input, .inline-form select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); min-width: 0;
}

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.card-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-head .date { font-weight: 700; }
.card-head .rname { color: var(--muted); flex: 1; cursor: text; }
.card-head .rname:empty::before { content: "Name hinzufügen"; opacity: 0.5; }
.card-head input { flex: 1; }

.takes { list-style: none; margin: 0; padding: 0; }
.take {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line);
}
.take:first-child { border-top: 0; }
.take a.title { text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take a.title:hover { color: var(--accent); }
.take .meta { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.take .right { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.tag { padding: 0 8px; border-radius: 999px; background: var(--panel-2); font-size: 12px; }
.badge-new { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

.uploadbox {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.uploadbox.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.uploadbox .hint { flex: 1; min-width: 180px; }

/* take view */
.take-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.take-head input.title {
  flex: 1; font-size: 20px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 4px 6px;
  border-radius: 8px; min-width: 0;
}
.take-head input.title:hover, .take-head input.title:focus { border-color: var(--line); background: var(--panel); }
.subline { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 13px; margin: 0 0 12px 6px; }
.subline select { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

.wave-wrap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 0; }
.wave-wrap canvas { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; }
.wave-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); padding: 6px 2px 0; }
.wave-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

.transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.transport .time { font-variant-numeric: tabular-nums; min-width: 7.5em; text-align: center; }
.transport .play { width: 52px; height: 52px; border-radius: 50%; justify-content: center; font-size: 20px; padding: 0; }
.transport .spacer { flex: 1; }
.transport .mark {
  height: 52px; padding: 0 20px; font-size: 17px; font-weight: 600; gap: 8px;
  background: var(--marker); border-color: var(--marker); color: #08111d;
}
.transport .mark:hover { filter: brightness(1.08); border-color: var(--marker); }
.transport .mark:active { transform: scale(0.96); }
.transport .mark { justify-content: center; }
@media (max-width: 560px) { .transport .mark { flex: 1; font-size: 18px; } }

.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.section-head h2 { flex: 1; }
.section-head .section-toggle { flex: 1; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }

.markers { display: flex; flex-wrap: wrap; gap: 6px; }
.marker-chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--marker); color: var(--text);
  border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; background: color-mix(in srgb, var(--marker) 12%, transparent);
}
.marker-chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px 4px; }
.marker-chip button:hover { color: var(--text); }
.marker-chip .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.marker-chip a.open { color: var(--muted); text-decoration: none; padding: 2px 4px; }
.marker-chip a.open:hover { color: var(--text); }
.marker-chip.from-version { border-style: dotted; }
.marker-chip .from { color: var(--muted); font-size: 0.85em; }
.marker-chip .bar { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85em; }

.composer { display: grid; gap: 8px; margin-bottom: 14px; }
.composer textarea {
  width: 100%; min-height: 70px; resize: vertical; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
}
.composer .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.composer .row label { flex: 1; color: var(--muted); font-size: 13px; }

.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.post .who { font-weight: 600; }
.post .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.post .body { white-space: pre-wrap; margin: 4px 0; overflow-wrap: anywhere; }
.post .actions { display: flex; gap: 10px; font-size: 13px; }
.post .actions button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.post .actions button:hover { color: var(--text); }
.post .replies { list-style: none; margin: 8px 0 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.ts {
  font-variant-numeric: tabular-nums; border: 0; background: color-mix(in srgb, var(--comment) 18%, transparent);
  color: var(--text); border-radius: 6px; padding: 0 6px; cursor: pointer; font-size: 13px; margin-right: 6px;
}

.admin-links { display: grid; gap: 10px; }
.admin-links .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-links code {
  flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; font-size: 13px;
}

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: 90vw;
}

@media (max-width: 560px) {
  main { padding: 12px; }
  .namefield span { display: none; }
  .namefield input { width: 7.5em; }
  .wave-wrap canvas { height: 120px; }
  .transport .time { min-width: 0; }
}

.topnav .count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.topnav a.active { color: var(--text); }

/* inbox */
.bulkbar {
  position: sticky; top: 56px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px;
}
.bulkbar .sel { flex: 1; min-width: 120px; }
.inbox-day { margin: 18px 0 6px; font-weight: 700; }
.inbox-row {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 4px 10px; align-items: center;
  padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px;
}
.inbox-row input[type=checkbox] { width: 20px; height: 20px; }
.inbox-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .meta { grid-column: 3 / 5; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.inbox-row .playmini { width: 36px; height: 36px; border-radius: 50%; padding: 0; justify-content: center; }
.inbox-row.selected { border-color: var(--accent); }

/* ---------- trash ---------- */
.trash-list { list-style: none; margin: 8px 0 0; padding: 0; }
.trash-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px;
}
.trash-row a.title { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .meta { grid-column: 1 / 3; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.trash-row .meta .warn { color: var(--danger); }
.trash-row .actions { grid-column: 1 / 3; display: flex; flex-wrap: wrap; gap: 8px; }
.trash-banner {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between;
  margin: 10px 0; padding: 10px 12px; border: 1px solid var(--danger); border-radius: var(--radius); background: var(--panel);
}

/* ---------- Stufe 3: studio ---------- */
.versions { margin: 4px 0 10px; }
.versions a.chip { text-decoration: none; }
.chip-sub { opacity: 0.7; font-size: 12px; }
.versions a.chip[data-vid] { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.versions.sorting { cursor: grabbing; }
.versions a.chip.dragging { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 0.85; transform: scale(1.06); cursor: grabbing; }
.newversion { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); width: 100%; }
.newversion input[type=text], .newversion input:not([type]) { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.newversion .row, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.versioninfo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); margin-bottom: 10px; }
.versioninfo input { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.wave-wrap canvas[hidden] { display: none; }
.wave-wrap canvas.overview { height: 28px; cursor: grab; border-top: 1px solid var(--line); margin-top: 6px; }
.zoombar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin: 4px 0 6px; }
.zoombar .btn.small { min-width: 34px; }
.zoom-label { font-variant-numeric: tabular-nums; }
.marker-chip.snippet { border-color: var(--loop-edge); background: color-mix(in srgb, var(--loop-edge) 12%, transparent); }
.marker-chip.snippet.active { background: color-mix(in srgb, var(--loop-edge) 35%, transparent); }
.wave-wrap canvas.lanes { height: 30px; cursor: crosshair; border-top: 1px solid var(--line); margin-top: 6px; }
.btn.rec { color: #ff6b6b; border-color: color-mix(in srgb, #ff6b6b 50%, var(--line)); }
.btn.rec.on { background: #ff4d4d; color: #fff; border-color: #ff4d4d; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.7; } }
.recpanel { display: grid; gap: 8px; padding: 12px; margin-bottom: 12px; border: 1px solid #ff6b6b; border-radius: var(--radius); background: var(--panel); }
.recpanel input { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.inpanel { display: grid; gap: 8px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.inpanel .in-gain input[type=range] { flex: 1; min-width: 140px; }
.btn.on { border-color: var(--accent); }
.vol-pct { min-width: 4.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted, inherit); }
.vol-pct.boost { color: var(--accent); font-weight: 600; }
.meter { position: relative; height: 14px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: #3fb96b; transition: width 60ms linear; }
.meter.hot .meter-fill { background: #e3b341; }
.meter.clip .meter-fill { background: #ff4d4d; }
.meter-mark { position: absolute; top: 0; bottom: 0; left: 87.5%; width: 2px; background: var(--text, #888); opacity: 0.6; }
.meter-hint { font-variant-numeric: tabular-nums; }
.latency { margin-bottom: 8px; }
.latency .warn { color: var(--accent); }
.mixer { display: grid; gap: 8px; }
.mixrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mixname { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.mixname a.iconbtn { text-decoration: none; }
.mixctl { display: flex; align-items: center; gap: 6px; }
.mixctl input[type=range] { width: 110px; }
.btn.ms { width: 30px; justify-content: center; padding: 4px 0; font-weight: 700; }
.btn.on-mute { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
.btn.on-solo { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.offset { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.offset input[type=range] { flex: 1; min-width: 140px; }
.offset .btn.small { padding: 2px 8px; font-variant-numeric: tabular-nums; }
input.num { width: 5.5em; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); font-variant-numeric: tabular-nums; }
.arrangement { display: grid; gap: 10px; }
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--accent); border-radius: 8px; padding: 2px 4px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.seg-main { background: none; border: 0; cursor: pointer; padding: 4px 6px; text-align: left; }
.seg-n { display: inline-block; min-width: 1.4em; text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 4px; font-weight: 700; font-size: 12px; }
.arrangement select { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; max-width: 100%; }
.post.system { background: transparent; border-style: dashed; }
@media (max-width: 560px) {
  .mixrow { grid-template-columns: 1fr; }
  .mixctl input[type=range] { flex: 1; width: auto; }
}

/* marker dialog: name, toggle "new version from here" */
.marker-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--text);
}
.marker-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.marker-dialog form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
.marker-dialog h3 { margin: 0; font-size: 17px; font-variant-numeric: tabular-nums; }
.marker-dialog input:not([type]), .marker-dialog textarea {
  font: inherit; font-size: 16px; /* no zoom on phones */ padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
.marker-dialog .stack { display: grid; gap: 6px; }
.marker-dialog .row.end { display: flex; justify-content: flex-end; gap: 8px; }
.marker-dialog .btn { padding: 10px 16px; }
@media (max-width: 560px) {
  /* phone: sheet at the bottom, above the keyboard */
  .marker-dialog { margin: auto auto 12px; }
}
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--panel-2);
  border: 1px solid var(--line); transition: background 0.15s;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--loop-edge); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.4; }
.chip.fresh { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.seg { border-color: var(--seg, var(--accent)); background: color-mix(in srgb, var(--seg, var(--accent)) 12%, transparent); }
.seg .seg-n { background: var(--seg, var(--accent)); color: #08111d; }
.relation { margin: 10px 0 4px; }
.relation-head { display: block; width: 100%; margin-bottom: 4px; padding: 2px 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.relation-arrow { display: inline-block; width: 1.1em; color: var(--muted); }
.relation canvas { display: block; width: 100%; cursor: pointer; }
.trim-note { margin: -2px 2px 8px; }

/* bars ("Takte") next to version names, tempo dialog */
.chip-bars { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.85; white-space: nowrap; }
.btn.tempo { font-variant-numeric: tabular-nums; }
.tempo-dialog .row.tempo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.tempo-dialog .tempo-row label { flex: 1 1 110px; }
.tempo-dialog input[type=number], .tempo-dialog select {
  width: 100%; font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums;
}
.tempo-dialog .btn.tap { padding: 16px; font-size: 16px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }

/* fine positioning inside the marker dialog */
.marker-dialog .fine-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.marker-dialog canvas.fine {
  display: block; width: 100%; height: 96px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--line); touch-action: none; cursor: ew-resize;
}
.marker-dialog .fine-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.marker-dialog .fine-tools .spacer { flex: 1; }
.marker-dialog .btn.nudge { padding: 8px 6px; min-width: 40px; justify-content: center; font-variant-numeric: tabular-nums; }
.marker-dialog .nudges .btn.nudge { flex: 1; }
.marker-dialog .btn.listen { flex: 1.6; justify-content: center; border-color: var(--marker); color: var(--marker); font-weight: 600; }
.marker-dialog .small.muted .btn.nudge { padding: 4px 10px; min-width: 36px; }
.marker-dialog .fine-tools.small { flex-wrap: nowrap; white-space: nowrap; }

/* marker categories, colour-coded */
.chip.cat { border-color: var(--mc); color: var(--text); }
.chip.cat::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mc); margin-right: 6px; vertical-align: 1px; }
.chip.cat.active, .chip.cat[aria-pressed="true"] { background: var(--mc); color: #08111d; border-color: var(--mc); }
.chip.cat[aria-pressed="true"]::before { background: #08111d; }
.cat-filter { margin-bottom: 8px; }
.cat-filter .chip { font-size: 13px; padding: 4px 10px; }
.marker-chip.cat { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, transparent); }
.marker-chip .cat-tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--mc); color: #08111d; }
/* compact: one row, still a finger-sized target */
.marker-dialog .cat-pick { display: flex; flex-wrap: nowrap; gap: 4px; }
.marker-dialog .cat-pick .chip {
  flex: 1 1 auto; min-width: 0; min-height: 30px; padding: 2px 4px; font-size: 12px; line-height: 1; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
.marker-dialog .cat-pick .chip::before { width: 6px; height: 6px; margin-right: 4px; flex: none; }
.relation canvas[hidden] { display: none; }

.marker-dialog .until { display: flex; align-items: center; gap: 8px; }
.marker-dialog .until select {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
@media (max-width: 400px) { .marker-dialog .cat-pick .chip::before { display: none; } .marker-dialog .cat-pick { gap: 3px; } }
.marker-dialog .nudges { flex-wrap: nowrap; } .marker-dialog .nudges .btn { min-width: 0; }
/* wider screens (tablet, desktop): use the room */
@media (min-width: 700px) {
  .marker-dialog { width: min(760px, calc(100vw - 64px)); }
  .marker-dialog form { padding: 20px 24px; gap: 14px; }
  .marker-dialog canvas.fine { height: 150px; }
  .marker-dialog .cat-pick .chip { font-size: 14px; min-height: 34px; padding: 4px 10px; }
  .marker-dialog .cat-pick .chip::before { width: 8px; height: 8px; margin-right: 6px; }
}
@media (max-width: 400px) { .marker-dialog .nudges .btn { padding: 8px 4px; font-size: 14px; } .marker-dialog .fine-tools.small .btn.nudge { min-width: 32px; } }
@media (max-width: 400px) { .marker-dialog .nudges .btn.listen { flex: 0 0 auto; padding: 8px 10px; } .marker-dialog .nudges { gap: 4px; } }
/* versions whose arrangement contains the spot that is playing */
.versions a.chip.playing:not(.active) { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.versions a.chip { transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }

/* time ruler above the waveform */
.wave-wrap canvas.ruler { height: 20px; cursor: pointer; touch-action: manipulation; border-bottom: 1px solid var(--line); }
/* playback still running from another view of this take */
.bgplay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; padding: 8px 10px; border-radius: var(--radius);
  border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.bgplay[hidden] { display: none; }
.bgplay.here { border: 1px solid var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.bgplay-text { flex: 1 1 260px; font-variant-numeric: tabular-nums; }
.versions a.chip.active.playing-here { box-shadow: 0 0 0 2px var(--accent); }
.marker-dialog textarea { resize: vertical; min-height: 64px; }
.marker-dialog textarea[hidden] { display: none; }
