/* MakeItScale website chat (assets/js/mis-chat.js): CTA popup, launcher and chat window.
   Dark navy glass to match the v3 pages. Every selector is prefixed mis-chat-, nothing is named ad, ads or -ad-.
   Stacking: the launcher and bubble sit under the nav (50) and its mobile menu (49); the open window sits over the
   nav but under the Client Wins lightbox (1500) and the lead popup (2000). */

.mis-chat{
  --mis-chat-ink:#071b33;
  --mis-chat-sky:#00a6ff;
  --mis-chat-sky-soft:#63b8ef;
  --mis-chat-glass:rgba(255,255,255,.06);
  --mis-chat-glass-strong:rgba(255,255,255,.1);
  --mis-chat-line:rgba(255,255,255,.12);
  --mis-chat-text:rgba(255,255,255,.92);
  --mis-chat-muted:rgba(255,255,255,.66);
  --mis-chat-green:#4ade80;
  --mis-chat-gap:24px;
  --mis-chat-lift:0px;
  font-family:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.mis-chat *,.mis-chat *::before,.mis-chat *::after{box-sizing:border-box}
.mis-chat [hidden]{display:none !important}
:where(.mis-chat) :where(p,h2,form){margin:0;padding:0}
:where(.mis-chat) :where(button,input,textarea){font:inherit;color:inherit;letter-spacing:normal;text-transform:none;margin:0}
:where(.mis-chat) button{-webkit-appearance:none;appearance:none;background:none;border:0;padding:0;cursor:pointer;line-height:inherit}
:where(.mis-chat) img{max-width:none}
.mis-chat :focus-visible{outline:2px solid var(--mis-chat-sky-soft);outline-offset:2px}
.mis-chat-sr{position:absolute !important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

/* ---------- original sky-blue chat helper ---------- */
.mis-chat-brand-image{
  display:block;width:100%;height:100%;max-width:none;object-fit:contain;
  -webkit-user-select:none;user-select:none;pointer-events:none;-webkit-user-drag:none;
}

/* ---------- dock: bubble + launcher, bottom right ---------- */
.mis-chat-dock{
  position:fixed;z-index:45;
  right:calc(var(--mis-chat-gap) + env(safe-area-inset-right, 0px));
  bottom:calc(var(--mis-chat-gap) + var(--mis-chat-lift) + env(safe-area-inset-bottom, 0px));
  display:flex;flex-direction:column;align-items:flex-end;gap:6px;
  pointer-events:none;visibility:hidden;
  transition:visibility 0s linear .6s;
}
.mis-chat--in .mis-chat-dock{visibility:visible;transition-delay:0s}
.mis-chat--open .mis-chat-dock{visibility:hidden;transition:visibility 0s linear .18s}
.mis-chat-dock > *{pointer-events:auto}

/* ---------- speech bubble ---------- */
.mis-chat-bubble{
  position:relative;margin-right:4px;
  width:min(320px, calc(100vw - 2 * var(--mis-chat-gap)));
  padding:16px 16px 16px 18px;
  border-radius:20px 20px 6px 20px;
  background:linear-gradient(165deg, rgba(21,64,109,.97) 0%, rgba(9,34,62,.97) 100%);
  border:1px solid rgba(99,184,239,.34);
  box-shadow:0 24px 50px -20px rgba(0,0,0,.8), 0 0 36px -12px rgba(0,166,255,.45);
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
  color:var(--mis-chat-text);font-size:14.5px;line-height:1.55;font-weight:400;text-align:left;
  opacity:0;transform:translateY(10px) scale(.94);transform-origin:88% 100%;
  transition:opacity .22s ease, transform .4s cubic-bezier(.2,.9,.25,1.2);
}
.mis-chat-bubble.is-in{opacity:1;transform:none;transition-delay:0s}
.mis-chat-bubble::after{
  content:"";position:absolute;right:44px;bottom:-7px;width:14px;height:14px;
  background:#0a2442;border-right:1px solid rgba(99,184,239,.34);border-bottom:1px solid rgba(99,184,239,.34);
  transform:rotate(45deg);border-bottom-right-radius:3px;
}
.mis-chat-bubble-result{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:11px;padding-right:28px}
.mis-chat-bubble-result-logo{display:block;width:54px;height:42px;object-fit:contain}
.mis-chat-bubble-result-copy{display:flex;min-width:0;flex-direction:column;align-items:flex-start;gap:2px}
.mis-chat-bubble-result-kicker{color:#7dd3fc;font-size:9.5px;line-height:1.2;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.mis-chat-bubble-result-title{color:#fff;font-size:14px;line-height:1.35;font-weight:750}
.mis-chat-bubble-result-detail{color:var(--mis-chat-muted);font-size:11.5px;line-height:1.4}
.mis-chat-bubble-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:13px}
.mis-chat-bubble-cta{
  min-height:42px;padding:9px 10px;border-radius:11px;
  display:flex;align-items:center;justify-content:center;
  font-size:12.5px;line-height:1.2;font-weight:700;text-align:center;text-decoration:none;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease;
}
.mis-chat-bubble-cta:hover{transform:translateY(-1px)}
.mis-chat-bubble-cta--primary{background:var(--mis-chat-sky);border:1px solid var(--mis-chat-sky);color:var(--mis-chat-ink)}
.mis-chat-bubble-cta--primary:hover{background:#35b7ff;border-color:#35b7ff;color:var(--mis-chat-ink)}
.mis-chat-bubble-cta--secondary{background:rgba(255,255,255,.07);border:1px solid rgba(99,184,239,.5);color:#fff}
.mis-chat-bubble-cta--secondary:hover{background:rgba(99,184,239,.15);border-color:var(--mis-chat-sky-soft);color:#fff}
.mis-chat-bubble-x{
  position:absolute;top:2px;right:2px;width:44px;height:44px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.7);
}
.mis-chat-bubble-x::before{content:"";position:absolute;inset:9px;border-radius:50%;background:transparent;transition:background .15s ease}
.mis-chat-bubble-x:hover{color:#fff}
.mis-chat-bubble-x:hover::before{background:rgba(255,255,255,.1)}
.mis-chat-bubble-x svg{position:relative}
.mis-chat-bubble-x:focus-visible{outline-offset:-4px}

/* ---------- branded chat launcher ---------- */
.mis-chat-launcher{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:88px;height:88px;border-radius:50%;color:#fff;
  transform:translateY(calc(100% + 48px));opacity:0;
  transition:transform .6s cubic-bezier(.2,.9,.25,1.12), opacity .3s ease, width .35s ease, height .35s ease;
}
.mis-chat:not(.mis-chat--in) .mis-chat-launcher{transition:none}
.mis-chat--in .mis-chat-launcher{transform:none;opacity:1}
/* A soft halo keeps the cutout visible against the navy page. */
.mis-chat-launcher::before{
  content:"";position:absolute;inset:12px;border-radius:50%;
  background:radial-gradient(circle,rgba(0,166,255,.22),rgba(0,166,255,0) 72%);
  box-shadow:0 0 28px 2px rgba(0,166,255,.16);
  transition:opacity .3s ease, transform .35s ease;
}
.mis-chat-launcher:hover::before{box-shadow:0 0 34px 4px rgba(0,166,255,.32)}
.mis-chat-launcher:focus-visible{outline:3px solid var(--mis-chat-sky-soft);outline-offset:4px}
.mis-chat-figure{position:relative;z-index:1;display:block;width:88px;height:88px;filter:drop-shadow(0 7px 8px rgba(0,0,0,.35));transition:width .35s ease,height .35s ease}

.mis-chat-launcher--hero{width:88px;height:88px;border-radius:50%}
.mis-chat-launcher--hero::before{opacity:1;transform:none}
.mis-chat-launcher--hero .mis-chat-figure{width:88px;height:88px}

.mis-chat-badge{
  position:absolute;z-index:2;top:-3px;right:-3px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;
  background:var(--mis-chat-sky);color:var(--mis-chat-ink);font-size:12px;font-weight:700;line-height:22px;text-align:center;
  box-shadow:0 0 0 2px var(--mis-chat-ink);
}
.mis-chat-launcher--hero .mis-chat-badge{top:-3px;right:-3px}
.mis-chat-launcher--ping::after{
  content:"";position:absolute;inset:-2px;border-radius:50%;border:2px solid var(--mis-chat-sky-soft);
  animation:mis-chat-ping 1.4s ease-out 2;pointer-events:none;
}
@keyframes mis-chat-ping{0%{opacity:.9;transform:scale(1)}100%{opacity:0;transform:scale(1.45)}}

/* ---------- chat window ---------- */
.mis-chat-window{
  position:fixed;z-index:1400;
  right:calc(var(--mis-chat-gap) + env(safe-area-inset-right, 0px));
  bottom:calc(var(--mis-chat-gap) + env(safe-area-inset-bottom, 0px));
  width:388px;height:min(640px, calc(100vh - 136px));
  display:flex;flex-direction:column;overflow:hidden;
  background:linear-gradient(180deg, #0f3460 0%, #0a2647 120px, #071b33 100%);
  border:1px solid var(--mis-chat-line);border-radius:22px;
  box-shadow:0 44px 90px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.3), 0 0 60px -20px rgba(0,166,255,.35);
  color:var(--mis-chat-text);font-size:14.5px;line-height:1.5;text-align:left;
  visibility:hidden;opacity:0;transform:translateY(18px) scale(.98);transform-origin:100% 100%;
  transition:opacity .2s ease, transform .26s cubic-bezier(.2,.9,.25,1), visibility 0s linear .26s;
}
@supports (height:100dvh){.mis-chat-window{height:min(640px, calc(100dvh - 136px))}}
.mis-chat-window:not(.is-open){pointer-events:none}
.mis-chat-window.is-open{visibility:visible;opacity:1;transform:none;transition-delay:0s}
.mis-chat-window:focus{outline:none}

.mis-chat-top{display:flex;align-items:center;gap:12px;padding:14px 8px 14px 16px;border-bottom:1px solid var(--mis-chat-line);flex:none}
.mis-chat-avatar{
  position:relative;flex:none;width:46px;height:46px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
  background:rgba(0,166,255,.1);
  border:1px solid rgba(99,184,239,.55);box-shadow:0 0 18px -6px rgba(0,166,255,.6);
}
.mis-chat-top-text{flex:1;min-width:0}
.mis-chat .mis-chat-title{
  margin:0;padding:0;font-family:inherit;font-size:16.5px;font-weight:700;line-height:1.2;letter-spacing:-.01em;color:#fff;text-align:left;
}
.mis-chat-sub{margin:3px 0 0;font-size:12.5px;line-height:1.35;color:var(--mis-chat-muted)}
.mis-chat-live{display:inline-block;width:7px;height:7px;margin:0 6px 1px 0;border-radius:50%;background:var(--mis-chat-green);box-shadow:0 0 0 3px rgba(74,222,128,.18);vertical-align:middle}
.mis-chat-close{
  flex:none;align-self:flex-start;width:44px;height:44px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.75);transition:background .15s ease,color .15s ease;
}
.mis-chat-close:hover{background:var(--mis-chat-glass-strong);color:#fff}

/* ---------- conversation ---------- */
.mis-chat-log{
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  display:flex;flex-direction:column;gap:4px;padding:16px 16px 12px;
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent;
}
.mis-chat-log:focus-visible{outline:2px solid var(--mis-chat-sky-soft);outline-offset:-3px}
.mis-chat-msg{display:flex;flex-direction:column;align-items:flex-start;max-width:86%;align-self:flex-start}
.mis-chat-msg--first{margin-top:10px}
.mis-chat-msg--first:first-child{margin-top:0}
.mis-chat-msg--visitor{align-self:flex-end;align-items:flex-end}
.mis-chat-meta{display:none;align-items:baseline;gap:7px;margin:0 4px 4px;font-size:11.5px;line-height:1.3;font-weight:600;color:var(--mis-chat-muted)}
.mis-chat-msg--first .mis-chat-meta{display:flex}
.mis-chat-msg--ai .mis-chat-who{color:var(--mis-chat-sky-soft)}
.mis-chat-msg--human .mis-chat-who{color:var(--mis-chat-green)}
.mis-chat-time{font-weight:400;color:rgba(255,255,255,.5)}
.mis-chat-text{
  margin:0;padding:10px 14px;border-radius:16px;font-size:14.5px;line-height:1.5;
  white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
}
.mis-chat-msg--ai .mis-chat-text{background:var(--mis-chat-glass);border:1px solid var(--mis-chat-line);color:var(--mis-chat-text)}
.mis-chat-msg--ai.mis-chat-msg--first .mis-chat-text{border-top-left-radius:6px}
.mis-chat-msg--human .mis-chat-text{background:rgba(74,222,128,.08);border:1px solid rgba(74,222,128,.3);color:var(--mis-chat-text)}
.mis-chat-msg--human.mis-chat-msg--first .mis-chat-text{border-top-left-radius:6px}
.mis-chat-msg--visitor .mis-chat-text{background:linear-gradient(135deg,#0a74c2 0%,#0b5995 100%);border:1px solid rgba(255,255,255,.1);color:#fff}
.mis-chat-msg--visitor.mis-chat-msg--first .mis-chat-text{border-top-right-radius:6px}
.mis-chat-msg--pending .mis-chat-text{opacity:.72}
.mis-chat-msg--failed .mis-chat-text{opacity:1;background:rgba(255,120,120,.12);border-color:rgba(255,140,140,.4)}
.mis-chat-state{margin:4px 4px 0;font-size:11.5px;line-height:1.3;color:var(--mis-chat-muted)}
.mis-chat-state:empty{display:none}
.mis-chat-msg--failed .mis-chat-state{color:#ffb8b8}
.mis-chat-msg--system{align-self:center;align-items:center;max-width:92%}
.mis-chat-msg--system .mis-chat-text{padding:6px 12px;font-size:12.5px;color:var(--mis-chat-muted);text-align:center;background:none;border:0}
.mis-chat-link{color:var(--mis-chat-sky-soft);text-decoration:underline;text-underline-offset:2px}
.mis-chat-link:hover{color:#fff}

.mis-chat-typing{display:flex;align-items:center;gap:8px;align-self:flex-start;margin-top:10px}
.mis-chat-typing-figure{
  position:relative;flex:none;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:hidden;
  background:rgba(0,166,255,.1);border:1px solid rgba(99,184,239,.45);
}
.mis-chat-dots{display:flex;align-items:center;gap:4px;padding:12px 14px;border-radius:16px;border-top-left-radius:6px;background:var(--mis-chat-glass);border:1px solid var(--mis-chat-line)}
.mis-chat-dot{width:7px;height:7px;border-radius:50%;background:var(--mis-chat-sky-soft);opacity:.4;animation:mis-chat-dot 1.2s ease-in-out infinite}
.mis-chat-dot:nth-child(2){animation-delay:.16s}
.mis-chat-dot:nth-child(3){animation-delay:.32s}
@keyframes mis-chat-dot{0%,70%,100%{opacity:.35;transform:translateY(0)}35%{opacity:1;transform:translateY(-3px)}}

/* ---------- inline error / notice ---------- */
.mis-chat-alert{
  flex:none;display:flex;align-items:center;gap:10px;margin:0 12px 10px;padding:6px 6px 6px 12px;border-radius:14px;
  background:rgba(255,120,120,.1);border:1px solid rgba(255,140,140,.32);
}
.mis-chat-alert-text{flex:1;margin:0;font-size:13px;line-height:1.4;color:#ffd6d6}
.mis-chat-retry{
  flex:none;min-height:44px;padding:0 14px;border-radius:10px;font-size:13.5px;font-weight:600;color:#fff;
  background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);transition:background .15s ease;
}
.mis-chat-retry:hover{background:rgba(255,255,255,.16)}
.mis-chat-retry:disabled{cursor:default;color:rgba(255,255,255,.6);background:rgba(255,255,255,.05)}

/* ---------- email step ---------- */
.mis-chat-gate{flex:none;display:flex;flex-direction:column;gap:10px;padding:14px 16px 16px;border-top:1px solid var(--mis-chat-line);background:rgba(3,14,28,.38)}
.mis-chat-gate-title{font-size:17px;font-weight:600;line-height:1.25;letter-spacing:-.01em;color:#fff}
.mis-chat-gate-title em{font-family:"Instrument Serif",Georgia,serif;font-style:italic;font-weight:400;font-size:1.2em;letter-spacing:0;color:var(--mis-chat-sky-soft)}
.mis-chat-gate-note{margin-top:-4px;font-size:13px;line-height:1.45;color:var(--mis-chat-muted)}
.mis-chat-field{display:flex;flex-direction:column;gap:5px}
.mis-chat-label{font-size:12.5px;font-weight:600;line-height:1.2;color:rgba(255,255,255,.82)}
.mis-chat-optional{font-weight:400;color:var(--mis-chat-muted)}
.mis-chat .mis-chat-field-input{
  width:100%;height:44px;padding:0 14px;border-radius:12px;border:1px solid var(--mis-chat-line);background:var(--mis-chat-glass);
  color:#fff;font-size:16px;line-height:1.2;outline:none;box-shadow:none;transition:border-color .15s ease,box-shadow .15s ease;
}
.mis-chat .mis-chat-field-input::placeholder{color:rgba(255,255,255,.42)}
.mis-chat .mis-chat-field-input:focus{border-color:rgba(99,184,239,.75);box-shadow:0 0 0 3px rgba(0,166,255,.22)}
.mis-chat .mis-chat-field-input[aria-invalid="true"]{border-color:#ff9a9a;box-shadow:0 0 0 3px rgba(255,120,120,.18)}
.mis-chat-hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
.mis-chat-err{font-size:12.5px;line-height:1.4;color:#ffc2c2}
.mis-chat-err:empty{display:none}
.mis-chat-btn{
  display:flex;align-items:center;justify-content:center;gap:8px;height:46px;border-radius:999px;
  background:#fff;color:#15406d;font-size:15px;font-weight:600;
  box-shadow:0 14px 30px -16px rgba(0,0,0,.7);transition:transform .15s ease,box-shadow .15s ease;
}
.mis-chat-btn:hover{transform:translateY(-1px)}
.mis-chat-btn:disabled{cursor:progress;opacity:.75;transform:none}
.mis-chat-fine{font-size:11.5px;line-height:1.4;color:rgba(255,255,255,.55);text-align:center}
.mis-chat-fine-link{color:rgba(255,255,255,.75);text-decoration:underline;text-underline-offset:2px}

/* ---------- composer ---------- */
.mis-chat-compose{flex:none;position:relative;display:flex;align-items:flex-end;gap:8px;padding:10px 12px 12px;border-top:1px solid var(--mis-chat-line);background:rgba(3,14,28,.38)}
.mis-chat .mis-chat-input{
  flex:1;min-width:0;min-height:44px;max-height:132px;padding:11px 14px;resize:none;overflow-y:auto;
  border-radius:14px;border:1px solid var(--mis-chat-line);background:var(--mis-chat-glass);color:#fff;
  font-size:16px;line-height:1.35;outline:none;box-shadow:none;transition:border-color .15s ease,box-shadow .15s ease;
}
.mis-chat .mis-chat-input::placeholder{color:rgba(255,255,255,.45)}
.mis-chat .mis-chat-input:focus{border-color:rgba(99,184,239,.75);box-shadow:0 0 0 3px rgba(0,166,255,.22)}
.mis-chat-count{position:absolute;right:64px;top:-20px;font-size:11px;color:var(--mis-chat-muted)}
.mis-chat-send{
  flex:none;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:#0091e0;color:#fff;box-shadow:0 10px 22px -12px rgba(0,166,255,.8);transition:background .15s ease,transform .15s ease;
}
.mis-chat-send:hover{background:#0a7fc7}
.mis-chat-send:disabled{cursor:default;background:rgba(255,255,255,.08);color:rgba(255,255,255,.45);box-shadow:none}

/* ---------- page scroll lock, phone sheet only ---------- */
html.mis-chat-lock,html.mis-chat-lock body{overflow:hidden !important}

/* ---------- phone: near full-screen sheet ---------- */
@media (max-width:560px){
  .mis-chat{--mis-chat-gap:16px}
  .mis-chat-window{
    left:0;right:0;bottom:auto;width:auto;
    top:calc(var(--mis-chat-vt, 0px) + 8px);
    height:calc(var(--mis-chat-vh, 100vh) - 8px);
    border-radius:20px 20px 0 0;border-bottom:0;
    transform:translateY(40px);transform-origin:50% 100%;
  }
  @supports (height:100dvh){.mis-chat-window{height:calc(var(--mis-chat-vh, 100dvh) - 8px)}}
  .mis-chat-compose,.mis-chat-gate{padding-bottom:calc(12px + env(safe-area-inset-bottom, 0px))}
  .mis-chat-bubble{width:min(320px, calc(100vw - 2 * var(--mis-chat-gap)));font-size:14px;padding:14px 14px 14px 16px}
  .mis-chat-bubble::after{right:36px}
  .mis-chat-bubble-cta{min-height:40px;padding:8px 7px;font-size:12px}
  .mis-chat-launcher{width:76px;height:76px}
  .mis-chat-figure{width:76px;height:76px}
  .mis-chat-launcher--hero{width:76px;height:76px}
  .mis-chat-launcher--hero .mis-chat-figure{width:76px;height:76px}
  .mis-chat-msg{max-width:90%}
}

@media (prefers-reduced-motion:reduce){
  .mis-chat-launcher,.mis-chat-bubble,.mis-chat-window{transition:opacity .01s linear, visibility 0s linear !important;transform:none !important}
  .mis-chat-dot,.mis-chat-launcher--ping::after{animation:none !important}
  .mis-chat-dot{opacity:.75}
  .mis-chat-launcher::before,.mis-chat-figure{transition:none !important}
}
@media (forced-colors:active){
  .mis-chat-bubble,.mis-chat-window,.mis-chat-text,.mis-chat-launcher::before{border:1px solid CanvasText}
}
@media print{.mis-chat{display:none !important}}
