/* =============================================================
   SIDtunez — Sync Studio: Editor-Gestaltung
   /css/studio-editor.css
   -------------------------------------------------------------
   KOPIE von css/asm.css. Unten angehaengt: die Regeln fuer den
   eingebetteten Betrieb, in dem der Editor Teil der Seite ist und
   nicht ein Fenster darueber.
   ============================================================= */
/* =============================================================
   SIDTUNEZ — ASM (Audio Stem Mixer)  ·  Stufe 2a Styling
   Eigenstaendige Datei, lazy von player.js geladen.
   Nutzt die Brand-Tokens (Teal = Wiedergabe, Charcoal-Bases).
   ============================================================= */

body.asm-noscroll { overflow: hidden; }

.asm-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 2vh 1.5vw;
  animation: asmFade 0.16s ease;
}
@keyframes asmFade { from { opacity: 0; } to { opacity: 1; } }

.asm-modal {
  width: 100%; max-width: 1480px; height: 94vh; max-height: 940px;
  display: flex; flex-direction: column;
  background: var(--bg2, #191D24);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  outline: none;
  overflow: hidden;
}

/* ----- Kopf ----- */
.asm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg, #0E0F12);
}
.asm-head-titles { display: flex; align-items: baseline; gap: 0.7rem; min-width: 0; }
.asm-brand {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.08em;
  font-size: 1.5rem; color: var(--accent, #2FD4C4); line-height: 1;
}
.asm-sub {
  color: var(--text2, #9A9CA3); font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asm-tag {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.03em;
  color: var(--accent, #2FD4C4); background: rgba(47, 212, 196, 0.1);
  border: 1px solid rgba(47, 212, 196, 0.28);
  border-radius: 5px; padding: 2px 7px; align-self: center; white-space: nowrap;
}
.asm-build {
  flex-shrink: 0; font-size: 0.62rem; letter-spacing: 0.04em;
  color: var(--text3, #9299A5); border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 5px; padding: 1px 5px; align-self: center;
}
.asm-x {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  background: transparent; color: var(--text2, #9A9CA3);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.asm-x:hover { background: var(--bg3, #252A33); color: #fff; border-color: var(--border-hover, rgba(255,255,255,.28)); }

/* ----- Body / Bühne ----- */
.asm-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg2, #191D24); }
.asm-stage { position: relative; padding: 0; }

.asm-loading {
  padding: 3rem 1.5rem; text-align: center; color: var(--text2, #9A9CA3); font-size: 0.95rem;
}

.asm-ruler {
  display: flex;
  position: sticky; top: 0; z-index: 6;
  height: 28px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg, #0E0F12);
  user-select: none;
}
.asm-ruler-spacer {
  width: var(--asm-head, 150px); flex: none;
  position: sticky; left: 0; z-index: 7;
  background: var(--bg, #0E0F12);
  border-right: 1px solid var(--border, rgba(255,255,255,.08));
}
.asm-ruler-track { position: relative; height: 100%; flex: none; }
.asm-ruler-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.13); }
.asm-ruler-tick.asm-tick-minor {
  top: auto; bottom: 0; height: 8px;
  border-left-color: rgba(255,255,255,.06);
}
.asm-ruler-tick span {
  position: absolute; top: 4px; left: 4px;
  font-size: 0.68rem; color: var(--text3, #9299A5);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.asm-lanes { display: flex; flex-direction: column; }

.asm-lane {
  display: flex; align-items: stretch;
  height: 80px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
}
.asm-lane:nth-child(even) .asm-lane-track { background-color: rgba(255,255,255,.012); }
.asm-lane:last-child { border-bottom: none; }

.asm-lane-head {
  width: var(--asm-head, 150px); flex-shrink: 0;
  position: sticky; left: 0; z-index: 5;
  display: flex; flex-direction: column; justify-content: center; gap: 0.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg, #0E0F12);
  border-right: 1px solid var(--border, rgba(255,255,255,.08));
}
/* Titelzeile im Spurkopf: Loeschsymbol vorn, Titel daneben */
.asm-lane-topline { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.asm-lane-del {
  flex-shrink: 0; width: 20px; height: 20px; padding: 0; line-height: 1;
  border: 1px solid var(--border, rgba(255,255,255,.08)); border-radius: 4px;
  background: transparent; color: var(--text3, #9299A5);
  font-size: 0.72rem; cursor: pointer; opacity: .75;
  transition: color .15s, border-color .15s, background .15s, opacity .15s;
}
.asm-lane-del:hover {
  color: #e0533f; border-color: rgba(224, 83, 63, .5);
  background: rgba(224, 83, 63, .1); opacity: 1;
}
.asm-lane-title {
  font-size: 0.9rem; color: var(--text, #e8e8ea); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asm-lane-state { font-size: 0.72rem; color: var(--text3, #9299A5); }
.asm-lane-error .asm-lane-state { color: #e0533f; }
.asm-lane-error .asm-lane-title { color: var(--text3, #9299A5); }

.asm-lane-track {
  flex: none; min-width: 0; position: relative; cursor: pointer; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 64px);
}
.asm-lane-track canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ----- Playhead ----- */
.asm-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--accent, #2FD4C4);
  box-shadow: 0 0 8px rgba(47, 212, 196, 0.6);
  pointer-events: none; z-index: 4;
}
.asm-playhead::before {
  content: ''; position: absolute; top: 0; left: -4px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--accent, #2FD4C4);
}

/* ----- Sprungmarken ----- */
.asm-markers { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.asm-marker-line {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1px dashed rgba(47, 212, 196, 0.45);
}
.asm-marker-flag {
  position: absolute; top: 2px;
  min-width: 15px; height: 16px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700; line-height: 1;
  color: var(--accent, #2FD4C4);
  background: rgba(47, 212, 196, 0.16);
  border: 1px solid rgba(47, 212, 196, 0.55);
  border-radius: 3px; cursor: pointer;
  font-variant-numeric: tabular-nums; user-select: none; z-index: 2;
}
.asm-marker-flag:hover { background: rgba(47, 212, 196, 0.32); }

/* ----- Fuß / Transport ----- */
.asm-foot {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.75rem 1.2rem;
  border-top: 1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg, #0E0F12);
}
.asm-transport { display: flex; align-items: center; gap: 0.5rem; }
.asm-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg3, #252A33); color: var(--text, #e8e8ea);
  font-size: 1rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.asm-btn:hover:not(:disabled) { border-color: var(--border-hover, rgba(255,255,255,.28)); }
.asm-btn:active:not(:disabled) { transform: scale(0.94); }
.asm-btn:disabled { opacity: 0.4; cursor: default; }
.asm-play {
  background: var(--accent, #2FD4C4); color: #0E0F12; border-color: transparent;
}
.asm-play:hover:not(:disabled) { background: var(--accent-hover, #4ee0d2); }

.asm-time {
  font-variant-numeric: tabular-nums; color: var(--text2, #9A9CA3);
  font-size: 0.92rem; letter-spacing: 0.02em;
}
.asm-time #asmCur { color: var(--text, #e8e8ea); }

.asm-hint { margin-left: auto; color: var(--text3, #9299A5); font-size: 0.74rem; }

/* ----- Mobil / schmal ----- */
.asm-mobile-hint { display: none; }
@media (max-width: 760px) {
  .asm-overlay { padding: 0; }
  .asm-modal { height: 100vh; max-height: none; border-radius: 0; border: none; }
  /* Kopfbreite NICHT mehr hart setzen: sie kommt aus --asm-head (vom JS,
     ziehbar). Vorher war nur .asm-lane-head auf 104px, waehrend
     Lineal-Spacer, Video-Kopf und die JS-Rechnung bei 172px blieben —
     dadurch standen Koepfe, Lineal und Playhead auf schmalen Geraeten
     gegeneinander versetzt. Den Startwert setzt jetzt initialHeadW(). */
  .asm-mobile-hint { display: block; }
}

/* =================== Stufe 2b: Editing & Mixer =================== */

/* etwas hoehere Lanes fuer die Regler im Kopf */
.asm-lane { height: 86px; }
.asm-lane-head {
  justify-content: space-between; gap: 0.3rem; padding: 0.5rem 0.7rem;
}
.asm-lane-title { font-size: 0.86rem; }

/* Lane-Regler: Mute / Solo / Fader */
.asm-lane-ctl { display: flex; align-items: center; gap: 0.3rem; }
.asm-ms {
  width: 22px; height: 20px; flex-shrink: 0; border-radius: 4px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--bg3, #252A33); color: var(--text2, #9A9CA3);
  font-size: 0.7rem; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.asm-ms:hover { border-color: var(--border-hover, rgba(255,255,255,.22)); }
.asm-mute.on { background: #e0533f; color: #fff; border-color: transparent; }
.asm-solo.on { background: #6aa9e0; color: #0E0F12; border-color: transparent; }

/* Fader (Lane + Master) */
.asm-fader { flex: 1; min-width: 40px; height: 18px; accent-color: var(--accent, #2FD4C4); cursor: pointer; }
.asm-fader-wide { width: 130px; flex: none; }

/* Toolbar */
.asm-toolbar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 1.2rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg2, #191D24);
}
.asm-tool {
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--bg3, #252A33); color: var(--text, #e8e8ea);
  font-size: 0.8rem; padding: 0.34rem 0.7rem; border-radius: 6px; cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
}
.asm-tool:hover:not(:disabled) { border-color: var(--border-hover, rgba(255,255,255,.22)); }
.asm-tool:disabled { opacity: 0.4; cursor: default; }
.asm-tool-hint { color: var(--text3, #9299A5); font-size: 0.72rem; margin-left: auto; }
.asm-zoom { display: flex; gap: 0.25rem; margin-left: 1rem; align-items: center; flex: none; }
.asm-zoom-btn { padding: 0.34rem 0; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }

/* ----- Lade-Fortschritt (bis alle Stems geladen sind) ----- */
.asm-loadbar {
  padding: 0.6rem 1.2rem 0.7rem;
  background: var(--bg2, #191D24);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  overflow: hidden; max-height: 60px; opacity: 1;
  transition: max-height .35s ease, opacity .3s ease, padding .35s ease, border-color .35s ease;
}
.asm-loadbar-done {
  max-height: 0; opacity: 0;
  padding-top: 0; padding-bottom: 0; border-color: transparent; pointer-events: none;
}
.asm-loadbar-label {
  font-size: 0.78rem; color: var(--text2, #9A9CA3);
  margin-bottom: 0.4rem; font-variant-numeric: tabular-nums;
}
.asm-loadbar-track {
  height: 6px; border-radius: 3px;
  background: var(--bg4, #23262e); overflow: hidden;
}
.asm-loadbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent, #2FD4C4), #4fe3d5);
  border-radius: 3px; transition: width .25s ease;
}

/* Clips */
.asm-clip {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  border-radius: 4px; overflow: hidden; cursor: grab; z-index: 2;
  background: rgba(47, 212, 196, 0.07);
  border: 1px solid rgba(47, 212, 196, 0.35);
}
.asm-clip:active { cursor: grabbing; }
.asm-clip.sel {
  border-color: var(--accent, #2FD4C4);
  box-shadow: 0 0 0 1px var(--accent, #2FD4C4) inset, 0 0 10px rgba(47,212,196,0.25);
  background: rgba(47, 212, 196, 0.13);
  z-index: 3;
}
.asm-clip canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Master-Bereich im Fuss */
.asm-master { display: flex; align-items: center; gap: 0.5rem; }
.asm-master-lbl {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.06em;
  font-size: 0.9rem; color: var(--text2, #9A9CA3);
}

@media (max-width: 760px) {
  .asm-lane-head { width: 132px; }
  .asm-fader-wide { width: 90px; }
}

/* =================== Stufe 3c-2: Kauf-Button & Fortschritt =================== */
.asm-modal { position: relative; } /* fuer den Fortschritts-Overlay */

/* Kaufen-Button — Amber ist die Kauf-/Lizenz-Aktion */
.asm-btn-buy {
  margin-left: auto;
  border: none; border-radius: 7px;
  background: #E9A94A; color: #0E0F12;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em;
  font-size: 1rem; padding: 0.6rem 1.1rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, opacity .15s, transform .1s;
}
.asm-btn-buy:hover:not(:disabled) { background: #f0b75e; }
.asm-btn-buy:active:not(:disabled) { transform: scale(0.97); }
.asm-btn-buy:disabled { opacity: 0.45; cursor: default; }

/* Fortschritts-/Status-Overlay */
.asm-progress {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(14, 15, 18, 0.82);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.asm-progress-box {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 2rem 2.4rem; text-align: center;
  background: var(--bg2, #191D24);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px; max-width: 80%;
}
.asm-progress-msg { color: var(--text, #e8e8ea); font-size: 0.98rem; line-height: 1.4; }
.asm-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(47, 212, 196, 0.2);
  border-top-color: var(--accent, #2FD4C4);
  animation: asmSpin 0.8s linear infinite;
}
@keyframes asmSpin { to { transform: rotate(360deg); } }
.asm-progress-close {
  border: 1px solid var(--border, rgba(255,255,255,.14));
  background: var(--bg3, #252A33); color: var(--text, #e8e8ea);
  border-radius: 7px; padding: 0.45rem 1.1rem; cursor: pointer; font-size: 0.9rem;
}
.asm-progress-close:hover { border-color: var(--border-hover, rgba(255,255,255,.24)); }

/* ----- Schliessen-Rueckfrage (SIDtunez-Look) ----- */
.asm-confirm {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  animation: asmFade 0.14s ease;
}
.asm-confirm-box {
  width: min(420px, 86%);
  background: var(--bg3, #252A33);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 1.5rem 1.5rem 1.25rem;
  text-align: center;
}
.asm-confirm-title {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em;
  font-size: 1.6rem; line-height: 1; color: var(--text, #e8e8ea);
  margin-bottom: 0.5rem;
}
/* Projekt-Dialog vor dem Kauf (Projektbindung § 4.4) — nutzt die Huelle
   des Bestaetigungsdialogs, braucht nur Feld und Fehlerzeile. */
.asm-project-input {
  width: 100%; margin-top: 1rem;
  background: var(--bg2, #14161a); border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--text, #e8e8ea); font-family: inherit; font-size: 0.92rem;
  padding: 0.55rem 0.7rem; border-radius: 8px; text-align: left;
}
.asm-project-input:focus { border-color: var(--accent, #2FD4C4); outline: none; }
.asm-project-err {
  color: #f4606c; font-size: 0.8rem; margin-top: 0.45rem; text-align: left;
}

.asm-confirm-msg {
  color: var(--text2, #9A9CA3); font-size: 0.92rem; line-height: 1.45;
  margin-bottom: 1.4rem;
}
.asm-confirm-actions { display: flex; gap: 0.6rem; justify-content: center; }
.asm-confirm-btn {
  flex: 1; max-width: 190px;
  padding: 0.6rem 1rem; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; font-weight: 600;
  transition: background .14s, border-color .14s, color .14s;
}
.asm-confirm-cancel {
  background: var(--bg4, #23262e); color: var(--text, #e8e8ea);
  border: 1px solid var(--border, rgba(255,255,255,.14));
}
.asm-confirm-cancel:hover { border-color: var(--border-hover, rgba(255,255,255,.24)); }
.asm-confirm-ok {
  background: transparent; color: #e0533f;
  border: 1px solid rgba(224, 83, 63, 0.5);
}
.asm-confirm-ok:hover { background: rgba(224, 83, 63, 0.12); border-color: rgba(224, 83, 63, 0.85); }

/* ===== Video-Referenzspur (lokal, kein Upload) ===== */
.asm-vidlane {
  display: flex; align-items: stretch;
  height: 62px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  background: rgba(47,212,196,.03);
}
.asm-vidlane-head {
  width: var(--asm-head, 150px); flex-shrink: 0;
  position: sticky; left: 0; z-index: 5;
  display: flex; flex-direction: column; justify-content: center; gap: 0.2rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg, #0E0F12);
  border-right: 1px solid var(--border, rgba(255,255,255,.08));
}
.asm-vidlane-ctl { display: flex; gap: 0.25rem; }
.asm-vidlane-ctl .asm-ms.on { color: var(--accent, #2FD4C4); border-color: var(--accent, #2FD4C4); }
.asm-vidlane-track {
  flex: none; min-width: 0; position: relative; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 64px);
}
.asm-vidstrip {
  position: absolute; top: 4px; bottom: 4px;
  border: 1px solid rgba(47,212,196,.45);
  border-radius: 4px; overflow: hidden;
  background: rgba(0,0,0,.35);
  cursor: grab;
}
.asm-vidstrip.drag { cursor: grabbing; border-color: var(--accent, #2FD4C4); }
.asm-vidstrip img {
  position: absolute; top: 0; bottom: 0; height: 100%;
  object-fit: cover; display: block;
  pointer-events: none; user-select: none;
}

/* ----- Vorschaufenster ----- */
.asm-vidprev {
  position: absolute; top: 96px; right: 16px; z-index: 8;
  width: 240px; aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.asm-vidprev.big { width: 460px; }
.asm-vidprev video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
@media (max-width: 900px) {
  .asm-vidprev { width: 160px; top: 84px; right: 8px; }
  .asm-vidprev.big { width: 260px; }
}

/* Vorschaufenster: frei verschiebbar */
.asm-vidprev { cursor: grab; user-select: none; }
.asm-vidprev.drag { cursor: grabbing; border-color: var(--accent, #2FD4C4); }
.asm-vidprev video { pointer-events: none; }

/* ===== Fade-Griffe an den Clip-Ecken ===== */
.asm-fade-h {
  position: absolute; top: 0; width: 12px; height: 12px;
  z-index: 3; cursor: ew-resize;
}
.asm-fade-h::after {
  content: ''; position: absolute; top: 2px; width: 8px; height: 8px;
  background: rgba(233,234,236,.55);
  border: 1px solid rgba(14,15,18,.7);
  border-radius: 2px;
}
.asm-fade-in  { left: 0; }
.asm-fade-in::after  { left: 1px; }
.asm-fade-out { right: 0; }
.asm-fade-out::after { right: 1px; }
.asm-clip:hover .asm-fade-h::after { background: var(--accent, #2FD4C4); }
.asm-fade-h:hover::after { background: #fff; transform: scale(1.15); }

/* Zeitleiste: klickbar zum Positionieren */
.asm-ruler-track { cursor: pointer; }
.asm-ruler-track .asm-marker-flag { cursor: pointer; }

/* ===== Spurkopf-Breite ziehen (Trenner) ===== */
.asm-head-grip {
  position: absolute; top: 0; right: 0; bottom: 7px; width: 6px;
  cursor: col-resize; z-index: 8;
}
.asm-head-grip:hover { background: rgba(47,212,196,.4); }
.asm-head-grip.on    { background: var(--accent, #2FD4C4); }

/* ===== Spurhoehe ziehen (Unterkante des Spurkopfs) ===== */
.asm-lane-hgrip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  cursor: ns-resize; z-index: 9;
}
.asm-lane-hgrip:hover { background: rgba(47,212,196,.4); }
.asm-lane-hgrip.on    { background: var(--accent, #2FD4C4); }


/* =============================================================
   EINGEBETTET — gesetzt von studio-editor.js, wenn open() einen
   Container bekommen hat. Der Editor fuellt dann sein Element,
   statt den Bildschirm zu bedecken.
   ============================================================= */
.asm-overlay.asm-eingebettet {
  position: static;
  inset: auto;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  animation: none;
  height: 100%;
  display: block;
}
.asm-overlay.asm-eingebettet .asm-modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border-radius: 0;
  border-left: 0; border-right: 0; border-bottom: 0;
  box-shadow: none;
}
/* Die Kopfzeile des Editors doppelt im Studio die Seitenkopfzeile —
   Marke und Schliessen braucht es dort nicht. Titel, Tempo und
   Tonart des Stuecks bleiben, die sind Arbeitsinformation. */
.asm-overlay.asm-eingebettet .asm-brand { display: none; }
.asm-overlay.asm-eingebettet .asm-head { padding-top: .4rem; padding-bottom: .4rem; }

/* Herkunft ueber dem Stemnamen — nur sichtbar, wenn mehrere Titel
   auf der Zeitleiste liegen (das JS setzt es nur dann). */
.asm-lane-herkunft {
  display: block;
  font-size: .72rem;
  line-height: 1.2;
  color: var(--accent, #2FD4C4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* =============================================================
   Effekte je Spur
   ============================================================= */
.asm-ms.asm-fx { font-size: .62rem; letter-spacing: .02em; }
.asm-ms.asm-fx.on { background: var(--accent, #2FD4C4); color: #0A2E2B; border-color: var(--accent, #2FD4C4); }

.asm-fx-panel {
  position: absolute;
  z-index: 40;
  width: 230px;
  padding: .7rem .8rem .8rem;
  background: var(--bg2, #191D24);
  border: 1px solid var(--border, rgba(255,255,255,.14));
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: .78rem;
  color: var(--text, #ECEAE4);
}
/* Die Kopfzeile ist der Griff. Der Zeiger sagt das auch — sonst
   probiert niemand, daran zu ziehen. */
.asm-fx-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin: -.7rem -.8rem .6rem;
  padding: .5rem .8rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.14));
  border-radius: 10px 10px 0 0;
  background: rgba(255,255,255,.04);
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: grab;
  user-select: none;
}
.asm-fx-panel.zieht .asm-fx-kopf { cursor: grabbing; }
.asm-fx-panel.zieht { box-shadow: 0 18px 44px rgba(0,0,0,.65); }
.asm-fx-zu {
  background: transparent; border: 0; color: var(--text2, #9A9CA3);
  font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 .2rem;
}
.asm-fx-zu:hover { color: var(--accent, #2FD4C4); }

.asm-fx-z { display: block; margin-bottom: .55rem; color: var(--text2, #9A9CA3); }
.asm-fx-z b { color: var(--accent, #2FD4C4); font-weight: 600; float: right; }
/* accent-color faerbt Regler und Haken in einer Zeile — dieselbe
   Loesung wie bei den Spurfadern, statt jeden Browser einzeln mit
   ::-webkit-slider-thumb zu bedienen. */
.asm-fx-z input[type=range] {
  width: 100%; margin-top: .25rem; height: 18px;
  accent-color: var(--accent, #2FD4C4);
  cursor: pointer;
}
.asm-fx-z select {
  width: 100%; margin-top: .25rem; padding: .3rem .4rem;
  background: var(--bg3, #252A33); color: var(--text, #ECEAE4);
  border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 5px;
  font-family: inherit; font-size: .78rem;
}
.asm-fx-z select option { background: var(--bg2, #191D24); color: var(--text, #ECEAE4); }

.asm-fx-weg {
  width: 100%; margin-top: .3rem; padding: .35rem;
  background: transparent; color: var(--text2, #9A9CA3);
  border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 6px;
  font-family: inherit; font-size: .75rem; cursor: pointer;
}
.asm-fx-weg:hover { border-color: #e0533f; color: #e0533f; }
