/* Mia website chat */
.mia-launch {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 900;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 10px; border: 0; border-radius: 999px;
  background: var(--ink, #1d1d1f); color: #fff; font: 600 15px/1 var(--font, sans-serif); letter-spacing: -0.01em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22); cursor: pointer;
}
.mia-launch:hover { background: #000; }
.mia-launch:focus-visible, .mia-panel button:focus-visible, .mia-panel a:focus-visible, .mia-input:focus-visible { outline: 3px solid var(--light-blue, #64D2FF); outline-offset: 2px; }
.mia-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--yellow, #F9E900); color: #1d1d1f; display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.mia-launch[aria-expanded="true"] { display: none; }

.mia-panel {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 901;
  width: min(390px, calc(100vw - 40px)); height: min(640px, calc(100vh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--ink, #1d1d1f); border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .06);
  font-family: var(--font, sans-serif); font-size: 15px; line-height: 1.45; letter-spacing: -0.01em;
}
.mia-panel[hidden] { display: none; }
.mia-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); }
.mia-head__text { flex: 1; min-width: 0; }
.mia-head__name { font-weight: 700; font-size: 16px; }
.mia-head__sub { font-size: 12.5px; color: var(--muted, #6e6e73); }
.mia-icon-btn { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--grey, #f5f5f7); color: #1d1d1f; font-size: 20px; line-height: 1; cursor: pointer; }
.mia-icon-btn:hover { background: #e8e8ed; }

.mia-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cream, #F7F5F1); overscroll-behavior: contain; }
.mia-msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mia-msg--bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.mia-msg--me { align-self: flex-end; background: var(--ink, #1d1d1f); color: #fff; border-bottom-right-radius: 6px; }
.mia-msg--note { align-self: center; max-width: 100%; background: transparent; color: var(--muted, #6e6e73); font-size: 13px; text-align: center; padding: 2px 6px; }
.mia-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; background: #fff; border-radius: 18px; border-bottom-left-radius: 6px; }
.mia-typing span { width: 7px; height: 7px; border-radius: 50%; background: #a1a1a6; animation: mia-blink 1.2s infinite ease-in-out; }
.mia-typing span:nth-child(2) { animation-delay: .15s; }
.mia-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mia-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .mia-typing span { animation: none; opacity: .6; } }

.mia-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: var(--cream, #F7F5F1); }
.mia-chips[hidden] { display: none; }
.mia-chip { border: 1px solid rgba(0,0,0,.14); background: #fff; color: #1d1d1f; border-radius: 999px; padding: 7px 12px; font: 500 13.5px/1.2 var(--font, sans-serif); cursor: pointer; }
.mia-chip:hover { border-color: #1d1d1f; }

.mia-book { display: flex; gap: 8px; padding: 10px 12px 0; }
.mia-book a { flex: 1; text-align: center; text-decoration: none; border-radius: 999px; padding: 9px 10px; font-weight: 600; font-size: 14px; }
.mia-book .wa { background: var(--whatsapp, #25D366); color: #000; }
.mia-book .vb { background: var(--viber, #7360F2); color: #fff; }

.mia-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px; }
.mia-input {
  flex: 1; resize: none; max-height: 120px; min-height: 42px; padding: 10px 14px;
  border: 1px solid rgba(0,0,0,.16); border-radius: 21px; font: 15px/1.4 var(--font, sans-serif); color: #1d1d1f; background: #fff;
}
.mia-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--yellow, #F9E900); color: #1d1d1f; font-size: 20px; font-weight: 700; cursor: pointer; }
.mia-send:disabled { opacity: .45; cursor: default; }
.mia-foot { padding: 0 14px 12px; font-size: 11.5px; color: var(--muted, #6e6e73); text-align: center; }
.mia-foot a { color: inherit; }

@media (max-width: 520px) {
  .mia-panel { right: 0; bottom: 0; width: 100vw; height: min(88vh, calc(100vh - 40px)); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .mia-launch { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
}
