#michal-n8n-chat-root,
#michal-n8n-chat-root * { box-sizing: border-box; }

.mnc-wrap {
  position: fixed;
  bottom: 22px;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
.mnc-wrap.mnc-right { right: 22px; }
.mnc-wrap.mnc-left { left: 22px; }

.mnc-toggle {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: var(--mnc-primary, #10b981);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .18s ease, opacity .18s ease;
}
.mnc-toggle:hover { transform: translateY(-2px); }
.mnc-toggle svg { width: 28px; height: 28px; fill: currentColor; }
.mnc-toggle-hidden { opacity: 0; pointer-events: none; position: absolute; bottom: 0; }

.mnc-window {
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 44px));
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,23,42,.24);
  display: flex;
  flex-direction: column;
}
.mnc-window[hidden] { display: none !important; }

.mnc-header {
  min-height: 70px;
  padding: 14px 14px 14px 18px;
  background: var(--mnc-primary, #10b981);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mnc-header-copy { display: flex; flex-direction: column; min-width: 0; }
.mnc-header-copy strong { font-size: 16px; line-height: 1.25; color: inherit; }
.mnc-header-copy span { font-size: 12px; opacity: .88; margin-top: 2px; }
.mnc-header-actions { display: flex; align-items: center; gap: 4px; }
.mnc-header-actions button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.mnc-header-actions button:hover { background: rgba(255,255,255,.22); }
.mnc-new { font-size: 18px !important; }

.mnc-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 10px;
  background: #f8fafc;
  scrollbar-width: thin;
}
.mnc-message { display: flex; margin: 0 0 11px; }
.mnc-message.mnc-user { justify-content: flex-end; }
.mnc-message.mnc-assistant { justify-content: flex-start; }
.mnc-bubble {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 15px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
  overflow-wrap: anywhere;
}
.mnc-user .mnc-bubble {
  color: #fff;
  background: var(--mnc-primary, #10b981);
  border-bottom-right-radius: 5px;
}
.mnc-assistant .mnc-bubble { border-bottom-left-radius: 5px; }
.mnc-bubble a { color: inherit; text-decoration: underline; }
.mnc-bubble code { padding: 1px 4px; background: rgba(15,23,42,.07); border-radius: 4px; font-size: .92em; }
.mnc-error .mnc-bubble { color: #991b1b; background: #fef2f2; }

.mnc-typing { min-width: 53px; display: flex; gap: 4px; align-items: center; }
.mnc-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: mnc-dot 1s infinite ease-in-out;
}
.mnc-typing i:nth-child(2) { animation-delay: .12s; }
.mnc-typing i:nth-child(3) { animation-delay: .24s; }
@keyframes mnc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

.mnc-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.mnc-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  outline: none;
  box-shadow: none;
}
.mnc-input:focus { border-color: var(--mnc-primary, #10b981); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mnc-primary, #10b981) 16%, transparent); }
.mnc-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 12px;
  background: var(--mnc-primary, #10b981);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  display: grid;
  place-items: center;
}
.mnc-send:disabled { opacity: .55; cursor: default; }

@media (max-width: 520px) {
  .mnc-wrap { right: 10px !important; left: 10px !important; bottom: 10px; }
  .mnc-window {
    width: calc(100vw - 20px);
    height: min(690px, calc(100vh - 20px));
    border-radius: 16px;
    margin: 0;
  }
  .mnc-toggle { margin-left: auto; }
  .mnc-left .mnc-toggle { margin-left: 0; margin-right: auto; }
}
