/* WEBLIVE – Oberfläche */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --line: #e3e6ec;
  --line-2: #d4d8e0;
  --ink: #161b26;
  --ink-2: #4a5263;
  --ink-3: #7a8294;
  --accent: #0e6b62;
  --accent-2: #14a08f;
  --accent-soft: #e2f3f0;
  --accent-ink: #ffffff;
  --sel: #e6f2ff;
  --sel-line: #9cc6f5;
  --danger: #c2372b;
  --danger-soft: #fdecea;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --ok: #1d7a3e;
  --ok-soft: #e5f5ea;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
  --radius: 10px;
  --radius-sm: 7px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --top: 56px;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --surface: #161a22; --surface-2: #1b2029; --surface-3: #222833; --line: #272e3a; --line-2: #343c4a;
    --ink: #e8ebf1; --ink-2: #aeb5c3; --ink-3: #7d8596; --accent: #2bb3a1; --accent-2: #0e7c70; --accent-soft: #12302d;
    --sel: #16304d; --sel-line: #2f5f93; --danger: #ef6b5f; --danger-soft: #3a1d1b; --warn: #f0a640; --warn-soft: #382a14;
    --ok: #4cc47a; --ok-soft: #15301f; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 16px 40px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0f1218; --surface: #161a22; --surface-2: #1b2029; --surface-3: #222833; --line: #272e3a; --line-2: #343c4a;
    --ink: #e8ebf1; --ink-2: #aeb5c3; --ink-3: #7d8596; --accent: #2bb3a1; --accent-2: #0e7c70; --accent-soft: #12302d;
    --sel: #16304d; --sel-line: #2f5f93; --danger: #ef6b5f; --danger-soft: #3a1d1b; --warn: #f0a640; --warn-soft: #382a14;
    --ok: #4cc47a; --ok-soft: #15301f; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 16px 40px rgba(0,0,0,.55);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: var(--fs, 14px)/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 12.5px; margin: -4px 0 12px; }
.pad { padding: 16px; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 550; font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
label > input, label > select, label > textarea { margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--ink-3); font-weight: 400; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: .3em; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 560; font-size: 13.5px;
  padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; line-height: 1.3; text-decoration: none !important; user-select: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line-2)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.icon { padding: 7px; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 10px; font-size: 14.5px; }
.btn .i { width: 17px; height: 17px; }

.err { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 9px 11px; margin: 0 0 12px; font-weight: 500; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 9px 11px; margin: 0 0 12px; font-weight: 500; }
.okbox { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-sm); padding: 9px 11px; margin: 0 0 12px; font-weight: 500; }

/* ---------- Login / Setup ---------- */
.center-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
  radial-gradient(900px 400px at 110% 110%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 60%), var(--bg); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; }
.card.auth { width: 100%; max-width: 400px; padding: 28px; box-shadow: var(--shadow-lg); }
.card.narrow { max-width: 520px; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand b { display: block; font-size: 18px; letter-spacing: -.01em; }
.brand small { color: var(--ink-3); }
.logo { width: 38px; height: 38px; flex: none; }
.foot { margin: 18px 0 0; font-size: 12px; text-align: center; }

/* ---------- App-Gerüst ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.app { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: var(--top) 1fr; height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 20; }
.topbar .brand { margin: 0; gap: 10px; min-width: calc(var(--side) - 28px); }
.topbar .brand b { font-size: 15.5px; }
.topbar .logo { width: 30px; height: 30px; }
.search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 34px; background: var(--surface-2); border-color: var(--line); height: 36px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; }
.userbtn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 20px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.userbtn:hover { background: var(--surface-3); }
.geo-pill { font-size: 11.5px; color: var(--ink-3); padding: 3px 8px; border: 1px solid var(--line); border-radius: 20px; white-space: nowrap; }
.menu-toggle { display: none; }

.sidebar { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 8px 24px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 650; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 520; text-decoration: none; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a .cnt { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.tree { margin: 2px 0 4px; font-size: 13.5px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.tree > ul { padding-left: 2px; }
.tnode { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; cursor: pointer; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tnode:hover { background: var(--surface-3); }
.tnode.on { background: var(--sel); color: var(--ink); font-weight: 560; }
.tnode.drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.tnode .tw { width: 16px; height: 16px; display: grid; place-items: center; flex: none; color: var(--ink-3); border-radius: 4px; }
.tnode .tw .i { width: 13px; height: 13px; transition: transform .12s; }
.tnode .tw.open .i { transform: rotate(90deg); }
.tnode .fd { width: 15px; height: 15px; color: #d9a316; flex: none; }
.tnode span.n { overflow: hidden; text-overflow: ellipsis; }

.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; position: relative; }
.view { flex: 1; overflow: auto; padding: 18px 22px 40px; }
.view.files { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head .sp { flex: 1; }

/* ---------- Dateiansicht ---------- */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.toolbar .sp { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 2px; padding: 10px 16px 0; flex-wrap: wrap; min-height: 38px; }
.crumbs a { padding: 3px 7px; border-radius: 6px; color: var(--ink-2); font-weight: 540; }
.crumbs a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.crumbs a.last { color: var(--ink); font-weight: 650; }
.crumbs a.drop { outline: 2px dashed var(--accent); }
.crumbs .i { width: 14px; height: 14px; color: var(--ink-3); }
.subbar { display: flex; align-items: center; gap: 10px; padding: 6px 16px 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.subbar input { height: 30px; padding: 4px 9px; max-width: 220px; font-size: 13px; }
.subbar select { height: 30px; padding: 3px 8px; width: auto; font-size: 13px; }
.selbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--sel); border-bottom: 1px solid var(--sel-line); flex-wrap: wrap; }
.selbar b { margin-right: 6px; }
.clipbar { display: flex; align-items: center; gap: 10px; padding: 7px 16px; background: var(--warn-soft); color: var(--warn); font-weight: 520; font-size: 13px; }

.filearea { flex: 1; overflow: auto; position: relative; display: flex; }
.listwrap { flex: 1; overflow: auto; min-width: 0; }
.filearea.dragover::after { content: "Dateien hier ablegen zum Hochladen"; position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 85%, transparent); display: grid; place-items: center; font-weight: 650; color: var(--accent); font-size: 16px; z-index: 5; pointer-events: none; }
table.files { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.files th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
table.files th.on { color: var(--ink); }
table.files td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 13px; }
table.files tr { cursor: default; }
table.files tbody tr:hover td { background: var(--surface-2); }
table.files tr.sel td { background: var(--sel) !important; }
table.files tr.cut td { opacity: .55; }
table.files tr.drop td { background: var(--accent-soft) !important; box-shadow: inset 0 0 0 1px var(--accent); }
table.files td.nm { color: var(--ink); font-weight: 520; }
.c-chk { width: 38px; } .c-size { width: 100px; text-align: right !important; } .c-date { width: 150px; } .c-perm { width: 66px; } .c-act { width: 44px; }
td.c-size { text-align: right; font-variant-numeric: tabular-nums; }
.nmwrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nmwrap .n { overflow: hidden; text-overflow: ellipsis; }
.nmwrap .star { color: #e3a008; width: 14px; height: 14px; fill: #e3a008; flex: none; }
.lbl { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.lbl.red { background: #e5484d; } .lbl.orange { background: #f76b15; } .lbl.yellow { background: #e2b203; } .lbl.green { background: #30a46c; }
.lbl.blue { background: #3e8ce6; } .lbl.purple { background: #8e4ec6; } .lbl.gray { background: #8b8d98; }
.note-ico { color: var(--ink-3); }
input.rowchk { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; cursor: pointer; }

.ficon { width: 26px; height: 30px; flex: none; position: relative; display: inline-block; border-radius: 3px 8px 3px 3px; background: linear-gradient(135deg, #fff 0%, #f1f3f6 100%); border: 1px solid #cfd5df; }
.ficon::before { content: attr(data-ext); position: absolute; left: -3px; bottom: 4px; font: 700 7.5px/1 var(--font); text-transform: uppercase; color: #fff; background: #7a8294; padding: 2px 3px; border-radius: 2px; max-width: 30px; overflow: hidden; }
.ficon[data-ext=""]::before { display: none; }
.ficon.dir { width: 28px; height: 22px; border: 0; border-radius: 3px 3px 4px 4px; background: linear-gradient(180deg, #f6c445, #e9a91c); margin: 4px 0; }
.ficon.dir::before { content: ""; display: block; position: absolute; left: 0; top: -4px; width: 12px; height: 6px; border-radius: 3px 3px 0 0; background: #e9a91c; padding: 0; }
.ficon.code::before { background: #3e63dd; } .ficon.img::before { background: #12a594; } .ficon.arc::before { background: #e5484d; }
.ficon.doc::before { background: #d6409f; } .ficon.media::before { background: #8e4ec6; } .ficon.txt::before { background: #6b7280; } .ficon.data::before { background: #f76b15; }
:root[data-theme="dark"] .ficon { background: linear-gradient(135deg, #2a303b, #222833); border-color: #3a4250; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ficon { background: linear-gradient(135deg, #2a303b, #222833); border-color: #3a4250; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; padding: 14px 16px; }
.gitem { border: 1px solid transparent; border-radius: 10px; padding: 12px 8px 10px; text-align: center; cursor: default; position: relative; }
.gitem:hover { background: var(--surface-2); border-color: var(--line); }
.gitem.sel { background: var(--sel); border-color: var(--sel-line); }
.gitem.drop { background: var(--accent-soft); border-color: var(--accent); }
.gitem .thumb { height: 74px; display: grid; place-items: center; margin-bottom: 8px; }
.gitem .thumb img { max-width: 100%; max-height: 74px; border-radius: 5px; object-fit: cover; box-shadow: var(--shadow); }
.gitem .thumb .ficon { transform: scale(1.75); }
.gitem .thumb .ficon.dir { transform: scale(2); }
.gitem .gn { font-size: 12.5px; font-weight: 520; word-break: break-word; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gitem .gm { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.gitem .lbl { position: absolute; top: 8px; left: 8px; }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 40px; margin-bottom: 8px; opacity: .6; }

.details { width: 330px; flex: none; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 16px; }
.details .dprev { border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; min-height: 140px; margin-bottom: 14px; overflow: hidden; }
.details .dprev img { max-width: 100%; max-height: 260px; display: block; }
.details .dprev .ficon { transform: scale(2.2); margin: 30px; }
.details h3 { word-break: break-word; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 12.5px; margin: 10px 0 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; word-break: break-all; }
.dacts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.colors { display: flex; gap: 6px; margin: 6px 0 10px; flex-wrap: wrap; }
.colors button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.colors button.on { box-shadow: 0 0 0 2px var(--ink); }
.colors button.none { background: var(--surface); position: relative; }
.colors button.none::after { content: ""; position: absolute; left: 3px; right: 3px; top: 9px; height: 2px; background: var(--danger); transform: rotate(-45deg); }

.statusbar { display: flex; gap: 14px; padding: 6px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }

/* ---------- Kontextmenü / Dropdown ---------- */
.ctx { position: fixed; z-index: 1000; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop .1s ease-out; max-height: calc(100vh - 20px); overflow-y: auto; }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink); border-radius: 6px; cursor: pointer; text-align: left; }
.ctx button:hover, .ctx button:focus { background: var(--surface-3); outline: none; }
.ctx button.danger { color: var(--danger); }
.ctx button kbd { margin-left: auto; font: 11px var(--mono); color: var(--ink-3); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* ---------- Modale ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 14, 22, .48); z-index: 900; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.wide { max-width: 860px; }
.modal.xl { max-width: 1200px; height: calc(100vh - 32px); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; font-size: 16px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-b { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-f .sp { flex: 1; }
.pick-tree { border: 1px solid var(--line); border-radius: 8px; max-height: 340px; overflow: auto; padding: 6px; }
.pick-path { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 7px 10px; border-radius: 6px; margin: 10px 0 0; word-break: break-all; }

/* Vorschau */
.preview-b { flex: 1; display: grid; place-items: center; background: #11141a; overflow: auto; min-height: 300px; position: relative; }
.preview-b img { max-width: 100%; max-height: calc(100vh - 140px); }
.preview-b iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-b video, .preview-b audio { max-width: 100%; max-height: calc(100vh - 140px); }
.preview-b pre { margin: 0; padding: 16px; color: #e8ebf1; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; width: 100%; align-self: start; }
.preview-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.preview-nav.prev { left: 12px; } .preview-nav.next { right: 12px; }

/* Editor */
.editor { display: flex; flex-direction: column; height: 100%; }
.ed-bar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); }
.ed-bar .sp { flex: 1; }
.ed-bar .stat { font-size: 12px; color: var(--ink-3); }
.ed-find { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-find input { width: 200px; height: 30px; padding: 3px 8px; font-size: 13px; }
.ed-main { flex: 1; display: flex; min-height: 0; position: relative; background: var(--surface); }
.ed-gutter { width: 54px; flex: none; overflow: hidden; text-align: right; padding: 10px 8px 10px 0; color: var(--ink-3); font: 13px/1.55 var(--mono); background: var(--surface-2); border-right: 1px solid var(--line); user-select: none; white-space: pre; }
.ed-text { flex: 1; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; resize: none; padding: 10px 12px !important; font: 13px/1.55 var(--mono) !important; tab-size: 4; white-space: pre; overflow: auto; min-height: 0 !important; background: var(--surface) !important; }
.ed-text.wrap { white-space: pre-wrap; }
.ed-side { width: 280px; flex: none; border-left: 1px solid var(--line); overflow-y: auto; padding: 12px; background: var(--surface-2); }
.ed-foot { display: flex; gap: 16px; padding: 5px 12px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--surface-2); }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }

/* Tabellen (Verwaltung) */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.act { text-align: right; white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 20px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.acc { background: var(--accent-soft); color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.panel .desc { color: var(--ink-3); margin-top: -4px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 560; color: var(--ink-3); padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.check-list li:last-child { border-bottom: 0; }
.check-list .badge { min-width: 62px; text-align: center; }
.progress { height: 8px; background: var(--surface-3); border-radius: 8px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.logbox { background: #11141a; color: #cfd5e0; font: 12px/1.5 var(--mono); padding: 10px 12px; border-radius: 8px; max-height: 260px; overflow: auto; white-space: pre-wrap; margin-top: 10px; }
.qr { background: #fff; padding: 8px; border-radius: 10px; display: inline-block; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font: 15px var(--mono); background: var(--surface-3); padding: 12px; border-radius: 8px; margin: 10px 0; }
.kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font-size: 20px; }
.kpi span { font-size: 12px; color: var(--ink-3); }

/* Uploads & Toasts */
.uploads { position: fixed; right: 16px; bottom: 16px; width: 360px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 800; overflow: hidden; }
.uploads-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.uploads-h .sp { flex: 1; }
.uploads-l { max-height: 260px; overflow-y: auto; }
.up-item { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.up-item .t { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.up-item .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item.err { color: var(--danger); }
.up-item .progress { height: 5px; }
.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1d2330; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 90vw; pointer-events: auto; animation: pop .15s; }
.toast.err { background: var(--danger); }
.toast.ok { background: #1d7a3e; }

/* Freigabe-Seite (öffentlich) */
.wl-wrap { max-width: 860px; margin: 0 auto; padding: 28px 16px 40px; }
.wl-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.wl-head > div { flex: 1; min-width: 200px; }
.wl-head h1 { margin: 0; word-break: break-word; }
.wl-head p { margin: 2px 0 0; }
.fl-note { background: var(--surface); border-left: 3px solid var(--accent); padding: 8px 12px; margin-top: 10px !important; border-radius: 4px; }
.fl-crumbs { margin-bottom: 10px; color: var(--ink-3); }
.fl-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fl-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fl-row:last-child { border-bottom: 0; }
.fl-name { flex: 1; min-width: 0; word-break: break-word; font-weight: 530; }
.fl-name small { display: block; color: var(--ink-3); font-weight: 400; }
.fl-drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 14px; background: var(--surface); }
.fl-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.fl-foot { text-align: center; font-size: 12px; margin-top: 18px; }
.fl-msg { text-align: center; padding: 10px; }
.fl-ico { font-size: 44px; color: var(--ink-3); }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) { .details { display: none; } }
@media (max-width: 860px) {
  :root { --side: 270px; }
  .app { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(0,0,0,.35); z-index: 40; }
  .topbar .brand { min-width: 0; }
  .topbar .brand b, .geo-pill, .userbtn .uname { display: none; }
  .c-date, .c-perm { display: none; }
  .view { padding: 14px 14px 40px; }
  .toolbar { padding: 8px 10px; }
  .toolbar .lbl-txt { display: none; }
  table.files td { padding: 9px 8px; }
  .modal.xl { height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .modal-bg:has(.modal.xl) { padding: 0; }
  .ed-side { display: none; }
  .ed-gutter { width: 40px; }
}
@media (max-width: 520px) { .c-size { width: 76px; } .search input { font-size: 16px; } }
@media print { .sidebar, .topbar, .toolbar { display: none; } }
.toolbar.sticky { position: sticky; bottom: 0; margin: 16px -22px -40px; border-top: 1px solid var(--line); border-bottom: 0; z-index: 5; }
.dropov .card { pointer-events: none; text-align: center; border: 2px dashed var(--accent); }
.fab { display: none; }
@media (max-width: 860px) {
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: var(--shadow-lg); z-index: 60; }
  .fab .i { width: 26px; height: 26px; }
}

/* feste Höhe: kein Layout-Sprung beim Auswählen (Doppelklick bleibt treffsicher) */
.selbar { height: 46px; flex: none; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.selbar .btn, .selbar b { flex: none; }
.selbar.idle { background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }
.legal { font-size: 12px; margin: 10px 0 0; text-align: center; }
.legal a { color: inherit; text-decoration: underline; }
.legal-page h1 { margin-top: 0; } .legal-page h2 { font-size: 15px; margin: 16px 0 4px; } .legal-page p { margin: 0; line-height: 1.5; }

/* ---------- Dichte ---------- */
.dense .tbl td { padding-top: 4px; padding-bottom: 4px; } .dense .tbl th { padding-top: 5px; padding-bottom: 5px; } .dense .ficon { transform: scale(.85); }
.roomy .tbl td { padding-top: 13px; padding-bottom: 13px; }

/* ---------- Übersicht ---------- */
.dash { padding: 18px 20px 40px; max-width: 1200px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 10px 0 22px; }
.site-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.site-card h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; font-size: 14.5px; }
.site-card .meta { color: var(--ink-3); font-size: 12.5px; margin-bottom: 8px; }
.site-card.klein, .site-card.alt, .site-card.leer { border-color: var(--warn); background: var(--warn-soft); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin: 6px 0 10px; }
.spark i { display: block; flex: 1; background: var(--accent-2); opacity: .75; border-radius: 2px 2px 0 0; min-height: 2px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding: 6px 0 0; }
.bars div { flex: 1; text-align: center; font-size: 10px; color: var(--ink-3); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars b { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pal-bg { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); z-index: 200; display: flex; justify-content: center; padding-top: 12vh; }
.pal { width: min(640px, 94vw); max-height: 70vh; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; align-self: flex-start; }
.pal input.pq { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 16px; background: transparent; color: var(--ink); outline: 0; width: 100%; }
.pal .pf { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pal .pf select { width: auto; padding: 4px 8px; font-size: 12.5px; }
.pal .pr { overflow-y: auto; }
.pal .pi { padding: 8px 16px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.pal .pi:hover, .pal .pi.on { background: var(--accent-soft); }
.pal .pi small { color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.crumb-dd { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0 2px; }
.crumb-dd:hover { color: var(--ink); }
.bottomnav { display: none; }
@media (max-width: 720px) {
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; text-align: center; padding: 8px 2px 7px; font-size: 11px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
  .bottomnav a.on { color: var(--accent); }
  .main { padding-bottom: 64px; } .fab { bottom: 76px !important; }
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 4px 6px; background: var(--surface); min-height: 38px; }
.chips input { flex: 1; min-width: 160px; border: 0 !important; box-shadow: none !important; padding: 4px 2px; background: transparent; outline: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 13px; }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: inherit; padding: 0 5px; }
.field { margin: 0 0 12px; } .flabel { display: block; font-weight: 550; font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
.mailbox { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 8px; background: var(--surface-2); }
.mailbox textarea { width: 100%; }

.lasso { position: fixed; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); z-index: 90; pointer-events: none; }
.tbl td.err { color: var(--danger); font-weight: 600; }

/* v9 */
.pwmeter{margin:-4px 0 10px;font-size:.85rem}.pwbar{height:6px;background:var(--line,#ddd);border-radius:4px;overflow:hidden;margin-bottom:4px}.pwbar i{display:block;height:100%;width:0;transition:width .2s,background .2s}
.notes .note,.panel .note{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-bottom:1px solid var(--line,#e5e5e5)}.note .nb{flex:1;min-width:0}.note .nb b{margin-right:6px}.note.overdue .nb b{color:var(--danger,#c0392b)}.note.isdone .nb{opacity:.55;text-decoration:line-through}
.btn.danger{background:var(--danger,#c0392b);color:#fff;border-color:transparent}
input[type=month]{font:inherit;padding:5px 8px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);width:auto}

/* =====================================================================
   v10 – Designs: apple · salesforce · midnight · aurora
   (gesetzt über <html data-design="…">; Kontraste ≥ 4.5:1 für Text)
   ===================================================================== */
html { transition: background-color .2s; }
.btn, .nav a, .tnode, .site-card, .panel, .kpi div { transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s, filter .15s; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Apple ---------- */
html[data-design="apple"][data-theme] {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #fafafc; --surface-3: #ececf0; --line: #e4e4e9; --line-2: #d2d2d7;
  --ink: #1d1d1f; --ink-2: #424245; --ink-3: #636366;
  --accent: #0071e3; --accent-2: #2997ff; --accent-soft: #e5f1fd; --accent-ink: #fff;
  --sel: #dcebfd; --sel-line: #7db8f5; --danger: #d70015; --danger-soft: #ffebed; --warn: #9a5b00; --warn-soft: #fff3dc; --ok: #1f7a3a; --ok-soft: #e4f6ea;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05); --shadow-lg: 0 24px 60px rgba(0,0,0,.22), 0 4px 12px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, "Segoe UI", system-ui, sans-serif; color-scheme: light;
}
html[data-design="apple"] body { letter-spacing: -.008em; }
html[data-design="apple"] .topbar { background: rgba(255,255,255,.78); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border-bottom-color: rgba(0,0,0,.08); }
html[data-design="apple"] .sidebar { background: rgba(245,245,247,.7); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-right-color: rgba(0,0,0,.06); }
html[data-design="apple"] .btn { border-radius: 980px; padding: 7px 16px; font-weight: 560; border-color: var(--line-2); background: #fff; }
html[data-design="apple"] .btn.sm { padding: 4px 12px; }
html[data-design="apple"] .btn.primary { background: var(--accent); border-color: var(--accent); }
html[data-design="apple"] .btn.primary:hover { filter: none; background: #0a64c8; }
html[data-design="apple"] .nav a { border-radius: 10px; }
html[data-design="apple"] .nav a.on { background: var(--accent); color: #fff; }
html[data-design="apple"] .nav a.on .i { color: #fff; }
html[data-design="apple"] .modal { border-radius: 22px; }
html[data-design="apple"] .modal-bg { background: rgba(0,0,0,.32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html[data-design="apple"] .panel, html[data-design="apple"] .site-card, html[data-design="apple"] .kpi div, html[data-design="apple"] .tbl-wrap { border-color: transparent; box-shadow: var(--shadow); }
html[data-design="apple"] .site-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.1); }
html[data-design="apple"] .kpi b { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
html[data-design="apple"] .page-head h1 { font-size: 28px; letter-spacing: -.02em; }
html[data-design="apple"] input, html[data-design="apple"] select, html[data-design="apple"] textarea { border-radius: 10px; }

/* ---------- Salesforce Lightning ---------- */
html[data-design="salesforce"][data-theme] {
  --bg: #f3f3f3; --surface: #ffffff; --surface-2: #fafaf9; --surface-3: #f3f3f3; --line: #e5e5e5; --line-2: #c9c9c9;
  --ink: #181818; --ink-2: #444444; --ink-3: #5c5c5c;
  --accent: #0176d3; --accent-2: #1b96ff; --accent-soft: #eef4ff; --accent-ink: #fff;
  --sel: #eef4ff; --sel-line: #1b96ff; --danger: #ba0517; --danger-soft: #fef1f1; --warn: #8c4b02; --warn-soft: #fef6e7; --ok: #2e844a; --ok-soft: #ebf7e6;
  --radius: 6px; --radius-sm: 4px; --shadow: 0 2px 2px rgba(0,0,0,.1); --shadow-lg: 0 8px 24px rgba(0,0,0,.25);
  --font: "Salesforce Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color-scheme: light;
}
html[data-design="salesforce"] .topbar { background: #032d60; border-bottom: 0; color: #fff; }
html[data-design="salesforce"] .topbar .brand b, html[data-design="salesforce"] .topbar .userbtn, html[data-design="salesforce"] .topbar .uname { color: #fff; }
html[data-design="salesforce"] .topbar .search input { background: #fff; border-color: transparent; color: #181818; }
html[data-design="salesforce"] .topbar .geo-pill { color: #d8e6fe; border-color: #1b4a85; }
html[data-design="salesforce"] .topbar .userbtn:hover { background: rgba(255,255,255,.12); }
html[data-design="salesforce"] .topbar .btn { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
html[data-design="salesforce"] .avatar { background: #1b96ff; }
html[data-design="salesforce"] .sidebar { background: #fff; border-right: 1px solid var(--line-2); }
html[data-design="salesforce"] .nav a { border-radius: 0; border-left: 4px solid transparent; padding-left: 8px; }
html[data-design="salesforce"] .nav a.on { background: #eef4ff; color: #014486; border-left-color: #0176d3; font-weight: 700; }
html[data-design="salesforce"] .nav-sec { color: #444; }
html[data-design="salesforce"] .btn { border-radius: 4px; border-color: #c9c9c9; color: #0176d3; font-weight: 600; }
html[data-design="salesforce"] .btn:hover { background: #f3f3f3; }
html[data-design="salesforce"] .btn.primary { background: #0176d3; border-color: #0176d3; color: #fff; }
html[data-design="salesforce"] .btn.primary:hover { background: #014486; filter: none; }
html[data-design="salesforce"] .btn.danger { color: #ba0517; }
html[data-design="salesforce"] .page-head { background: #fff; border: 1px solid var(--line); border-top: 3px solid #0176d3; border-radius: 6px; padding: 12px 16px; box-shadow: var(--shadow); }
html[data-design="salesforce"] .page-head h1 { font-size: 20px; }
html[data-design="salesforce"] .panel, html[data-design="salesforce"] .site-card, html[data-design="salesforce"] .kpi div { box-shadow: var(--shadow); }
html[data-design="salesforce"] .tbl th { background: #f3f3f3; color: #444; text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; }
html[data-design="salesforce"] .modal { border-radius: 8px; }
html[data-design="salesforce"] .modal-h { background: #f3f3f3; }
html[data-design="salesforce"] .view a { color: #0b5cab; }

/* ---------- Midnight (dunkel, Linear/GitHub-Stil) ---------- */
html[data-design="midnight"][data-theme] {
  --bg: #0b0d12; --surface: #12151c; --surface-2: #171b24; --surface-3: #1e2330; --line: #262c3a; --line-2: #343c4e;
  --ink: #eef1f6; --ink-2: #b9c1d1; --ink-3: #8f98ab;
  --accent: #8b98ff; --accent-2: #6272ff; --accent-soft: #1d2247; --accent-ink: #0b0d12;
  --sel: #1b2250; --sel-line: #4553c9; --danger: #ff7b72; --danger-soft: #3a1c1f; --warn: #f2b84b; --warn-soft: #3a2c12; --ok: #56d364; --ok-soft: #12301b;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.5); --shadow-lg: 0 20px 60px rgba(0,0,0,.7);
  --font: Inter, -apple-system, "Segoe UI", system-ui, sans-serif; color-scheme: dark;
}
html[data-design="midnight"] .topbar { background: #0e1118; }
html[data-design="midnight"] .sidebar { background: #0e1118; }
html[data-design="midnight"] .nav a.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
html[data-design="midnight"] .btn.primary { background: var(--accent); color: #0b0d12; font-weight: 650; }
html[data-design="midnight"] .avatar { color: #0b0d12; }
html[data-design="midnight"] .panel, html[data-design="midnight"] .kpi div, html[data-design="midnight"] .site-card { background: linear-gradient(180deg, #151923, #12151c); }
html[data-design="midnight"] .page-head h1 { letter-spacing: -.02em; }

/* ---------- Aurora (dunkel, Glas & Farbverlauf) ---------- */
html[data-design="aurora"][data-theme] {
  --bg: #0d0a1f; --surface: #191433; --surface-2: #1f1940; --surface-3: #2a2352; --line: #342c63; --line-2: #463c80;
  --ink: #f6f3ff; --ink-2: #d0c9ee; --ink-3: #a9a1d0;
  --accent: #36d6e7; --accent-2: #a78bfa; --accent-soft: #1b2f4a; --accent-ink: #07131c;
  --sel: #2b2a66; --sel-line: #7466e8; --danger: #ff8a80; --danger-soft: #41203a; --warn: #ffc15c; --warn-soft: #41301d; --ok: #5eeaa0; --ok-soft: #14352f;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 4px 24px rgba(10,6,40,.5); --shadow-lg: 0 24px 70px rgba(0,0,0,.7);
  --font: "Plus Jakarta Sans", Inter, -apple-system, "Segoe UI", system-ui, sans-serif; color-scheme: dark;
}
html[data-design="aurora"] body { background: radial-gradient(1100px 600px at 85% -10%, #3a1d7a55, transparent 60%), radial-gradient(900px 500px at -10% 110%, #0e5a7a55, transparent 60%), #0d0a1f; background-attachment: fixed; }
html[data-design="aurora"] .topbar, html[data-design="aurora"] .sidebar { background: rgba(25,20,51,.72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
html[data-design="aurora"] .main, html[data-design="aurora"] .app { background: transparent; }
html[data-design="aurora"] .btn.primary { background: linear-gradient(135deg, #36d6e7, #a78bfa); border-color: transparent; color: #07131c; font-weight: 700; }
html[data-design="aurora"] .btn.primary:hover { filter: brightness(1.1); }
html[data-design="aurora"] .btn { border-radius: 12px; }
html[data-design="aurora"] .nav a { border-radius: 12px; }
html[data-design="aurora"] .nav a.on { background: linear-gradient(135deg, #36d6e733, #a78bfa33); color: #fff; box-shadow: inset 0 0 0 1px #a78bfa66; }
html[data-design="aurora"] .avatar { background: linear-gradient(135deg, #36d6e7, #a78bfa); color: #07131c; }
html[data-design="aurora"] .panel, html[data-design="aurora"] .kpi div, html[data-design="aurora"] .site-card, html[data-design="aurora"] .tbl-wrap { border-color: #3d3470; }
html[data-design="aurora"] .site-card:hover { transform: translateY(-2px); border-color: #a78bfa; }
html[data-design="aurora"] .kpi b { background: linear-gradient(135deg, #36d6e7, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 24px; }
html[data-design="aurora"] .modal { border: 1px solid #463c80; border-radius: 22px; }

/* Design-Auswahl */
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.dz { text-align: left; border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 8px; cursor: pointer; font: inherit; }
.dz:hover { border-color: var(--line-2); transform: translateY(-2px); }
.dz.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.dz b { display: block; margin: 8px 4px 0; } .dz span.d { display: block; margin: 0 4px 4px; font-size: 12px; color: var(--ink-3); }
.dz .pv { height: 86px; border-radius: 9px; border: 1px solid rgba(128,128,128,.3); display: grid; grid-template-columns: 30% 1fr; overflow: hidden; }
.dz .pv i { display: block; } .dz .pv .m { padding: 8px; display: flex; flex-direction: column; gap: 5px; } .dz .pv .m u { display: block; height: 9px; border-radius: 4px; text-decoration: none; }

/* Gefahr-Knopf in allen Designs lesbar */
html[data-design] .btn.danger, html[data-design] .btn.danger:hover { background: var(--danger); border-color: transparent; color: #fff; }
html[data-design="midnight"] .btn.danger, html[data-design="midnight"] .btn.danger:hover, html[data-design="aurora"] .btn.danger, html[data-design="aurora"] .btn.danger:hover { color: #1a0505; font-weight: 700; }
html[data-design] .btn.danger:hover { filter: brightness(1.1); }
:root[data-theme] .ficon.dir{background:linear-gradient(180deg,#f6c445,#e9a91c);border:0}
.sqlpre{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px;overflow:auto;max-height:50vh;font:12px/1.5 var(--mono);white-space:pre}

/* v11 – Designs Papier & Hochkontrast, verdächtige Websites */
html[data-design="paper"][data-theme] {
  --bg: #f6f1e7; --surface: #fffdf8; --surface-2: #fbf7ef; --surface-3: #efe8d9; --line: #e2d9c6; --line-2: #cbbfa6;
  --ink: #2b2418; --ink-2: #4d4333; --ink-3: #6b5f4b; --accent: #8a4b1f; --accent-2: #b5652e; --accent-soft: #f5e6d6; --accent-ink: #fff;
  --sel: #f3e3cc; --sel-line: #c9955f; --danger: #a3271b; --danger-soft: #f9e4e0; --warn: #8a5a00; --warn-soft: #fbefd6; --ok: #2f6b2f; --ok-soft: #e5efdc;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(60,40,10,.08); --shadow-lg: 0 12px 32px rgba(60,40,10,.2);
  --font: Georgia, "Iowan Old Style", "Palatino Linotype", serif; color-scheme: light;
}
html[data-design="paper"] .topbar, html[data-design="paper"] .sidebar { background: #fffdf8; border-color: var(--line); }
html[data-design="paper"] h1, html[data-design="paper"] h2, html[data-design="paper"] h3 { font-weight: 600; }
html[data-design="paper"] .nav a.on { background: #f3e3cc; color: #6b3414; }
html[data-design="paper"] .btn.primary { background: var(--accent); border-color: var(--accent); }

html[data-design="contrast"][data-theme] {
  --bg: #000; --surface: #000; --surface-2: #0a0a0a; --surface-3: #1a1a1a; --line: #fff; --line-2: #fff;
  --ink: #fff; --ink-2: #fff; --ink-3: #e6e6e6; --accent: #ffd600; --accent-2: #ffd600; --accent-soft: #222; --accent-ink: #000;
  --sel: #333300; --sel-line: #ffd600; --danger: #ff7b7b; --danger-soft: #2a0000; --warn: #ffd600; --warn-soft: #2e2600; --ok: #6dff9a; --ok-soft: #002a10;
  --radius: 6px; --radius-sm: 4px; --shadow: none; --shadow-lg: none; color-scheme: dark;
}
html[data-design="contrast"] .btn, html[data-design="contrast"] .panel, html[data-design="contrast"] .site-card,
html[data-design="contrast"] .kpi div, html[data-design="contrast"] .tbl-wrap, html[data-design="contrast"] .modal { border-width: 2px; border-color: #fff; }
html[data-design="contrast"] .btn.primary { background: #ffd600; color: #000; border-color: #ffd600; font-weight: 700; }
html[data-design="contrast"] .nav a.on { background: #ffd600; color: #000; }
html[data-design="contrast"] .nav a.on .i { color: #000; }
html[data-design="contrast"] a { color: #ffd600; text-decoration: underline; }
html[data-design="contrast"] :focus-visible { outline: 3px solid #ffd600; outline-offset: 2px; }
html[data-design="contrast"] .btn.danger, html[data-design="contrast"] .btn.danger:hover { background: #ff7b7b; color: #000; border-color: #ff7b7b; }

.site-card.verdaechtig { border: 2px solid var(--danger) !important; background: var(--danger-soft) !important; }
.site-card.verdaechtig h3 a { color: var(--danger); }
.fl-extra { margin-top: 18px; } .fl-extra h3 { margin: 0 0 8px; }
.fl-form { display: grid; gap: 10px; } .fl-form label { display: grid; gap: 4px; font-size: 13px; }

/* ---------- v14: Desktop-Ansicht ---------- */
.win-bar { display: none; }
.app.desk { background: radial-gradient(1100px 620px at 8% -10%, #cfdcff 0%, transparent 60%), radial-gradient(900px 560px at 105% 110%, #ffdcec 0%, transparent 55%), #e7ebf3; }
:root[data-theme="dark"] .app.desk, :root:not([data-theme="light"]) .app.desk { background: radial-gradient(1100px 620px at 8% -10%, #26336b 0%, transparent 60%), radial-gradient(900px 560px at 105% 110%, #3d1f4a 0%, transparent 55%), #0b0e14; }
.app.desk .topbar { background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 0; }
.app.desk .sidebar { margin: 10px 0 10px 10px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.app.desk .main { margin: 10px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); background: var(--surface); }
.app.desk .win-bar { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-2, var(--surface)); flex: 0 0 auto; font-size: 13px; }
.app.desk .win-bar b { flex: 1; text-align: center; font-weight: 600; color: var(--muted, #5b6472); }
.win-dots { display: inline-flex; gap: 7px; width: 54px; }
.win-dots i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.win-dots .d-r { background: #ff5f57; } .win-dots .d-y { background: #febc2e; } .win-dots .d-g { background: #28c840; }
@media (min-width: 721px) { .app.desk .bottomnav { display: none !important; } }
@media (max-width: 860px) { .app.desk .sidebar { margin: 0; border-radius: 0; } }
@media (max-width: 720px) { .app.desk .main { margin: 0; border-radius: 0; border: 0; box-shadow: none; } .app.desk .win-bar { display: none; } }

/* ---------- v14: Tracking & Backup-Tabelle ---------- */
.trk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.trk-bar input[type=search] { flex: 1 1 240px; min-width: 0; }
.trk-bar select { flex: 0 1 auto; max-width: 100%; }
.trk-links { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.trk-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 170px; max-width: 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.trk-card b { font-size: 20px; }
.trk-card span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.trk-card small { color: var(--muted, #5b6472); }
.trk-card.on { border-color: var(--acc, #0e6b62); box-shadow: 0 0 0 2px var(--acc-soft, rgba(14,107,98,.2)); }
.trk-ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-more { margin: 10px 0 20px; }
.backup-tbl td.num { text-align: right; white-space: nowrap; }
.backup-tbl tr.click { cursor: pointer; }
@media (max-width: 720px) { .backup-tbl .tbl td:nth-child(5), .backup-tbl .tbl th:nth-child(5) { display: none; } .trk-ua { display: none; } }
.trk-bar select { width: auto; flex: 0 0 auto; }
.trk-bar .inline { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- v14.1: Mobile Bedienung ---------- */
.modal-h { flex-wrap: wrap; }
.modal-h h2 { min-width: 0; flex: 1 1 60%; }
.modal-h .btn { flex: 0 0 auto; }
.preview-b { touch-action: pinch-zoom; }
.preview-b img.pv-img { cursor: zoom-in; touch-action: pinch-zoom; }
.preview-b img.pv-img.zoomed { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.fl-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--surface-2, #eee); }
@media (max-width: 720px) {
  .modal-bg { padding: 0; }
  .modal, .modal.wide, .modal.xl { max-width: 100%; width: 100%; height: 100vh; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .modal-b { padding: 14px; }
  .modal-f { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1 1 auto; }
  .preview-b img { max-height: calc(100dvh - 120px); }
}


/* Warnung abgehakt: neutrale Kachel mit Hinweis */
.site-card.gesehen { opacity: .92; }
.site-card.gesehen h3 a { opacity: .9; }

/* ===== Schriften (selbst gehostet, keine externen Dienste) ===== */
@font-face { font-family: "FM Inter"; src: url(fonts/inter-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "FM Inter"; src: url(fonts/inter-500.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "FM Inter"; src: url(fonts/inter-600.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "FM Inter"; src: url(fonts/inter-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "FM Poppins"; src: url(fonts/poppins-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "FM Poppins"; src: url(fonts/poppins-500.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "FM Poppins"; src: url(fonts/poppins-700.woff) format("woff"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "FM Lora"; src: url(fonts/lora-var.woff) format("woff"); font-weight: 400 700; font-display: swap; }
html[data-font="inter"] { --font: "FM Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[data-font="poppins"] { --font: "FM Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[data-font="lora"] { --font: "FM Lora", Georgia, "Times New Roman", serif; }

/* ===== Neue Oberflächen: Labarru, Taskflow, Mesquite, Nutzer ===== */
html[data-design="labarru"][data-theme] { --bg:#f2f6f5; --surface:#fff; --surface-2:#f6f9f9; --surface-3:#eaf1f0; --line:#e1ebea; --line-2:#cbdcd8; --ink:#11302c; --ink-2:#3e5d59; --ink-3:#6f8a86; --accent:#0f766e; --accent-2:#0b5b55; --accent-soft:#e3f2f0; --sel:#dcefeb; --sel-line:#8cc7bd; --radius:14px; --radius-sm:10px; --shadow:0 1px 2px rgba(17,48,44,.05),0 2px 8px rgba(17,48,44,.06); --shadow-lg:0 16px 40px rgba(17,48,44,.18); color-scheme: light; }
html[data-design="labarru"] .brand b { font-family: "FM Lora", Georgia, serif; font-weight: 600; font-size: 18px; color: var(--accent-2); }
html[data-design="labarru"] .nav a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
html[data-design="labarru"] .kpi > div, html[data-design="labarru"] .card, html[data-design="labarru"] .site-card, html[data-design="labarru"] .tbl-wrap { border-radius: 16px; }
html[data-design="labarru"] .btn.primary { background: var(--accent); border-color: var(--accent); }

html[data-design="taskflow"][data-theme] { --bg:#f5f5f3; --surface:#fff; --surface-2:#faf9f7; --surface-3:#f1efec; --line:#ebe8e4; --line-2:#d9d4ce; --ink:#1c1917; --ink-2:#57534e; --ink-3:#8a8580; --accent:#f97316; --accent-2:#ea580c; --accent-soft:#fff1e7; --sel:#ffe9d6; --sel-line:#fdba74; --radius:18px; --radius-sm:12px; --shadow:0 1px 2px rgba(28,25,23,.04),0 2px 10px rgba(28,25,23,.05); --shadow-lg:0 18px 44px rgba(28,25,23,.16); color-scheme: light; }
html[data-design="taskflow"] .nav a { border-radius: 12px; }
html[data-design="taskflow"] .nav a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
html[data-design="taskflow"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-design="taskflow"] .kpi > div, html[data-design="taskflow"] .card, html[data-design="taskflow"] .site-card, html[data-design="taskflow"] .tbl-wrap { border-radius: 18px; }
html[data-design="taskflow"] .kpi b { color: var(--ink); }

html[data-design="mesquite"][data-theme] { --bg:#f4f6fb; --surface:#fff; --surface-2:#f8f9fc; --surface-3:#eef1f7; --line:#e4e8f2; --line-2:#cfd6e4; --ink:#0f172a; --ink-2:#475569; --ink-3:#94a3b8; --accent:#2563eb; --accent-2:#1d4ed8; --accent-soft:#eaf1ff; --sel:#dbe7ff; --sel-line:#93b4f5; --radius:12px; --radius-sm:8px; --shadow:0 1px 2px rgba(15,23,42,.05),0 1px 4px rgba(15,23,42,.05); --shadow-lg:0 14px 36px rgba(15,23,42,.16); color-scheme: light; }
html[data-design="mesquite"] .nav a { border-radius: 999px; padding: 9px 14px; }
html[data-design="mesquite"] .nav a.on { background: var(--accent); color: #fff; font-weight: 600; }
html[data-design="mesquite"] .nav a.on .i, html[data-design="mesquite"] .nav a.on svg { color: #fff; }
html[data-design="mesquite"] .btn.primary { background: var(--accent); border-color: var(--accent); }

html[data-design="nutzer"][data-theme] { --bg:#f1f1ee; --surface:#fff; --surface-2:#f8f8f6; --surface-3:#eeeeea; --line:#e7e5df; --line-2:#d6d3cb; --ink:#111111; --ink-2:#4b4b4b; --ink-3:#8b8b86; --accent:#111111; --accent-2:#000; --accent-soft:#ececE8; --sel:#e6e6e1; --sel-line:#a8a8a0; --radius:16px; --radius-sm:11px; --shadow:0 1px 2px rgba(0,0,0,.04),0 2px 8px rgba(0,0,0,.05); --shadow-lg:0 18px 44px rgba(0,0,0,.16); color-scheme: light; }
html[data-design="nutzer"] body { background: linear-gradient(160deg, #f4f1ea 0%, #eef0f4 100%); }
html[data-design="nutzer"] .btn.primary { background: #111; border-color: #111; color: #fff; }
html[data-design="nutzer"] .nav a.on { background: #111; color: #fff; }
html[data-design="nutzer"] .nav a.on svg { color: #fff; }
html[data-design="nutzer"] .kpi > div, html[data-design="nutzer"] .card, html[data-design="nutzer"] .site-card, html[data-design="nutzer"] .tbl-wrap { border-radius: 18px; }
@media (min-width: 861px) {
  html[data-design="nutzer"] .app { padding: 12px; gap: 12px; box-sizing: border-box; }
  html[data-design="nutzer"] .sidebar { border-radius: 22px; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); }
  html[data-design="nutzer"] .rail-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 12px; }
  html[data-design="nutzer"] .rail-head b { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-design="nutzer"] .rail-toggle { display: flex; align-items: center; justify-content: center; margin: 10px auto 0; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); position: sticky; bottom: 4px; }
  html[data-design="nutzer"] .app.rail-open .rail-toggle svg { transform: rotate(180deg); }
  html[data-design="nutzer"] .app:not(.rail-open) { --side: 84px; }
  html[data-design="nutzer"] .app:not(.rail-open) .sidebar { padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
  html[data-design="nutzer"] .app:not(.rail-open) .nav-sec, html[data-design="nutzer"] .app:not(.rail-open) .tree, html[data-design="nutzer"] .app:not(.rail-open) #favBox, html[data-design="nutzer"] .app:not(.rail-open) .nav a span, html[data-design="nutzer"] .app:not(.rail-open) .nav a .cnt { display: none; }
  html[data-design="nutzer"] .app:not(.rail-open) .nav a { justify-content: center; width: 52px; height: 46px; margin: 4px auto; padding: 0; border-radius: 14px; }
  html[data-design="nutzer"] .app:not(.rail-open) .nav a svg { width: 22px; height: 22px; }
  html[data-design="nutzer"] .app.rail-open .rail-head { flex-direction: row; justify-content: flex-start; padding: 4px 8px 12px; }
}

/* Kennzahl-Sparklines und Icon-Leiste (Basis, nur bei Bedarf sichtbar) */
.kspark { display: block; margin-top: 6px; width: 100%; max-width: 110px; height: 28px; color: var(--accent); }
.kspark svg { width: 100%; height: 100%; display: block; }
.rail-head, .rail-toggle { display: none; }

/* Warnung abgehakt: neutrale Kachel mit Hinweis */
.site-card.gesehen { opacity: .92; }
.site-card.gesehen h3 a { opacity: .9; }
.fontgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.fontgrid .fz { text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.fontgrid .fz.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fontgrid .fa { font-size: 20px; line-height: 1.2; }
.fontgrid .d { font-size: 12px; color: var(--ink-3); }

/* ===== weitere Schriften ===== */
@font-face { font-family: "FM Carlito"; src: url(fonts/carlito-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "FM Carlito"; src: url(fonts/carlito-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "FM Caladea"; src: url(fonts/caladea-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "FM Caladea"; src: url(fonts/caladea-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "FM DejaVu"; src: url(fonts/dejavu-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "FM DejaVu"; src: url(fonts/dejavu-700.woff) format("woff"); font-weight: 700; font-display: swap; }
html[data-font="carlito"] { --font: "FM Carlito", Calibri, system-ui, sans-serif; }
html[data-font="caladea"] { --font: "FM Caladea", Cambria, Georgia, serif; }
html[data-font="dejavu"] { --font: "FM DejaVu", "DejaVu Sans", Verdana, sans-serif; }

/* ===== Karten: Warnung dezenter, Text bricht nicht mehr aus ===== */
.site-card h3 { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.site-card h3 .badge { white-space: nowrap; }
.site-card.klein, .site-card.alt, .site-card.leer { border-color: color-mix(in srgb, var(--warn) 38%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.site-card.klein h3, .site-card.alt h3, .site-card.leer h3 { color: var(--ink); }
.site-card.gesehen { border-color: var(--line); background: var(--surface); }

/* ===== Ordnerbaum: ruhiger, moderner ===== */
.tree { margin: 4px 0 8px; font-size: 13px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 8px; margin-left: 10px; border-left: 1px solid var(--line); }
.tree > ul { padding-left: 0; margin-left: 4px; border-left: 0; }
.tnode { padding: 5px 8px; border-radius: 9px; gap: 6px; color: var(--ink-2); }
.tnode:hover { background: var(--surface-3); }
.tnode.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.tnode .fd { color: var(--ink-3); width: 14px; height: 14px; }
.tnode.on .fd { color: var(--accent); }
.tnode .tw { color: var(--ink-3); }
.tree .tnode .n { font-weight: 500; }

/* ===== Schriftwahl: Farbfelder ===== */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.palette-grid label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.palette-grid input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); cursor: pointer; }
.theme-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.theme-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.theme-row .sw { display: flex; gap: 3px; }
.theme-row .sw i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-2); }
.theme-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-row .d { font-size: 12px; color: var(--ink-3); }

/* ===== PHP-Seite ===== */
.php-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.php-form .row { display: grid; grid-template-columns: 1fr 130px; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.php-form .row span { font-size: 13px; color: var(--ink-2); }
.php-form .row small { display: block; color: var(--ink-3); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); }
.php-grid td.mono { white-space: normal; word-break: break-all; font-size: 12px; }
.php-grid .tbl td { vertical-align: top; }

/* ===== Schriften: weitere Sans ===== */
@font-face { font-family: "FM Liberation"; src: url(fonts/liberation-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "FM Liberation"; src: url(fonts/liberation-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "FM FreeSans"; src: url(fonts/freesans-400.woff) format("woff"); font-weight: 400 700; font-display: swap; }
html[data-font="liberation"] { --font: "FM Liberation", Arial, Helvetica, sans-serif; }
html[data-font="freesans"] { --font: "FM FreeSans", Helvetica, Arial, sans-serif; }

/* ===== Darstellung: Form der Buttons und Kacheln ===== */
html { --btn-r: var(--radius-sm); }
html[data-shape="round"], html[data-shape="round"][data-theme] { --btn-r: 999px; --radius-sm: 14px; --radius: 20px; }
html[data-shape="square"], html[data-shape="square"][data-theme] { --btn-r: 3px; --radius-sm: 2px; --radius: 4px; }
.btn { border-radius: var(--btn-r); }
.search input, .chips span { border-radius: var(--btn-r); }

/* ===== Schriftgröße & Symbolgröße ===== */
body { font-size: var(--fs, 14px); }
.nav a > svg.i, .tnode .fd, .tnode .tw .i { width: var(--ico, 16px); height: var(--ico, 16px); }
.tnode .fd { display: block; }
.btn .i { width: calc(var(--ico, 16px) + 1px); height: calc(var(--ico, 16px) + 1px); }

/* ===== Seitenleiste & Ordner ===== */
.sidebar { background: var(--side-bg, var(--surface)); }
.tnode .fd { color: initial; }

/* ===== Suche: Icon mittig ===== */
.search { position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; margin: 0; }
.search input { height: 40px; padding-left: 40px; line-height: 40px; }

/* ===== Icons oben rechts: schärfer ===== */
svg.i { shape-rendering: geometricPrecision; }
.topbar svg.i, .topbar .userbtn svg, .win-bar svg.i { width: 18px; height: 18px; }
.topbar .geo-pill { font-size: 12px; }


/* ===== Freigabe-Kennzeichen ===== */
.nmwrap { position: relative; }
.nmwrap .shb, .tnode .tshb { display: inline-grid; place-items: center; }
.shb { position: absolute; left: 17px; top: 17px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.shb svg { width: 9px; height: 9px; }
.nmwrap .i, .nmwrap .ficon { position: relative; }
.tnode .tshb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); color: #fff; margin-left: auto; flex: none; }
.tnode .tshb svg { width: 8px; height: 8px; }
.badge.shpill { font-size: 11px; }

/* ===== WEBLIVE – Optik: dunkle Leiste, violetter Akzent, runde Karten ===== */
:root {
  --accent: #6d4aff; --accent-2: #8f74ff; --accent-soft: #eee9ff; --accent-ink: #fff;
  --bg: #f3f4f9; --radius: 14px; --radius-sm: 9px;
  --wl-side: #15112b; --wl-side-2: #201a41; --wl-side-ink: #cfc9ea;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #8f74ff; --accent-2: #6d4aff; --accent-soft: #261f4a; --bg: #0e0c1a; --surface: #17142a; --surface-2: #1c1933; --surface-3: #241f40; --line: #2b2650; --line-2: #3a3466; } }
html:not([data-design]) .sidebar, html[data-design="standard"] .sidebar { background: var(--wl-side); border-right: 0; color: var(--wl-side-ink); }
html:not([data-design]) .sidebar .nav-sec, html[data-design="standard"] .sidebar .nav-sec { color: #8a82b8; }
html:not([data-design]) .sidebar a, html[data-design="standard"] .sidebar a { color: var(--wl-side-ink); }
html:not([data-design]) .sidebar a:hover, html[data-design="standard"] .sidebar a:hover { background: var(--wl-side-2); color: #fff; }
html:not([data-design]) .sidebar a.on, html[data-design="standard"] .sidebar a.on { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(109,74,255,.35); }
html:not([data-design]) .sidebar .rail-head b, html[data-design="standard"] .sidebar .rail-head b { color: #fff; }
html:not([data-design]) .sidebar .tnode, html[data-design="standard"] .sidebar .tnode { color: var(--wl-side-ink); }
html:not([data-design]) .sidebar .tnode:hover, html[data-design="standard"] .sidebar .tnode:hover { background: var(--wl-side-2); }
html:not([data-design]) .sidebar .tnode.on, html[data-design="standard"] .sidebar .tnode.on { background: var(--wl-side-2); color: #fff; }
.wl-ip { font-size: 12px; color: var(--ink-3); padding: 4px 10px; border-radius: 999px; background: var(--surface-3); }
.wl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.wl-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.wl-tile small { color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.wl-tile b { font-size: 24px; line-height: 1.2; }
.wl-tile span { color: var(--ink-3); font-size: 12.5px; min-height: 1em; }
.wl-tile.warn b { color: var(--warn); } .wl-tile.ok b { color: var(--ok); }
.wl-store { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.wl-store-h { display: flex; justify-content: space-between; margin-bottom: 8px; }
.wl-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.wl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.wl-note { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); margin-bottom: 12px; }
.wl-note.warn { background: var(--warn-soft); color: var(--warn); }
.wl-sec { font-weight: 700; margin: 18px 0 10px; font-size: 15px; }
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.wl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.wl-card:hover, .wl-card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent-2); outline: 0; }
.wl-card.alt, .wl-card.verdacht { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.wl-card-h { display: flex; gap: 12px; align-items: center; }
.wl-card-h > div { flex: 1; min-width: 0; } .wl-card-h b { display: block; font-size: 15.5px; } .wl-card-h small { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-fold { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #2a2158, #4b36a8); color: #fff; display: grid; place-items: center; flex: none; }
.wl-fold .i { width: 20px; height: 20px; }
.wl-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wl-kv small { display: block; color: var(--ink-3); font-size: 11.5px; } .wl-kv b { display: block; font-size: 14px; } .wl-kv b.bad { color: var(--danger); } .wl-kv span { color: var(--ink-3); font-size: 11.5px; }
.wl-badges { display: flex; gap: 6px; flex-wrap: wrap; min-height: 4px; }
.wl-acts { display: flex; gap: 6px; flex-wrap: wrap; } .wl-acts.wide { margin: 8px 0; align-items: center; }
.wl-pill { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.wl-pill.ok { background: var(--ok-soft); color: var(--ok); } .wl-pill.warn { background: var(--warn-soft); color: var(--warn); } .wl-pill.bad { background: var(--danger-soft); color: var(--danger); }
.wl-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding-bottom: 0; scrollbar-width: none; }
.wl-tabs a { padding: 9px 14px; border-radius: 10px 10px 0 0; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.wl-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.wl-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.wl-checks { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.wl-code { width: 100%; font-family: var(--mono); font-size: 12.5px; }
.wl-pre { white-space: pre-wrap; }
.logbox.tall { max-height: 60vh; overflow: auto; }
.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
@media (max-width: 720px) { .wl-grid { grid-template-columns: 1fr; } .wl-kv { grid-template-columns: repeat(3, 1fr); } .view { padding: 14px 12px 80px; } }
@media (max-width: 720px) { .wl-body .tbl .dacts { flex-wrap: nowrap; } .wl-body .tbl .dacts .btn.sm { font-size: 0; padding: 8px; gap: 0; } .wl-body .tbl .dacts .btn.sm .i { width: 18px; height: 18px; } .wl-body .tbl td { word-break: break-word; } }
@media (max-width: 720px) { .wl-body .tbl td:first-child { min-width: 150px; overflow-wrap: anywhere; } }
.wl-combo { position: relative; display: flex; gap: 6px; align-items: stretch; } .wl-combo > input { flex: 1; min-width: 0; }
.wl-combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 240px; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.wl-combo-item, .wl-combo-empty { padding: 8px 12px; font-size: 13.5px; } .wl-combo-item { cursor: pointer; } .wl-combo-item:hover { background: var(--accent-soft); } .wl-combo-empty { color: var(--ink-3); }
.wl-example { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 8px 12px; border-radius: var(--radius-sm); margin: 6px 0 12px; word-break: break-all; }
.wl-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .wl-filters input[type=search] { flex: 1; min-width: 180px; }
.wl-body h3, form h3 { margin: 16px 0 6px; }
.wl-filters select { width: auto; flex: 0 1 200px; }
.wl-filters input[type=search] { width: auto; }
@media (max-width: 700px) { .wl-filters select, .wl-filters input[type=search] { flex: 1 1 100%; } }
.wl-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; margin: 10px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.wl-fact { min-width: 0; } .wl-fact small { display: block; font-size: 11px; color: var(--ink-3); } .wl-fact b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-fact.ok b { color: #15803d; } .wl-fact.warn b { color: #b45309; } .wl-fact.bad b { color: #b91c1c; }
.wl-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.wl-chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.wl-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wl-bulk { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--accent-soft); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.wl-selbox { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.wl-tags { color: var(--accent); }
.wl-moves { display: grid; gap: 8px; margin: 12px 0; }
.wl-move { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); }
.wl-mico { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; flex: none; background: var(--line-2); }
.wl-move.ok .wl-mico { background: #dcfce7; color: #15803d; } .wl-move.warn .wl-mico { background: #fef3c7; color: #b45309; } .wl-move.bad .wl-mico { background: #fee2e2; color: #b91c1c; }

/* ---------- Design „Materialize“ (Vorlage nach Materialize-Dashboard: dunkle Seitenleiste, Violett, weiße Karten) ---------- */
html[data-design="materialize"][data-theme] {
  --bg:#f5f5f9; --surface:#fff; --surface-2:#f8f8fb; --surface-3:#f0f0f6; --line:#e6e6ef; --line-2:#d5d5e2;
  --ink:#2b2c40; --ink-2:#5b5d73; --ink-3:#8b8da3; --accent:#696cff; --accent-2:#5f61e6; --accent-soft:#e7e7ff; --accent-ink:#fff;
  --sel:#e7e7ff; --sel-line:#a6a8ff; --radius:10px; --radius-sm:8px;
  --shadow:0 2px 6px 0 rgba(67,89,113,.08); --shadow-lg:0 14px 34px rgba(67,89,113,.22); color-scheme: light;
}
html[data-design="materialize"] body { font-size: 14.5px; }
html[data-design="materialize"] .topbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; }
html[data-design="materialize"] .sidebar { background: #2f3349; border-right: 0; color: #c3c4d6; --ink:#c3c4d6; --ink-2:#c3c4d6; --ink-3:#8f92ad; --line:rgba(255,255,255,.08); --surface-3:rgba(255,255,255,.06); --accent:#fff; --accent-soft:#696cff; padding: 14px 12px 24px; }
html[data-design="materialize"] .sidebar .nav-sec, html[data-design="materialize"] .sidebar h4 { color: #8f92ad; letter-spacing: .04em; }
html[data-design="materialize"] .nav a { border-radius: 6px; padding: 8px 12px; color: #c3c4d6; font-weight: 500; }
html[data-design="materialize"] .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
html[data-design="materialize"] .nav a.on { background: #696cff; color: #fff; box-shadow: 0 2px 6px rgba(105,108,255,.45); font-weight: 600; }
html[data-design="materialize"] .nav a.on svg, html[data-design="materialize"] .nav a.on .i { color: #fff; }
html[data-design="materialize"] .sidebar .tree, html[data-design="materialize"] .sidebar .tree * { color: #c3c4d6; }
html[data-design="materialize"] .sidebar .tree .sel, html[data-design="materialize"] .sidebar .tree .on { background: rgba(105,108,255,.25); color: #fff; }
html[data-design="materialize"] .btn { border-radius: 6px; font-weight: 600; }
html[data-design="materialize"] .btn.primary { background: #696cff; border-color: #696cff; box-shadow: 0 2px 6px rgba(105,108,255,.35); }
html[data-design="materialize"] .btn.primary:hover { background: #5f61e6; border-color: #5f61e6; filter: none; }
html[data-design="materialize"] .panel, html[data-design="materialize"] .wl-card, html[data-design="materialize"] .wl-tile, html[data-design="materialize"] .kpi > div, html[data-design="materialize"] .card, html[data-design="materialize"] .tbl-wrap { border-radius: 10px; border: 0; box-shadow: var(--shadow); }
html[data-design="materialize"] .wl-tile b { font-weight: 700; color: var(--ink); }
html[data-design="materialize"] .wl-tile small, html[data-design="materialize"] .wl-tile span { color: var(--ink-3); }
html[data-design="materialize"] .wl-card { padding: 16px; }
html[data-design="materialize"] .wl-card:hover { box-shadow: 0 10px 28px rgba(67,89,113,.18); transform: translateY(-2px); }
html[data-design="materialize"] .wl-pill { border-radius: 6px; font-weight: 600; }
html[data-design="materialize"] .page-head h1 { font-size: 22px; font-weight: 700; }
html[data-design="materialize"] input, html[data-design="materialize"] select, html[data-design="materialize"] textarea { border-radius: 6px; border-color: var(--line-2); }
html[data-design="materialize"] .wl-chip.on { background: #696cff; border-color: #696cff; }
html[data-design="materialize"] .wl-chip { border-radius: 6px; }
html[data-design="materialize"] .modal { border-radius: 10px; }
html[data-design="materialize"] .tbl th { color: var(--ink-3); font-weight: 600; text-transform: none; }

.ed-wrap { flex: 1; position: relative; display: flex; min-width: 0; min-height: 0; }
.ed-hl { position: absolute; inset: 0; margin: 0; overflow: hidden; pointer-events: none; padding: 10px 12px; font: 13px/1.55 var(--mono); white-space: pre; tab-size: 4; color: var(--ink); background: transparent; }
.ed-wrap > .ed-text { position: relative; background: transparent !important; color: transparent !important; caret-color: var(--ink); z-index: 1; }
.hl-c { color: #7d8596; font-style: italic; } .hl-s { color: #0f9d58; } .hl-v { color: #b45309; } .hl-t { color: #7c3aed; } .hl-k { color: #2563eb; font-weight: 600; } .hl-n { color: #c2410c; }
html[data-theme="dark"] .hl-s, :root:not([data-theme="light"]) .hl-s { color: #6ee7a0; }
html[data-theme="dark"] .hl-k, :root:not([data-theme="light"]) .hl-k { color: #7db4ff; }
html[data-theme="dark"] .hl-t, :root:not([data-theme="light"]) .hl-t { color: #c4a5ff; }
html[data-theme="dark"] .hl-v, :root:not([data-theme="light"]) .hl-v { color: #ffb86b; }
html[data-theme="dark"] .hl-n, :root:not([data-theme="light"]) .hl-n { color: #ffa07a; }
