/* ==========================================================================
   ilabs write - Oberflaeche
   ========================================================================== */
body.write { --tb-top: 14px; }
.view { position: fixed; inset: 0; }
.view[hidden] { display: none; }

/* ---------- Start (Backstage) im core-Design ---------- */
.topbrand { position: fixed; z-index: 50; top: 18px; left: 26px; display: flex; align-items: baseline; gap: 16px; pointer-events: none; animation: fade-up .8s var(--smooth) both; }
.topclock { font: 500 15px var(--display); letter-spacing: .12em; color: var(--ink-soft); }
.home { --orb: min(54vh, 440px); --ox: 34vw; }
.home .hm-orb { position: absolute; left: calc(var(--ox) - var(--orb) / 2); top: calc(50% - var(--orb) / 2); width: var(--orb); height: var(--orb); }
.home .hm-orb .glyph { width: 30%; }
.hm-orb.intro { animation: hm-in 1.1s var(--spring) both; }
@keyframes hm-in { from { opacity: 0; transform: scale(.5) translateX(-80px); } }

.sc-wrap { --bs: clamp(140px, min(32vh, 26vw), 290px); position: relative; width: min(1180px, calc(100vw - 80px)); max-height: 100%; display: flex; align-items: center; gap: clamp(20px, 4vw, 46px); }
.sc-bub {
  position: relative; flex-shrink: 0; width: var(--bs); height: var(--bs); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.92), rgba(207,230,255,.62) 40%, rgba(111,179,250,.48) 75%, rgba(42,122,224,.62));
  box-shadow: inset -12px -18px 34px rgba(13,52,120,.3), inset 10px 12px 24px rgba(255,255,255,.6), 0 30px 70px rgba(14,42,92,.32), 0 0 90px rgba(64,156,255,.4);
  transform: perspective(1400px) rotateY(12deg); color: var(--blue-700);
}
.sc-bub .orb-ring.r1 { animation: spin 18s linear infinite; }
.sc-bub .orb-ring.r2 { animation: spin 26s linear infinite reverse; }
.sc-bub > svg { width: 40%; height: 40%; filter: drop-shadow(0 6px 14px rgba(13,52,120,.3)); }
.sc-panel { flex: 1; min-width: 0; height: min(680px, calc(100vh - 190px)); display: flex; flex-direction: column; padding: clamp(16px, 2.4vh, 24px); border-radius: 30px; transform: perspective(1400px) rotateY(-11deg) rotateZ(-1deg); transform-origin: 30% 50%; }
.sc-head { display: flex; align-items: center; gap: 14px; padding: 4px 6px 16px; flex-wrap: wrap; }
.sc-head h2 { margin: 0; font: 700 clamp(24px, 4vh, 36px) var(--display); letter-spacing: .03em; }
.sc-head .grow { flex: 1; }
.sc-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px 10px; margin: 0 -6px; }

/* Vorlagen */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.tpl { position: relative; border: none; background: none; padding: 0; cursor: pointer; text-align: left; color: var(--ink); animation: card-pop .6s var(--spring) both; }
.tpl:nth-child(2) { animation-delay: .05s; } .tpl:nth-child(3) { animation-delay: .1s; } .tpl:nth-child(4) { animation-delay: .15s; }
.tpl:nth-child(5) { animation-delay: .2s; } .tpl:nth-child(6) { animation-delay: .25s; } .tpl:nth-child(7) { animation-delay: .3s; } .tpl:nth-child(8) { animation-delay: .35s; }
@keyframes card-pop { from { opacity: 0; transform: translateY(24px) scale(.92); } }
.tpl .paper { position: relative; aspect-ratio: 210 / 297; border-radius: 10px; background: #fff; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 30px -14px rgba(14,42,92,.45), 0 0 0 1px rgba(140,196,255,.35);
  transition: transform .45s var(--spring), box-shadow .3s; }
.tpl.land .paper { aspect-ratio: 297 / 210; }
.tpl:hover .paper { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 24px 40px -16px rgba(14,42,92,.5), 0 0 0 2px rgba(64,156,255,.55), 0 0 30px rgba(64,156,255,.25); }
.tpl .paper .mini { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.tpl b { display: block; margin: 10px 4px 0; font: 600 14px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.tpl small { display: block; margin: 2px 4px 0; font-size: 12px; color: var(--ink-soft); }
.tpl .plus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--blue-500); }
.tpl .plus svg { width: 42px; height: 42px; transition: transform .45s var(--spring); }
.tpl:hover .plus svg { transform: rotate(90deg) scale(1.1); }

.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.55); box-shadow: inset 0 2px 5px rgba(22,52,104,.12); }
.seg button { position: relative; z-index: 1; border: none; background: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; font: 600 13px var(--display); letter-spacing: .04em; color: var(--ink-soft); transition: color .3s; white-space: nowrap; }
.seg button.on { color: #fff; }
.seg .seg-pill { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: linear-gradient(180deg, #5eadf8, #2f80e4 55%, #1f66cc);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), 0 6px 16px -4px rgba(31,102,204,.6), 0 0 18px rgba(64,156,255,.35); transition: transform .5s var(--spring), width .5s var(--spring); }

/* Zuletzt */
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; }
.rc { position: relative; border: none; background: none; padding: 0; cursor: pointer; text-align: left; color: var(--ink); animation: card-pop .6s var(--spring) both; }
.rc .paper { position: relative; aspect-ratio: 210 / 297; border-radius: 10px; background: #fff; overflow: hidden;
  box-shadow: 0 14px 30px -14px rgba(14,42,92,.45), 0 0 0 1px rgba(140,196,255,.35); transition: transform .45s var(--spring), box-shadow .3s; }
.rc:hover .paper { transform: translateY(-6px); box-shadow: 0 24px 40px -16px rgba(14,42,92,.5), 0 0 0 2px rgba(64,156,255,.55); }
.rc .paper .mini { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.rc b { display: block; margin: 10px 4px 0; font: 600 14px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc small { display: block; margin: 2px 4px 0; font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc .fmt { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 99px; font: 700 10px var(--display); letter-spacing: .08em; color: #fff; background: linear-gradient(180deg, #5eadf8, #1f66cc); box-shadow: 0 4px 10px rgba(31,102,204,.4); }
.rc .rm { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
  background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(14,42,92,.2); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .35s var(--spring); }
.rc .rm svg { width: 13px; height: 13px; }
.rc:hover .rm { opacity: 1; transform: none; }
.rc .rm:hover { color: var(--red); }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); animation: fade-up .7s var(--smooth) both; }
.empty .mini-orb { width: 84px; height: 84px; margin: 0 auto 18px; color: #fff; }
.empty .mini-orb svg { width: 34px; height: 34px; }
.empty h3 { margin: 0 0 6px; font: 700 19px var(--display); color: var(--ink); }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.72); box-shadow: inset 0 2px 5px rgba(22,52,104,.1); min-width: 240px; color: var(--ink-faint); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: 14.5px; color: var(--ink); }

.drop-hint { position: fixed; inset: 14px; z-index: 6000; border-radius: 30px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; pointer-events: none;
  background: rgba(220,236,255,.72); box-shadow: inset 0 0 0 3px rgba(64,156,255,.6), inset 0 0 60px rgba(64,156,255,.35); opacity: 0; transform: scale(1.02); transition: opacity .25s, transform .4s var(--spring);
  font: 600 20px var(--display); letter-spacing: .06em; color: var(--blue-700); }
.drop-hint.on { opacity: 1; transform: none; }
.drop-hint .mini-orb { width: 90px; height: 90px; animation: float-orb 2.4s ease-in-out infinite; }
.drop-hint .mini-orb svg { width: 36px; height: 36px; }
@keyframes float-orb { 50% { transform: translateY(-10px); } }

/* ==========================================================================
   Editor
   ========================================================================== */
#editor { background: linear-gradient(170deg, #eef5ff 0%, #dce9fb 60%, #cfe0f8 100%); }
#editor .bg i { opacity: .7; }

/* Marke + Dokumentname oben links */
.ed-brand { position: fixed; z-index: 120; top: 12px; left: 14px; display: flex; align-items: center; gap: 12px; }
.ed-orb { width: 46px; height: 46px; border: none; padding: 0; cursor: pointer; transition: transform .45s var(--spring); }
.ed-orb .glyph { width: 46%; }
.ed-orb:hover { transform: scale(1.08) rotate(-6deg); }
.ed-orb:active { transform: scale(.94); }
.ed-name { display: flex; flex-direction: column; min-width: 0; }
.ed-name .app { font: 700 15px var(--display); letter-spacing: .01em; white-space: nowrap; }
.ed-name .app em { font-style: normal; color: var(--blue-600); font-weight: 600; }
.ed-title { display: flex; align-items: center; gap: 7px; max-width: 26vw; }
.ed-title input { border: none; outline: none; background: transparent; font: 500 12.5px var(--text); color: var(--ink-soft); padding: 2px 6px; margin-left: -6px; border-radius: 8px; min-width: 40px; width: 100%; text-overflow: ellipsis; transition: background .2s, box-shadow .2s; }
.ed-title input:hover { background: rgba(255,255,255,.5); }
.ed-title input:focus { background: rgba(255,255,255,.9); box-shadow: 0 0 0 2px rgba(58,146,239,.35); color: var(--ink); }
.save-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(36,168,101,.15); transition: background .3s, box-shadow .3s; }
.save-dot.dirty { background: var(--amber); box-shadow: 0 0 0 3px rgba(224,161,42,.18); }
.save-dot.saving { background: var(--blue-500); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(64,156,255,.15); } }

.ed-me { position: fixed; z-index: 120; top: 9px; right: 132px; display: flex; align-items: center; gap: 8px; }
body:not(.desktop) .ed-me { right: 18px; }
.ed-me .avatar { width: 32px; height: 32px; font-size: 12px; cursor: default; animation: pop-in .6s var(--spring) .4s both; }

/* ---------- Leiste: faellt von oben, klappt in die Breite auf ---------- */
.tb-zone { position: fixed; z-index: 110; top: var(--tb-top); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; transition: transform .6s var(--smooth), opacity .4s; }
body.focus .tb-zone { transform: translateY(-160px); opacity: 0; }
.tb-tabs, .tb-tools { pointer-events: auto; position: relative; display: flex; align-items: center; border-radius: 999px; overflow: hidden; white-space: nowrap;
  background: linear-gradient(170deg, rgba(255,255,255,.78), rgba(236,245,255,.62));
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.95), inset 0 -10px 16px -12px rgba(22,52,104,.28), 0 0 0 1px rgba(255,255,255,.7), 0 18px 36px -18px rgba(14,42,92,.45), 0 2px 8px rgba(14,42,92,.08); }
.tb-tabs { padding: 5px; gap: 2px; }
.tb-tab { position: relative; z-index: 1; border: none; background: none; cursor: pointer; padding: 9px 20px; border-radius: 999px; font: 600 14px var(--text); color: var(--ink); transition: color .3s; }
.tb-tab:hover { color: var(--blue-700); }
.tb-tab.on { color: var(--blue-900); font-weight: 700; }
.tb-pill { position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 0; width: 80px; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(235,246,255,.98), rgba(196,226,255,.92));
  box-shadow: inset 0 1.5px 0 #fff, inset 0 -6px 10px -6px rgba(29,95,194,.45), 0 0 0 1px rgba(140,196,255,.8), 0 6px 18px -4px rgba(64,156,255,.65), 0 0 22px rgba(64,156,255,.45);
  transition: transform .55s var(--spring), width .55s var(--spring); }
.tb-tools { padding: 6px 10px; min-height: 52px; max-width: calc(100vw - 28px); overflow-x: auto; scrollbar-width: none; }
.tb-tools::-webkit-scrollbar { display: none; }
.tb-set { display: flex; align-items: center; gap: 2px; }
.tb-set[hidden] { display: none; }
.tb-sep { width: 1px; height: 26px; margin: 0 6px; flex-shrink: 0; background: linear-gradient(180deg, rgba(70,101,140,0), rgba(70,101,140,.28), rgba(70,101,140,0)); }

.tb-btn { position: relative; flex-shrink: 0; height: 36px; min-width: 35px; padding: 0 8px; border: none; border-radius: 999px; background: none; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 13px var(--text);
  transition: background .2s, color .2s, transform .3s var(--spring), box-shadow .25s; }
.tb-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.tb-btn:hover { background: rgba(255,255,255,.85); box-shadow: inset 0 1px 0 #fff, 0 4px 12px -4px rgba(14,42,92,.25); color: var(--blue-700); }
.tb-btn:active { transform: scale(.9); }
.tb-btn.on { color: var(--blue-900); background: linear-gradient(180deg, rgba(235,246,255,.98), rgba(196,226,255,.92));
  box-shadow: inset 0 1px 0 #fff, inset 0 -5px 8px -5px rgba(29,95,194,.45), 0 0 0 1px rgba(140,196,255,.8), 0 0 14px rgba(64,156,255,.4); }
.tb-btn:disabled { opacity: .35; cursor: default; transform: none; background: none; box-shadow: none; }
.tb-btn .lbl { font-size: 12.5px; }
.tb-btn .caret { width: 10px; height: 10px; margin-left: -2px; opacity: .6; }
.tb-btn.split { padding-right: 2px; }
.tb-btn .sw { position: absolute; left: 9px; right: 9px; bottom: 5px; height: 4px; border-radius: 3px; background: currentColor; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.tb-btn.has-sw svg { margin-top: -5px; }
.tb-drop { width: 18px; min-width: 18px; padding: 0; margin-left: -4px; }
.tb-drop svg { width: 11px; height: 11px; }

/* Auswahlfelder (Schrift, Absatz) */
.tb-select { position: relative; flex-shrink: 0; height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 14px; border: none; border-radius: 999px; cursor: pointer; color: var(--ink);
  background: rgba(255,255,255,.7); box-shadow: inset 0 2px 4px rgba(22,52,104,.1), 0 0 0 1px rgba(255,255,255,.8); font: 500 13.5px var(--text); transition: background .2s, box-shadow .25s; }
.tb-select:hover { background: #fff; box-shadow: inset 0 1px 2px rgba(22,52,104,.06), 0 0 0 1px rgba(140,196,255,.7), 0 0 12px rgba(64,156,255,.2); }
.tb-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.tb-select svg { width: 11px; height: 11px; opacity: .55; flex-shrink: 0; transition: transform .35s var(--spring); }
.tb-select.open svg { transform: rotate(180deg); }
.tb-size { display: inline-flex; align-items: center; height: 36px; border-radius: 999px; background: rgba(255,255,255,.7); box-shadow: inset 0 2px 4px rgba(22,52,104,.1), 0 0 0 1px rgba(255,255,255,.8); }
.tb-size button { width: 28px; height: 36px; border: none; background: none; cursor: pointer; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; border-radius: 999px; transition: color .2s, transform .25s var(--spring); }
.tb-size button:hover { color: var(--blue-700); }
.tb-size button:active { transform: scale(.85); }
.tb-size button svg { width: 13px; height: 13px; }
.tb-size input { width: 44px; border: none; outline: none; background: none; text-align: center; font: 600 13.5px var(--text); color: var(--ink); padding: 0; }

/* Ueberlauf-Menue der Leiste */
.more-pop { max-width: min(520px, calc(100vw - 30px)); }
.more-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px; }
.more-box .tb-sep { height: 22px; margin: 0 4px; }
@media (max-width: 1560px) { .tb-set[data-set="insert"] .lbl, .tb-set[data-set="layout"] .lbl { display: none; } }
@media (max-width: 1100px) { .tb-tab { padding: 8px 14px; } }

/* Leisten-Animation: Knoepfe bauen sich auf */
.tb-tools .tb-set > *, .tb-tabs > .tb-tab { will-change: transform, opacity; }

/* ---------- Schreibtisch + Seiten ---------- */
.desk { position: absolute; inset: 0; overflow: auto; scroll-behavior: auto; padding: 150px 0 120px; }
body.focus .desk { padding-top: 60px; }
.desk-in { position: relative; margin: 0 auto; }
.stack { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sheets { position: absolute; left: 0; top: 0; }
.sheet { position: absolute; left: 0; background: var(--page-color, #fff); border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(140,180,230,.35), 0 2px 6px rgba(14,42,92,.06), 0 24px 48px -26px rgba(14,42,92,.45); }
.sheet.new { animation: sheet-in .55s var(--spring) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.sheet .hf { position: absolute; left: var(--ml); right: var(--mr); font: 10pt "Calibri", "Segoe UI", sans-serif; color: #5b6b80; overflow: hidden; white-space: pre-wrap; pointer-events: none; }
.sheet .hf.empty { display: none; }
/* Grafiken/Textfelder aus Kopf-/Fusszeile (z. B. aus Word) */
.sheet .hfo { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.sheet .hfo.empty { display: none; }
.hfo-obj { position: absolute; transform-origin: 50% 50%; }
.hfo-obj > img { display: block; width: 100%; height: 100%; }
.hfo-text { padding: 2pt 4pt; font-size: 10pt; line-height: 1.2; color: #111; white-space: pre-wrap; overflow: visible; }
.hfo-text p { margin: 0; }
.sheet .hf p { margin: 0; }
.sheet .hd { top: calc(var(--mt) * .42); }
.sheet .ft { bottom: calc(var(--mb) * .42); }
.sheet .wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; }
.sheet .wm span { font: 700 96px var(--display); letter-spacing: .08em; color: rgba(120,140,170,.16); transform: rotate(-38deg); white-space: nowrap; text-transform: uppercase; }
.sheet .pborder { position: absolute; pointer-events: none; border-radius: 2px; }
.sheet .marg { position: absolute; pointer-events: none; border: 1px dashed rgba(64,156,255,.0); transition: border-color .3s; }
body.show-margins .sheet .marg { border-color: rgba(64,156,255,.35); }

/* Text-Fluss (ein einziges Eingabefeld ueber alle Seiten) */
.flow { position: absolute; outline: none; z-index: 2; min-height: 40px; caret-color: #1d5fc2;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif; font-size: 11pt; line-height: 1.15; color: #111; word-wrap: break-word; overflow-wrap: break-word; user-select: text; white-space: pre-wrap; tab-size: 36pt; }
.flow > *, .free-text > * { margin-top: 0; }
.flow p, .free-text p { margin: 0 0 var(--p-after, 8pt); }
.free-text { white-space: pre-wrap; }
.flow h1 { font-weight: 600; font-size: 20pt; line-height: 1.2; color: #1d4f9c; margin: 0 0 6pt; padding-top: 12pt; }
.flow h2 { font-weight: 600; font-size: 15pt; line-height: 1.2; color: #2463b8; margin: 0 0 5pt; padding-top: 10pt; }
.flow h3 { font-weight: 600; font-size: 12.5pt; line-height: 1.25; color: #24508f; margin: 0 0 4pt; padding-top: 8pt; }
.flow h4 { font-weight: 600; font-size: 11pt; line-height: 1.25; font-style: italic; color: #24508f; margin: 0 0 4pt; padding-top: 6pt; }
.flow p.iw-title { font-weight: 300; font-size: 28pt; line-height: 1.1; letter-spacing: -.01em; color: #10233f; margin-bottom: 4pt; }
.flow p.iw-subtitle { font-weight: 400; font-size: 14pt; line-height: 1.3; color: #5a6f8c; margin-bottom: 14pt; letter-spacing: .01em; }
.flow blockquote { margin: 0 0 10pt; padding: 6pt 0 6pt 14pt; border-left: 3px solid #5aa8f7; color: #334a68; font-style: italic; }
.flow pre { position: relative; margin: 0 0 10pt; padding: 34px 14pt 12pt; border-radius: 12px; background: linear-gradient(170deg, #15253f, #0d1a2e); color: #dce8f7; border: 1px solid #23395c; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px -14px rgba(13,26,46,.6); font: 10pt/1.55 "Cascadia Code", "Consolas", monospace; white-space: pre-wrap; caret-color: #8cc4ff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.flow pre::selection, .flow pre *::selection { background: rgba(90,168,247,.45); }
.flow code { font-family: "Cascadia Code", "Consolas", monospace; font-size: .92em; background: #eef3fa; border-radius: 4px; padding: 0 3px; }
.flow pre code { background: none; padding: 0; }
.flow ul, .flow ol { margin: 0 0 8pt; padding-left: 26pt; }
.flow li { margin: 0 0 2pt; }
.flow li > p { margin: 0; }
.flow ul ul, .flow ol ol, .flow ul ol, .flow ol ul { margin-bottom: 0; }
.flow ul { list-style-type: disc; } .flow ul ul { list-style-type: circle; } .flow ul ul ul { list-style-type: square; }
.flow ol { list-style-type: decimal; } .flow ol ol { list-style-type: lower-alpha; } .flow ol ol ol { list-style-type: lower-roman; }
.flow ul.iw-check { list-style: none; padding-left: 22pt; }
.flow ul.iw-check > li { position: relative; }
.flow ul.iw-check > li::before { content: ""; position: absolute; left: -20pt; top: calc(var(--pgp, 0px) + .18em); width: 12pt; height: 12pt; border-radius: 4px; cursor: pointer;
  background: #fff; box-shadow: inset 0 0 0 1.5px #8cb6e6; transition: background .2s, box-shadow .2s, transform .3s var(--spring); }
.flow ul.iw-check > li[data-checked="1"]::before { background: linear-gradient(180deg, #5eadf8, #2a7ae0) ; box-shadow: 0 0 8px rgba(64,156,255,.5); }
.flow ul.iw-check > li[data-checked="1"]::after { content: ""; position: absolute; left: -16.6pt; top: calc(var(--pgp, 0px) + .18em + 2.4pt); width: 5pt; height: 8pt; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.flow ul.iw-check > li[data-checked="1"] { color: #8a99ad; text-decoration: line-through; text-decoration-color: rgba(138,153,173,.7); }
.flow a { color: #1d63c9; text-decoration: underline; text-underline-offset: 2px; cursor: text; }
.flow hr { border: none; height: 1px; margin: 10pt 0 14pt; background: linear-gradient(90deg, rgba(90,168,247,0), rgba(90,168,247,.9) 20%, rgba(90,168,247,.9) 80%, rgba(90,168,247,0)); }
.flow table { border-collapse: collapse; width: 100%; margin: 0 0 10pt; table-layout: fixed; }
.flow td, .flow th { border: 1px solid #b9cce3; padding: 4pt 6pt; vertical-align: top; min-width: 20px; word-break: break-word; }
.flow th { background: #eaf2fc; font-weight: 600; text-align: left; }
.flow td > p:last-child, .flow th > p:last-child { margin-bottom: 0; }
.flow tr.pg-spacer td { border: none !important; padding: 0 !important; background: transparent !important; }
.flow .iw-pb { position: relative; height: 22px; margin: 0 0 4pt; user-select: none; cursor: default; }
.flow .iw-pb::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; border-top: 1.5px dashed rgba(64,156,255,.55); }
.flow .iw-pb::after { content: "Seitenumbruch"; position: absolute; left: 50%; top: 2px; transform: translateX(-50%); padding: 1px 10px; border-radius: 99px; font: 600 9px/16px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--blue-600); background: #eef6ff; }
.flow .iw-toc { margin: 0 0 12pt; padding: 10pt 12pt; border-radius: 10px; background: linear-gradient(180deg, #f6faff, #eef5ff); border: 1px solid #d7e6f7; user-select: none; cursor: default; }
.flow .iw-toc h4 { margin: 0 0 6pt; padding: 0; font: 700 9pt var(--display); letter-spacing: .16em; text-transform: uppercase; color: #2a7ae0; font-style: normal; }
.flow .iw-toc a { display: flex; gap: 6px; text-decoration: none; color: #213a5c; padding: 1.5pt 0; cursor: pointer; }
.flow .iw-toc a .dots { flex: 1; border-bottom: 1px dotted #9db5d4; transform: translateY(-4px); }
.flow .iw-toc a.l2 { padding-left: 14pt; } .flow .iw-toc a.l3 { padding-left: 28pt; font-size: .95em; }
.flow .iw-footnote { vertical-align: super; font-size: .7em; color: #1d63c9; }

/* Bilder im Text */
.flow img, .free-text img { max-width: 100%; }
.flow img.iw-img { cursor: default; vertical-align: bottom; transition: box-shadow .25s, opacity .25s, filter .25s; user-select: none; }
.flow img.iw-img[data-wrap="left"] { float: left; margin: 2pt 12pt 6pt 0; }
.flow img.iw-img[data-wrap="right"] { float: right; margin: 2pt 0 6pt 12pt; }
.flow img.iw-img[data-wrap="center"] { display: block; margin: 4pt auto 8pt; }
.flow img.iw-img.dragging { opacity: .22; filter: saturate(.3); }
.flow img.iw-img.sel, .free-obj.sel { outline: none; }
.flow::after { content: ""; display: block; clear: both; }

/* Bild-Stile */
[data-look="shadow"] { box-shadow: 0 14px 28px -10px rgba(14,30,60,.45) !important; }
[data-look="round"] { border-radius: 14px !important; }
[data-look="circle"] { border-radius: 50% !important; object-fit: cover; aspect-ratio: 1 / 1; }
[data-look="frame"] { border: 6px solid #fff !important; box-shadow: 0 0 0 1px #d4deeb, 0 10px 24px -10px rgba(14,30,60,.35) !important; }
[data-look="polaroid"] { background: #fff; padding: 8px 8px 30px !important; box-shadow: 0 16px 30px -12px rgba(14,30,60,.4), 0 0 0 1px #e3e9f1 !important; }
[data-look="glow"] { border-radius: 16px !important; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 5px rgba(90,168,247,.6), 0 12px 34px rgba(64,156,255,.45) !important; }

/* Freie Objekte (vor/hinter dem Text) */
.free-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.free-layer.back { z-index: 1; }
.free-layer.front { z-index: 3; }
.free-obj { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; user-select: none; }
.free-obj > img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.free-obj[data-kind="img"] { cursor: move; }
.free-obj.moving { transition: none !important; }
.free-text { width: 100%; height: 100%; padding: 8pt 10pt; overflow: hidden; outline: none; cursor: text; user-select: text;
  font-family: "Calibri", "Segoe UI", sans-serif; font-size: 11pt; line-height: 1.2; color: #111; border-radius: 10px; background: rgba(255,255,255,.0);
  box-shadow: inset 0 0 0 1px rgba(90,168,247,.0); transition: box-shadow .2s; }
.free-obj[data-kind="text"]:hover .free-text { box-shadow: inset 0 0 0 1px rgba(90,168,247,.45); }
.free-obj[data-kind="text"][data-look="card"] .free-text { background: #fff; box-shadow: 0 10px 26px -12px rgba(14,30,60,.35), 0 0 0 1px #dfe7f2; }
.free-obj[data-kind="text"][data-look="blue"] .free-text { background: linear-gradient(170deg, #eef6ff, #dcecff); box-shadow: inset 0 0 0 1px #bcd8f7; }
.free-obj[data-kind="text"][data-look="note"] .free-text { background: #fff7c7; box-shadow: 0 12px 22px -12px rgba(120,90,0,.35); transform: rotate(-1.2deg); }
.free-grip { position: absolute; left: 50%; top: -14px; width: 40px; height: 10px; margin-left: -20px; border-radius: 6px; cursor: move; opacity: 0; transition: opacity .2s;
  background: repeating-linear-gradient(90deg, rgba(64,156,255,.65) 0 3px, transparent 3px 6px); }
.free-obj[data-kind="text"]:hover .free-grip, .free-obj.sel .free-grip { opacity: 1; }

/* Auswahlrahmen, Griffe, Hilfslinien */
.overlay { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; }
.selbox { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 50% 50%; animation: sel-in .3s var(--spring) both; }
@keyframes sel-in { from { opacity: 0; transform: scale(.96); } }
.selbox::before { content: ""; position: absolute; inset: -2px; border-radius: 3px; box-shadow: 0 0 0 1.5px rgba(42,122,224,.95), 0 0 0 5px rgba(64,156,255,.18), 0 0 22px rgba(64,156,255,.3); }
.hdl { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: auto;
  background: radial-gradient(circle at 35% 30%, #fff, #dcecff); box-shadow: 0 0 0 1.5px #2a7ae0, 0 3px 8px rgba(14,42,92,.3); transition: transform .25s var(--spring); }
.hdl:hover { transform: scale(1.35); }
.hdl[data-h="nw"], .hdl[data-h="se"] { cursor: nwse-resize; } .hdl[data-h="ne"], .hdl[data-h="sw"] { cursor: nesw-resize; }
.hdl[data-h="n"], .hdl[data-h="s"] { cursor: ns-resize; width: 22px; height: 10px; margin: -5px 0 0 -11px; border-radius: 6px; }
.hdl[data-h="e"], .hdl[data-h="w"] { cursor: ew-resize; width: 10px; height: 22px; margin: -11px 0 0 -5px; border-radius: 6px; }
.hdl[data-h="rot"] { cursor: grab; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: radial-gradient(circle at 35% 30%, #8fd0ff, #2a7ae0); box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(14,42,92,.35), 0 0 14px rgba(64,156,255,.6); }
.hdl[data-h="rot"]::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 18px; margin-left: -.75px; background: rgba(42,122,224,.8); }
.guide { position: absolute; background: #ff4fa3; box-shadow: 0 0 6px rgba(255,79,163,.7); pointer-events: none; animation: guide-in .25s var(--smooth) both; }
.guide.v { width: 1px; } .guide.h { height: 1px; }
@keyframes guide-in { from { opacity: 0; } }
.size-tip { position: absolute; padding: 4px 10px; border-radius: 99px; font: 600 11px var(--display); letter-spacing: .04em; color: #fff; white-space: nowrap;
  background: linear-gradient(180deg, #3a92ef, #1d5fc2); box-shadow: 0 6px 16px rgba(29,95,194,.45); pointer-events: none; transform: translate(-50%, 0); }
.drop-caret { position: absolute; width: 2.5px; border-radius: 2px; background: #2a7ae0; box-shadow: 0 0 0 3px rgba(64,156,255,.2), 0 0 14px rgba(64,156,255,.9); pointer-events: none; transition: transform .12s var(--smooth), height .12s; animation: caret-blink 1s ease-in-out infinite; }
@keyframes caret-blink { 50% { opacity: .45; } }
.drop-side { position: absolute; border-radius: 8px; background: rgba(64,156,255,.12); box-shadow: inset 0 0 0 1.5px rgba(64,156,255,.5); pointer-events: none; transition: all .18s var(--smooth); }
.ghost { position: fixed; left: 0; top: 0; z-index: 9500; pointer-events: none; border-radius: 6px; transform-origin: 50% 50%;
  box-shadow: 0 30px 60px -20px rgba(14,30,60,.55), 0 0 0 2px rgba(64,156,255,.6), 0 0 36px rgba(64,156,255,.35); will-change: transform; }

/* Kontext-Leiste ueber Bild / Tabelle */
.ctx-bar { position: fixed; z-index: 130; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px;
  background: linear-gradient(170deg, rgba(255,255,255,.94), rgba(236,245,255,.9));
  box-shadow: inset 0 1.5px 0 #fff, 0 0 0 1px rgba(255,255,255,.8), 0 16px 34px -14px rgba(14,42,92,.5), 0 0 24px rgba(64,156,255,.18);
  animation: ctx-in .45s var(--spring) both; white-space: nowrap; }
@keyframes ctx-in { from { opacity: 0; transform: translateY(10px) scale(.9); } }
.ctx-bar .tb-btn { height: 34px; min-width: 34px; }
.ctx-bar .tb-btn svg { width: 17px; height: 17px; }
.ctx-bar .tb-sep { height: 20px; margin: 0 4px; }
.ctx-bar .tb-btn.danger:hover { color: var(--red); }

/* ---------- Aufklapp-Menues ---------- */
.pop { position: fixed; z-index: 7600; min-width: 180px; max-height: min(70vh, 560px); overflow: auto; padding: 8px; border-radius: 22px;
  background: linear-gradient(165deg, rgba(255,255,255,.97), rgba(236,245,255,.95));
  box-shadow: inset 0 1.5px 0 #fff, 0 0 0 1px rgba(255,255,255,.8), 0 24px 50px -18px rgba(14,42,92,.55), 0 4px 14px rgba(14,42,92,.1);
  transform-origin: var(--ox, 50%) var(--oy, 0%); animation: pop-open .38s var(--spring) both; user-select: none; }
.pop.closing { animation: pop-close .18s ease both; pointer-events: none; }
@keyframes pop-open { from { opacity: 0; transform: scale(.86) translateY(-8px); } }
@keyframes pop-close { to { opacity: 0; transform: scale(.94) translateY(-4px); } }
.pop .opt { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; cursor: pointer; padding: 9px 12px; border-radius: 14px; text-align: left; color: var(--ink); font-size: 13.5px;
  transition: background .15s, transform .25s var(--spring); animation: opt-in .4s var(--smooth) both; }
@keyframes opt-in { from { opacity: 0; transform: translateX(-8px); } }
.pop .opt:hover, .pop .opt.kb { background: linear-gradient(180deg, rgba(235,246,255,1), rgba(210,232,255,.9)); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(140,196,255,.6); }
.pop .opt.on { color: var(--blue-700); font-weight: 600; }
.pop .opt.on::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-500); box-shadow: 0 0 8px var(--glow); }
.pop .opt svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--blue-600); }
.pop .opt small { margin-left: auto; color: var(--ink-faint); font-size: 11.5px; padding-left: 14px; }
.pop .opt:disabled { opacity: .45; cursor: default; }
.pop hr { border: none; height: 1px; margin: 6px 8px; background: rgba(70,101,140,.14); }
.pop h5 { margin: 6px 10px 6px; font: 700 10.5px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.pop .search { height: 38px; min-width: 0; margin: 2px 2px 8px; }
.pop.fonts { width: 290px; }
.pop.fonts .opt { font-size: 15px; padding: 8px 12px; }
.pop.styles { width: 300px; }
.pop.styles .opt { padding: 10px 14px; }

/* Farben */
.colors { width: 268px; padding: 12px; }
.colors .row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-bottom: 4px; }
.colors .sw { width: 100%; aspect-ratio: 1; border: none; border-radius: 7px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .25s var(--spring), box-shadow .2s; animation: sw-in .35s var(--spring) both; }
@keyframes sw-in { from { opacity: 0; transform: scale(.4); } }
.colors .sw:hover { transform: scale(1.25); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 4px 10px rgba(14,42,92,.3); z-index: 1; position: relative; }
.colors .sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--blue-600); }
.colors .wide { display: flex; gap: 6px; margin-top: 8px; }
.colors .wide button { flex: 1; height: 34px; border: none; border-radius: 12px; cursor: pointer; font: 600 12.5px var(--text); color: var(--ink); background: rgba(255,255,255,.8); box-shadow: var(--bevel-sm); display: flex; align-items: center; justify-content: center; gap: 6px; }
.colors .wide button:hover { background: #fff; color: var(--blue-700); }
.colors .wide svg { width: 16px; height: 16px; color: var(--blue-600); }
.pop.colors { overflow: visible; max-height: none; }
.colors .wide input[type=color] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.colors .none-sw { background: linear-gradient(135deg, #fff 45%, #e25555 46%, #e25555 54%, #fff 55%) !important; }

/* Tabelle einfuegen */
.grid-pick { padding: 14px; }
.grid-pick .cells { display: grid; grid-template-columns: repeat(10, 20px); gap: 3px; }
.grid-pick .cells i { width: 20px; height: 20px; border-radius: 5px; background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1px #c9daef; transition: background .12s, box-shadow .12s, transform .2s var(--spring); }
.grid-pick .cells i.on { background: linear-gradient(180deg, #8cc4ff, #3a92ef); box-shadow: 0 0 8px rgba(64,156,255,.5); transform: scale(1.06); }
.grid-pick .lbl { margin-top: 10px; text-align: center; font: 600 13px var(--display); letter-spacing: .06em; color: var(--blue-700); }

/* Symbole / Emoji */
.sym-grid { display: grid; grid-template-columns: repeat(10, 34px); gap: 3px; padding: 4px; }
.sym-grid button { width: 34px; height: 34px; border: none; border-radius: 10px; cursor: pointer; background: none; font-size: 17px; color: var(--ink); transition: background .15s, transform .25s var(--spring); }
.sym-grid button:hover { background: #fff; transform: scale(1.25); box-shadow: 0 4px 12px rgba(14,42,92,.2); }
.sym-tabs { display: flex; gap: 4px; padding: 2px 4px 8px; flex-wrap: wrap; }
.sym-tabs button { border: none; border-radius: 99px; padding: 6px 11px; cursor: pointer; font: 600 12px var(--text); color: var(--ink-soft); background: rgba(255,255,255,.6); }
.sym-tabs button.on { color: #fff; background: linear-gradient(180deg, #5eadf8, #2a7ae0); }

/* kleine Formulare in Popovers */
.pform { padding: 12px; width: 300px; }
.pform .field { margin-bottom: 10px; }
.pform .inp { padding: 10px 13px; font-size: 14px; border-radius: 13px; }
.pform .row { display: flex; gap: 8px; }
.pform .row > * { flex: 1; }
.pform .btn-primary { padding: 10px 16px; font-size: 14px; }
.pform .btn-ghost { padding: 10px 14px; font-size: 13px; }
.pform .hint { font-size: 12px; color: var(--ink-faint); margin: -2px 4px 10px; }

/* ---------- Suchen & Ersetzen ---------- */
.find { position: fixed; z-index: 115; right: 18px; top: 130px; width: 360px; padding: 12px; border-radius: 26px; animation: find-in .5s var(--spring) both; }
@keyframes find-in { from { opacity: 0; transform: translateX(40px) scale(.95); } }
.find.closing { animation: find-out .25s ease both; }
@keyframes find-out { to { opacity: 0; transform: translateX(30px) scale(.96); } }
.find .frow { display: flex; align-items: center; gap: 6px; }
.find .frow + .frow { margin-top: 8px; }
.find .inp { flex: 1; padding: 10px 14px; font-size: 14px; border-radius: 999px; }
.find .cnt { min-width: 52px; text-align: center; font: 600 12px var(--display); color: var(--ink-soft); }
.find .tb-btn { height: 34px; min-width: 34px; }
.find .tb-btn svg { width: 16px; height: 16px; }
.find .opts { display: flex; gap: 6px; margin-top: 8px; }
.find .chip { border: none; border-radius: 99px; padding: 6px 12px; cursor: pointer; font: 600 12px var(--text); color: var(--ink-soft); background: rgba(255,255,255,.6); box-shadow: var(--bevel-sm); transition: all .25s; }
.find .chip.on { color: #fff; background: linear-gradient(180deg, #5eadf8, #2a7ae0); }
.find .btn-ghost { padding: 9px 14px; font-size: 13px; }
::highlight(iw-find) { background-color: rgba(255,214,90,.65); }
::highlight(iw-find-cur) { background-color: rgba(255,140,40,.75); color: #000; }

/* ---------- Statusleiste ---------- */
.status { position: fixed; z-index: 110; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 6px 8px 6px 18px; border-radius: 999px;
  background: linear-gradient(170deg, rgba(255,255,255,.8), rgba(236,245,255,.66)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1.5px 0 #fff, 0 0 0 1px rgba(255,255,255,.7), 0 14px 30px -16px rgba(14,42,92,.45); font: 500 12.5px var(--text); color: var(--ink-soft); white-space: nowrap;
  animation: status-in .8s var(--spring) .9s both; transition: transform .6s var(--smooth), opacity .4s; }
@keyframes status-in { from { opacity: 0; transform: translate(-50%, 40px); } }
body.focus .status { transform: translate(-50%, 90px); opacity: 0; }
.status b { color: var(--ink); font-weight: 600; }
.status .sep { width: 1px; height: 16px; background: rgba(70,101,140,.2); }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom input[type=range] { -webkit-appearance: none; appearance: none; width: 110px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #5aa8f7 var(--p, 50%), rgba(70,101,140,.2) var(--p, 50%)); outline: none; }
.zoom input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; cursor: pointer; background: radial-gradient(circle at 35% 30%, #fff, #cfe6ff); box-shadow: 0 0 0 1.5px #2a7ae0, 0 3px 8px rgba(14,42,92,.3); transition: transform .25s var(--spring); }
.zoom input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.25); }
.zoom .tb-btn { height: 30px; min-width: 30px; }
.zoom .tb-btn svg { width: 15px; height: 15px; }
.zoom .z { min-width: 42px; text-align: center; font: 600 12px var(--display); color: var(--ink); border: none; background: none; cursor: pointer; border-radius: 99px; padding: 6px 4px; }
.zoom .z:hover { background: rgba(255,255,255,.8); }

/* Formatierungszeichen */
body.marks .flow p::after, body.marks .flow h1::after, body.marks .flow h2::after, body.marks .flow h3::after, body.marks .flow h4::after, body.marks .flow li::after { content: "¶"; color: #7aa9e0; font-weight: 400; font-style: normal; margin-left: 2px; }
body.marks .flow br::after { content: "↵"; }

/* Sperre (abgemeldet / gesperrt) */
.lock { position: fixed; inset: 0; z-index: 9800; display: flex; align-items: center; justify-content: center; background: rgba(220,234,252,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: lock-in .5s var(--smooth) both; }
@keyframes lock-in { from { opacity: 0; } }
.lock .lock-card { width: min(430px, calc(100vw - 40px)); padding: 54px 28px 26px; text-align: center; animation: card-in .8s var(--spring) .1s both; }
.lock .mini-orb { width: 92px; height: 92px; margin: -100px auto 18px; }
.lock .mini-orb svg { width: 36px; height: 36px; }
.lock h1 { margin: 0 0 6px; font: 700 22px var(--display); }
.lock p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.lock .btn-link { margin-top: 10px; }

/* Ladeanzeige beim Oeffnen */
.loading-veil { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; background: rgba(226,239,255,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: lock-in .3s both; font: 600 15px var(--display); letter-spacing: .08em; color: var(--blue-700); }
.loading-veil .ring { width: 64px; height: 64px; border-radius: 50%; border: 4px solid rgba(64,156,255,.2); border-top-color: var(--blue-600); animation: spin .9s linear infinite; box-shadow: 0 0 30px rgba(64,156,255,.3); }

/* Format-Kacheln (Speichern unter) */
.fmt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fmt { position: relative; border: none; cursor: pointer; padding: 14px 12px 12px; border-radius: 20px; text-align: left; color: var(--ink);
  background: rgba(255,255,255,.7); box-shadow: var(--bevel-sm), 0 8px 18px -12px rgba(14,42,92,.4); transition: transform .35s var(--spring), box-shadow .25s, background .2s; animation: card-pop .5s var(--spring) both; }
.fmt:hover { transform: translateY(-3px); background: #fff; box-shadow: var(--bevel-sm), 0 0 0 2px rgba(64,156,255,.5), 0 14px 24px -12px rgba(14,42,92,.4); }
.fmt:disabled { opacity: .45; cursor: default; transform: none; }
.fmt .ext { display: inline-block; padding: 3px 9px; border-radius: 99px; font: 700 11px var(--display); letter-spacing: .08em; color: #fff; background: linear-gradient(180deg, #5eadf8, #1f66cc); box-shadow: 0 4px 10px rgba(31,102,204,.35); }
.fmt .ext.own { background: linear-gradient(135deg, #36c2ff, #2a7ae0 50%, #6a5cff); }
.fmt b { display: block; margin-top: 8px; font: 600 14px var(--display); letter-spacing: .02em; }
.fmt small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; }

/* Dialog-Formular (Seite einrichten, Eigenschaften) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.form-grid .field { margin-bottom: 4px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .inp { padding: 10px 13px; font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,.7); box-shadow: var(--bevel-sm); animation: card-pop .5s var(--spring) both; }
.stat b { display: block; font: 700 24px var(--display); color: var(--blue-700); }
.stat span { font-size: 12.5px; color: var(--ink-soft); }

/* Kontextmenue */
.cmenu { min-width: 220px; }

/* ---------- Druck / PDF ---------- */
@media print {
  @page { margin: 0; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#editor) { display: none !important; }
  #editor { position: static !important; background: none !important; }
  #editor > *:not(.desk) { display: none !important; }
  .desk { position: static !important; overflow: visible !important; padding: 0 !important; }
  .desk-in { margin: 0 !important; width: auto !important; height: auto !important; }
  .stack { position: relative !important; transform: none !important; }
  .sheet { box-shadow: none !important; border-radius: 0 !important; }
  .sheet .hf:hover, .sheet .hf.empty::before { background: none !important; box-shadow: none !important; content: none !important; }
  .print-links { display: block !important; }
  .overlay, .flow .iw-pb::before, .flow .iw-pb::after, .marg { display: none !important; }
  body.marks .flow *::after { content: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
body.printing .tb-zone, body.printing .status, body.printing .ed-brand, body.printing .ed-me, body.printing .titlebar { visibility: hidden; }

/* Code-Bloecke: Leiste mit Sprache + Kopieren */
.code-bar { position: absolute; left: 0; top: 0; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 8px; pointer-events: none; }
.code-bar button { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border: none; border-radius: 99px; cursor: pointer;
  font: 600 11px var(--display); letter-spacing: .06em; color: #b9d3f2; background: rgba(255,255,255,.07); transition: background .2s, color .2s, transform .3s var(--spring); }
.code-bar button:hover { background: rgba(90,168,247,.25); color: #fff; }
.code-bar button:active { transform: scale(.94); }
.code-bar svg { width: 12px; height: 12px; }
.code-bar .cb-lang i { width: 7px; height: 7px; border-radius: 50%; background: #5aa8f7; box-shadow: 0 0 8px #5aa8f7; }
.code-bar .cb-copy.done { color: #fff; background: linear-gradient(180deg, #36c47c, #1d8a52); }
.pop.langs { max-height: 360px; }
::highlight(iw-kw) { color: #7cb8ff; }
::highlight(iw-str) { color: #a5e3a1; }
::highlight(iw-com) { color: #6f86a6; }
::highlight(iw-num) { color: #ffb86b; }
::highlight(iw-fn) { color: #e7c0ff; }
::highlight(iw-tag) { color: #7cb8ff; }
::highlight(iw-attr) { color: #ffd479; }
/* im PDF: Sprache + Kopieren-Link */
.print-links { display: none; position: absolute; left: 0; top: 0; z-index: 6; }
body.printing .print-links { display: block; }
.print-links .pl { position: absolute; left: 0; top: 0; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; text-decoration: none; font: 600 8.5pt "Bahnschrift", "Segoe UI", sans-serif; letter-spacing: .06em; }
.print-links .pl-lang { color: #8fb3dd; }
.print-links .pl-copy { color: #cfe4ff; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.1); }

/* ---------- Hinweis beim ersten Start: Menue hinter dem Stift ---------- */
.ed-orb.hinting { animation: orb-call 1.8s ease-in-out infinite; }
@keyframes orb-call { 0%,100% { box-shadow: 0 0 0 0 rgba(64,156,255,.55); } 50% { box-shadow: 0 0 0 14px rgba(64,156,255,0); } }
.orb-hint { position: fixed; z-index: 7100; top: 14px; left: 78px; width: 270px; padding: 16px 18px 14px; border-radius: 22px;
  display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateX(-26px) scale(.9); transform-origin: 0 24px; pointer-events: none;
  transition: opacity .35s, transform .6s var(--spring); }
.orb-hint.show { opacity: 1; transform: none; pointer-events: auto; }
.orb-hint::before { content: ""; position: absolute; left: -7px; top: 18px; width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px;
  background: rgba(240,247,255,.95); box-shadow: -1px 1px 0 rgba(255,255,255,.7); }
.orb-hint b { font: 700 16px var(--display); letter-spacing: .02em; color: var(--ink); }
.orb-hint > span { font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.orb-hint .btn-primary { margin-top: 6px; padding: 9px 16px; font-size: 13.5px; }

/* ---------- Druckfenster ---------- */
.pr-layer { position: fixed; inset: 0; z-index: 6500; display: flex; gap: 26px; padding: 54px 28px 24px; overflow: hidden;
  background: rgba(225,238,255,0); backdrop-filter: blur(0); transition: background .45s, backdrop-filter .45s; }
.pr-layer.open { background: rgba(215,232,255,.72); backdrop-filter: blur(18px) saturate(1.2); }
.pr-panel { width: 330px; flex-shrink: 0; border-radius: var(--r-xl); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 14px; overflow: auto;
  opacity: 0; transform: translateX(-60px) scale(.96); transition: opacity .4s, transform .7s var(--spring); }
.pr-layer.open .pr-panel { opacity: 1; transform: none; }
.pr-head { display: flex; align-items: center; gap: 12px; }
.pr-head h2 { margin: 0; font: 700 24px var(--display); letter-spacing: .02em; color: var(--ink); }
.pr-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 34% 28%, #9fd0ff, #3a92ef 55%, #1d5fc2); box-shadow: 0 8px 18px -6px rgba(31,102,204,.7), inset 0 1px 0 rgba(255,255,255,.6); }
.pr-ic svg { width: 20px; height: 20px; }
.pr-go { padding: 15px 20px; font-size: 16px; }
.pr-layer.sent .pr-go { background: linear-gradient(180deg, #5fd69a, #24a865 55%, #1a8a52); }
.pr-sec { display: flex; flex-direction: column; gap: 7px; }
.pr-sec.pr-row { flex-direction: row; align-items: center; justify-content: space-between; }
.pr-lbl { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-left: 6px; letter-spacing: .02em; }
.pr-printer { position: relative; }
.pr-pick { width: 100%; display: flex; align-items: center; gap: 10px; border: none; cursor: pointer; text-align: left; padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.75); box-shadow: inset 0 -1px 0 rgba(255,255,255,.9), 0 0 0 1px rgba(255,255,255,.7), 0 6px 14px -8px rgba(14,42,92,.35); color: var(--ink); transition: box-shadow .25s; }
.pr-pick:hover { box-shadow: 0 0 0 3px rgba(58,146,239,.25), 0 6px 14px -8px rgba(14,42,92,.35); }
.pr-pick b { flex: 1; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-pick svg { width: 16px; height: 16px; color: var(--blue-600); transition: transform .4s var(--spring); }
.pr-printer.open .pr-pick svg { transform: rotate(180deg); }
.pr-printer.none .pr-pick { cursor: default; color: var(--ink-faint); }
.pr-pdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--green); box-shadow: 0 0 8px rgba(36,168,101,.7); }
.pr-printer.none .pr-pdot { background: var(--ink-faint); box-shadow: none; }
.pr-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); max-height: 260px; overflow: auto; padding: 6px; border-radius: 18px;
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top; pointer-events: none; transition: opacity .2s, transform .35s var(--spring); }
.pr-printer.open .pr-list { opacity: 1; transform: none; pointer-events: auto; }
.pr-list button { width: 100%; display: flex; align-items: center; gap: 10px; border: none; background: none; cursor: pointer; text-align: left;
  padding: 10px 12px; border-radius: 12px; color: var(--ink); font-size: 14px; transition: background .15s; }
.pr-printer.open .pr-list button { animation: pr-in .35s var(--smooth) backwards; }
.pr-list button span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-list button:hover { background: rgba(58,146,239,.12); }
.pr-list button.on { background: rgba(58,146,239,.18); font-weight: 600; }
.pr-list small { font-size: 11px; color: var(--blue-600); font-weight: 600; }
@keyframes pr-in { from { opacity: 0; transform: translateY(-6px); } }
.pr-step { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(255,255,255,.7); box-shadow: inset 0 2px 5px rgba(22,52,104,.1); }
.pr-step button { width: 32px; height: 32px; border: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--blue-700);
  background: rgba(255,255,255,.9); box-shadow: var(--bevel-sm); transition: transform .25s var(--spring); }
.pr-step button:active { transform: scale(.88); }
.pr-step svg { width: 14px; height: 14px; }
.pr-step input { width: 46px; border: none; outline: none; background: none; text-align: center; font: 700 17px var(--display); color: var(--ink); }
.pr-seg { position: relative; display: flex; padding: 4px; border-radius: 99px; background: rgba(18,41,75,.07); box-shadow: inset 0 2px 4px rgba(22,52,104,.1); }
.pr-seg button { position: relative; z-index: 1; flex: 1; border: none; background: none; cursor: pointer; padding: 8px 6px; border-radius: 99px;
  font-weight: 600; font-size: 13px; color: var(--ink-soft); transition: color .25s; white-space: nowrap; }
.pr-seg button.on { color: var(--blue-700); }
.pr-seg-mark { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 99px; background: #fff;
  box-shadow: 0 4px 12px -4px rgba(14,42,92,.35), inset 0 -1px 0 rgba(22,52,104,.08); transition: transform .5s var(--spring), width .5s var(--spring); }
.pr-range { max-height: 0; padding-top: 0 !important; padding-bottom: 0 !important; opacity: 0; transition: max-height .4s var(--smooth), opacity .3s, padding .4s; font-size: 14px !important; }
.pr-layer.ranged .pr-range { max-height: 50px; padding-top: 11px !important; padding-bottom: 11px !important; opacity: 1; }
.pr-range.bad { box-shadow: 0 0 0 2px rgba(201,69,69,.45) !important; }
.pr-foot { margin-top: auto; padding-top: 6px; }
.pr-foot .btn-ghost { width: 100%; }
.pr-view { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pr-scroll { flex: 1; overflow: auto; border-radius: var(--r-xl); padding: 24px 0 60px; perspective: 1400px; }
.pr-sheets { width: min(560px, 86%); margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.pr-wait { display: grid; place-items: center; height: 300px; }
.pr-wait .spin { width: 34px; height: 34px; border-width: 3px; }
.pr-sheet { position: relative; width: 100%; background: #fff; border-radius: 4px; cursor: pointer; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(14,42,92,.55), 0 4px 12px rgba(14,42,92,.1);
  animation: pr-sheet .8s var(--smooth) backwards; transition: opacity .35s, transform .45s var(--spring), filter .35s; }
@keyframes pr-sheet { from { opacity: 0; transform: translateY(60px) rotateX(18deg) scale(.94); } }
.pr-sheet:hover { transform: translateY(-3px); }
.pr-sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .5s; }
.pr-sheet canvas.in { opacity: 1; }
.pr-sheet.off { opacity: .32; transform: scale(.96); }
.pr-num { position: absolute; z-index: 2; right: 10px; bottom: 10px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center;
  font: 700 12px var(--display); color: #fff; background: rgba(29,95,194,.85); box-shadow: 0 4px 10px rgba(14,42,92,.3); transition: background .3s; }
.pr-sheet.off .pr-num { background: rgba(70,101,140,.6); }
.pr-layer.gray .pr-sheet canvas { filter: grayscale(1); }
.pr-count { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: 13px; color: var(--ink);
  background: rgba(255,255,255,.85); box-shadow: var(--bevel-sm); white-space: nowrap; }
.pr-count:empty { display: none; }
.pr-layer.sending .pr-sheet:not(.off) { animation: pr-send 1.2s var(--smooth) infinite alternate; }
@keyframes pr-send { to { transform: translateY(-6px); box-shadow: 0 40px 70px -30px rgba(31,102,204,.6); } }
.pr-close { position: absolute; top: 56px; right: 28px; width: 40px; height: 40px; border: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  color: var(--ink-soft); background: rgba(255,255,255,.75); box-shadow: var(--bevel-sm); transition: transform .4s var(--spring), background .2s; }
.pr-close:hover { background: #fff; transform: rotate(90deg); }
.pr-close svg { width: 15px; height: 15px; }
@media (max-width: 820px) { .pr-layer { flex-direction: column; overflow: auto; } .pr-panel { width: auto; } }
