:root {
  --bg: #f4f5f8; --panel: #ffffff; --line: #e3e6ec; --line2: #eef0f4; --text: #1c2230; --muted: #6a7385; --faint: #9aa2b1;
  --pri: #3b5bdb; --pri-2: #2f4ac0; --pri-soft: #edf1ff; --ok: #2b8a3e; --ok-soft: #e6f6ea; --warn: #e67700; --warn-soft: #fff4e0;
  --bad: #d6336c; --bad-soft: #ffeef3; --radius: 10px; --shadow: 0 1px 2px rgba(20,28,45,.05), 0 4px 16px rgba(20,28,45,.06);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--pri); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 10px; }
.sp { flex: 1; }
.hidden { display: none !important; }

/* Buttons & Inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 550; white-space: nowrap; text-decoration: none; color: var(--text); transition: background .12s, border-color .12s; }
.btn:hover { background: #f6f7fa; border-color: #d3d8e2; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eceff4; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 28px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.on { background: var(--pri-soft); border-color: #c5d0fa; color: var(--pri-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 0 12px; height: 32px; cursor: pointer; color: var(--muted); font-weight: 550; }
.seg button.on { background: var(--pri-soft); color: var(--pri-2); }
.seg button + button { border-left: 1px solid var(--line); }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: #8ea2f0; box-shadow: 0 0 0 3px rgba(59,91,219,.12); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: #3c4456; }
.field .hint { font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--pri); }

/* Layout */
.topbar { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--text); }
.brand img { width: 28px; height: 28px; }
.brand small { font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 2px; }
.nav a { padding: 7px 12px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 550; }
.nav a:hover { background: #f1f3f7; color: var(--text); }
.nav a.on { background: var(--pri-soft); color: var(--pri-2); }
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.page.wide { max-width: 1500px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.section { margin-top: 28px; }
.section > .row:first-child { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.empty { padding: 36px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0f4; color: #4a5263; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: #b35c00; } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.pri { background: var(--pri-soft); color: var(--pri-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c4c9d3; display: inline-block; }
.dot.on { background: #2fb344; box-shadow: 0 0 0 3px rgba(47,179,68,.18); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--pri-2); border-color: var(--pri); }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.kbd { font: 12px ui-monospace, monospace; background: #f1f3f7; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: linear-gradient(150deg, #3b5bdb, #5c3bdb 60%, #8e3bdb); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 36px; margin: 18px 0 12px; }
.auth-side p { opacity: .85; font-size: 16px; max-width: 440px; }
.auth-main { display: grid; place-items: center; padding: 30px; background: #fff; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-box .btn.pri { width: 100%; justify-content: center; height: 40px; margin-top: 6px; }
.err { color: var(--bad); background: var(--bad-soft); padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }
.mock-mail { background: rgba(255,255,255,.12); border-radius: 12px; padding: 14px 16px; margin-top: 10px; backdrop-filter: blur(4px); max-width: 420px; }
.mock-mail b { display: block; } .mock-mail span { opacity: .8; font-size: 13px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* Thumbnails */
.thumb { position: relative; overflow: hidden; background: #e9ecf1; border-radius: 10px 10px 0 0; height: 220px; }
.thumb iframe { position: absolute; top: 0; left: 0; border: 0; pointer-events: none; transform-origin: 0 0; background: #fff; }
.dcard { cursor: pointer; transition: transform .12s, box-shadow .12s; overflow: hidden; }
.dcard:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(20,28,45,.12); }
.dcard .meta { padding: 12px 14px; display: flex; gap: 8px; align-items: center; }
.dcard .meta .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tpl { border: 2px solid var(--line); border-radius: 12px; cursor: pointer; overflow: hidden; background: #fff; }
.tpl:hover { border-color: #9fb0f3; }
.tpl .thumb { height: 190px; border-radius: 0; }
.tpl .info { padding: 10px 12px; }
.tpl .info b { display: block; }
.tpl .info span { font-size: 12px; color: var(--muted); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20,24,35,.45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.lg { max-width: 900px; } .modal.xl { max-width: 1280px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-b { padding: 18px 20px; overflow: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #1c2230; color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: fade .15s; max-width: 520px; }
.toast.bad { background: var(--bad); } .toast.ok { background: #1f7a33; }

/* ───────── Designer ───────── */
.ed { display: grid; grid-template-rows: 56px 1fr; height: 100vh; overflow: hidden; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); }
.ed-top .title { border: 1px solid transparent; background: none; font-weight: 650; font-size: 15px; padding: 5px 8px; border-radius: 7px; width: 240px; }
.ed-top .title:hover, .ed-top .title:focus { border-color: var(--line); outline: none; background: #fff; }
.save-state { font-size: 12px; color: var(--faint); min-width: 90px; }
.ed-body { display: grid; grid-template-columns: 250px 1fr 340px; min-height: 0; }
.ed-left, .ed-right { background: #fff; overflow: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); }
.ed-right { border-left: 1px solid var(--line); }
.ptabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.ptabs button { flex: 1; border: 0; background: none; padding: 11px 6px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.ptabs button.on { color: var(--pri-2); border-color: var(--pri); }
.pbody { padding: 14px; }
.pal-group { margin-bottom: 14px; }
.pal-group h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.pal { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pal-item { border: 1px solid var(--line); border-radius: 9px; padding: 10px 6px 8px; text-align: center; cursor: grab; background: #fafbfc; user-select: none; transition: border-color .1s, background .1s; }
.pal-item:hover { border-color: #9fb0f3; background: var(--pri-soft); }
.pal-item i { display: block; font-style: normal; font-size: 18px; margin-bottom: 3px; color: #4a5263; }
.pal-item span { font-size: 12px; font-weight: 550; }
.ed-canvas { overflow: auto; background: #e9ecf1; min-height: 0; padding: 24px; position: relative; }
.ed-canvas.mobile .frame-wrap { width: 395px; padding: 54px 10px 40px; background: #1c2230; border-radius: 42px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.ed-canvas.mobile .frame-wrap iframe { border-radius: 4px; }
.frame-wrap { margin: 0 auto; width: 100%; max-width: 760px; }
.frame-wrap iframe { display: block; width: 100%; border: 0; background: #fff; min-height: 400px; }
.ed-canvas.mobile .frame-wrap iframe { width: 375px; }
.inbox { background: #fff; border-radius: 10px; margin: 0 auto 16px; max-width: 760px; box-shadow: var(--shadow); overflow: hidden; }
.ed-canvas.mobile .inbox { max-width: 395px; }
.inbox-h { padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line2); display: flex; gap: 8px; align-items: center; }
.mail-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line2); align-items: start; }
.mail-row:last-child { border-bottom: 0; }
.mail-row .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.mail-row .from { font-weight: 700; font-size: 13.5px; } .mail-row .subj { font-size: 13.5px; } .mail-row .pre { font-size: 13px; color: var(--muted); }
.mail-row .clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row .time { font-size: 12px; color: var(--muted); }
.mail-row.dim { opacity: .55; } .mail-row.dim .from, .mail-row.dim .subj { font-weight: 500; }
.mail-row.me { background: #f7f9ff; }
.insp-h { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.insp-h b { flex: 1; }
.color-in { display: flex; gap: 6px; align-items: center; }
.color-in input[type=color] { width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.color-in .input { flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }
.swatches { display: flex; gap: 4px; margin-top: 4px; }
.swatches span { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.1); cursor: pointer; }
.img-in { display: flex; gap: 8px; align-items: center; }
.img-in .prev { width: 64px; height: 48px; border-radius: 6px; background: #eef0f4 center/cover no-repeat; border: 1px solid var(--line); flex: none; }
.md-tools { display: flex; gap: 4px; margin-bottom: 4px; }
.md-tools button { height: 26px; min-width: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12.5px; padding: 0 7px; }
.md-tools button:hover { background: var(--pri-soft); }
.items .it { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; }
.items .it-h { display: flex; align-items: center; gap: 6px; padding: 7px 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.items .it-h .prev { width: 30px; height: 30px; border-radius: 5px; background: #eee center/cover; }
.items .it-b { padding: 4px 10px 2px; border-top: 1px solid var(--line2); }
.blocklist .bl { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.blocklist .bl:hover { background: #f3f5f9; } .blocklist .bl.on { background: var(--pri-soft); color: var(--pri-2); font-weight: 600; }
.blocklist .bl i { font-style: normal; width: 18px; text-align: center; color: var(--muted); }
.blocklist .bl .st { margin-left: auto; }

/* Prüfung */
.score { display: flex; align-items: center; gap: 14px; padding: 14px; }
.ring { --p: 0; --c: var(--ok); width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eceff4 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-v); color: var(--text); width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 750; font-size: 15px; }
.ring.lg { width: 92px; height: 92px; } .ring.lg::after { width: 74px; height: 74px; font-size: 22px; }
.chk-group h4 { margin: 14px 14px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.chk { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 8px 14px; cursor: pointer; }
.chk:hover { background: #f7f8fb; }
.chk .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px; }
.chk.ok .ic { background: var(--ok); } .chk.warn .ic { background: var(--warn); } .chk.fail .ic { background: var(--bad); } .chk.na .ic { background: #c4c9d3; }
.chk b { font-size: 13px; font-weight: 600; display: block; }
.chk .m { font-size: 12.5px; color: var(--muted); }
.chk .req { font-size: 10.5px; font-weight: 700; color: var(--bad); text-transform: uppercase; margin-left: 4px; }
.chk .ex { font-size: 12px; color: #4a5263; background: #f6f7fa; border-radius: 6px; padding: 6px 8px; margin-top: 5px; display: none; }
.chk.open .ex { display: block; }

/* Live */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lcard { overflow: hidden; cursor: pointer; }
.lcard .thumb { height: 280px; }
.lcard .meta { padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.lcard .meta .n { font-weight: 650; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard .sub { padding: 0 12px 10px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.lcard.off { opacity: .6; }
.lcard .badge { position: absolute; top: 8px; right: 8px; z-index: 2; }
.view-split { display: grid; grid-template-columns: 1fr 395px; gap: 20px; align-items: start; }
.view-split .desk iframe, .view-split .mob iframe { width: 100%; border: 0; background: #fff; display: block; border-radius: 8px; }
.view-split .mob { background: #1c2230; padding: 40px 10px 30px; border-radius: 36px; }
.view-split .mob iframe { width: 375px; }

/* Abgaben */
.subs { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.sub-list .si { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.sub-list .si:hover { background: #f7f8fb; } .sub-list .si.on { background: var(--pri-soft); }
.sub-list .si .n { font-weight: 600; } .sub-list .si .d { font-size: 12px; color: var(--muted); }
.rub { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.crit-table td { padding: 7px 8px; }
.crit-table input[type=number] { width: 64px; height: 30px; }

/* Präsentation */
.pres { position: fixed; inset: 0; background: #12151d; color: #fff; display: grid; grid-template-rows: 1fr 64px; z-index: 50; }
.pres-stage { display: flex; gap: 32px; align-items: flex-start; justify-content: center; padding: 28px 28px 0; overflow: hidden; min-height: 0; }
.pres-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; height: 100%; }
.pres .scrollbox { overflow: auto; border-radius: 10px; background: #fff; flex: 1; min-height: 0; }
.pres .scrollbox iframe { border: 0; display: block; width: 100%; }
.pres .phone { background: #000; border-radius: 44px; padding: 48px 10px 36px; height: 100%; display: flex; box-shadow: 0 0 0 2px #2d3240; }
.pres .phone .scrollbox { border-radius: 6px; width: 375px; flex: none; }
.pres .inbox { margin: 0; color: var(--text); }
.pres-bar { display: flex; align-items: center; gap: 14px; padding: 0 24px; background: #0b0d12; border-top: 1px solid #232838; }
.pres-bar .n { font-size: 18px; font-weight: 700; }
.pres-bar .btn { background: #232838; border-color: #2f3547; color: #fff; }
.pres-bar .btn:hover { background: #2f3547; }
.pres-bar .btn.on { background: #3b5bdb; border-color: #3b5bdb; }
.pres-check { width: 380px; background: #fff; color: var(--text); border-radius: 12px; overflow: auto; flex: none; height: 100%; }
.pres-big-inbox { width: min(900px, 90vw); margin-top: 10vh; transform: scale(1.25); transform-origin: top center; }

@media (max-width: 1100px) {
  .ed-body { grid-template-columns: 210px 1fr 300px; }
  .view-split, .subs { grid-template-columns: 1fr; }
}
.ring.sm { width: 42px; height: 42px; } .ring.sm::after { width: 32px; height: 32px; font-size: 11px; }
