.mik-ai-widget {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 9999;
  font-family: Tahoma, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mik-ai-toggle {
  border: 0;
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  color: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  box-shadow: 0 18px 30px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  letter-spacing: 0.02em;
  min-width: 132px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.mik-ai-toggle.hidden {
  display: none;
}

.mik-ai-panel {
  width: min(420px, calc(100vw - 28px));
  min-height: 500px;
  max-height: 76vh;
  background: rgba(10, 16, 28, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px 18px 16px 16px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.52);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.mik-ai-panel.hidden {
  display: none;
}

.mik-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(18, 32, 52, 0.96), rgba(28, 38, 66, 0.9));
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.mik-ai-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mik-ai-badge {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(135deg, #14b8a6, #2563eb);
  color: #fff;
  font-size: 12px;
}

.mik-ai-header-title strong {
  display: block;
  color: #f5f7ff;
  font-size: 15px;
}

.mik-ai-header-title span {
  display: block;
  color: #a7b7d8;
  font-size: 11px;
}

.mik-ai-header-actions {
  display: flex;
  gap: 8px;
}

.mik-ai-mini,
.mik-ai-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #e5eefc;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.mik-ai-messages {
  max-height: 330px;
  overflow-y: auto;
  padding: 14px 12px 10px;
  background: rgba(7, 12, 20, 0.78);
}

.mik-ai-message {
  display: flex;
  margin-bottom: 12px;
}

.mik-ai-message.user {
  justify-content: flex-end;
}

.mik-ai-message.assistant {
  justify-content: flex-start;
}

.mik-ai-message .bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.8;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.mik-ai-message.user .bubble {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.mik-ai-message.assistant .bubble {
  background: rgba(148, 163, 184, 0.12);
  color: #eff6ff;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom-left-radius: 5px;
}

.mik-ai-input {
  display: flex;
  gap: 10px;
  padding: 12px 12px 14px;
  background: rgba(9, 15, 26, 0.95);
  border-top: 1px solid rgba(255,255,255,0.07);
}

.mik-ai-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: #eef3ff;
  padding: 10px 12px;
  min-height: 48px;
  font-size: 13px;
}

.mik-ai-input textarea::placeholder {
  color: rgba(255,255,255,0.5);
}

.mik-ai-input button {
  border: 0;
  border-radius: 12px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}

.mik-ai-footer {
  padding: 0 12px 10px;
  background: rgba(9, 15, 26, 0.95);
}

.mik-ai-footer a {
  display: block;
  text-align: center;
  background: rgba(148, 163, 184, 0.08);
  color: #dfeaff;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
}

@media (max-width: 500px) {
  .mik-ai-widget {
    right: 10px;
    bottom: 10px;
  }

  .mik-ai-panel {
    width: min(92vw, 360px);
  }
}

.mik-ai-panel.hidden {
  display: none;
}

.mik-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(18, 25, 40, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mik-ai-header strong {
  display: block;
  color: #f5f7ff;
  font-size: 15px;
}

.mik-ai-header span {
  display: block;
  font-size: 11px;
  color: #9fb2d1;
}

.mik-ai-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.mik-ai-messages {
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(9, 13, 22, 0.8);
}

.mik-ai-message {
  display: flex;
  margin-bottom: 12px;
}

.mik-ai-message.user {
  justify-content: flex-end;
}

.mik-ai-message.assistant {
  justify-content: flex-start;
}

.mik-ai-message .bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.7;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.mik-ai-message.user .bubble {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.mik-ai-message.assistant .bubble {
  background: rgba(255,255,255,0.06);
  color: #eff6ff;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-right-radius: 4px;
}

.mik-ai-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(12, 20, 33, 0.9);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.mik-ai-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: #eef3ff;
  padding: 10px 12px;
  font-size: 13px;
  min-height: 48px;
}

.mik-ai-input button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.mik-ai-input button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 500px) {
  .mik-ai-widget {
    right: 10px;
    bottom: 10px;
  }

  .mik-ai-panel {
    width: min(94vw, 340px);
  }
}
