:root { font-family: system-ui, sans-serif; color-scheme: light dark; }
body { margin: 0; }
.logout-form { margin: 0; }
.login { max-width: 22rem; margin: 3rem auto; }
.login label { display: block; margin-bottom: 1rem; }
.login input { display: block; width: 100%; padding: .75rem; font-size: 1.25rem; box-sizing: border-box; }
.login button { padding: .75rem 1.5rem; font-size: 1.1rem; }
.error { color: #b00020; }
table { border-collapse: collapse; }
th, td { padding: .4rem .8rem; border-bottom: 1px solid #8884; text-align: left; }
.stack label { display: block; margin-bottom: .75rem; }
.hint { color: #666; font-size: .9rem; }
.warn { color: #8a5a00; }
.warn.older-plan { color: #b71c1c; }
p.warn.older-plan { background: #fdecea; border: 2px solid #b71c1c; padding: .5rem .75rem; }
tr.target-blocked { opacity: .6; }
tr.target-delta td, tr.target-pdf_attach td { background: #f9c5131f; }
.merge-summary { color: #8a5a00; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.alert-error { color: #b00020; background: #fdecea; border: 1px solid #b00020; padding: .5rem .75rem; margin: .5rem 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Cabinet workspace (tablet split-screen) ===================== */
body.ws-body { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
[x-cloak] { display: none !important; }
.workspace {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top" "stage panel";
}
.workspace.panel-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.workspace.panel-collapsed .ws-panel { display: none; }

.ws-top { grid-area: top; display: flex; align-items: center; gap: .5rem; min-width: 0;
  padding: .25rem .5rem; background: #1e3a5f; color: #fff; }
.ws-back { color: #fff; text-decoration: none; font-size: 1.4rem; padding: 0 .4rem; min-height: 2.5rem; display: flex; align-items: center; }
.ws-title { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; font-size: .8rem; }
.ws-title strong { font-size: .95rem; }
.ws-btn { min-width: 2.75rem; min-height: 2.5rem; background: #ffffff22; color: #fff; border: 0; border-radius: .4rem; font-size: 1.1rem; }
.ws-user { font-size: .8rem; opacity: .85; white-space: nowrap; }
/* Back stack of the cross-reference navigation (A§9 „← Bl. 0.a“). */
.ws-nav-back { padding: 0 .7rem; font-size: .95rem; font-weight: 700; white-space: nowrap; background: #f9c513; color: #000; }
.ws-nav-back[hidden] { display: none; }
.presence { display: flex; gap: .25rem; }
.presence:empty { display: none; }

.sheet-nav { flex: 1; min-width: 0; display: flex; gap: .6rem; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; padding: 2px 0; scroll-padding-inline: 2rem; overscroll-behavior-x: contain; }
.sheet-nav::-webkit-scrollbar { display: none; }
.sheet-group { display: inline-flex; align-items: center; gap: .2rem; }
.sheet-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.sheet-chip { display: inline-flex; align-items: center; justify-content: center; gap: .25rem;
  min-width: 2.1rem; min-height: 2.25rem; padding: 0 .35rem; border-radius: .4rem; font-size: .9rem;
  background: #ffffff22; color: #fff; text-decoration: none; font-variant-numeric: tabular-nums; }
.sheet-chip[aria-current="page"] { background: #fff; color: #1e3a5f; font-weight: 700; }
.sheet-chip.no-page .sheet-no { text-decoration: line-through; opacity: .7; }
.sheet-chip.cad-changed_in_cad { box-shadow: inset 0 0 0 2px #f9c513; }
.sheet-chip.cad-removed_in_cad { box-shadow: inset 0 0 0 2px #d32f2f; }
.cad-mark { font-weight: 700; color: #f9c513; }
.cad-removed_in_cad .cad-mark { color: #ff6b6b; }
.badge { font-size: .7rem; font-weight: 700; line-height: 1.15rem; min-width: 1.15rem; padding: 0 .3rem;
  border-radius: 999px; text-align: center; }
.badge-modified { background: #f9c513; color: #000; }
.badge-removed { background: #d32f2f; color: #fff; }
.badge-drive { background: #1a73e8; color: #fff; display: inline-block; }
.badge-imported { background: #e0e0e0; color: #333; display: inline-block; }
.drive-imported td { color: #666; }
.drive-export.ok { color: #1b5e20; }
.ws-drive-result { padding: 0 .5rem; font-size: .85rem; }
.ws-drive-result:empty { display: none; }

.ws-stage-wrap { grid-area: stage; position: relative; min-width: 0; min-height: 0; }
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; background: #5b6470;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* No `will-change: transform` here: Chrome freezes such a layer's raster scale and stretches the
   SVG/HTML overlays as a bitmap; gestures.js sets it only while a gesture runs (A§5). */
.page-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff;
  box-shadow: 0 2px 14px #0007; }
.page-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Ink (A§5, ink-render.js): finished strokes as SVG paths over the page; the live canvas covers
   only the visible region (position/size set inline, layer CSS px). */
.page-layer svg.ink { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.page-layer canvas.ink-live { right: auto; bottom: auto; pointer-events: none; }
.page-layer canvas[hidden] { display: none; }
/* Schematic overlay (A§9, overlay.js): normalized viewBox stretched over the page; hit tests
   run in JS, the SVG itself never takes pointer events. */
.page-layer svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  overflow: visible; pointer-events: none; }
.ov-xref { fill: rgba(211, 47, 47, .06); stroke: #d32f2f; stroke-opacity: .55; stroke-width: 1.25;
  vector-effect: non-scaling-stroke; }
.ov-target { fill: rgba(255, 109, 0, .25); stroke: #ff6d00; stroke-width: 3; vector-effect: non-scaling-stroke;
  animation: ov-pulse .5s ease-in-out infinite alternate; }
@keyframes ov-pulse { from { stroke-opacity: 1; fill-opacity: 1; } to { stroke-opacity: .3; fill-opacity: .25; } }
/* Viewport-clipped high-res render: position/size set inline by pdf-view.js (layer CSS px). */
.page-layer canvas.pdf-detail { right: auto; bottom: auto; pointer-events: none; }
.stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 2rem; color: #fff; font-size: 1.2rem; text-align: center; }
.stage-msg[hidden] { display: none; }
.stage-error { background: #000a; }
/* Banner of a sheet changed in CAD / new in the plan (above the stage, A§3.5). */
.sheet-banner { position: absolute; z-index: 2; top: .5rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .75rem; max-width: calc(100% - 1rem); box-sizing: border-box;
  padding: .3rem .4rem .3rem .9rem; border-radius: .5rem; background: #f9c513; color: #000;
  box-shadow: 0 2px 10px #0006; font-weight: 600; }
.sheet-banner[hidden] { display: none; }
.sheet-banner-ack { min-height: 2.5rem; min-width: 5rem; border: 0; border-radius: .4rem;
  background: #1e3a5f; color: #fff; font: inherit; }

.ws-panel { grid-area: panel; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-left: 1px solid #8884; background: Canvas; }
.ws-tabs { display: flex; border-bottom: 1px solid #8884; }
.ws-tabs button { flex: 1; min-height: 2.75rem; border: 0; border-bottom: 3px solid transparent;
  background: none; color: inherit; font: inherit; }
.ws-tabs button[aria-selected="true"] { border-bottom-color: #1e88e5; font-weight: 700; }
.ws-error { padding: 0 .5rem; }
.ws-error:empty { display: none; }
.tab-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.panel-placeholder { padding: 1rem; color: #888; }

.conn-tools { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .4rem .5rem; background: Canvas; border-bottom: 1px solid #8884; font-size: .85rem; }
.conn-filter { min-height: 2.25rem; padding: 0 .6rem; border: 1px solid #1e88e5; border-radius: .4rem;
  background: none; color: inherit; font: inherit; }
.conn-filter[aria-pressed="true"] { background: #1e88e5; color: #fff; }
.conn-list { list-style: none; margin: 0; padding: 0; }
.conn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; min-height: 2.75rem;
  padding: .45rem .6rem; border-bottom: 1px solid #8883; border-left: 5px solid transparent; }
.conn-ends { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.conn-attrs { grid-column: 1; display: flex; flex-wrap: wrap; gap: .1rem .45rem; font-size: .82rem; opacity: .85; }
.conn-other { font-weight: 700; }
/* „→ Bl. x“ jumps to the other end's sheet (xref-nav.js); never changes the status. */
button.conn-other { min-height: 2rem; padding: 0 .5rem; border: 1px solid #1e88e5; border-radius: .4rem;
  background: none; color: #1565c0; font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.conn-status { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-size: .78rem; }
.conn.kind-internal { font-style: italic; opacity: .75; }
/* Signal colours (A§5): green = wired (as .ov-wired / badge st-all), blue = partial / pen,
   orange = selected, yellow = CAD change, red = removal. */
.conn.st-wired { border-left-color: #2e7d32; background: #81c784; }
.conn.st-wired .conn-status { color: #1b5e20; font-weight: 700; }
/* Sprint 18: one end laid on („einseitig“) – light blue, never green. */
.conn.one-side { border-left-color: #1e88e5; background: #e3f2fd; }
/* End checkboxes „Ziel 1“ / „Ziel 2“ around the connection text (own end first in „Vom Bauteil“). */
/* Sprint 19: fixed columns – [Ende 1] text [Ende 2] never move, whatever the text or state. */
.conn-line { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem; align-items: center; gap: .45rem; min-width: 0; }
.conn-line > * { grid-row: 1; }
.conn-line .conn-ends { grid-column: 2; min-width: 0; }
.end-check { order: 1; flex: none; width: 2.5rem; height: 2.5rem; padding: 0; border: 2px solid #78909c;
  border-radius: .35rem; background: Canvas; color: #fff; font: inherit; font-size: 1.3rem; font-weight: 800;
  line-height: 1; touch-action: manipulation; cursor: pointer; }
.end-check[data-end="source"] { grid-column: 1; }
.end-check[data-end="target"] { grid-column: 3; }
.conn.ends-swapped .end-check[data-end="source"], .pop-row.ends-swapped .end-check[data-end="source"] { grid-column: 3; }
.conn.ends-swapped .end-check[data-end="target"], .pop-row.ends-swapped .end-check[data-end="target"] { grid-column: 1; }
.end-check[aria-pressed="true"] { border-color: #2e7d32; background: #2e7d32; }
.end-check[aria-pressed="true"]::before { content: "✓"; }
.conn.pending .end-check, .pop-row.pending .end-check { opacity: .7; }
.conn.st-modified_in_cad { border-left-color: #f9c513; background: #f9c51340; }
.conn.st-modified_in_cad .conn-status { color: #8a6d00; font-weight: 700; }
.conn.st-removed_after_wired { border-left-color: #d32f2f; background: #d32f2f26; }
.conn.st-removed_after_wired .conn-status { color: #d32f2f; font-weight: 700; }
.conn-delta, .conn-alert { grid-column: 1 / -1; font-size: .82rem; overflow-wrap: anywhere; }
.conn-delta { color: #6b5200; font-weight: 600; }
.conn-was-wired { font-style: normal; color: #b00020; }
.conn-alert { color: #d32f2f; font-weight: 700; }

/* ===== Ink toolbar, presence, sync status, toasts (Task 15) ========= */
.ink-toolbar { position: absolute; z-index: 3; left: .5rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .35rem; padding: .35rem; border-radius: .6rem;
  background: #1e3a5fe6; box-shadow: 0 2px 10px #0006; }
.ink-btn { min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem; border: 2px solid transparent;
  border-radius: .45rem; background: #ffffff22; color: #fff; font: inherit; font-size: .85rem; font-weight: 600;
  touch-action: manipulation; }
.ink-btn[aria-pressed="true"] { border-color: #fff; background: #ffffff44; }
.ink-btn.ink-blue { color: #90caf9; }
.ink-btn.ink-blue[aria-pressed="true"] { background: #1565c0; color: #fff; }
.ink-btn.ink-red { color: #ef9a9a; }
.ink-btn.ink-red[aria-pressed="true"] { background: #e53935; color: #fff; }
.ink-btn.ink-select { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .1rem; font-size: .7rem; }
.ink-icon { width: 1.15rem; height: 1.15rem; }
.ink-btn.ink-select { position: relative; }
/* Auswählen: colour the stylus draws in (toolbar.js penIndicator) */
.pen-dot { position: absolute; top: .2rem; right: .2rem; width: .6rem; height: .6rem; border-radius: 50%;
  border: 1px solid #fff; }
.pen-dot.pen-blue { background: #1e88e5; }
.pen-dot.pen-red { background: #e53935; }
/* last pen mode (the pen draws in it while Auswählen / Radierer is active) */
.ink-btn[data-last-pen="true"][aria-pressed="false"] { border-bottom-color: currentColor; }
.stage[data-tool-mode="select"] { cursor: grab; }
.stage[data-tool-mode="wiring_blue"], .stage[data-tool-mode="revision_red"] { cursor: crosshair; }
.stage[data-tool-mode="eraser"] { cursor: cell; }
.ink-btn[data-ink-action="undo"], .ink-btn[data-ink-action="redo"] { font-size: 1.3rem; }
.ink-btn[data-ink-action="finger"] { font-size: .7rem; line-height: 1.1; max-width: 4.5rem; white-space: normal; }
/* View toggles (toolbar.js): aria-pressed = shown; hidden ones are crossed out */
.ink-btn.ink-view { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .1rem; font-size: .7rem; }
.ink-btn.ink-view[aria-pressed="true"] { border-color: transparent; background: #ffffff22; }
.ink-btn.ink-view[aria-pressed="true"] .eye-off { display: none; }
.ink-btn.ink-view[aria-pressed="false"] { opacity: .6; }
.workspace.hide-red .pin-layer, .workspace.hide-badges .conn-badges { display: none; }

.presence { align-items: center; font-size: .78rem; white-space: nowrap; overflow: hidden; max-width: 22rem; }
.presence-user { display: inline-flex; align-items: center; gap: .3rem; }
.presence-dot { width: .7rem; height: .7rem; border-radius: 50%; background: #9e9e9e; box-shadow: 0 0 0 1px #fff8; }
.sync-status { font-size: .75rem; white-space: nowrap; padding: .15rem .5rem; border-radius: 999px;
  background: #ffffff22; }
.sync-status::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .35rem;
  border-radius: 50%; background: #f9c513; vertical-align: baseline; }
.sync-status[data-state="online"]::before { background: #43a047; }
.sync-status[data-state="offline"] { background: #d32f2f; }
.sync-status[data-state="offline"]::before { background: #fff; }

.toasts { position: fixed; z-index: 10; left: 50%; bottom: 1rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .4rem; pointer-events: none; }
.toast { padding: .6rem 1rem; border-radius: .5rem; background: #263238; color: #fff; box-shadow: 0 2px 10px #0006;
  max-width: 80vw; }
.toast-error { background: #b00020; }

/* Connection overlay (A§9, conn-overlay.js): badges, chips and info badges sit at normalized
   page points (left/top in %) and keep their screen size (--conn-scale = 1 / zoom); taps are
   resolved by hit tests, never by DOM events here. Outlines and lines are SVG (svg.overlay). */
.page-layer { --conn-scale: 1; }
.conn-layer { position: absolute; inset: 0; pointer-events: none; }
.conn-layer > div { position: absolute; inset: 0; }
.conn-badge, .conn-chip, .conn-info { position: absolute; transform-origin: 0 0; white-space: nowrap;
  font: 600 11px/1.35 system-ui, sans-serif; border-radius: 999px; }
.conn-badge { display: inline-flex; align-items: center; gap: 2px; padding: 0 5px;
  transform: scale(var(--conn-scale)) translate(-35%, -75%); box-shadow: 0 1px 2px #0004; }
.conn-badge.st-all { background: #2e7d32; color: #fff; }
.conn-badge.st-some { background: #1e88e5; color: #fff; }
.conn-badge.st-none { background: #eceff1e6; color: #607d8b; font-weight: 500; box-shadow: none;
  border: 1px solid #b0bec5; }
.conn-dot { position: static; inset: auto; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 1px #fff; }
.conn-dot.dot-mod { background: #f9c513; }
.conn-dot.dot-rem { background: #d32f2f; }
.conn-chip { padding: 2px 8px; background: #1565c0; color: #fff; font-size: 12px; box-shadow: 0 1px 4px #0006;
  transform: scale(var(--conn-scale)) translate(6px, calc(-50% + var(--chip-row, 0) * 24px)); }
.conn-info { padding: 2px 8px; border-radius: 6px; background: #263238e6; color: #fff; font-size: 12px;
  transform: scale(var(--conn-scale)) translate(-50%, 8px); }
.ov-sel { fill: rgba(255, 109, 0, .18); stroke: #ff6d00; stroke-width: calc(3px * var(--conn-scale));
  vector-effect: non-scaling-stroke; animation: ov-pulse .6s ease-in-out infinite alternate; }
/* Drawn wire paths (PDF segments + junction dots, zero-length round-capped subpaths): orange
   highlight, green tint of wired connections below it, pin anchor markers without a path. */
.ov-path, .ov-path-dots, .ov-anchor, .ov-wired, .ov-wired-dots { fill: none; stroke-linecap: round;
  stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ov-path { stroke: #ff6d00; stroke-width: calc(4px * var(--conn-scale)); stroke-opacity: .9; }
.ov-path-dots { stroke: #ff6d00; stroke-width: calc(11px * var(--conn-scale)); }
.ov-anchor { stroke: #ff6d00; stroke-width: calc(12px * var(--conn-scale)); stroke-opacity: .75; }
.ov-pot, .ov-pot-dots { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* „⚡ Ganzes Potenzial“ (Sprint 15): the rest of the selected connection's potential, below the orange. */
.ov-pot { stroke: #00b8d4; stroke-width: calc(4px * var(--conn-scale)); stroke-opacity: .85; }
.ov-pot-dots { stroke: #00b8d4; stroke-width: calc(11px * var(--conn-scale)); }
.conn-pot-toggle[aria-pressed="true"] { background: #00b8d4; border-color: #00b8d4; color: #000; }
.ov-partial, .ov-partial-dots { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* Sprint 18: partly done stretch (shared with an open wire, or a one-sided wire's stub). */
.ov-partial { stroke: #0097a7; stroke-width: calc(3px * var(--conn-scale)); stroke-opacity: .8;
  stroke-dasharray: calc(7px * var(--conn-scale)) calc(5px * var(--conn-scale)); }
.ov-partial-dots { stroke: #0097a7; stroke-width: calc(8px * var(--conn-scale)); stroke-opacity: .7; }
.ov-wired { stroke: #2e7d32; stroke-width: calc(3px * var(--conn-scale)); stroke-opacity: .6; }
.ov-wired-dots { stroke: #2e7d32; stroke-width: calc(8px * var(--conn-scale)); stroke-opacity: .7; }

/* Element popover (element-popover.js): in the stage, outside the zoomed layer. */
.el-popover { position: absolute; z-index: 4; display: flex; flex-direction: column; width: min(22rem, 80%);
  max-height: 60%; border-radius: .6rem; background: Canvas; color: CanvasText; box-shadow: 0 4px 18px #0008;
  font-size: .9rem; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.el-popover[hidden] { display: none; }
.pop-head { display: flex; align-items: center; gap: .5rem; padding: .35rem .35rem .35rem .75rem;
  border-bottom: 1px solid #8884; cursor: move; touch-action: none; }
.el-popover.minimized .pop-head { border-bottom: 0; }
.el-popover.minimized .pop-list { display: none; }
.pop-bmk { font-size: 1rem; }
.pop-count { flex: 1; color: #1e88e5; font-weight: 600; }
.pop-close, .pop-min { min-width: 2.75rem; min-height: 2.75rem; border: 0; background: none; color: inherit; font-size: 1.2rem; }
.pop-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pop-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; align-items: center;
  padding: .35rem .5rem .35rem .6rem; border-bottom: 1px solid #8883; border-left: 4px solid transparent; }
.pop-row.st-wired { border-left-color: #2e7d32; background: #81c784; }
.pop-row.one-side { border-left-color: #1e88e5; background: #e3f2fd; }
.pop-row.st-modified_in_cad { border-left-color: #f9c513; }
.pop-row.st-removed_after_wired { border-left-color: #d32f2f; }
.pop-row.pop-current { outline: 2px solid #ff6d00; outline-offset: -2px; }
.pop-ends { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-sheet { font-weight: 400; opacity: .75; }
.pop-attrs { grid-column: 1; font-size: .8rem; opacity: .8; }
.pop-attrs:empty { display: none; }
.pop-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.pop-show { min-height: 2.75rem; padding: 0 .6rem; border: 1px solid #8888; border-radius: .4rem;
  background: none; color: inherit; font: inherit; }
.pop-empty { padding: .6rem .75rem; color: #888; }

.conn { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.conn.pending { opacity: .7; }
.conn-actions { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; }
.conn-act { min-height: 2.75rem; padding: 0 .8rem; border: 1px solid #1e88e5; border-radius: .4rem;
  background: #1e88e5; color: #fff; font: inherit; font-weight: 600; }
.conn-act[data-next="open"] { background: none; color: inherit; }
/* Status button of open/wired rows (A§9): the status itself, the only way to tick a row. */
.conn-act.conn-toggle { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 3.5rem;
  padding: 0 .6rem; border: 2px solid #78909c; background: none; color: inherit; font-weight: 700;
  touch-action: manipulation; }
.conn-act.conn-toggle[data-next="open"] { border-color: #2e7d32; background: #2e7d32; color: #fff; }
.conn-toggle .conn-status { color: inherit; font-size: .8rem; }
.conn.st-wired .conn-toggle .conn-status { color: inherit; }
/* Fixed status button (Sprint 19): same box open / einseitig / ✓, the badge slot always reserved. */
.conn-act.conn-toggle { width: 6.75rem; min-width: 0; height: 2.75rem; min-height: 0; padding: 0 .3rem; line-height: 1.2; }
.conn-status { display: inline-flex; align-items: center; justify-content: flex-end; gap: .3rem; }
.conn-toggle .conn-status { justify-content: center; width: 100%; }
.conn-label { white-space: nowrap; }
.conn-by { flex: none; display: inline-block; width: 1.7rem; height: 1.15rem; border-radius: .3rem; background: #0000001f;
  font-size: .65rem; font-weight: 800; line-height: 1.15rem; text-align: center; letter-spacing: .02em; }
.conn-by:empty { visibility: hidden; }
.conn.conn-selected { box-shadow: inset 0 0 0 2px #ff6d00; background-color: #ff6d0014; }
/* The selection keeps its orange frame, but a done / one-sided row keeps its colour (Sprint 18). */
.conn.conn-selected.st-wired { background-color: #81c784; }
.conn.conn-selected.one-side { background-color: #e3f2fd; }
.conn[hidden] { display: none; }
/* BMK filter of the list (component tap, conn-list.js renderFilter) */
.conn-bmk-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .4rem .5rem; background: #ff6d0014; border-bottom: 2px solid #ff6d00; font-size: .85rem; }
.conn-filter-clear { min-height: 2.75rem; padding: 0 .6rem; border: 1px solid #ff6d00; border-radius: .4rem;
  background: Canvas; color: inherit; font: inherit; font-weight: 600; touch-action: manipulation; }
.conn-filter-clear small { font-weight: 400; opacity: .8; }

/* Part view of a selected BMK (Sprint 15, conn-list.js partTools): view switch + sort pills. */
.part-tools { display: flex; flex-direction: column; gap: .25rem; width: 100%; }
.el-popover .part-tools { width: auto; padding: .3rem .5rem; border-bottom: 1px solid #8884; }
.el-popover.minimized .pop-sub { display: none; }
.part-pills { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.part-pills-label { font-size: .75rem; opacity: .75; margin-right: .15rem; }
.part-pill { min-height: 2.25rem; padding: 0 .55rem; border: 1px solid #8888; border-radius: 999px; background: Canvas;
  color: inherit; font: inherit; font-size: .78rem; touch-action: manipulation; }
.part-pill[aria-pressed="true"] { background: #ff6d00; border-color: #ff6d00; color: #fff; font-weight: 600; }
.conn-own { font-weight: 800; }
.conn-group, .pop-group { padding: .3rem .6rem; background: #8882; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; }
/* „⚡ Potenzial-Verlauf“ under the selected row */
.conn-potential { padding: .4rem .6rem .5rem; border-left: 4px solid #00b8d4; background: #00b8d414; font-size: .85rem; }
.pot-pins { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.pot-pin { font-variant-numeric: tabular-nums; }

/* ===== Red pins: markers, quick sheet, revision panel (Task 16) ===== */
.ws-link { display: inline-flex; align-items: center; padding: 0 .6rem; font-size: .8rem; text-decoration: none; white-space: nowrap; }
.ink-btn.ink-done { background: #e53935; color: #fff; }
.ink-btn[hidden] { display: none; }
/* Markers sit at the task anchor (bottom-left corner on it) and keep their screen size. */
.pin-layer { position: absolute; inset: 0; pointer-events: none; --pin-scale: 1; }
.pin-marker { position: absolute; pointer-events: auto; transform-origin: 0 0;
  transform: scale(var(--pin-scale)) translateY(-100%); display: inline-flex; align-items: center; gap: .3rem;
  min-height: 2.75rem; max-width: 16rem; padding: 0 .2rem; border: 2px solid #fff; border-radius: 1.4rem;
  background: #d32f2fe6; color: #fff; font: inherit; font-size: .8rem; box-shadow: 0 1px 6px #0007;
  white-space: nowrap; overflow: hidden; touch-action: manipulation; cursor: pointer; }
.pin-no { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem;
  border-radius: 50%; background: #fff; color: #c62828; font-weight: 800; }
/* Compact by default (only „R6“); the text shows on hover (mouse) or after a tap (.pin-open). */
.pin-text { display: none; overflow: hidden; text-overflow: ellipsis; }
.pin-marker.pin-open { z-index: 1; padding-right: .55rem; }
.pin-marker.pin-open .pin-text { display: inline; }
@media (hover: hover) {
  .pin-marker:hover { z-index: 1; padding-right: .55rem; }
  .pin-marker:hover .pin-text { display: inline; }
}
.pin-marker.pending { opacity: .75; border-style: dashed; }
.pin-marker.st-in_cad { background: #ef6c00e6; }
.pin-marker.st-done { background: #2e7d32cc; }
.pin-marker.st-rejected { background: #616161cc; text-decoration: line-through; }
.pin-marker.pin-flash { animation: hl-pulse .5s ease-in-out 3 alternate; }

.quick-sheet { position: absolute; z-index: 5; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(46rem, 100%); max-height: 75%; overflow-y: auto; box-sizing: border-box; padding: .6rem .8rem .8rem;
  border-radius: .9rem .9rem 0 0; background: #fff; color: #111; box-shadow: 0 -4px 18px #0007;
  border-top: 4px solid #e53935; }
.quick-sheet[hidden] { display: none; }
.qs-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.qs-title { margin: 0 0 .3rem; font-size: 1.05rem; color: #c62828; }
.qs-meta { font-size: .85rem; color: #555; }
.qs-row { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; }
.qs-label { flex: 0 0 6.5rem; font-size: .8rem; font-weight: 700; color: #555; }
.qs-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.qs-chip, .qs-btn { min-height: 2.75rem; min-width: 2.75rem; padding: 0 .8rem; border: 1px solid #9e9e9e;
  border-radius: 1.4rem; background: #f5f5f5; color: #111; font: inherit; font-size: .9rem; touch-action: manipulation; }
.qs-chip[aria-pressed="true"] { background: #e53935; border-color: #e53935; color: #fff; font-weight: 700; }
.qs-chip:disabled { opacity: .6; }
.qs-quick { border-style: dashed; }
.qs-input { flex: 1; min-height: 2.75rem; box-sizing: border-box; padding: 0 .6rem; font: inherit; font-size: 1rem;
  border: 1px solid #9e9e9e; border-radius: .4rem; }
.qs-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.qs-btn { border-radius: .45rem; font-weight: 600; }
.qs-btn[hidden] { display: none; }
.qs-save { background: #e53935; border-color: #e53935; color: #fff; }
.qs-delete { margin-right: auto; color: #b00020; border-color: #b00020; background: none; }

.rev-tools { flex-wrap: wrap; gap: .3rem; }
.rev-title { font-size: .8rem; font-weight: 700; }
.rev-scope { display: inline-flex; gap: .3rem; }
.rev-list { list-style: none; margin: 0; padding: 0; }
.rev { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; min-height: 2.75rem;
  padding: .4rem .5rem; border-bottom: 1px solid #8883; border-left: 4px solid #e53935; cursor: pointer; }
.rev-head { font-size: .85rem; overflow-wrap: anywhere; }
.rev-no { color: #c62828; }
.rev.rev-selected { box-shadow: inset 0 0 0 2px #e53935; background-color: #e5393514; }
.rev-cat { opacity: .75; }
.rev-text { grid-column: 1 / -1; font-weight: 600; overflow-wrap: anywhere; }
.rev-meta { grid-column: 1 / -1; font-size: .75rem; opacity: .75; }
.rev-status { align-self: start; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px;
  background: #e53935; color: #fff; white-space: nowrap; }
.rev-st-in_cad { background: #ef6c00; }
.rev-st-done { background: #2e7d32; }
.rev-st-rejected { background: #616161; }
.rev.st-done, .rev.st-rejected { border-left-color: #9e9e9e; opacity: .8; }

/* Büro task list */
.office-group th { background: #1e3a5f14; }
.office-status { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.office-status select, .office-status input, .office-status button { min-height: 2.5rem; font: inherit; }
.office-text { font-weight: 600; }

/* ===== Office pages: projects, cabinets, revision list, import wizard ==========
   Same dark topbar as the workspace (.ws-top); light content area with cards. */
body.app-body { --navy: #1e3a5f; --navy-2: #2a4c78; --accent: #1e88e5; --ok: #2e7d32; --yellow: #f9c513;
  --red: #d32f2f; --line: #dde3ea; --muted: #5f6b7a; --bg: #eef1f5; --card: #fff;
  color-scheme: light; background: var(--bg); color: #1b2430; min-height: 100vh; }
.app-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem;
  min-height: 3rem; padding: .25rem .75rem; background: var(--navy, #1e3a5f); color: #fff; box-shadow: 0 1px 6px #0003; }
.app-brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; }
.app-logo { display: inline-flex; align-items: center; justify-content: center; height: 1.8rem; padding: 0 .45rem;
  border-radius: .35rem; background: #fff; color: #1e3a5f; font-size: .8rem; letter-spacing: .04em; }
.app-name { font-size: 1.05rem; }
.app-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-size: .9rem; padding-left: .75rem; border-left: 1px solid #ffffff33; }
.app-crumbs a { color: #ffffffcc; text-decoration: none; }
.app-crumbs a:hover { color: #fff; text-decoration: underline; }
.app-crumbs [aria-current] { font-weight: 600; }
.crumb-sep { opacity: .5; }
.app-user { font-size: .85rem; opacity: .85; white-space: nowrap; }
.top-btn { min-height: 2.25rem; padding: 0 .8rem; background: #ffffff22; color: #fff; border: 0; border-radius: .4rem;
  font: inherit; font-size: .85rem; cursor: pointer; }
.top-btn:hover { background: #ffffff38; }
.app-main { max-width: 1400px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-body h1 { margin: 0; font-size: 1.5rem; }
.app-body h1 small { font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: .4rem; }
.app-body h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.app-body .hint { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-title { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 16rem; }
.page-actions, .panel-actions, .drive-status { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.section-title { display: flex; align-items: center; gap: .5rem; margin: 1.5rem 0 .75rem !important; }
.count-pill { display: inline-block; min-width: 1.6rem; padding: .05rem .5rem; border-radius: 999px;
  background: #d8e0ea; color: var(--navy); font-size: .8rem; font-weight: 700; text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.5rem;
  padding: 0 1rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff; color: var(--navy);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--navy-2); background: #f5f8fc; }
.btn:disabled, .btn.htmx-request { opacity: .6; cursor: progress; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-sm { min-height: 2rem; padding: 0 .7rem; font-size: .85rem; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.archive-panel .panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-ghost { border-color: transparent; background: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .9rem; }

/* Search */
.search { min-height: 2.5rem; min-width: 16rem; padding: 0 .9rem; border: 1px solid var(--line); border-radius: .45rem;
  background: #fff; font: inherit; }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Cards */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); }
.card { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; border: 1px solid var(--line);
  border-radius: .7rem; background: var(--card); box-shadow: 0 1px 2px #1e3a5f14; color: inherit; text-decoration: none; }
.card[hidden] { display: none; }
a.card:hover, .cabinet-card:hover { border-color: #b7c6d8; box-shadow: 0 4px 14px #1e3a5f1f; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; justify-content: space-between; }
.cabinet-card .card-head { justify-content: flex-start; }
.card-title { margin: 0 !important; font-size: 1.05rem !important; line-height: 1.3; }
.card-title a { color: inherit; text-decoration: none; }
.card-meta { margin: 0; color: var(--muted); font-size: .88rem; }
.card-result:empty { display: none; }
.card-result { font-size: .85rem; }

.pill { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: .35rem; background: #e8edf3;
  color: var(--navy); font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pill-no { background: var(--navy); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pill-lg { font-size: 1rem; padding: .25rem .7rem; }
.pill-stand { background: #e3f0fd; color: #0d47a1; }

.app-body .badge { display: inline-flex; align-items: center; padding: .1rem .55rem; font-size: .75rem; line-height: 1.2rem; }
.badge-ok { background: #e6f4ea; color: var(--ok, #2e7d32); text-decoration: none; }
.badge-neutral { background: #eceff3; color: var(--muted, #5f6b7a); }
.badge-warn { background: #fff4d6; color: #8a5a00; }
.badge-danger-outline { background: #fff; color: var(--red, #d32f2f); box-shadow: inset 0 0 0 1.5px var(--red, #d32f2f); }
.badge-btn { border: 0; font: inherit; cursor: pointer; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1.4rem; }

/* Progress */
.progress { height: .5rem; border-radius: 999px; background: #e3e8ee; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2e7d32, #43a047); }
.progress-lg { height: .85rem; }
.progress-label { margin: 0; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-label strong { color: #1b2430; }

/* Panels, tables */
.panel { margin-top: 1.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--card); }
.panel-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); margin-top: 1.5rem; }
.panel-grid .panel { margin-top: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.panel-head h2 { margin: 0; }
.group-title { margin: 1rem 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.data-table th { position: sticky; top: 0; background: #f5f7fa; color: var(--muted); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; }
.data-table th, .data-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table th.num { text-align: right; }
.app-body .stack label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; font-weight: 600; }
.app-body .stack input { min-height: 2.4rem; padding: 0 .7rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; font-weight: 400; }
.empty-state { padding: 2rem; border: 1px dashed #c3ccd8; border-radius: .7rem; text-align: center; color: var(--muted); background: #fff8; }
.empty-state[hidden] { display: none; }
.file-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.file-link { padding: .35rem .7rem; border-radius: .4rem; background: #f0f4f9; color: var(--navy); font-size: .85rem; text-decoration: none; }
.file-link:hover { background: #e2eaf4; }
.office-group th { background: #e8edf3 !important; color: var(--navy) !important; }
.office-status { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.office-status select, .office-status input { min-height: 2rem; border: 1px solid var(--line); border-radius: .35rem; font: inherit; padding: 0 .4rem; }
#import-area:not(:empty), #import-error:not(:empty) { margin-top: 1.25rem; }

/* Drag-&-drop upload zone: the transparent file input covers the zone (native click + drop). */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.6rem 1rem;
  border: 2px dashed #b7c6d8; border-radius: .7rem; background: #f7f9fc; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone:focus-within, .dropzone.drag-over { border-color: var(--accent); background: #eaf3fd; }
.dropzone.has-files { border-style: solid; border-color: var(--ok); background: #eef8f0; }
.dropzone-icon { font-size: 1.6rem; color: var(--navy); }
.dropzone-hint { font-size: .8rem; color: var(--muted); }
.dropzone-files { font-size: .85rem; font-weight: 600; color: var(--ok); word-break: break-all; }

/* Drive import dialog */
.modal { width: min(52rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 0; border: 0; border-radius: .8rem;
  box-shadow: 0 20px 60px #0006; color: #1b2430; background: #fff; }
.modal::backdrop { background: #0f1c2e99; }
.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem;
  background: var(--navy); color: #fff; }
.modal-head h2 { margin: 0 !important; }
.modal-head .hint { margin: .15rem 0 0; color: #ffffffb3 !important; font-size: .85rem; }
.modal-close { min-width: 2.5rem; min-height: 2.5rem; border: 0; border-radius: .4rem; background: #ffffff22; color: #fff; font-size: 1.4rem; cursor: pointer; }
.modal-search { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: 1rem 1.25rem .5rem; }
.modal-search .search { flex: 1; }
.modal-body { overflow-y: auto; padding: 0 1.25rem 1.25rem; min-height: 8rem; }
#drive-dialog-error:not(:empty) { padding: 0 1.25rem; }
.folder-list { list-style: none; margin: 0; padding: 0; }
.folder-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .25rem; border-bottom: 1px solid var(--line); }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-pick h3 { margin: .25rem 0 .5rem; }
.app-body h1 small { white-space: nowrap; }
.office-tasks, .drive-files { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }

/* ===== Sprint 13: sheet bar, fullscreen, wire pills, „Offene“ filter ===== */
/* Sheet bar (topbar.js): ‹ › show only when the nav overflows in that direction. */
.sheet-bar { position: relative; flex: 1; min-width: 0; display: flex; }
.sheet-scroll { position: absolute; z-index: 1; top: 0; bottom: 0; width: 1.9rem; border: 0; padding: 0;
  color: #fff; font-size: 1.3rem; font-weight: 700; touch-action: manipulation; cursor: pointer; }
.sheet-scroll[hidden] { display: none; }
.sheet-scroll-prev { left: 0; background: linear-gradient(90deg, #1e3a5f 55%, #1e3a5f00); text-align: left; }
.sheet-scroll-next { right: 0; background: linear-gradient(270deg, #1e3a5f 55%, #1e3a5f00); text-align: right; }
.ws-fullscreen[hidden] { display: none; }
.ws-fullscreen svg { width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.ws-fullscreen[aria-pressed="true"] { background: #fff; color: #1e3a5f; }
.ws-fullscreen[aria-pressed="true"] .fs-enter, .ws-fullscreen[aria-pressed="false"] .fs-exit { display: none; }
.ink-btn[data-action="fit"] { font-size: 1.2rem; }

/* Wire attribute pills of a row: cross section, colour swatch (wscad::colors::swatch_codes), type. */
.conn-attrs { align-items: center; }
.conn-pill { display: inline-flex; align-items: center; gap: .3rem; padding: 0 .45rem; border: 1px solid #8886;
  border-radius: 999px; font-size: .75rem; line-height: 1.3rem; white-space: nowrap; font-style: normal; }
.wc-dot { display: inline-flex; width: .8rem; height: .8rem; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 1px #0007; }
.wc-dot > i { flex: 1; background: var(--c); }
.wc-GNYE { background: repeating-linear-gradient(45deg, #2e7d32 0 .2rem, #fdd835 .2rem .4rem); }
.wc-GNYE > i { display: none; }
.wc-BK { --c: #212121; } .wc-BN { --c: #795548; } .wc-RD { --c: #d32f2f; } .wc-OG { --c: #ef6c00; }
.wc-YE { --c: #fdd835; } .wc-GN { --c: #2e7d32; } .wc-BU { --c: #1e63d0; } .wc-VT { --c: #8e24aa; }
.wc-GY { --c: #9e9e9e; } .wc-WH { --c: #fff; } .wc-PK { --c: #f48fb1; }

/* „Offene (x)“ (conn-list.js): wired rows hidden; a just-ticked row fades out first. */
.conn-tools { flex-wrap: wrap; }
.conn-panel.only-open .conn.st-wired:not(.just-wired) { display: none; }
.conn-panel.only-open .conn.st-wired.just-wired { animation: conn-fade-out 1s ease-in forwards; }
@keyframes conn-fade-out { to { opacity: .25; } }
/* ===== Sprint 13: part search (top bar) and part info card (part-search.js) ===== */
.part-search { position: relative; z-index: 30; flex: 0 1 14rem; min-width: 8rem; }
.part-search-input { width: 100%; min-height: 2.5rem; padding: 0 .6rem; border: 0; border-radius: .4rem;
  background: #ffffff22; color: #fff; font: inherit; font-size: .9rem; }
.part-search-input::placeholder { color: #fffb; }
.part-search-input:focus { background: #fff; color: #1e3a5f; outline: none; }
.part-results { position: absolute; top: calc(100% + .3rem); right: 0; width: min(26rem, 92vw); max-height: 70vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: .6rem; background: Canvas; color: CanvasText;
  box-shadow: 0 4px 18px #0008; font-size: .9rem; }
.part-results[hidden] { display: none; }
.part-hits { list-style: none; margin: 0; padding: 0; }
.part-hit { display: flex; flex-direction: column; gap: .25rem; padding: .5rem .6rem; border-bottom: 1px solid #8883; }
.part-hit-head { display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.part-empty { padding: .6rem .75rem; color: #888; }
.part-bmk { font-size: 1rem; white-space: nowrap; }
.part-text { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.part-maker { font-size: .85rem; opacity: .8; }
.part-sheets, .part-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.part-sheets:empty { display: none; }
.part-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; }
.part-sheet, .part-show, .part-ansicht, .part-datasheet { min-height: 2.75rem; min-width: 2.75rem; padding: 0 .6rem;
  border: 1px solid #1e88e5; border-radius: .4rem; background: none; color: #1565c0; font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; text-decoration: none; touch-action: manipulation; }
.part-show { background: #1e88e5; color: #fff; }
.part-card { display: flex; flex-direction: column; gap: .3rem; padding: .5rem; border-bottom: 1px solid #ff6d0066;
  background: #ff6d000a; font-size: .85rem; }
.part-card.compact { padding: .35rem .6rem; gap: .2rem; font-size: .8rem; }
.part-card.compact .part-text { -webkit-line-clamp: 2; }


/* ===== Sprint 14: material list /cabinets/{id}/materials (materials.js) ===== */
.mat-maker { min-height: 2.75rem; padding: 0 .6rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff; font: inherit; }
.mat-search { flex: 1; min-width: 12rem; min-height: 2.75rem; }
.mat-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: 1rem; }
.mat-kpi { display: flex; flex-direction: column; gap: .4rem; padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: .7rem; background: var(--card); }
.mat-kpi-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; color: var(--muted); font-size: .9rem; }
.mat-kpi-head strong { color: #1b2430; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.mat-kpi.has-problems { border-color: var(--red); background: #fdecea; }
.mat-kpi.has-problems strong { color: var(--red); }
.mat-kpi-note { font-size: .8rem; font-weight: 600; color: #8a5a00; }
.mat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.mat-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; grid-template-areas: "qty art status" "qty notes notes";
  gap: .35rem .9rem; padding: .7rem .9rem; border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: .6rem; background: var(--card); }
.mat-row[hidden] { display: none; }
.mat-row[data-installed="true"] { border-left-color: var(--ok); }
.mat-row.qty-changed { border-left-color: var(--yellow); background: #fff8dc; }
.mat-row.has-problem { border-left-color: var(--red); }
.mat-row.qty-zero .mat-qty strong { text-decoration: line-through; color: var(--red); }
.mat-qty { grid-area: qty; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: .5rem; background: #f0f4f9; color: var(--navy); font-variant-numeric: tabular-nums; }
.mat-qty strong { font-size: 1.5rem; line-height: 1.1; }
.mat-qty small { font-size: .75rem; color: var(--muted); }
.mat-art { grid-area: art; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.mat-art-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.mat-maker-name { color: var(--muted); font-weight: 600; }
.mat-no { font-size: 1.05rem; overflow-wrap: anywhere; }
.mat-desc { overflow-wrap: anywhere; }
.mat-bmks { display: flex; flex-wrap: wrap; gap: .3rem; }
.mat-bmk { display: inline-flex; align-items: center; gap: .2rem; min-height: 2rem; padding: 0 .55rem; border: 1px solid #1e88e5;
  border-radius: .4rem; color: #1565c0; font-size: .85rem; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.mat-bmk:hover { background: #e3f0fd; }
.mat-changed { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: .4rem;
  background: var(--yellow); color: #000; font-weight: 700; font-size: .9rem; }
/* Sprint 19: fixed button boxes – a tick never changes size or position (badge slot reserved). */
/* Sprint 20: line 1 „✓ Bestellt“, line 2 the reserved badge slot; fixed box, nothing clipped. */
.mat-status { grid-area: status; display: grid; grid-template-columns: repeat(4, 8.5rem); gap: .35rem; align-self: start; }
.mat-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; width: 100%; height: 3.5rem;
  min-height: 52px; line-height: 1.2;
  padding: .25rem .4rem; border: 2px solid var(--line); border-radius: .55rem; background: #fff; color: var(--muted);
  font: inherit; font-size: .85rem; font-weight: 700; touch-action: manipulation; cursor: pointer; }
.mat-toggle-main { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.mat-check { flex: none; width: 1.1rem; height: 1.1rem; opacity: .25; }
.mat-toggle[aria-pressed="true"] { border-color: var(--ok); background: #e6f4ea; color: var(--ok); }
.mat-toggle[aria-pressed="true"] .mat-check { opacity: 1; }
.mat-toggle.mat-problem[aria-pressed="true"] { border-color: var(--red); background: #fdecea; color: var(--red); }
.mat-toggle.htmx-request { opacity: .6; }
.mat-toggle-label { white-space: nowrap; }
.mat-stamp { display: block; flex: none; min-width: 1.7rem; height: 1rem; padding: 0 .2rem; border-radius: .3rem; background: #0000001a;
  color: #1b2430; font-size: .65rem; font-weight: 800; line-height: 1rem; text-align: center; }
.mat-stamp:empty { visibility: hidden; }
.mat-notes { grid-area: notes; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mat-note { flex: 1 1 14rem; min-height: 2.5rem; padding: 0 .6rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; }
.mat-note-problem { border-color: var(--red); }
.mat-add summary { cursor: pointer; font-weight: 700; color: var(--navy); min-height: 2.5rem; display: flex; align-items: center; }
.mat-add-form { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; margin-top: .75rem; }
.mat-add-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; }
.mat-add-form input { min-height: 2.5rem; padding: 0 .6rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; font-weight: 400; }
@media (max-width: 960px) {
  .mat-row { grid-template-columns: 3.5rem minmax(0, 1fr); grid-template-areas: "qty art" "status status" "notes notes"; }
  .mat-status { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== Sprint 14: responsive workspace header (tablets 768–1279 px) =====
   ≥ 1280: one row, office actions as icon buttons (tooltip). < 1280: actions in the ☰ menu with
   full labels. < 1150: the sheet bar gets its own full-width second row, the part search is a
   loupe button with a floating overlay. < 960: the side panel is a drawer over the plan (closed
   by default, workspace.js) and the ink toolbar is compact; portrait: a bottom dock. */
.ws-top { position: relative; z-index: 20; }
.ws-icon { width: 1.3rem; height: 1.3rem; display: block; }
.ws-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; flex: 0 0 auto;
  text-decoration: none; cursor: pointer; touch-action: manipulation; }
.ws-panel-toggle { position: relative; }
.workspace:not(.panel-collapsed) .ws-panel-toggle { background: #ffffff44; }
.ws-panel-badge { position: absolute; top: -.2rem; right: -.25rem; min-width: 1.15rem; padding: 0 .3rem; border-radius: 999px;
  background: #f9c513; color: #000; font-size: .7rem; font-weight: 800; line-height: 1.15rem; text-align: center; }
.ws-panel-badge[hidden] { display: none; }
.ws-menu { position: relative; display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.ws-menu-btn { display: none; }
.ws-actions { display: flex; align-items: center; gap: .5rem; }
.ws-act-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws-logout { margin: 0; display: flex; }
.part-search-toggle { display: none; }
.part-search-pop { position: relative; }
.part-search-field { position: relative; display: block; }
.part-search-icon { position: absolute; left: .55rem; top: 50%; width: 1.05rem; height: 1.05rem; transform: translateY(-50%);
  opacity: .8; pointer-events: none; }
.part-search-input { padding-left: 2rem; box-sizing: border-box; }
.part-search-pop:focus-within .part-search-icon { color: #1e3a5f; }
.ws-drive-result { position: absolute; z-index: 6; top: .5rem; right: .5rem; max-width: min(28rem, calc(100% - 1rem));
  padding: .5rem .75rem; border-radius: .5rem; background: Canvas; color: CanvasText; box-shadow: 0 2px 12px #0006; cursor: pointer; }

@media (max-width: 1279.98px) {
  .ws-menu-btn { display: inline-flex; }
  .ws-menu-btn[aria-expanded="true"] { background: #fff; color: #1e3a5f; }
  .ws-actions { display: none; position: absolute; z-index: 40; top: calc(100% + .45rem); right: 0; flex-direction: column;
    align-items: stretch; gap: .25rem; min-width: 17rem; padding: .4rem; border-radius: .6rem; background: #1e3a5f;
    box-shadow: 0 6px 22px #0009; }
  .ws-menu.open .ws-actions { display: flex; }
  .ws-actions .ws-btn { justify-content: flex-start; gap: .6rem; min-height: 2.9rem; padding: 0 .8rem; font: inherit;
    font-size: .95rem; text-align: left; white-space: nowrap; }
  .ws-act-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .ws-actions .ws-user { padding: .4rem .8rem 0; border-top: 1px solid #ffffff33; margin-top: .2rem; }
  .ws-logout .ws-btn { flex: 1; }
}

@media (max-width: 1149.98px) {
  .ws-top { flex-wrap: wrap; row-gap: .25rem; }
  .ws-top > .sheet-bar { order: 10; flex: 1 1 100%; min-width: 0; }
  .ws-title { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .ws-title strong, .ws-title span { overflow: hidden; text-overflow: ellipsis; }
  .presence { max-width: 12rem; }
  .part-search { flex: 0 0 auto; min-width: 0; position: static; }
  .part-search-toggle { display: inline-flex; }
  .part-search.open .part-search-toggle { background: #fff; color: #1e3a5f; }
  .part-search-pop { display: none; position: absolute; z-index: 40; top: calc(100% + .3rem); right: .5rem;
    width: min(28rem, calc(100vw - 1rem)); padding: .45rem; border-radius: .6rem; background: #1e3a5f; box-shadow: 0 6px 22px #0009; }
  .part-search.open .part-search-pop { display: block; }
  .part-search-pop .part-results { position: static; width: auto; margin-top: .4rem; max-height: 60vh; }
}

/* Compact ink toolbar on narrow or short (landscape tablet) screens. */
@media (max-width: 959.98px), (max-height: 820px) {
  .ink-toolbar { left: .3rem; gap: .25rem; padding: .25rem; }
  .ink-btn { min-width: 2.75rem; min-height: 2.75rem; padding: 0 .3rem; font-size: .75rem; } /* 44 px touch target */
  .ink-btn.ink-select span { display: none; } /* the eye toggles keep "Rot" / "n/m" */
  .ink-btn[data-ink-action="finger"] { max-width: 4.2rem; font-size: .62rem; }
}

@media (max-width: 959.98px) {
  .workspace, .workspace.panel-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "stage"; }
  /* Drawer: same grid cell as the stage, right-aligned above it. */
  .ws-panel { grid-area: stage; justify-self: end; z-index: 8; width: min(24rem, 88vw); box-shadow: -6px 0 22px #0007;
    animation: ws-drawer-in .18s ease-out; }
  @keyframes ws-drawer-in { from { transform: translateX(100%); } to { transform: none; } }
}

/* Portrait tablets: the toolbar becomes a bottom dock (one scrollable row). */
@media (max-width: 959.98px) and (orientation: portrait) {
  .ink-toolbar { top: auto; bottom: .4rem; left: 50%; transform: translateX(-50%); flex-direction: row; max-width: calc(100% - .8rem);
    overflow-x: auto; scrollbar-width: none; }
  .ink-toolbar::-webkit-scrollbar { display: none; }
  .ink-btn { flex: 0 0 auto; }
}
.part-icon { width: 1.05rem; height: 1.05rem; margin-right: .3rem; flex: 0 0 auto; }

/* ===== Sprint 19: breadcrumbs with cabinet switcher, project-wide lists, activity log ===== */
/* Shrink order in a narrow header: project name first (ellipsis), the cabinet label keeps ≥ 7rem. */
.crumb-project { flex: 0 1 auto; min-width: 4.6rem; overflow: hidden; text-overflow: ellipsis; }
.crumb-switch { flex: 0 1 auto; min-width: 7rem; }
.crumb-page, .app-crumbs .crumb-sep { flex: none; }
.crumb-switch > summary { list-style: none; display: inline-flex; align-items: center; gap: .25rem; max-width: 100%; min-height: 2.25rem;
  padding: 0 .55rem; border-radius: .4rem; background: #ffffff1f; color: #fff; cursor: pointer; overflow: hidden; }
.crumb-switch > summary::-webkit-details-marker { display: none; }
.crumb-switch[open] > summary { background: #fff; color: var(--navy); }
.crumb-switch-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Containing block = the sticky .app-top, so the overflow of .app-crumbs does not clip it. */
.crumb-menu { position: absolute; top: 100%; z-index: 30; min-width: 17rem; max-width: calc(100vw - 1rem); margin: .2rem 0 0; padding: .35rem;
  list-style: none; border-radius: .6rem; background: #fff; box-shadow: 0 6px 22px #0005; white-space: normal; }
.app-crumbs .crumb-menu a { display: flex; align-items: center; gap: .3rem; min-height: 2.75rem; padding: 0 .75rem; border-radius: .4rem;
  color: #1b2430; text-decoration: none; }
.app-crumbs .crumb-menu a:hover { background: #f0f4f9; text-decoration: none; }
.app-crumbs .crumb-menu a[aria-current] { background: #e3f0fd; font-weight: 700; }
.crumb-menu-all { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--line); }
.ini-badge { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 1.9rem; height: 1.35rem; border-radius: .35rem;
  background: var(--navy); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .03em; }
.act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.act-row { display: grid; grid-template-columns: 1.9rem 8.5rem 6.5rem minmax(0, 1fr) auto; grid-template-areas: "who when kind what cab";
  gap: .6rem; align-items: center; padding: .5rem .75rem; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: .5rem; background: var(--card); font-size: .9rem; }
.act-row > .ini-badge { grid-area: who; }
.act-when { grid-area: when; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-kind { grid-area: kind; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.act-what { grid-area: what; min-width: 0; overflow-wrap: anywhere; }
.act-what a { color: #1565c0; font-weight: 700; text-decoration: none; }
.act-cab { grid-area: cab; padding: .1rem .5rem; border-radius: 999px; background: #f0f4f9; font-size: .8rem; font-weight: 700; }
.act-verdrahtung { border-left-color: var(--ok); }
.act-material { border-left-color: var(--accent); }
.act-revision { border-left-color: var(--red); }
.pm-parts { display: flex; flex-wrap: wrap; gap: .3rem; }
.pm-part { padding: .1rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: #1b2430; font-size: .85rem; font-weight: 600;
  text-decoration: none; white-space: nowrap; }
.pm-part.is-ordered { border-color: var(--accent); background: #e3f0fd; }
.pm-part.is-installed { border-color: var(--ok); background: #e6f4ea; }
.pm-part.has-problem { border-color: var(--red); color: var(--red); }
.pm-st { display: inline-block; margin: 0 .2rem .2rem 0; padding: .05rem .4rem; border-radius: .3rem; background: #f0f4f9; color: var(--muted);
  font-size: .72rem; opacity: .5; }
.pm-st.on { opacity: 1; background: #e6f4ea; color: var(--ok); font-weight: 700; }
.pm-problem.on { background: #fdecea; color: var(--red); }

/* Element panel (Sprint 19): one-line part card + „⇅ Sortierung / Ansicht“ dropdown, fixed buttons. */
.el-popover .pop-list { flex: 1 1 auto; min-height: 0; }
.pop-sub { position: relative; display: flex; align-items: flex-start; gap: .4rem; padding: .3rem .5rem; border-bottom: 1px solid #8884; }
.pop-sub .part-card.compact { flex: 1; min-width: 0; padding: 0; border: 0; background: none; }
.part-line { display: flex; align-items: center; gap: .3rem; min-width: 0; min-height: 2.5rem; }
.part-line .part-text { display: block; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part-info { flex: none; width: 2.5rem; height: 2.5rem; border: 1px solid #8888; border-radius: 50%; background: none; color: inherit;
  font: italic 700 1.05rem Georgia, "Times New Roman", serif; touch-action: manipulation; }
.part-card.open .part-info { background: #1e88e5; border-color: #1e88e5; color: #fff; }
.part-card.compact .part-more { display: none; }
.part-card.compact.open .part-more { display: flex; flex-direction: column; gap: .3rem; padding-bottom: .2rem; }
.part-menu { flex: none; }
.part-menu-btn { list-style: none; display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 .6rem; border: 1px solid #8888;
  border-radius: .4rem; font-weight: 700; white-space: nowrap; cursor: pointer; touch-action: manipulation; }
.part-menu-btn::-webkit-details-marker { display: none; }
.part-menu[open] .part-menu-btn { background: #ff6d00; border-color: #ff6d00; color: #fff; }
.part-menu[open] > .part-tools { position: absolute; top: 100%; right: .5rem; z-index: 3; width: max-content; max-width: calc(100% - 1rem);
  padding: .5rem; border-radius: .5rem; background: Canvas; box-shadow: 0 4px 14px #0006; }
.pop-btns .conn-toggle { width: 4.5rem; padding: 0; }
.pop-grip { display: none; }
/* Bottom sheet below 900 px (element-popover.js SHEET_QUERY): docked, half / full height. */
.el-popover.as-sheet { left: 0; right: 0; top: auto; bottom: 0; z-index: 12; width: auto; height: 60%; max-height: none;
  border-radius: .9rem .9rem 0 0; box-shadow: 0 -4px 22px #0008; }
.el-popover.as-sheet.full { height: calc(100% - .4rem); }
.el-popover.as-sheet.minimized { height: auto; }
.el-popover.as-sheet .pop-head { position: relative; padding-top: .7rem; cursor: grab; }
.el-popover.as-sheet .pop-grip { display: block; position: absolute; top: .3rem; left: 50%; width: 2.75rem; height: .3rem; margin-left: -1.375rem;
  border-radius: 999px; background: #8889; }

@media (max-width: 1023.98px) {
  .crumb-root, .crumb-root + .crumb-sep { display: none; } /* the SAB logo links to the projects */
}
@media (max-width: 640px) {
  .app-name, .crumb-long, .app-user, .crumb-page, .crumb-switch + .crumb-sep { display: none; }
  .part-menu-text { display: none; }
  .app-crumbs { padding-left: .4rem; gap: .25rem; font-size: .85rem; }
  .crumb-menu { left: .5rem; right: .5rem; min-width: 0; }
  .crumb-switch { min-width: 6rem; }
  .top-btn { padding: 0 .55rem; }
  .app-main { padding: .75rem .6rem 2rem; }
  .mat-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mat-search { min-width: 0; }
  .act-row { grid-template-columns: 1.9rem minmax(0, 1fr) auto; grid-template-areas: "who when cab" "what what what" "kind kind kind"; }
  .act-kind { font-size: .7rem; }
  .page-title { min-width: 0; }
}

/* ===== Sprint 20: list tools (search / filter / sort), quick-switch nav ===== */
.data-table th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th[data-sort]::after { content: " ⇅"; opacity: .35; }
.data-table th[aria-sort="ascending"]::after { content: " ▲"; opacity: 1; }
.data-table th[aria-sort="descending"]::after { content: " ▼"; opacity: 1; }
.data-table tr[hidden] { display: none; }
.nowrap { white-space: nowrap; }
.pm-part-box { display: inline-block; vertical-align: top; }
.pm-part-box > summary { list-style: none; cursor: pointer; }
.pm-part-box > summary::-webkit-details-marker { display: none; }
.pm-part-box > summary::after { content: " ▾"; font-size: .75em; }
.pm-part-box[open] { flex-basis: 100%; }
.pm-part-box .mat-bmks { margin-top: .3rem; }
.pm-prev { color: #8a5a00; font-weight: 700; }
/* Project lists: table rows reuse `.mat-row` (filters) but keep the table layout, not the card grid. */
tr.mat-row { display: table-row; padding: 0; border: 0; border-radius: 0; background: none; }
tr.mat-row.qty-changed { background: #fff8dc; }

/* ===== Sprint 21: ruhige Navigation – Tab-Leiste, 1-zeilige Toolbar, Cards, Drive ===== */
.tabs { display: flex; align-items: flex-end; gap: 1rem; margin: -.5rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.page-head > .tabs { flex-basis: 100%; order: 9; margin: 0; } /* also when included inside the page head */
.tabs-list { display: flex; flex: 1; min-width: 0; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.tabs-list::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .9rem; border-bottom: 3px solid transparent;
  margin-bottom: -1px; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--navy); border-bottom-color: #c3cfdd; }
.tab[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); }
.tabs-cta { flex: none; margin-bottom: .45rem; }

.toolbar { position: sticky; top: 3.5rem; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin: 0 0 .5rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--card); }
.tb-search { flex: 1 1 12rem; min-width: 10rem; min-height: 2.75rem; }
.tb-select { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; border: 1px solid var(--line);
  border-radius: .45rem; background: #fff; }
.tb-select:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.tb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* option 1 says it */
.tb-select select { min-height: 2.6rem; max-width: 10.5rem; padding: 0 .3rem 0 .6rem; border: 0; background: transparent;
  color: var(--navy); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.tb-select select:focus { outline: none; }
.tb-end { margin-left: auto; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; background: #fff; }
.segmented a { display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0 .8rem; color: var(--navy); font-weight: 600;
  text-decoration: none; white-space: nowrap; }
.segmented a + a { border-left: 1px solid var(--line); }
.segmented a[aria-pressed="true"] { background: var(--navy); color: #fff; }
.tb-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .75rem; }
.tb-chips[hidden], .tb-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: .3rem; min-height: 2rem; padding: 0 .4rem 0 .7rem; border: 1px solid #b9d4f1;
  border-radius: 999px; background: #e3f0fd; color: var(--navy); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: #fff; font-size: .9rem; }

/* Schrank-Cards: ein Primär-Button, 3er-Link-Grid, Drive im Card-Menü */
.cabinet-card .card-head .card-menu { margin-left: auto; }
.card-foot { display: flex; flex-direction: column; gap: .5rem; margin-top: auto; padding-top: .5rem; }
.btn-block { width: 100%; min-height: 2.75rem; box-sizing: border-box; }
.card-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; }
.card-links a { display: flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: 0 .4rem; color: var(--navy);
  font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.card-links a + a { border-left: 1px solid var(--line); }
.card-links a:hover { background: #f5f8fc; }
.card-menu { position: relative; }
.card-menu > summary { list-style: none; }
.card-menu > summary::-webkit-details-marker { display: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 1px solid transparent;
  border-radius: .45rem; color: var(--muted); font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.icon-btn:hover, .card-menu[open] > .icon-btn { border-color: var(--line); background: #f5f8fc; color: var(--navy); }
.menu-body { position: absolute; right: 0; top: calc(100% + .25rem); z-index: 20; display: flex; flex-direction: column; min-width: 15rem;
  padding: .35rem; border: 1px solid var(--line); border-radius: .55rem; background: #fff; box-shadow: 0 8px 24px #1e3a5f2e; }
.menu-item { display: flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; border: 0; border-radius: .4rem; background: none;
  color: #1b2430; font: inherit; text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: #f0f4f9; }
.menu-note, .menu-body .drive-ok { padding: .55rem .75rem; color: var(--muted); font-size: .88rem; }

.drive-panel .panel-head { justify-content: flex-start; }
.drive-panel .panel-head h2 { margin: 0; }
.drive-panel .panel-actions { margin-left: auto; }
.drive-scanned { font-size: .85rem; }
.drive-empty { margin: .5rem 0 0; padding: .5rem .75rem; border-radius: .45rem; background: #f0f3f7; font-size: .88rem; }

@media (max-width: 899.98px) {
  .tab { padding: 0 .6rem; }
  .tb-search { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .toolbar { top: 3rem; }
  .tb-select { flex: 1 1 calc(50% - .5rem); }
  .tb-select select { flex: 1; max-width: none; min-width: 0; }
  .tabs { flex-wrap: wrap; }
  .tabs-cta { order: -1; width: 100%; box-sizing: border-box; }
}
/* Sprint 21: Benutzer */
.user-badge { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: 50%; background: #d8e0ea; color: #1e3a5f; font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: .45rem; min-height: 2.5rem; padding: 0 .4rem; border-radius: .4rem;
  list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: #ffffff22; }
.user-menu-list { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 13rem; margin-top: .2rem; padding: .35rem;
  border-radius: .6rem; background: #fff; box-shadow: 0 6px 22px #0005; }
.user-menu-list a, .user-menu-list button { display: flex; align-items: center; width: 100%; min-height: 2.75rem; padding: 0 .75rem;
  border: 0; border-radius: .4rem; background: none; color: #1e3a5f; font: inherit; font-size: .95rem; text-align: left;
  text-decoration: none; cursor: pointer; box-sizing: border-box; }
.user-menu-list a:hover, .user-menu-list button:hover { background: #eef1f5; }
.user-menu-list form { margin: 0; border-top: 1px solid #dde3ea; padding-top: .25rem; margin-top: .25rem; }

.login-tiles { max-width: 46rem; }
.user-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; margin: 0 0 1.5rem; }
.login .user-tile { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin: 0;
  padding: 1.1rem .5rem; border: 2px solid #dde3ea; border-radius: .9rem; background: #fff; cursor: pointer; text-align: center;
  font: inherit; touch-action: manipulation; }
.login .user-tile[aria-checked="true"] { border-color: #1e88e5; box-shadow: 0 0 0 3px #1e88e533; }
.user-tile-badge { display: inline-flex; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: #1e3a5f; color: #fff; font-size: 1.6rem; font-weight: 700; letter-spacing: .03em; }
.user-tile-name { font-size: 1.05rem; font-weight: 600; color: #1b2430; }
.pin-entry { max-width: 20rem; margin: 0 auto; }
.js-pin .pin-submit { display: none; }
.js-pin .pin-field input { font-size: 2rem; letter-spacing: .35em; text-align: center; }
.js-pin:not(.has-user) .pin-pad { opacity: .45; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.login .pin-key { min-height: 4.25rem; min-width: 4.25rem; padding: 0; border: 1px solid #dde3ea; border-radius: .8rem;
  background: #fff; color: #1e3a5f; font-size: 1.6rem; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.login .pin-key:active { background: #e8edf3; }
.login .pin-ok { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }
.notice { color: #2e7d32; }

.admin-users .users-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-users .users-table th, .admin-users .users-table td { padding: .5rem; border-bottom: 1px solid #dde3ea; text-align: left;
  vertical-align: top; }
.user-inactive td { color: #5f6b7a; }
.user-inactive .user-badge { opacity: .5; }
.user-edit > summary { cursor: pointer; color: #1e88e5; min-height: 2rem; }
.user-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: .5rem 0; }
.user-form label { display: flex; flex-direction: column; font-size: .85rem; gap: .2rem; }
.user-form input, .user-form select { min-height: 2.25rem; padding: 0 .5rem; font: inherit; }
.user-form button { min-height: 2.25rem; padding: 0 .9rem; font: inherit; cursor: pointer; }
.user-form button.danger { color: #d32f2f; }
.user-new { padding: 1rem; border-radius: .6rem; background: #fff; }
/* Sprint 21: Planstände */
.ver-section { margin-bottom: 2rem; }
.ver-section h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.ver-table-wrap { overflow-x: auto; }
.ver-title { font-weight: 600; }
.ver-note { white-space: pre-line; }
.ver-source { word-break: break-word; max-width: 18rem; }
.ver-edit summary { cursor: pointer; color: var(--navy); font-size: .85rem; margin-top: .25rem; }
.ver-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; margin-top: .5rem; }
.ver-form label, .ver-pick label, .ver-import label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
.ver-form input, .ver-form textarea, .ver-pick select, .ver-import select { font: inherit; padding: .4rem .5rem; min-height: 2.25rem; }
.ver-form-note { flex: 1 1 100%; }
.ver-form-note textarea { width: 100%; box-sizing: border-box; }
.ver-import, .ver-pick { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: 1rem 0; }
.ver-kpis { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.ver-kpi { padding: .6rem 1rem; border-radius: .6rem; border: 1px solid var(--line); background: #fff; min-width: 8rem; }
.ver-kpi strong { font-size: 1.4rem; margin-right: .25rem; }
.ver-kpi-neu strong { color: #2e7d32; }
.ver-kpi-entfallen strong { color: var(--red, #d32f2f); }
.ver-kpi-geaendert strong { color: #8a5a00; }
.ver-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; }
.ver-tab { padding: .6rem 1rem; min-height: 2.75rem; box-sizing: border-box; text-decoration: none; color: inherit;
  border-radius: .5rem .5rem 0 0; display: inline-flex; align-items: center; gap: .5rem; }
.ver-tab small { color: var(--muted); font-variant-numeric: tabular-nums; }
.ver-tab[aria-selected="true"] { background: var(--navy); color: #fff; }
.ver-tab[aria-selected="true"] small { color: #dce6f2; }
.ver-panel[hidden] { display: none; }
.ver-panel h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.ver-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.chg-badge { display: inline-block; padding: .1rem .5rem; border-radius: .35rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chg-neu td:first-child { box-shadow: inset 4px 0 #2e7d32; }
.chg-neu .chg-badge { background: #e6f4ea; color: #1b5e20; }
.chg-entfallen td:first-child { box-shadow: inset 4px 0 var(--red, #d32f2f); }
.chg-entfallen .chg-badge { background: #fdecea; color: #b71c1c; }
.chg-geaendert td:first-child { box-shadow: inset 4px 0 #f9c513; }
.chg-geaendert .chg-badge { background: #fff4d6; color: #8a5a00; }
.chg-gleich .chg-badge { background: #eceff3; color: var(--muted); }
.bmk-add { color: #1b5e20; font-weight: 600; }
.bmk-del { color: #b71c1c; text-decoration: line-through; }
.ver-sheet-actions { display: flex; gap: .5rem; align-items: center; white-space: nowrap; }
.ver-project { display: grid; gap: 1rem; }
.ver-cab { border: 1px solid var(--line); border-radius: .7rem; padding: .75rem 1rem; background: #fff; }
.ver-cab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.ver-cab-head h2 { font-size: 1.05rem; margin: 0; }
.ver-cab-list { margin: .5rem 0 0; padding-left: 1.25rem; display: grid; gap: .3rem; }
.sheet-cmp { position: relative; border: 1px solid var(--line); border-radius: .7rem; padding: .75rem; background: #f5f7fa; margin-bottom: 2rem; }
.sheet-cmp[hidden] { display: none; }
.sheet-cmp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .5rem; }
.sheet-cmp-bar .seg { margin: 0; }
.sheet-cmp-title { flex: 1 1 12rem; }
.sheet-cmp-zoom { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.sheet-cmp-opt { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.sheet-cmp-opt[hidden] { display: none; }
.sheet-cmp-panes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; isolation: isolate; }
.sheet-cmp-pane { min-width: 0; display: flex; flex-direction: column; }
.sheet-cmp-cap { font-size: .8rem; color: var(--muted); padding: .2rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-cmp-scroll { position: relative; overflow: auto; height: 70vh; background: #fff; border: 1px solid var(--line); touch-action: pan-x pan-y; }
.sheet-cmp-stage { position: relative; }
.sheet-cmp-stage canvas { display: block; width: 100%; height: 100%; }
.sheet-cmp-pane[data-missing]:not([data-missing=""]) .sheet-cmp-scroll::before { content: attr(data-missing); display: block; padding: 2rem; color: var(--muted); }
.sheet-cmp-panes[data-mode="overlay"] { grid-template-columns: 1fr; position: relative; }
.sheet-cmp-panes[data-mode="overlay"] [data-pane="b"] { position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: var(--cmp-blend, difference); opacity: var(--cmp-opacity, 1); }
.sheet-cmp-panes[data-mode="overlay"] [data-pane="b"] .sheet-cmp-cap { visibility: hidden; }
.sheet-cmp-panes[data-mode="overlay"] [data-pane="b"] .sheet-cmp-scroll { background: transparent; border-color: transparent; scrollbar-width: none; }
@media (max-width: 900px) {
  .sheet-cmp-panes[data-mode="side"] { grid-template-columns: 1fr; }
  .sheet-cmp-panes[data-mode="side"] .sheet-cmp-scroll { height: 45vh; }
}

/* ===== Sprint 22: Design-Tokens & Page-Shell (_sub_page.html) – identische Geometrie auf allen Listen-Seiten ===== */
body.app-body { --page-max: 1400px; --page-pad-x: 1rem; --page-pad-top: 1.25rem; --head-h: 2.5rem; --h1-size: 1.5rem; --h1-lh: 2rem;
  --ctl-fs: .875rem; --seg-track: #e9edf3; }
html:has(body.app-body) { scrollbar-gutter: stable; } /* a page with / without a scrollbar must not shift the container */
.app-main { max-width: var(--page-max); padding: var(--page-pad-top) var(--page-pad-x) 3rem; }
.page-head { flex-wrap: nowrap; height: var(--head-h); margin: 0 0 .75rem; gap: 1rem; }
.page-title { min-width: 0; }
.app-body h1 { min-width: 0; font-size: var(--h1-size); line-height: var(--h1-lh); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .pill-lg { flex: none; line-height: 1.5rem; padding: 0 .7rem; }
.page-head .drive-status { flex: none; flex-wrap: nowrap; }
.tabs { min-height: 3rem; margin: 0 0 1.25rem; }
.tabs-cta { margin-bottom: .25rem; }
.office-export .panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.office-export .panel-head h2 { margin: 0; }
.admin-users > h2 { margin-top: 1.5rem; }

/* Segmented controls & sub-tabs: one calm style, .875rem (Ansicht getrennt|summiert, Vergleichs-Reiter). */
.segmented, .ver-tabs { display: inline-flex; flex-wrap: nowrap; gap: 2px; max-width: 100%; padding: 3px; overflow-x: auto; border: 0;
  border-radius: .55rem; background: var(--seg-track); scrollbar-width: none; box-sizing: border-box; }
.ver-tabs { display: flex; width: max-content; margin-bottom: 1rem; }
.segmented a, .ver-tab { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.25rem; padding: 0 .85rem; border: 0;
  border-radius: .4rem; background: none; color: var(--muted); font-size: var(--ctl-fs); font-weight: 600; text-decoration: none; white-space: nowrap; }
.segmented a + a { border-left: 0; }
.segmented a:hover, .ver-tab:hover { color: var(--navy); }
.segmented a[aria-pressed="true"], .ver-tab[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px #1e3a5f33; }
.ver-tab small, .ver-tab[aria-selected="true"] small { color: var(--muted); font-size: .75rem; font-weight: 500; }

/* Workspace: the same avatar menu as the app header (Sprint 22). */
.ws-top > .user-menu { flex: 0 0 auto; }
.ws-top .user-menu-list { z-index: 45; }
@media (max-width: 1279.98px) { .ws-top .app-user { display: none; } }

/* ===== Sprint 22: ruhiges Verbindungs-Panel – Segmented-Kopf, dichte Tabellen-Zeilen =====
   Columns (subgrid, aligned over all rows): gutter [Ende 1 ✓] [Ende 1] [Ader] [Ende 2] [Ende 2 ✓] [✓✓ / Kürzel] gutter
   (gutter columns instead of row padding: a subgrid's padding is not added to the parent tracks).
   Narrow panel: the wire badges get the second line under the ends (every row the same height);
   ≥ 36rem: one line per connection. */
@media (min-width: 960px) { .workspace { grid-template-columns: minmax(0, 3fr) minmax(20rem, 1fr); } } /* < 960: drawer */
#conn-list { container-type: inline-size; }
.conn-tools { flex-wrap: nowrap; justify-content: flex-start; gap: .35rem; padding: .4rem .5rem; font-size: .8125rem; }
.conn-seg { display: inline-flex; flex: none; gap: 2px; margin-right: auto; padding: 2px; border-radius: .5rem; background: #e9edf3; }
.conn-seg button, .conn-toggle-btn { position: relative; min-height: 2rem; padding: 0 .6rem; border: 0; border-radius: .375rem; background: none;
  color: #5f6b7a; font: inherit; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; }
.conn-seg button[aria-pressed="true"] { background: #fff; color: #1e3a5f; box-shadow: 0 1px 2px #1e3a5f33; }
.conn-toggle-btn { flex: none; padding: 0 .5rem; border: 1px solid #d5dce5; }
.conn-toggle-btn[aria-pressed="true"] { border-color: #1e3a5f; background: #1e3a5f12; color: #1e3a5f; }
.conn-pot-toggle[aria-pressed="true"] { border-color: #00a5bf; background: #00b8d41a; color: #00708a; }
@container (max-width: 23rem) { .conn-pot-label { display: none; } }

.conn-list { display: grid; grid-template-columns: 0 2.5rem minmax(0, auto) minmax(0, 1fr) minmax(0, auto) 2.5rem 2.25rem 0; column-gap: .25rem; }
.conn-list > li { grid-column: 1 / -1; }
.conn-list > .conn { grid-template-columns: subgrid; align-items: center; row-gap: 1px; min-height: 0; padding: .25rem 0;
  border: 0; border-bottom: 1px solid #e6eaf0; background: #fff; color: #1b2430; box-shadow: inset 3px 0 var(--row-accent, transparent); }
.conn-list > .conn > .conn-line { display: contents; }
.conn-list .conn-ends { grid-column: 3 / 6; grid-row: 1; display: grid; grid-template-columns: subgrid; min-width: 0;
  font-size: .875rem; font-weight: 600; line-height: 1.25rem; overflow-wrap: normal; }
.conn-list .conn-ends > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-list .conn-ends > .conn-src, .conn-list .conn-ends > .conn-own { grid-column: 1; }
.conn-list .conn-ends > .conn-sep { display: none; }
.conn-list .conn-ends > .conn-dst { grid-column: 3; }
.conn-list .conn-attrs { grid-column: 3 / 6; grid-row: 2; display: flex; flex-wrap: nowrap; align-items: center; gap: .2rem;
  min-width: 0; min-height: 1.125rem; overflow: hidden; font-size: .72rem; opacity: 1; }
.conn-list .conn-attrs > * { flex: none; }
.conn-list .conn-pill { gap: .2rem; padding: 0 .25rem; border: 0; border-radius: .25rem; background: #f1f4f8; color: #334155;
  font-size: .7rem; line-height: 1.125rem; }
/* too little room: type, then cross section give way (ellipsis) – the „→ Bl.“ jump stays whole */
.conn-list .conn-pill.conn-type, .conn-list .conn-pill.conn-xs { display: block; min-width: 1.5rem; overflow: hidden; text-overflow: ellipsis; }
.conn-list .conn-pill.conn-type { flex: 0 3 auto; }
.conn-list .conn-pill.conn-xs { flex: 0 1 auto; }
.conn-list .wc-dot { width: .625rem; height: .625rem; }
.conn-list .conn-kind { color: #64748b; font-size: .7rem; }
.conn-list button.conn-other { position: relative; min-height: 1.125rem; padding: 0 .3rem; border: 0; border-radius: .25rem;
  background: #e0ecfb; color: #1d4ed8; font-size: .7rem; line-height: 1.125rem; }
.conn-list .conn > .conn-delta, .conn-list .conn > .conn-alert, .conn-list .conn > .conn-status, .conn-list .conn > .conn-actions { grid-column: 2 / -2; }
.conn-list .conn > .conn-status { justify-content: flex-start; text-align: left; }
.conn-list .conn-actions .conn-act { min-height: 2.25rem; font-size: .8125rem; }

/* End checkboxes: the 40 px button is the touch area, the visible 26 px box is drawn inside (nothing overflows). */
.conn-list .end-check, .conn-list .end-check[aria-pressed="true"] { position: relative; grid-row: 1 / span 2; justify-self: center; width: 2.5rem; height: 2.5rem;
  padding: 0; border: 0; background: none; color: #fff; font-size: .95rem; }
.conn-list .end-check::before { content: ""; position: absolute; inset: .4375rem; display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; border: 1.5px solid #94a3b8; border-radius: .375rem; background: #fff; }
.conn-list .end-check[data-end="source"], .conn-list .conn.ends-swapped .end-check[data-end="target"] { grid-column: 2; }
.conn-list .end-check[data-end="target"], .conn-list .conn.ends-swapped .end-check[data-end="source"] { grid-column: 6; }
.conn-list .end-check[aria-pressed="true"]::before { content: "✓"; border-color: #059669; background: #059669; }

/* ✓✓ quick button / done badge on a fixed 36 px slot (36 × 36 touch area). */
.conn-list .conn-act.conn-toggle { position: relative; grid-column: 7; grid-row: 1 / span 2; display: inline-flex; align-items: center;
  justify-content: center; width: 2.25rem; height: 2.25rem; min-width: 0; min-height: 0; padding: 0; border: 1px solid #cbd5e1;
  border-radius: .375rem; background: #fff; color: #475569; font-size: .8rem; font-weight: 800; line-height: 1; }
.conn-list .conn-toggle .conn-label { display: none; }
.conn-list .conn-toggle[data-next="wired"] .conn-status { display: none; }
.conn-list .conn-toggle[data-next="wired"]::before { content: "✓✓"; letter-spacing: -.12em; }
.conn-list .conn.one-side .conn-toggle { border-color: #93c5fd; color: #2563eb; }
.conn-list .conn-act.conn-toggle[data-next="open"] { border-color: #6ee7b7; background: #d1fae5; color: #065f46; }
.conn-list .conn-toggle[data-next="open"] .conn-by { width: auto; height: auto; background: none; font-size: .72rem; line-height: 1; }
.conn-list .conn-toggle[data-next="open"]:has(.conn-by:empty)::before { content: "✓✓"; letter-spacing: -.12em; }
.conn-list .conn-toggle[data-next="open"] .conn-by:empty { display: none; }

/* Row states: done = soft mint, one end = soft blue (dark, readable text). */
.conn-list .conn.st-wired { --row-accent: #059669; background: #ecfdf5; }
.conn-list .conn.one-side { --row-accent: #3b82f6; background: #eff6ff; }
.conn-list .conn.st-wired .conn-pill, .conn-list .conn.one-side .conn-pill { background: #ffffffb3; }
.conn-list .conn.st-modified_in_cad { --row-accent: #f9c513; background: #fffbeb; }
.conn-list .conn.st-removed_after_wired { --row-accent: #d32f2f; background: #fef2f2; }
.conn-list .conn.conn-selected { --row-accent: #ff6d00; background-color: #fff7ed; box-shadow: inset 4px 0 var(--row-accent); }
.conn-list .conn.conn-selected.st-wired { background-color: #ecfdf5; }
.conn-list .conn.conn-selected.one-side { background-color: #eff6ff; }
.conn-list .conn-group { padding: .2rem .5rem; background: #f1f4f8; color: #5f6b7a; font-size: .7rem; }

@container (min-width: 36rem) {
  .conn-list .end-check, .conn-list .conn-act.conn-toggle { grid-row: 1; }
  .conn-list .conn-attrs { grid-column: 4; grid-row: 1; min-height: 0; }
  .conn-list > .conn { padding-block: 0; }
}

/* Selected part: one flat bar – label + ✕, text · maker · Datenblatt ↗, view / sort pills. */
.conn-bmk-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem .5rem; padding: .3rem .5rem .4rem;
  border-bottom: 1px solid #fed7aa; background: #fff7ed; color: #1b2430; font-size: .8125rem; }
.conn-filter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9a3412; }
.conn-filter-clear { position: relative; width: 2rem; height: 2rem; min-height: 0; padding: 0; border: 0; border-radius: .375rem;
  background: none; color: #9a3412; font-size: 1rem; line-height: 1; }
.conn-filter-clear::after { content: ""; position: absolute; inset: -.25rem; }
.conn-filter-clear:hover { background: #ffedd5; }
.conn-bmk-filter > .part-card { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: .4rem; min-width: 0; padding: 0;
  border: 0; background: none; font-size: .8125rem; }
.conn-bmk-filter .part-card .part-bmk, .conn-bmk-filter .part-datasheet .part-icon, .conn-bmk-filter .part-ds-src { display: none; }
.conn-bmk-filter .part-card .part-text, .conn-bmk-filter .part-card .part-maker { display: block; flex: 0 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
.conn-bmk-filter .part-card .part-text { flex: 0 1 auto; }
.conn-bmk-filter .part-card .part-maker { flex: 0 1 auto; min-width: 3.5rem; max-width: 45%; color: #5f6b7a; font-size: .75rem; opacity: 1; }
.conn-bmk-filter .part-card .part-maker::before { content: "· "; }
.conn-bmk-filter .part-acts { flex: none; flex-wrap: nowrap; gap: .15rem; margin-left: auto; }
.conn-bmk-filter .part-datasheet, .conn-bmk-filter .part-ansicht { min-height: 2rem; min-width: 0; padding: 0 .35rem; border: 0;
  border-radius: .375rem; font-size: .78rem; white-space: nowrap; }
.conn-bmk-filter .part-datasheet::after { content: " ↗"; white-space: pre; }
.conn-bmk-filter .part-ansicht { font-size: 0; }
.conn-bmk-filter .part-ansicht .part-icon { margin: 0; }
.conn-bmk-filter .part-tools { grid-column: 1 / -1; gap: .25rem; min-width: 0; }
.conn-bmk-filter .part-pills { flex-wrap: nowrap; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.conn-bmk-filter .part-pills-label { flex: none; width: 4.75rem; margin: 0; color: #5f6b7a; font-size: .72rem; opacity: 1; }
.conn-bmk-filter .part-pill { flex: none; min-height: 1.875rem; padding: 0 .55rem; border: 0; border-radius: .375rem; background: #fde8d4;
  color: #7c2d12; font-size: .75rem; }
.conn-bmk-filter .part-pill:first-of-type { border-radius: .375rem 0 0 .375rem; }
.conn-bmk-filter .part-pill:last-of-type { border-radius: 0 .375rem .375rem 0; }
.conn-bmk-filter .part-pill[aria-pressed="true"] { background: #fff; color: #9a3412; font-weight: 700; box-shadow: inset 0 0 0 1.5px #ea580c; }

/* Sprint 24: Admin › System & Google Drive, Ersteinrichtung */
.pill-ok { background: #dcfce7; color: #166534; }
.settings-dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .75rem 0; }
.settings-dl dt { color: var(--muted); font-size: .88rem; }
.settings-dl dd { margin: 0; overflow-wrap: anywhere; }
.settings-form { display: flex; flex-direction: column; gap: .75rem; }
.settings-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; }
.settings-form input, .settings-form textarea { padding: .5rem; font: inherit; }
.settings-form textarea { font-family: ui-monospace, monospace; font-size: .8rem; }
.settings-form button { align-self: flex-start; }
.settings-danger { margin-top: 1rem; }
.settings-danger summary { cursor: pointer; color: #b00020; }
.setup { max-width: 26rem; }
