/* Esils Chat Widget - compact XE sidebar style */
.emc-chat {
  width: 100%;
  max-width: 220px;
  margin: 8px auto 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 12px;
  color: #111827;
  box-sizing: border-box;
}

.emc-chat * { box-sizing: border-box; }

.emc-chat .emc-box {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.emc-chat .emc-header {
  width: 100%;
  border: 0;
  cursor: pointer;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #10b981 100%);
  font: inherit;
  text-align: left;
}

.emc-chat .emc-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emc-chat .emc-meta {
  font-size: 11px;
  opacity: 0.9;
  white-space: nowrap;
}

.emc-chat .emc-panel {
  display: block;
  padding: 8px;
  background: #f8fafc;
}

.emc-chat .is-collapsed .emc-panel { display: none; }

.emc-chat .emc-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 0;
  margin-bottom: 4px;
}

.emc-chat .emc-admin-link {
  border-radius: 999px;
  padding: 3px 8px;
  background: #334155;
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  text-decoration: none;
}

.emc-chat .emc-messages {
  height: 190px;
  overflow-y: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.emc-chat .emc-message {
  position: relative;
  padding: 7px 8px;
  margin: 0 0 6px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: #ffffff;
}

.emc-chat .emc-message.is-deleted {
  opacity: 0.62;
  background: #f1f5f9;
}

.emc-chat .emc-message-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.emc-chat .emc-nick {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #0f172a;
}

.emc-chat .emc-time {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

.emc-chat .emc-content {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
  color: #1f2937;
}

.emc-chat .emc-delete {
  margin-top: 5px;
  border: 0;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  color: #ffffff;
  background: #ef4444;
  cursor: pointer;
}

.emc-chat .emc-notice {
  display: none;
  padding: 7px 8px;
  margin: 4px 0 7px;
  border-radius: 9px;
  background: #e0f2fe;
  color: #075985;
  line-height: 1.35;
}

.emc-chat .emc-notice.is-warn {
  background: #fef3c7;
  color: #92400e;
}

.emc-chat .emc-form {
  display: flex;
  gap: 5px;
  align-items: stretch;
}

.emc-chat .emc-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  max-height: 72px;
  resize: vertical;
  padding: 7px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
  color: #111827;
  outline: none;
  font: inherit;
  line-height: 1.3;
}

.emc-chat .emc-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.emc-chat .emc-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  color: #ffffff;
  background: #16a34a;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.emc-chat .emc-send:disabled,
.emc-chat .emc-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .emc-chat { max-width: none !important; }
  .emc-chat .emc-messages { height: 170px; }
}
