:root {
  --bg: #07080b;
  --bg2: #0c0e12;
  --panel: #111419;
  --panel2: #171b21;
  --panel3: #1e232a;
  --line: #232830;
  --line2: #303741;
  --text: #ece8df;
  --text2: #c3bfb6;
  --muted: #878c95;
  --gold: #c8a46a;
  --gold2: #e8d09c;
  --gold-dim: rgba(200, 164, 106, .13);
  --green: #62c193;
  --green-dim: rgba(98, 193, 147, .13);
  --red: #e4706f;
  --red-dim: rgba(228, 112, 111, .13);
  --amber: #e2b55e;
  --amber-dim: rgba(226, 181, 94, .14);
  --blue: #7aa9dc;
  --blue-dim: rgba(122, 169, 220, .13);
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --serif: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1100px 560px at 88% -12%, rgba(200, 164, 106, .075), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(122, 169, 220, .04), transparent 60%), var(--bg);
  color: var(--text); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; margin: 0 0 .5em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { font-family: Consolas, "SF Mono", monospace; font-size: 12.5px; color: var(--gold2); background: rgba(255, 255, 255, .04); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
::selection { background: rgba(200, 164, 106, .35); }
[hidden] { display: none !important; }

/* ---------- Grundlayout mit Seitenleiste ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.side {
  background: linear-gradient(180deg, #0d0f13, #090a0d); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto;
}
.marke { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.marke img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.marke img.kanzlei-logo { background: #fff; padding: 2px; border: 1px solid rgba(200, 164, 106, .45); border-radius: 10px; object-fit: cover; }
.marke .gipfel { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, #1d1a14, #0f0e0b); border: 1px solid rgba(200, 164, 106, .35); }
.marke .gipfel svg { width: 28px; height: 28px; }
.marke .name { font-family: var(--serif); font-size: 19px; line-height: 1.1; font-weight: 600; }
.marke .zusatz { font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .gruppe { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text2); font-size: 14px; }
.nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.nav a.aktiv { background: var(--gold-dim); color: var(--gold2); }
.nav a .zahl { margin-left: auto; background: var(--gold); color: #17120a; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side-fuss { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.side-fuss strong { color: var(--text); display: block; font-weight: 600; }
.main { min-width: 0; padding: 28px 34px 70px; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.kopf h1 { margin: 0; }
.kopf .unter { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.kopf .aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.zurueck { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.mobil-nav { display: none; }

/* ---------- Bausteine ---------- */
.karte { background: linear-gradient(180deg, var(--panel), #0f1216); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.karte + .karte { margin-top: 16px; }
.karte h2, .karte h3 { margin-bottom: 14px; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.karte-kopf h2, .karte-kopf h3 { margin: 0; }
.raster { display: grid; gap: 16px; }
.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.r-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.r-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.kpi { background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); opacity: .7; }
a.kpi:hover { border-color: var(--gold); text-decoration: none; }
.kpi .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.1px; }
.kpi .wert { font-family: var(--serif); font-size: 30px; margin-top: 2px; color: var(--text); line-height: 1.2; font-variant-numeric: lining-nums tabular-nums; }
.kpi .info { font-size: 12.5px; color: var(--muted); }
.kpi.gold .wert { color: var(--gold2); }
.kpi.gruen .wert { color: var(--green); }
.kpi.rot .wert { color: var(--red); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: var(--panel2);
  color: var(--text); padding: 9px 15px; border-radius: 10px; font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap; transition: .15s; text-decoration: none !important;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--gold); color: var(--gold2); }
.btn.gold { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #17120a; border-color: transparent; }
.btn.gold:hover { filter: brightness(1.08); color: #17120a; }
.btn.rot { color: var(--red); border-color: rgba(228, 112, 111, .4); }
.btn.rot:hover { background: var(--red-dim); }
.btn.gruen { color: var(--green); border-color: rgba(98, 193, 147, .4); }
.btn.klein { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.gross { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.leer { background: transparent; border-color: transparent; color: var(--text2); }
.btn.leer:hover { color: var(--gold2); background: var(--panel2); }
.btn.voll { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

label.feld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; }
label.feld > span { letter-spacing: .3px; }
label.feld small, .schalter small { color: var(--muted); font-size: 11.5px; opacity: .85; display: block; }
input, select, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 9px; padding: 9px 11px;
  font: 14px var(--sans); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
textarea.code { font-family: Consolas, "SF Mono", monospace; font-size: 13px; min-height: 460px; line-height: 1.6; tab-size: 2; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--gold); flex: none; margin: 1px 0 0; }
.mit-einheit { position: relative; }
.mit-einheit input { padding-right: 30px; }
.mit-einheit b { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--gold); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text2); cursor: pointer; }
.formular { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.formular .voll { grid-column: 1 / -1; }
.formular.f1 { grid-template-columns: 1fr; }
.formular.f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.abschnitt-titel { grid-column: 1 / -1; font-family: var(--serif); font-size: 17px; color: var(--gold2); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 6px; }

/* Schalter (Ja/Nein) */
.schalter { display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: 13.5px; color: var(--text2); padding: 4px 0; }
.schalter input { position: absolute; opacity: 0; pointer-events: none; }
.schalter .regler { width: 38px; height: 22px; border-radius: 12px; background: var(--panel3); border: 1px solid var(--line2); position: relative; flex: none; transition: .18s; }
.schalter .regler::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .18s; }
.schalter input:checked + .regler { background: var(--gold-dim); border-color: var(--gold); }
.schalter input:checked + .regler::after { left: 18px; background: var(--gold2); }
.schalter input:focus-visible + .regler { box-shadow: 0 0 0 3px var(--gold-dim); }

table.tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tab-wrap { overflow-x: auto; }
table.tab th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tab td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tab tr:last-child td { border-bottom: 0; }
table.tab tr.klickbar { cursor: pointer; }
table.tab tr.klickbar:hover td { background: var(--panel2); }
table.tab td.zahl, table.tab th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tab .unter { display: block; color: var(--muted); font-size: 12px; }
.leer-hinweis { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13.5px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-gold { background: var(--gold-dim); color: var(--gold2); }
.b-gruen { background: var(--green-dim); color: var(--green); }
.b-rot { background: var(--red-dim); color: var(--red); }
.b-gelb { background: var(--amber-dim); color: var(--amber); }
.b-blau { background: var(--blue-dim); color: var(--blue); }
.b-grau { background: rgba(255, 255, 255, .06); color: var(--muted); }

.hinweis { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; border: 1px solid; }
.hinweis + .hinweis { margin-top: 8px; }
.h-info { background: var(--blue-dim); border-color: rgba(122, 169, 220, .3); color: #bfd6ee; }
.h-warn { background: var(--amber-dim); border-color: rgba(226, 181, 94, .35); color: #f0d59f; }
.h-rot { background: var(--red-dim); border-color: rgba(228, 112, 111, .35); color: #f2b4b3; }
.h-gruen { background: var(--green-dim); border-color: rgba(98, 193, 147, .35); color: #ade0c6; }
.h-gold { background: var(--gold-dim); border-color: rgba(200, 164, 106, .35); color: var(--gold2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: thin; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.aktiv { color: var(--gold2); border-bottom-color: var(--gold); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter button { background: var(--panel); border: 1px solid var(--line); color: var(--text2); border-radius: 20px; padding: 6px 13px; font: 600 12.5px var(--sans); cursor: pointer; }
.filter button.aktiv { background: var(--gold-dim); border-color: var(--gold); color: var(--gold2); }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.klein { font-size: 12.5px; }
.gold-t { color: var(--gold2); }
.rot-t { color: var(--red); }
.gruen-t { color: var(--green); }
.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.zeile.zw { justify-content: space-between; }
.stapel > * + * { margin-top: 12px; }
.suche { max-width: 300px; }
.serif { font-family: var(--serif); }

/* Kacheln (Vorlagen-Auswahl) */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.kachel { background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); font: inherit; }
.kachel:hover { border-color: var(--gold); transform: translateY(-2px); }
.kachel .kat { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); }
.kachel .t { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.kachel .b { font-size: 13px; color: var(--muted); }

/* Verlauf */
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { position: relative; padding: 0 0 14px 20px; font-size: 13px; color: var(--text2); }
.verlauf li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.verlauf li::after { content: ""; position: absolute; left: 6.5px; top: 16px; bottom: 0; width: 1px; background: var(--line2); }
.verlauf li:last-child::after { display: none; }
.verlauf small { display: block; color: var(--muted); font-size: 11.5px; }

/* Link + Code */
.code-box { background: radial-gradient(400px 160px at 50% 0, rgba(200, 164, 106, .14), transparent 70%), var(--bg2); border: 1px solid rgba(200, 164, 106, .35); border-radius: 14px; padding: 18px; text-align: center; }
.code-box .code { font-family: Consolas, "SF Mono", monospace; font-size: 38px; letter-spacing: 10px; color: var(--gold2); font-weight: 700; padding-left: 10px; }
.link-zeile { display: flex; gap: 8px; align-items: center; }
.link-zeile input { font-family: Consolas, monospace; font-size: 12.5px; color: var(--text2); }

/* Platzhalter-Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel2); border: 1px solid var(--line2); color: var(--text2); border-radius: 7px; padding: 3px 8px; font: 12px Consolas, monospace; cursor: pointer; }
.chip:hover { border-color: var(--gold); color: var(--gold2); }
.chip.befehl { color: var(--blue); }

/* Feld-Editor */
.feld-liste { display: flex; flex-direction: column; gap: 8px; }
.feld-zeile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px; }
.feld-zeile input, .feld-zeile select { padding: 7px 9px; font-size: 13px; }
.feld-zeile .mehr { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.feld-zeile .key { font-family: Consolas, monospace; font-size: 12.5px; color: var(--gold2); }
.feld-zeile .knoepfe { display: flex; gap: 2px; grid-row: span 2; }
.feld-zeile .knoepfe .btn { padding: 5px 8px; }

/* Editor-Layout */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.editor.dok-links { grid-template-columns: minmax(0, 1.7fr) minmax(380px, 1fr); }
.sticky { position: sticky; top: 16px; }

/* Modal & Toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: ein .15s; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal.breit { width: min(900px, 100%); }
.modal .m-kopf { padding: 18px 22px 0; }
.modal .m-inhalt { padding: 12px 22px 4px; }
.modal .m-fuss { padding: 16px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes ein { from { opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel3); border: 1px solid var(--line2); border-left: 3px solid var(--gold); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 380px; animation: ein .2s; }
.toast.fehler { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }

/* Login */
.login-seite { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-bild {
  background: radial-gradient(800px 500px at 20% 15%, rgba(200, 164, 106, .17), transparent 60%), linear-gradient(160deg, #101216, #060709);
  border-right: 1px solid var(--line); padding: 50px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-bild .berge { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; opacity: .5; pointer-events: none; }
.login-bild h1 { font-size: 50px; line-height: 1.05; max-width: 520px; position: relative; }
.login-bild p { color: var(--text2); max-width: 440px; font-size: 15.5px; position: relative; }
.login-bild .marke { border: 0; position: relative; }
.login-form { display: grid; place-items: center; padding: 40px 20px; }
.login-form .karte { width: min(420px, 100%); padding: 30px; }
.mobil-marke { display: none; }
.linie-gold { width: 48px; height: 2px; background: var(--gold); margin: 14px 0 18px; }

/* ---------- Gemeinsame Anmeldeseite ---------- */
.anmelden { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); }
.anm-buehne { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 56px 64px 40px;
  background: radial-gradient(900px 640px at 30% 32%, rgba(200, 164, 106, .16), transparent 62%), radial-gradient(700px 500px at 100% 100%, rgba(122, 169, 220, .06), transparent 60%), linear-gradient(160deg, #101217, #06070a);
  border-right: 1px solid var(--line); }
.anm-buehne::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(circle at 35% 40%, #000, transparent 70%); -webkit-mask-image: radial-gradient(circle at 35% 40%, #000, transparent 70%); pointer-events: none; }
.anm-glanz { position: absolute; width: 520px; height: 520px; left: -60px; top: 6%; border-radius: 50%; border: 1px solid rgba(200, 164, 106, .16); box-shadow: 0 0 0 46px rgba(200, 164, 106, .03), 0 0 0 110px rgba(200, 164, 106, .02); pointer-events: none; }
.anm-inhalt { position: relative; max-width: 560px; animation: hoch .6s ease both; }
.anm-medaillon { width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle at 50% 42%, #ffffff 0%, #fbf9f4 55%, #ece5d6 100%); display: grid; place-items: center; margin-bottom: 30px;
  box-shadow: 0 0 0 1px rgba(200, 164, 106, .55), 0 0 0 9px rgba(200, 164, 106, .08), 0 0 0 10px rgba(200, 164, 106, .3), 0 30px 70px rgba(0, 0, 0, .55), 0 0 90px rgba(200, 164, 106, .18); }
.anm-medaillon img { width: 84%; height: 84%; object-fit: contain; transform: translateY(4px); }
.anm-eyebrow { font-size: 11.5px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.anm-inhalt h1 { font-size: 54px; line-height: 1.04; margin: 10px 0 16px; letter-spacing: .3px; background: linear-gradient(180deg, #f6f1e6, #d9cdb4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.anm-lead { color: var(--text2); font-size: 16px; line-height: 1.6; max-width: 480px; margin: 0 0 30px; }
.anm-vorteile { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.anm-vorteile li { display: flex; gap: 14px; align-items: flex-start; }
.anm-vorteile strong { display: block; font-size: 14.5px; color: var(--text); }
.anm-vorteile span:not(.anm-icon) { font-size: 13px; color: var(--muted); }
.anm-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--gold2); background: var(--gold-dim); border: 1px solid rgba(200, 164, 106, .3); }
.anm-icon svg { width: 18px; height: 18px; }
.anm-fuss { position: relative; margin-top: 46px; font-size: 12px; color: var(--muted); letter-spacing: .4px; }
.anm-seite { display: grid; place-items: center; padding: 40px 28px; background: radial-gradient(600px 400px at 50% 30%, rgba(200, 164, 106, .05), transparent 70%); }
.anm-karte { width: min(420px, 100%); background: linear-gradient(180deg, rgba(24, 27, 33, .92), rgba(15, 17, 21, .92)); border: 1px solid var(--line2); border-radius: 20px; padding: 34px 32px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .04); animation: hoch .6s .08s ease both; }
.anm-karte h2 { font-size: 32px; margin: 4px 0 6px; }
.anm-karte > p { margin: 0 0 22px; font-size: 13.5px; }
.anm-mobil-logo { display: none; }
.anm-feld { display: block; margin-bottom: 14px; }
.anm-feld > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; letter-spacing: .3px; }
.anm-feld > div { position: relative; }
.anm-feld > div > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.anm-feld input { padding: 12px 42px 12px 40px; font-size: 15px; border-radius: 11px; background: #0a0c0f; }
.anm-feld input:focus + .anm-auge, .anm-feld div:focus-within > svg { color: var(--gold2); }
.anm-auge { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 7px; display: grid; }
.anm-auge svg { width: 18px; height: 18px; }
.anm-auge:hover, .anm-auge.an { color: var(--gold2); }
.anm-los { margin-top: 8px; border-radius: 12px !important; letter-spacing: .4px; box-shadow: 0 10px 30px rgba(200, 164, 106, .22); }
.anm-hinweise { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.anm-hinweise strong { color: var(--text2); }
.anm-pruefen { margin-top: 18px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--text2); font-size: 13px; text-decoration: none !important; transition: .15s; }
.anm-pruefen svg { width: 20px; height: 20px; color: var(--gold2); flex: none; }
.anm-pruefen span { flex: 1; }
.anm-pruefen strong { color: var(--gold2); }
.anm-pruefen:hover { border-color: var(--gold); }
@keyframes hoch { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 980px) {
  .anmelden { grid-template-columns: 1fr; }
  .anm-buehne { display: none; }
  .anm-seite { min-height: 100vh; padding: 28px 16px; background: radial-gradient(500px 360px at 50% 0%, rgba(200, 164, 106, .14), transparent 70%), var(--bg); }
  .anm-karte { padding: 26px 20px 20px; }
  .anm-mobil-logo { display: block; width: 150px; margin: 0 auto 18px; background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 0 0 1px rgba(200, 164, 106, .45), 0 16px 40px rgba(0, 0, 0, .45); }
}

/* Unterschrift */
.sig-tabs { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; margin-bottom: 8px; }
.sig-tabs button { background: none; border: 0; color: var(--muted); padding: 6px 13px; border-radius: 7px; font: 600 12.5px var(--sans); cursor: pointer; }
.sig-tabs button.aktiv { background: var(--gold-dim); color: var(--gold2); }
.sig-flaeche-wrap { position: relative; background: #fbfaf6; border-radius: 12px; border: 1px solid var(--line2); height: 170px; overflow: hidden; }
.sig-flaeche-wrap::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 38px; border-bottom: 1px dashed #c9c2b2; pointer-events: none; }
.sig-pad { width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; position: relative; z-index: 1; }
.sig-tipp { padding: 12px 16px; height: 100%; display: flex; flex-direction: column; }
.sig-eingabe { width: calc(100% - 70px) !important; background: #fff !important; color: #222 !important; border-color: #d8d1c2 !important; }
.sig-vorschau { flex: 1; display: flex; align-items: center; font-size: 46px; color: #13213d; white-space: nowrap; overflow: hidden; padding-left: 8px; }
.sig-hinweis { position: absolute; left: 24px; bottom: 14px; font-size: 11.5px; color: #a29b8c; letter-spacing: .5px; pointer-events: none; z-index: 0; }
.sig-loeschen { position: absolute; right: 8px; top: 8px; z-index: 2; color: #6b665d !important; }
.sig-loeschen:hover { background: rgba(0, 0, 0, .05) !important; }

/* ---------- Dokument (Papier) ---------- */
.papier-wrap { background: #191c21; border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); overflow-x: auto; }
.papier-wrap.kompakt { padding: 10px; }
.dokument { position: relative; overflow: hidden; background: #fbfaf6; color: #1d1c1a; max-width: 1040px; margin: 0 auto; padding: 56px 64px 44px; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); font: 16.5px/1.7 "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; font-variant-numeric: lining-nums; }
/* Kopierschutz: Vertragstexte lassen sich nicht markieren oder herausziehen */
.dokument { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dokument img { pointer-events: none; -webkit-user-drag: none; }
.papier-wrap.kompakt .dokument { padding: 36px 40px 30px; font-size: 15.5px; }
.wasserzeichen { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-32deg); font: 700 64px var(--sans); color: rgba(120, 115, 105, .12); white-space: nowrap; pointer-events: none; text-transform: uppercase; letter-spacing: 4px; }
.wasserzeichen.rot { color: rgba(179, 65, 47, .14); }
.dok-kopf { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 2px solid #b8955a; padding-bottom: 14px; margin-bottom: 26px; min-height: 70px; }
.dok-marke img { max-height: 62px; max-width: 150px; object-fit: contain; display: block; }
.dok-adr { text-align: right; font: 13.5px/1.5 var(--sans); color: #5a564f; }
.dok-firma { font: 700 22px var(--sans); color: #1d1c1a; margin-bottom: 2px; }
.dok-titel { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: 3.5px; text-transform: uppercase; margin: 4px 0 4px; }
.dok-meta { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; font: 13.5px var(--sans); color: #5a564f; margin-bottom: 22px; }
.dok-parteien { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.dok-parteien > div { border: 1px solid #d9d2c3; border-radius: 6px; padding: 13px 16px; font: 13.5px/1.5 var(--sans); color: #5a564f; }
.dok-parteien > div > span { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #a8843f; }
.dok-parteien strong { display: block; font: 700 18px Georgia, serif; color: #1d1c1a; margin: 2px 0; }
.dok-text h3 { font: 700 17px var(--sans); margin: 18px 0 5px; color: #1d1c1a; }
.dok-text p { margin: 0 0 10px; text-align: justify; }
.dok-text ul { margin: 2px 0 10px; padding-left: 22px; }
/* ---------- Visueller Vorlagen-Editor ---------- */
.vorlage-ed { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.ved-karte { padding: 16px; }
.ved-wrap { border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; background: #0c0e12; }
.ved-leiste { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px; background: var(--panel2); border-bottom: 1px solid var(--line2); }
.ved-leiste button, .ved-leiste select { width: auto; background: var(--panel3); border: 1px solid var(--line2); color: var(--text2); border-radius: 8px; padding: 6px 10px; font: 600 12.5px var(--sans); cursor: pointer; }
.ved-leiste button:hover { border-color: var(--gold); color: var(--gold2); }
.ved-leiste button.aktiv { background: var(--gold-dim); color: var(--gold2); border-color: var(--gold); }
.ved-leiste button:disabled, .ved-leiste select:disabled { opacity: .4; pointer-events: none; }
.ved-leiste .gold-k { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #17120a; border-color: transparent; }
.ved-leiste .ved-trenner { width: 1px; height: 22px; background: var(--line2); margin: 0 4px; }
.ved-leiste .ved-rechts { margin-left: auto; }
.ved { min-height: 520px; max-height: 75vh; overflow-y: auto; padding: 34px 40px; background: #fbfaf6; color: #1d1c1a; font: 15px/1.7 "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; outline: none; }
.ved:focus { box-shadow: inset 0 0 0 2px var(--gold-dim); }
.ved h3 { font: 700 16px var(--sans); color: #1d1c1a; margin: 18px 0 6px; }
.ved p { margin: 0 0 10px; }
.ved ul { margin: 0 0 10px; padding-left: 22px; }
.ved b, .ved strong { font-weight: 700; }
.ved-quelle { min-height: 520px; border: 0; border-radius: 0; }
.ved-fuss { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--panel2); border-top: 1px solid var(--line2); }
table.ed-tab { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font: 13.5px/1.45 var(--sans); }
table.ed-tab th { background: #1f2f48; color: #fff; padding: 6px 9px; border: 1px solid #1f2f48; text-align: left; }
table.ed-tab td { padding: 6px 9px; border: 1px solid #b9c0cb; min-width: 40px; }
.ed-feld, .ed-bef { display: inline-block; border-radius: 6px; padding: 0 7px; margin: 0 1px; font: 600 12.5px/1.6 var(--sans); cursor: default; user-select: all; vertical-align: baseline; white-space: nowrap; }
.ed-feld { background: #f3e7c9; color: #6b4f16; border: 1px solid #d9bd7d; }
.ed-feld::before { content: "▸ "; opacity: .55; }
.ed-wenn { background: #dfeafb; color: #1d4a8a; border: 1px solid #a9c4ec; cursor: pointer; }
.ed-sonst { background: #ece3fa; color: #5a3591; border: 1px solid #c9b3ee; }
.ed-ende { background: #eceae4; color: #6d6a62; border: 1px solid #d4d0c6; }
.ed-plan { background: #dcf1ea; color: #1e6650; border: 1px solid #a7d9c6; }
mark.ed-luecke { background: #ffe58a; color: #5c4600; border-radius: 3px; padding: 0 3px; cursor: pointer; box-shadow: 0 0 0 1px #e6c34a; }
mark.ed-luecke:hover { background: #ffd54a; }
details.klapp > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
details.klapp > summary::-webkit-details-marker { display: none; }
details.klapp > summary h3 { margin: 0; }
details.klapp > summary h3::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--gold); transition: transform .15s; }
details.klapp[open] > summary h3::before { transform: rotate(90deg); }
.ved-liste { max-height: 55vh; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.ved-gruppe { grid-column: 1 / -1; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 8px 0 2px; }
.ved-wahl { text-align: left; background: var(--bg2); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; color: var(--text); cursor: pointer; font: 13px var(--sans); }
.ved-wahl:hover { border-color: var(--gold); }
.ved-wahl strong { display: block; font-weight: 600; }
.ved-wahl span { display: block; font-size: 11.5px; color: var(--muted); }
@media (max-width: 860px) { .ved { padding: 20px 16px; min-height: 380px; } }

/* Eingabe-Raster für Tabellen-Felder */
.tab-eingabe { background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 8px; overflow-x: auto; }
.tab-eingabe table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.tab-eingabe th { text-align: left; font: 600 11.5px var(--sans); color: var(--muted); padding: 4px 6px; white-space: nowrap; }
.tab-eingabe td { padding: 3px; }
.tab-eingabe td input { padding: 7px 9px; font-size: 13px; min-width: 90px; }
.tab-eingabe td.tab-weg { width: 34px; }
table.dok-tab { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font: 13px/1.45 var(--sans); }
table.dok-tab th { background: #1f2f48; color: #fff; text-align: left; font-weight: 600; padding: 7px 10px; border: 1px solid #1f2f48; }
table.dok-tab td { padding: 7px 10px; border: 1px solid #b9c0cb; vertical-align: top; color: #1d1c1a; height: 30px; }
table.dok-tab tr:nth-child(even) td { background: rgba(31, 47, 72, .03); }
.papier-wrap.kompakt table.dok-tab { font-size: 12.5px; }
.ph-fehlt { background: #fde3d6; color: #9a2a10; padding: 0 4px; border-radius: 3px; font: 13.5px var(--sans); font-weight: 400; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.papier-wrap.kompakt .dok-text p { text-align: left; }
.ph-wert { background: rgba(200, 164, 106, .18); border-radius: 3px; padding: 0 2px; }
.dok-sig { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 34px; page-break-inside: avoid; }
.sig-block .sig-titel { font: 700 10px var(--sans); color: #a8843f; text-transform: uppercase; letter-spacing: 1.3px; }
.sig-block .sig-ort { font: 11.5px var(--sans); color: #6b675f; margin-top: 2px; }
.sig-block .sig-flaeche { height: 76px; display: flex; align-items: flex-end; position: relative; margin-top: 4px; }
.sig-block .sig-flaeche img { max-height: 72px; max-width: 75%; }
.sig-block .sig-stempel { position: absolute; right: 0; bottom: -6px; max-height: 84px !important; max-width: 110px !important; opacity: .9; }
.sig-block .sig-linie { border-top: 1px solid #333; padding-top: 4px; font: 12px var(--sans); color: #333; }
.dok-siegel { display: flex; gap: 18px; align-items: center; margin-top: 30px; padding-top: 14px; border-top: 1px solid #e3dccd; font: 11px/1.5 var(--sans); color: #6b675f; }
.dok-siegel strong { color: #1d1c1a; font-size: 12px; }
.dok-siegel code { background: none; color: #5a564f; padding: 0; }
.stempel { flex: none; width: 128px; border: 1.6px solid #a8843f; border-radius: 7px; padding: 6px 8px 5px; box-shadow: inset 0 0 0 3px #fbfaf6, inset 0 0 0 3.8px #a8843f; transform: rotate(-5deg); text-align: center; opacity: .93; }
.stempel img { width: 100%; height: 76px; object-fit: contain; display: block; }
.stempel span { display: block; white-space: nowrap; font: 700 9px Georgia, serif; letter-spacing: .8px; text-transform: uppercase; color: #a8843f; margin-top: 2px; }
.siegel { width: 82px; height: 82px; flex: none; border-radius: 50%; border: 2px solid #a8843f; box-shadow: inset 0 0 0 4px #fbfaf6, inset 0 0 0 5px #a8843f; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #a8843f; text-align: center; line-height: 1.15; }
.siegel b { font: 700 10px Georgia, serif; text-transform: uppercase; letter-spacing: .5px; max-width: 62px; }
.siegel i { width: 36px; border-top: 1px solid #a8843f; margin: 3px 0; }
.siegel span { font-size: 6.5px; text-transform: uppercase; letter-spacing: .4px; }
.siegel em { font-style: normal; font-weight: 700; font-size: 6.5px; text-transform: uppercase; margin-top: 1px; }

/* ---------- Öffentliche Seite (Unterschrift/Prüfung) ---------- */
.oeff-top { border-bottom: 1px solid var(--line); background: rgba(7, 8, 11, .85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.oeff-top .innen { max-width: none; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 32px; }
.oeff-top .marke { border: 0; padding: 0; margin: 0; }
.oeff-main { max-width: none; margin: 0; padding: 28px 32px 70px; }
.mittig { max-width: 470px; margin: 6vh auto 0; }
.code-eingabe { display: flex; gap: 8px; justify-content: center; margin: 18px 0 8px; }
.code-eingabe input { width: 50px; height: 60px; text-align: center; font: 700 26px Consolas, monospace; color: var(--gold2); padding: 0; }
.ergebnis { text-align: center; padding: 26px 20px; }
.ergebnis .gross-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; font-size: 30px; }
.ergebnis.echt .gross-icon { background: var(--green-dim); color: var(--green); border: 1px solid rgba(98, 193, 147, .4); }
.ergebnis.falsch .gross-icon { background: var(--red-dim); color: var(--red); border: 1px solid rgba(228, 112, 111, .4); }
.ergebnis.warn .gross-icon { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(226, 181, 94, .4); }
.schritte { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.schritte span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; }
.schritte span.aktiv { color: var(--gold2); border-color: var(--gold); background: var(--gold-dim); }
.schritte span.fertig { color: var(--green); border-color: rgba(98, 193, 147, .4); }

@media (max-width: 1150px) {
  .r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-2-1, .r-1-2, .editor { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .side.offen { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 40; width: 272px; box-shadow: var(--shadow); }
  .mobil-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; z-index: 30; }
  .mobil-nav .marke { border: 0; padding: 0; margin: 0; }
  .main { padding: 20px 16px 60px; }
  .r2, .r3, .r4 { grid-template-columns: 1fr; }
  .formular, .formular.f3 { grid-template-columns: 1fr; }
  .login-seite { grid-template-columns: 1fr; }
  .login-bild { display: none; }
  .mobil-marke { display: block; }
  .mobil-marke .marke { padding-bottom: 14px; }
  .dokument { padding: 24px 18px; font-size: 13px; }
  .dok-kopf { flex-direction: column; align-items: flex-start; }
  .dok-adr { text-align: left; }
  .dok-parteien, .dok-sig { grid-template-columns: 1fr; }
  .dok-titel { font-size: 19px; letter-spacing: 2px; }
  .papier-wrap { padding: 8px; }
  .feld-zeile { grid-template-columns: 1fr; }
  .feld-zeile .knoepfe { grid-row: auto; }
  .feld-zeile .mehr { grid-column: 1; grid-template-columns: 1fr; }
  .code-box .code { font-size: 30px; letter-spacing: 6px; }
  .code-eingabe input { width: 42px; height: 52px; font-size: 22px; }
  .oeff-top .innen { padding: 10px 16px; }
  .oeff-main { padding: 20px 16px 60px; }
}
