/* =============================================================
   MILKY LANE · CHAT WIDGET
   Floating launcher + panel. Brand-matched, dark, neon accents.
   ============================================================= */

/* The launcher owns the bottom-right corner and publishes where it sits, so
   anything else that wants to float there - the back-to-top button - can
   stack above it instead of landing on top of it. */
:root { --mlc-right: 20px; --mlc-bottom: 20px; --mlc-height: 50px; }

.mlc-launcher {
  position: fixed;
  right: var(--mlc-right); bottom: var(--mlc-bottom);
  z-index: 9400;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px 14px 16px;
  border: 0; cursor: pointer;
  border-radius: 999px;
  background: var(--ml-pink, #FF8CE0);
  color: #050505;
  font-family: var(--display, 'Anton', Impact, sans-serif);
  text-transform: uppercase; letter-spacing: .12em; font-size: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.34), 0 0 0 0 rgba(255,140,224,.55);
  transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease, opacity .2s ease;
}
.mlc-launcher:hover { transform: translateY(-3px) scale(1.03); }
.mlc-launcher svg { width: 22px; height: 22px; flex: 0 0 auto; }
.mlc-launcher.is-hidden { opacity: 0; pointer-events: none; transform: translateY(10px) scale(.9); }

/* Nudge above the sticky mobile order bar when it's present */
body.has-mobile-bar { --mlc-bottom: 84px; }

/* ---------------- Panel ---------------- */
.mlc-panel {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 9450;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 40px));
  display: none; flex-direction: column;
  background: linear-gradient(180deg, #141418 0%, #0A0A0C 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(255,140,224,.18);
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .3s ease, transform .3s cubic-bezier(.2,.7,.2,1);
}
.mlc-panel.is-open { display: flex; }
.mlc-panel.is-shown { opacity: 1; transform: translateY(0) scale(1); }

/* Header */
.mlc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, rgba(255,140,224,.16), rgba(255,140,224,.06));
  border-bottom: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}
.mlc-head__logo {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  background: #050505;
}
.mlc-head__text { flex: 1; min-width: 0; line-height: 1.2; }
.mlc-head__title {
  display: block;
  font-family: var(--display, 'Anton', sans-serif);
  text-transform: uppercase; letter-spacing: .06em;
  font-size: 16px; color: #fff;
}
.mlc-head__sub {
  display: block; font-size: 11px; color: rgba(255,255,255,.6);
  margin-top: 2px;
}
.mlc-head__sub .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; margin-right: 5px; vertical-align: 1px;
}
.mlc-close {
  width: 32px; height: 32px; flex: 0 0 auto;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.08); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.mlc-close:hover { background: rgba(255,255,255,.18); transform: rotate(90deg); }
.mlc-close svg { width: 15px; height: 15px; }

/* Message list */
.mlc-log {
  flex: 1 1 auto; overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
}
.mlc-log::-webkit-scrollbar { width: 6px; }
.mlc-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

.mlc-msg {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.55;
  animation: mlcIn .3s cubic-bezier(.2,.7,.2,1);
  word-wrap: break-word; overflow-wrap: anywhere;
}
@keyframes mlcIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.mlc-msg--bot {
  align-self: flex-start;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-bottom-left-radius: 5px;
  color: rgba(255,255,255,.92);
}
.mlc-msg--user {
  align-self: flex-end;
  background: var(--ml-pink, #FF8CE0);
  color: #050505;
  border-bottom-right-radius: 5px;
  font-weight: 500;
}
.mlc-msg a { color: var(--ml-blue, #5BD0E6); text-decoration: underline; text-underline-offset: 2px; }
.mlc-msg--user a { color: #050505; }
.mlc-msg strong { color: #fff; font-weight: 700; }
.mlc-msg--user strong { color: #050505; }
.mlc-msg ul { margin: 8px 0 4px; padding-left: 18px; }
.mlc-msg li { margin-bottom: 4px; }

/* Typing indicator */
.mlc-typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.mlc-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  animation: mlcBounce 1.2s infinite ease-in-out;
}
.mlc-typing span:nth-child(2) { animation-delay: .15s; }
.mlc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mlcBounce { 0%,60%,100% { transform: translateY(0); opacity:.5 } 30% { transform: translateY(-5px); opacity:1 } }

/* Quick-reply chips */
.mlc-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 4px 16px 12px;
  flex: 0 0 auto;
}
.mlc-chip {
  border: 1px solid rgba(91,208,230,.45);
  background: rgba(91,208,230,.08);
  color: var(--ml-blue, #5BD0E6);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 12.5px; cursor: pointer;
  font-family: inherit;
  transition: background .2s ease, transform .15s ease, color .2s ease;
}
.mlc-chip:hover {
  background: var(--ml-blue, #5BD0E6); color: #050505;
  transform: translateY(-1px);
}

/* Composer */
.mlc-form {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.35);
  flex: 0 0 auto;
}
.mlc-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  color: #fff;
  padding: 11px 13px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px; line-height: 1.4;
  resize: none; max-height: 96px; min-height: 42px;
  outline: none;
  transition: border-color .2s ease;
}
.mlc-input::placeholder { color: rgba(255,255,255,.38); }
.mlc-input:focus { border-color: var(--ml-pink, #FF8CE0); }
.mlc-send {
  width: 42px; height: 42px; flex: 0 0 auto;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--ml-pink, #FF8CE0);
  color: #050505;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, opacity .2s ease;
}
.mlc-send:hover { transform: scale(1.06); }
.mlc-send:disabled { opacity: .4; cursor: default; transform: none; }
.mlc-send svg { width: 19px; height: 19px; }

.mlc-foot {
  text-align: center; font-size: 10.5px;
  color: rgba(255,255,255,.34);
  padding: 0 14px 10px;
  flex: 0 0 auto;
}

/* Mobile · go near-fullscreen */
@media (max-width: 520px) {
  .mlc-panel {
    right: 8px; left: 8px; bottom: 8px;
    width: auto;
    height: min(78vh, calc(100vh - 70px));
    border-radius: 18px;
  }
  :root { --mlc-right: 14px; --mlc-bottom: 14px; --mlc-height: 46px; }
  body.has-mobile-bar { --mlc-bottom: 84px; }
  .mlc-launcher { padding: 13px 18px 13px 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .mlc-launcher, .mlc-panel, .mlc-msg, .mlc-chip, .mlc-send { transition: none; animation: none; }
}
