/* Song-Ansicht des Cowork-Servers im Aufbau des DAW-Hauptfensters: Werkzeugleiste, Spurfenster (Spurköpfe, Zeitlineal, Clips mit
   Wellenform, Abspielzeiger), Browser rechts, Mixer unten (Kanalzüge), Transportleiste; dazu die Notizen im Browser.
   Grenzen: Farben und Maße folgen dem dunklen Thema der DAW (theme.rs), nicht pixelgenau. Unter 760px Breite ist immer nur ein Bereich
   (Spuren, Mixer oder Browser) sichtbar; die Werkzeugleiste schaltet um. */
.daw { --hw: 248px; --dock: 292px; --side: 340px; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) var(--dock) auto; grid-template-columns: minmax(0, 1fr); background: var(--ground); }
.daw.no-mixer { grid-template-rows: auto minmax(0, 1fr) 0 auto; }
.daw.no-mixer .dock, .daw.no-browser .browser { display: none; }

/* Werkzeugleiste */
.toolbar { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px 0 6px; background: var(--soft); border-bottom: 1px solid #111316; min-width: 0; }
.tool { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--raised); color: var(--ink); font: 600 12.5px/1 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; flex: none; transition: background-color .12s var(--ease), border-color .12s var(--ease); }
.tool .ic { width: 15px; height: 15px; }
.tool:hover { border-color: var(--ink-soft); color: var(--bright); }
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tool.back { border-color: transparent; background: none; color: var(--ink-soft); padding: 0 6px; flex: 0 1 auto; min-width: 0; }
.tool.back span { overflow: hidden; text-overflow: ellipsis; max-width: 18ch; }
.tool.phone { display: none; }
.song-name { font: 600 14px/1.2 var(--text); color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tool-info { color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 10 auto; }
.tool-gap { flex: 1; }
.sum { width: 132px; height: 10px; margin-left: 8px; background: #101215; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; flex: none; }
.sum i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--ok) 0 72%, var(--solo) 72% 92%, var(--danger) 92%); }

.work { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); min-height: 0; }
.daw.no-browser .work { grid-template-columns: minmax(0, 1fr); }

/* Spurfenster */
.arr { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--lane-a); }
.arr > .empty { margin: 24px; align-self: start; }
.arr-scroll { overflow: auto; min-height: 0; scrollbar-color: var(--line-strong) var(--lane-a); }
.arr-scroll:focus-visible { outline-offset: -2px; }
.arr-inner { --th: 68px; --lw: 0px; position: relative; width: calc(var(--hw) + var(--lw)); min-width: 100%; min-height: 100%; display: flex; flex-direction: column; }
.arr-rulerrow, .arr-row { display: flex; flex: none; }
.arr-rulerrow { position: sticky; top: 0; z-index: 4; height: 36px; background: var(--soft); border-bottom: 1px solid #111316; }
.arr-corner { position: sticky; left: 0; z-index: 5; width: var(--hw); flex: none; display: flex; align-items: center; padding: 0 10px; background: var(--soft); border-right: 1px solid #111316; color: var(--ink-soft); font-size: 12px; }
.arr-ruler { position: relative; width: var(--lw); flex: none; cursor: pointer; overflow: hidden; }
.tick { position: absolute; top: 0; bottom: 0; padding: 17px 0 0 5px; border-left: 1px solid var(--line-strong); color: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
.flag { position: absolute; bottom: 0; width: 16px; height: 16px; margin-left: -8px; padding: 0; border: 0; background: none; cursor: pointer; }
.flag::before { content: ""; position: absolute; left: 3px; bottom: 0; border: 5px solid transparent; border-top: 8px solid var(--solo); border-bottom: 0; }
.flag.done::before { border-top-color: var(--ink-soft); }
.flag:hover::before { border-top-color: var(--bright); }
.arr-row { height: var(--th); border-bottom: 1px solid #17191c; }
.arr-row:nth-child(odd) .lane { background: var(--lane-b); }
.arr-fill { flex: 1; }
.th { position: sticky; left: 0; z-index: 3; width: var(--hw); flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); gap: 2px 8px; align-content: center; padding: 5px 8px 5px 12px; background: var(--soft); border-right: 1px solid #111316; box-shadow: inset 4px 0 0 var(--c); overflow: hidden; }
.arr-row.sel .th { background: var(--raised); }
.th-name { grid-column: 1; border: 0; background: none; padding: 0; color: var(--bright); font: 600 13px/1.3 var(--text); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-sub { grid-column: 1 / -1; color: var(--ink-soft); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: start; }
.th-ctl { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 4px; }
.th-none { grid-column: 2; grid-row: 1; color: var(--ink-soft); font-size: 11.5px; white-space: nowrap; }
.th.off .th-name { color: var(--ink-soft); font-weight: 400; }
.th-fader { width: 76px; height: 22px; }
.tog { width: 24px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--ground); color: var(--ink-soft); font: 700 11px/1 var(--text); cursor: pointer; flex: none; transition: background-color .1s var(--ease), color .1s var(--ease); }
.tog:hover { border-color: var(--ink-soft); color: var(--bright); }
.tog.mute[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.tog.solo[aria-pressed="true"] { background: var(--solo); border-color: var(--solo); color: var(--on-accent); }
.lane { position: relative; width: var(--lw); flex: none; background: var(--lane-a); cursor: pointer; }
.clip { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 3px; background: color-mix(in srgb, var(--c) 26%, #15171a); border: 1px solid color-mix(in srgb, var(--c) 70%, #15171a); overflow: hidden; }
.clip-t { position: absolute; left: 0; top: 0; max-width: 100%; padding: 0 6px; background: color-mix(in srgb, var(--c) 70%, #15171a); color: var(--on-accent); font-size: 10.5px; font-weight: 700; line-height: 14px; border-radius: 0 0 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.wave { display: block; width: 100%; height: 100%; }
.arr-row.quiet .clip { opacity: .38; }
.arr-row.extra .th-name { cursor: default; font-weight: 500; }
/* Marker und Schleife */
.arr-ruler { touch-action: pan-y; user-select: none; }
.mk { position: absolute; top: 1px; height: 16px; max-width: 14ch; padding: 0 5px; border: 0; border-radius: 0 3px 3px 0; background: var(--ok); color: var(--on-accent); font-weight: 600; font-size: 10.5px; line-height: 16px; font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 2; }
.mk:hover, .mk:focus-visible { background: var(--bright); max-width: none; z-index: 3; }
.loop-range { position: absolute; bottom: 0; height: 7px; background: var(--ink-soft); opacity: .55; pointer-events: none; z-index: 1; }
.loop-range.on { background: var(--accent); opacity: 1; }
.arr-loop { position: absolute; top: 36px; bottom: 0; background: rgba(160, 168, 180, .05); border-inline: 1px solid rgba(160, 168, 180, .35); pointer-events: none; z-index: 1; }
.arr-loop.on { background: rgba(59, 142, 234, .10); border-inline-color: var(--accent); }
.tp[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.loop-box { justify-items: stretch; }
.loop-state { margin: 0; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.loop-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.loop-help { margin: 0; color: var(--ink-soft); font-size: 12px; }
.mk-item { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.lane-marks { position: absolute; inset: 0; pointer-events: none; }
.lane-marks .mark { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--solo); }
.lane-marks .mark.done { background: var(--ink-soft); }
.arr-playhead { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: #fff; z-index: 2; pointer-events: none; will-change: transform; }
.arr-hint { position: absolute; left: calc(var(--hw) + 16px); top: 48px; z-index: 6; padding: 6px 12px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--ink); font-size: 12.5px; max-width: calc(100% - var(--hw) - 32px); }
.arr-foot { display: flex; justify-content: flex-end; gap: 20px; height: 30px; padding: 0 12px; align-items: center; background: var(--soft); border-top: 1px solid #111316; color: var(--ink-soft); font-size: 12px; }
.arr-foot label { display: flex; align-items: center; gap: 8px; }
.arr-foot input { width: 110px; height: 20px; }

/* Reiterleisten (Browser, Dock) */
.pane-tabs { display: flex; gap: 2px; height: 30px; padding: 0 6px; align-items: flex-end; background: var(--ground); border-bottom: 1px solid #111316; flex: none; }
.pane-tabs button { height: 26px; padding: 0 12px; border: 0; border-radius: 4px 4px 0 0; background: none; color: var(--ink-soft); font: 600 12.5px/1 var(--text); cursor: pointer; }
.pane-tabs button:hover { color: var(--bright); }
.pane-tabs button[aria-selected="true"] { background: var(--soft); color: var(--bright); box-shadow: inset 0 2px 0 var(--accent); }
.pane-host { flex: 1; min-height: 0; display: flex; }
.browser, .dock { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--soft); }
.browser { border-left: 1px solid #111316; }
.dock { border-top: 1px solid #111316; }
.pane-body { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane-scroll { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; display: grid; gap: 10px; align-content: start; }
.pane-body .empty { border: 0; padding: 8px 0; }
.plist { display: grid; gap: 2px; }
.pitem { display: grid; gap: 1px; padding: 6px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.pitem:hover { background: var(--raised); }
.pitem.on { background: var(--raised); outline: 1px solid var(--line); font-weight: 600; }
.pnote { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); justify-items: start; }
.pnote.acts-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Notizen */
.note-list { display: grid; }
.note { display: grid; gap: 4px; padding: 10px 0; }
.note + .note { border-top: 1px solid var(--line); }
.note:first-child { padding-top: 0; }
.note-meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; color: var(--ink-soft); font-size: 12px; }
.note-meta b { color: var(--bright); font-size: 13px; }
.note-text { overflow-wrap: anywhere; white-space: pre-line; }
.note.done .note-text { color: var(--ink-soft); }
.note-acts { display: flex; gap: 6px; }
.pos { height: 22px; padding: 0 8px; border: 0; border-radius: 4px; background: var(--solo); color: var(--on-accent); font: 700 12px/1 var(--text); font-variant-numeric: tabular-nums; cursor: pointer; }
.pos:hover { background: #f2c561; }
.note-form textarea { min-height: 52px; }
.note-form { flex: none; gap: 8px; padding: 10px 12px; border-top: 1px solid #111316; background: var(--lane-b); grid-template-columns: minmax(0, 1fr); }
.pr-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pr-stage > .btn { justify-self: start; }
.pr-title { color: var(--bright); font-weight: 600; overflow-wrap: anywhere; }
.pr-fact { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.pr-held { display: grid; gap: 8px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--solo); border-radius: 6px; }
.pr-held > summary { color: var(--bright); font-weight: 600; cursor: pointer; }
.note-acts { flex-wrap: wrap; }
.note-acts .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--bright); }
.pr-rec, .pr-stage, .pr-links { display: grid; gap: 14px; }
.pr-link { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pr-level { height: 12px; background: #101215; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.pr-level i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--ok) 0 72%, var(--solo) 72% 92%, var(--danger) 92%); }
.pr-say { color: var(--bright); font-variant-numeric: tabular-nums; }
.note-opts { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }

/* Mixer */
.strips { flex: 1; min-width: 0; display: flex; background: var(--lane-a); }
.strips-scroll { flex: 1; min-width: 0; display: flex; overflow-x: auto; overflow-y: hidden; }
.strip { --c: var(--ink-soft); width: 96px; flex: none; display: flex; flex-direction: column; gap: 5px; padding: 6px 6px 0; border-right: 1px solid #111316; background: var(--soft); min-height: 0; }
.strip.sel { background: var(--raised); }
.strip.master { --c: var(--bright); width: 104px; border-left: 2px solid #111316; border-right: 0; }
.strip-sec { display: grid; gap: 2px; min-width: 0; }
.strip-sec.grow { flex: 0 0 auto; }
.strip-lab { color: var(--ink-soft); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.strip-ins { display: grid; gap: 2px; height: 56px; overflow: hidden; align-content: start; }
.strip-ins li { padding: 0 5px; background: var(--ground); border-radius: 2px; font-size: 11px; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-ins li.more { background: none; color: var(--ink-soft); }
.strip-nil { color: var(--ink-soft); font-size: 11px; }
.strip-sec:first-child .strip-nil { height: 56px; }
.strip-who { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-btn { display: flex; gap: 4px; justify-content: center; }
.strip-btn .tog { flex: 1; }
.strip-btn.none { color: var(--ink-soft); font-size: 11px; height: 22px; align-items: center; }
.strip-db { display: block; text-align: center; padding: 1px 0; background: #101215; border-radius: 2px; color: var(--bright); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.strip-fad { flex: 1; min-height: 60px; display: flex; justify-content: center; gap: 8px; padding: 2px 0; }
.vu { width: 8px; background: #101215; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; display: flex; }
.vu i { flex: 1; transform-origin: bottom; transform: scaleY(0); background: linear-gradient(0deg, var(--ok) 0 72%, var(--solo) 72% 92%, var(--danger) 92%); }
.fader.vert { writing-mode: vertical-lr; direction: rtl; width: 24px; height: auto; min-height: 0; }
.strip-name { display: block; margin: 0 -6px; padding: 0 6px; height: 24px; border: 0; background: color-mix(in srgb, var(--c) 34%, #1b1d21); box-shadow: inset 0 3px 0 var(--c); color: var(--bright); font: 600 11.5px/24px var(--text); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
button.strip-name { cursor: pointer; }
.strip.off .strip-name { color: var(--ink-soft); }

/* Transportleiste */
.transportbar { position: relative; background: var(--soft); border-top: 1px solid #111316; }
.seek { position: absolute; left: 0; right: 0; top: -9px; width: 100%; height: 16px; margin: 0; z-index: 7; }
.tp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; height: 52px; padding: 0 12px; }
.tp-btns { display: flex; gap: 4px; justify-self: end; }
.tp { width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 4px; background: var(--raised); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background-color .1s var(--ease), transform .1s var(--ease); }
.tp:hover { border-color: var(--ink-soft); color: var(--bright); }
.tp:active { transform: scale(.95); }
.tp.play { width: 46px; color: var(--ok); }
.tp.play.on { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.tc-box { display: grid; justify-items: center; padding: 3px 18px; min-width: 190px; background: #101215; border: 1px solid var(--line); border-radius: 4px; }
.tc { font: 600 22px/1.15 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--bright); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tc-sub { color: var(--ink-soft); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tp-facts { display: flex; justify-content: flex-end; gap: 6px; min-width: 0; overflow: hidden; }
.tp-facts span { padding: 0 8px; height: 24px; display: inline-flex; align-items: center; background: var(--ground); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .daw { --side: 300px; --hw: 208px; }
  .tool-info { display: none; }
  .th-fader { width: 52px; }
}
@media (max-width: 760px) {
  .daw { --hw: 128px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .daw.no-mixer { grid-template-rows: auto minmax(0, 1fr) auto; }
  .toolbar { height: 48px; gap: 4px; padding: 0 6px; }
  .tool { height: 38px; padding: 0 9px; }
  .tool.phone { display: inline-flex; }
  .tool.back span, .sum { display: none; }
  .tool span { font-size: 12px; }
  .song-name { font-size: 14px; }
  .work { grid-template-columns: minmax(0, 1fr); grid-row: 2; grid-column: 1; }
  .dock { grid-row: 2; grid-column: 1; border-top: 0; }
  .daw .work, .daw .dock, .daw .browser, .daw .arr { display: none; }
  .daw[data-pane="tracks"] .work, .daw[data-pane="tracks"] .arr, .daw[data-pane="browser"] .work, .daw[data-pane="browser"] .browser { display: grid; }
  .daw[data-pane="browser"] .browser, .daw[data-pane="mixer"] .dock { display: flex; }
  .browser { border-left: 0; }
  .th { grid-template-columns: minmax(0, 1fr); padding: 4px 6px 4px 10px; }
  .th-ctl, .th-none { grid-column: 1; grid-row: 2; }
  .th-sub, .th-fader, .arr-foot label:first-child { display: none; }
  .tog { width: 34px; height: 30px; font-size: 12px; }
  .arr-hint { left: 12px; right: 12px; max-width: none; }
  .strip { width: 84px; }
  .strip-btn .tog { height: 38px; }
  .fader.vert { width: 36px; }
  .pane-tabs { height: 40px; }
  .pane-tabs button { height: 36px; }
  .pos { height: 32px; padding: 0 12px; }
  .seek { top: -14px; height: 28px; }
  .tp-row { grid-template-columns: auto minmax(0, 1fr); height: 60px; gap: 8px; padding: 0 8px; }
  .tp { width: 42px; height: 44px; }
  .tp.play { width: 52px; }
  .tp-btns { gap: 3px; justify-self: start; }
  .tp-facts { display: none; }
  .tc-box { min-width: 0; padding: 3px 8px; justify-self: end; }
  .tc { font-size: 18px; }
  .tp-btns .tp:nth-child(2), .tp-btns .tp:nth-child(3) { display: none; }
}
