.slc-root {
  --slc-bg: #111827;
  --slc-panel: #1f2937;
  --slc-text: #f9fafb;
  --slc-muted: #9ca3af;
  --slc-accent: #2563eb;
  --slc-visitor: #374151;
  --slc-staff: #1d4ed8;
  position: fixed;
  z-index: 99990;
  right: 18px;
  bottom: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.slc-launcher {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--slc-accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.slc-launcher:hover { filter: brightness(1.08); }

.slc-panel {
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 100px));
  background: var(--slc-panel);
  color: var(--slc-text);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.slc-root.is-open .slc-panel { display: flex; }
.slc-root.is-open .slc-launcher { display: none; }

.slc-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slc-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.slc-header p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.slc-close {
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.slc-meta {
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.slc-meta input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--slc-bg);
  color: var(--slc-text);
  padding: 8px 10px;
  font-size: 13px;
}

.slc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--slc-bg);
}

.slc-empty {
  color: var(--slc-muted);
  font-size: 13px;
  text-align: center;
  margin: auto;
  padding: 20px;
  line-height: 1.45;
}

.slc-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.slc-bubble--visitor {
  align-self: flex-end;
  background: var(--slc-visitor);
  border-bottom-right-radius: 4px;
}

.slc-bubble--staff {
  align-self: flex-start;
  background: var(--slc-staff);
  border-bottom-left-radius: 4px;
}

.slc-bubble--system {
  align-self: center;
  background: transparent;
  color: var(--slc-muted);
  font-size: 12px;
  text-align: center;
}

.slc-composer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--slc-panel);
}

.slc-composer textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 90px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--slc-bg);
  color: var(--slc-text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}

.slc-composer button {
  border: 0;
  border-radius: 10px;
  background: var(--slc-accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.slc-composer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.slc-launcher-wrap { position: relative; }
.slc-launcher-wrap.has-unread .slc-badge { display: inline-flex; }

@media (max-width: 480px) {
  .slc-root { right: 10px; bottom: 10px; }
  .slc-panel {
    width: calc(100vw - 20px);
    height: min(70vh, 560px);
  }
}
