:root {
  --paper: #f7f4ee; --paper-2: #efeae0; --surface: #fffdf9; --ink: #0e1a2b; --ink-2: #33415a; --ink-3: #56617a;
  --line: #ddd5c6; --accent: #0b6b70; --accent-strong: #08545a; --accent-tint: #edf5f3; --ochre: #8a520f; --ochre-soft: #f5e6cc; --error: #a3271f;
  --r: 14px; --shadow: 0 1px 2px rgba(14, 26, 43, 0.06), 0 8px 24px -12px rgba(14, 26, 43, 0.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-strong); }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--ghost { background: none; border-color: transparent; }
.btn--danger { color: var(--error); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
:focus-visible { outline: 3px solid rgba(11, 107, 112, 0.45); outline-offset: 2px; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: rgba(247, 244, 238, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.wm { font-weight: 750; letter-spacing: -0.02em; font-size: 18px; text-decoration: none; color: var(--ink); }
.wm b { color: var(--accent); }
.top .tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 3px 8px; border-radius: 6px; background: var(--paper-2); }
.top nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
main { max-width: 1320px; margin: 0 auto; padding: 32px 24px 80px; }
.h1 { font-size: 28px; font-weight: 720; letter-spacing: -0.02em; }
.sec { margin-top: 40px; }
.sec__h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sec__h h2 { font-size: 19px; font-weight: 700; }

/* Karten */
.grid3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.thumb { display: block; position: relative; aspect-ratio: 4 / 5; background: var(--paper-2); overflow: hidden; }
.thumb iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1350px; border: 0; transform-origin: 0 0; pointer-events: none; }
.card__b { padding: 14px 16px 16px; display: grid; gap: 4px; }
.card__b h3 { font-size: 17px; }
.card__b .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Dateien */
.drop { display: grid; place-items: center; gap: 6px; padding: 26px; border: 2px dashed var(--line); border-radius: var(--r); background: var(--surface); text-align: center; cursor: pointer; }
.drop.is-over { border-color: var(--accent); background: var(--accent-tint); }
.files { margin-top: 16px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.file video { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: #111; }
.file .card__b { gap: 2px; }
.file .name { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.prog { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; margin-top: 8px; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); }

/* Editor */
.ed { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .ed { grid-template-columns: minmax(360px, 520px) minmax(0, 1fr); align-items: start; } .ed__pv { position: sticky; top: 80px; } }
.pv { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: #111; box-shadow: var(--shadow); }
.pv iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1350px; border: 0; transform-origin: 0 0; }
.pv iframe.is-next { visibility: hidden; }
.ctl { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ctl input[type='range'] { flex: 1; accent-color: var(--accent); }
.ctl .time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-3); min-width: 76px; text-align: right; }
.pv-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.bar2 { position: sticky; top: 64px; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.bar2 .status { margin-right: auto; font-size: 14px; font-weight: 600; }
.status.is-dirty { color: var(--ochre); }
.status.is-ok { color: var(--accent-strong); }
.help { padding: 14px 16px; border-radius: 12px; background: var(--accent-tint); border: 1px solid #cfe3e0; font-size: 13.5px; color: var(--ink-2); margin-bottom: 20px; }
.help code { background: #fff; border: 1px solid #cfe3e0; padding: 0 5px; border-radius: 5px; font-size: 12.5px; }
.grp { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.grp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 700; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary .n { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.grp > summary .n.is-dirty { color: var(--ochre); }
.grp__b { padding: 0 16px 16px; display: grid; gap: 14px; }
.fld { display: grid; gap: 5px; }
.fld__h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fld label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.fld__h .acts { display: flex; gap: 10px; font-size: 12.5px; }
.fld__h .acts button { border: 0; background: none; padding: 0; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fld input, .fld textarea { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: #fff; line-height: 1.45; }
.fld textarea { resize: vertical; min-height: 70px; }
.fld input:focus, .fld textarea:focus { border-color: var(--accent); outline: 3px solid rgba(11, 107, 112, 0.18); }
.fld.is-changed input, .fld.is-changed textarea { border-color: #d9b47a; background: #fffaf1; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.5); z-index: 200; }
.toast.is-err { background: var(--error); }

/* Aufnahme: Vorschau füllt das Fenster */
body.rec .top, body.rec .ed__form, body.rec .ctl, body.rec .pv-actions, body.rec .ed__h { visibility: hidden; }
body.rec .ed__pv { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: #000; }
body.rec .pv { border-radius: 0; box-shadow: none; }
.rec-info { position: fixed; left: 16px; bottom: 16px; z-index: 160; padding: 8px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; display: none; }
body.rec .rec-info { display: block; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: min(380px, 100%); display: grid; gap: 14px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.login h1 { font-size: 22px; }
.login input { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.login .err { color: var(--error); font-size: 14px; min-height: 1.4em; }

/* Speicherort der aktuellen Fassung */
.pfad { display: grid; gap: 4px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-tint); border: 1px solid #cfe3e0; font-size: 13px; }
.pfad b { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-strong); }
.pfad a { overflow-wrap: anywhere; font-weight: 600; }
.pfad code { font-size: 12px; overflow-wrap: anywhere; }
.pfad.is-warn { background: #fff6e8; border-color: #ecd3a8; }
.pfad.is-warn b { color: var(--ochre); }
.pfad__acts { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

/* Musik */
.mus { margin-bottom: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.mus__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mus__h h2 { font-size: 17px; }
.sw { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.sw input { width: 18px; height: 18px; accent-color: var(--accent); }
.mus__b { margin-top: 12px; display: grid; gap: 14px; }
.mus.is-off .mus__b { opacity: 0.55; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--ink-3); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mus__grid { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mus__grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.mus__grid select { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 500; }
.mus__grid input[type='range'] { accent-color: var(--accent); margin-top: 8px; }
#ton[aria-pressed='true'] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-strong); }
.pfad__lauf { font-weight: 650; color: var(--ochre); }
.pfad__lauf::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: currentColor; animation: puls 1.2s ease-in-out infinite; }
@keyframes puls { 50% { opacity: 0.25; } }
.fs { display: grid; gap: 6px; margin-top: 4px; }
.fs__k { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fs__k b { color: var(--ochre); white-space: nowrap; }
.fs__b { height: 10px; border-radius: 5px; background: rgba(14, 26, 43, 0.08); overflow: hidden; }
.fs__b i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #13a3a8); transition: width 0.8s ease; }
