/* ============================================================
   assets/ui_elements.css
   EPTEC UI ELEMENTS — COMPONENT LAYER (Final)
   ------------------------------------------------------------
   Purpose:
   - Styles for reusable UI components (forms, buttons, boxes,
     grids, notices, badges, toolbars, small helpers).
   - NO scene/illustration styling (that lives in imagine.css).
   - Works with variables defined in assets/style.css (:root).
   ============================================================ */

/* ---------- helpers ---------- */
.whiteout-hidden { display:none !important; }
.pw-wrap { display:flex; gap:10px; align-items:center; }
.pw-wrap input { flex:1; }

.admin-camera-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

/* ---------- boxes / panels ---------- */
.login-box,
.register-box,
.forgot-box{
  background: var(--bg-glass);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.login-box h2,
.register-box h2,
.forgot-box h2{
  margin: 0 0 10px 0;
  letter-spacing: 0.3px;
}

.room1,
.room2{
  background: var(--bg-glass);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

/* ---------- room readability layer (Room 1 / Room 2) ---------- */
#room1-view .room,
#room2-view .room{
  width: min(980px, 92vw);
  background: rgba(8, 12, 18, 0.58);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 38px rgba(0,0,0,0.46);
  backdrop-filter: blur(3px);
}

#room1-view .room h2,
#room2-view .room h2{
  margin: 0 0 12px 0;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.75);
}

#room1-view .room-actions,
#room2-view .room-actions,
#room1-view .room-hotspots,
#room2-view .room-hotspots{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

#room1-view .room-hotspots,
#room2-view .room-hotspots{
  margin-top: 8px;
}

#room1-view .room-actions button,
#room2-view .room-actions button,
#room1-view .room-hotspots button,
#room2-view .room-hotspots button,
#btn-logout-room1,
#btn-logout-room2{
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.42);
  color: #fff;
  font-weight: 600;
  border-radius: 11px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.65);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

#room1-view .room-actions button:hover,
#room2-view .room-actions button:hover,
#room1-view .room-hotspots button:hover,
#room2-view .room-hotspots button:hover,
#btn-logout-room1:hover,
#btn-logout-room2:hover{
  background: rgba(255,255,255,0.24);
  border-color: rgba(255,255,255,0.62);
}

#room2-view #r2-top-notice{
  display: block;
  background: rgba(10, 14, 20, 0.62);
  border: 1px solid rgba(255,255,255,0.36);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.65);
}
/* ---------- doors layout ---------- */
.doors-shell{
  width: min(96vw, 980px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #fff;
}

.doors-grid{
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.door-card{
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 16px;
  padding: 16px;
  color: #fff;
}

.door-button{
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.door-inputs{
  display: grid;
  grid-template-columns: minmax(0, 260px) auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
}

.door-inputs input{
  max-width: 260px;
  width: 100%;
  font-weight: 500;
  color: #fff;
  background: rgba(0,0,0,0.35);
}

.door-inputs .pw-wrap{
  width: 100%;
}

.door-inputs .pw-wrap input{
  max-width: 260px;
}

.door-inputs button{
  width: auto;
  white-space: nowrap;
}
/* ---------- inputs ---------- */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,0.25);
  color: var(--txt);
  outline: none;
}

input::placeholder,
textarea::placeholder{
  color: rgba(255,255,255,0.55);
}

input:focus,
textarea:focus,
select:focus{
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

/* ---------- buttons ---------- */
button,
.eptec-btn{
  appearance:none;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.08);
  color: var(--txt);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}

button:hover,
.eptec-btn:hover{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
}

button:active,
.eptec-btn:active{
  transform: translateY(1px);
}

button:disabled,
.eptec-btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

/* small / inline button */
.eptec-btn--sm{
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
}

/* primary intent */
.eptec-btn--primary{
  background: rgba(130, 220, 255, 0.16);
  border-color: rgba(130, 220, 255, 0.22);
}

/* danger intent */
.eptec-btn--danger{
  background: rgba(255, 90, 90, 0.14);
  border-color: rgba(255, 90, 90, 0.20);
}

/* ---------- grids / toolbars ---------- */
.r1-compare-grid,
.r2-evidence-grid{
  display:grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.r2-toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin: 8px 0 12px 0;
}

/* ---------- notices / badges ---------- */
.r2-top-notice{
  border: 1px dashed var(--line-soft);
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 10px 12px;
}

.r2-traffic-box{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 10px 12px;
}

.r2-traffic-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.06);
  font-weight: 600;
}

.r2-ampel-label{
  display:inline-block;
  font-size: 0.92rem;
  opacity: 0.9;
}

.r1-pct{
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ---------- lists ---------- */
.r2-log-list,
.r2-plant-list{
  list-style: none;
  padding: 0;
  margin: 0;
}

.r2-log-list li,
.r2-plant-list li{
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0;
}

/* ---------- modal refinement (works with base modal in style.css) ---------- */
.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.modal-title{
  margin:0 0 10px 0;
}

/* ---------- footer link emphasis ---------- */
.footer-product a,
.footer-product-desc a{
  color: rgba(190, 235, 255, 0.95);
  text-decoration: none;
}
.footer-product a:hover,
.footer-product-desc a:hover{
  text-decoration: underline;
}

/* ---------- Orbit Dock (Chat + Online + Media) ---------- */
.eptec-orbit-dock{
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(180px, 0.7fr) minmax(320px, 1.2fr);
  gap: 10px;
  align-items: stretch;
  margin: 10px 0 12px 0;
}

.eptec-online-panel,
.eptec-media-panel{
  background: rgba(10, 16, 24, 0.82);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 8px;
  min-height: 160px;
}

.eptec-online-panel .panel-label,
.eptec-media-panel .panel-label{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  margin-bottom: 6px;
}

.online-list{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.online-chip{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #dfe8ff;
}

.online-chip.role-creator{
  border-color: rgba(110,170,255,.45);
  background: rgba(60,110,170,.35);
}

.online-empty{
  color: rgba(255,255,255,.45);
  font-size: 12px;
  font-style: italic;
}

.eptec-media-panel{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.eptec-media-col{
  min-width: 0;
}

.eptec-media-grid{
  display: grid;
  gap: 6px;
}

.eptec-media-grid-videos{
  grid-template-rows: repeat(3, minmax(52px, auto));
}

.eptec-media-grid-pdfs{
  grid-template-rows: repeat(3, minmax(52px, auto));
}

.eptec-media-grid-audios{
  grid-template-rows: repeat(3, minmax(52px, auto));
}

.eptec-media-slot{
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255,255,255,.04);
}

.eptec-media-slot .media-name{
  font-size: 11px;
  color: rgba(230,235,245,.92);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eptec-media-slot .media-actions{
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.eptec-media-btn{
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 7px;
}

.eptec-webcam-box{
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 8px;
  min-height: 118px;
  padding: 6px;
  background: rgba(0,0,0,.25);
}

.webcam-box-empty{
  font-size: 12px;
  color: rgba(255,255,255,.45);
  font-style: italic;
}

.webcam-box-row{
  font-size: 12px;
  color: rgba(210,240,210,.92);
  margin-bottom: 4px;
}

@media (max-width: 1100px){
  .eptec-orbit-dock{ grid-template-columns: 1fr; }
  .eptec-media-panel{ grid-template-columns: 1fr; }
}

/* ---------- Second Dashboard (strict minimal mode) ---------- */
/* In der HTML-Struktur liegen Chat/Media innerhalb von .eptec-orbit-dock.
   Daher darf nicht der gesamte Dock-Container ausgeblendet werden. */
html.eptec-second-dashboard-only #room1-view .room > :not(.eptec-orbit-dock):not(.room-actions),
html.eptec-second-dashboard-only #room2-view .room > :not(.eptec-orbit-dock):not(.room-actions):not(#r2-toolbar) {
  display: none !important;
}

html.eptec-second-dashboard-only #eptec-footer,
html.eptec-second-dashboard-only #r1-webcam-grid,
html.eptec-second-dashboard-only #r2-webcam-grid,
html.eptec-second-dashboard-only #r1-online-panel,
html.eptec-second-dashboard-only #r2-online-panel,
html.eptec-second-dashboard-only #r1-sub-panel,
html.eptec-second-dashboard-only #r2-sub-panel,
html.eptec-second-dashboard-only #r1-membership-badge,
html.eptec-second-dashboard-only #r2-membership-badge,
html.eptec-second-dashboard-only #r2-top-notice {
  display: none !important;
}

html.eptec-second-dashboard-only #room1-view .room,
html.eptec-second-dashboard-only #room2-view .room {
  width: 100vw;
  min-height: 100vh;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

html.eptec-second-dashboard-only .eptec-orbit-dock {
  display: block;
  margin: 0;
}

/* oben links: Medienpanel */
html.eptec-second-dashboard-only #r1-media-panel,
html.eptec-second-dashboard-only #r2-media-panel {
  display: block !important;
  display: none !important;
  position: fixed;
  left: 14px;
  top: 14px;
  width: auto;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  z-index: 10020;
}

/* Alte Spaltenbeschriftungen wie "Videos (3) / PDF (3) / MP3 (3)" im Second Dashboard ausblenden */
html.eptec-second-dashboard-only #r1-media-panel .eptec-media-col,
html.eptec-second-dashboard-only #r2-media-panel .eptec-media-col,
html.eptec-second-dashboard-only #r1-media-panel .eptec-media-upload-input,
html.eptec-second-dashboard-only #r2-media-panel .eptec-media-upload-input {
  display: none !important;
}

/* Nur die 3 Hauptreiter anzeigen: Video / Audio / Doc */
html.eptec-second-dashboard-only #r1-profile-media-tabs,
html.eptec-second-dashboard-only #r2-profile-media-tabs {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  width: auto !important;
  min-width: 360px;
  flex-direction: row !important;
}

html.eptec-second-dashboard-only #r1-profile-media-tabs .eptec-main-tabs-row,
html.eptec-second-dashboard-only #r2-profile-media-tabs .eptec-main-tabs-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start !important;
  gap: 8px !important;
}

html.eptec-second-dashboard-only #r1-profile-media-tabs button[data-media-main],
html.eptec-second-dashboard-only #r2-profile-media-tabs button[data-media-main] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Vorschau + Cam-Spalte im zweiten Dashboard ausblenden, nur 3 Reiter + Kategorie-Listen */
html.eptec-second-dashboard-only #r1-profile-media-preview,
html.eptec-second-dashboard-only #r2-profile-media-preview,
html.eptec-second-dashboard-only #r1-profile-media-tabs .eptec-stream-cam-controls,
html.eptec-second-dashboard-only #r2-profile-media-tabs .eptec-stream-cam-controls {
  display: none !important;
}

/* unten mittig: Chat */
html.eptec-second-dashboard-only #r1-chat-panel,
html.eptec-second-dashboard-only #r2-chat-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: min(58vw, 980px);
  min-height: 255px;
  z-index: 10025;
}

/* oben rechts: Language + Logout + Profil (nebeneinander) */
html.eptec-second-dashboard-only #language-switcher {
  right: 16px;
  top: 14px;
  z-index: 10040;
}

html.eptec-second-dashboard-only #room1-view .room-actions,
html.eptec-second-dashboard-only #room2-view .room-actions {
  position: fixed !important;
  top: 14px !important;
  right: 74px !important;
  z-index: 10041 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 6px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Room 2 hat Logout im #r2-toolbar (nicht in .room-actions).
   Im Second Dashboard daher Toolbar sichtbar halten,
   aber alle Buttons außer Logout ausblenden. */
html.eptec-second-dashboard-only #r2-toolbar {
  position: fixed !important;
  top: 14px !important;
  right: 74px !important;
  z-index: 10041 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 6px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html.eptec-second-dashboard-only #r2-toolbar > *:not(#btn-logout-room2) {
  display: none !important;
}

html.eptec-second-dashboard-only #room1-view .room-actions > *:not(#btn-logout-room1),
html.eptec-second-dashboard-only #room2-view .room-actions > *:not(#btn-logout-room2) {
  display: none !important;
}

html.eptec-second-dashboard-only #eptec-profile-pip {
  top: 14px !important;
  right: 178px !important;
  z-index: 10039 !important;
}

/* Logout sitzt oben rechts zwischen Language und Profil */
html.eptec-second-dashboard-only #btn-logout-room1,
html.eptec-second-dashboard-only #btn-logout-room2 {
  position: fixed;
  top: 14px;
  right: 84px;
  z-index: 10041;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 86px;
}

/* unten links: Demo/REC/System-Setup – nur in Raum 1/2 */
html.in-room.eptec-second-dashboard-only #eptec-demo-admin-toggle {
  display: flex !important;
  position: fixed !important;
  left: 14px !important;
  bottom: 14px !important;
  z-index: 10055 !important;
}

/* rechts unten: Contractboy (beweglich), darüber Orb */
html.eptec-second-dashboard-only #eptec-contractboy-assist {
  left: auto !important;
  right: 14px !important;
  top: auto !important;
  bottom: 14px !important;
  z-index: 10054 !important;
}

/* Orb: standardmäßig immer versteckt. */
#author-orb {
  display: none !important;
}

/* DIAGNOSE-TEST: Orb für ALLE sichtbar wenn in-room gesetzt. */
html.in-room #author-orb,
html.in-room1 #author-orb,
html.in-room2 #author-orb {
  display: flex !important;
  z-index: 999999 !important;
  background: rgba(255,0,0,0.7) !important;
}

/* Orb sichtbar: privilegierte Rolle + in einem Raum (alle Klassen-Kombinationen) */
html.role-master.in-room #author-orb,
html.role-master.in-room1 #author-orb,
html.role-master.in-room2 #author-orb,
html.role-admin.in-room #author-orb,
html.role-admin.in-room1 #author-orb,
html.role-admin.in-room2 #author-orb,
html.eptec-ui-demo-hard-lock.in-room #author-orb,
html.eptec-ui-demo-hard-lock.in-room1 #author-orb,
html.eptec-ui-demo-hard-lock.in-room2 #author-orb {
  display: flex !important;
  z-index: 999999 !important;
}

/* SD-Modus: Orb umpositionieren */
html.eptec-second-dashboard-only #author-orb {
  right: 22px !important;
  top: auto !important;
  bottom: 284px !important;
  transform: none !important;
  z-index: 10056 !important;
}

/* SD-Modus: Orb auch im Second Dashboard sichtbar für privilegierte Rollen */
html.role-master.eptec-second-dashboard-only.in-room #author-orb,
html.role-master.eptec-second-dashboard-only.in-room1 #author-orb,
html.role-master.eptec-second-dashboard-only.in-room2 #author-orb,
html.role-admin.eptec-second-dashboard-only.in-room #author-orb,
html.role-admin.eptec-second-dashboard-only.in-room1 #author-orb,
html.role-admin.eptec-second-dashboard-only.in-room2 #author-orb,
html.eptec-ui-demo-hard-lock.eptec-second-dashboard-only.in-room #author-orb,
html.eptec-ui-demo-hard-lock.eptec-second-dashboard-only.in-room1 #author-orb,
html.eptec-ui-demo-hard-lock.eptec-second-dashboard-only.in-room2 #author-orb {
  display: flex !important;
  z-index: 999999 !important;
}

/* Admin-Verwaltung nur für Master sichtbar */
#admin-manage-panel { display: none !important; }
html.role-master #admin-manage-panel { display: block !important; }

/* [ROLE-SEP 0.3] Dashboard-Steuerung: Master + Admin */
#role-dashboard-ctrl-panel { display: none !important; }
html.role-master #role-dashboard-ctrl-panel { display: block !important; }
html.role-admin  #role-dashboard-ctrl-panel { display: block !important; }

.login-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-section:first-child { border-top: none; }
.login-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
  margin-bottom: 2px;
}

.stream-slot .stream-hint {
  font-size: 11px;
  color: rgba(230,235,245,.76);
  margin: 6px 0;
}

.stream-slot .stream-file-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.stream-slot.stream-collab,
.stream-slot.stream-main {
  min-height: 160px;
}

.stream-slot.stream-collab {
  opacity: .96;
}

/* ============================================================
   SECOND DASHBOARD – 3 eigenständige Reiter + Stream-Strip
   Jeder Reiter ist ein unabhängiges Dropdown (wie Sprachreiter).
   Standardmäßig versteckt, nur aktiv bei eptec-second-dashboard-only.
   ============================================================ */

/* Standardmäßig IMMER versteckt */
/* Standardmäßig versteckt */
#sd-tabs-panel {
  display: none;
}

/* Sichtbar in Second-Dashboard-Modus – nur in Room 1 und Room 2. */
html.in-room.eptec-second-dashboard-only #sd-tabs-panel {
  display: block !important;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 10030;
}

/* Obere Zeile: Reiter + Stream-Strip nebeneinander */
.sd-top-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px; /* Abstand zwischen den 3 Reitern */
}

/* ---- Einzelner Reiter (eigenständig, mit eigenem Dropdown) ---- */
.sd-reiter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Reiter-Button (wie Sprachreiter) */
.sd-tab-btn {
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(18,20,32,.88);
  color: rgba(215,225,245,.88);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
  position: relative;
  z-index: 2;
}
.sd-tab-btn:hover {
  background: rgba(50,65,110,.92);
  color: #fff;
  border-color: rgba(140,160,220,.5);
}
.sd-tab-btn.sd-tab-open {
  background: rgba(38,52,100,.97);
  color: #fff;
  border-color: rgba(130,155,215,.55);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

/* Dropdown des Reiters: klappt nach unten aus */
.sd-tab-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  max-height: 0;
  overflow: hidden;
  background: rgba(18,20,32,.95);
  border: 1px solid rgba(130,155,215,.3);
  border-top: none;
  border-radius: 0 10px 10px 10px;
  backdrop-filter: blur(14px);
  transition: max-height .22s ease;
  z-index: 10031;
  padding: 0;
}
.sd-tab-dropdown.sd-open {
  max-height: 420px;
  overflow-y: auto;
  padding: 6px 0;
}

/* ---- Kategorie-Zeile im Dropdown ---- */
/* Standardmäßig: nur der Kategorie-Button sichtbar (zentriert) */
.sd-cat-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.sd-cat-row:last-child { border-bottom: none; }

/* Seitengruppen (2×links, 2×rechts): standardmäßig VERSTECKT */
.sd-side-group {
  display: flex;
  flex-direction: row;
  gap: 3px;
}

/* Kategorie-Zeile geöffnet: optisches Highlight nur über Main-Button */
.sd-cat-row.sd-cat-open .sd-side-group {
  display: flex;
}

/* Zentraler Kategorie-Button */
.sd-cat-main-btn {
  flex: 1;
  min-width: 80px;
  padding: 5px 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  color: rgba(210,220,240,.85);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s, color .12s;
}
.sd-cat-main-btn:hover { background: rgba(55,75,150,.4); color: #fff; }
.sd-cat-row.sd-cat-open .sd-cat-main-btn {
  background: rgba(42,60,120,.65);
  color: #fff;
  border-color: rgba(130,155,215,.4);
}
.sd-cat-main-btn.sd-cat-placeholder {
  color: rgba(155,165,195,.38);
  font-style: italic;
}

/* Seitenbuttons (je 2 links, 2 rechts = 4 Slots) */
.sd-cat-side-btn {
  width: 32px;
  height: 26px;
  padding: 2px 3px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.05);
  color: rgba(200,215,240,.72);
  font-size: 9px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s;
}
.sd-cat-side-btn:hover { background: rgba(65,90,170,.45); color: #fff; }
/* Leere Slots: sichtbar aber inaktiv (Platzhalter-Rahmen) */
.sd-cat-side-btn.sd-empty {
  opacity: .35;
  border-style: dashed;
  cursor: pointer;
  pointer-events: auto;
}

/* ---- Rollen-Filter (nur in Raum 1/2) ---- */
/* Creator: darf alle Control-Buttons sehen (kein CSS-Hide mehr). */
/* User: Panel komplett ausblenden */
html.in-room.eptec-second-dashboard-only.role-user #eptec-demo-admin-toggle { display: none !important; }

/* ---- Media-Panel nur in Room 1/2 im SD-Modus ausblenden ---- */
html.in-room.eptec-second-dashboard-only #r1-media-panel,
html.in-room.eptec-second-dashboard-only #r2-media-panel { display: none !important; }


/* ============================================================
   [DEBUG] Kanal-Debug-Overlay  (#eptec-channel-debug)
   Aktivierung: localStorage.setItem("EPTEC_CHANNEL_DEBUG","1")
   Deaktivierung: localStorage.removeItem("EPTEC_CHANNEL_DEBUG")
   ============================================================ */
#eptec-channel-debug {
  display: none; /* JS zeigt/versteckt via .ecd-active */
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 99999;
  width: 270px;
  background: rgba(10,12,18,.93);
  border: 1px solid rgba(120,180,255,.22);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.55);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #b0c8e8;
  user-select: text;
  backdrop-filter: blur(6px);
}
#eptec-channel-debug.ecd-active { display: block; }

#ecd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: move;
}
#ecd-title {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
  color: #7eb8f7;
  text-transform: uppercase;
}
#ecd-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
#ecd-close:hover { color: #fff; }

#ecd-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }

.ecd-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
}
.ecd-row.ecd-active-channel {
  background: rgba(100,200,120,.12);
  border-left: 2px solid #64c878;
  padding-left: 6px;
}
.ecd-ch {
  min-width: 56px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  opacity: .55;
}
.ecd-val {
  font-size: 10px;
  color: #c8d8ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ecd-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 4px 0;
}
.ecd-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ecd-lbl {
  min-width: 100px;
  font-size: 10px;
  opacity: .5;
}
.ecd-field > span:last-child {
  font-weight: 600;
  color: #e8f0ff;
  font-size: 11px;
}
.ecd-future .ecd-lbl { color: #a0b8d8; }
.ecd-future > span:last-child { color: #6af; font-size: 10px; }
.ecd-blocked .ecd-lbl { color: #f08080; }
.ecd-blocked > span:last-child { color: #ff9090; font-size: 10px; }
#ecd-last-blocked { word-break: break-all; }
#ecd-actions { display: flex; gap: 6px; margin-top: 2px; }
#ecd-actions button {
  flex: 1;
  background: rgba(80,120,200,.18);
  border: 1px solid rgba(100,150,255,.25);
  border-radius: 5px;
  color: #a8c8f8;
  font-size: 10px;
  font-family: inherit;
  padding: 4px 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
#ecd-actions button:hover { background: rgba(80,120,200,.38); color: #fff; }
#ecd-test-result {
  margin-top: 5px;
  font-size: 10px;
  min-height: 14px;
  color: #8cf;
  white-space: pre-wrap;
  word-break: break-all;
}
#ecd-test-result.ecd-fail { color: #f88; }
#ecd-test-result.ecd-ok   { color: #8f8; }

/* ============================================================
   [MASTER/ADMIN] KI-Cockpit PiP (#eptec-master-cockpit)
   Nur sichtbar für html.role-master + html.role-admin
   ============================================================ */
#eptec-master-cockpit {
  display: none;
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 99998;
  width: 220px;
  background: rgba(8,12,22,.95);
  border: 1px solid rgba(180,140,255,.28);
  border-radius: 10px;
  box-shadow: 0 4px 28px rgba(0,0,0,.6), 0 0 0 1px rgba(180,140,255,.08);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c8b8f0;
  backdrop-filter: blur(8px);
  user-select: none;
}
html.role-master #eptec-master-cockpit,
html.role-admin  #eptec-master-cockpit { display: block; }

#emc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  cursor: move;
}
#emc-role-badge {
  font-size: 9px;
  color: #b090ff;
}
html.role-master #emc-role-badge { color: #ffd060; }
html.role-admin  #emc-role-badge { color: #80c8ff; }

#emc-title {
  flex: 1;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #d0c0f8;
}
html.role-master #emc-title { color: #ffd060; }
html.role-admin  #emc-title { color: #80c8ff; }

#emc-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  transition: color .15s;
  line-height: 1;
}
#emc-toggle:hover { color: #fff; }

#emc-body { padding: 8px 10px 10px; }
#eptec-master-cockpit.emc-collapsed #emc-body { display: none; }
#eptec-master-cockpit.emc-collapsed #emc-toggle { transform: rotate(-90deg); }

#emc-state-grid { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.emc-row { display: flex; align-items: baseline; gap: 6px; }
.emc-lbl { min-width: 90px; font-size: 10px; opacity: .5; }
.emc-row > span:last-child { font-weight: 600; font-size: 11px; color: #e8e0ff; }

#emc-smoke-status.emc-ok   { color: #80f880; }
#emc-smoke-status.emc-fail { color: #f88080; }
#emc-last-block { color: #f0a080; font-size: 10px; word-break: break-all; }

#emc-actions { display: flex; gap: 6px; margin-bottom: 6px; }
#emc-actions button {
  flex: 1;
  background: rgba(140,100,255,.15);
  border: 1px solid rgba(180,140,255,.22);
  border-radius: 5px;
  color: #c0a8f8;
  font-size: 10px;
  font-family: inherit;
  padding: 4px 4px;
  cursor: pointer;
  transition: background .15s;
}
#emc-actions button:hover { background: rgba(140,100,255,.32); color: #fff; }

#emc-result {
  font-size: 10px;
  min-height: 12px;
  color: #a0c8a0;
  white-space: pre-wrap;
  word-break: break-all;
}
#emc-result.emc-fail { color: #f08080; }
#emc-result.emc-ok   { color: #80f880; }
