/* Schnittwerk – Editor-Oberfläche (dunkel). Desktop: Raster mit Seitenleisten,
   unter 900 px: Vorschau oben, Zeitleiste darunter, Bedienfelder als Bottom-Sheets. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/inter-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/montserrat-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/playfair-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/caveat-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #0c0c11;
  --panel: #13131b;
  --panel2: #191924;
  --panel3: #20202d;
  --line: #262635;
  --line2: #34344a;
  --text: #ececf3;
  --muted: #a0a0b6;
  --dim: #6e6e86;
  --pri: #7c5cff;
  --pri-h: #9177ff;
  --pri-soft: rgba(124, 92, 255, 0.16);
  --acc: #ffb547;
  --ok: #2fbf71;
  --err: #ff5d6e;
  --r: 10px;
  --r-sm: 7px;
  --top-h: 52px;
  --tl-h: 270px;
  --side-w: 300px;
  --insp-w: 300px;
  --nav-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
.hidden, [hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pri-h); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ------------------------------------------------------------------ Raster */
.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--insp-w);
  grid-template-rows: var(--top-h) minmax(0, 1fr) var(--tl-h);
  grid-template-areas: "top top top" "side stage insp" "tl tl tl";
}
@media (max-width: 1200px) and (min-width: 900px) {
  :root { --side-w: 264px; --insp-w: 272px; }
}

/* ------------------------------------------------------------- Kopfzeile */
.top {
  grid-area: top;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; flex: none; }
.brand svg { width: 28px; height: 28px; display: block; }
.proj-name {
  min-width: 60px; width: 220px; flex: 0 1 auto;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 6px 8px; font-weight: 700;
  text-overflow: ellipsis;
}
.proj-name:hover { border-color: var(--line2); }
.proj-name:focus { border-color: var(--pri); background: var(--panel2); outline: none; }
.save-state { font-size: 12px; color: var(--dim); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state[data-s="pending"]::before { background: var(--acc); }
.save-state[data-s="error"]::before { background: var(--err); }
.save-state[data-s="error"] { color: var(--err); }
.top .grow { flex: 1 1 auto; min-width: 4px; }
.top-group { display: flex; align-items: center; gap: 4px; }
.fmt-select { width: auto; max-width: 170px; }

/* --------------------------------------------------------------- Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line2);
  background: var(--panel2); color: var(--text);
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--panel3); border-color: #44445e; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: var(--pri-h); border-color: var(--pri-h); }
.btn.accent { background: var(--acc); border-color: var(--acc); color: #1b1408; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel2); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.big { height: 46px; font-size: 15px; }
.ib {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted);
}
.ib:hover { background: var(--panel2); color: var(--text); }
.ib:disabled { opacity: 0.35; cursor: default; background: transparent; }
.ib.on { color: var(--acc); }
.ib.sm { width: 30px; height: 30px; }
.pro-badge {
  height: 26px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--line2); background: transparent;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  flex: none; white-space: nowrap;
}
.pro-badge.is-pro { border-color: var(--acc); color: var(--acc); background: rgba(255, 181, 71, 0.1); }
.tag-pro { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 99px; background: rgba(255, 181, 71, 0.14); color: var(--acc); vertical-align: middle; }

/* ------------------------------------------------------------- Formulare */
input[type="text"], input[type="number"], input[type="search"], input[type="email"], select, textarea {
  width: 100%;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding: 7px 9px; color: var(--text); min-height: 34px;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="color"] { width: 44px; height: 34px; padding: 2px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--pri); }
input[type="range"] { width: 100%; accent-color: var(--pri); height: 22px; margin: 0; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field > label output, .field .val { color: var(--text); font-weight: 400; font-variant-numeric: tabular-nums; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.inline { display: flex; align-items: center; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin-bottom: 10px; }
.seg { display: flex; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button { flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 5px; padding: 6px 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--pri); color: #fff; }
.seg button:not(.on):hover { background: var(--panel3); color: var(--text); }
.hint { font-size: 12px; color: var(--dim); margin: 4px 0 12px; }
.hint.warn { color: var(--acc); }
.hint.err { color: var(--err); }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
h3.sub { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin: 16px 0 10px; font-weight: 800; }
h3.sub:first-child { margin-top: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.btn-row > .btn { flex: 1 1 auto; }

/* --------------------------------------------------- Seitenleiste (links) */
.side { grid-area: side; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; padding: 0 6px; }
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 12px 4px 10px; font-weight: 700; font-size: 12.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--pri); }
.panes { flex: 1; min-height: 0; overflow: auto; }
.pane { padding: 14px; }
.sheet-head { display: none; }

/* Medienbibliothek */
.dropzone {
  border: 1.5px dashed var(--line2); border-radius: var(--r);
  padding: 16px 12px; text-align: center; color: var(--muted); font-size: 12.5px;
  margin-bottom: 14px; transition: border-color 0.15s, background 0.15s;
}
.dropzone .btn { margin-bottom: 8px; }
.dropzone.over { border-color: var(--pri); background: var(--pri-soft); }
.mlist { display: grid; gap: 6px; }
.mitem {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 6px; border-radius: var(--r-sm); background: var(--panel2); border: 1px solid transparent;
  cursor: grab; user-select: none; -webkit-user-select: none;
}
.mitem:hover { border-color: var(--line2); }
.mitem.missing { border-color: rgba(255, 93, 110, 0.5); cursor: default; }
.mthumb { width: 64px; height: 38px; border-radius: 5px; background: #0a0a0f center/cover no-repeat; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--dim); position: relative; }
.mthumb canvas, .mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .dur { position: absolute; right: 3px; bottom: 2px; font-size: 10px; font-weight: 700; background: rgba(0, 0, 0, 0.7); padding: 0 4px; border-radius: 3px; color: #fff; font-variant-numeric: tabular-nums; }
.mthumb.audio { background: linear-gradient(135deg, #123c26, #0f2a1c); color: var(--ok); }
.mname { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmeta { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem.missing .mmeta { color: var(--err); }
.mact { display: flex; gap: 2px; }
.storage { margin-top: 14px; font-size: 11.5px; color: var(--dim); }
.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 5px; }
.meter > i { display: block; height: 100%; background: var(--pri); width: 0; }

/* Text-Vorlagen */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  height: 78px; border-radius: var(--r-sm); border: 1px solid var(--line2);
  background: linear-gradient(160deg, #1f1d33, #121219); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px; overflow: hidden; position: relative;
}
.tile:hover { border-color: var(--pri); }
.tile .tp { line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tn { position: absolute; left: 7px; bottom: 5px; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.tile.t-title .tp { font: 800 18px "Montserrat", sans-serif; text-transform: uppercase; }
.tile.t-lower .tp { font: 700 12px "Inter", sans-serif; background: var(--pri); padding: 3px 8px; border-radius: 3px; align-self: flex-start; }
.tile.t-subtitle .tp { font: 700 12px "Inter", sans-serif; background: rgba(0, 0, 0, 0.6); padding: 3px 8px; border-radius: 3px; margin-top: 14px; }
.tile.t-plain .tp { font: 700 17px "Playfair Display", serif; }

/* Untertitel-Liste */
.sublist { display: grid; gap: 6px; }
.subitem { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 7px; border-radius: var(--r-sm); background: var(--panel2); border: 1px solid transparent; }
.subitem.on { border-color: var(--acc); }
.subitem .st { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 3px; cursor: pointer; line-height: 1.3; }
.subitem textarea { min-height: 34px; padding: 5px 7px; font-size: 13px; resize: none; background: var(--panel); }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 8px 0; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pri), var(--acc)); transition: width 0.25s; }
.progress.indet > i { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.box { border: 1px solid var(--line2); border-radius: var(--r); padding: 12px; background: var(--panel2); margin-bottom: 12px; }
.box.pro { border-color: rgba(255, 181, 71, 0.4); }

/* Ton-Spuren */
.tracklist { display: grid; gap: 6px; margin-bottom: 8px; }
.trackitem { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-sm); background: var(--panel2); cursor: pointer; border: 1px solid transparent; }
.trackitem:hover { border-color: var(--line2); }
.trackitem.on { border-color: var(--acc); }
.trackitem .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.trackitem .nm { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trackitem .tm { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--err); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ------------------------------------------------------------- Vorschau */
.stage { grid-area: stage; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #08080c; }
.viewer { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden; }
.viewer canvas { display: block; background: #000; box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(0, 0, 0, 0.6); border-radius: 3px; touch-action: none; }
.viewer canvas.grab { cursor: move; }
.viewer.dragover::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--pri); border-radius: var(--r); background: var(--pri-soft); pointer-events: none; }
.empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none;
}
.empty-card { pointer-events: auto; max-width: 420px; text-align: center; background: rgba(19, 19, 27, 0.92); border: 1px solid var(--line2); border-radius: 16px; padding: 24px 22px; box-shadow: var(--shadow); }
.empty-card h2 { margin: 6px 0 6px; font-size: 18px; }
.empty-card p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.empty-card .ico { width: 46px; height: 46px; border-radius: 14px; background: var(--pri-soft); color: var(--pri-h); display: inline-flex; align-items: center; justify-content: center; }
.empty-card .ico svg { width: 24px; height: 24px; }
.empty-card .small { font-size: 12px; color: var(--dim); margin-top: 12px; }
.transport {
  flex: none; height: 46px; display: flex; align-items: center; justify-content: center; gap: 4px;
  border-top: 1px solid var(--line); background: var(--panel); padding: 0 10px; position: relative;
}
.transport .time { position: absolute; left: 12px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.transport .time b { color: var(--text); font-weight: 700; }
.transport .right { position: absolute; right: 10px; display: flex; gap: 2px; }
.play { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: #0c0c11; border: 0; display: inline-flex; align-items: center; justify-content: center; margin: 0 6px; }
.play:hover { background: #fff; }
.play svg { width: 18px; height: 18px; }
.audio-blocked { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; }

/* ------------------------------------------------------- Inspektor (rechts) */
.insp { grid-area: insp; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.insp-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; height: 46px; border-bottom: 1px solid var(--line); }
.insp-head h2 { flex: 1; margin: 0; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-head .kind { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--acc); }
.insp-body { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.insp-empty { color: var(--dim); font-size: 12.5px; }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }
kbd { display: inline-block; min-width: 22px; text-align: center; font: 700 11px "Inter", sans-serif; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--panel2); color: var(--text); }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.filters button { border: 1px solid var(--line2); background: var(--panel2); border-radius: var(--r-sm); padding: 0; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 700; }
.filters button canvas { display: block; width: 100%; aspect-ratio: 16 / 10; background: #222; }
.filters button span { display: block; padding: 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters button.on { border-color: var(--acc); color: var(--text); }
.trans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.trans-grid button { border: 1px solid var(--line2); background: var(--panel2); border-radius: var(--r-sm); padding: 9px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.trans-grid button.on { border-color: var(--acc); color: var(--text); background: rgba(255, 181, 71, 0.08); }
.pos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pos-grid button { border: 1px solid var(--line2); background: var(--panel2); border-radius: var(--r-sm); padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pos-grid button.on { border-color: var(--acc); color: var(--text); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line2); padding: 0; }
.swatches button.on { border-color: var(--acc); }

/* ----------------------------------------------------------- Zeitleiste */
.tl { grid-area: tl; display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-top: 1px solid var(--line); position: relative; }
.tl-resize { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; z-index: 2; touch-action: none; }
.tl-resize:hover, .tl-resize.on { background: linear-gradient(transparent 3px, var(--pri) 3px, var(--pri) 5px, transparent 5px); }
.tl-bar { flex: none; display: flex; align-items: center; gap: 2px; height: 42px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tl-bar::-webkit-scrollbar { display: none; }
.tl-bar .div { width: 1px; height: 22px; background: var(--line2); margin: 0 6px; flex: none; }
.tl-bar .lbl-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-weight: 700; font-size: 12.5px; white-space: nowrap; flex: none; }
.tl-bar .lbl-btn:hover { background: var(--panel2); color: var(--text); }
.tl-bar .lbl-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.tl-bar .grow { flex: 1; }
.tl-wrap { flex: 1; min-height: 0; position: relative; }
.tl-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------- Mobile Nav */
.mnav { display: none; }

/* -------------------------------------------------------------- Dialoge */
dialog {
  border: 1px solid var(--line2); border-radius: 16px; padding: 0;
  background: var(--panel); color: var(--text);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(5, 5, 9, 0.7); backdrop-filter: blur(2px); }
dialog[open] { display: flex; flex-direction: column; animation: pop 0.16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); flex: none; }
.dlg-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 800; }
.dlg-body { padding: 16px 18px; overflow: auto; flex: 1; min-height: 0; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.dlg-body p { margin: 0 0 12px; color: var(--muted); }
.dlg-body p strong { color: var(--text); }
dialog.wide { width: min(760px, calc(100vw - 24px)); }

/* Projekte */
.plist { display: grid; gap: 8px; }
.pcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--panel2); border: 1px solid transparent; }
.pcard.cur { border-color: var(--pri); }
.pcard .pn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pm { font-size: 12px; color: var(--dim); }
.pcard .pa { display: flex; gap: 4px; }

/* Export */
.exp-sum { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin-bottom: 14px; }
.exp-sum dt { color: var(--dim); }
.exp-sum dd { margin: 0; font-weight: 700; }
.exp-state { text-align: center; padding: 6px 0 4px; }
.exp-state .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.exp-state .small { font-size: 12.5px; color: var(--muted); }
.exp-done { text-align: center; }
.exp-done video { max-width: 100%; max-height: 40vh; border-radius: var(--r-sm); background: #000; margin-bottom: 12px; }
.ok-ico { width: 48px; height: 48px; border-radius: 50%; background: rgba(47, 191, 113, 0.15); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.ok-ico svg { width: 26px; height: 26px; }

/* Pro / Lizenz */
.pro-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.pro-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.pro-list li svg { color: var(--ok); margin-top: 1px; }
.price { font-size: 26px; font-weight: 800; }
.price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.key-input { font: 700 16px/1 "Inter", monospace; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; }

/* ------------------------------------------------------ Menüs & Toasts */
.menu {
  position: fixed; z-index: 60; min-width: 200px; max-width: calc(100vw - 16px);
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 5px;
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--text); text-decoration: none;
  padding: 8px 10px; border-radius: 6px; font-size: 13px;
}
.menu button:hover, .menu a:hover { background: var(--panel3); }
.menu button:disabled { opacity: 0.4; cursor: default; background: transparent; }
.menu button .k { margin-left: auto; color: var(--dim); font-size: 11.5px; }
.menu button.on::after { content: "✓"; margin-left: auto; color: var(--acc); font-weight: 800; }
.menu button.danger { color: var(--err); }
.menu hr { border: 0; height: 1px; background: var(--line2); margin: 5px 4px; }
.menu .mh { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-weight: 800; padding: 6px 10px 3px; }
.toasts { position: fixed; left: 50%; bottom: calc(var(--tl-h) + 14px); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  background: #23232f; border: 1px solid var(--line2); color: var(--text);
  padding: 10px 14px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 13px;
  animation: pop 0.16s ease-out;
}
.toast.err { border-color: rgba(255, 93, 110, 0.6); }
.toast.ok { border-color: rgba(47, 191, 113, 0.5); }
.toast button { border: 0; background: transparent; color: var(--acc); font-weight: 700; padding: 0; }
.drop-ov { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(12, 12, 17, 0.82); pointer-events: none; }
.drop-ov > div { border: 2px dashed var(--pri); border-radius: 20px; padding: 40px 50px; font-size: 18px; font-weight: 800; background: var(--pri-soft); text-align: center; }
.drop-ov small { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--muted); }
.busy { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(12, 12, 17, 0.6); }
.busy > div { background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px 20px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line2); border-top-color: var(--pri); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--muted); }
.boot svg { width: 48px; height: 48px; }
.boot[hidden] { display: none !important; }
.noscript { position: fixed; inset: 0; z-index: 101; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }

/* ----------------------------------------------------------- Scrollbalken */
.panes, .insp-body, .dlg-body { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.panes::-webkit-scrollbar, .insp-body::-webkit-scrollbar, .dlg-body::-webkit-scrollbar { width: 8px; }
.panes::-webkit-scrollbar-thumb, .insp-body::-webkit-scrollbar-thumb, .dlg-body::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }

/* ==================================================== Mobil (unter 900 px) */
@media (max-width: 899px) {
  :root { --top-h: 50px; --tl-h: 210px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--top-h) minmax(0, 1fr) var(--tl-h) calc(var(--nav-h) + var(--safe-b));
    grid-template-areas: "top" "stage" "tl" "nav";
  }
  .top { gap: 4px; padding: 0 6px; }
  .brand span, .save-state span, .top .d-only { display: none; }
  .proj-name { flex: 1 1 auto; width: auto; }
  .btn.export-btn { padding: 0 12px; }
  #btnInstall { width: 38px; padding: 0; }
  #btnInstall span { display: none; }
  .viewer { padding: 8px; }
  .transport { height: 44px; }
  .transport .time { font-size: 11.5px; left: 8px; }
  .transport .right .d-only { display: none; }
  .tl-bar { height: 40px; padding: 0 4px; }
  .tl-bar .lbl-btn { padding: 0 8px; }
  .tl-bar .lbl-btn .t { display: none; }
  .tl-resize { display: none; }

  .mnav {
    grid-area: nav; display: flex; background: var(--panel); border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b); z-index: 41;
  }
  .mnav button {
    flex: 1; min-width: 0; border: 0; background: transparent; color: var(--dim);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 10.5px; font-weight: 700; padding: 6px 2px;
  }
  .mnav button svg { width: 21px; height: 21px; }
  .mnav button.on { color: var(--text); }
  .mnav button.on svg { color: var(--pri-h); }

  /* Seitenleiste + Inspektor als Bottom-Sheets */
  .side, .insp {
    position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 40;
    max-height: min(64dvh, calc(100dvh - var(--nav-h) - 110px)); height: auto;
    border: 1px solid var(--line2); border-bottom: 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(calc(100% + var(--nav-h) + 20px)); visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .side.open, .insp.open { transform: none; visibility: visible; transition: transform 0.22s ease, visibility 0s; }
  .side .tabs { display: none; }
  .sheet-head {
    display: flex; align-items: center; gap: 8px; height: 46px; flex: none;
    padding: 0 6px 0 16px; border-bottom: 1px solid var(--line); position: relative;
  }
  .sheet-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; border-radius: 4px; background: var(--line2); transform: translateX(-50%); }
  .sheet-head h2 { flex: 1; margin: 0; font-size: 14px; font-weight: 800; }
  .insp-head { height: 46px; position: relative; }
  .insp-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; border-radius: 4px; background: var(--line2); transform: translateX(-50%); }
  .panes, .insp-body { overflow: auto; -webkit-overflow-scrolling: touch; }
  .pane { padding: 12px 14px 18px; }
  .toasts { bottom: calc(var(--tl-h) + var(--nav-h) + var(--safe-b) + 12px); }
  dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .dlg-body { padding: 14px; }
  .dlg-foot { padding: 10px 14px 14px; }
  .dlg-foot .btn { flex: 1 1 auto; }
  .ib { width: 38px; height: 38px; }
  .mitem { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .mthumb { width: 56px; height: 34px; }
}
@media (min-width: 900px) {
  .insp-head .ib.m-only, .m-only { display: none !important; }
}
@media (max-width: 899px) and (max-height: 640px) {
  :root { --tl-h: 170px; --nav-h: 52px; }
}
@media (max-width: 519px) {
  .btn.export-btn { padding: 0 11px; }
  .btn.export-btn .t, .pro-badge .pro-x { display: none; }
}
@media (max-width: 399px) {
  #btnInstall { display: none; }
}
@media (max-width: 380px) {
  .top .ib { width: 34px; }
}
@media (max-width: 349px) {
  .top .brand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Auto-Untertitel: Pro-Hinweis nur, solange nicht freigeschaltet */
.box.pro:not(.locked) .tag-pro { display: none; }

