/* белая страница, никаких зависимостей */
html, body { height: 100%; margin: 0; }
body { font-family: Arial, Helvetica, sans-serif; background: #fff; color: #111; }

.ec-page {
  min-height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  box-sizing: border-box;
}

.ec-card {
  width: 980px;
  max-width: 100%;
  height: calc(100vh - 32px);
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.ec-header {
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid #eee;
}

.ec-title { font-weight: bold; font-size: 16px; }
.ec-sub { font-size: 12px; color: #666; margin-top: 4px; }

.ec-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #fff;
}

.ec-msg { margin: 0 0 10px 0; display: flex; }
.ec-msg.user { justify-content: flex-end; }

.ec-bubble {
  max-width: 78%;
  padding: 10px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
}

.ec-msg.user .ec-bubble {
  background: #111;
  color: #fff;
  border-top-right-radius: 4px;
}

.ec-msg.assistant .ec-bubble {
  background: #f3f4f6;
  color: #111;
  border-top-left-radius: 4px;
}

.ec-foot {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #eee;
  background: #fff;
}

.ec-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 11px;
  font-size: 13px;
  outline: none;
}

.ec-send {
  border: 0;
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  cursor: pointer;
}

.ec-send:disabled { opacity: .5; cursor: default; }

.ec-hint {
  padding: 10px 14px;
  border-top: 1px solid #f2f2f2;
  font-size: 12px;
  color: #777;
}

/* нормальный HTML от ассистента */
.ec-msg.assistant .ec-bubble p { margin: 0 0 10px 0; }
.ec-msg.assistant .ec-bubble p:last-child { margin-bottom: 0; }

.ec-msg.assistant .ec-bubble ul,
.ec-msg.assistant .ec-bubble ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}

.ec-msg.assistant .ec-bubble li { margin: 4px 0; }

.ec-msg.assistant .ec-bubble b,
.ec-msg.assistant .ec-bubble strong { font-weight: 700; }

.ec-msg.assistant .ec-bubble code {
  font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
  font-size: 12px;
}

.ec-msg.assistant .ec-bubble pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0;
}

/* ===== СПИННЕР “Электрик печатает…” ===== */
.ec-typing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ec-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,.18);
  border-top-color: rgba(0,0,0,.75);
  border-radius: 50%;
  animation: ecspin .8s linear infinite;
}

@keyframes ecspin {
  to { transform: rotate(360deg); }
}

.ec-typing-text {
  font-size: 13px;
  color: #666;
}
