/* MeinVoice – Stylesheet */
:root {
    --bg: #0d1020;
    --bg-2: #12162b;
    --panel: #171c35;
    --panel-2: #1e2442;
    --line: #2a3156;
    --line-2: #363e6a;
    --text: #e8eaf6;
    --muted: #9aa0c3;
    --primary: #7c6cff;
    --primary-2: #9b8cff;
    --primary-soft: rgba(124, 108, 255, .16);
    --accent: #2ed3b7;
    --danger: #ff5d6c;
    --warn: #ffb547;
    --ok: #36d399;
    --voice: #7c6cff;
    --music: #2ec4b6;
    --sfx: #ffb547;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f6fb; --bg-2: #eceef8; --panel: #ffffff; --panel-2: #f3f4fb; --line: #dfe2f0; --line-2: #cdd2ea;
        --text: #1b1e33; --muted: #646a8c; --primary-soft: rgba(124, 108, 255, .12); --shadow: 0 10px 30px rgba(30, 35, 80, .12);
        color-scheme: light;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
    min-height: 100vh; display: flex; flex-direction: column;
    background-image: radial-gradient(1200px 500px at 85% -10%, rgba(124, 108, 255, .14), transparent 60%), radial-gradient(900px 400px at -10% 10%, rgba(46, 211, 183, .07), transparent 60%);
    background-attachment: fixed;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
code { background: var(--panel-2); padding: .1em .4em; border-radius: 5px; font-size: .9em; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 20px;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.08rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo-mark {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 4px 14px rgba(124, 108, 255, .4);
}
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.mainnav a { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.mainnav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.mainnav a.active { color: var(--text); background: var(--primary-soft); }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary), #c86cff);
}

.dropdown { position: relative; }
.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px; z-index: 80; padding: 6px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.dropdown-menu.right { left: auto; right: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none;
    color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--panel-2); text-decoration: none; }
.dropdown-menu form { margin: 0; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-head small { display: block; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px;
    border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
    cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #6a5af0); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(124, 108, 255, .3); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-2), var(--primary)); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel); border-color: var(--line); }
.btn-danger { background: rgba(255, 93, 108, .12); border-color: rgba(255, 93, 108, .4); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-rec { background: var(--danger); border-color: transparent; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: .78rem; border-radius: 6px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.btn-row.center { justify-content: center; }
.btn-col { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.btn-col .btn { justify-content: flex-start; }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent;
    color: var(--muted); cursor: pointer; font-size: 15px; text-decoration: none !important;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 12px; }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.accent { color: var(--primary-2); font-weight: 700; font-size: 18px; }

/* ---------- Layout ---------- */
.main { flex: 1; width: 100%; }
.page { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }
.page.narrow { max-width: 820px; }
.page.narrow-wide { max-width: 980px; }
.page.center { text-align: center; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .2em; display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card > h2:first-child { margin-top: 0; }
.danger-zone { border-color: rgba(255, 93, 108, .35); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.align-start { align-items: start; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-between.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.toolbar .search { max-width: 320px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 22px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.footer-links { display: flex; gap: 16px; }
.footer a { color: var(--muted); }

/* ---------- Formulare ---------- */
.form label, label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .9rem; color: var(--text); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { margin: 10px 0 0; }
.label { font-weight: 500; font-size: .9rem; margin: 0; }
.label-like { display: flex; flex-direction: column; gap: 6px; }
input, select, textarea {
    width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
    font: inherit; font-size: .93rem; font-weight: 400; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
select[multiple] { padding: 6px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--primary); box-shadow: none; height: 22px; }
input[type=file] { padding: 8px; }
output { color: var(--muted); font-weight: 400; font-size: .85rem; }
label output { display: inline; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; cursor: pointer; }
.input-xs { width: 70px; padding: 4px 8px; display: inline-block; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; flex-direction: row; }
.inline-form label { flex: 1; min-width: 180px; }
.inline-form.tight { gap: 6px; align-items: center; flex-wrap: nowrap; }
.inline-form.tight input, .inline-form.tight select { padding: 6px 8px; min-width: 0; }
.hint { color: var(--muted); margin: 4px 0; }
.code { font-family: ui-monospace, monospace; font-size: .8rem; }
.title-input { font-size: 1.5rem; font-weight: 700; background: transparent; border-color: transparent; padding: 4px 8px; margin-left: -8px; }
.title-input:hover { border-color: var(--line); }
.pad-top { padding-top: 26px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; justify-content: flex-end; }

/* ---------- Meldungen ---------- */
.flash-stack { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
.flash-stack .alert { margin-top: 16px; }
.alert { position: relative; padding: 12px 40px 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); margin: 0 0 16px; transition: opacity .4s; }
.alert.fade { opacity: 0; }
.alert-error { border-color: rgba(255, 93, 108, .5); background: rgba(255, 93, 108, .1); }
.alert-success { border-color: rgba(54, 211, 153, .5); background: rgba(54, 211, 153, .1); }
.alert-info { border-color: rgba(124, 108, 255, .45); background: var(--primary-soft); }
.alert-close { position: absolute; right: 8px; top: 7px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: toastIn .25s ease; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-success { border-left: 4px solid var(--ok); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.progress { position: relative; height: 26px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin: 10px 0; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .2s; opacity: .55; }
.progress span { position: relative; display: block; text-align: center; font-size: .8rem; line-height: 24px; }
.progress.indeterminate i { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { left: -35%; } 100% { left: 100%; } }
.meter { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .76rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.badge-active { color: var(--ok); border-color: rgba(54, 211, 153, .4); }
.badge-pending { color: var(--warn); border-color: rgba(255, 181, 71, .4); }
.badge-disabled { color: var(--danger); border-color: rgba(255, 93, 108, .4); }

/* ---------- Tabellen & Listen ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 6px 4px; }
.card .table th, .card .table td { padding-left: 4px; padding-right: 4px; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions form { display: inline; margin: 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); flex-wrap: wrap; }
.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.checklist li em { margin-left: auto; font-size: .78rem; color: var(--muted); font-style: normal; }
.checklist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.checklist .ok .dot { background: var(--ok); }
.checklist .fail .dot { background: var(--danger); }
.checklist .warn .dot { background: var(--warn); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty .ic { opacity: .6; margin-bottom: 10px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; margin-bottom: -1px; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.admin-nav { margin-bottom: 22px; overflow-x: auto; }

/* ---------- Dropzone ---------- */
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 26px; margin-bottom: 14px;
    border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.dropzone.small { flex-direction: row; padding: 12px; font-size: .88rem; }
.dropzone strong { color: var(--text); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 18, .62); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.modal-close { position: absolute; right: 12px; top: 10px; border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
body.modal-open { overflow: hidden; }

/* ---------- Startseite ---------- */
.hero { max-width: 1200px; margin: 0 auto; padding: 70px 20px 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); letter-spacing: -.025em; margin-bottom: .35em; background: linear-gradient(120deg, var(--text) 30%, var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; background: var(--primary-soft); color: var(--primary-2); font-weight: 600; font-size: .82rem; margin-bottom: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.fake-editor { position: relative; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); overflow: hidden; }
.fe-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.fe-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.fe-track { position: relative; height: 54px; margin-bottom: 10px; border-radius: 8px; background: var(--bg-2); }
.fe-track em { position: absolute; left: 10px; top: 4px; font-size: .7rem; color: var(--muted); font-style: normal; z-index: 1; }
.fe-clip { position: absolute; top: 16px; bottom: 6px; border-radius: 6px; background-size: 6px 100%; }
.fe-clip.c1 { left: 6%; width: 34%; background-color: rgba(124, 108, 255, .3); border: 1px solid var(--voice); background-image: repeating-linear-gradient(90deg, var(--voice) 0 2px, transparent 2px 5px); }
.fe-clip.c2 { left: 46%; width: 40%; background-color: rgba(124, 108, 255, .3); border: 1px solid var(--voice); background-image: repeating-linear-gradient(90deg, var(--voice) 0 2px, transparent 2px 6px); }
.fe-clip.c3 { left: 2%; width: 94%; background-color: rgba(46, 196, 182, .22); border: 1px solid var(--music); background-image: repeating-linear-gradient(90deg, var(--music) 0 1px, transparent 1px 4px); }
.fe-clip.c4 { left: 30%; width: 10%; background-color: rgba(255, 181, 71, .25); border: 1px solid var(--sfx); }
.fe-clip.c5 { left: 80%; width: 12%; background-color: rgba(255, 181, 71, .25); border: 1px solid var(--sfx); }
.fe-playhead { position: absolute; top: 40px; bottom: 10px; left: 42%; width: 2px; background: #ff4f8b; animation: ph 6s linear infinite; }
@keyframes ph { from { left: 5%; } to { left: 95%; } }
.section { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.section-title { font-size: 1.6rem; text-align: center; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 28px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.feature h3 { margin: 12px 0 6px; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.feature-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-2); flex-shrink: 0; }
.feature-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.feature-icon.inline { width: 38px; height: 38px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.tool-card small { color: var(--muted); }

/* ---------- Dashboard ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.stat span { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 1.5rem; }
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 30px; }
.quick { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.quick:hover { border-color: var(--primary); text-decoration: none; }
.quick .ic { color: var(--primary-2); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: border-color .15s; }
.project-card:hover { border-color: var(--line-2); }
.project-thumb { display: block; height: 96px; background: linear-gradient(135deg, rgba(124, 108, 255, .25), rgba(46, 211, 183, .15)); position: relative; }
.pt-wave { position: absolute; inset: 26px 18px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 6px); -webkit-mask: linear-gradient(90deg, #000 0 100%), radial-gradient(ellipse at center, #000 30%, transparent 70%); mask-image: radial-gradient(ellipse 60% 100% at 50% 50%, #000 40%, transparent 75%); }
.project-body { padding: 12px 14px 4px; }
.project-title { display: block; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-actions { display: flex; gap: 2px; padding: 4px 8px 8px; justify-content: flex-end; }
.project-actions form { margin: 0; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.template input { position: absolute; opacity: 0; }
.template span { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; height: 100%; }
.template span .ic { color: var(--primary-2); }
.template small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.template input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.storage-box { min-width: 220px; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sound { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.sound > div { flex: 1; min-width: 0; }
.sound strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Auth ---------- */
.auth-page { display: grid; place-items: center; min-height: calc(100vh - 200px); }
.auth-card { width: min(420px, 100%); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: .9rem; }
.display { font-size: 4rem; margin: 0; background: linear-gradient(120deg, var(--primary-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- TTS / Aufnahme / STT ---------- */
.tts-panel textarea { min-height: 150px; }
.tts-panel.compact textarea { min-height: 110px; }
.tts-panel > * + * { margin-top: 10px; }
.tts-panel .grid-3 { margin-top: 12px; }
.tts-result, .rec-result { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.tts-result audio, .rec-result audio, .stt-source audio { width: 100%; margin-bottom: 6px; }
.rec-result label { margin: 8px 0; }
.rec-options { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; }
.rec-stage { position: relative; margin: 14px 0; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); padding: 14px; text-align: center; }
.rec-stage canvas { width: 100%; height: 80px; display: block; color: var(--primary); }
.rec-time { font-family: ui-monospace, monospace; font-size: 2rem; font-weight: 700; margin-top: 6px; }
.rec-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; font-weight: 800; background: rgba(13, 16, 32, .75); border-radius: 12px; color: #fff; }
.rec-panel.recording .rec-time { color: var(--danger); }
.rec-panel.recording .rec-stage { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 93, 108, .15); }
.rec-panel.compact .rec-time { font-size: 1.4rem; }
.rec-panel.compact .rec-options { flex-direction: column; gap: 6px; }
.stt-source { margin-bottom: 14px; }
.seg-options { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 4px 0 14px; color: var(--muted); }
.seg-options label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.segments { display: flex; flex-direction: column; gap: 6px; max-height: 65vh; overflow-y: auto; padding-right: 4px; }
.seg { display: grid; grid-template-columns: 250px 1fr auto; gap: 10px; align-items: start; padding: 8px; border-radius: 10px; border: 1px solid transparent; transition: background .15s; }
.seg:hover { background: var(--bg-2); }
.seg.current { background: var(--primary-soft); border-color: rgba(124, 108, 255, .4); }
.seg-times { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.seg-time { width: 88px; padding: 6px; font-family: ui-monospace, monospace; font-size: .8rem; text-align: center; }
.seg-text { min-height: 36px; padding: 7px 10px; resize: none; overflow: hidden; }
.seg-actions { display: flex; gap: 2px; }
.wave-canvas { width: 100%; height: 120px; display: block; background: var(--bg-2); border-radius: 10px; color: var(--primary); margin: 14px 0 6px; }

/* ---------- Editor ---------- */
body.is-editor { height: 100vh; overflow: hidden; }
body.is-editor .main { display: flex; flex-direction: column; min-height: 0; }
.editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; }
.ed-title { width: 240px; font-weight: 700; background: transparent; border-color: transparent; padding: 6px 8px; }
.ed-title:hover { border-color: var(--line); }
.ed-status { font-size: .78rem; color: var(--muted); min-width: 70px; }
.ed-status[data-state=unsaved] { color: var(--warn); }
.ed-status[data-state=save_failed] { color: var(--danger); }
.ed-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.ed-grow { flex: 1; }
.ed-transport { display: flex; align-items: center; gap: 6px; }
.play-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--primary), #6a5af0); box-shadow: 0 4px 14px rgba(124, 108, 255, .4); }
.play-btn.busy { opacity: .6; }
.ed-time { font-family: ui-monospace, monospace; font-size: 1rem; font-weight: 700; min-width: 64px; }
.ed-time.muted { font-size: .85rem; font-weight: 400; }
.snap-toggle { flex-direction: row !important; align-items: center; gap: 5px !important; font-size: .8rem !important; color: var(--muted) !important; cursor: pointer; padding: 0 4px; }
.ed-body { flex: 1; display: grid; grid-template-columns: 300px 1fr 250px; min-height: 0; }
.ed-side { border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ed-side .tabs { margin: 0; padding: 0 6px; flex-shrink: 0; }
.ed-side .tab { flex: 1; flex-direction: column; gap: 2px; padding: 9px 4px; font-size: .74rem; }
.ed-side .tab-pane { padding: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.ed-side .tab-pane.active { display: flex; flex-direction: column; gap: 10px; }
.ed-side .dropzone { margin: 0; }
.media-list { display: flex; flex-direction: column; gap: 4px; }
.media-item { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: grab; }
.media-item:hover { border-color: var(--line-2); }
.mi-text { flex: 1; min-width: 0; }
.mi-text strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-text small { display: block; font-size: .73rem; color: var(--muted); }
.ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-toolbar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.master-vol { flex-direction: row !important; align-items: center; gap: 6px !important; }
.master-vol input { width: 110px; }
.ed-hint { padding: 6px 12px; border-top: 1px solid var(--line); }
.tl-scroll { flex: 1; overflow: auto; position: relative; min-height: 0; background: var(--bg); }
.tl-inner { position: relative; min-height: 100%; }
.tl-ruler-row { position: sticky; top: 0; z-index: 10; display: flex; height: 28px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.tl-corner { position: sticky; left: 0; z-index: 11; width: 190px; flex-shrink: 0; background: var(--bg-2); border-right: 1px solid var(--line); font-size: .72rem; color: var(--muted); padding: 6px 12px; text-transform: uppercase; letter-spacing: .05em; }
.tl-ruler { position: sticky; left: 190px; height: 28px; display: block; color: var(--muted); cursor: pointer; }
.tl-row { display: flex; height: 76px; border-bottom: 1px solid var(--line); }
.tl-head { position: sticky; left: 0; z-index: 9; width: 190px; flex-shrink: 0; padding: 6px 8px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; border-left: 3px solid var(--voice); }
.tl-row.type-music .tl-head { border-left-color: var(--music); }
.tl-row.type-sfx .tl-head { border-left-color: var(--sfx); }
.tl-row.sel-track .tl-head { background: var(--panel-2); }
.th-top, .th-mid { display: flex; gap: 3px; align-items: center; }
.th-name { padding: 2px 6px; font-size: .82rem; font-weight: 600; background: transparent; border-color: transparent; }
.th-name:hover, .th-name:focus { border-color: var(--line-2); }
.th-type { padding: 1px 4px; font-size: .72rem; width: auto; flex: 1; }
.th-btn { width: 22px; height: 22px; padding: 0; border-radius: 5px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-size: .7rem; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.th-btn:hover { color: var(--text); }
.th-btn.on { background: var(--warn); color: #222; border-color: transparent; }
.th-btn.danger { border-color: transparent; background: none; font-size: 1rem; }
.th-btn.danger:hover { color: var(--danger); }
.th-vol { height: 14px; }
.tl-lane { position: relative; flex: 1; }
.tl-lane.drop-target { background: var(--primary-soft); }
.tl-row.inactive .tl-lane { opacity: .4; }
.tl-empty { padding: 30px; text-align: center; color: var(--muted); }
.clip {
    position: absolute; top: 5px; bottom: 5px; border-radius: 7px; overflow: hidden; cursor: grab; touch-action: none; user-select: none;
    background: rgba(124, 108, 255, .22); border: 1px solid rgba(124, 108, 255, .7); color: var(--voice);
}
.type-music .clip { background: rgba(46, 196, 182, .18); border-color: rgba(46, 196, 182, .7); color: var(--music); }
.type-sfx .clip { background: rgba(255, 181, 71, .18); border-color: rgba(255, 181, 71, .7); color: var(--sfx); }
.clip.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); z-index: 2; }
.clip.missing { background: repeating-linear-gradient(45deg, rgba(255, 93, 108, .15) 0 8px, transparent 8px 16px); border-color: var(--danger); }
.clip-wave { position: absolute; left: 0; top: 16px; bottom: 0; width: 100%; height: calc(100% - 16px); color: inherit; opacity: .9; }
.clip-label { position: absolute; left: 6px; top: 1px; right: 6px; font-size: .72rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.clip-label em { font-style: normal; color: var(--muted); font-weight: 400; }
.clip .fade-in, .clip .fade-out { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.clip .fade-in { left: 0; background: linear-gradient(to top right, rgba(0, 0, 0, .35) 50%, transparent 50%); }
.clip .fade-out { right: 0; background: linear-gradient(to top left, rgba(0, 0, 0, .35) 50%, transparent 50%); }
.handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 3; }
.handle.hl { left: 0; }
.handle.hr { right: 0; }
.handle:hover, .clip.selected .handle { background: rgba(255, 255, 255, .18); }
.tl-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: #ff4f8b; z-index: 8; pointer-events: none; will-change: transform; }
.tl-playhead span { position: absolute; top: 0; left: -6px; border: 7px solid transparent; border-top: 9px solid #ff4f8b; }
.tl-drop-new { margin: 10px 10px 10px 200px; padding: 14px; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: .85rem; text-align: center; position: sticky; left: 0; max-width: 600px; }
.tl-drop-new.over { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }
.ed-inspector { border-left: 1px solid var(--line); background: var(--bg-2); padding: 14px; overflow-y: auto; }
.insp-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.insp-empty .ic { opacity: .5; }
.insp-body { display: flex; flex-direction: column; gap: 12px; }
.insp-body h3 { margin: 0; }
.insp-body label { font-size: .82rem; }
.insp-body .grid-2 { gap: 8px; }
.insp-body input[type=number] { padding: 6px 8px; }

/* ---------- Installer ---------- */
body.install { align-items: center; }
.install-wrap { width: min(760px, 100%); padding: 40px 20px; }
.install-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.install-brand .logo-mark { width: 44px; height: 44px; border-radius: 13px; }
.install-brand strong { display: block; font-size: 1.3rem; }
.install-brand small { color: var(--muted); }
.install-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.install-steps li { padding: 6px 12px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.install-steps li.active { color: #fff; background: var(--primary); border-color: transparent; }
.install-steps li.done { color: var(--ok); }
.install .card h2 { font-size: 1rem; margin-top: 12px; color: var(--primary-2); }
.install textarea.code { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .ed-body { grid-template-columns: 260px 1fr; }
    .ed-inspector { position: fixed; right: 10px; bottom: 10px; width: 260px; max-height: 60vh; z-index: 40; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); }
    .ed-inspector .insp-empty { display: none; }
    .ed-inspector:has(.insp-body[hidden]) { display: none; }
    .hide-sm { display: none; }
}
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding-top: 40px; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .nav-toggle { display: block; }
    .mainnav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; padding: 10px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
    body.nav-open .mainnav { display: flex; }
    .seg { grid-template-columns: 1fr auto; }
    .seg-text { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
    body.is-editor { height: auto; overflow: auto; }
    .ed-body { grid-template-columns: 1fr; }
    .ed-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; }
    .tl-scroll { min-height: 50vh; }
    .ed-title { width: 140px; }
    .ed-sep { display: none; }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .feature-grid { grid-template-columns: 1fr; }
    .page { padding: 22px 16px 50px; }
    .topbar { padding: 0 12px; gap: 10px; }
    .brand span:last-child { display: none; }
    .card { padding: 16px; }
    .inline-form.tight { flex-wrap: wrap; }
}
