/* Zentrale — Shell: Grundgerüst, Raumliste + Raum-Suche, Chat-Header + Verbindungs-Banner,
   Leerzustand der Chat-Spalte, Technik-Panel (Raum, Besatzung, Verbindung, Darstellung, Sitzung)
   und die Login-Maske. Farben, Abstände, Radien und Dauern kommen NUR aus tokens.css.
   Reihenfolge der Module (index.html): shell → timeline → composer → mobile. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; background: none; border: none; padding: 0; color: inherit; cursor: pointer; }
img { max-width: 100%; }

/* Tastatur-Fokus ist sichtbar — ein Ring für alle Bedienelemente, nur bei Tastatur-Fokus.
   (--focus-ring kommt mit D3s tokens.css; bis dahin ink-2 = 4,8:1 auf der Fläche) */
:focus-visible { outline: var(--focus-w, 2px) solid var(--focus, var(--ink-2)); outline-offset: var(--focus-offset, 2px); }
.room:focus-visible, .switcher-item:focus-visible, .seg-btn:focus-visible { outline-offset: -2px; }

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}
.kbd {
  font-family: var(--font-mono); font-size: var(--fs-mono-s); color: var(--ink-3);
  border: 1px solid var(--line-off); border-radius: var(--radius-sm);
  padding: 1px 5px; white-space: nowrap;
}

@keyframes shell-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Grundgerüst: 3 Spalten ---------- */
#app { display: flex; height: 100%; }

.col { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#col-rooms { width: var(--col-rooms-w); flex: none; background: var(--surface); }
#col-chat { flex: 1; min-width: 0; }
#col-tech {
  width: var(--col-tech-w); flex: none; background: var(--surface);
  transition: width var(--motion-slow) var(--ease), opacity var(--motion-mid) var(--ease);
}
/* Inhalt behält seine Breite und wird beim Ein-/Ausblenden weggeblendet statt gequetscht */
#col-tech .col-header, #tech-body { min-width: var(--col-tech-w); }
body:not(.panel-open) #col-tech { width: 0; opacity: 0; pointer-events: none; }
#panel-scrim { display: none; } /* nur auf Mobile aktiv, s. mobile.css */

.col-header {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-5);
  min-width: 0;
}
#col-rooms .col-header, #col-tech .col-header { border-bottom: 1px solid var(--line); }
#col-tech .col-header { padding: 0 var(--sp-6); } /* css-design-13: bündig mit dem Panel-Inhalt */
.col-header .brand { font-size: var(--fs-title); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.col-header .brand-tech { font-size: var(--fs-name); }
.col-header .brand-sub {
  font-family: var(--font-mono); font-size: var(--fs-tiny); color: var(--ink-4); margin-left: auto;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.icon-btn {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  transition: background-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease),
              transform var(--motion-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { display: block; }

/* Runde 3 (2.4): #theme-toggle lebt nur noch im Chat-Kopf am Handy — Desktop steuert allein
   das Technik-Panel (render/panel.js renderTheme()). mobile.css hebt die Sperre unter 900px auf. */
.is-mobile-only { display: none; }

/* ---------- Avatare + Status-Dots (Presence = Semantik, keine Deko) ---------- */
.av {
  width: var(--av-size); height: var(--av-size); flex: none;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-m);
  font-weight: 500;
  color: var(--on-avatar);
  background: var(--av-bg, var(--c-neutral));
  position: relative;
  overflow: visible;
}
.av img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
  transition: opacity var(--motion-mid) var(--ease), filter var(--motion-mid) var(--ease);
}
/* „aus": gedämpfter Avatar — Initialen als Umriss, Profilbild entsättigt */
.av.av-off { background: var(--surface); border: 1px solid var(--line-off); color: var(--ink-4); }
.av.av-off img { filter: grayscale(1); opacity: 0.55; }
.av .dot {
  position: absolute; right: -3px; bottom: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--surface);
  transition: background-color var(--motion-mid) var(--ease), border-color var(--motion-fast) var(--ease);
}
.dot-frei { background: var(--st-frei); }
.dot-busy { background: var(--st-busy); }
.dot-problem { background: var(--st-problem); }
.dot-aus { background: var(--st-aus); }

/* ---------- Raumliste ---------- */
#room-list { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-4) var(--sp-2); }
#room-list .eyebrow { padding: 0 var(--sp-3) 6px; display: flex; align-items: baseline; gap: var(--sp-2); }
#room-list .group ~ .eyebrow { padding-top: var(--sp-5); }
/* Runde 3 (S1, 2.1): Summe Ungelesener rechts in jeder Sektions-/Bereichs-Überschrift. */
.eyebrow-count { margin-left: auto; letter-spacing: 0; color: var(--ink-3); }
/* "Gruppe" statt "Sektion" seit Runde 3 (S1, 2.2) — Bereiche UND automatische Abschnitte sind
   gleichermaßen ein .group-Block, `data-section` trägt den Drag&Drop-Zielwert (leer = kein Bereich). */
.group { display: flex; flex-direction: column; gap: 2px; }
.group.is-drop { background: var(--inset); border-radius: var(--radius); }
/* Ziel „Ohne Bereich" — nur während eines Zugs sichtbar (.is-active, js/render/rooms.js). */
.no-section-target {
  display: none; align-items: center; justify-content: center;
  height: 32px; margin: 0 var(--sp-2) var(--sp-3);
  border: 1px dashed var(--line-off); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: var(--fs-mono-s); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-4);
}
.no-section-target.is-active { display: flex; }
.no-section-target.is-drop { background: var(--inset); border-color: var(--ink-3); color: var(--ink-2); }

/* Laden: bis das erste init da ist, steht die Liste als Skelett in Layout-Form — verzögert,
   damit ein schneller Start (LAN) nicht flackert. */
#room-list:empty::before {
  content: ""; display: block; height: calc(5 * 48px); margin-top: var(--sp-5);
  background-image:
    linear-gradient(to bottom, var(--inset, var(--active)) 0 var(--av-size), transparent var(--av-size)),
    linear-gradient(to bottom, var(--inset, var(--active)) 0 10px, transparent 10px 17px, var(--inset, var(--active)) 17px 25px, transparent 25px);
  background-size: var(--av-size) 48px, 132px 48px;
  background-position: var(--sp-3) 0, calc(var(--sp-3) + var(--av-size) + 10px) 2px;
  background-repeat: repeat-y;
  animation: shell-fade-in var(--motion-mid) var(--ease) calc(var(--motion-slow) * 2) both;
}
.room-list-empty { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-preview); color: var(--ink-4); line-height: 1.5; }

.room {
  display: flex; align-items: center; gap: 10px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  width: 100%; text-align: left;
  transition: background-color var(--motion-fast) var(--ease);
}
.room:hover { background: var(--hover); }
.room:hover .dot { border-color: var(--hover); }
.room:active, .room.is-active { background: var(--sel); }
.room.is-active .dot { border-color: var(--sel); }
.room[draggable].is-dragging { opacity: .5; }
.room-main { flex: 1; min-width: 0; }
.room-name {
  font-size: var(--fs-name); font-weight: 600; color: var(--ink); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room.is-active .room-name { font-weight: 700; }
.room-prev {
  font-size: var(--fs-preview); color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.room.is-off .room-name { color: var(--ink-3); font-weight: 500; }
.room.is-off .room-prev { color: var(--ink-4); }
/* Ungelesen (Runde 3, S1, 2.1): Name fett/voll, Vorschau eine statt zwei Stufen heller, rechts
   eine große Mono-Zahl statt der Uhrzeit — rot nur bei Erwähnung, sonst kein Unterschied (keine
   Pille, kein Punkt). */
.room.is-unread .room-name { color: var(--ink); font-weight: 700; }
.room.is-unread .room-prev { color: var(--ink-2); }
.room-meta {
  font-family: var(--font-mono); color: var(--ink-4);
  font-size: var(--fs-mono-s); align-self: flex-start; padding-top: 2px;
  flex: none; min-width: 2.5ch; text-align: right;
}
.room-meta.is-unread  { font-size: var(--fs-name); font-weight: 500; color: var(--ink); padding-top: 0; }
.room-meta.is-mention { font-size: var(--fs-name); font-weight: 500; color: var(--st-problem-ink); padding-top: 0; }

/* Fuß der Raumliste: der Weg zur Raum-Suche (Tastenkürzel nur mit Maus/Tastatur sichtbar) */
.room-list-hint {
  flex: none; display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-mono); font-size: var(--fs-tiny); color: var(--ink-4);
  text-align: left; transition: color var(--motion-fast) var(--ease);
}
.room-list-hint:hover { color: var(--ink-2); }
.room-list-hint .kbd { margin-left: auto; font-size: var(--fs-tiny); color: var(--ink-4); }
@media (hover: none) { .room-list-hint .kbd { display: none; } }

/* ---------- Raum-Suche (Strg+K bzw. /) ---------- */
.switcher {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh var(--sp-4) var(--sp-4);
  background: var(--scrim);
  animation: shell-fade-in var(--motion-fast) var(--ease-out);
}
.switcher[hidden] { display: none; }
.switcher-box {
  width: min(520px, 100%); max-height: 72vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden;
}
.switcher-input {
  width: 100%; font-family: var(--font-ui); font-size: var(--fs-title); color: var(--ink);
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: var(--sp-4) var(--sp-5); outline: none;
  transition: border-color var(--motion-fast) var(--ease);
}
.switcher-input:focus { border-bottom-color: var(--ink-2); }
.switcher-input::placeholder { color: var(--ink-4); }
.switcher-list { min-height: 0; overflow-y: auto; padding: var(--sp-2); display: flex; flex-direction: column; gap: 2px; }
.switcher-item {
  display: flex; align-items: center; gap: 10px;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
  width: 100%; text-align: left;
  transition: background-color var(--motion-fast) var(--ease);
}
.switcher-item:hover { background: var(--hover); }
.switcher-item.is-selected { background: var(--sel); }
.switcher-item.is-selected .dot { border-color: var(--sel); }
.switcher-item .av { width: var(--av-size-s); height: var(--av-size-s); font-size: var(--fs-tiny); }
.switcher-item .name { flex: 1; min-width: 0; font-size: var(--fs-name); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-item .meta { font-family: var(--font-mono); font-size: var(--fs-tiny); color: var(--ink-4); flex: none; }
.switcher-item .meta.is-unread { color: var(--ink); font-weight: 500; }
.switcher-empty { padding: var(--sp-4) var(--sp-5); font-size: var(--fs-name); color: var(--ink-4); }
.switcher-hint {
  flex: none; padding: var(--sp-2) var(--sp-5) var(--sp-3);
  font-family: var(--font-mono); font-size: var(--fs-tiny); color: var(--ink-4);
  border-top: 1px solid var(--line);
}
@media (hover: none) { .switcher-hint { display: none; } } /* Tasten-Hinweis nur mit Tastatur */

/* ---------- Chat-Header ---------- */
#chat-header { padding: 0 var(--sp-8); gap: var(--sp-3); container-type: inline-size; }
/* css-design-11: langer Raumname/Untertitel bleiben einzeilig mit Ellipsis; wird die Chat-Spalte
   schmal (Handy, enges Fenster), fällt der Untertitel weg statt zu „Gruppen…" zu schrumpfen. */
#chat-title {
  font-size: var(--fs-body); font-weight: 700;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#chat-sub {
  font-size: var(--fs-meta); color: var(--ink-3);
  flex: 0 1 auto; min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#chat-header .spacer { flex: 1; }
@container (max-width: 520px) { #chat-sub { display: none; } }
.btn-back { display: none; }

/* ---------- Verbindungs-Banner (über der Timeline, ruhig, ohne Rot-Alarm) ---------- */
.conn-banner {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-2) var(--sp-8);
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: var(--fs-mono-m); color: var(--ink-2);
  animation: shell-fade-in var(--motion-mid) var(--ease-out);
}
.conn-banner[hidden] { display: none; }
.conn-banner .txt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-banner .detail { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-4); }
.conn-banner .detail[hidden] { display: none; }
.conn-banner.is-error { color: var(--ink); }
.conn-banner-btn {
  margin-left: auto; flex: none;
  font-family: var(--font-mono); font-size: var(--fs-mono-m); color: var(--ink);
  text-decoration: underline; text-underline-offset: 2px; padding: 2px 0;
}
.conn-banner-btn[hidden] { display: none; }
.conn-banner-btn:disabled { color: var(--ink-4); cursor: default; }

/* ---------- Leerzustand der Chat-Spalte: kein Raum gewählt ---------- */
.chat-empty {
  flex: 1; min-height: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-8); text-align: center;
}
body.no-room .chat-empty { display: flex; }
body.no-room #timeline, body.no-room #composer-wrap { display: none; }
.chat-empty .title { font-size: var(--fs-title); font-weight: 600; color: var(--ink-2); }
.chat-empty .sub { font-size: var(--fs-name); color: var(--ink-4); max-width: 38ch; line-height: 1.55; }
.chat-empty .sub:empty { display: none; }

/* ---------- Technik-Panel ---------- */
#tech-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-5) var(--sp-6); }
#tech-body .eyebrow { padding-bottom: var(--sp-2); }
.tech-section { padding-top: var(--sp-6); }
.tech-section:first-child { padding-top: 0; }
.tech-muted { font-size: var(--fs-preview); color: var(--ink-4); line-height: 1.6; padding-top: var(--sp-1); }

/* Raum-Kopf: echte Raum-Daten prominent oben */
.room-head-name {
  font-size: var(--fs-title); font-weight: 700; color: var(--ink); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-head-meta { padding-top: 6px; font-size: var(--fs-preview); color: var(--ink-3); }

/* Besatzung: Avatar + Dot, Name, rechts der Zustand in Mono. Der Dot trägt die Farbe, der Text
   nimmt sie nur in der AA-sicheren Text-Variante auf (--st-*-ink aus D3s tokens.css; bis zum
   Merge ink-2/ink-4). Beim Problem steht die Ursache als Zeile unter dem Namen. */
.crew-row {
  display: flex; align-items: center; gap: 10px; min-height: 36px;
  padding: var(--sp-1) var(--sp-2); margin: 0 calc(-1 * var(--sp-2));
  border-radius: var(--radius-sm);
  transition: background-color var(--motion-fast) var(--ease);
}
.crew-row:hover { background: var(--hover); }
.crew-row:hover .dot { border-color: var(--hover); }
.crew-main { flex: 1; min-width: 0; }
.crew-name {
  font-size: var(--fs-crew); font-weight: 600; color: var(--ink); line-height: 1.3;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crew-detail {
  font-family: var(--font-mono); font-size: var(--fs-mono-s); color: var(--ink-3); line-height: 1.4;
  padding-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crew-row.is-problem .crew-detail { color: var(--st-problem); }
.crew-row.is-off .crew-name { color: var(--ink-4); font-weight: 500; }
.crew-state { font-family: var(--font-mono); font-size: var(--fs-mono-s); color: var(--ink-2); margin-left: auto; flex: none; }
.crew-state.is-on { color: var(--st-frei-ink, var(--ink-2)); }
.crew-state.is-busy { color: var(--st-busy-ink, var(--ink-2)); }
.crew-state.is-off { color: var(--st-aus-ink, var(--ink-4)); }
.crew-state.is-problem { color: var(--ink); font-weight: 600; }

/* Verbindung: die fünf Sync-Zustände als Klartext, Punkt = Farbe; Details als Key/Value-Zeilen */
.sync-row { display: flex; align-items: center; gap: var(--sp-2); min-height: 20px; }
.sync-row .lgd { width: 7px; height: 7px; border-radius: 50%; flex: none; transition: background-color var(--motion-mid) var(--ease); }
.sync-row .txt {
  font-family: var(--font-mono); font-size: var(--fs-mono-m); color: var(--ink-2);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sync-detail { display: flex; flex-direction: column; gap: 2px; padding-top: var(--sp-1); }
.sync-kv { display: flex; gap: var(--sp-2); min-width: 0; font-family: var(--font-mono); font-size: var(--fs-mono-s); }
.sync-kv .k { color: var(--ink-4); flex: none; }
.sync-kv .v { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-kv.is-text .v { white-space: normal; line-height: 1.5; } /* Klartext-Hinweise dürfen umbrechen, Werte nicht */

/* Darstellung: Hell / Dunkel / System als schlichter Segment-Schalter */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn {
  padding: 5px var(--sp-3); font-size: var(--fs-meta); font-weight: 500; color: var(--ink-2);
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn:hover { background: var(--hover); color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--sel); color: var(--ink); font-weight: 600; }

/* Sitzung: Abmelden als Textlink (Strang B: POST /api/logout) */
.tech-link { font-size: var(--fs-preview); color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; padding: 2px 0; }
.tech-link:hover { color: var(--ink); }
.tech-link:disabled { color: var(--ink-4); cursor: default; }

.panel-close { display: none; margin-left: var(--sp-2); }

/* ---------- Login-Maske (login.html): derselbe Ground, dieselben Tokens wie die App ---------- */
/* Karte knapp über der Mitte (optisches Zentrum), nicht mathematisch mittig */
body.login { display: flex; align-items: center; justify-content: center; padding: var(--sp-6) var(--sp-6) 10vh; overflow: auto; }
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: var(--sp-5); }
.login-head { display: flex; flex-direction: column; gap: 6px; }
.login-brand { font-size: calc(var(--fs-title) * 1.5); font-weight: 700; letter-spacing: 0.01em; line-height: 1.2; }
.login-sub { font-family: var(--font-mono); font-size: var(--fs-preview); color: var(--ink-4); }
.login-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.login-input {
  width: 100%; font-family: var(--font-ui); font-size: var(--fs-title); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: var(--sp-3) 14px; outline: none;
  transition: border-color var(--motion-mid) var(--ease), box-shadow var(--motion-mid) var(--ease);
}
.login-input::placeholder { color: var(--ink-5); letter-spacing: 0.1em; }
.login-input::selection { background: var(--line-off); color: var(--ink); } /* Auswahl nach Fehlversuch im Ton der Palette */
/* css-design-7: Fokus als klarer Ring, nicht als kaum sichtbarer Rahmenwechsel */
.login-input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 1px var(--ink-3); }
.login-input[aria-invalid="true"] { border-color: var(--st-problem); }
.login-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--st-problem); }
.login-btn {
  font-size: var(--fs-title); font-weight: 600;
  background: var(--ink); color: var(--bg); border-radius: var(--radius);
  padding: var(--sp-3) 14px;
  transition: opacity var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.login-btn:hover:not(:disabled) { opacity: 0.9; }
.login-btn:active:not(:disabled) { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.5; cursor: default; }
.login-error { font-size: var(--fs-name); color: var(--st-problem); min-height: 18px; line-height: 1.45; }
.login-error[hidden] { display: none; }

/* ---------- Bot-Profile (Runde 2, S1): „Dein Profil" + klickbare Besatzungs-Zeilen, Inline-Editor ----------
   Die Zeile bleibt die Besatzungs-Zeile (Avatar, Dot, Name, Zustand); verwaltbare Zeilen sind Buttons
   mit einem leisen „ändern" rechts. Der Editor liegt als Vertiefung (--inset) direkt darunter:
   Vorschau + Name, „Bild wählen", Speichern / Abbrechen flach, Fehlertext benennt die Ursache. */
.profile-row {
  display: flex; align-items: center; gap: 10px; min-height: 36px;
  padding: var(--sp-1) var(--sp-2); margin: 0 calc(-1 * var(--sp-2));
  border-radius: var(--radius-sm);
  transition: background-color var(--motion-fast) var(--ease);
}
.profile-row:hover { background: var(--hover); }
/* <button> füllt die Breite nicht von selbst (shrink-to-fit) — explizit auf die Zeilenbreite */
.crew-row.is-editable, .profile-row { width: calc(100% + 2 * var(--sp-2)); text-align: left; cursor: pointer; }
.crew-row.is-editable:focus-visible, .profile-row:focus-visible { outline-offset: -2px; }
.crew-row.is-editing, .profile-row.is-editing { background: var(--sel); }
.crew-row.is-editing .dot { border-color: var(--sel); }
.crew-edit {
  font-family: var(--font-mono); font-size: var(--fs-mono-s); color: var(--ink-4); flex: none;
  transition: color var(--motion-fast) var(--ease);
}
.crew-row.is-editable:hover .crew-edit, .profile-row:hover .crew-edit,
.crew-row.is-editable:focus-visible .crew-edit, .profile-row:focus-visible .crew-edit { color: var(--ink-2); }

.crew-editor {
  display: flex; flex-direction: column; gap: var(--sp-3);
  margin: var(--sp-1) 0 var(--sp-3); padding: var(--sp-3);
  background: var(--inset); border-radius: var(--radius);
  animation: shell-fade-in var(--motion-mid) var(--ease-out);
}
.crew-editor.is-pending { opacity: 0.7; }
.crew-editor-top { display: flex; align-items: center; gap: var(--sp-3); }
.crew-editor-av { width: 40px; height: 40px; font-size: var(--fs-name); }
.crew-editor-name {
  flex: 1; min-width: 0;
  font-family: var(--font-ui); font-size: var(--fs-name); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 6px var(--sp-2);
  transition: border-color var(--motion-fast) var(--ease);
}
.crew-editor-name:hover { border-color: var(--line-off); }
.crew-editor-name:disabled { color: var(--ink-4); }
.crew-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.crew-editor-actions .spacer { flex: 1; }
.crew-editor-pick { cursor: pointer; flex: none; }
.crew-editor-file {
  font-family: var(--font-mono); font-size: var(--fs-mono-s); color: var(--ink-4);
  min-width: 0; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crew-editor-btn {
  font-family: var(--font-ui); font-size: var(--fs-meta); font-weight: 500; color: var(--ink-2);
  padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-sm); background: var(--surface);
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.crew-editor-btn.is-primary { font-weight: 600; color: var(--ink); }
.crew-editor-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.crew-editor-btn:disabled { color: var(--ink-4); cursor: default; }
.crew-editor-error { font-size: var(--fs-preview); color: var(--st-problem-ink); line-height: 1.5; }
.crew-editor-error[hidden] { display: none; }
@media (max-width: 900px) {
  .crew-editor-name { font-size: var(--fs-body-touch); min-height: var(--tap-min); }
  .crew-editor-btn, .crew-editor-pick { display: inline-flex; align-items: center; min-height: var(--tap-min); }
}

/* ---------- Scrollbars, ruhig ---------- */
#room-list, #timeline, #tech-body, .switcher-list { scrollbar-width: thin; scrollbar-color: var(--line-off) transparent; }

/* ---------- Bewegung respektiert Nutzer-Präferenz ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
