/* Terminals — NUR Anordnung. Aussehen kommt aus den Kern-Bausteinen (Knöpfe, Chips, Plaketten, Rail,
   Textarea, Design::muted/heading, das Überblend-Feld Design::overlay). Datenfarben (Anwesenheits-Punkt)
   setzt das JS als Laufzeitwert. */
.tm-page .tm-main { display: flex; flex-direction: column; min-height: 0; }
.tm-page .tm-work { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: var(--sp-3); }
.tm-page .tm-host, .tm-page .tm-who, .tm-page .tm-mem, .tm-page .tm-links { flex: 1; min-height: 0; overflow: auto; }

.tm-bar .tm-bar-gap { flex: 1; }

/* ── Raster ── */
.tm-grid { flex: 1; min-height: 0; display: grid; gap: var(--sp-3); grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.tm-grid[data-layout="2h"] { grid-template-columns: 1fr 1fr; }
.tm-grid[data-layout="2v"] { grid-template-rows: 1fr 1fr; }
.tm-grid[data-layout="4"]  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tm-grid[data-layout="6"]  { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.tm-grid[data-layout="9"]  { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.tm-grid[data-layout="auto"] { grid-template-columns: repeat(auto-fill, minmax(var(--sz-320), 1fr)); grid-auto-rows: minmax(var(--sz-220), 1fr); overflow: auto; }

.tm-slot { min-width: 0; min-height: 0; position: relative; }
.tm-slot .tm-proj { min-width: 0; overflow: hidden; }
.tm-term { height: 100%; padding: var(--sp-1) var(--sp-2); box-sizing: border-box; }
.tm-term .xterm { height: 100%; }

.tm-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.tm-page.is-solo .tm-bar .tm-multi { display: none; }

/* ── Kollisionswarnung ── */
.tm-page .tm-collide { margin: 0; }
.tm-collide-mark { margin-left: var(--sp-2); }

/* ── Wer arbeitet gerade woran ── */
.tm-who-list { display: flex; flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-2); }
.tm-who-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2); min-width: 0; }
.tm-who-dot { flex: none; }
.tm-who-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tm-who-ago { white-space: nowrap; flex: none; }

/* ── Gedächtnis ── */
.tm-mem-files { display: flex; flex-direction: column; gap: var(--sp-1); margin: var(--sp-2) 0; }
.tm-mem-edit { display: flex; flex-direction: column; gap: var(--sp-2); }
.tm-mem-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-mem-text { width: 100%; min-height: var(--sz-320); resize: vertical; }
.tm-mem-actions { margin-top: var(--sp-1); }

/* ── Zugänge ── */
.tm-links-urls { display: flex; flex-direction: column; gap: var(--sp-1); margin: var(--sp-2) 0; }
.tm-url { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.tm-url-type { min-width: var(--sz-64); }
.tm-url-a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-links-creds { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.tm-cred { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-2) 0; }
.tm-cred-head { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
.tm-cred-host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-cred-line { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.tm-cred-user, .tm-cred-pw, .tm-cred-ssh-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-cred-ssh { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-1); }

/* ── Arbeits-Overlay: nur die Video-Fläche füllen; Scrim/Text/Timer kommen aus Design::overlay (Kern). ── */
.tm-wo-video { width: 100%; height: 100%; }

/* ── Chat-Ansicht: Liste links, Konversation rechts (Aussehen der Blasen kommt aus dem Kern cc-chat*) ── */
.tm-page .tm-chatpane { display: flex; flex: 1; min-height: 0; gap: var(--sp-3); overflow: hidden; }
.tm-chat-side { width: var(--sz-220); flex: none; display: flex; flex-direction: column; gap: var(--sp-2); min-height: 0; }
.tm-chat-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-1); }
.tm-chat-row { justify-content: flex-start; text-align: left; overflow: hidden; }
.tm-chat-row-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-chat-conv { flex: 1; min-width: 0; }
.tm-chat-none { flex: 1; }
.tm-chat-head .tm-chat-model { flex: none; }

/* ── Als Dashboard-Widget eingebettet (Rail weg, eine Ansicht, feste Kachelgrösse) ── */
.tm-embed { height: 100%; }
.tm-embed .tm-rail { display: none; }
.tm-embed .wn-main-col { flex: 1; min-width: 0; }
.tm-embed.tm-embed-chat .tm-chat-side { display: none; }
.tm-embed.tm-embed-term .tm-bar, .tm-embed.tm-embed-term .tm-collide { display: none; }
/* Die Kachel von Design::widget(bare) — Chat/Terminal brauchen mehr Fläche als ein Standard-Widget. */
.dash-widget.tm-wg { width: var(--sz-360); height: var(--sz-500); }
.tm-wg .tm-page { height: 100%; }
