:root {
  --blau: #0b2a4a; --akzent: #1f6feb; --grund: #eef1f5; --karte: #fff; --text: #1a1f2b; --leise: #5b6577; --linie: #d6dbe3;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; background: var(--grund); overflow: hidden; }
button { font: inherit; cursor: pointer; border: 1px solid var(--linie); background: #fff; color: var(--text); border-radius: 6px; padding: 5px 10px; }
button:hover:not(:disabled) { border-color: var(--akzent); }
button:disabled { opacity: .45; cursor: default; }
button.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.link { border: 0; background: none; padding: 0; color: var(--akzent); text-decoration: underline; }

.leiste { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 6px 12px; background: var(--blau); color: #fff; }
.leiste button { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.leiste button.aktiv { background: #fff; color: var(--blau); }
.leiste button.primaer { background: var(--akzent); border-color: #5a98ff; }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.marke img { width: 26px; height: 26px; border-radius: 6px; }
.gruppe { display: flex; gap: 4px; align-items: center; }
.gruppe.rechts { margin-left: auto; }
.leiste select, .leiste input[type=color] { height: 30px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); }
.person { font-size: 13px; opacity: .85; cursor: pointer; }
#zoom { min-width: 48px; text-align: center; font-size: 13px; }

.haupt { flex: 1; display: flex; min-height: 0; }
.seitenleiste { width: 150px; overflow-y: auto; padding: 10px 8px; background: #e3e7ee; border-right: 1px solid var(--linie); }
.seitenleiste:empty { display: none; }
.vorschau { background: #fff; border: 2px solid transparent; border-radius: 6px; padding: 4px; margin-bottom: 10px; text-align: center; font-size: 12px; color: var(--leise); }
.vorschau.aktiv { border-color: var(--akzent); }
.vorschau canvas { max-width: 100%; display: block; margin: 0 auto 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: pointer; }
.vorschau .knoepfe { display: flex; justify-content: center; gap: 2px; }
.vorschau .knoepfe button { padding: 1px 6px; font-size: 12px; }

.ansicht { flex: 1; overflow: auto; position: relative; }
.seiten { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px; }
.seite { position: relative; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.seite canvas { display: block; }
.ebene { position: absolute; inset: 0; overflow: hidden; }
.ebene svg { position: absolute; inset: 0; pointer-events: none; }
body[data-werkzeug=text] .ebene { cursor: text; }
body[data-werkzeug=zeichnen] .ebene, body[data-werkzeug=markieren] .ebene, body[data-werkzeug=signatur] .ebene { cursor: crosshair; }

.anm { position: absolute; }
.anm.text { white-space: pre; line-height: 1.2; font-family: Helvetica, Arial, sans-serif; outline: none; min-width: 6px; padding: 0; }
.anm.text:focus, .anm.gewaehlt { outline: 1px dashed var(--akzent); outline-offset: 2px; }
.anm.mark { background: rgba(255, 220, 0, .38); mix-blend-mode: multiply; }
.anm.sig { border: 1.5px dashed var(--akzent); background: rgba(31,111,235,.06); color: var(--akzent); font-size: 11px; display: flex; align-items: center; justify-content: center; text-align: center; }
body[data-werkzeug=auswahl] .anm { cursor: move; }
body[data-werkzeug=auswahl] .anm.text { cursor: text; }

.leer { max-width: 520px; margin: 12vh auto; text-align: center; color: var(--leise); border: 2px dashed var(--linie); border-radius: 14px; padding: 36px; background: rgba(255,255,255,.6); }
.leer h1 { color: var(--text); margin: 8px 0; }
.leer-icon { width: 84px; border-radius: 18px; }
.ansicht.ziehen .leer, .ansicht.ziehen { outline: 3px dashed var(--akzent); outline-offset: -8px; }
.klein { font-size: 13px; }

.formular { width: 270px; overflow-y: auto; padding: 12px; background: #fff; border-left: 1px solid var(--linie); }
.formular h2 { font-size: 15px; margin: 0 0 10px; }
.formular label { display: block; font-size: 12px; color: var(--leise); margin-bottom: 10px; }
.formular input[type=text], .formular select { width: 100%; padding: 5px 7px; border: 1px solid var(--linie); border-radius: 5px; font: inherit; color: var(--text); }

.status { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--blau); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.status.zeigen { opacity: .95; }
.status.fehler { background: #b42318; }

.schleier { position: fixed; inset: 0; background: rgba(11,42,74,.55); display: flex; align-items: center; justify-content: center; z-index: 10; }
.schleier[hidden] { display: none; }
.karte { background: #fff; border-radius: 14px; padding: 28px; width: min(400px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.karte .logo { width: 56px; border-radius: 12px; }
.karte h1 { margin: 8px 0; font-size: 22px; }
.karte p { color: var(--leise); font-size: 14px; }
.karte label { display: block; font-size: 13px; color: var(--leise); margin: 12px 0; }
.karte input { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; border: 1px solid var(--linie); border-radius: 7px; }
.karte button { width: 100%; padding: 10px; margin-top: 6px; }
.meldung { color: #b42318 !important; min-height: 1em; }

@media (max-width: 800px) {
  .seitenleiste { display: none; }
  .marke span { display: none; }
}
