/* NotesWerk 1v2 – created by AnnoBoy 2015–2026 */
@font-face { font-family:"Montserrat"; font-weight:400; font-display:swap; src:url(schriften/montserrat-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Montserrat"; font-weight:700; font-display:swap; src:url(schriften/montserrat-latin-700-normal.woff) format("woff"); }
@font-face { font-family:"Caveat"; font-weight:700; font-display:swap; src:url(schriften/caveat-latin-700-normal.woff) format("woff"); }

body.hell   { --bg:#f3f2fb; --panel:#ffffff; --panel2:#f4f3fd; --rand:#dedbf3; --text:#1c1a36; --leise:#6b6890; --knopf:#efedfb; --knopfh:#e3e0f8;
  --akz:#4f46e5; --akz2:#0d9488; --akz3:#f97316; --rot:#dc2626; --schatten:rgba(40,30,120,.13); --leiste:#ffffffee; --glas:rgba(255,255,255,.86); }
body.dunkel { --bg:#0e0d1d; --panel:#18172e; --panel2:#201e3b; --rand:#34315c; --text:#efeeff; --leise:#a7a3d3; --knopf:#25233f; --knopfh:#302d52;
  --akz:#8b86ff; --akz2:#2dd4bf; --akz3:#fb923c; --rot:#f87171; --schatten:rgba(0,0,0,.5); --leiste:#18172eee; --glas:rgba(24,23,46,.86); }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; }
body { background:var(--bg); color:var(--text); font:14px/1.45 Montserrat, "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color:transparent;
  overflow:hidden; -webkit-text-size-adjust:100%; }
[hidden] { display:none !important; }
h1, h2, h3 { margin:0; }
.luecke { flex:1; }
.leise { color:var(--leise); }
.klein { font-size:12px; }
.mittig { text-align:center; }
.rot-text { color:var(--rot) !important; }

/* Knöpfe */
button, .knopf { font:inherit; font-weight:600; color:var(--text); background:var(--knopf); border:1px solid var(--rand); border-radius:11px;
  padding:7px 12px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:36px;
  touch-action:manipulation; user-select:none; -webkit-user-select:none; transition:background .15s, transform .1s, box-shadow .15s; }
button:hover, .knopf:hover { background:var(--knopfh); }
button:active { transform:scale(.97); }
button:disabled { opacity:.38; cursor:default; transform:none; }
button.haupt { background:linear-gradient(135deg,var(--akz),#7c3aed); color:#fff; border-color:transparent; box-shadow:0 4px 14px rgba(79,70,229,.3); }
button.haupt:hover { filter:brightness(1.08); }
button.rot { background:var(--rot); color:#fff; border-color:transparent; }
button.gross { font-size:16px; padding:12px 22px; }
.klein-knopf { min-height:30px; padding:4px 10px; font-size:13px; }
.x-knopf { min-height:32px; width:34px; padding:0; border-radius:50%; background:transparent; border-color:transparent; font-size:16px; }
input[type=text], input[type=email], input[type=search], input[type=number] { font:inherit; color:var(--text); background:var(--panel2); border:1px solid var(--rand);
  border-radius:11px; padding:9px 12px; width:100%; outline:none; }
input:focus { border-color:var(--akz); box-shadow:0 0 0 3px color-mix(in srgb, var(--akz) 22%, transparent); }
.seg { display:inline-flex; background:var(--panel2); border:1px solid var(--rand); border-radius:12px; padding:3px; gap:2px; flex-wrap:wrap; }
.seg button { border:none; background:transparent; min-height:30px; padding:4px 11px; border-radius:9px; font-size:13px; }
.seg button.an { background:var(--panel); box-shadow:0 1px 5px var(--schatten); color:var(--akz); }
.seg.klein button { min-height:28px; padding:3px 9px; font-size:12px; }

/* ===================================================== Ansichten */
.ansicht { position:fixed; inset:0; display:flex; flex-direction:column; padding-top:env(safe-area-inset-top); }

/* Kopf der Startseite */
.kopf { display:flex; align-items:center; gap:12px; margin:10px 12px 0; padding:8px 14px; border-radius:18px; flex:none; flex-wrap:wrap;
  background:linear-gradient(105deg,#1e1b4b 0%,#3730a3 34%,#0f766e 72%,#f97316 115%); color:#fff; box-shadow:0 10px 26px var(--schatten); }
.logo { width:46px; height:46px; border-radius:12px; flex:none; box-shadow:0 0 0 1px rgba(255,255,255,.25), 0 4px 14px rgba(0,0,0,.25); }
.titel h1 { font-size:24px; letter-spacing:.2px; }
.titel p { margin:0; font-size:12px; opacity:.88; }
.knopfgruppe { display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
.kopfknopf { color:#fff !important; background:rgba(255,255,255,.14) !important; border:1px solid rgba(255,255,255,.3) !important; }
.kopfknopf:hover { background:rgba(255,255,255,.26) !important; }
.haupt-kopf { background:#fff !important; color:#312e81 !important; border-color:#fff !important; box-shadow:0 4px 14px rgba(0,0,0,.2); }
.konto-knopf.an { background:rgba(45,212,191,.28) !important; }
.sprachwahl { display:inline-flex; border-radius:10px; overflow:hidden; border:1px solid rgba(255,255,255,.3); }
.sprachwahl button { border:none; border-radius:0; background:rgba(255,255,255,.1); color:#fff; min-height:34px; padding:4px 10px; font-size:12px; }
.sprachwahl button.an { background:rgba(255,255,255,.34); }
.sprachwahl.gross { border-color:var(--rand); }
.sprachwahl.gross button { color:var(--text); background:var(--panel2); font-size:13px; padding:6px 12px; }
.sprachwahl.gross button.an { background:var(--akz); color:#fff; }

.bib-leiste { display:flex; align-items:center; gap:10px; padding:12px 18px 0; flex:none; }
.bib-leiste input { max-width:320px; }
.sync-stand { font-size:12px; }
.hefte-gitter { flex:1; overflow:auto; padding:18px; display:grid; grid-template-columns:repeat(auto-fill, minmax(168px, 1fr)); gap:22px; align-content:start;
  -webkit-overflow-scrolling:touch; }
.heft-karte { display:flex; flex-direction:column; gap:7px; }
.heft-umschlag { position:relative; aspect-ratio:0.72; border-radius:6px 14px 14px 6px; cursor:pointer; overflow:hidden;
  background:linear-gradient(140deg, color-mix(in srgb, var(--farbe) 82%, #fff) 0%, var(--farbe) 55%, color-mix(in srgb, var(--farbe) 70%, #000) 100%);
  box-shadow:0 10px 22px var(--schatten), inset 0 0 0 1px rgba(255,255,255,.12); transition:transform .18s, box-shadow .18s; }
.heft-umschlag:hover { transform:translateY(-3px) rotate(-.6deg); box-shadow:0 16px 30px var(--schatten); }
.heft-umschlag::after { content:""; position:absolute; inset:0; background:repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 6px, transparent 6px 12px); pointer-events:none; }
.heft-ruecken { position:absolute; left:0; top:0; bottom:0; width:14px; background:linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.05)); }
.heft-fach { position:absolute; top:16%; left:0; right:0; text-align:center; font-size:40px; filter:drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.heft-schild { position:absolute; left:18%; right:10%; bottom:16%; background:#fffdf7; color:#26223f; border-radius:8px; padding:9px 10px; min-height:44px;
  display:flex; align-items:center; justify-content:center; text-align:center; box-shadow:0 3px 8px rgba(0,0,0,.18); font-family:Caveat, Montserrat, sans-serif; }
.heft-schild b { font-size:21px; line-height:1.05; word-break:break-word; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.heft-endlos { position:absolute; top:8px; right:10px; color:#fff; font-size:20px; opacity:.85; }
.heft-unten { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--leise); padding:0 2px; }
.heft-mehr { min-height:28px; padding:0 10px; background:transparent; border-color:transparent; font-size:18px; }
.leer-karte { margin:30px auto; max-width:420px; text-align:center; padding:30px 24px; background:var(--panel); border:1px solid var(--rand); border-radius:22px;
  box-shadow:0 12px 30px var(--schatten); }
.leer-bild { font-size:52px; margin-bottom:8px; }
.leer-karte h2 { font-size:22px; margin-bottom:8px; }
.leer-karte p { color:var(--leise); margin:0 0 18px; }

/* Fußzeile */
.fuss { display:flex; align-items:center; gap:10px; padding:6px 14px calc(6px + env(safe-area-inset-bottom)); font-size:12px; flex:none; min-height:34px; overflow:hidden; white-space:nowrap; }
.werbung { color:var(--leise); text-decoration:none; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.werbung b { background:linear-gradient(90deg,#7c3aed,#db2777); -webkit-background-clip:text; background-clip:text; color:transparent; }
.werbung:hover { color:var(--text); }
.fuss-link { color:var(--leise); text-decoration:none; }
.signatur { color:var(--leise); font-size:11px; opacity:.85; flex:none; }
.lizenzText:empty { display:none; }

/* ===================================================== Editor */
.ed-kopf { display:flex; align-items:center; gap:6px; padding:6px 10px; flex:none; background:var(--panel); border-bottom:1px solid var(--rand); position:relative; z-index:3; }
.ed-kopf::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; background:var(--heft, #4f46e5); }
.ed-knopf { min-height:38px; min-width:40px; padding:4px 10px; background:transparent; border-color:transparent; font-size:17px; }
.ed-knopf .kt { font-size:13px; }
.ed-knopf:hover { background:var(--knopf); }
.ed-name { background:transparent; border-color:transparent; font-size:16px; font-weight:700; padding:4px 8px; max-width:40vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.ed-name::after { content:" ✎"; font-size:12px; color:var(--leise); }
.schloss.zu { background:#f59e0b !important; color:#fff; border-radius:12px; }

.werkzeugleiste { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:10px; padding:6px 12px; flex:none; background:var(--leiste);
  border-bottom:1px solid var(--rand); position:relative; z-index:2; backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
.werkzeugleiste.gesperrt .wl-gruppe { opacity:.45; }
.wl-gruppe { display:flex; align-items:center; gap:5px; }
#wlWerkzeuge { justify-self:start; }
.wl-rechts { justify-self:end; display:flex; align-items:center; gap:4px; }
.wl-mitte { justify-self:center; }
.wz { flex-direction:column; gap:1px; min-height:48px; min-width:56px; padding:4px 6px; background:transparent; border-color:transparent; border-radius:12px; }
.wz svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.wz small { font-size:10.5px; font-weight:600; color:var(--leise); }
.wz.an { background:color-mix(in srgb, var(--akz) 14%, transparent); color:var(--akz); box-shadow:inset 0 0 0 1.5px color-mix(in srgb, var(--akz) 45%, transparent); }
.wz.an small { color:var(--akz); }
.wz .markband { stroke:#facc15; stroke-width:3; }
.raster-knopf { gap:9px; min-height:46px; padding:5px 16px 5px 6px; border-radius:24px; font-size:14px;
  background:linear-gradient(135deg, color-mix(in srgb, var(--akz2) 18%, var(--panel)), var(--panel)); border:1.5px solid color-mix(in srgb, var(--akz2) 50%, var(--rand)); }
.raster-bild { width:30px; height:36px; border-radius:6px; overflow:hidden; box-shadow:0 1px 4px var(--schatten); background:#fff; flex:none; }
.raster-bild canvas { width:100%; height:100%; display:block; }
.farbe { width:30px; height:30px; min-height:30px; padding:0; border-radius:50%; background:var(--f); border:2px solid var(--panel); box-shadow:0 0 0 1px var(--rand); position:relative; flex:none; }
.farbe.an { box-shadow:0 0 0 2.5px var(--akz); transform:scale(1.08); }
.farbe.eigen { background:conic-gradient(#ef4444,#f59e0b,#eab308,#22c55e,#06b6d4,#3b82f6,#8b5cf6,#ec4899,#ef4444); cursor:pointer; display:inline-flex; }
.farbe.eigen.an::after { content:""; position:absolute; inset:6px; border-radius:50%; background:var(--f); border:2px solid #fff; }
.farbe.eigen input { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; }
.breite { width:34px; min-width:34px; height:34px; min-height:34px; padding:0; border-radius:10px; background:transparent; border-color:transparent; }
.breite i { display:block; border-radius:50%; background:var(--text); }
.breite.an { background:var(--knopf); box-shadow:inset 0 0 0 1.5px var(--akz); }
.wl-trenn { width:1px; height:26px; background:var(--rand); margin:0 4px; }
#wlFarben { gap:6px; }
#wlFarben .seg { margin-right:4px; }

.buehne { flex:1; position:relative; overflow:hidden; min-height:0; }
.buehne canvas { position:absolute; left:0; top:0; display:block; }
#obenauf { touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; cursor:crosshair; }
.seiten-nav, .zoom-nav { position:absolute; bottom:14px; display:flex; align-items:center; gap:6px; padding:5px; border-radius:30px; background:var(--glas);
  box-shadow:0 6px 20px var(--schatten); border:1px solid var(--rand); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); z-index:2; }
.seiten-nav { left:50%; transform:translateX(-50%); }
.seiten-nav span { min-width:58px; text-align:center; font-weight:700; font-size:13px; font-variant-numeric:tabular-nums; }
.zoom-nav { right:14px; }
.rund-knopf { width:36px; height:36px; min-height:36px; padding:0; border-radius:50%; font-size:18px; background:transparent; border-color:transparent; }
.rund-knopf.plus { background:linear-gradient(135deg,var(--akz2),#0284c7); color:#fff; }
.schloss-hinweis { position:absolute; top:12px; left:50%; transform:translateX(-50%); background:#f59e0b; color:#fff; padding:7px 14px; border-radius:20px;
  font-weight:600; font-size:13px; box-shadow:0 6px 18px rgba(245,158,11,.35); pointer-events:none; white-space:nowrap; z-index:2; }
.ed-fuss { background:var(--panel); border-top:1px solid var(--rand); min-height:28px; padding-top:3px; padding-bottom:calc(3px + env(safe-area-inset-bottom)); }

/* Kleines Fenster an einem Knopf */
.pop { position:fixed; z-index:60; background:var(--panel); border:1px solid var(--rand); border-radius:14px; padding:12px; box-shadow:0 14px 40px var(--schatten); min-width:220px; }
.pop input[type=range] { width:100%; accent-color:var(--akz); }
.pop.auswahl { padding:6px; display:flex; flex-direction:column; gap:2px; min-width:210px; }
.pop.auswahl button { justify-content:flex-start; background:transparent; border-color:transparent; font-weight:600; }
.pop.auswahl button:hover { background:var(--knopf); }

/* ===================================================== Dialoge */
.dialog { position:fixed; inset:0; background:rgba(12,10,30,.48); display:flex; align-items:center; justify-content:center; z-index:40; padding:14px;
  backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); animation:einblenden .16s ease-out; }
@keyframes einblenden { from { opacity:0; } }
.dialog-box { background:var(--panel); border:1px solid var(--rand); border-radius:20px; padding:18px 20px; width:min(460px, 100%); max-height:calc(100dvh - 28px);
  overflow:auto; box-shadow:0 24px 60px rgba(0,0,0,.3); animation:hoch .2s ease-out; }
@keyframes hoch { from { transform:translateY(14px); opacity:.6; } }
.dialog-box.breit { width:min(640px, 100%); }
.dialog-box.sehr-breit { width:min(980px, 100%); }
.dialog-box.klein-box { width:min(400px, 100%); }
.dialog-box h2 { display:flex; align-items:center; gap:8px; font-size:18px; margin-bottom:12px; }
.dialog-box h3 { font-size:12px; text-transform:uppercase; letter-spacing:.07em; color:var(--leise); margin:18px 0 8px; }
.feld-titel { display:block; font-size:12px; font-weight:700; color:var(--leise); margin:14px 0 6px; text-transform:uppercase; letter-spacing:.05em; }
.knopf-zeile { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; align-items:center; }
.knopf-zeile.rechts { justify-content:flex-end; }
.fehler { color:var(--rot); font-size:13px; min-height:1em; margin:8px 0 0; }
.umschlag-wahl, .papier-wahl { display:flex; gap:9px; flex-wrap:wrap; }
.farb-punkt { width:36px; height:36px; min-height:36px; padding:0; border-radius:50%; border:3px solid var(--panel); box-shadow:0 0 0 1px var(--rand); }
.farb-punkt.an { box-shadow:0 0 0 3px var(--akz); }
.farb-punkt.papier { border-radius:8px; border:1px solid #c9c6dd; }
.fach-wahl { display:flex; gap:5px; flex-wrap:wrap; margin-top:10px; }
.fach-knopf { width:40px; min-height:38px; padding:0; font-size:19px; background:var(--panel2); }
.fach-knopf.an { box-shadow:inset 0 0 0 2px var(--akz); background:var(--panel); }
.format-wahl { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.format-wahl button { flex-direction:column; gap:3px; padding:10px 6px; min-height:96px; background:var(--panel2); text-align:center; }
.format-wahl button.an { box-shadow:inset 0 0 0 2px var(--akz); background:var(--panel); }
.format-wahl small { font-weight:400; color:var(--leise); font-size:11.5px; }
.fm { display:block; background:#fff; border:1.5px solid #9aa3c0; border-radius:3px; margin-bottom:4px; }
.fm.hoch { width:26px; height:36px; } .fm.quer { width:36px; height:26px; margin-top:5px; margin-bottom:9px; }
.fm.endlos { width:26px; height:36px; border-bottom:none; border-radius:3px 3px 0 0; -webkit-mask:linear-gradient(#000 60%, transparent); mask:linear-gradient(#000 60%, transparent); }
.raster-gitter { display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:10px; }
.raster-gitter.klein { grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)); }
.raster-kachel { flex-direction:column; padding:6px 6px 7px; gap:6px; background:var(--panel2); border-radius:12px; min-height:0; }
.raster-kachel canvas { width:100%; aspect-ratio:.78; border-radius:6px; box-shadow:0 1px 4px var(--schatten); display:block; }
.raster-kachel span { font-size:11.5px; line-height:1.15; }
.raster-kachel.an { box-shadow:inset 0 0 0 2px var(--akz); background:var(--panel); color:var(--akz); }
.zwei-spalten { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.seiten-gitter { display:grid; grid-template-columns:repeat(auto-fill, minmax(146px, 1fr)); gap:14px; }
.seiten-karte { background:var(--panel2); border-radius:12px; padding:7px; display:flex; flex-direction:column; gap:6px; align-items:center; }
.seiten-karte canvas { box-shadow:0 2px 8px var(--schatten); border-radius:3px; cursor:pointer; max-width:100%; }
.seiten-karte.jetzt { box-shadow:inset 0 0 0 2px var(--akz); }
.sk-unten { display:flex; align-items:center; justify-content:space-between; width:100%; padding:0 3px; }
.wahl-liste { display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.wahl-liste label, .schalter { display:flex; align-items:center; gap:8px; flex-wrap:wrap; background:var(--panel2); border:1px solid var(--rand); border-radius:12px; padding:10px 12px; cursor:pointer; }
.wahl-liste input[type=radio], .schalter input { accent-color:var(--akz); width:18px; height:18px; }
.von-bis { display:inline-flex; align-items:center; gap:6px; margin-left:auto; }
.von-bis input { width:70px; padding:6px 8px; }
.menue .dialog-box { width:min(470px, 100%); }
.menue-karte { background:var(--panel2); border:1px solid var(--rand); border-radius:14px; padding:12px; }
.menue-karte p { margin:0; }
.menue-liste { display:flex; flex-direction:column; gap:7px; }
.menue-liste > button, .menue-liste > .knopf { justify-content:flex-start; }
.menue-liste p { margin:0; }
.menue-liste.zweier { flex-direction:row; flex-wrap:wrap; margin-top:12px; }
.werbe-karte { display:flex; flex-direction:column; gap:4px; margin-top:18px; padding:14px 16px; border-radius:16px; text-decoration:none; color:#fff;
  background:linear-gradient(120deg,#2b0f6b,#7c3aed 55%,#db2777); box-shadow:0 8px 22px rgba(124,58,237,.3); }
.werbe-karte b { font-size:16px; }
.werbe-karte span { font-size:13px; opacity:.92; }
.korb-liste { display:flex; flex-direction:column; gap:8px; }
.korb-zeile { display:flex; align-items:center; gap:8px; background:var(--panel2); border-radius:12px; padding:9px 12px; }
.korb-zeile > div { flex:1; display:flex; flex-direction:column; min-width:0; }
.korb-zeile b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Meldung und Arbeit */
.meldung { position:fixed; left:50%; bottom:calc(70px + env(safe-area-inset-bottom)); transform:translate(-50%, 20px); opacity:0; background:#1f1b45; color:#fff;
  padding:11px 18px; border-radius:16px; box-shadow:0 12px 34px rgba(0,0,0,.3); z-index:80; max-width:min(560px, 92vw); text-align:center; font-weight:600;
  transition:opacity .22s, transform .22s; pointer-events:none; }
.meldung.da { opacity:1; transform:translate(-50%, 0); }
body.dunkel .meldung { background:#eceaff; color:#1c1a36; }
.arbeit { position:fixed; inset:0; z-index:90; background:rgba(12,10,30,.5); display:flex; align-items:center; justify-content:center; }
.arbeit-box { background:var(--panel); border-radius:20px; padding:22px 26px; width:min(360px, 92vw); text-align:center; box-shadow:0 24px 60px rgba(0,0,0,.35); }
.dreher { width:38px; height:38px; margin:0 auto 10px; border-radius:50%; border:4px solid var(--rand); border-top-color:var(--akz); animation:drehen .8s linear infinite; }
@keyframes drehen { to { transform:rotate(360deg); } }
.fortschritt { height:8px; border-radius:5px; background:var(--panel2); overflow:hidden; margin:12px 0 14px; }
.fortschritt i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--akz2),var(--akz)); transition:width .15s; }

/* ===================================================== Kleine Bildschirme */
/* Stufe 2: Einfügen, Markieren, Tabelle, Kamera */
.einfuegen-knopf { margin-left:8px; min-height:46px; border-radius:24px; padding:5px 16px; font-size:14px; gap:6px;
  background:linear-gradient(135deg, color-mix(in srgb, var(--akz3) 18%, var(--panel)), var(--panel)); border:1.5px solid color-mix(in srgb, var(--akz3) 50%, var(--rand)); }
.einfuegen-knopf::first-letter { font-size:18px; }
.wl-mitte { display:flex; align-items:center; }
.hinweis-klein { font-size:12px; color:var(--leise); max-width:260px; white-space:normal; line-height:1.3; }
.formen-wahl button { font-size:17px; min-width:34px; padding:2px 6px; }
.auswahl-leiste { position:absolute; z-index:4; display:flex; gap:3px; padding:5px; border-radius:16px; background:var(--panel); border:1px solid var(--rand);
  box-shadow:0 10px 30px var(--schatten); flex-wrap:wrap; max-width:calc(100% - 16px); }
.auswahl-leiste button { min-height:38px; min-width:40px; padding:3px 8px; background:transparent; border-color:transparent; font-size:16px; }
.auswahl-leiste button:hover { background:var(--knopf); }
.auswahl-leiste button.text-knopf { font-size:14px; padding:3px 14px; color:#b45309; }
.auswahl-leiste button.an { background:color-mix(in srgb, var(--akz) 16%, transparent); color:var(--akz); }
.farb-reihe { display:flex; gap:7px; flex-wrap:wrap; }
.tab-gitter { display:grid; grid-template-columns:repeat(8, 1fr); gap:4px; margin:10px 0 4px; touch-action:manipulation; }
.tab-gitter i { aspect-ratio:1.3; border-radius:5px; background:var(--panel2); border:1px solid var(--rand); cursor:pointer; transition:background .08s; }
.tab-gitter i.an { background:color-mix(in srgb, var(--akz) 30%, var(--panel)); border-color:var(--akz); }
.kamera-bild { background:#000; border-radius:14px; overflow:hidden; aspect-ratio:16/10; display:flex; align-items:center; justify-content:center; }
.kamera-bild video { width:100%; height:100%; object-fit:contain; }
.buehne.ablegen::after { content:"🖼"; position:absolute; inset:12px; border:3px dashed var(--akz); border-radius:20px; display:flex; align-items:center; justify-content:center;
  font-size:60px; background:color-mix(in srgb, var(--akz) 10%, transparent); pointer-events:none; z-index:5; }

/* Stufe 3: Grafiken */
.grafik-box h2 input { max-width:220px; padding:6px 10px; }
.themen-leiste { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.themen-leiste button { min-height:32px; padding:4px 11px; font-size:13px; border-radius:20px; background:var(--panel2); }
.themen-leiste button.an { background:var(--akz); color:#fff; border-color:transparent; }
.grafik-gitter { display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:10px; max-height:min(62vh, 620px); overflow:auto; padding:2px; }
.grafik-kachel { position:relative; flex-direction:column; gap:4px; padding:6px; background:#fff; border-radius:12px; min-height:0; color:#1c1a36; }
.grafik-kachel canvas { width:100%; height:78px; display:block; }
.grafik-kachel span { font-size:11.5px; font-weight:600; line-height:1.2; }
.grafik-kachel .weg { position:absolute; top:3px; right:3px; min-height:24px; width:24px; padding:0; border-radius:50%; font-size:12px; }
body.dunkel .grafik-kachel { background:#f3f2fb; }

@media (max-width: 900px) {
  .werkzeugleiste { display:flex; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; gap:8px; padding:5px 8px; }
  .werkzeugleiste::-webkit-scrollbar { display:none; }
  .wl-gruppe, .wl-mitte, .wl-rechts { flex:none; }
  .wz { min-width:50px; }
}
@media (max-width: 640px) {
  .nur-breit { display:none !important; }
  .kopf { margin:8px 8px 0; padding:8px 10px; gap:8px; }
  .titel h1 { font-size:20px; }
  .titel p { display:none; }
  .kopfknopf .kt { display:none; }
  .haupt-kopf .kt { display:inline; }
  .hefte-gitter { grid-template-columns:repeat(auto-fill, minmax(132px, 1fr)); gap:16px; padding:14px; }
  .heft-schild b { font-size:18px; }
  .heft-fach { font-size:32px; }
  .ed-knopf { min-width:36px; padding:4px 7px; }
  .ed-knopf .kt { display:none; }
  .ed-name { max-width:34vw; font-size:14px; }
  .ed-kopf .konto-knopf { display:none !important; }
  .ed-name { max-width:44vw; }
  .wz small { display:none; }
  .wz { min-height:42px; min-width:44px; }
  .raster-knopf { padding:4px 12px 4px 5px; min-height:42px; }
  .raster-bild { width:26px; height:32px; }
  .einfuegen-knopf { min-height:42px; padding:4px 12px; }
  .hinweis-klein { max-width:180px; }
  .farbe { width:27px; height:27px; min-height:27px; }
  .zoom-nav { display:none; }
  .seiten-nav { bottom:10px; }
  .zwei-spalten { grid-template-columns:1fr; }
  .format-wahl small { display:none; }
  .format-wahl button { min-height:76px; }
  .dialog { padding:8px; align-items:flex-end; }
  .dialog-box { border-radius:20px 20px 14px 14px; padding:16px; }
}
@media print { body { display:none; } }
