:root {
  --mia-primary: #00363B;
  --mia-accent: #00F6F0;
  --mia-accent-light: #A7FFFD;
  --mia-surface: #F3F3F3;
  --mia-text: #00363B;
  --mia-text-light: #667085;
  --mia-border: #E5E7EB;
  --mia-font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#mia-agent-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mia-accent);
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 54, 59, 0.2);
  z-index: 999999;
  padding: 0;
  overflow: hidden;
  transition: transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mia-agent-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#mia-agent-launcher:hover {
  transform: scale(1.08);
}

#mia-agent-launcher.open {
  background: #fff;
}

#mia-agent-launcher.open img {
  object-fit: contain;
  padding: 14px;
}

#mia-agent-launcher.mia-pulse {
  animation: mia-pulse-ring 2s ease-out 3;
}

@keyframes mia-pulse-ring {
  0% { box-shadow: 0 8px 24px rgba(0, 54, 59, 0.2), 0 0 0 0 rgba(0, 246, 240, 0.5); }
  70% { box-shadow: 0 8px 24px rgba(0, 54, 59, 0.2), 0 0 0 16px rgba(0, 246, 240, 0); }
  100% { box-shadow: 0 8px 24px rgba(0, 54, 59, 0.2), 0 0 0 0 rgba(0, 246, 240, 0); }
}

#mia-agent-launcher {
  animation: mia-peek-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mia-peek-in {
  from {
    opacity: 0;
    transform: translateX(100px) translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

#mia-agent-callout {
  position: fixed;
  bottom: 30px;
  right: 96px;
  max-width: 240px;
  background: #fff;
  color: var(--mia-text);
  border: 1px solid var(--mia-border);
  border-radius: 12px;
  border-bottom-right-radius: 2px;
  padding: 12px 14px;
  font-family: var(--mia-font);
  font-size: 13px !important;
  line-height: 1.4 !important;
  box-shadow: 0 10px 30px rgba(0, 54, 59, 0.12);
  z-index: 999998;
  cursor: pointer;
  animation: mia-callout-in 0.35s ease;
}

#mia-agent-callout .close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--mia-text);
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@keyframes mia-callout-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  #mia-agent-callout {
    right: 20px;
    bottom: 92px;
    max-width: calc(100vw - 40px);
  }
}

#mia-agent-panel {
  position: fixed;
  bottom: 96px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 54, 59, 0.15), 0 0 0 1px rgba(0, 246, 240, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: var(--mia-font);
  border: 1px solid var(--mia-border);
}

#mia-agent-panel.open {
  display: flex;
}

#mia-agent-header {
  background: var(--mia-primary);
  color: #fff;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#mia-agent-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#mia-agent-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

#mia-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#mia-agent-header-left > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#mia-agent-header small {
  display: block;
  font-weight: 400;
  opacity: 0.75;
  font-size: 11px;
}

#mia-agent-brand {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--mia-text-light);
  padding: 9px 0;
  border-top: 1px solid var(--mia-border);
  background: var(--mia-surface);
}

#mia-agent-brand a {
  color: var(--mia-primary);
  text-decoration: none;
  font-weight: 700;
}

#mia-agent-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

#mia-agent-close:hover {
  opacity: 1;
}

#mia-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafafa;
}

.mia-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-family: var(--mia-font) !important;
}

.mia-msg.user {
  align-self: flex-end;
  background: var(--mia-primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.mia-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: var(--mia-text);
  border: 1px solid var(--mia-border);
  border-bottom-left-radius: 2px;
}

.mia-booking-card {
  align-self: flex-start;
  max-width: 90%;
  background: linear-gradient(135deg, var(--mia-accent-light) 0%, #B4FFFD 100%);
  border: 1px solid var(--mia-accent);
  border-radius: 14px;
  padding: 14px;
  font-size: 12px;
}

.mia-booking-header {
  font-weight: 700;
  color: var(--mia-primary);
  margin-bottom: 6px;
  font-size: 13px;
}

.mia-booking-context {
  color: var(--mia-text);
  margin-bottom: 12px;
  line-height: 1.5;
}

.mia-booking-button {
  display: inline-block;
  background: var(--mia-primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mia-booking-button:hover {
  background: #003d46;
  transform: translateY(-1px);
}

.mia-booking-close {
  margin-top: 12px;
  color: var(--mia-text);
  font-size: 12px;
  font-weight: 600;
}

#mia-agent-inputrow {
  display: flex;
  border-top: 1px solid var(--mia-border);
  padding: 10px;
  gap: 8px;
  background: #fff;
}

#mia-agent-input {
  flex: 1;
  border: 1px solid var(--mia-border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px !important;
  line-height: 1.4 !important;
  outline: none;
  font-family: var(--mia-font) !important;
  color: var(--mia-text);
  transition: border-color 0.15s ease;
}

#mia-agent-input:focus {
  border-color: var(--mia-accent);
}

#mia-agent-send {
  background: var(--mia-accent);
  color: var(--mia-primary);
  border: none;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--mia-font);
}

#mia-agent-send:hover:not(:disabled) {
  background: #00e5f5;
  transform: translateY(-1px);
}

#mia-agent-send:disabled {
  opacity: 0.5;
  cursor: default;
}
