/* Das Blatt: gilt in Vorschau und Druck gleich, alles in mm und pt. Hier keine Farben der Oberfläche */
.sheet { position: relative; overflow: hidden; background: #fff; color: #000; box-sizing: border-box; }
.sheet, .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet .o { position: absolute; line-height: 1.15; }
.o-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.o-line { background: #000; }
.o-box { box-sizing: border-box; }
.o-table .tc { position: absolute; display: flex; box-sizing: border-box; padding: .4mm .8mm; overflow: hidden; white-space: pre-wrap; line-height: 1.1; }
.sheet[data-canvas] .o-line::before { content: ''; position: absolute; inset: -1.5mm; } /* Linien lassen sich auch knapp daneben greifen */
.hair.is-ghost { fill: var(--paper-ghost); }
.hair.is-ghost line { stroke: var(--paper-ghost); }
.hair { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.o-table .tl { position: absolute; display: block; box-sizing: content-box; }
.o-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sheet-bg { object-fit: fill; }
/* Nur im Editor */
.o-table { outline-offset: 0; }
.o-table .tc.is-data { color: var(--paper-data); }
.o-table .tc.is-nil { color: var(--paper-nil); }
.is-sel.o-table { overflow: visible; }
.is-sel .tc { cursor: text; }
.tc.has-caret span::after { content: ''; display: inline-block; width: .25mm; height: 1em; margin-left: .2mm; vertical-align: text-bottom; background: var(--paper-select); animation: tf-caret 1s linear infinite; }
@keyframes tf-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.th { position: absolute; display: flex; align-items: center; justify-content: center; background: var(--bg-control); color: var(--text-muted); font: 500 2.6mm/1 var(--font-mono); box-sizing: border-box; border: .1mm solid var(--bg-panel); cursor: pointer; }
.th.on { background: var(--select-bg); color: var(--select-text); }
.th-c { top: -5mm; height: 4.5mm; }
.th-r { left: -5mm; width: 4.5mm; }
.tmove { position: absolute; left: -5mm; top: -5mm; width: 4.5mm; height: 4.5mm; background: var(--accent); cursor: move; }
.tz { position: absolute; }
.tz-c { top: -5mm; height: 4.5mm; width: 1.6mm; margin-left: -.8mm; cursor: col-resize; }
.tz-r { left: -5mm; width: 4.5mm; height: 1.6mm; margin-top: -.8mm; cursor: row-resize; }
.tins { display: none; position: absolute; width: 4mm; height: 4mm; left: -1.2mm; top: -4.4mm; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 600 3mm/4mm var(--font-sans); cursor: pointer; }
.tz-r .tins { left: -4.4mm; top: -1.2mm; }
.tz:hover .tins { display: block; }
.tsel { position: absolute; pointer-events: none; outline: .5mm solid var(--paper-select); background: rgba(95, 128, 0, .12); }
[data-canvas] { cursor: default; user-select: none; }
.tool-place [data-canvas], .tool-place [data-canvas] .o { cursor: crosshair; }
.o.is-data { color: var(--paper-data); background: var(--paper-data-bg); }
.o.is-nil { color: var(--paper-nil); background: var(--paper-nil-bg); }
.o.is-comment { background: var(--paper-head); color: var(--paper-ghost); }
.o.is-ghost { color: var(--paper-ghost); background: repeating-linear-gradient(45deg, var(--paper-ghost-bg) 0 1mm, var(--paper) 1mm 2mm); }
.o.is-empty { background: var(--paper-head); display: flex; align-items: center; justify-content: center; }
.img-ph { color: var(--paper-ghost); font: 500 3.5mm/1 var(--font-sans); }
.o.is-sel { outline: .4mm solid var(--paper-select); outline-offset: .3mm; }
.o.is-multi { outline: .3mm solid var(--paper-select); outline-offset: .2mm; }
.handle { z-index: 10; position: absolute; width: 2mm; height: 2mm; background: var(--accent); border: .2mm solid var(--paper-handle); box-sizing: border-box; }
.handle.e { right: -1.3mm; top: calc(50% - 1mm); cursor: ew-resize; }
.handle.s { bottom: -1.3mm; left: calc(50% - 1mm); cursor: ns-resize; }
.handle.se { right: -1.3mm; bottom: -1.3mm; cursor: nwse-resize; }
.snap-line { position: absolute; background: var(--guide); pointer-events: none; }
.snap-line.sx { top: 0; bottom: 0; width: .2mm; }
.snap-line.sy { left: 0; right: 0; height: .2mm; }

@media print {
  #print-root .sheet { break-inside: avoid; }
  #print-root .sheet + .sheet { break-before: page; }
}
