/* Answering Now web chat "Live Line" (preview). First-party, no external assets.
   Tokens are scoped to .an-chat-root so the window looks the same on site.css and legacy.css pages. */
.an-chat-root{
  --an-navy:#1A1A2E; --an-blue:#2256E0; --an-blue-hover:#1A45B3; --an-blue-press:#153A99;
  --an-tint:#E8EEFF; --an-tint-hover:#D6E0FF; --an-field:#F7F8FA; --an-white:#FFFFFF;
  --an-text:#1A1A2E; --an-text-2:#475569; --an-sub:#C9D3EA; --an-border:#D4D8DE; --an-border-input:#7C8594;
  --an-placeholder:#5B6472; --an-red-light:#FF8A8A; --an-err-bg:#FDECEE; --an-err-border:#F3B8BF; --an-err-head:#8E1B2A;
  --an-font:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --an-ease:cubic-bezier(.2,.7,.2,1); --an-ease-in-out:cubic-bezier(.45,0,.55,1); --an-ease-pop:cubic-bezier(.34,1.56,.64,1);
  --an-shadow-launcher:0 2px 4px rgba(26,26,46,.2),0 12px 32px rgba(26,26,46,.28);
  --an-shadow-launcher-hover:0 4px 8px rgba(26,26,46,.2),0 16px 40px rgba(26,26,46,.32);
  --an-shadow-panel:0 2px 6px rgba(26,26,46,.10),0 24px 64px rgba(26,26,46,.24);
  font-family:var(--an-font);font-size:16px;line-height:1.5;color:var(--an-text);letter-spacing:normal;text-align:left;
  -webkit-font-smoothing:antialiased;
}
.an-chat-root *,.an-chat-root *::before,.an-chat-root *::after{box-sizing:border-box}
.an-chat-root [hidden]{display:none!important}
.an-chat-root .an-chat-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.an-chat-root svg{display:block;flex:none}
.an-chat-root button,.an-chat-root input{font-family:var(--an-font);margin:0}

/* ---------- Bars (Alex's face) ---------- */
.an-chat-root .an-chat-bars rect{transform-box:fill-box;transform-origin:center}

/* ---------- Launcher ---------- */
.an-chat-root .an-chat-launcher{position:fixed;right:24px;bottom:24px;z-index:110;display:inline-flex;align-items:center;gap:12px;min-height:60px;margin:0;padding:8px 22px 8px 8px;border:0;border-radius:999px;background:var(--an-navy);color:var(--an-white);font:600 17px/1.25 var(--an-font);text-align:left;box-shadow:var(--an-shadow-launcher);cursor:pointer;transition:transform .18s var(--an-ease),box-shadow .18s var(--an-ease),bottom .2s var(--an-ease),opacity 160ms ease-out,visibility 160ms ease-out;-webkit-tap-highlight-color:transparent}
.an-chat-root .an-chat-launcher:active{transform:translateY(0)}
.an-chat-root .an-chat-launcher:focus{outline:none}
.an-chat-root .an-chat-launcher:focus-visible{outline:3px solid var(--an-blue);outline-offset:4px;border-radius:999px}
.an-chat-root .an-chat-disc{width:44px;height:44px;border-radius:50%;background:var(--an-blue);color:var(--an-white);display:inline-flex;align-items:center;justify-content:center;flex:none}
.an-chat-root .an-chat-txt{display:flex;flex-direction:column;align-items:flex-start;line-height:1.25;color:var(--an-white)}
.an-chat-root .an-chat-sub{display:block;font-size:13px;font-weight:500;line-height:1.2;color:var(--an-sub)}
.an-chat-root .an-chat-sub::before{content:attr(data-text)}
.an-chat-root .an-chat-dot{position:absolute;top:2px;left:40px;width:14px;height:14px;border-radius:50%;background:var(--an-red-light);border:2px solid var(--an-navy);transform:scale(0);pointer-events:none}
.an-chat-root.an-chat-has-new .an-chat-dot{transform:scale(1);animation:an-pop .24s var(--an-ease-pop)}
.an-chat-root.an-chat-open .an-chat-launcher{display:none}
@media (hover:hover) and (pointer:fine){
  .an-chat-root .an-chat-launcher:hover{transform:translateY(-2px);box-shadow:var(--an-shadow-launcher-hover)}
  .an-chat-root .an-chat-launcher:hover:active{transform:translateY(0)}
}

/* Motion: idle breathe on the launcher and the header tile; talk while Alex composes. */
.an-chat-root .an-chat-launcher .an-chat-bars rect,
.an-chat-root .an-chat-hd .an-chat-av .an-chat-bars rect{animation:an-breathe 6s var(--an-ease-in-out) infinite;animation-delay:calc(var(--i) * 90ms)}
.an-chat-root.an-chat-burst .an-chat-launcher .an-chat-bars rect,
.an-chat-root .an-chat-panel.an-chat-typing .an-chat-hd .an-chat-av .an-chat-bars rect,
.an-chat-root .an-chat-typing-row .an-chat-bars rect{animation:an-talk .9s var(--an-ease-in-out) infinite alternate;animation-delay:calc(var(--i) * -180ms)}
@keyframes an-breathe{0%,26%,100%{transform:scaleY(1)}6%{transform:scaleY(.45)}13%{transform:scaleY(1.2)}20%{transform:scaleY(.75)}}
@keyframes an-talk{0%{transform:scaleY(.35)}100%{transform:scaleY(1.25)}}
@keyframes an-pop{from{transform:scale(0)}to{transform:scale(1)}}
@keyframes an-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- Panel (desktop 600px and up) ---------- */
.an-chat-root .an-chat-panel{position:fixed;right:24px;bottom:24px;z-index:120;width:400px;height:640px;max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px);margin:0;padding:0;background:var(--an-white);border:1px solid var(--an-border);border-radius:16px;box-shadow:var(--an-shadow-panel);display:flex;flex-direction:column;overflow:hidden;color:var(--an-text);animation:an-rise .2s var(--an-ease)}
.an-chat-root .an-chat-hd{display:flex;align-items:center;gap:12px;min-height:68px;margin:0;padding:12px 8px 12px 16px;background:var(--an-navy);color:var(--an-white);border:0;flex:none}
.an-chat-root .an-chat-av{width:44px;height:44px;border-radius:12px;background:var(--an-blue);color:var(--an-white);display:inline-flex;align-items:center;justify-content:center;flex:none}
.an-chat-root .an-chat-who{flex:1;min-width:0}
.an-chat-root .an-chat-name{margin:0;padding:0;font:700 17px/1.2 var(--an-font);letter-spacing:normal;color:var(--an-white);text-wrap:wrap}
.an-chat-root .an-chat-role{margin:2px 0 0;padding:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--an-sub)}
.an-chat-root .an-chat-icon{width:44px;height:44px;margin:0;padding:0;border:0;border-radius:10px;background:transparent;color:var(--an-white);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.an-chat-root .an-chat-icon:hover{background:rgba(255,255,255,.12)}
.an-chat-root .an-chat-icon:focus{outline:none}
.an-chat-root .an-chat-icon:focus-visible{outline:3px solid var(--an-white);outline-offset:-3px;border-radius:10px}

.an-chat-root .an-chat-call{display:flex;align-items:center;gap:8px;min-height:52px;margin:0;padding:8px 16px;background:var(--an-field);border-bottom:1px solid var(--an-border);font-size:15px;line-height:1.3;color:var(--an-text-2);flex:none}
.an-chat-root .an-chat-call-btn{margin-left:auto}

/* Pill call buttons (call strip and offline banner) */
.an-chat-root .an-chat-pill{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border-radius:999px;background:var(--an-tint);color:var(--an-blue);font:600 15px/1.2 var(--an-font);text-decoration:none;white-space:nowrap;cursor:pointer}
.an-chat-root .an-chat-pill:hover{background:var(--an-tint-hover);color:var(--an-blue-hover)}
.an-chat-root .an-chat-pill:active{color:var(--an-blue-press)}
.an-chat-root .an-chat-pill:focus{outline:none}
.an-chat-root .an-chat-pill:focus-visible{outline:3px solid var(--an-blue);outline-offset:2px;border-radius:999px}
.an-chat-root .an-chat-pill-solid{background:var(--an-blue);color:var(--an-white);padding:0 16px}
.an-chat-root .an-chat-pill-solid:hover{background:var(--an-blue-hover);color:var(--an-white)}
.an-chat-root .an-chat-pill-solid:active{background:var(--an-blue-press);color:var(--an-white)}

/* ---------- Log ---------- */
.an-chat-root .an-chat-log{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;margin:0;padding:16px;display:flex;flex-direction:column;gap:10px;font-size:16px;line-height:1.5;-webkit-overflow-scrolling:touch}
.an-chat-root .an-chat-log:focus{outline:none}
.an-chat-root .an-chat-log:focus-visible{outline:3px solid var(--an-blue);outline-offset:-3px}
.an-chat-root .an-chat-msg{max-width:86%;margin:0;padding:10px 14px;border-radius:14px;font-size:16px;line-height:1.5;overflow-wrap:anywhere}
.an-chat-root .an-chat-msg p{margin:0;padding:0;color:inherit;font-size:inherit;line-height:inherit;white-space:pre-line}
.an-chat-root .an-chat-a{position:relative;align-self:flex-start;margin-left:30px;background:var(--an-field);border:1px solid var(--an-border);border-bottom-left-radius:4px;color:var(--an-text);max-width:calc(86% - 30px)}
.an-chat-root .an-chat-a::before{content:"";position:absolute;left:-30px;bottom:2px;width:22px;height:22px;border-radius:7px;background:var(--an-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='2.6' y='8' width='2.6' height='8' rx='1.3'/%3E%3Crect x='6.8' y='5' width='2.6' height='14' rx='1.3'/%3E%3Crect x='11' y='2' width='2.6' height='20' rx='1.3'/%3E%3Crect x='15.2' y='6' width='2.6' height='12' rx='1.3'/%3E%3Crect x='19.4' y='9' width='2.6' height='6' rx='1.3'/%3E%3C/svg%3E") center/16px no-repeat}
.an-chat-root .an-chat-a+.an-chat-a::before{display:none}
.an-chat-root .an-chat-v{align-self:flex-end;background:var(--an-blue);color:var(--an-white);border:1px solid var(--an-blue);border-bottom-right-radius:4px}
.an-chat-root .an-chat-fail{align-self:flex-end;display:flex;align-items:center;gap:8px;margin:-4px 0 0;font-size:14px;line-height:1.3;color:var(--an-text-2)}
.an-chat-root .an-chat-retry{min-height:44px;padding:0 16px;border:0;border-radius:999px;background:var(--an-tint);color:var(--an-blue);font:600 15px/1.2 var(--an-font);cursor:pointer}
.an-chat-root .an-chat-retry:hover{background:var(--an-tint-hover);color:var(--an-blue-hover)}
.an-chat-root .an-chat-retry:disabled{cursor:default;opacity:.6}
.an-chat-root .an-chat-retry:focus{outline:none}
.an-chat-root .an-chat-retry:focus-visible{outline:3px solid var(--an-blue);outline-offset:2px}
.an-chat-root .an-chat-divider{align-self:stretch;margin:14px 0 6px;padding:0;text-align:center;font-size:13px;font-weight:400;line-height:1.4;color:var(--an-text-2)}
.an-chat-root .an-chat-divider-title{display:flex;align-items:center;gap:12px;font-weight:600}
.an-chat-root .an-chat-divider-title::before,.an-chat-root .an-chat-divider-title::after{content:"";flex:1;height:1px;background:var(--an-border)}
.an-chat-root .an-chat-divider-sub{display:block;margin-top:2px}
.an-chat-root .an-chat-typing-row{display:flex;align-items:center;gap:8px;margin:0;font-size:14px;line-height:1.3;color:var(--an-text-2)}
.an-chat-root .an-chat-typing-row .an-chat-av{width:30px;height:30px;border-radius:9px}

/* ---------- Composer, offline banner, fine print ---------- */
.an-chat-root .an-chat-composer{display:flex;gap:8px;margin:0;padding:12px 12px 16px;border-top:1px solid var(--an-border);background:var(--an-white);flex:none}
.an-chat-root:has(.an-chat-fine) .an-chat-composer{padding-bottom:8px}
.an-chat-root .an-chat-input{flex:1;min-width:0;min-height:48px;margin:0;padding:0 18px;border:1.5px solid var(--an-border-input);border-radius:999px;background:var(--an-white);color:var(--an-text);font:400 16px/1.3 var(--an-font);-webkit-appearance:none;appearance:none;box-shadow:none}
.an-chat-root .an-chat-input::placeholder{color:var(--an-placeholder);opacity:1}
.an-chat-root .an-chat-input:focus{outline:none}
.an-chat-root .an-chat-input:focus-visible{outline:3px solid var(--an-blue);outline-offset:1px;border-color:var(--an-blue)}
.an-chat-root .an-chat-send{width:48px;height:48px;margin:0;padding:0;border:0;border-radius:50%;background:var(--an-blue);color:var(--an-white);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.an-chat-root .an-chat-send:hover{background:var(--an-blue-hover)}
.an-chat-root .an-chat-send:active{background:var(--an-blue-press)}
.an-chat-root .an-chat-send:disabled{cursor:default;background:var(--an-blue);opacity:.55}
.an-chat-root .an-chat-send:focus{outline:none}
.an-chat-root .an-chat-send:focus-visible{outline:3px solid var(--an-blue);outline-offset:2px}
.an-chat-root .an-chat-offline{margin:12px;padding:12px 14px;border-radius:10px;background:var(--an-err-bg);border:1px solid var(--an-err-border);color:var(--an-text);font-size:15px;line-height:1.45;flex:none}
.an-chat-root .an-chat-offline b{color:var(--an-err-head);font-weight:700}
.an-chat-root .an-chat-offline p{margin:0;padding:0;color:var(--an-text)}
.an-chat-root .an-chat-offline .an-chat-pill{margin-top:8px}
.an-chat-root .an-chat-nw{white-space:nowrap}
.an-chat-root .an-chat-fine{margin:0;padding:0 16px 12px;font-size:13px;font-weight:400;line-height:1.4;color:var(--an-text-2);flex:none}

/* ---------- Desktop card with an on-screen keyboard ----------
   chat.js adds .an-chat-kb only when the card (600px and up, for example an unfolded Galaxy Z Fold) is open
   and the visual viewport is clearly shorter than the layout viewport. The card then sits 8px above the
   keyboard, inside the visual viewport, up to its normal 640px. Without the class nothing here applies. */
.an-chat-root.an-chat-kb .an-chat-panel{--an-card-h:min(640px,calc(var(--an-vv-h) - 16px));top:calc(var(--an-vv-top) + var(--an-vv-h) - var(--an-card-h) - 8px);bottom:auto;height:var(--an-card-h);max-height:none}

/* ---------- Calculator lift ----------
   chat.js sets html.an-chat-lift only while .calc-sticky is actually on screen (computed display/visibility,
   not .off, IntersectionObserver), and --an-chat-lift-h to the bar's measured height. No width ranges.
   Launcher sits 8px above the bar plus its normal inset (24px desktop, 16px phone). */
html.an-chat-lift .an-chat-root .an-chat-launcher{bottom:calc(var(--an-chat-lift-h,64px) + 32px + env(safe-area-inset-bottom,0px))}

/* ---------- Typing in a page field on a touch screen ----------
   interactive-widget=resizes-content makes Android shrink the page above the keyboard, which would float the
   launcher over the field being typed in (calculator, onboarding). Fade it out while a page text field has focus.
   Opacity only, so it stays in the tab order and shows again as soon as it, or anything else, takes focus. */
@media (pointer:coarse){
  html:has(:is(input:not([type=checkbox],[type=radio],[type=range],[type=button],[type=submit],[type=reset],[type=file],[type=color]),textarea,[contenteditable=""],[contenteditable="true"]):focus) .an-chat-root:not(.an-chat-open) .an-chat-launcher{opacity:0;pointer-events:none}
}

/* ---------- Phone sheet (under 600px) ---------- */
@media (max-width:599.98px){
  html{scroll-padding-bottom:88px}
  html:has(.calc-sticky){scroll-padding-bottom:152px}
  html.an-chat-has-calc{scroll-padding-bottom:152px}
  .an-chat-root .an-chat-launcher{right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));min-height:56px;padding:6px 18px 6px 6px}
  .an-chat-root .an-chat-sub{display:none}
  html.an-chat-lift .an-chat-root .an-chat-launcher{bottom:calc(var(--an-chat-lift-h,64px) + 24px + env(safe-area-inset-bottom,0px))}
  .an-chat-root .an-chat-panel{inset:0;right:0;bottom:0;left:0;width:100%;height:100vh;height:100dvh;top:var(--an-vv-top,0px);height:var(--an-vv-h,100dvh);max-height:none;border:0;border-radius:0;box-shadow:none}
  .an-chat-root .an-chat-hd{padding-top:calc(12px + env(safe-area-inset-top,0px));padding-right:calc(8px + env(safe-area-inset-right,0px));padding-left:calc(16px + env(safe-area-inset-left,0px))}
  .an-chat-root .an-chat-composer{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
  .an-chat-root:has(.an-chat-fine) .an-chat-composer{padding-bottom:8px}
  .an-chat-root .an-chat-fine{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
}
html.an-chat-locked,html.an-chat-locked body{overflow:hidden!important;overscroll-behavior:none}

/* ---------- Reduced motion ---------- */
/* Tuck when the launcher overlaps a [data-chat-avoid] target (home offer tickets). */
.an-chat-root .an-chat-launcher.is-tucked{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(8px);transition:opacity 160ms ease-out,visibility 160ms ease-out,transform 160ms ease-out}
@media (prefers-reduced-motion:reduce){
  .an-chat-root .an-chat-launcher .an-chat-bars rect,.an-chat-root .an-chat-panel .an-chat-bars rect{animation:none!important}
  .an-chat-root .an-chat-launcher{transition:none}
  .an-chat-root .an-chat-launcher.is-tucked{transform:none;transition:none}
  .an-chat-root.an-chat-has-new .an-chat-dot{animation:none}
  .an-chat-root .an-chat-panel{animation:none}
}
