/* WDMS Admin – modern, ruhig, schnell erfassbar. Keine externen Abhängigkeiten. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #16181d;
  --text-2: #5b6270;
  --text-3: #8b92a0;
  --accent: #e4572e;
  --accent-hover: #cc4520;
  --accent-soft: #fdeee8;
  --green: #1f9d55;
  --green-soft: #e5f6ec;
  --red: #d93b30;
  --red-soft: #fdeceb;
  --amber: #d98e04;
  --amber-soft: #fdf4e1;
  --blue: #2f6fde;
  --blue-soft: #e8f0fd;
  --gray-soft: #eef0f3;
  --sidebar: #16181d;
  --sidebar-text: #aeb4bf;
  --sidebar-active: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --surface: #171a20; --surface-2: #1c2027; --border: #262b34; --border-strong: #353b46;
    --text: #eef0f3; --text-2: #aab1bd; --text-3: #7c8492; --accent-soft: #3a1f16; --green-soft: #112a1c;
    --red-soft: #33171530; --amber-soft: #33270c; --blue-soft: #14223a; --gray-soft: #232831; --sidebar: #0b0d10;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.boot { padding: 40px; text-align: center; color: var(--text-3); }
[hidden] { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; letter-spacing: -.02em; }
.brand b { display: block; font-size: 14px; line-height: 1.2; }
.brand small { display: block; font-size: 11px; color: var(--sidebar-text); }
.nav { padding: 6px 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-weight: 500; margin: 1px 0; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(228,87,46,.16); color: var(--sidebar-active); }
.nav a.active svg { color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 6px; }
.nav .badge-count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; font-weight: 700; }
.userbox { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2b303a; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.userbox .who { flex: 1; min-width: 0; }
.userbox .who b { color: #fff; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .who small { font-size: 11px; }
.userbox button { background: none; border: 0; color: var(--sidebar-text); cursor: pointer; padding: 6px; border-radius: 6px; }
.userbox button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { min-width: 0; padding: 24px 28px 60px; max-width: 1320px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar .title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }

.mobilebar { display: none; }
.tabbar { display: none; }

/* Karten & Raster */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat .k { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .k svg { width: 16px; height: 16px; flex: none; }
.stat .v { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.green .v { color: var(--green); }
.stat.red .v { color: var(--red); }
.stat.amber .v { color: var(--amber); }

/* Status */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--text-3); }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.offline { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.dot.maintenance { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.locked { background: var(--text-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.ni { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 2px 8px; border-radius: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; min-height: 36px; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 12.5px; }
.btn.lg { padding: 12px 20px; font-size: 15px; min-height: 46px; }
.btn.block { width: 100%; }
.iconbtn { border: 0; background: transparent; color: var(--text-2); padding: 6px; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--gray-soft); color: var(--text); }
.iconbtn svg { width: 17px; height: 17px; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 11px; font: 14px var(--font); min-height: 38px; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=color] { width: 44px; height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; background: var(--surface); }
.frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.frow3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { left: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); border-radius: 20px; padding: 5px 12px; font-weight: 600; font-size: 13px; cursor: pointer; background: var(--surface); color: var(--text-2); user-select: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg { display: inline-flex; background: var(--gray-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: 600 13px var(--font); color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; min-width: 140px; }
.error { background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; font-weight: 500; }
.note { background: var(--blue-soft); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.note.warn { background: var(--amber-soft); }
.note.accent { background: var(--accent-soft); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--text-3); }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty svg { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 8px; }
.empty h3 { margin-bottom: 4px; color: var(--text); }

/* Listen */
.list > * { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.list > *:last-child { border-bottom: 0; }
.list a.item:hover { background: var(--surface-2); text-decoration: none; }
.list .item { color: inherit; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* Medien */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.mcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .12s, transform .12s; position: relative; }
.mcard:hover { border-color: var(--border-strong); }
.mcard.sel { outline: 3px solid var(--accent); outline-offset: -1px; }
.mcard .thumb { aspect-ratio: 16/9; background: #1f2229 center/contain no-repeat; display: grid; place-items: center; color: #8b92a0; position: relative; }
.mcard .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mcard .thumb .fmt { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: .03em; }
.mcard .meta { padding: 8px 10px; }
.mcard .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .meta small { color: var(--text-3); font-size: 11.5px; }
.mcard .tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; font-weight: 800; font-size: 13px; }
.mcard.sel .tick { display: grid; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-2); background: var(--surface); transition: background .12s, border-color .12s; margin-bottom: 14px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone b { color: var(--text); }
.uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.upl { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.progress { height: 6px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.progress.green > i { background: var(--green); }
.thumbsm { width: 64px; height: 36px; border-radius: 5px; background: #1f2229; object-fit: contain; flex: none; display: grid; place-items: center; color: #8b92a0; font-size: 10px; font-weight: 700; overflow: hidden; }
.thumbsm img { width: 100%; height: 100%; object-fit: contain; }

/* Playlist-Editor */
.pl-items { display: flex; flex-direction: column; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pl-item.dragging { opacity: .85; box-shadow: var(--shadow-lg); position: relative; z-index: 5; border-radius: 8px; }
.pl-item.off { opacity: .5; }
.pl-item .handle { cursor: grab; color: var(--text-3); padding: 6px 2px; touch-action: none; display: grid; place-items: center; }
.pl-item .handle svg { width: 18px; height: 18px; }
.pl-item .pos { width: 22px; text-align: center; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pl-item .nm { flex: 1; min-width: 0; }
.pl-item .nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .dur { width: 86px; display: flex; align-items: center; gap: 4px; }
.pl-item .dur input { padding: 6px 8px; min-height: 32px; text-align: right; }
.pl-item select { width: auto; min-height: 32px; padding: 4px 8px; font-size: 12.5px; }
.placeholder { height: 56px; background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: 8px; margin: 2px 8px; }

/* Zeitplan */
.week { display: flex; flex-direction: column; gap: 6px; }
.week .day { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; }
.week .day .lbl { font-size: 12.5px; }
.week .bar { position: relative; height: 34px; background: var(--gray-soft); border-radius: 7px; overflow: hidden; }
.week .seg-b { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 6px; font-size: 11.5px; font-weight: 600; color: #fff; overflow: hidden; white-space: nowrap; border-right: 1px solid rgba(255,255,255,.5); }
.week .hours { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.week .hours div { position: relative; height: 16px; font-size: 10.5px; color: var(--text-3); }
.week .hours span { position: absolute; transform: translateX(-50%); }
.week .nowline { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--red); z-index: 2; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-right: 5px; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(12, 14, 18, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .14s; }
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1180px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-b { padding: 18px 20px; max-height: calc(90vh - 130px); overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); }
.toast { background: #16181d; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .15s; max-width: 420px; }
.toast.ok { border-left: 4px solid var(--green); }
.toast.err { border-left: 4px solid var(--red); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 20% 0%, #2a2f3a 0%, #16181d 55%); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 18px; color: var(--text); }
.login .brand small { color: var(--text-3); }

/* Schnell-Update */
.wizard { max-width: 560px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--border); }
.steps i.on { background: var(--accent); }
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: 15px var(--font); color: var(--text); cursor: pointer; }
.pick button:hover { border-color: var(--accent); }
.pick button b { display: block; }
.pick button small { color: var(--text-3); }
.bigdrop { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 30px 16px; text-align: center; background: var(--surface); cursor: pointer; display: block; }
.bigdrop img, .bigdrop video { max-width: 100%; max-height: 260px; border-radius: 8px; }

/* Screenshot */
.shot { background: #0c0d10; border-radius: 10px; aspect-ratio: 16/9; display: grid; place-items: center; color: #8b92a0; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: contain; }

/* Design-Editor */
.editor { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.stagewrap { background: repeating-conic-gradient(var(--gray-soft) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; place-items: center; }
.dstage { position: relative; box-shadow: var(--shadow-lg); touch-action: none; }
.dstage canvas { display: block; width: 100%; height: 100%; }
.dbox { position: absolute; border: 1px dashed transparent; cursor: move; }
.dbox:hover { border-color: rgba(228,87,46,.6); }
.dbox.sel { border: 2px solid var(--accent); }
.dbox .rh { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; cursor: nwse-resize; display: none; }
.dbox.sel .rh { display: block; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tpl { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; }
.tpl:hover { border-color: var(--accent); }
.tpl canvas { width: 100%; display: block; aspect-ratio: 16/9; background: #222; }
.tpl div { padding: 10px 12px; font-weight: 600; }
.qrprev { background: #fff; padding: 12px; border-radius: 10px; display: inline-block; }
.qrprev svg { display: block; width: 160px; height: 160px; }

/* Responsive */
@media (max-width: 1100px) {
  .g-side { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .editor { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .shell.navopen .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.navopen::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 40; }
  .mobilebar b { flex: 1; font-size: 15px; }
  .mobilebar button { background: none; border: 0; color: #fff; padding: 6px; }
  .mobilebar svg { width: 22px; height: 22px; }
  .main { padding: 16px 14px 90px; }
  .g2, .g3, .frow, .frow3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat .v { font-size: 24px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 45; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 10.5px; color: var(--text-2); font-weight: 600; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a.fab svg { background: var(--accent); color: #fff; border-radius: 12px; padding: 4px; width: 32px; height: 28px; }
  /* Tabellen als Karten */
  table.t.resp thead { display: none; }
  table.t.resp tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.t.resp td { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; border: 0; padding: 4px 14px; text-align: right; justify-items: end; }
  table.t.resp td::before { content: attr(data-l); color: var(--text-3); font-size: 12px; text-align: left; font-weight: 500; grid-row: 1 / span 4; justify-self: start; }
  table.t.resp td > * { grid-column: 2; }
  table.t.resp td.first { display: block; font-size: 15px; text-align: left; }
  table.t.resp td.first::before { display: none; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-width: none; }
  .modal-b { max-height: calc(88vh - 130px); }
  .topbar h1 { font-size: 19px; }
  .toolbar input[type=search], .toolbar select { max-width: none; flex: 1 1 140px; }
  .pl-item { flex-wrap: wrap; }
  .pl-item .nm { flex-basis: calc(100% - 140px); }
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
