:root {
  --ec-bg: #050b16;
  --ec-panel: rgba(8, 18, 34, 0.86);
  --ec-panel-2: rgba(10, 22, 40, 0.92);
  --ec-line: rgba(25, 182, 255, 0.16);
  --ec-line-strong: rgba(25, 182, 255, 0.28);
  --ec-glow: rgba(25, 182, 255, 0.24);
  --ec-text: #dbeaff;
  --ec-muted: #8eadd0;
  --ec-cyan: #19b6ff;
  --ec-green: #31d88f;
  --ec-red: #ff5d70;
  --ec-shadow: 0 14px 34px rgba(0,0,0,.45);
  --ec-radius: 16px;
  --ec-font: Inter, Segoe UI, Arial, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ec-font);
  color: var(--ec-text);
}

/* When using full page mode, prevent the background page from scrolling */
body.ec-page-lock {
  overflow: hidden;
}

/* ===============================
   AUTH OVERLAY (Login + Character Select)
================================ */
.ec-auth-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background: radial-gradient(900px 500px at 50% 0%, rgba(80,150,255,.18), rgba(0,0,0,.65) 60%),
              rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
  z-index: 2147483000;
}
.ec-auth-card{
  width:min(520px, 100%);
  border-radius:16px;
  border:1px solid rgba(140,180,255,.16);
  background: linear-gradient(180deg, rgba(10,26,44,.92), rgba(6,14,26,.92));
  box-shadow: 0 0 0 1px rgba(90,160,255,.06) inset, 0 18px 60px rgba(0,0,0,.55);
  overflow:hidden;
}
.ec-auth-header{ padding:18px 18px 10px; border-bottom:1px solid rgba(140,180,255,.10); }
.ec-auth-title{ font-size:20px; font-weight:800; letter-spacing:.3px; }
.ec-auth-subtitle{ margin-top:4px; font-size:13px; opacity:.75; }
.ec-auth-body{ padding:16px 18px 18px; }
.ec-auth-text{ font-size:13px; opacity:.85; margin-bottom:10px; }
.ec-auth-form{ display:flex; flex-direction:column; gap:10px; }
.ec-auth-label{ font-size:12px; opacity:.75; }
.ec-auth-input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(140,180,255,.14);
  background: rgba(5,10,18,.55);
  color: inherit;
  outline:none;
}
.ec-auth-input:focus{ border-color: rgba(140,180,255,.32); box-shadow:0 0 0 3px rgba(80,150,255,.12); }
.ec-auth-btn{
  margin-top:4px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(140,180,255,.18);
  background: rgba(80,150,255,.18);
  color: inherit;
  font-weight:700;
  cursor:pointer;
}
.ec-auth-btn:disabled{ opacity:.55; cursor:not-allowed; }
.ec-auth-error{
  margin-top:6px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,120,120,.25);
  background: rgba(255,80,80,.10);
  color: rgba(255,210,210,.95);
  font-size:13px;
}
.ec-auth-charlist{ display:grid; grid-template-columns: 1fr; gap:10px; margin-top:10px; }
.ec-auth-char{
  text-align:left;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(140,180,255,.14);
  background: rgba(5,10,18,.50);
  color: inherit;
  cursor:pointer;
}
.ec-auth-char:hover{ border-color: rgba(140,180,255,.30); }
.ec-auth-char-name{ font-weight:800; }
.ec-auth-char-meta{ margin-top:4px; font-size:12px; opacity:.8; display:flex; gap:8px; align-items:center; }
.ec-auth-pill{ font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid rgba(140,180,255,.14); opacity:.9; }
.ec-auth-pill.on{ background: rgba(80,255,170,.12); border-color: rgba(80,255,170,.25); }
.ec-auth-pill.off{ background: rgba(255,200,120,.10); border-color: rgba(255,200,120,.20); }
.ec-auth-empty{ font-size:13px; opacity:.75; padding:10px 0; }
.ec-auth-link{ margin-top:12px; background:transparent; border:none; color: rgba(180,210,255,.85); cursor:pointer; text-decoration:underline; font-size:12px; }

/* Demo background */
.demo-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 70% 5%, rgba(38, 91, 170, 0.28), transparent 70%),
    radial-gradient(700px 420px at 10% 90%, rgba(11, 72, 132, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(4,10,22,.8), rgba(2,6,14,.95)),
    url('https://images.unsplash.com/photo-1518562180175-34a163b1a9a6?auto=format&fit=crop&w=1800&q=80') center/cover no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55));
}
.demo-content {
  position: relative;
  z-index: 1;
  padding: 56px;
}
.demo-content h1 {
  margin: 0 0 10px;
  font-size: 34px;
  color: #ecf6ff;
  text-shadow: 0 0 22px rgba(25,182,255,.18);
}
.demo-content p {
  margin: 0 0 24px;
  color: #c9def7;
}
.demo-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 240px));
  gap: 14px;
}
.demo-card {
  border: 1px solid rgba(25,182,255,.14);
  background: rgba(7,17,31,.55);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--ec-shadow);
}

/* Widget shell */
.ec-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 390px;
  height: 560px;
  border-radius: 18px;
  border: 1px solid var(--ec-line);
  background: linear-gradient(180deg, rgba(8,18,34,.9), rgba(5,10,20,.92));
  box-shadow: var(--ec-shadow), 0 0 0 1px rgba(255,255,255,.015) inset;
  overflow: hidden;
  display: grid;
  grid-template-rows: 56px 42px 1fr auto 44px; /* header | roombar | body | composer | footer */
  z-index: 9999;
  backdrop-filter: blur(10px);
}

/* Full-page mode — acum centrat si incadrat, nu fullscreen */
.ec-widget.ec-page {
  left: auto;
  top: auto;
  right: 18px;
  bottom: 18px;
  transform: none;
  width: 390px;
  height: 560px;
  border-radius: 18px;
}

/* Cand e embedded in panelul website (containerul are overflow:hidden) */
#espada-comms-website-root .ec-widget.ec-page {
  position: absolute;
  inset: 0;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* IMPORTANT: cand widget-ul e embedded in pagina (root cu overflow hidden),
   modul "minimized" trebuie sa iasa din container si sa stea jos-dreapta
   ca un widget normal (altfel ramane full-size dar gol). */
#espada-comms-website-root .ec-widget.ec-page.ec-minimized {
  position: fixed;
  inset: auto;
  left: auto;
  top: auto;
  right: 18px;
  bottom: 18px;
  transform: none;
  width: 420px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(25,182,255,.18);
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
  background: linear-gradient(180deg, rgba(8,20,38,.92), rgba(6,14,26,.86));
  z-index: 2147483000;
}

/* In page mode standalone, expand jos-dreapta mai mare */
.ec-widget.ec-page.ec-expanded:not(#espada-comms-website-root .ec-widget) {
  width: min(780px, calc(100vw - 40px));
  height: min(680px, calc(100vh - 40px));
  right: 18px;
  bottom: 18px;
  left: auto;
  top: auto;
  transform: none;
}

.ec-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(360px 120px at 70% 0%, rgba(25,182,255,.08), transparent 70%);
}

.ec-widget.ec-minimized {
  width: 480px;
  height: 56px;
  grid-template-rows: 56px;
}

/* Cand e in page mode si minimizat, se muta jos-dreapta ca widget normal */
.ec-widget.ec-page.ec-minimized {
  left: auto;
  top: auto;
  right: 18px;
  bottom: 18px;
  transform: none;
  width: 420px;
  border-radius: 14px;
}

.ec-widget.ec-minimized .ec-roombar,
.ec-widget.ec-minimized .ec-body,
.ec-widget.ec-minimized .ec-composer {
  display: none;
}

.ec-widget.ec-expanded {
  width: min(780px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 40px));
  grid-template-rows: 56px 42px 1fr auto 44px;
}

.ec-widget.ec-expanded .ec-body {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
}

.ec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-bottom: 1px solid rgba(25,182,255,.10);
  background: linear-gradient(180deg, rgba(9,20,38,.72), rgba(7,14,26,.55));
}

.ec-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ec-orb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e1f8ff 0%, #48d0ff 35%, #0d4f88 75%);
  box-shadow: 0 0 10px rgba(25,182,255,.7);
  flex: 0 0 auto;
}
.ec-brand-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ec-brand-title strong {
  font-size: 13px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ec-brand-title span {
  font-size: 11px;
  color: var(--ec-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ec-actions {
  display: flex;
  gap: 4px;
  position: relative;
}

.ec-btn,
.ec-icon {
  border: 1px solid rgba(25,182,255,.14);
  background: linear-gradient(180deg, rgba(11,24,45,.9), rgba(6,13,24,.9));
  color: var(--ec-text);
  border-radius: 10px;
  cursor: pointer;
  transition: .15s ease;
  font-family: inherit;
}
.ec-btn:hover,
.ec-icon:hover { box-shadow: 0 0 0 1px rgba(25,182,255,.12), 0 0 14px rgba(25,182,255,.08); }
.ec-btn {
  padding: 5px 7px;
  font-size: 10px;
}
.ec-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.ec-roombar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(25,182,255,.08);
  background: rgba(6,14,26,.55);
}
.ec-select {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(25,182,255,.12);
  background: rgba(5,12,22,.65);
  color: var(--ec-text);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
}

.ec-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
}

.ec-side,
.ec-right {
  display: none;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(25,182,255,.07);
  background: rgba(6,14,25,.35);
}
.ec-widget.ec-expanded .ec-side,
.ec-widget.ec-expanded .ec-right {
  display: flex;
  flex-direction: column;
}
.ec-widget.ec-expanded .ec-right {
  border-right: none;
  border-left: 1px solid rgba(25,182,255,.07);
}

.ec-side-head,
.ec-right-head {
  padding: 10px;
  border-bottom: 1px solid rgba(25,182,255,.07);
  font-size: 12px;
  color: #cfe8ff;
  font-weight: 700;
}

.ec-tree,
.ec-members {
  padding: 8px;
  overflow: auto;
  /* IMPORTANT: allow the scroll area to actually take space inside flex columns */
  flex: 1 1 auto;
  min-height: 0;
}
.ec-tree-group {
  margin-bottom: 10px;
}
.ec-tree-group-title {
  font-size: 11px;
  color: #a2ccf0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(9,22,40,.35);
  border: 1px solid rgba(25,182,255,.05);
  margin-bottom: 6px;
}
.ec-tree-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}
.ec-tree-item:hover { background: rgba(10,24,44,.35); }
.ec-tree-item.active {
  background: linear-gradient(90deg, rgba(12,42,71,.48), rgba(8,19,35,.25));
  border-color: rgba(25,182,255,.12);
  box-shadow: inset 2px 0 0 rgba(25,182,255,.6);
}
.ec-tree-item .meta { color: var(--ec-muted); font-size: 11px; }
/* ── Room wrap container ── */
.ec-tree-room-wrap {
  margin: 2px 0;
}
.ec-tree-room-wrap .ec-tree-item {
  margin: 0;
}

/* ── Room user dropdown (TeamSpeak style) ── */
.ec-tree-room-user {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 18px;
  font-size: 11px;
  color: rgba(200,220,255,.8);
  cursor: default;
  border-radius: 6px;
  transition: background .15s;
}
.ec-tree-room-user:hover { background: rgba(25,182,255,.06); }
.ec-tru-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ec-tru-av {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(25,182,255,.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #a2ccf0;
  flex-shrink: 0;
  overflow: hidden;
}
.ec-tru-av img { width:16px;height:16px;border-radius:50%;object-fit:cover; }
.ec-tru-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ec-tru-icons { font-size: 10px; opacity: .7; }

/* ── Delete message button ── */
.ec-msg-del {
  background: none;
  border: none;
  color: rgba(255,100,100,.0);
  cursor: pointer;
  font-size: 11px;
  padding: 0 3px;
  border-radius: 3px;
  line-height: 1;
  transition: color .15s, background .15s;
  margin-left: 4px;
}
.ec-msg:hover .ec-msg-del,
.ec-msg-del:focus { color: rgba(255,100,100,.7); }
.ec-msg-del:hover { color: #ff4444 !important; background: rgba(255,0,0,.1); }

.ec-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}
.ec-room-banner {
  margin: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(25,182,255,.12);
  background: linear-gradient(180deg, rgba(10,26,46,.55), rgba(7,14,24,.45));
}
.ec-room-banner strong { display: block; font-size: 13px; }
.ec-room-banner span { color: var(--ec-muted); font-size: 11px; }

.ec-chat {
  min-height: 0;
  overflow: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ec-sys {
  align-self: center;
  font-size: 11px;
  color: #b5d3f2;
  background: rgba(8,18,34,.5);
  border: 1px solid rgba(25,182,255,.07);
  border-radius: 999px;
  padding: 5px 8px;
}
.ec-msg {
  max-width: 88%;
  border-radius: 12px;
  border: 1px solid rgba(25,182,255,.08);
  background: rgba(10,21,37,.75);
  padding: 8px 10px;
}
.ec-msg.mine {
  align-self: flex-end;
  background: rgba(8,33,58,.8);
  border-color: rgba(25,182,255,.18);
}
.ec-msg .head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ec-muted);
  margin-bottom: 4px;
}
.ec-msg .name {
  color: #d8edff;
  font-weight: 700;
}
.ec-msg .body {
  font-size: 13px;
  line-height: 1.35;
}

.ec-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(25,182,255,.05);
  background: rgba(8,18,34,.25);
  margin-bottom: 6px;
  font-size: 12px;
}
.ec-member small { color: var(--ec-muted); display:block; }
.ec-state { font-size: 11px; color: #cbe8ff; }
.ec-state.on { color: #b8ffd7; }
.ec-state.off { color: #ffc5ce; }

.ec-signal {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ec-signal-label {
  font-size: 10px;
  color: var(--ec-muted);
}
.ec-signal-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}
.ec-signal-bars i {
  width: 3px;
  border-radius: 2px;
  background: rgba(122,151,180,.35);
  display: block;
}
.ec-signal-bars i:nth-child(1){ height: 5px; }
.ec-signal-bars i:nth-child(2){ height: 7px; }
.ec-signal-bars i:nth-child(3){ height: 9px; }
.ec-signal-bars i:nth-child(4){ height: 11px; }
.ec-signal-bars i.on {
  background: linear-gradient(180deg, #73ecff, #34d18b);
  box-shadow: 0 0 6px rgba(52,209,139,.25);
}

.ec-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-top: 1px solid rgba(25,182,255,.08);
  background: rgba(6,14,25,.72);
}
.ec-composer textarea {
  resize: none;
  height: 38px;
  max-height: 96px;
  border: 1px solid rgba(25,182,255,.12);
  background: rgba(4,10,18,.72);
  color: var(--ec-text);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
}
.ec-composer-tools {
  display: flex;
  gap: 6px;
}
.ec-send {
  padding: 8px 10px;
  font-size: 12px;
}

.ec-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid rgba(25,182,255,.08);
  background: linear-gradient(180deg, rgba(8,16,28,.78), rgba(6,10,20,.9));
}
.ec-user-mini {
  min-width: 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ec-user-mini strong { display:block; font-size: 12px; }
.ec-user-mini span { color: var(--ec-muted); font-size: 11px; }
.ec-quick {
  display: flex;
  gap: 6px;
}
.ec-quick .ec-icon.active {
  border-color: rgba(49,216,143,.2);
  box-shadow: 0 0 10px rgba(49,216,143,.08);
}
.ec-quick .ec-icon.danger {
  border-color: rgba(255,93,112,.2);
}

@media (max-width: 700px) {
  .ec-widget {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
    height: 58vh;
  }
  .ec-widget.ec-expanded {
    width: auto;
    height: 82vh;
  }
  .ec-widget.ec-expanded .ec-body {
    grid-template-columns: 1fr;
  }
  .ec-widget.ec-expanded .ec-side,
  .ec-widget.ec-expanded .ec-right {
    display: none;
  }
  .demo-content {
    padding: 24px;
  }
  .demo-cards {
    grid-template-columns: 1fr;
  }
}

.ec-tree-empty {
  padding: 7px 8px;
  color: var(--ec-muted);
  font-size: 11px;
}

.ec-btn-primary {
  border-color: rgba(25,182,255,.28);
  box-shadow: 0 0 0 1px rgba(25,182,255,.08) inset;
}

.ec-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(2, 7, 14, .62);
  display: grid;
  place-items: center;
  padding: 12px;
  backdrop-filter: blur(4px);
}

.ec-modal {
  width: min(360px, calc(100% - 8px));
  border-radius: 14px;
  border: 1px solid rgba(25,182,255,.18);
  background: linear-gradient(180deg, rgba(10,21,40,.96), rgba(6,12,22,.96));
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  overflow: hidden;
}

.ec-modal-head,
.ec-modal-foot {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(25,182,255,.07);
}
.ec-modal-foot {
  border-bottom: none;
  border-top: 1px solid rgba(25,182,255,.07);
  justify-content: flex-end;
}

.ec-modal-body {
  padding: 10px;
  display: grid;
  gap: 10px;
}
.ec-modal-body label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #cfe8ff;
}
.ec-modal-body label.row-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}
.ec-modal-body input[type="text"],
.ec-modal-body input[type="number"],
.ec-modal-body select {
  border: 1px solid rgba(25,182,255,.13);
  background: rgba(4,10,18,.8);
  color: var(--ec-text);
  border-radius: 9px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

/* hidden in minimized mode */
.ec-widget.ec-minimized .ec-footer {
  display: none;
}

.ec-icon.active {
  border-color: rgba(49,216,143,.28);
  box-shadow: 0 0 0 1px rgba(49,216,143,.12), 0 0 12px rgba(49,216,143,.10);
}

/* Self-muted: in voice dar mic oprit — portocaliu ca in TS3 */
.ec-icon.active.self-muted,
.ec-quick .ec-icon.active.self-muted {
  border-color: rgba(255,160,50,.35);
  box-shadow: 0 0 0 1px rgba(255,160,50,.15), 0 0 12px rgba(255,160,50,.12);
  opacity: 0.75;
}
.ec-local-preview {
  margin: 8px 10px 10px;
  border: 1px solid rgba(25,182,255,.12);
  background: rgba(5,12,22,.55);
  border-radius: 12px;
  overflow: hidden;
}
.ec-local-preview.ec-hidden { display: none; }
.ec-local-preview video {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  background: #02060c;
}
.ec-local-preview-label {
  font-size: 11px;
  color: var(--ec-muted);
  padding: 6px 8px;
  border-top: 1px solid rgba(25,182,255,.08);
}


.ec-modal.ec-modal-devices {
  width: min(680px, calc(100% - 8px));
  max-height: calc(100% - 10px);
  height: calc(100% - 10px);
  display: flex;
  flex-direction: column;
}
.ec-modal.ec-modal-devices .ec-modal-body {
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
}
.ec-device-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.ec-device-note { color: var(--ec-muted); font-size: 11px; }
.ec-device-panel-grid { display:grid; grid-template-columns: 1fr; gap:10px; }
.ec-device-panel { border:1px solid rgba(25,182,255,.12); border-radius:12px; padding:10px; background: rgba(6,14,25,.35); }
.ec-device-panel h4 { margin:0 0 8px; font-size:12px; color:#d8eeff; }
.ec-device-panel label { display:grid; gap:6px; font-size:11px; color:var(--ec-muted); }
.ec-device-meta { margin-top:8px; font-size:11px; color:var(--ec-muted); min-height:14px; }
.ec-device-row-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.ec-meter-wrap { margin-top:8px; height:8px; border:1px solid rgba(25,182,255,.12); border-radius:999px; overflow:hidden; background:rgba(4,10,18,.8); }
.ec-meter-bar { width:0%; height:100%; transition:width .08s linear; background:linear-gradient(90deg, rgba(49,216,143,.7), rgba(255,208,76,.7), rgba(255,104,104,.75)); }
.ec-cam-preview { margin-top:8px; border:1px solid rgba(25,182,255,.12); border-radius:10px; overflow:hidden; background:#03070d; }
.ec-cam-preview video { display:block; width:100%; min-height:160px; max-height:220px; object-fit:contain; background:#02060c; }
@media (min-width: 900px) { .ec-device-panel-grid { grid-template-columns: 1fr 1fr; } .ec-device-panel-grid .ec-device-panel:last-child { grid-column: 1 / -1; } }


.ec-member-main { display:flex; align-items:center; gap:8px; }
.ec-member-avatar { width:36px; height:36px; border-radius:999px; position:relative; display:flex; align-items:center; justify-content:center; background:rgba(100,140,220,0.12); border:1px solid rgba(120,180,255,0.18); flex:0 0 36px; }
.ec-member-avatar-img-wrap { width:100%; height:100%; border-radius:999px; overflow:hidden; position:absolute; inset:0; }
.ec-member-avatar::after { content:""; position:absolute; right:-2px; bottom:-2px; width:10px; height:10px; border-radius:50%; border:2px solid #061424; background:#64748b; z-index:2; }
.ec-member-avatar.active::after  { background:#22c55e; }
.ec-member-avatar.afk::after     { background:#eab308; }
.ec-member-avatar.offline::after { background:#ef4444; }
.ec-member-avatar.logout::after  { background:#64748b; }
.ec-member-avatar-img { width:100%; height:100%; object-fit:cover; }
.ec-member-avatar-text { font-size:14px; font-weight:700; color:#bfe0ff; }

/* Avatar in chat messages */
.ec-msg-avatar { width:28px; height:28px; border-radius:50%; flex:0 0 28px; display:flex; align-items:center; justify-content:center; background:rgba(100,140,220,0.15); border:1px solid rgba(120,180,255,0.2); overflow:hidden; font-size:12px; font-weight:700; color:#bfe0ff; }
.ec-msg-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.ec-msg-row { display:flex; gap:8px; align-items:flex-start; }
.ec-msg-row.mine { flex-direction:row-reverse; }

/* Avatar in DM messages */
.ec-dm-msg-row { display:flex; gap:6px; align-items:flex-start; margin-bottom:6px; }
.ec-dm-msg-row.mine { flex-direction:row-reverse; }
.ec-dm-msg-avatar { width:24px; height:24px; border-radius:50%; flex:0 0 24px; display:flex; align-items:center; justify-content:center; background:rgba(100,140,220,0.15); border:1px solid rgba(120,180,255,0.2); overflow:hidden; font-size:10px; font-weight:700; color:#bfe0ff; }
.ec-dm-msg-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

/* Own avatar in footer */
.ec-my-avatar { width:32px; height:32px; border-radius:50%; flex:0 0 32px; display:flex; align-items:center; justify-content:center; background:rgba(100,140,220,0.2); border:2px solid rgba(25,182,255,0.35); overflow:hidden; font-size:13px; font-weight:700; color:#bfe0ff; cursor:pointer; transition:border-color .2s; position:relative; }
.ec-my-avatar:hover { border-color:rgba(25,182,255,0.7); }
.ec-my-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; position:absolute; inset:0; }
.ec-my-avatar input[type="file"] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; font-size:0; z-index:2; }
.ec-member-signal { display:flex; align-items:flex-end; gap:2px; margin-right:8px; }
.ec-member-signal span { width:3px; border-radius:3px; background:rgba(140,170,210,0.25); display:block; }
.ec-member-signal span:nth-child(1){ height:4px; }
.ec-member-signal span:nth-child(2){ height:6px; }
.ec-member-signal span:nth-child(3){ height:8px; }
.ec-member-signal span:nth-child(4){ height:10px; }
.ec-member-signal span:nth-child(5){ height:12px; }
.ec-member-signal span.on { background:#7dd3fc; box-shadow:0 0 6px rgba(125,211,252,.35); }


/* === Devices dropdown layout (v2) === */
.ec-device-row{
  display:flex;
  gap:14px;
  justify-content:space-between;
  align-items:flex-start;
  padding:12px;
  border:1px solid rgba(25,182,255,.10);
  border-radius:14px;
  background:rgba(8,18,34,.28);
  margin-bottom:10px;
}
.ec-device-left{ flex:1 1 auto; min-width:0; }
.ec-device-right{ flex:0 0 160px; display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.ec-device-title{ font-weight:700; font-size:12px; color:#cfe7ff; letter-spacing:.2px; margin-bottom:6px; }
.ec-device-status{ font-size:12px; color:#9fead1; padding:4px 10px; border-radius:999px; border:1px solid rgba(47,216,138,.22); background:rgba(9,22,40,.55); }
.ec-select-wide{ width:100%; }


/* ============================
   Video Session Modal
============================ */
.ec-modal-video{ width:min(760px, 92vw); }
.ec-badges{ display:flex; gap:8px; margin-left:12px; flex-wrap:wrap; }
.ec-badge{
  display:inline-flex; align-items:center;
  padding:4px 8px; border-radius:999px;
  border:1px solid rgba(25,182,255,.18);
  background:rgba(8,18,34,.45);
  font-size:11px; color:#caeaff;
}
.ec-video-stage{
  position:relative;
  width:100%;
  border:1px solid rgba(25,182,255,.14);
  border-radius:14px;
  background:rgba(5,14,26,.65);
  overflow:hidden;
  min-height:320px;
}
.ec-video-main{
  width:100%;
  height:320px;
  display:block;
  object-fit:cover;
  background:rgba(0,0,0,.35);
}
.ec-video-pip{
  position:absolute;
  right:12px;
  bottom:12px;
  width:min(220px, 34%);
  aspect-ratio: 16 / 9;
  border-radius:12px;
  overflow:hidden;
  border:1px solid rgba(25,182,255,.22);
  box-shadow:0 8px 18px rgba(0,0,0,.35);
  background:rgba(0,0,0,.25);
}
.ec-video-pip video{
  width:100%;
  height:100%;
  object-fit:cover;
}
.ec-video-controls{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-top:12px;
}

/* Auth gate: prevent page scroll while login/character select overlay is open */
body.ec-page-lock{ overflow:hidden !important; }


/* Status select în footer */
.ec-status-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(25,182,255,.14);
  background: linear-gradient(180deg, rgba(11,24,45,.9), rgba(6,13,24,.9));
  border-radius: 10px;
  padding: 0 6px 0 5px;
  height: 26px;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.ec-status-wrap:hover {
  box-shadow: 0 0 0 1px rgba(25,182,255,.12), 0 0 14px rgba(25,182,255,.08);
}
.ec-status-label {
  font-size: 11px;
  color: var(--ec-text);
}
.ec-status-menu {
  position: absolute;
  top: 38px;
  right: 80px;
  background: #0b1830;
  border: 1px solid rgba(25,182,255,.18);
  border-radius: 8px;
  padding: 4px;
  z-index: 999;
  min-width: 110px;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.ec-status-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ec-text);
  white-space: nowrap;
}
.ec-status-option:hover {
  background: rgba(25,182,255,.1);
}
.ec-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  background: #64748b;
}
.ec-status-dot.active  { background: #22c55e; }
.ec-status-dot.afk     { background: #eab308; }
.ec-status-dot.offline { background: #ef4444; }
.ec-status-dot.logout  { background: #64748b; }

.ec-member-avatar::after { content:""; position:absolute; right:-2px; bottom:-2px; width:10px; height:10px; border-radius:50%; border:2px solid #061424; background:#64748b; z-index:2; }
.ec-member-avatar.active::after  { background:#22c55e; }
.ec-member-avatar.afk::after     { background:#eab308; }
.ec-member-avatar.offline::after { background:#ef4444; }
.ec-member-avatar.logout::after  { background:#64748b; }

.ec-status-select {
  background: transparent;
  border: none;
  color: var(--ec-text);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  padding: 0;
  font-family: inherit;
}
.ec-status-select:focus { outline: none; }
.ec-status-select option { background: #050b16; color: var(--ec-text); }

/* ═══════════════════════════════════════════════════════
   DM PANEL — chat privat 1-la-1
═══════════════════════════════════════════════════════ */
.ec-dm-panel {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(6,12,24,.98), rgba(5,9,18,.99));
  border-radius: inherit;
  animation: ec-slide-in .18s ease;
}
@keyframes ec-slide-in {
  from { opacity:0; transform: translateX(18px); }
  to   { opacity:1; transform: translateX(0); }
}
.ec-dm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(25,182,255,.10);
  background: linear-gradient(180deg, rgba(9,20,38,.8), rgba(7,14,26,.6));
  gap: 8px;
}
.ec-dm-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ec-dm-avatar-wrap {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 13px;
}
.ec-dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ec-dm-msg {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.ec-dm-msg.mine {
  align-self: flex-end;
  align-items: flex-end;
}
.ec-dm-msg.theirs {
  align-self: flex-start;
  align-items: flex-start;
}
.ec-dm-msg-text {
  padding: 7px 11px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.ec-dm-msg.mine .ec-dm-msg-text {
  background: rgba(25,182,255,.18);
  border: 1px solid rgba(25,182,255,.22);
  color: #e6f4ff;
  border-bottom-right-radius: 4px;
}
.ec-dm-msg.theirs .ec-dm-msg-text {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #c8dff5;
  border-bottom-left-radius: 4px;
}
.ec-dm-msg-time {
  font-size: 10px;
  color: rgba(160,200,240,.4);
  padding: 2px 4px;
}
.ec-dm-composer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(25,182,255,.08);
  background: rgba(6,10,20,.7);
}
.ec-dm-textarea {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(25,182,255,.12);
  border-radius: 10px;
  color: var(--ec-text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
  height: 38px;
  outline: none;
  transition: border-color .15s;
}
.ec-dm-textarea:focus {
  border-color: rgba(25,182,255,.3);
}
.ec-dm-call-btn {
  background: rgba(25,182,255,.1);
  border-color: rgba(25,182,255,.25);
}
.ec-dm-call-btn:hover {
  background: rgba(25,182,255,.18);
}

/* ═══════════════════════════════════════════════════════
   VIDEO CALL PANEL — WebRTC 1-la-1
═══════════════════════════════════════════════════════ */
.ec-call-panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #05080f;
  border-radius: inherit;
  animation: ec-slide-in .18s ease;
}
.ec-call-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(25,182,255,.10);
  background: rgba(8,16,28,.9);
  color: #d6f2ff;
  font-weight: 600;
  font-size: 13px;
}
.ec-call-videos {
  flex: 1;
  position: relative;
  background: #000;
}
.ec-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ec-local-video {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(25,182,255,.3);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.ec-call-hint {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(6,12,24,.75);
  border: 1px solid rgba(25,182,255,.18);
  color: #bfeaff;
  font-size: 12px;
  backdrop-filter: blur(4px);
}
.ec-call-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px 12px;
  border-top: 1px solid rgba(25,182,255,.08);
  background: rgba(6,10,20,.9);
}
.ec-call-ctrl {
  min-width: 90px;
}


/* ═══════════════════════════════════════════════════════
   DM WINDOWS v15 — ferestre private flotante
═══════════════════════════════════════════════════════ */

/* Taskbar jos-dreapta, langa widget */
.ec-dm-taskbar {
  position: fixed;
  bottom: 0;
  right: 630px;
  display: flex;
  align-items: flex-end;
  flex-direction: row-reverse;
  gap: 10px;
  z-index: 100000;
  pointer-events: none;
}

/* Fereastra DM text — flotanta, drag-and-drop */
.ec-dm-window {
  width: 300px;
  height: 390px;
  background: linear-gradient(180deg, #07101f 0%, #050c18 100%);
  border: 1px solid rgba(25,182,255,.28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.85), 0 0 0 1px rgba(25,182,255,.08);
  pointer-events: all;
  overflow: hidden;
  flex-shrink: 0;
}

.ec-dm-window.minimized {
  height: 38px;
  width: 220px;
}

/* Header */
.ec-dm-win-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  height: 38px;
  min-height: 38px;
  background: linear-gradient(90deg, rgba(9,22,44,.98), rgba(7,16,32,.95));
  border-bottom: 1px solid rgba(25,182,255,.10);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.ec-dm-win-header:hover { background: linear-gradient(90deg, rgba(14,30,58,.98), rgba(10,22,42,.95)); }

.ec-dm-win-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(25,182,255,.3), rgba(49,216,143,.2));
  border: 1.5px solid rgba(25,182,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #e0f4ff; flex-shrink: 0;
  overflow: hidden;
}
.ec-dm-win-avatar.online { border-color: rgba(49,216,143,.6); }
.ec-dm-win-avatar.afk    { border-color: rgba(255,190,60,.5); }
.ec-dm-win-avatar.offline,.ec-dm-win-avatar.logout { border-color: rgba(120,140,180,.2); }

.ec-dm-win-info { flex: 1; min-width: 0; }
.ec-dm-win-name {
  font-size: 12px; font-weight: 700; color: #dbeaff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.ec-dm-win-status { font-size: 10px; color: rgba(140,180,220,.45); line-height: 1.2; }

.ec-dm-win-unread {
  background: #19b6ff; color: #020c1a;
  border-radius: 10px; font-size: 9px; font-weight: 700;
  padding: 1px 5px; min-width: 16px; text-align: center; flex-shrink: 0;
}

.ec-dm-win-btns { display: flex; gap: 3px; flex-shrink: 0; }
.ec-dm-win-btn {
  width: 20px; height: 20px; border-radius: 5px;
  border: 1px solid rgba(25,182,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(160,200,240,.5); font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .12s; line-height: 1;
}
.ec-dm-win-btn:hover { background: rgba(25,182,255,.1); color: #19b6ff; border-color: rgba(25,182,255,.28); }
.ec-dm-win-btn.call  { color: rgba(49,216,143,.65); border-color: rgba(49,216,143,.18); }
.ec-dm-win-btn.call:hover { background: rgba(49,216,143,.1); color: #31d88f; }
.ec-dm-win-btn.close:hover { background: rgba(255,80,80,.1); color: #ff5d70; border-color: rgba(255,80,80,.28); }

/* Mesaje */
.ec-dm-win-messages {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(25,182,255,.1) transparent;
}
.ec-dm-win-messages::-webkit-scrollbar { width: 3px; }
.ec-dm-win-messages::-webkit-scrollbar-thumb { background: rgba(25,182,255,.12); border-radius: 2px; }

.ec-dm-win-msg { display: flex; flex-direction: column; max-width: 88%; }
.ec-dm-win-msg.mine   { align-self: flex-end;  align-items: flex-end; }
.ec-dm-win-msg.theirs { align-self: flex-start; align-items: flex-start; }

.ec-dm-win-msg-text {
  padding: 5px 9px; border-radius: 12px;
  font-size: 12px; line-height: 1.4; word-break: break-word;
}
.ec-dm-win-msg.mine   .ec-dm-win-msg-text {
  background: rgba(25,182,255,.18); border: 1px solid rgba(25,182,255,.22);
  color: #e8f5ff; border-bottom-right-radius: 3px;
}
.ec-dm-win-msg.theirs .ec-dm-win-msg-text {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07);
  color: #c5daf5; border-bottom-left-radius: 3px;
}
.ec-dm-win-msg-time { font-size: 9px; color: rgba(140,180,220,.3); padding: 1px 3px; }
.ec-dm-win-empty { text-align: center; color: rgba(140,180,220,.28); font-size: 11px; padding: 16px 8px; }

/* Compositor */
.ec-dm-win-composer {
  display: flex; gap: 5px; padding: 6px;
  border-top: 1px solid rgba(25,182,255,.07);
  background: rgba(4,8,18,.75); flex-shrink: 0;
}
.ec-dm-win-input {
  flex: 1; background: rgba(255,255,255,.04);
  border: 1px solid rgba(25,182,255,.1); border-radius: 7px;
  color: var(--ec-text); font-family: inherit; font-size: 12px;
  padding: 5px 8px; resize: none; height: 30px; min-height: 30px;
  max-height: 72px; outline: none; transition: border-color .12s;
}
.ec-dm-win-input:focus { border-color: rgba(25,182,255,.28); }
.ec-dm-win-send {
  height: 30px; padding: 0 10px; border-radius: 7px;
  border: 1px solid rgba(25,182,255,.2); background: rgba(25,182,255,.1);
  color: #19b6ff; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .12s; white-space: nowrap; flex-shrink: 0;
}
.ec-dm-win-send:hover { background: rgba(25,182,255,.18); }

/* Control butoane apel in fereastra video */
.ec-dm-win-ctrl {
  height: 26px; padding: 0 12px; border-radius: 6px;
  border: 1px solid rgba(25,182,255,.15);
  background: rgba(255,255,255,.04);
  color: rgba(180,210,240,.8); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .12s;
}
.ec-dm-win-ctrl.accept { border-color: rgba(49,216,143,.35); color: #31d88f; }
.ec-dm-win-ctrl.accept:hover { background: rgba(49,216,143,.12); }
.ec-dm-win-ctrl.hangup { border-color: rgba(255,80,80,.3); color: #ff8a95; }
.ec-dm-win-ctrl.hangup:hover { background: rgba(255,80,80,.1); }

/* Ascunde vechiul panou DM */
#ec-dm-panel { display: none !important; }

/* DM composer: emoji + attach buttons */
.ec-dm-win-btn-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(25,182,255,.06);
  border: 1px solid rgba(25,182,255,.12);
  border-radius: 6px; cursor: pointer;
  font-size: 14px; color: rgba(140,200,255,.7);
  transition: all .12s; position: relative; overflow: hidden;
}
.ec-dm-win-btn-icon:hover { background: rgba(25,182,255,.14); border-color: rgba(25,182,255,.3); color: #19b6ff; }
.attach-btn { cursor: pointer; }

/* Emoji picker */
.ec-dm-emoji-picker button:hover { background: rgba(25,182,255,.12) !important; }

/* DM composer layout cu butoane */
.ec-dm-win-composer {
  display: flex !important;
  align-items: flex-end;
  gap: 4px;
  padding: 6px !important;
}

/* Video call fullscreen mode */
#ec-dm-video-win:fullscreen,
#ec-dm-video-win:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  top: 0 !important; left: 0 !important;
  transform: none !important;
}
#ec-dm-video-win:fullscreen #ec-vw-body,
#ec-dm-video-win:-webkit-full-screen #ec-vw-body {
  flex: 1;
}

/* Room access icons */
.ec-room-lock { font-size: 10px; margin-right: 3px; opacity: .8; }
.ec-room-owner { font-size: 10px; margin-right: 3px; color: #f5c518; }

/* Create room modal — password field toggle */
.ec-modal .ec-pwd-row { margin-top: 2px; }
.ec-modal select option { background: #0d1f3c; color: #c5daf5; }

/* Modal body spacing */
.ec-modal-body label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: rgba(180,210,255,.7); }
.ec-modal-body label input,
.ec-modal-body label select { background: rgba(255,255,255,.04); border: 1px solid rgba(25,182,255,.15); border-radius: 7px; color: #c5daf5; font-size: 12px; padding: 6px 9px; outline: none; transition: border-color .12s; }
.ec-modal-body label input:focus,
.ec-modal-body label select:focus { border-color: rgba(25,182,255,.4); }

/* ── Room Settings Button ── */
.ec-room-settings-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(140,180,255,0); font-size: 13px; padding: 0 2px;
  border-radius: 4px; line-height: 1; transition: color .15s, background .15s;
  flex-shrink: 0;
}
.ec-tree-item:hover .ec-room-settings-btn { color: rgba(140,180,255,.6); }
.ec-room-settings-btn:hover { color: #a2ccf0 !important; background: rgba(25,182,255,.1); }

/* ── Modal Tabs ── */
.ec-modal-tabs {
  display: flex; border-bottom: 1px solid rgba(25,182,255,.15);
  padding: 0 14px; gap: 2px;
}
.ec-tab-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(140,180,255,.6); font-size: 12px; padding: 8px 12px;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.ec-tab-btn:hover { color: #a2ccf0; }
.ec-tab-btn.active { color: #19b6ff; border-bottom-color: #19b6ff; }

/* ── Modal Settings wide ── */
.ec-modal-settings { min-width: 340px; max-width: 420px; }

/* ── Form groups in modal ── */
.ec-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ec-form-group label { font-size: 11px; color: rgba(140,180,255,.7); text-transform: uppercase; letter-spacing: .5px; }
.ec-form-group input, .ec-form-group select {
  background: rgba(10,22,40,.8); border: 1px solid rgba(25,182,255,.2);
  color: #e6f0ff; padding: 7px 10px; border-radius: 6px; font-size: 13px;
  outline: none; transition: border-color .15s;
}
.ec-form-group input:focus, .ec-form-group select:focus { border-color: rgba(25,182,255,.5); }
.ec-form-group select option { background: #0a1628; }

/* ── Member row in settings ── */
.ec-member-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; background: rgba(25,182,255,.04);
}
.ec-member-row-name { flex: 1; font-size: 13px; color: #e6f0ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-role-select {
  background: rgba(10,22,40,.8); border: 1px solid rgba(25,182,255,.2);
  color: #a2ccf0; padding: 3px 6px; border-radius: 4px; font-size: 12px; cursor: pointer;
}
.ec-btn-danger {
  background: rgba(220,50,50,.15); border: 1px solid rgba(220,50,50,.3);
  color: rgba(255,120,120,.9); padding: 5px 10px; border-radius: 6px;
  cursor: pointer; font-size: 12px; transition: background .15s;
}
.ec-btn-danger:hover { background: rgba(220,50,50,.3); }

/* ── Invisible status dot ── */
.ec-status-dot.invisible {
  background: transparent;
  border: 2px solid rgba(140,180,255,.5);
  box-shadow: none;
}
.ec-status-option [class*="invisible"] {
  background: transparent;
  border: 2px solid rgba(140,180,255,.5);
}
.ec-auth-pill.gm { background: rgba(255,200,50,.15); color: #ffd700; border: 1px solid rgba(255,200,50,.3); font-weight: 700; }

/* ── Admin Panel ── */
.ec-modal-admin { min-width: 580px; max-width: 700px; }
.ec-modal-admin table th { font-weight: 600; }

/* ── PTT / VAD Indicator ─────────────────────────────────────── */
.ew-ptt-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  color: rgba(180,210,255,.7);
  background: rgba(0,0,0,.3);
  border-top: 1px solid rgba(255,255,255,.05);
  user-select: none;
  transition: background .15s, color .15s;
}
.ew-ptt-indicator.active {
  background: rgba(220,40,40,.22);
  color: #ff6b6b;
  border-top-color: rgba(220,40,40,.3);
  animation: ew-ptt-pulse 0.8s infinite;
}
.ew-ptt-indicator.ew-vad.active {
  background: rgba(49,216,143,.18);
  color: #31d88f;
  border-top-color: rgba(49,216,143,.3);
}
@keyframes ew-ptt-pulse {
  0%,100% { opacity:1; }
  50%      { opacity:.7; }
}

/* ── Voice Mode buttons in Devices modal ─────────────────────── */
.ew-vm-btn {
  border: 1px solid rgba(0,188,212,.2) !important;
  color: rgba(180,210,255,.7) !important;
  background: rgba(0,188,212,.05) !important;
  transition: all .15s !important;
}
.ew-vm-btn:hover {
  background: rgba(0,188,212,.12) !important;
  color: #00bcd4 !important;
}
.ew-vm-btn.active {
  background: rgba(0,188,212,.2) !important;
  border-color: rgba(0,188,212,.6) !important;
  color: #00e5ff !important;
  font-weight: 700 !important;
}


/* PTT transmit state on user dots */
.ec-member-avatar.is-transmitting::after,
.ec-tru-dot.is-transmitting {
  background: linear-gradient(135deg, #a855f7 0%, #ef4444 100%) !important;
  box-shadow: 0 0 0 2px rgba(168,85,247,.18), 0 0 10px rgba(239,68,68,.45);
}

/* ── Talking-While-Muted warning banner ─────────────────────────── */
.ew-twm-warn {
  display: none;
  margin: 0 8px 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: rgba(239, 68, 68, .18);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #fca5a5;
  letter-spacing: .01em;
  animation: ew-twm-pulse 0.6s ease-in-out;
}
.ew-twm-warn.visible {
  display: block;
}
@keyframes ew-twm-pulse {
  0%   { opacity: 0; transform: translateY(4px); }
  30%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Per-user volume context menu ───────────────────────────────── */
.ec-vol-menu {
  position: fixed;
  z-index: 99999;
  background: rgba(10, 18, 30, 0.97);
  border: 1px solid rgba(25, 182, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
}
.ec-vol-head {
  font-size: 12px;
  font-weight: 700;
  color: #e0e6f0;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ec-vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ec-vol-slider {
  flex: 1;
  accent-color: #19b6ff;
  height: 4px;
}
.ec-vol-val {
  font-size: 12px;
  font-weight: 700;
  color: #19b6ff;
  min-width: 38px;
  text-align: right;
}
.ec-vol-hint {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  margin-top: 6px;
}

/* ── Voice Clarity toggleuri ─────────────────────────────────────── */
.ew-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.ew-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #19b6ff;
  cursor: pointer;
  flex-shrink: 0;
}
.ew-toggle-label {
  font-size: 12px;
  color: rgba(200, 220, 255, 0.85);
  line-height: 1.3;
}
#ew-clarity-section {
  border-top: 1px solid rgba(25, 182, 255, 0.08);
  padding-top: 12px;
  margin-top: 4px;
}

/* ── Mic Volume (Gain) slider ───────────────────────────────────── */
.ew-gain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 2px;
}
.ew-gain-lbl {
  font-size: 11px;
  color: rgba(180, 210, 255, 0.6);
  white-space: nowrap;
  min-width: 70px;
}
.ew-gain-slider {
  flex: 1;
  accent-color: #19b6ff;
  height: 4px;
}
.ew-gain-val {
  font-size: 11px;
  font-weight: 700;
  color: #19b6ff;
  min-width: 36px;
  text-align: right;
}

/* =========================================================
   MOBILE OVERRIDE — keep desktop layout and scale the whole
   page widget down on phones (embedded website + standalone)
========================================================= */
@media (max-width: 700px) {
  .ec-widget.ec-page.ec-expanded,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded {
    position: fixed !important;
    inset: auto 10px 10px auto !important;
    width: 780px !important;
    height: 680px !important;
    max-width: none !important;
    max-height: none !important;
    left: auto !important;
    top: auto !important;
    right: 10px !important;
    bottom: 10px !important;
    transform-origin: right bottom !important;
    --ec-mobile-scale: min(calc((100vw - 20px) / 780), calc((100vh - 20px) / 680));
    transform: scale(var(--ec-mobile-scale)) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    z-index: 2147483000 !important;
    box-shadow: 0 14px 40px rgba(0,0,0,.55) !important;
  }

  .ec-widget.ec-page.ec-expanded .ec-body,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-body {
    display: grid !important;
    grid-template-columns: 200px 1fr 200px !important;
  }

  .ec-widget.ec-page.ec-expanded .ec-side,
  .ec-widget.ec-page.ec-expanded .ec-right,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-side,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-right {
    display: flex !important;
    flex-direction: column !important;
  }

  .ec-widget.ec-page.ec-expanded .ec-main,
  .ec-widget.ec-page.ec-expanded .ec-chat,
  .ec-widget.ec-page.ec-expanded .ec-tree,
  .ec-widget.ec-page.ec-expanded .ec-members,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-main,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-chat,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-tree,
  #espada-comms-website-root .ec-widget.ec-page.ec-expanded .ec-members {
    min-height: 0 !important;
  }

  /* embedded root must not clip the scaled widget */
  #espada-comms-website-root {
    overflow: visible !important;
  }

  /* minimized bar on phones */
  .ec-widget.ec-page.ec-minimized,
  #espada-comms-website-root .ec-widget.ec-page.ec-minimized {
    position: fixed !important;
    inset: auto 10px 10px auto !important;
    left: auto !important;
    top: auto !important;
    right: 10px !important;
    bottom: 10px !important;
    width: 220px !important;
    max-width: calc(100vw - 20px) !important;
    height: 56px !important;
    transform: none !important;
  }
}
