:root {
  --bg: #08090c;
  --panel: #111318;
  --panel-2: #171a21;
  --line: #242833;
  --text: #e7e9ee;
  --muted: #8a91a0;
  --accent: #ffb020;      /* Pult-Bernstein */
  --ok: #3ddc84;
  --warn: #ffb020;
  --bad: #ff5a5f;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 var(--font);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
h2 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin: 0; color: var(--muted); }
button, select, input { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- Kopfzeile */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px; min-height: 52px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: .01em; }
.brand-mark {
  width: 24px; height: 24px; flex: none;
  background: url("marke/droplit-symbol.svg") center / contain no-repeat;   /* Droplit Cue Pad, marke/baue_logo.py */
}
.brand-word { display: block; height: 18px; width: auto; }
.field { display: flex; align-items: center; gap: 8px; }
.field-label { color: var(--muted); font-size: 12px; }
select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; min-height: 34px; max-width: 280px;
}
.field-slider input { width: 110px; accent-color: var(--accent); }
.spacer { flex: 1; }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg-btn {
  border: 0; background: transparent; padding: 6px 11px; border-radius: 6px; cursor: pointer;
  color: var(--muted); min-height: 30px;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-on { background: #262a35; color: var(--text); box-shadow: inset 0 0 0 1px #343a48; }
.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; min-height: 34px; cursor: pointer;
}
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.topbar .opt-btn { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.topbar .opt-btn:hover { color: var(--text); }
.topbar .opt-btn[hidden] { display: none; }
.icon-btn { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.icon-btn:hover { color: var(--text); }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2);
  font-size: 12px; white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status[data-state="ok"] .status-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status[data-state="wait"] .status-dot { background: var(--warn); }
.status[data-state="bad"] .status-dot { background: var(--bad); }
.status[data-state="test"] .status-dot { background: #a259ff; }

/* ---------------------------------------------------------------- Layout */
.layout { display: grid; grid-template-columns: 340px 1fr auto; min-height: 0; }
.panel { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.inspector { width: 340px; border-right: 0; border-left: 1px solid var(--line); }
.inspector[hidden] { display: none; }

.viewport { position: relative; min-width: 0; min-height: 0; background: #000; }
#stage { width: 100%; height: 100%; display: block; }
.hint {
  position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: rgba(231, 233, 238, .45);
  pointer-events: none;
}
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  background: rgba(8, 9, 12, .82); text-align: center;
}
.overlay[hidden] { display: none; }
.overlay .box { max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; text-align: left; }
.overlay h3 { margin: 0 0 8px; font-size: 16px; }
.overlay ol { padding-left: 20px; margin: 10px 0; }
.overlay li { margin: 4px 0; }

/* ---------------------------------------------------------------- Geräteliste */
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.fixture-list { padding: 2px 0 16px; }
.group-title { padding: 12px 14px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.group-title button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; }
.fx {
  display: flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 5px 10px 5px 14px; cursor: pointer; border-left: 2px solid transparent;
}
.fx-name { flex: 1; min-width: 0; }
.fx:hover { background: var(--panel-2); }
.fx.is-sel { background: #1c2029; border-left-color: var(--accent); }
.fx.is-hidden .fx-name, .fx.is-hidden .fx-addr { opacity: .4; }
.fx-swatch { width: 12px; height: 12px; border-radius: 3px; background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.fx-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-addr { font: 11px var(--mono); color: var(--muted); flex: none; }
.fx-swatch { flex: none; }
.fx-eye { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px 4px; font-size: 13px; }
.fx-eye:hover { color: var(--text); }

/* ---------------------------------------------------------------- Inspector */
.insp-body { overflow-y: auto; padding: 12px 14px 20px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.kv select { width: 100%; max-width: 100%; }
.cell { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel-2); }
.cell-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.cell-swatch { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.ch { display: grid; grid-template-columns: 44px 1fr 46px; gap: 2px 8px; align-items: center; font-size: 12px; padding: 2px 0; }
.ch-addr { font: 11px var(--mono); color: var(--muted); }
.ch-bar { height: 6px; border-radius: 3px; background: #262a35; overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--accent); }
.ch-val { font: 11px var(--mono); text-align: right; }
.ch-name { grid-column: 1 / 4; grid-row: 1; color: var(--muted); font-size: 11px; margin-top: 4px; }
.ch-addr, .ch-bar, .ch-val { grid-row: 2; }
.decoded { font-size: 12px; color: var(--text); margin: 4px 0 6px; }

/* ---------------------------------------------------------------- DMX */
.dmx { background: var(--panel); border-top: 1px solid var(--line); max-height: 34vh; display: flex; flex-direction: column; }
.dmx[hidden] { display: none; }
.dmx-head { display: flex; align-items: center; gap: 14px; padding: 8px 14px; }
.dmx-grid {
  display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 2px;
  padding: 0 14px 12px; overflow-y: auto;
}
.dmx-c {
  font: 9px/1 var(--mono); text-align: center; padding: 4px 0; border-radius: 3px;
  background: #1a1d25; color: var(--muted); position: relative;
}
.dmx-c.is-patched { box-shadow: inset 0 -2px 0 rgba(255, 176, 32, .35); }
.dmx-c.is-sel { box-shadow: inset 0 0 0 1px var(--accent); color: var(--text); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 1fr 40vh; }
  .side { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .inspector { position: fixed; right: 0; top: 52px; bottom: 0; width: min(340px, 92vw); z-index: 5; }
  .dmx-grid { grid-template-columns: repeat(16, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- Übersicht (2D) */
.plan {
  position: absolute; inset: 0; overflow-y: auto; background: var(--bg);
  padding: 16px; display: grid; gap: 12px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.plan[hidden] { display: none; }
.plan-group { grid-column: 1 / -1; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.pcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; min-width: 0;
}
.pcard:hover { border-color: #3a4050; }
.pcard.is-sel { border-color: var(--accent); }
.pcard-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pcard-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-addr { font: 11px var(--mono); color: var(--muted); flex: none; }
.ptiles { display: flex; gap: 4px; min-height: 56px; }
.ptiles.is-column { flex-direction: column-reverse; min-height: 0; }
.ptiles.is-column .ptile { height: 9px; flex: none; border-radius: 2px; }
.ptile {
  flex: 1 1 0; min-width: 0; border-radius: 6px; background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: background-color 40ms linear;
}
.pcard-info { font-size: 11px; color: var(--muted); min-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- Aufbauten & Bearbeiten */
.setup-bar { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.setup-label { color: var(--muted); font-size: 12px; }
.setup-bar select { max-width: none; width: 100%; }
.setup-actions { grid-column: 1 / -1; display: flex; gap: 14px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--muted); cursor: pointer; font-size: 12px; min-height: 28px; }
.link-btn:hover { color: var(--accent); }
.edit-tools { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.edit-tools[hidden] { display: none; }
.add-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 14px 10px; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer; font-size: 12px; min-height: 32px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.obj-icon { color: var(--muted); font-size: 11px; }
body.is-edit #toggle-edit { border-color: var(--accent); color: var(--accent); }
body.is-edit .viewport { box-shadow: inset 0 0 0 2px rgba(255, 176, 32, .55); }
.slider-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 12px; }
.slider-row select { grid-column: 2 / 4; max-width: none; width: 100%; }
.seg-wide > .seg { grid-column: 2 / 4; justify-self: start; }
.seg-wide .seg-btn { white-space: nowrap; padding: 6px 9px; }
.slider-label { color: var(--muted); }
.slider-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.slider-val { font: 11px var(--mono); min-width: 58px; text-align: right; }
.small { font-size: 11px; line-height: 1.45; margin: 8px 0; }
.place .btn { margin-top: 6px; width: 100%; }
.btn-danger { margin-top: 12px; width: 100%; border-color: rgba(255, 90, 95, .5); color: var(--bad); }
.chip:disabled { opacity: .4; cursor: default; border-color: var(--line); color: inherit; }
#record[aria-pressed="true"] { border-color: var(--bad); color: var(--bad); }
#record[aria-pressed="true"]::after { content: attr(data-time); margin-left: 6px; font: 11px var(--mono); }

/* Kopien mit gleicher Adresse */
.fx.is-clone { padding-left: 34px; }
.fx.is-clone .fx-name { color: var(--muted); }
.clone-row { display: grid; grid-template-columns: 92px 40px 1fr 40px; gap: 8px; align-items: center; margin: 8px 0; font-size: 12px; }
.clone-row .btn { padding: 0; font-size: 18px; min-height: 40px; }
.clone-num { min-height: 40px; text-align: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; font-size: 15px; }
/* Duplizieren: Anzahl × Knopf, darunter „spiegelbildlich“; Knopf auch oben im Eigenschaften-Feld */
.dup-row { display: grid; grid-template-columns: 64px auto 1fr; gap: 8px; align-items: center; margin: 4px 0 8px; }
.dup-row .btn { min-height: 40px; }
.dup-mirror { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 12px; cursor: pointer; }
.dup-mirror input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.panel-head .insp-dup { margin-left: auto; min-height: 32px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.panel-head .insp-dup:hover { border-color: var(--accent); color: var(--accent); }
.insp-dup[hidden] { display: none; }
.panel-head:has(.insp-dup:not([hidden])) h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Anordnen */
.arrange-row { align-items: center; }
.arrange-row .chip:disabled { opacity: .45; cursor: default; }
.arrange-row .chip.is-on { border-color: var(--accent); color: var(--accent); }
.arr-num { width: 56px; min-height: 34px; font-size: 13px; }
/* Ausrichten: Beschriftung der Lichtkreise über der 3D-Ansicht */
.focus-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.focus-label { position: absolute; transform: translate(-50%, -150%); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: rgba(17, 19, 24, .88); border: 1px solid #5a4415; color: #ffd27a; font-size: 12px; font-variant-numeric: tabular-nums; }
/* Traglast der Stative */
.load-box { margin: 12px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.load-dev { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; font-size: 12.5px; }
.load-dev .clone-num { width: 76px; min-height: 32px; font-size: 13px; }
.pos-box { display: grid; gap: 6px; padding: 10px 0 4px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.pos-head { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pos-num { width: 100%; min-height: 36px; }
.tilt-box { display: grid; gap: 2px; margin: 8px 0 4px; padding: 10px 0 4px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.tilt-box > .muted.small { margin: -4px 0 4px; }
.angle-row { grid-template-columns: 92px 1fr 64px auto; margin: 6px 0 4px; }
.angle-row .slider-val { min-width: 0; }
.tilt-info { color: var(--text); font-weight: 500; }
.mount-row { grid-template-columns: 1fr; gap: 6px; }
.mount-row .seg { display: flex; }
.mount-row .seg-btn { flex: 1 1 0; min-width: 0; }
/* Mehrfachauswahl: Abschnitte im Kasten „Für alle ausgewählten“, gemischte Werte gestrichelt */
.multi-sec { display: grid; gap: 2px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.multi-sec > .btn { margin-top: 4px; }
.multi-sec .tilt-box { border-bottom: 0; margin-bottom: 0; }
.mixed-tag { display: inline-block; padding: 0 6px; border: 1px dashed var(--muted); border-radius: 999px; color: var(--muted); font-size: 10.5px; font-weight: 400; line-height: 16px; white-space: nowrap; }
.chip.is-mixed { border-style: dashed; border-color: var(--accent); }
input[type="range"].is-mixed { opacity: .45; }
.shift-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: -2px 0 2px; }
.shift-btns .chip { min-height: 34px; padding: 4px 6px; font-size: 12px; white-space: nowrap; }
.multi-note { margin: 12px 0 0; }
.load-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.load-bar i { display: block; height: 100%; background: var(--ok); }
.load-bar.warn i { background: var(--warn); }
.load-bar.bad i { background: var(--bad); }
.load-msg { margin: 4px 0 0; font-size: 12.5px; }
.load-msg.ok { color: #9fe9bf; }
.load-msg.warn { color: #ffd27a; }
.load-msg.bad { color: #ffb0b2; }
/* Traglast der Traversen: ein Block je Feld bzw. Kurbelstativ */
.load-hint { margin: 2px 0 8px; font-size: 12.5px; color: #ffd27a; }
.load-field { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.load-field strong { font-weight: 600; }
.load-msg.none { color: var(--muted); }
.load-calc { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.load-devs { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--line); }
.load-devs summary { cursor: pointer; color: var(--accent); font-size: 12.5px; padding: 8px 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; text-decoration: underline; }

/* Presets (Speicherplätze je Benutzer) */
.preset-bar { display: grid; gap: 8px; padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
.preset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preset-user { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.preset-user select { min-height: 30px; max-width: 150px; }
.preset-select { width: 100%; max-width: none; min-height: 44px; font-size: 14px; }
.preset-state { font-size: 12px; color: var(--muted); min-height: 16px; }
.preset-state.is-dirty { color: var(--accent); }
.preset-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.preset-actions .btn { min-height: 40px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #16181d; font-weight: 600; }
.btn-accent:disabled { background: var(--panel-2); border-color: var(--line); color: var(--muted); font-weight: 400; cursor: default; }

/* Geräteprofile (Bibliothek + Prompt) */
.dlg { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); padding: 18px 20px; }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.lib-top { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: stretch; margin: 12px 0; }
.lib-top .btn { min-height: 48px; }
.lib-drop { display: grid; place-content: center; gap: 4px; text-align: center; min-height: 72px; padding: 10px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 10px; }
.lib-drop.is-over, .lib-drop:hover { border-color: var(--accent); }
.lib-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: var(--panel-2); display: grid; gap: 8px; }
.lib-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.lib-gobos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lib-gobos img { width: 44px; height: 44px; border-radius: 50%; background: #000; border: 1px solid var(--line); object-fit: cover; }
.lib-gobos img.inv { filter: invert(1); }
.lib-color { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); }
.lib-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.lib-actions select { min-height: 36px; }
.lib-err { color: #ff8a80; margin: 0; }
.lib-warn { color: var(--accent); margin: 0; }
.lib-ok { color: var(--ok); }
.small { font-size: 12px; }
.prompt-steps { margin: 8px 0; padding-left: 20px; color: var(--muted); }
#prompt-text { width: 100%; height: min(52vh, 460px); resize: vertical; font: 12px/1.45 var(--mono); background: #0d0f13; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.profile-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.lib-db { margin: 14px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.lib-db h3 { margin: 0 0 4px; font-size: 14px; }
.lib-db .small { margin: 4px 0 8px; }
.lib-db-q { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; }
.lib-db-q:focus { outline: none; border-color: var(--accent); }
.lib-db-results { display: grid; gap: 6px; margin-top: 8px; max-height: 320px; overflow: auto; }
.lib-db-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); text-align: left; color: var(--text); font: inherit; cursor: pointer; width: 100%; }
.lib-db-row:hover, .lib-db-row:focus-visible { border-color: var(--accent); outline: none; }
.lib-db-row .grow { flex: 1 1 220px; min-width: 0; }
.lib-db-dev { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.lib-db-dev:first-child { border-top: 0; }
.lib-tag { display: inline-block; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.lib-tag.ok { border-color: var(--ok); color: var(--ok); }
.lib-tag.warn { border-color: var(--accent); color: var(--accent); }
@media (max-width: 600px) { .lib-top { grid-template-columns: 1fr; } }

/* Eingebettet im Show-Designer (index.html?embed=1): nur die 3D-Bühne */
body.embed { grid-template-rows: 1fr; }
body.embed .topbar, body.embed .side, body.embed .inspector, body.embed .dmx { display: none !important; }
body.embed .layout { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; height: 100vh; }
body.embed .hint { display: none; }

/* Eingebettet im Show-Designer: Werkzeugleiste zum Verschieben direkt in der Vorschau */
.embed-tools { display: none; }
body.embed.is-edit .embed-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: absolute; left: 12px; right: 12px; top: 12px;
  padding: 8px 10px; border-radius: 10px; background: rgba(17, 19, 24, .92); border: 1px solid var(--line); z-index: 5;
  font-size: 13px; color: var(--text);
}
body.embed.is-edit .embed-tools > span { color: var(--muted); flex: 1; min-width: 160px; }
/* Im Show-Designer als „Geräte & Bühne“: Projekt und Quelle bestimmt der Designer */
body.app-mode .topbar .brand, body.app-mode .topbar label.field:has(#project), body.app-mode .topbar .seg:has(#src-live),
body.app-mode .topbar a[href="designer.html"], body.app-mode .topbar a[href="generator.html"] { display: none !important; }

/* Sprache: Seite erst zeigen, wenn die Übersetzung steht (i18n.js entfernt die Klasse; Notbremse nach 2,5 s) */
html.i18n-wait body { visibility: hidden; animation: i18n-show 0s 2.5s forwards; }
@keyframes i18n-show { to { visibility: visible; } }

/* ---------------------------------------------------------------- Aufbau-Modus */
.edit-intro { margin: 0; padding: 12px 14px 4px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sect { border-bottom: 1px solid var(--line); }
.sect-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 14px; background: none; border: 0;
  cursor: pointer; text-align: left; color: var(--text); }
.sect-head:hover { background: var(--panel-2); }
.sect-title { font-weight: 650; font-size: 13.5px; flex: 1; }
.sect-head .small { margin: 0; }
.sect.is-collapsed .sect-body { display: none; }
.sect-body { padding: 0 0 10px; }
.sect-note { padding: 0 14px; margin: 2px 0 0; }
.chev { width: 14px; height: 14px; flex: none; display: inline-grid; place-items: center; color: var(--muted); transition: transform .15s ease; }
.chev::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); }
[aria-expanded="false"] > .chev { transform: rotate(-90deg); }
.sub-title { padding: 10px 14px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Objekt-Katalog: Suche + Gruppen mit Bausteinen zum Hineinziehen */
.cat-search { display: block; width: calc(100% - 28px); margin: 2px 14px 6px; min-height: 36px; padding: 6px 11px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: 13px var(--font); }
.cat-search:focus { outline: none; border-color: var(--accent); }
.cat-grp + .cat-grp { margin-top: 2px; }
.cat-head { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 34px; padding: 4px 14px; background: none; border: 0;
  cursor: pointer; text-align: left; color: var(--muted); font: 600 11px var(--font); letter-spacing: .06em; text-transform: uppercase; }
.cat-head:hover { color: var(--text); }
.cat-name { flex: 1; }
.cat-head .grp-count { letter-spacing: 0; }
.cat-grp .palette { padding-bottom: 6px; }
.cat-empty { padding: 4px 14px; margin: 0; }
.furn-info { margin: 8px 0 0; }
/* Raum: Farbfelder */
.room-box { padding: 0 14px; }
.room-box .cell + .cell { margin-top: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatch:hover { border-color: #5b6170; }
.swatch.is-on, .swatch-pick.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 176, 32, .3); }
.swatch-pick { width: 40px; height: 32px; padding: 2px; border: 2px solid var(--line); border-radius: 9px; background: var(--panel-2); cursor: pointer; }
.palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 2px 14px 0; }
.palette[hidden] { display: none; }
.tile { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 62px; padding: 7px 3px; cursor: grab;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 11px; line-height: 1.2; text-align: center; }
.tile:hover { border-color: var(--accent); }
.tile:hover .tile-icon { color: var(--accent); }
.tile:active { cursor: grabbing; }
.tile-icon { display: inline-grid; place-items: center; color: #c9ced8; }
.tile-name { overflow-wrap: break-word; hyphens: auto; font-size: 10.5px; }
.sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 14px; }
.set-btn { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; cursor: pointer; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 12px; line-height: 1.25; }
.set-btn .tile-icon { flex: none; }
.set-btn:hover { border-color: var(--accent); }
.set-btn:hover .tile-icon { color: var(--accent); }
.drag-ghost { position: fixed; top: -200px; left: -200px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #16181d;
  font: 600 12.5px var(--font); white-space: nowrap; }

/* Geräteliste in Gruppen */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 6px; }
.list-head .seg-btn { font-size: 12px; padding: 5px 10px; white-space: nowrap; }
.list-head .link-btn { white-space: nowrap; }
.grp { border-top: 1px solid rgba(36, 40, 51, .7); }
.grp-head { display: flex; align-items: center; gap: 2px; padding-right: 6px; min-height: 40px; border-left: 2px solid transparent; }
.grp-head.is-sel { background: #1c2029; border-left-color: var(--accent); }
.grp-head[draggable="true"] .grp-toggle { cursor: grab; }
.grp-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 6px 4px 12px;
  background: none; border: 0; cursor: pointer; color: var(--text); text-align: left; }
.grp-toggle:hover .grp-name { color: var(--accent); }
.grp-icon { flex: none; display: inline-grid; place-items: center; color: #aab0bd; }
.grp-icon svg, .obj-icon svg { width: 18px; height: 18px; }
.grp-name { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-count { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #232733; color: var(--muted); font: 11px var(--mono); text-align: center; }
.grp-act { flex: none; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11.5px; padding: 6px; border-radius: 6px; }
.grp-act:hover { color: var(--accent); background: var(--panel-2); }
.grp-body { padding-bottom: 4px; }
.grp-body .fx { padding-left: 36px; }
.grp-body .fx.is-clone { padding-left: 52px; }
.grp-body .obj-row { padding-left: 34px; }
.grp-empty { margin: 0; padding: 4px 14px 10px 36px; font-size: 12px; color: var(--muted); }
.is-drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: rgba(255, 176, 32, .08) !important; }
.fx-where { flex: none; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; padding: 1px 7px;
  border-radius: 999px; border: 1px solid #343a48; color: #c3c8d2; }
.fx-where.is-free { border-style: dashed; color: var(--muted); }
body.is-edit .fx[draggable="true"] { cursor: grab; }
.obj-icon { flex: none; display: inline-grid; place-items: center; color: #aab0bd; }

/* Werkzeugleiste über der 3D-Ansicht */
.edit-bar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px; border-radius: 12px; background: rgba(17, 19, 24, .9); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.edit-bar[hidden] { display: none; }
.edit-bar { gap: 6px; padding: 6px; font-size: 12.5px; }
.edit-bar .seg-btn { min-height: 34px; padding: 6px 8px; }
.edit-bar .chip { min-height: 34px; }
.edit-bar .eb-done { margin-left: auto; }
/* Schmale 3D-Fläche (Tablet, Eigenschaften offen): eine Zeile, seitlich scrollbar, „Fertig“ bleibt rechts stehen */
.viewport { container-type: inline-size; }
@container (max-width: 720px) {
  .edit-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .edit-bar::-webkit-scrollbar { display: none; }
  .edit-bar > * { flex: none; }
  .edit-bar .eb-done { position: sticky; right: 0; box-shadow: -10px 0 12px rgba(17, 19, 24, .95); }
  /* Symbol-Knöpfe (Drehgriff, Teststrahl) nur mit Symbol – der Text bleibt für Screenreader und im Tooltip */
  .edit-bar .chip.with-icon { padding-inline: 9px; }
  .edit-bar .chip.with-icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.chip.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.icon-chip { display: inline-grid; place-items: center; }
.edit-bar .btn { min-height: 38px; padding: 6px 16px; }
.chip.is-on { border-color: var(--accent); color: var(--accent); }
.icon-chip { min-width: 38px; min-height: 34px; padding: 4px 9px; }
.edit-msg { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 4; max-width: min(560px, calc(100% - 24px));
  padding: 8px 14px; border-radius: 999px; background: rgba(17, 19, 24, .94); border: 1px solid #5a4415; color: #ffd27a;
  font-size: 13px; text-align: center; pointer-events: none; }
.edit-msg[hidden] { display: none; }
body.is-edit .hint { color: rgba(231, 233, 238, .7); }

/* Namen über Geräten und Objekten */
.scene-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-label { position: absolute; left: 0; top: 0; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 7px; border-radius: 6px; background: rgba(17, 19, 24, .78); border: 1px solid #343a48; color: #dfe3ea; font-size: 11px; }
.scene-label.is-obj { background: rgba(42, 33, 16, .85); border-color: #5a4415; color: #ffd27a; font-weight: 600; }
.scene-label.is-sel { border-color: var(--accent); color: #fff; z-index: 1; }

/* Eigenschaften im Aufbau-Modus */
.insp-lead { margin: 0 0 10px; font-size: 12.5px; color: var(--text); }
.dev-box .btn { width: 100%; margin-top: 6px; min-height: 38px; }
.dev-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; border-bottom: 1px solid rgba(36, 40, 51, .7); }
.dev-name { font-size: 12.5px; text-decoration: none; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-name:hover { color: var(--accent); }
.dev-x { font-size: 18px; padding: 2px 8px; }
.dev-x:hover { color: var(--bad); }
.pick-list { margin-top: 8px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pick-list[hidden] { display: none; }
.pick-group { padding: 8px 10px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pick-row { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 3px 10px; cursor: pointer; font-size: 12.5px; }
.pick-row:hover { background: var(--panel-2); }
.pick-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.pick-row.is-hidden .pick-name { opacity: .5; }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-actions { position: sticky; bottom: 0; padding: 8px 10px; background: var(--panel); border-top: 1px solid var(--line); }
.pick-actions .btn { width: 100%; margin: 0; }
.rot-btns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: -2px 0 6px; }
.rot-btns .chip { min-height: 32px; padding: 4px 2px; font-size: 11.5px; white-space: nowrap; }
.place-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.place-acts .btn { width: auto; flex: 1; margin-top: 6px; }
.arrange-box .add-row { padding: 2px 0 6px; }
.arrange-box .small { margin: 2px 0 0; }
body.embed .edit-bar, body.embed .scene-labels { display: none !important; }
.height-box { margin: 4px 0 2px; }
.holder-row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: start; margin: 6px 0 8px; font-size: 12px; }
.holder-row .slider-label { padding-top: 7px; }
.holder-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.holder-chips .chip { min-height: 32px; padding: 4px 10px; font-size: 11.5px; }

/* Mover-Positionen */
body.is-pos #toggle-pos { border-color: var(--accent); color: var(--accent); }
body.is-pos .viewport { box-shadow: inset 0 0 0 2px rgba(255, 176, 32, .55); }
body.is-pos .list-head, body.is-pos #fixtures, body.is-pos #edit-tools { display: none !important; }
.pos-tools[hidden] { display: none; }
.pos-list { display: grid; gap: 2px; padding: 0 8px; }
.pos-row { display: grid; grid-template-columns: 22px 1fr auto 30px; align-items: center; gap: 8px; min-height: 38px; padding: 2px 6px 2px 8px;
  border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.pos-row:hover { background: var(--panel-2); }
.pos-row.is-on { background: #1c2029; border-color: var(--accent); }
.pos-row.is-off .pos-name { opacity: .45; }
.pos-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.pos-name { font-weight: 600; font-size: 13px; }
.pos-count { font: 11px var(--mono); color: var(--muted); padding: 1px 7px; border-radius: 999px; background: #232733; }
.pos-count.is-done { color: #9fe9bf; background: #10241a; }
.pos-star { background: none; border: 0; cursor: pointer; color: #4a5263; font-size: 17px; padding: 2px; }
.pos-star.is-on, .pos-star:hover { color: var(--accent); }
.pos-movers { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.pos-mover { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 12px; }
.pos-mover .dot { width: 9px; height: 9px; border-radius: 50%; background: #6f7685; }
.pos-mover.is-set .dot { background: var(--ok); }
.pos-mover.is-on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pos-mover.is-on .dot { background: var(--accent); }
.pos-mover.is-na { opacity: .4; cursor: default; }
.pos-invert { margin: 10px 14px 4px; padding: 10px 12px; border-radius: 10px; background: #1a1d26; border: 1px solid var(--line); display: grid; gap: 6px; }
.pos-invert-title { font-weight: 600; font-size: 12.5px; }
.pos-invert-text, .pos-invert-names { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pos-invert .chip { justify-self: start; min-height: 36px; }
.pos-step { margin: 10px 14px 6px; padding: 9px 11px; border-radius: 10px; background: #2a2110; border: 1px solid #5a4415; color: #ffd27a; font-size: 12.5px; line-height: 1.4; }
.pos-check { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; margin: 8px 14px; font-size: 12px; color: var(--muted); cursor: pointer; }
.pos-check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.pos-bar-title { font-size: 13px; padding: 0 6px; }
.pos-bar[hidden] { display: none; }
.sub-title .muted { text-transform: none; letter-spacing: 0; margin-left: 6px; }

/* Ausrichtung abgleichen (kopf-abgleich.js): eigener Modus wie die Mover-Positionen */
body.is-abg .viewport { box-shadow: inset 0 0 0 2px rgba(61, 220, 132, .5); }
body.is-abg .list-head, body.is-abg #fixtures, body.is-abg #edit-tools, body.is-abg #pos-tools { display: none !important; }
.abg-row { grid-template-columns: 14px 1fr auto 30px; }
.abg-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #4a5263; }
.abg-dot.is-set { background: var(--ok); border-color: var(--ok); }
.abg-del { font-size: 18px; line-height: 1; }
.abg-del[hidden] { display: none; }
.abg-seg { margin: 0 14px; display: flex; }
.abg-seg .seg-btn { flex: 1; min-height: 38px; }
.abg-result { padding: 0 14px; display: grid; gap: 8px; }
.abg-sum { margin: 0; font-weight: 600; font-size: 12.5px; }
.abg-table { display: grid; gap: 6px; }
.abg-card { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.abg-name { font-weight: 600; font-size: 12.5px; }
.abg-line { font-size: 12px; color: var(--muted); }
.abg-line:nth-child(2) { color: var(--text); }
.abg-warn { color: #ffd27a; }
.abg-note, .abg-empty { margin: 0; line-height: 1.45; }
.abg-swap { font-size: 12px; color: #ffd27a; padding: 8px 10px; border: 1px solid #5a4415; background: #2a2110; border-radius: 10px; }
.abg-swap .chip { margin-top: 6px; }
.abg-acts { padding: 10px 14px 0; }
.abg-acts .btn { min-height: 40px; }
.abg-hint .link-btn { padding: 0; }

/* Kombi-Geräte (GigBAR, KLS …): Kasten im Eigenschaften-Feld */
.kombi .cell-head { justify-content: space-between; }
.kombi-conf { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.kombi-conf.is-guess { color: var(--accent); border-color: var(--accent); }
.kombi-name { font-weight: 600; margin-bottom: 2px; }
.kombi-sub { margin: 8px 0 4px; font-size: 12px; }
.kombi-members { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.kombi-members .linkish.is-cur { color: var(--text); text-decoration: none; font-weight: 600; }
.kombi-parts { display: grid; gap: 4px; margin: 8px 0; }
.kombi-part { display: grid; grid-template-columns: 14px auto 1fr; gap: 8px; align-items: center; font-size: 12px; }
.kombi-pstate { text-align: right; margin: 0; }
.kombi-recipe { margin: 6px 0 8px; font-size: 12px; }
.kombi-recipe summary { cursor: pointer; color: var(--accent); }
.kombi-table { width: 100%; border-collapse: collapse; margin: 4px 0 6px; }
.kombi-table td { padding: 3px 4px; border-top: 1px solid var(--line); }

/* Gerätemodell aus dem Gerätekatalog (katalog.js): Gehäusefarbe als Knöpfe, Modellsuche */
.kat-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.kat-color { min-height: 32px; padding: 4px 10px 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.kat-color::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #0006; background: #34373e; }
.kat-color[data-farbe="weiss"]::before { background: #e8eaed; }
.kat-color[data-farbe="silber"]::before { background: linear-gradient(135deg, #8b9099, #e1e4e8 55%, #9aa0a8); }
.kat-color[data-farbe="chrom"]::before { background: linear-gradient(135deg, #b8bec6, #ffffff 50%, #a5abb4); }
.kat-color[data-farbe="transparent"]::before { background: repeating-conic-gradient(#c8ccd2 0 25%, #8a8f97 0 50%) 0 0 / 6px 6px; }
.kat-color[data-farbe^="#"]::before { background: inherit; }
.kat-color.is-on { border-color: var(--accent); color: var(--accent); }
.kat-search { margin-top: 8px; display: grid; gap: 6px; }
.kat-search input { min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: inherit; }
.kat-hits { max-height: 260px; overflow: auto; display: grid; gap: 2px; }
.kat-hit { text-align: left; display: grid; gap: 1px; padding: 6px 8px; border-radius: 6px; border: 1px solid transparent; background: none; color: inherit; cursor: pointer; }
.kat-hit:hover, .kat-hit:focus-visible { background: var(--panel); border-color: var(--line); }
.kat-hit.is-cur { border-color: var(--accent); }
.kombi-name a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.kat-search[hidden] { display: none; }

/* Gerätebibliothek: nichts gefunden -> ChatGPT-Weg (geraet/assistent.js) */
.lib-none { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 4px; }
.lib-none p { margin: 0; flex: 1 1 260px; }

/* ---------------------------------------------------------------- Locations (location/ui.js) */
.loc-cell .cell-head, .loc-fold > summary { justify-content: space-between; }
.loc-fold > summary { cursor: pointer; list-style: none; margin-bottom: 0; min-height: 28px; }
.loc-fold > summary::-webkit-details-marker { display: none; }
.loc-fold > summary::before { content: "▸"; color: var(--muted); margin-right: 2px; transition: transform .15s; }
.loc-fold[open] > summary::before { transform: rotate(90deg); }
.loc-open { border: 1px solid var(--line, #2c3038); border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.loc-open-sum { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; min-height: 32px; align-items: center; list-style: none; }
.loc-open-sum::-webkit-details-marker { display: none; }
.loc-open[open] { padding-bottom: 10px; }
.loc-open-foot { display: flex; gap: 8px; justify-content: space-between; margin-top: 8px; }
.loc-fold[open] > summary { margin-bottom: 6px; }
.loc-sum { font-weight: 400; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.loc-sub { display: block; margin: 12px 0 0; }
.loc-cta p { margin: 0 0 8px; }
.loc-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.loc-mini-card { display: grid; gap: 3px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); overflow: hidden;
  cursor: pointer; font-size: 10px; color: var(--muted); text-align: center; }
.loc-mini-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.loc-mini-card span { padding: 0 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-mini-card:hover, .loc-mini-card:focus-visible { border-color: var(--accent); color: var(--text); }
.loc-go { width: 100%; min-height: 44px; }
.loc-head-top { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.loc-head-img { width: 96px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: #000; }
.loc-head-txt { display: grid; gap: 4px; min-width: 0; }
.loc-name { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-weight: 600; min-height: 34px; }
.loc-name:focus { outline: none; border-color: var(--accent); }
.loc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.loc-acts .btn { min-height: 36px; flex: 1 1 auto; }
.btn-ghost { background: transparent; }
.loc-tools { display: grid; grid-template-columns: 1fr; gap: 6px; }
.loc-tools .loc-tool { min-height: 44px; padding: 6px 8px; }
.loc-tools .loc-tool .muted { font-size: 11px; }
.loc-tool, .loc-way { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; min-height: 52px; }
.loc-tool:hover, .loc-way:hover, .loc-tool:focus-visible, .loc-way:focus-visible { border-color: var(--accent); }
.loc-tool.is-on { border-color: var(--ok); }
.loc-tool-ic { grid-row: 1 / 3; font-size: 20px; line-height: 1; }
.loc-tool-t { font-weight: 600; }
.loc-guests { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 12px; }
.loc-guests input { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-height: 34px; }
.loc-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.loc-style { display: grid; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; font-size: 11px; text-align: center; }
.loc-style.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 176, 32, .25); }
.loc-style-sw { height: 30px; border-radius: 5px; display: block; }
.loc-style-real .loc-style-sw { background: linear-gradient(135deg, #8a4a32 0 30%, #c79a62 30% 60%, #e9e4da 60%); }
.loc-style-modell .loc-style-sw { background: linear-gradient(160deg, #fbfaf6, #d9d6cf); }
.loc-style-blaupause .loc-style-sw { background: #0b2a52 repeating-linear-gradient(90deg, rgba(159,212,255,.5) 0 1px, transparent 1px 8px); }
.loc-style-neon .loc-style-sw { background: #050506; box-shadow: inset 0 0 0 2px #22e5ff, inset 0 0 10px #ff2bd6; }
.loc-style-void .loc-style-sw { background: radial-gradient(circle at 50% 80%, #2a2c33, #000 70%); }

.loc-gal { position: fixed; left: 0; top: var(--loc-top, 104px); bottom: 0; width: min(560px, 100vw); z-index: 30; display: grid;
  grid-template-rows: auto 1fr auto; background: var(--panel); border-right: 1px solid var(--line); box-shadow: 12px 0 30px rgba(0, 0, 0, .45); }
.loc-gal[hidden] { display: none; }
.loc-gal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.loc-gal-head h3 { margin: 0; font-size: 16px; }
.loc-gal-x { min-width: 44px; min-height: 40px; font-size: 16px; }
.loc-gal-body { overflow-y: auto; padding: 4px 16px 16px; }
.loc-gal-body h4 { margin: 16px 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loc-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.loc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.loc-card { position: relative; display: grid; gap: 3px; align-content: start; padding: 0 0 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); overflow: hidden; cursor: pointer; text-align: left; }
.loc-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #000; margin-bottom: 4px; }
.loc-card b, .loc-card span { padding: 0 10px; }
.loc-card:hover, .loc-card:focus-visible { border-color: #5b6170; }
.loc-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 176, 32, .3); }
.loc-del { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); cursor: pointer; }
.loc-gal-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }
.loc-gal-foot > span { margin-right: auto; }
.loc-gal-foot .btn { min-height: 44px; min-width: 104px; }
@media (max-width: 900px) {
  .loc-gal { top: auto; height: 64vh; width: 100vw; border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -12px 30px rgba(0, 0, 0, .45); }
  .loc-ways, .loc-tools { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .loc-grid { grid-template-columns: 1fr 1fr; gap: 6px; } .loc-card span { display: none; } }
.loc-fold .seg, .loc-cell .seg { flex-wrap: wrap; row-gap: 4px; }
.loc-fold .slider-row { grid-template-columns: 82px 1fr auto; }
.loc-dlg { width: min(640px, calc(100vw - 32px)); }
.loc-dlg-wide { width: min(1100px, calc(100vw - 24px)); }
.loc-dlg-body { display: grid; gap: 10px; margin-top: 10px; max-height: calc(100vh - 200px); overflow-y: auto; }
.loc-dlg-body p { margin: 0; }
.loc-dlg-body ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.loc-dlg-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.loc-dlg-foot:empty { display: none; }
.loc-dlg-foot .btn { min-height: 44px; }
.loc-drop { display: grid; place-items: center; gap: 4px; min-height: 120px; padding: 14px; border: 2px dashed var(--line); border-radius: 12px;
  cursor: pointer; text-align: center; color: var(--muted); }
.loc-drop:hover, .loc-drop.is-over { border-color: var(--accent); color: var(--text); }
.loc-drop.is-busy { opacity: .7; cursor: progress; }
.loc-drop.is-bad { border-color: var(--bad); }
.loc-drop-ic { font-size: 26px; }
.loc-note { padding: 8px 10px; border-radius: 8px; background: rgba(255, 176, 32, .08); border: 1px solid rgba(255, 176, 32, .25); font-size: 12px; }
.loc-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.loc-row .btn { min-height: 36px; }
.loc-warn { color: var(--warn); margin: 6px 0 0; }
.loc-foto-ed { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
.loc-foto-ed[hidden] { display: none; }
.loc-foto-stage { position: relative; width: 100%; background: #000; border-radius: 8px; overflow: hidden; touch-action: none; }
.loc-foto-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.loc-foto-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.loc-foto-poly { fill: rgba(255, 176, 32, .12); stroke: #ffb020; stroke-width: 2.5; }
.loc-foto-grid { stroke: rgba(61, 220, 132, .75); stroke-width: 1.2; }
.loc-foto-up { stroke: #22e5ff; stroke-width: 2.5; }
.loc-foto-h { cursor: grab; }
.loc-foto-h circle:not(.loc-foto-hit) { fill: #ffb020; stroke: #000; stroke-width: 2; }
.loc-foto-hit { fill: transparent; }
.loc-foto-h text { fill: #fff; font: 700 22px sans-serif; text-anchor: middle; paint-order: stroke; stroke: #000; stroke-width: 4px; }
.loc-foto-side { display: grid; gap: 10px; align-content: start; font-size: 12px; }
.loc-num { display: grid; grid-template-columns: 1fr 76px auto; gap: 6px; align-items: center; }
.loc-num input { min-height: 40px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; }
.loc-chk { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.loc-chk input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
@media (max-width: 760px) { .loc-foto-ed { grid-template-columns: 1fr; } .loc-foto-stage { width: 100% !important; } }
.loc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-thumb { position: relative; width: 120px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.loc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loc-text { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; min-height: 64px; }
.loc-text:focus { outline: none; border-color: var(--accent); }
.loc-ki-result { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(61, 220, 132, .35); background: rgba(61, 220, 132, .07); display: grid; gap: 4px; }
.loc-ki-result[hidden] { display: none; }
.loc-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.loc-steps li > b { display: inline-block; margin-bottom: 4px; }
.loc-steps .loc-drop { min-height: 80px; margin: 6px 0; }
.loc-tex-prev { height: 120px; border-radius: 8px; border: 1px solid var(--line); background-size: 120px auto; background-repeat: repeat; }
.loc-tex-prev[hidden] { display: none; }
.loc-tex-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.loc-tex-row b { margin-right: auto; }
.loc-tex-sw { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); background-size: cover; background-color: #000; }
.loc-plan-stage { background: #fff; }
