:root {
  /* Blackout: blau-schwarz wie Bühnenmolton, Akzent Pixel-Cyan (Warnungen bleiben Bernstein) */
  --bg: #0c1015;
  --panel: #131820;
  --panel-2: #1a2029;
  --line: #242c37;
  --line-2: #313b48;
  --text: #e9edf2;
  --muted: #8a95a5;
  --accent: #34d2e6;
  --accent-ink: #03262b;
  --accent-soft: rgba(52, 210, 230, 0.12);
  --ok: #3fc47e;
  --warn: #f0b429;
  --err: #f05d5d;
  --din: 'DIN Alternate', 'DIN 2014', 'D-DIN', Bahnschrift, 'Barlow Semi Condensed', system-ui, sans-serif;
  --radius: 8px;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; display: flex; flex-direction: column; }
a { color: inherit; }
h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.boot { margin: auto; color: var(--muted); }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  padding: 7px 14px; border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: #46505f; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--err); border-color: transparent; }
.btn.danger.ghost:hover { border-color: var(--err); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; font-size: 14px;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Formulare */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 7px 9px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.7; }
input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
textarea { resize: vertical; }
input[type='number'] { -moz-appearance: textfield; }
input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .flabel { font-size: 12px; color: var(--muted); font-weight: 500; }
.field.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 20px; }
.field.check > span { font-size: 14px; color: var(--text); }
.req { color: var(--accent); font-style: normal; }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.form-error { color: var(--err); min-height: 0; font-size: 13px; }
.form-error:empty { display: none; }
.with-unit { position: relative; display: flex; }
.with-unit input { padding-right: 52px; }
.with-unit .unit {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px; pointer-events: none;
}

/* Anmeldung */
.auth { flex: 1; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #1f1a10 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.auth-brand img { width: 26px; height: 26px; }

/* Kopfleiste */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 0 16px; height: 52px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { white-space: nowrap; display: flex; align-items: center; gap: 9px; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 22px; height: 22px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a, .user {
  text-decoration: none; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 500;
}
.topbar nav a:hover, .user:hover { color: var(--text); background: var(--panel-2); }
.topbar nav a.active, .user.active { color: var(--text); background: var(--panel-2); }
.user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.main { flex: 1; min-height: 0; display: flex; }

/* Seiten */
.page { flex: 1; padding: 20px 24px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 640px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 160px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card .btn { align-self: flex-start; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.kv span { color: var(--muted); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); margin-left: 8px; color: var(--muted); }
.tag.ok { color: var(--ok); border-color: #2a5a40; margin: 0; }
.tag.off { color: var(--err); border-color: #6a2a2a; margin: 0; }
.empty { margin: 40px auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty.small { margin: 16px auto; }

/* Bibliothek */
.lib { flex: 1; display: flex; min-width: 0; }
.sidebar { width: 230px; flex: none; border-right: 1px solid var(--line); padding: 14px 10px; overflow: auto; background: var(--panel); }
.sidebar-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 10px 8px; font-weight: 600; }
.side-link { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.side-link:hover { background: var(--panel-2); color: var(--text); }
.side-link.active { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px 20px; gap: 14px; }
.search { max-width: 260px; }
.table-wrap { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  position: sticky; top: 0; background: var(--panel-2); text-align: left; font-weight: 600; font-size: 12px;
  color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td:first-child { font-weight: 500; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: #1a1e24; }
table.grid tbody tr.selected { background: #2a2214; }

/* Editor-Schublade */
.drawer { width: 520px; flex: none; border-left: 1px solid var(--line); background: var(--panel); display: flex; min-height: 0; }
.drawer.hidden { display: none; }
.editor { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 10px 0 0; padding: 14px 0 0; }
legend { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding-right: 8px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field.wide { grid-column: 1 / -1; }
.derived { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; font-size: 13px; }
.derived-title { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.derived b { font-family: var(--mono); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 99px; cursor: pointer; font-size: 13px; }
.chip:has(input:checked) { border-color: var(--accent); background: #2a2214; }
.subtable { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; overflow-x: auto; max-width: 100%; }
.subtable table { min-width: 100%; }
.subtable td input, .subtable td select { min-width: 72px; }
.subtable table { border-collapse: collapse; }
.subtable th { font-size: 11px; color: var(--muted); font-weight: 600; text-align: left; padding: 0 4px 4px; white-space: nowrap; }
.subtable th small { font-weight: 400; }
.subtable td { padding: 2px; }
.subtable input, .subtable select { padding: 5px 6px; font-size: 13px; }

/* Dialoge & Meldungen */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.dialog { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.dialog.wide { max-width: 720px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 4px; }
.dialog-body { padding: 10px 18px 16px; }
.dialog-body p { margin: 0; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); padding: 10px 14px; border-radius: 6px; transition: opacity 0.4s, transform 0.4s; }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); }

@media (max-width: 1100px) {
  .drawer { position: fixed; right: 0; top: 52px; bottom: 0; width: min(520px, 100vw); z-index: 20; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.4); }
}
.kind-select { display: none; width: auto; }
@media (max-width: 760px) {
  .sidebar { display: none; }
  .kind-select { display: block; }
  .lib-main h1 { display: none; }
  .user-name, .brand-name { display: none; }
  .topbar nav a { padding: 6px 8px; }
  .topbar .btn.ghost.small { padding: 4px 8px; }
  .topbar { gap: 8px; }
  .fields { grid-template-columns: 1fr; }
}

/* Projekte */
.row-actions { text-align: right; }
.row-actions .btn { margin-left: 4px; }
.fields.three { grid-template-columns: 1fr 1fr 1fr; }
.page .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Projekt-Editor */
.editor-layout { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.title-input { width: auto; min-width: 180px; max-width: 360px; font-size: 15px; font-weight: 600; background: transparent; border-color: transparent; }
.title-input:hover:not(:disabled) { border-color: var(--line-2); }
.save-state { font-size: 12px; color: var(--muted); }
.save-state.dirty { color: var(--warn); }
.save-state.err { color: var(--err); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg-btn { appearance: none; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; border-right: 1px solid var(--line-2); }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--text); background: var(--panel-2); }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.editor-body { flex: 1; display: flex; min-height: 0; }
.editor-left { width: 240px; flex: none; border-right: 1px solid var(--line); background: var(--panel); overflow: auto; display: flex; flex-direction: column; }
.editor-right { width: 330px; flex: none; border-left: 1px solid var(--line); background: var(--panel); overflow: auto; }
.proj-info { padding: 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.proj-info input { padding: 5px 8px; }
.mini-stats { font-size: 12.5px; }
.mini-stats b { font-family: var(--mono); font-weight: 500; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.wall-list { display: flex; flex-direction: column; padding: 0 6px 12px; gap: 2px; }
.wall-item { appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; }
.wall-item:hover { background: var(--panel-2); }
.wall-item.on { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.wall-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wall-name small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--warn); color: #1a1400; font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.pad { padding: 8px 12px; }
.canvas { flex: 1; position: relative; min-width: 0; background: #0b0d10; background-image: radial-gradient(#1c2027 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; cursor: grab; }
.canvas.panning { cursor: grabbing; }
.canvas-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.canvas-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); background: rgba(14, 16, 19, 0.85); padding: 4px 10px; border-radius: 6px; pointer-events: none; }
.canvas .wall { cursor: move; }
.canvas.tool-toggle .wall .panel { cursor: pointer; }
.canvas .panel { fill-opacity: 0.22; stroke: #58606d; stroke-width: 1; vector-effect: non-scaling-stroke; }
.canvas .wall.sel .panel { fill-opacity: 0.38; stroke: #9aa3b2; }
.canvas .panel.off { stroke-dasharray: 4 3; stroke: #4a515c; }
.canvas .off-x { stroke: #4a515c; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.canvas.tool-toggle .wall .panel:hover { fill-opacity: 0.6; }
.canvas .wall-outline { fill: none; stroke: #8b93a1; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.canvas .wall.sel .wall-outline { stroke: var(--accent); stroke-width: 2.5; }
.canvas .pnum { fill: #c9ced6; pointer-events: none; font-family: var(--mono); }
.canvas .wall-label { fill: var(--text); font-weight: 600; pointer-events: none; }
.canvas .wall.sel .wall-label { fill: var(--accent); }
.canvas .dim line { stroke: #8b93a1; stroke-width: 1; vector-effect: non-scaling-stroke; }
.canvas .dim text, .canvas .dim-note { fill: #b5bcc7; font-family: var(--mono); pointer-events: none; }
.canvas .floor line { stroke: #5b6472; stroke-width: 1.5; stroke-dasharray: 10 6; vector-effect: non-scaling-stroke; }
.canvas .floor text, .canvas .audience { fill: var(--muted); pointer-events: none; }
.canvas .plan-line { fill: none; stroke-linejoin: miter; stroke-opacity: 0.85; }
.canvas .wall.sel .plan-line { stroke-opacity: 1; }
.canvas .truss-plan, .curve-mini .truss-plan { fill: none; stroke: #94a3b8; stroke-opacity: 0.35; stroke-linejoin: miter; pointer-events: none; }
.canvas .truss-axis, .curve-mini .truss-axis { fill: none; stroke: #e2e8f0; stroke-width: 1; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.canvas .truss-end, .canvas .curve-joint, .curve-mini .truss-end, .curve-mini .curve-joint { stroke: #f59e0b; stroke-width: 2; vector-effect: non-scaling-stroke; }
.canvas .curve-lbl, .curve-mini .curve-lbl { fill: #f59e0b; font-family: var(--mono); pointer-events: none; }
.curve-mini { width: 100%; height: 150px; background: #0b0d10; border: 1px solid var(--line); border-radius: 6px; }
.curve-mini .plan-line { fill: none; stroke-opacity: 0.8; }
.curve-mini .audience { fill: var(--muted); }
table.curve-tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--mono); }
table.curve-tbl th, table.curve-tbl td { white-space: nowrap; padding: 3px 5px; border-bottom: 1px solid var(--line); text-align: right; }
table.curve-tbl th { color: var(--muted); font-weight: 600; }
table.curve-tbl tr.bad td { color: #f87171; }
.canvas .joint { fill: #0b0d10; stroke: #c9ced6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.canvas .angle { fill: var(--accent); font-family: var(--mono); pointer-events: none; }
.inspector { display: flex; flex-direction: column; }
.insp-section { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.insp-section.row { flex-direction: row; }
.insp-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
details.insp-section > summary { cursor: pointer; list-style: none; }
details.insp-section > summary::before { content: '▸ '; }
details.insp-section[open] > summary::before { content: '▾ '; }
.inspector input, .inspector select { padding: 5px 8px; }
.inspector input[type='color'] { padding: 2px; height: 31px; }
.inspector .kv { font-size: 12.5px; padding: 1px 0; }
.inspector .kv b { font-family: var(--mono); font-weight: 500; text-align: right; }
.angle-all { gap: 10px; }
.angle-all select, .angle-all input { width: 110px; }
.angle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; max-height: 260px; overflow: auto; }
.angle-item { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); }
select.bad { border-color: var(--err); color: var(--err); }
.warning { background: #2b2410; border: 1px solid #5c4a14; color: #f3d27a; padding: 6px 10px; border-radius: 6px; font-size: 12.5px; }
.notice { background: #102434; border: 1px solid #1e4a6a; color: #a9d4f5; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type='range'] { padding: 0; accent-color: var(--accent); }

@media (max-width: 1100px) {
  .editor-left { width: 200px; }
  .editor-right { width: 290px; }
}
@media (max-width: 860px) {
  .editor-body { flex-direction: column; overflow: auto; }
  .editor-left, .editor-right { width: auto; border: 0; }
  .canvas { min-height: 60vh; }
}

/* Datenverkabelung */
.canvas.hidden, .lists-wrap.hidden { display: none; }
.lists-wrap { flex: 1; min-width: 0; overflow: auto; padding: 18px 22px; }
.lists { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.lists .card { padding: 14px; }
.lists table.grid tbody tr { cursor: default; }
.lists .warning ul, .checks ul { margin: 6px 0 0; padding-left: 18px; }
.row.wrap { flex-wrap: wrap; }
.mono { font-family: var(--mono); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 0 4px 4px; }
.mini-table td { padding: 3px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.mini-table select { padding: 3px 4px; font-size: 12px; }
.mini-table tr.bad td { color: var(--err); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dev-box { border-top: 1px solid var(--line); margin-top: 4px; }
.dev-icon { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.dev-icon.processor { background: #1e3a5f; color: #93c5fd; }
.dev-icon.converter { background: #3b2a5c; color: #c4b5fd; }
.checks { margin: 0 8px 12px; padding: 8px 10px; border-radius: 6px; background: #2b2410; border: 1px solid #5c4a14; color: #f3d27a; font-size: 12.5px; }
.checks summary { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.checks.ok { background: #10291c; border-color: #1f5236; color: #8be0ad; }
.meter { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.meter div { height: 100%; background: var(--ok); }
.meter div.over { background: var(--err); }
.opt-row { display: grid; grid-template-columns: 42px 1fr 78px 82px; gap: 6px; align-items: center; font-size: 12.5px; }
.opt-row select { padding: 4px 6px; font-size: 12.5px; }
select.role-main { border-color: #2f7a52; color: #8be0ad; }
select.role-backup { border-color: #6a5a1e; color: #f3d27a; }
.canvas .wall.data .panel { fill-opacity: 0.35; }
.canvas .string-line { fill: none; stroke: #e6e8eb; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-opacity: 0.85; pointer-events: none; }
.canvas .arrow-head { fill: #e6e8eb; }
.canvas .string-start { stroke: #0b0d10; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.canvas .string-name { fill: #0b0d10; font-weight: 700; pointer-events: none; font-family: var(--mono); }
.canvas .cable { fill: none; stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.canvas .cable-label { fill: #e6e8eb; font-family: var(--mono); pointer-events: none; paint-order: stroke; stroke: #0b0d10; stroke-width: 3px; }
.canvas .device { cursor: move; }
.canvas .device rect { fill: #2a2140; stroke: #a78bfa; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.canvas .device.sel rect { stroke: var(--accent); stroke-width: 2.5; }
.canvas .device text { fill: #e9e3ff; font-weight: 600; pointer-events: none; }
.canvas .device .device-sub { fill: #c4b5fd; font-weight: 400; font-family: var(--mono); }

/* Strom */
.dev-icon.power { background: #14432a; color: #86efac; }
.canvas .device.proc rect { fill: #0c2a3a; stroke: #38bdf8; }
.canvas .device.proc text { fill: #e0f2fe; }
.canvas .device.proc .device-sub { fill: #7dd3fc; }
.canvas .device.proc.sel rect { stroke: var(--accent); }
.canvas .device.power rect { fill: #10301f; stroke: #22c55e; }
.canvas .device.power text { fill: #dcfce7; }
.canvas .device.power .device-sub { fill: #86efac; }
.canvas .device.power.sel rect { stroke: var(--accent); }
.canvas .cable.power { stroke-dasharray: 2 3; }
.canvas .amp-label { fill: #e6e8eb; font-family: var(--mono); pointer-events: none; paint-order: stroke; stroke: #0b0d10; stroke-width: 3px; }
.phase-row { display: grid; grid-template-columns: 26px 1fr 64px; gap: 8px; align-items: center; font-size: 12.5px; }
.phase-row .mono, .circuit-row .mono { text-align: right; }
.circuit-row { display: grid; grid-template-columns: 18px 58px 1fr 56px; grid-template-rows: auto auto; gap: 2px 8px; align-items: center; font-size: 12.5px; }
.circuit-row select { padding: 3px 4px; font-size: 12px; }
.circuit-row small { grid-column: 2 / -1; font-size: 11px; }

/* Rigging */
.canvas .wall.rig .panel { fill-opacity: 0.15; }
.canvas .truss { fill: rgba(148, 163, 184, 0.12); stroke: #cbd5e1; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.canvas .truss-lattice { fill: none; stroke: #94a3b8; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.canvas .truss-joint { stroke: #f8fafc; stroke-width: 2; vector-effect: non-scaling-stroke; }
.canvas .flybar { fill: #334155; stroke: #94a3b8; stroke-width: 1; vector-effect: non-scaling-stroke; }
.canvas .flybar.bad { stroke: var(--err); fill: #4a1d1d; }
.canvas .sling { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.canvas .rig-label, .canvas .rig-small { fill: #cbd5e1; font-family: var(--mono); pointer-events: none; }
.canvas .span-label { font-family: var(--mono); pointer-events: none; }
.canvas .span-label.ok { fill: #4ade80; } .canvas .span-label.warn { fill: #facc15; } .canvas .span-label.bad { fill: #f87171; } .canvas .span-label.unk { fill: #8b93a1; }
.canvas .hoist { cursor: ew-resize; }
.canvas .hoist line { stroke: #e2e8f0; stroke-width: 2; vector-effect: non-scaling-stroke; }
.canvas .hoist rect { stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke: #0b0d10; }
.canvas .hoist.ok rect { fill: #22c55e; } .canvas .hoist.warn rect { fill: #eab308; } .canvas .hoist.bad rect { fill: #ef4444; } .canvas .hoist.unk rect { fill: #64748b; }
.canvas .hoist .hoist-n { fill: #0b0d10; font-weight: 700; pointer-events: none; }
.canvas .hoist .hoist-load { fill: #f1f5f9; font-family: var(--mono); pointer-events: none; paint-order: stroke; stroke: #0b0d10; stroke-width: 3px; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 99px; font-family: var(--mono); }
.pill.ok { background: #10291c; color: #4ade80; } .pill.warn { background: #2b2410; color: #facc15; } .pill.bad { background: #3a1414; color: #f87171; } .pill.unk { background: var(--panel-2); color: var(--muted); }
.kv.total { border-top: 1px solid var(--line); padding-top: 4px; font-weight: 600; }
.hoist-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }

/* Zeichnungsblätter */
.sheets-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #2a2e35; }
.sheets-wrap.hidden { display: none; }
.sheet-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sheet-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sheet-tab { appearance: none; border: 1px solid var(--line-2); background: transparent; color: var(--muted); padding: 4px 10px; border-radius: 6px; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.sheet-tab:hover { color: var(--text); }
.sheet-tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.sheet-stage { flex: 1; overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; }
.sheet-page { width: 100%; max-width: 1400px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); background: #fff; }
.sheet-page svg { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
.sheet-svg .block-hit { fill: transparent; stroke: transparent; stroke-width: 0.4; cursor: move; }
.sheet-svg .block-hit:hover { stroke: var(--accent); stroke-dasharray: 2 1; }
.sheet-svg .block-hit.sel { stroke: var(--accent); stroke-width: 0.6; stroke-dasharray: 2 1; fill: rgba(52, 210, 230, 0.05); }
.sheet-svg .block-handle { fill: var(--accent); cursor: nwse-resize; }
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  html, body { background: #fff; height: auto; }
  #app { display: none !important; }
  #print-root { display: block; }
  .print-page { break-after: page; overflow: hidden; }
  .print-page:last-child { break-after: auto; }
  .print-page svg { width: 100%; height: 100%; display: block; }
}

/* Labels */
.field.inline { flex-direction: row; align-items: center; gap: 6px; }
.field.inline select { width: auto; padding: 4px 6px; font-size: 12.5px; }
.label-filters { display: flex; gap: 6px; padding: 8px 12px; align-items: center; flex-wrap: wrap; background: var(--panel); border-bottom: 1px solid var(--line); }
.label-stage { flex: 1; overflow: auto; padding: 16px; }
.label-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.label-group { flex-basis: 100%; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #cbd5e1; font-weight: 600; margin-top: 6px; }
.label-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; opacity: 0.45; }
.label-card.on { opacity: 1; border-color: #5b6472; }
.label-card .row { gap: 6px; font-size: 12.5px; }
.label-canvas { background: #fff; border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.4); image-rendering: auto; }
.print-log { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); max-height: 160px; overflow: auto; }

/* Stränge zeichnen, Kabelwege */
.manual-box { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--line-2); border-radius: 6px; }
.manual-box select { width: auto; padding: 4px 6px; font-size: 12.5px; }
.route-cell { display: flex; gap: 3px; }
.route-cell select { width: 64px; }
.route-cell input { width: 48px; padding: 3px 4px; font-size: 12px; }
.canvas .panel.free { stroke: #ef4444; stroke-dasharray: 3 2; }
.canvas .cable.manual { stroke-dasharray: 1 3; }
.sheet-svg .panel.free { stroke: #c00; }
.opt-row.card-row { grid-template-columns: 44px 1fr; display: grid; align-items: center; gap: 6px; }
.opt-row.card-row select { width: 100%; }
.sheet-tab.virtual { font-style: italic; opacity: .75; border-style: dashed; }
.sheet-note { width: 100%; max-width: 1400px; box-sizing: border-box; margin: 0 0 10px; padding: 6px 10px; border: 1px dashed var(--line-2); border-radius: 6px; color: var(--muted); font-size: 12.5px; }
.opt-row.vmp-row { grid-template-columns: 160px 1fr; }
.vmp-summary { display: flex; flex-direction: column; gap: 4px; }

/* Testbild */
.pattern-stage { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 24px; min-height: 0; }
.pattern-view { flex: 1; min-height: 300px; display: flex; align-items: center; justify-content: center; overflow: auto; border-radius: 10px; padding: 12px;
  background: repeating-conic-gradient(#1a2030 0 25%, #121722 0 50%) 0 0 / 16px 16px; }
.pattern-cv { display: block; image-rendering: pixelated; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); cursor: grab; touch-action: none; }
.pattern-cv.drag { cursor: grabbing; }
.pattern-size b { font-size: 18px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 32px; padding: 2px; flex: none; }
.warn-txt { color: var(--warn); }

/* Einstellungen: Logo */
.settings-card h2 { margin: 0; font-size: 16px; }
.logo-preview { min-height: 70px; max-width: 360px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; display: flex; align-items: center; justify-content: center; background: #fff; }
.logo-preview img { max-width: 100%; max-height: 90px; object-fit: contain; }
.row-actions { display: flex; gap: 8px; margin-top: 6px; }
.row-actions .btn { align-self: auto; }
.warn-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--warn); }
.vmp-import { display: flex; flex-direction: column; gap: 10px; }
.canvas .cable.backup { stroke-dasharray: 8 5; opacity: 0.75; }
.port-cell { display: flex; flex-direction: column; gap: 3px; }
.port-cell select.bk { font-size: 11px; padding: 2px 4px; opacity: 0.85; }
.port-cell .bk-info { font-size: 11px; color: var(--muted); }
.port-cell select { width: 100%; min-width: 0; }
.btn.link { background: none; border-color: transparent; color: var(--muted, #a1a1aa); text-decoration: underline; text-underline-offset: 3px; }
.btn.link:hover { color: var(--text, #fff); background: none; }
.canvas .cable.feed-link { stroke: #f5a524; stroke-width: 2.5; stroke-dasharray: 10 4; fill: none; vector-effect: non-scaling-stroke; }
.canvas .drop { cursor: ew-resize; }
.canvas .drop-mark { fill: #38bdf8; stroke: #0c4a6e; stroke-width: 1; vector-effect: non-scaling-stroke; }
.canvas .drop-rope { stroke: #38bdf8; stroke-width: 2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.canvas .drop-label { fill: #7dd3fc; font-weight: 600; }
.canvas .drop-sub { fill: #a1a1aa; }
.canvas .cable.fiber { stroke: #38bdf8; stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.canvas .cable.fiber.backup { stroke: #f472b6; stroke-dasharray: 8 5; }
.canvas .cable.feed-drop { stroke: #f5a524; stroke-width: 2.5; fill: none; vector-effect: non-scaling-stroke; }
.dev-icon.input { background: #3f2d0c; color: #fcd34d; }

/* ---------- Aufgeräumter Editor (0.9.37) ---------- */
.editor-bar { gap: 12px; padding: 6px 12px; flex-wrap: nowrap; }
.editor-bar .title-input { min-width: 120px; flex: 0 1 260px; }
.undo-seg .seg-btn { padding: 5px 10px; }
.view-tabs { display: flex; align-items: flex-end; gap: 14px; flex: none; }
.view-group { display: flex; flex-direction: column; gap: 2px; }
.vg-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #5f6775; font-weight: 600; padding-left: 2px; }
.view-group .seg-btn { padding: 5px 11px; }
.canvas-tools { position: absolute; top: 10px; left: 12px; display: flex; gap: 8px; z-index: 2; }
.canvas-tools .seg { background: rgba(21, 24, 29, 0.92); backdrop-filter: blur(4px); }
.canvas-tools .seg-btn { padding: 5px 11px; }

/* Linke Spalte */
.proj-info { padding: 8px 10px 10px; gap: 8px; }
.proj-details > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 4px 4px; border-radius: 6px; }
.proj-details > summary::-webkit-details-marker { display: none; }
.proj-details > summary:hover { background: var(--panel-2); }
.ph-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.ph-title::before { content: '▸ '; }
.proj-details[open] .ph-title::before { content: '▾ '; }
.ph-sub { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-fields { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px 2px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; display: flex; flex-direction: column; min-width: 0; }
.stat-tile b { font-family: var(--mono); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile span { font-size: 10.5px; color: var(--muted); }
.panel-head { padding: 12px 12px 4px; }
.list-sub { font-size: 10.5px; color: #5f6775; padding: 6px 8px 2px; text-transform: uppercase; letter-spacing: 0.06em; }
.wall-item { padding: 6px 8px; }
.dev-box { margin-top: 0; }

/* Inspektor */
.insp-section { gap: 8px; padding: 12px 14px; }
.insp-title { color: #aab2bf; }
details.insp-section > summary { padding: 2px 0; }
details.insp-section > summary:hover { color: var(--text); }
.inspector .fields { gap: 8px; }
/* lange Hinweise auf zwei Zeilen kürzen, Klick klappt sie auf */
.editor-right small.hint, .editor-left small.hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: help; }
.editor-right small.hint.open, .editor-left small.hint.open { -webkit-line-clamp: unset; display: block; }
.editor-right small.hint.clamped::after { content: ''; }
@media (max-width: 1360px) {
  .vg-label { display: none; }
  .view-tabs { gap: 8px; align-items: center; }
  .view-group .seg-btn { padding: 5px 8px; }
}
@media (max-width: 1180px) {
  .editor-bar { flex-wrap: wrap; }
}

/* ---------- Projekt-Assistent ---------- */
.fields.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.wizard { display: flex; flex-direction: column; gap: 14px; }
.wizard .wiz-body { max-height: 58vh; overflow: auto; padding-right: 4px; }
.wiz-steps { display: flex; gap: 4px; }
.wiz-step { flex: 1; appearance: none; border: 0; background: var(--panel-2); color: var(--muted); font: inherit; font-size: 12.5px; padding: 7px 8px; border-radius: 6px; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.wiz-step:hover { color: var(--text); background: var(--line-2); }
.wiz-step span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 11px; font-weight: 700; color: var(--text); flex: none; }
.wiz-step.on { background: #3a2a0c; color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.wiz-step.on span { background: var(--accent); color: var(--accent-ink); }
.wiz-step.done { cursor: pointer; color: var(--text); }
.wiz-step.done span { background: var(--ok); color: #06210f; }
.wiz-card { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2); }
.wiz-sum { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.wizard h3 { margin: 0; }
.dialog.wide:has(.wizard) { max-width: 820px; }
.dialog-actions .spacer { flex: 1; }
.sheet-bar .fmt-select { width: auto; flex: none; padding: 4px 8px; }
.wizard .slot-col { gap: 8px; }

/* Verkabelungsvarianten (U-Wende / Zickzack / Isoliert) */
.flow-picker { border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); }
.flow-picker > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 12.5px; }
.flow-picker > summary::-webkit-details-marker { display: none; }
.flow-picker > summary .flow-icon { width: 30px; height: 30px; flex: none; }
.flow-picker[open] > summary { border-bottom: 1px solid var(--line-2); }
.flow-group { padding: 6px 8px 2px; }
.flow-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #c9ced6; margin-top: 4px; }
.flow-sub { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 4px; }
.flow-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.flow-tile { appearance: none; border: 1px solid var(--line-2); background: #101317; border-radius: 7px; padding: 5px; cursor: pointer; display: grid; place-items: center; }
.flow-tile:hover { border-color: #4b5563; }
.flow-tile.on { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35); background: #16202e; }
.flow-icon { width: 100%; max-width: 44px; aspect-ratio: 1; }
.flow-icon .fi-panel { fill: #262b33; }
.flow-icon .fi-line { fill: none; stroke: #4ade80; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.flow-icon .fi-dot, .flow-icon .fi-arrow { fill: #4ade80; }

/* Druckauswahl */
.print-list { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.print-item { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.print-item:hover { background: var(--panel-2); }
.print-item input { width: auto; }
.print-item .pi-no { width: 24px; text-align: right; font-family: var(--mono); color: var(--muted); }
.print-item .pi-name { flex: 1; }
.print-item.virtual .pi-name { font-style: italic; color: var(--muted); }

/* Rolle Main / Backup bei Prozessoren */
.role-badge { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; flex: none; }
.role-badge.main { background: #0c2a3a; color: #7dd3fc; border: 1px solid #1e5a7a; }
.role-badge.backup { background: #3b1028; color: #f9a8d4; border: 1px solid #7a2350; }
.dev-icon.processor.role-main { background: #0c2a3a; color: #7dd3fc; }
.dev-icon.processor.role-backup { background: #3b1028; color: #f9a8d4; }
.proc-pair { position: relative; border: 1px solid #2c3f52; border-radius: 8px; margin: 2px 0 4px; padding: 2px 2px 2px 10px; background: linear-gradient(90deg, rgba(56, 189, 248, 0.06), rgba(244, 114, 182, 0.05)); }
.proc-pair::before { content: ''; position: absolute; left: 4px; top: 22px; bottom: 18px; width: 2px; border-radius: 2px; background: linear-gradient(#7dd3fc, #f9a8d4); }
.proc-pair .pair-head { font-size: 10px; color: var(--muted); padding: 3px 6px 0; text-transform: uppercase; letter-spacing: 0.05em; }
.proc-pair .wall-item { padding: 5px 6px; }
.canvas .feed-src { cursor: move; }
.canvas .feed-src rect { fill: #3a2a0c; stroke: #f5a524; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.canvas .feed-src text { fill: #fde68a; font-weight: 600; pointer-events: none; }
.canvas .feed-src .device-sub { fill: #fcd34d; font-weight: 400; }

/* Netzwerk */
.net-table input, .net-table select { padding: 4px 6px; font-size: 13px; }
.net-table tr.net-switch td { background: rgba(56, 189, 248, 0.06); }
.net-plan { width: 100%; background: #fff; border-radius: 6px; }
.net-plan .net-box { fill: #f8fafc; stroke: #334155; stroke-width: 1; vector-effect: non-scaling-stroke; }
.net-plan .net-box.switch { fill: #e0f2fe; stroke: #0369a1; }
.net-plan .net-name { fill: #111; font-weight: 700; } .net-plan .net-ip { fill: #0f172a; font-family: var(--mono); }
.net-plan .net-sub { fill: #475569; } .net-plan .td { fill: #555; }
.net-plan .net-link, .net-plan .net-uplink { fill: none; stroke: #334155; stroke-width: 1; vector-effect: non-scaling-stroke; }
.net-plan .net-uplink { stroke-dasharray: 4 3; }

/* Revisionen */
.rev-new { padding: 12px; }
.rev-table td { vertical-align: middle; }
.rev-actions { white-space: nowrap; display: flex; gap: 4px; justify-content: flex-end; }
.rev-diff h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.rev-diff ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.rev-diff li { display: flex; gap: 8px; align-items: baseline; }
.rev-k { font-family: var(--mono); font-weight: 700; width: 14px; flex: none; text-align: center; }
.rev-diff li.add .rev-k { color: var(--ok); } .rev-diff li.del .rev-k { color: var(--err); } .rev-diff li.chg .rev-k { color: var(--warn); }

/* Kundenlink */
.share-top { gap: 14px; }
.share-logo { height: 28px; max-width: 120px; object-fit: contain; }
.share-title { display: flex; flex-direction: column; line-height: 1.25; }
.share-badge { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #7dd3fc; border: 1px solid #1e5a7a; background: #0c2a3a; padding: 3px 9px; border-radius: 12px; }
.share-main { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.share-sheets { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.share-error { max-width: 420px; margin: 18vh auto; text-align: center; }
.share-error img { width: 40px; }

/* Aufbau-Checkliste (Handy) */
.bv { max-width: 760px; margin: 0 auto; padding: 12px 12px 60px; display: flex; flex-direction: column; gap: 10px; }
.bv-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 3; }
.bv-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bv-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-filter { white-space: nowrap; }
.bv-progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bv-progress div { height: 100%; background: var(--ok); transition: width 0.3s; }
.bv-focus { border: 2px solid var(--accent); border-radius: 12px; padding: 14px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 6px; }
.bv-focus-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.bv-focus-t { font-size: 20px; font-weight: 700; }
.bv-focus-s { color: #bfeff6; }
.btn.big { font-size: 17px; padding: 12px; margin-top: 6px; }
.bv-group { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.bv-group > summary { padding: 12px; cursor: pointer; font-size: 15px; }
.bv-sec { padding: 0 8px 8px; }
.bv-sec-h { display: flex; align-items: center; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 8px 6px 4px; }
.bv-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.bv-item:hover { background: var(--panel-2); }
.bv-item input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--ok); }
.bv-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bv-text small { color: var(--muted); }
.bv-item.done .bv-text b { color: var(--muted); text-decoration: line-through; }
.bv-by { color: var(--ok) !important; }
.bv-item.focus { outline: 2px solid var(--accent); background: var(--accent-soft); }

/* Projekte teilen */
.mem-list { display: flex; flex-direction: column; gap: 4px; }
.mem-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.mem-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mem-who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-row select { width: auto; }
.mem-fields { grid-template-columns: 2fr 1fr; }
.mem-add .row-actions { align-items: center; }
.proj-group { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.proj-group small { color: var(--muted); font-weight: 400; }
.settings-sep { font-size: 15px; color: var(--muted); margin-top: 18px; }

/* Ground Stack Skizze */
.stack-mini { width: 100%; height: auto; background: var(--panel-2); border-radius: 8px; margin-bottom: 8px; }
.stack-mini .st-ground { stroke: var(--muted); stroke-width: 2; }
.stack-mini .st-base { stroke: #94a3b8; stroke-width: 8; }
.stack-mini .st-brace { stroke: #94a3b8; stroke-width: 4; }
.stack-mini .st-wall { fill-opacity: 0.8; }
.stack-mini .st-riser { fill: #334155; }
.stack-mini .st-ballast { fill: #64748b; stroke: #cbd5e1; stroke-width: 1.5; }
.stack-mini .st-edge { fill: var(--accent); }
.stack-mini .st-dim { stroke: var(--muted); stroke-width: 1.5; }
.stack-mini .st-txt { fill: var(--text); }
.stack-mini .st-wind { stroke: #38bdf8; stroke-width: 4; } .stack-mini .st-wind-head { fill: #38bdf8; } .stack-mini .st-wind-txt { fill: #38bdf8; font-weight: 700; }
.insp-sub { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.insp-sub > summary { cursor: pointer; font-weight: 600; font-size: 12px; }


/* ===== Eigene Optik (0.9.61) =====
   Signatur: aktive Ansicht leuchtet wie eine LED-Zeile (Cyan-Linie mit Glühen) statt gefüllter Fläche.
   DIN für Überschriften, Zahlen und Navigation – die Schrift technischer Zeichnungen. */
h1, h2, h3, .brand, .topbar nav a, .seg-btn, .panel-head, .insp-title, .proj-group, .kv b, .mini-stats b, .stat b, .bv-focus-t, .bv-title b, .dialog-head h2 {
  font-family: var(--din);
}
h1 { font-size: 21px; font-weight: 600; letter-spacing: 0; }
h2 { font-size: 17px; letter-spacing: 0; }
.panel-head, .insp-title { text-transform: none; letter-spacing: 0.01em; font-size: 13px; font-weight: 600; color: #a7b1bf; }
.proj-group { text-transform: none; letter-spacing: 0.01em; font-size: 15px; color: #a7b1bf; }
.kv b, .mini-stats b, .inspector .kv b { font-family: var(--din); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* Kopfleiste: dunkler als die Flächen, Marke als Pixelmatrix */
.topbar { background: #090c10; border-bottom: 1px solid #1d242e; height: 54px; }
.brand { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.brand img { width: 24px; height: 24px; }
.topbar nav { gap: 2px; align-self: stretch; }
.topbar nav a { display: flex; align-items: center; border-radius: 0; padding: 0 14px; font-size: 15px; position: relative; }
.topbar nav a:hover { background: transparent; color: var(--text); }
.topbar nav a.active { background: transparent; color: var(--text); }
.topbar nav a.active::after, .seg-btn.on::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 6px 1px rgba(52, 210, 230, 0.75), 0 0 16px rgba(52, 210, 230, 0.35);
}

/* Segmente (Ansichten, Vorne/Hinten …): leuchtende Unterkante statt gefüllter Fläche */
.seg { border-color: var(--line-2); background: var(--panel); }
.seg-btn { position: relative; font-size: 14px; letter-spacing: 0.01em; }
.seg-btn.on { background: var(--panel-2); color: var(--accent); font-weight: 600; }
.seg-btn.on::after { left: 6px; right: 6px; bottom: 1px; }

/* Primärknopf: Cyan, ruhig */
.btn { border-radius: 5px; }
.btn.primary { box-shadow: 0 0 0 1px rgba(52, 210, 230, 0.35), 0 4px 14px -6px rgba(52, 210, 230, 0.6); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Zeichenfläche: Molton mit feinem Raster wie ein Stage-Plot */
.canvas {
  background-color: #080b0f;
  background-image: radial-gradient(rgba(140, 160, 185, 0.16) 1px, transparent 1.2px), linear-gradient(rgba(52, 210, 230, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(52, 210, 230, 0.035) 1px, transparent 1px);
  background-size: 22px 22px, 110px 110px, 110px 110px;
}

/* Karten/Abschnitte: Hierarchie über Fläche statt überall gleicher Rahmen */
.card { background: var(--panel); border-color: #202833; border-radius: 10px; }
.table-wrap { border-radius: 10px; }
table.grid tbody tr:hover td { background: var(--accent-soft); }
.avatar { background: linear-gradient(135deg, #ff4d6d 0 33%, #3ee07a 33% 66%, #3d7bff 66%); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.pill.ok, .pill.green { box-shadow: inset 0 0 0 1px rgba(63, 196, 126, 0.35); }
::selection { background: rgba(52, 210, 230, 0.35); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* Beschriftungen in Satzschreibung statt Versalien mit Sperrung */
.sidebar-title, .eyebrow, legend, .derived-title, .label-group, .vg-label, .ph-title, .list-sub, .flow-title, .flow-sub,
.proc-pair .pair-head, .rev-diff h4, .bv-focus-k, .bv-sec-h, .share-badge {
  text-transform: none; letter-spacing: 0.01em; font-family: var(--din);
}
.vg-label { font-size: 11.5px; color: #6f7a8a; }
.list-sub, .proc-pair .pair-head { font-size: 12px; }
.sidebar-title, .ph-title, legend, .label-group, .bv-sec-h, .flow-title { font-size: 13px; }
.role-badge { font-family: var(--din); letter-spacing: 0.04em; }
.stat-tile b { font-family: var(--din); font-size: 16px; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.stat-tile { border-left: 2px solid rgba(52, 210, 230, 0.45); }

/* Verkabelungsvarianten im eigenen Schema: Panels als Umriss, Strang in Cyan, Start als weißes Pixel */
.flow-tile { background: var(--bg); border-color: var(--line); border-radius: 6px; position: relative; }
.flow-tile:hover { border-color: var(--line-2); background: var(--panel); }
.flow-tile.on { border-color: rgba(52, 210, 230, 0.55); box-shadow: none; background: var(--accent-soft); }
.flow-tile.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px 1px rgba(52, 210, 230, 0.7); }
.flow-icon .fi-panel { fill: #111821; stroke: #2c3644; stroke-width: 0.8; }
.flow-icon .fi-line { stroke: var(--accent); stroke-width: 1.8; }
.flow-icon .fi-arrow { fill: var(--accent); }
.flow-icon .fi-dot { fill: #f4fbfc; filter: drop-shadow(0 0 1.5px rgba(52, 210, 230, 0.9)); }
.flow-picker { background: var(--panel); border-color: var(--line); }
.flow-tile { padding: 5px 5px 8px; }

/* Stromstränge: Kreis-Auswahl lesbar (Gerät, Kreis, Phase) */
.power-table .circ-sel { min-width: 150px; font-size: 12.5px; padding: 4px 6px; }
.power-table tr.bad td:first-child { box-shadow: inset 2px 0 0 var(--err); }

/* Aufbau: Pläne und Material je Wand */
.bv-tabs { display: flex; margin: 0 12px 8px; }
.bv-tabs .seg-btn { flex: 1; padding: 9px 6px; font-size: 15px; }
.bv-plan-card { padding: 4px 10px 12px; }
.bv-plan { background: #fff; border-radius: 8px; overflow: auto; -webkit-overflow-scrolling: touch; cursor: zoom-in; }
.bv-plan svg { display: block; width: 100%; height: auto; }
.bv-plan.zoom { cursor: zoom-out; max-height: 75vh; }
.bv-plan.zoom svg { width: 260%; }
.bv-plan-tbl > summary { cursor: pointer; padding: 8px 2px; color: var(--accent); font-weight: 600; }
.bv-tbl { overflow-x: auto; }
.bv-tbl table { border-collapse: collapse; width: 100%; font-size: 13px; }
.bv-tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.bv-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bv-logo { height: 30px; max-width: 90px; object-fit: contain; }
.stack-mini .st-foot { fill: #cbd5e1; }
.stack-mini .st-beam, .stack-mini .st-foot-bar { fill: #475569; stroke: #94a3b8; stroke-width: 1; }
.stack-mini .st-tower { fill: none; stroke: #cbd5e1; stroke-width: 3; }
.stack-mini .st-ladder, .stack-mini .st-arm { fill: none; stroke: #cbd5e1; stroke-width: 2; }
.stack-mini .st-leveler { fill: #94a3b8; }

/* 3D-Ansicht */
.v3d-wrap { flex: 1; min-width: 0; position: relative; display: flex; }
.v3d-wrap.hidden { display: none; }
.v3d { flex: 1; position: relative; display: flex; }
.v3d-canvas { flex: 1; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.v3d-canvas:active { cursor: grabbing; }
.v3d-bar { position: absolute; top: 10px; left: 10px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }
.v3d-bar .seg { background: rgba(19, 24, 32, 0.92); }
.v3d .canvas-hint { position: absolute; bottom: 8px; left: 12px; }
.v3d-tip { color: var(--accent); margin-left: 8px; }
