/* Verwaltung → Bausteine (frontend/modules-admin.js). Vorsilbe bs-. Farben und Schrift nur über Variablen (docs/DESIGN.md). */

/* Name des Bausteins: öffnet „nur für“ (ganze Zeile antippbar, list-tools.js) – wie Text, nicht wie ein Link. */
.bs-name { background:none; border:0; padding:0; font:inherit; font-weight:600; color:var(--ink); text-align:left; cursor:pointer; }
.bs-name:hover { color:var(--accent); }
.bs-name:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
tr[data-bs-row] { cursor:pointer; -webkit-tap-highlight-color:transparent; }
tr[data-bs-row]:active > td { background:var(--fill); }
.bs-hint { margin-top:2px; }
.bs-table td { vertical-align:middle; }
.bs-cell-switch { text-align:right; width:1%; white-space:nowrap; }

/* Schalter (Apple: Switch) – an: grün, aus: graue Spur. Tippfläche 45 px hoch über ein leeres ::before (nur nach oben/unten, sonst läuft es aus der Zelle). */
.bs-switch { position:relative; flex:none; width:51px; height:31px; border:0; padding:0; border-radius:999px; cursor:pointer;
  background:var(--fill-2); transition:background-color .2s; }
.bs-switch::after { content:''; position:absolute; top:2px; left:2px; width:27px; height:27px; border-radius:50%;
  background:var(--surface); box-shadow:var(--raise), 0 0 0 .5px var(--line-strong); transition:transform .2s; }
/* Dunkel: Knopf hell wie bei Apple (die Fläche wäre dort dunkel). */
:root[data-theme="dark"] .bs-switch::after { background:var(--ink); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .bs-switch::after { background:var(--ink); } }
.bs-switch::before { content:''; position:absolute; inset:-7px 0; }
.bs-switch[aria-checked="true"] { background:var(--green); }
.bs-switch[aria-checked="true"]::after { transform:translateX(20px); }
.bs-switch:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.bs-switch:disabled { opacity:.45; cursor:not-allowed; }
@media (prefers-reduced-motion: reduce) { .bs-switch, .bs-switch::after { transition:none; } }

.bs-roles, .bs-resp { border:0; margin:0; padding:0; }
.bs-roles legend, .bs-resp legend { padding:0; margin-bottom:4px; }
.bs-core-list { margin:0; padding-left:18px; display:grid; gap:4px; }
.bs-core summary { cursor:pointer; }

/* Handy: Schalter rechts neben dem Namen statt in einer eigenen Zeile. */
@media (max-width:900px) {
  table.m-cards.bs-table tr { position:relative; padding-right:76px; }
  table.m-cards.bs-table td.bs-cell-switch { position:absolute; top:10px; right:14px; width:auto; }
}
.bs-resp { border-top:1px solid var(--line); padding-top:12px; }
