* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; font: 14px/1.4 system-ui, sans-serif; color: #000; background: #fff; }
header { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #000; }
header .spacer { flex: 1; }
button { font: inherit; padding: 3px 8px; border: 1px solid #000; background: #fff; cursor: pointer; }
button:hover { background: #eee; }
button:disabled { opacity: .4; cursor: default; }
#status { min-width: 9em; text-align: right; color: #555; }
#status.fehler { color: #c00; }
#banner { padding: 6px 12px; background: #ffe9a8; border-bottom: 1px solid #000; }
main { flex: 1; display: flex; min-height: 0; }
aside { width: 280px; flex: none; display: flex; flex-direction: column; border-right: 1px solid #000; min-height: 0; }
#filter { margin: 8px; padding: 4px 6px; font: inherit; border: 1px solid #000; }
#list { flex: 1; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
#list li { display: flex; align-items: center; gap: 8px; padding: 3px 8px; cursor: pointer; border-bottom: 1px solid #eee; }
#list li:hover { background: #f3f3f3; }
#list li.aktiv { background: #000; color: #fff; }
#list li.konflikt .nr { color: #c00; font-weight: bold; }
#list li.aktiv.konflikt .nr { color: #ff8080; }
#list img { width: 28px; height: 28px; object-fit: contain; background: #fff; }
#list .nr { font-variant-numeric: tabular-nums; }
#list .sub { display: block; font-size: 12px; color: #666; }
#list li.aktiv .sub { color: #ccc; }
#list li.tisch { border-bottom: 1px solid #000; }
#list li > span { flex: 1; }
#list .foto { flex: none; padding: 2px; border: 0; background: none; line-height: 0; color: #666; }
#list .foto:hover { color: #000; background: #ddd; }
#list li.aktiv .foto { color: #fff; }
#list li.aktiv .foto:hover { background: #333; }
#varianten { width: min(480px, 92vw); padding: 16px; border: 1px solid #000; }
#varianten::backdrop { background: rgba(0,0,0,.3); }
#varianten h2 { margin: 0 0 12px; font-size: 16px; }
.v-neu { display: flex; gap: 6px; }
.v-neu input { flex: 1; font: inherit; padding: 3px 6px; border: 1px solid #000; }
#v-liste { list-style: none; margin: 12px 0; padding: 0; max-height: 50vh; overflow-y: auto; border-top: 1px solid #ddd; }
#v-liste li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #ddd; }
#v-liste li > span { flex: 1; }
#v-liste small { display: block; color: #666; }
#v-liste .leer { color: #666; }
.v-fuss { text-align: right; }
/* Notizen */
#plan.setzen { cursor: crosshair; }
#n-neu.aktiv { background: #000; color: #fff; }
.notiz { cursor: move; }
.notiz circle { fill: #f60; stroke: #fff; stroke-width: 1.5; }
.notiz text { fill: #fff; font: bold 10px system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.notiz.aktiv circle { fill: #06f; }
#bubble { position: fixed; z-index: 5; width: 260px; padding: 8px; background: #fff; border: 1px solid #000; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
input, textarea, #bubble, #detail, #lb-text { user-select: text; -webkit-user-select: text; }
#bubble textarea { width: 100%; font: inherit; border: 1px solid #ccc; padding: 4px; resize: vertical; }
#bubble div { display: flex; justify-content: space-between; margin-top: 6px; }
#list li.kopf { cursor: default; background: #f3f3f3; font-weight: bold; border-top: 1px solid #000; }
#list li.notiz-item .punkt { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #f60; color: #fff; font: bold 11px/20px system-ui, sans-serif; text-align: center; margin: 0 4px; }
#list li.notiz-item .text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#list li.notiz-item .text:empty::before { content: '(ohne Text)'; color: #999; }
#lightbox { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.85); cursor: zoom-out; }
#lightbox[hidden] { display: none; }
#lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
#lightbox img { height: calc(92vh - 2em); width: auto; max-width: 92vw; object-fit: contain; }
#lightbox figcaption { color: #fff; padding-top: 6px; }
#lb-close { position: absolute; top: 12px; right: 16px; font-size: 28px; line-height: 1; color: #fff; background: none; border: 0; }
#detail { padding: 8px; border-top: 1px solid #000; }
#detail h2 { font-size: 14px; margin: 0 0 4px; }
#detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 13px; }
#detail dt { color: #666; }
#detail dd { margin: 0; }
#plan { flex: 1; min-width: 0; height: 100%; background: #fff; touch-action: none; cursor: grab; user-select: none; }
#plan.pan { cursor: grabbing; }
#massstab text { font: 5px system-ui, sans-serif; }
.obj { cursor: move; }
.obj .label { font: 4.25px 'Courier New', monospace; fill: #878787; pointer-events: none; }
.obj .rahmen { fill: none; stroke: none; }
.obj.aktiv .rahmen { stroke: #06f; stroke-width: .5; stroke-dasharray: 2 1; }
.obj.aktiv .label { fill: #06f; font-weight: bold; }
.obj.konflikt .rahmen { stroke: #e00; stroke-width: .6; stroke-dasharray: none; }
.obj.konflikt .label { fill: #e00; }
.obj .griff { display: none; }
.obj.aktiv .griff { display: inline; }
.griff line { stroke: #06f; stroke-width: .4; }
.griff circle { fill: #fff; stroke: #06f; stroke-width: .6; cursor: crosshair; }
.tisch .platte { fill: #fff; stroke: #000; stroke-width: .6; }
.tisch .label { fill: #999; font: 6px system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; }
.obj.tisch.aktiv .rahmen { fill: none; }
@media (max-width: 700px) { main { flex-direction: column-reverse; } aside { width: auto; height: 38%; border-right: 0; border-top: 1px solid #000; } }
