/* Jarvis — Apex voice / chat assistant (see assistant.js). Uses the site tokens from styles.css and echoes the
 * header pill (navy glass), .button-accent / .button-ghost-navy (uppercase DM Sans pills), the lead form
 * dialog and the mobile action bar (white frosted pill with round icon wells). */
.ava { --ava-bottom: 24px; --ava-right: 24px; --ava-w: 392px; --ava-glass: rgba(7,26,51,.9); --ava-glass-line: rgba(255,255,255,.14); --ava-line: rgba(11,37,69,.1); --ava-green: #1fa971; position: fixed; z-index: 150; right: var(--ava-right); bottom: calc(var(--ava-bottom) + var(--ava-lift, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 14px; font-family: var(--body, "Manrope", system-ui, sans-serif); color: var(--ink, #101a2c); pointer-events: none; }
.ava > * { pointer-events: auto; }

/* ---------- Launcher: a sibling of the header pill ---------- */
.ava-launch { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 5px; border: 1px solid var(--ava-glass-line); border-radius: var(--r-pill, 999px); background: var(--blue-button, #0c7bbb); color: #fff; cursor: pointer; box-shadow: 0 0 0 1px rgba(104,207,255,.4), 0 0 22px rgba(36,173,242,.5), 0 0 48px rgba(13,138,210,.32), 0 14px 40px rgba(7,26,51,.34); transform: translateY(28px) scale(.9); opacity: 0; transition: transform .55s var(--ease, cubic-bezier(.2,.74,.2,1)), opacity .45s, box-shadow .3s var(--ease, ease), border-color .3s; -webkit-tap-highlight-color: transparent; }
.ava.is-ready .ava-launch { transform: none; opacity: 1; }
.ava-launch:hover { border-color: rgba(255,255,255,.3); box-shadow: 0 0 0 1px rgba(145,223,255,.6), 0 0 28px rgba(36,173,242,.65), 0 0 56px rgba(13,138,210,.4), 0 18px 50px rgba(7,26,51,.3); }
.ava.is-ready .ava-launch:hover { transform: translateY(-2px); }
.ava-launch:focus-visible, .ava-icon:focus-visible, .ava-mic:focus-visible, .ava-send:focus-visible, .ava-ctl:focus-visible, .ava-chips button:focus-visible { outline: 3px solid var(--blue, #0d8ad2); outline-offset: 3px; }
.ava-launch-label { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; line-height: 1.05; text-align: left; }
.ava-launch-label b { font-family: var(--ui, "DM Sans", sans-serif); font-size: 16px; font-weight: 700; letter-spacing: 0; }
.ava-launch-label small { font-family: var(--body, "Manrope", sans-serif); font-size: 12px; font-weight: 500; letter-spacing: 0; color: #fff; }
.ava-launch-orb { position: relative; flex: none; display: flex; align-items: center; justify-content: center; gap: 3px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #56b8ee 0%, #0d8ad2 45%, #0a5f96 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 16px rgba(13,138,210,.4); }
/* One shared face stays recognizable from the small header avatar to the voice stage. */
.jarvis-robot { position: absolute; inset: 0; margin: auto; display: block; width: 70%; height: 70%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.jarvis-robot-eye { fill: #fff; stroke: none; }
/* A short, synchronized blink every six seconds; the face stays still. */
.ava-launch .jarvis-robot-eye { transform-box: fill-box; transform-origin: center; animation: jarvisBlink 6s ease-in-out infinite; }
@keyframes jarvisBlink { 0%, 92%, 96%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
.ava.is-open .ava-launch { box-shadow: 0 8px 24px rgba(7,26,51,.18); }
.ava.is-open .ava-launch-orb { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

/* ---------- Panel ---------- */
.ava-panel { display: flex; flex-direction: column; width: var(--ava-w); max-width: calc(100vw - 2 * var(--ava-right)); height: min(640px, calc(100vh - var(--ava-bottom) - 64px - 14px - 20px), calc(100dvh - var(--ava-bottom) - 64px - 14px - 20px)); border: 1px solid var(--ava-line); border-radius: var(--r-lg, 28px); background: var(--paper, #f3f4f2); box-shadow: 0 40px 90px -20px rgba(7,26,51,.55), 0 4px 14px rgba(7,26,51,.1); overflow: hidden; transform-origin: bottom right; animation: none; }
.ava-panel[hidden] { display: none; }
/* Entry animation only on the first open: layout switches and popover re-raises must not restart it. */
.ava-panel.ava-entering { animation: avaPanelIn .4s var(--ease, cubic-bezier(.2,.74,.2,1)); }
/* As a popover the panel leaves the .ava flow and the UA styles: pin it to the same corner. */
.ava-panel:popover-open { position: fixed; inset: auto var(--ava-right) calc(var(--ava-bottom) + var(--ava-lift, 0px) + 64px + 14px) auto; margin: 0; padding: 0; color: var(--ink, #101a2c); }
.ava-panel::backdrop { display: none; }
.ava-panel:popover-open { --ava-right: 24px; --ava-bottom: 24px; --ava-w: 392px; --ava-glass: rgba(7,26,51,.9); --ava-glass-line: rgba(255,255,255,.14); --ava-line: rgba(11,37,69,.1); --ava-green: #1fa971; }
@keyframes avaPanelIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* Header: the site's navy glass pill, squared off into a bar */
.ava-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; color: #fff; background: var(--ava-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ava-glass-line); }
.ava-avatar { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #56b8ee 0%, #0d8ad2 45%, #0a5f96 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 0 1px rgba(255,255,255,.12); transition: filter .3s, background .3s; }
.ava-avatar i { position: absolute; inset: -1px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.55); opacity: 0; }
.ava-panel.is-speaking .ava-avatar i { animation: avaPulse 1.2s ease-out infinite; }
.ava-panel.is-listening .ava-avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 0 2px var(--ava-green); }
.ava-panel[data-state="thinking"] .ava-avatar i { animation: avaPulse 1.8s ease-out infinite; }
.ava-panel[data-state="paused"] .ava-avatar, .ava-panel[data-state="offline"] .ava-avatar { filter: saturate(.2) brightness(.9); }
@keyframes avaPulse { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.ava-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.1; }
.ava-title b { font-family: var(--display, "Syne", sans-serif); font-size: 19px; font-weight: 700; letter-spacing: -.03em; }
.ava-title span { font-family: var(--ui, "DM Sans", sans-serif); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava-title span::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); }
.ava-panel[data-state="online"] .ava-title span::before, .ava-panel[data-state="listening"] .ava-title span::before { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.ava-panel[data-state="connecting"] .ava-title span::before, .ava-panel[data-state="thinking"] .ava-title span::before { background: var(--sky-2, #aed7f0); animation: avaBlink 1s infinite; }
.ava-panel[data-state="offline"] .ava-title span::before { background: #f87171; }
.ava-panel[data-state="paused"] .ava-title span::before { background: #9aa4b1; box-shadow: none; animation: none; }
@keyframes avaBlink { 50% { opacity: .3; } }
.ava-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; transition: background .25s, border-color .25s, transform .25s var(--ease, ease); }
.ava-icon:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }
.ava-icon[data-ava-close]:hover { transform: rotate(90deg); }
.ava-icon svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.ava-icon[data-ava-close] svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.ava-icon .ava-ico-off { display: none; }
.ava-panel.is-muted .ava-icon .ava-ico-on { display: none; }
.ava-panel.is-muted .ava-icon .ava-ico-off { display: block; }
.ava-panel.is-muted .ava-icon[data-ava-mute] { color: rgba(255,255,255,.55); }

/* ---------- Voice stage (default view): the orb + one-line caption ----------
 * States via [data-state]: listening / thinking / speaking / paused / offline / connecting. */
.ava-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px 20px; text-align: center; background: radial-gradient(60% 45% at 50% 42%, rgba(13,138,210,.08), transparent 70%); }
.ava-stage[hidden], .ava-log[hidden], .ava-compose[hidden], .ava-controls[hidden], .ava-ctl[hidden], .ava-mic[hidden] { display: none; }
.ava-orb { position: relative; flex: none; width: 128px; height: 128px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #7fcdf5 0%, #0d8ad2 38%, #0b3f70 78%, #0b2545 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), inset 0 -18px 30px rgba(7,26,51,.35), 0 24px 60px -12px rgba(13,138,210,.55); transition: transform .45s var(--ease, ease), filter .45s, box-shadow .45s; }
.ava-orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(31,169,113,0); transition: box-shadow .45s; pointer-events: none; }
.ava-orb i { position: absolute; inset: -12px; border-radius: 50%; border: 1.5px solid rgba(13,138,210,.55); opacity: 0; pointer-events: none; }
.ava-orb i:nth-child(2) { inset: -24px; border-color: rgba(13,138,210,.35); }
/* listening: a slow, green-tinted breathing ring */
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="listening"] .ava-orb::after { box-shadow: 0 0 0 6px rgba(31,169,113,.16); }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="listening"] .ava-orb i { border-color: rgba(31,169,113,.7); opacity: 1; animation: avaBreatheRing 3.2s ease-in-out infinite; }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="listening"] .ava-orb i:nth-child(2) { border-color: rgba(31,169,113,.3); animation-delay: -1.6s; }
@keyframes avaBreatheRing { 0%, 100% { transform: scale(.96); opacity: .35; } 50% { transform: scale(1.06); opacity: 1; } }
/* speaking: ripples */
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="speaking"] .ava-orb { animation: avaBreathe 1.1s ease-in-out infinite; }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="speaking"] .ava-orb i { inset: 0; animation: avaRipple 1.6s ease-out infinite; }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="speaking"] .ava-orb i:nth-child(2) { animation-delay: .8s; }
@keyframes avaRipple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.55); opacity: 0; } }
@keyframes avaBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
/* thinking: a rotating dashed ring */
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="thinking"] .ava-orb i:nth-child(1) { opacity: 1; border-style: dashed; border-width: 2px; border-color: rgba(13,138,210,.7); animation: avaSpin 6s linear infinite; }
@keyframes avaSpin { to { transform: rotate(360deg); } }
/* connecting: a soft pulse */
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="connecting"] .ava-orb { filter: saturate(.7); }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="connecting"] .ava-orb i:nth-child(1) { inset: 0; animation: avaRipple 2s ease-out infinite; }
/* paused / offline: grey, slightly smaller */
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="paused"] .ava-orb, :is(.ava-stage, .ava-bar, .ava-mini)[data-state="offline"] .ava-orb { filter: saturate(0) brightness(1.05); transform: scale(.9); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), inset 0 -18px 30px rgba(7,26,51,.35), 0 18px 40px -14px rgba(7,26,51,.35); }
.ava-caption { margin: 0; max-width: 100%; font-family: var(--ui, "DM Sans", sans-serif); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #5b6776); min-height: 1.4em; line-height: 1.5; }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="listening"] .ava-caption { color: #157f55; }
:is(.ava-stage, .ava-bar, .ava-mini)[data-state="speaking"] .ava-caption, :is(.ava-stage, .ava-bar, .ava-mini)[data-state="thinking"] .ava-caption { color: var(--blue-deep, #0a6cab); }
/* Voice view with the transcript revealed: the stage shrinks to a strip above the log. */
.ava-panel[data-mode="voice"][data-transcript="shown"] .ava-stage { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--ava-line); background: #fff; text-align: left; }
.ava-panel[data-mode="voice"][data-transcript="shown"] .ava-orb { width: 36px; height: 36px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 14px -4px rgba(13,138,210,.5); }
.ava-panel[data-mode="voice"][data-transcript="shown"] .ava-orb i { inset: -5px; }
.ava-panel[data-mode="voice"][data-transcript="shown"] .ava-orb i:nth-child(2) { inset: -10px; }
.ava-panel[data-mode="voice"][data-transcript="shown"] .ava-orb::after { box-shadow: none; }
.ava-panel[data-mode="voice"][data-transcript="shown"] .ava-caption { text-align: left; }

/* ---------- Compact layout: a small voice bar instead of the panel ----------
 * [data-layout="compact"] while voice mode has nothing to read (transcript + composer hidden); "full" otherwise.
 * Desktop: floating pill bottom-right. Mobile: bottom bar above the (hidden) action bar. */
.ava-bar { display: none; align-items: center; gap: 10px; padding: 8px 8px 8px 8px; color: #fff; background: var(--ava-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ava-panel[data-layout="compact"] { width: 396px; height: auto; min-height: 0; border-radius: var(--r-pill, 999px); border-color: var(--ava-glass-line); box-shadow: 0 12px 40px rgba(7,26,51,.22), 0 2px 6px rgba(7,26,51,.14); animation-name: avaBarIn; }
/* The compact pill replaces the launcher (same material, same corner). */
.ava-panel[data-layout="compact"]:popover-open { width: 396px; height: auto; inset: auto var(--ava-right) var(--ava-bottom) auto; }
.ava.is-open[data-layout="compact"] .ava-launch { display: none; }
.ava-panel[data-layout="compact"] > :not(.ava-bar) { display: none; }
.ava-panel[data-layout="compact"] .ava-bar { display: flex; }
@keyframes avaBarIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.ava-bar-orb { width: 44px; height: 44px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 16px rgba(13,138,210,.4); }
.ava-bar-orb i { inset: -5px; }
.ava-bar-orb i:nth-child(2) { inset: -10px; }
.ava-bar[data-state="listening"] .ava-orb::after { box-shadow: 0 0 0 4px rgba(31,169,113,.22); }
.ava-bar-caption { flex: 1; min-width: 0; padding-left: 4px; text-align: left; color: rgba(255,255,255,.78); font-size: 10px; letter-spacing: .1em; line-height: 1.35; max-height: 2.7em; overflow: hidden; }
.ava-bar[data-state="listening"] .ava-caption { color: #7ee2b8; }
.ava-bar[data-state="speaking"] .ava-caption, .ava-bar[data-state="thinking"] .ava-caption { color: var(--sky-2, #aed7f0); }
.ava-bar-mic.ava-mic { width: 44px; height: 44px; box-shadow: 0 6px 16px rgba(13,138,210,.35); }
.ava-bar-mic.ava-mic:hover { transform: none; }
.ava-bar-mic.ava-mic svg { width: 18px; height: 18px; }
.ava-bar-btn.ava-icon { width: 36px; height: 36px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); }
.ava-bar-btn.ava-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ava-icon[data-ava-collapse] svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ava-icon[data-ava-collapse][hidden] { display: none; }

/* ---------- Mini layout: only the orb (+ a caption chip) docked where the launcher sits ----------
 * Phones use it as their compact state; desktop reaches it through "Minimize". Tap = mic (phone) / restore
 * (desktop), long press or the ≡ badge = expand. The launcher hides underneath it. */
.ava-mini { display: none; position: relative; align-items: center; justify-content: flex-end; gap: 12px; padding: 8px; }
/* No entry animation on layout switches: the orb and badge must be still (and clickable) the moment they appear. */
.ava-panel[data-layout="mini"] { width: auto; height: auto; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; animation: none; }
.ava-panel[data-layout="mini"]:popover-open { width: auto; height: auto; inset: auto var(--ava-right) calc(var(--ava-bottom) + var(--ava-lift, 0px)) auto; }
.ava-panel[data-layout="mini"] > :not(.ava-mini) { display: none; }
.ava-panel[data-layout="mini"] .ava-mini { display: flex; }
.ava.is-open[data-layout="mini"] .ava-launch { display: none; }
/* The launcher's navy-glass ring with the blue orb inside (the ring is drawn with box-shadow so the state rings can sit outside it). */
.ava-mini-orb { width: 50px; height: 50px; margin: 7px; padding: 0; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 0 7px var(--ava-glass), 0 0 0 8px var(--ava-glass-line), 0 12px 40px rgba(7,26,51,.22); transition: transform .45s var(--ease, ease), filter .45s; }
.ava-mini-orb:hover { transform: translateY(-2px); }
.ava-mini-orb:focus-visible { outline: 3px solid var(--blue, #0d8ad2); outline-offset: 3px; }
.ava-mini-orb i { inset: -14px; }
.ava-mini-orb i:nth-child(2) { inset: -21px; }
.ava-mini[data-state="listening"] .ava-orb::after { box-shadow: 0 0 0 7px rgba(31,169,113,.55); }
.ava-mini[data-state="paused"] .ava-orb, .ava-mini[data-state="offline"] .ava-orb { transform: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 0 7px var(--ava-glass), 0 0 0 8px var(--ava-glass-line), 0 12px 40px rgba(7,26,51,.22); }
.ava-mini-caption { max-width: 26ch; padding: 8px 14px; box-shadow: 0 8px 24px rgba(7,26,51,.18); animation: avaBarIn .35s var(--ease, ease); transition: opacity .3s; border: 1px solid var(--ava-glass-line); border-radius: var(--r-pill, 999px); background: var(--ava-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: rgba(255,255,255,.85); font-family: var(--ui, "DM Sans", sans-serif); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava-mini-caption:empty { display: none; }
.ava-mini[data-error] .ava-mini-caption { cursor: pointer; color: #fff; border-color: rgba(255,255,255,.35); }
.ava-mini[data-error] .ava-mini-caption:focus-visible { outline: 3px solid var(--blue, #0d8ad2); outline-offset: 2px; }
.ava-mini[data-state="listening"] .ava-mini-caption { color: #7ee2b8; }
.ava-mini-expand { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; padding: 0; border: 1px solid rgba(11,37,69,.08); border-radius: 50%; background: #fff; color: var(--navy, #0b2545); font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(7,26,51,.25); transition: background .25s, color .25s; }
.ava-mini-expand:hover { background: var(--blue, #0d8ad2); color: #fff; }
.ava-mini-expand:focus-visible { outline: 3px solid var(--blue, #0d8ad2); outline-offset: 2px; }
.ava-icon[data-ava-minimize] svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }

/* ---------- Header dock (phones, while the cookie banner is up) ----------
 * .ava[data-dock="header"]: the launcher slides into the header pill (40px, left of the phone/menu well);
 * the mini orb does the same when a session is running. Positions come from --ava-dock-x/y set by the script. */
.ava-launch { will-change: transform; }
.ava.is-ready[data-dock="header"] .ava-launch { transform: translate(var(--ava-dock-x, 0px), var(--ava-dock-y, 0px)) scale(.67); box-shadow: 0 6px 18px rgba(7,26,51,.35); }
.ava.is-ready[data-dock="header"] .ava-launch:hover { transform: translate(var(--ava-dock-x, 0px), var(--ava-dock-y, 0px)) scale(.7); }
.ava-mini { transition: transform .45s var(--ease, cubic-bezier(.2,.74,.2,1)); }
.ava-panel[data-dock="header"] .ava-mini { transform: translate(var(--ava-mini-dock-x, 0px), var(--ava-mini-dock-y, 0px)); }
.ava-panel[data-dock="header"] .ava-mini-orb { width: 40px; height: 40px; }
.ava-panel[data-dock="header"] .ava-mini-orb i { inset: -4px; }
.ava-panel[data-dock="header"] .ava-mini-orb i:nth-child(2) { inset: -8px; }
.ava-panel[data-dock="header"] .ava-mini-caption { order: 2; }
.ava-panel[data-dock="header"] .ava-mini-expand { width: 20px; height: 20px; font-size: 11px; }

/* ---------- Controls row: mic, "Type instead", "Transcript" (mobile action bar wells) ---------- */
.ava-controls { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--ava-line); background: #fff; }
.ava-ctl { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 6px; border: 1px solid transparent; border-radius: var(--r-pill, 999px); background: transparent; color: var(--navy, #0b2545); font-family: var(--ui, "DM Sans", sans-serif); font-size: 10px; font-weight: 600; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: background .25s var(--ease, ease), border-color .25s var(--ease, ease); }
.ava-ctl svg { flex: none; box-sizing: content-box; width: 16px; height: 16px; padding: 8px; border-radius: 50%; color: var(--blue, #0d8ad2); background: rgba(13,138,210,.12); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: background .25s, color .25s; }
.ava-ctl:hover { border-color: rgba(11,37,69,.16); }
.ava-ctl[aria-pressed="true"] { background: var(--sky, #d6e8f4); }
.ava-ctl[aria-pressed="true"] svg { background: var(--blue, #0d8ad2); color: #fff; }
/* Text mode: the mic becomes a quiet well beside the composer, aligned left like the mobile action bar. */
.ava-panel[data-mode="text"] .ava-controls { justify-content: flex-start; border-top: 0; padding: 8px 14px 0; }
.ava-panel[data-mode="text"] .ava-mic { width: 44px; height: 44px; background: rgba(13,138,210,.12); color: var(--blue, #0d8ad2); box-shadow: none; }
.ava-panel[data-mode="text"] .ava-mic:hover { background: var(--blue, #0d8ad2); color: #fff; transform: none; }
.ava-panel[data-mode="text"] .ava-mic svg { width: 18px; height: 18px; }
.ava-panel[data-mode="text"] .ava-mic[aria-pressed="true"] { background: var(--ava-green, #1fa971); color: #fff; }

/* ---------- Transcript ---------- */
.ava-log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.ava-msg { max-width: 86%; padding: 12px 16px; border-radius: var(--r-md, 18px); font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; animation: avaMsgIn .3s var(--ease, ease); }
@keyframes avaMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ava-msg-ava { align-self: flex-start; background: #fff; color: var(--ink, #101a2c); border: 1px solid var(--ava-line); border-bottom-left-radius: var(--r-xs, 6px); }
.ava-msg-user { align-self: flex-end; background: var(--navy, #0b2545); color: #fff; border-bottom-right-radius: var(--r-xs, 6px); }
.ava-msg-note { align-self: center; max-width: 92%; padding: 4px 12px; font-family: var(--ui, "DM Sans", sans-serif); font-size: 11.5px; font-weight: 500; line-height: 1.5; color: var(--muted, #5b6776); text-align: center; background: transparent; border: 0; }
.ava-msg[data-streaming]::after { content: ""; display: inline-block; width: 6px; height: 14px; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--blue, #0d8ad2); animation: avaBlink .9s infinite; }
.ava-msg-user:empty { display: none; }

/* Chips: .button-ghost-navy, with "book a visit" as the accent CTA */
.ava-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 12px; }
.ava-chips[hidden] { display: none; }
.ava-chips button { min-height: 38px; padding: 0 16px; border: 1px solid rgba(11,37,69,.35); border-radius: var(--r-pill, 999px); background: transparent; color: var(--navy, #0b2545); font-family: var(--ui, "DM Sans", sans-serif); font-size: 10px; font-weight: 600; letter-spacing: .075em; text-transform: uppercase; cursor: pointer; transition: background .25s var(--ease, ease), border-color .25s var(--ease, ease), transform .25s var(--ease, ease); }
.ava-chips button:hover { border-color: var(--navy, #0b2545); background: rgba(11,37,69,.06); transform: translateY(-1px); }
.ava-chips .ava-chip-new { width: 100%; min-height: 46px; border-color: transparent; background: var(--blue-button, #0c7bbb); color: #fff; font-size: 11px; }
.ava-chips .ava-chip-new:hover { background: var(--blue-deep, #0a6cab); border-color: transparent; }

/* Composer */
.ava-compose { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; background: #fff; }
.ava-compose input { flex: 1; min-width: 0; height: 48px; padding: 0 18px; border: 1px solid var(--line, rgba(11,37,69,.16)); border-radius: var(--r-pill, 999px); background: var(--paper, #f3f4f2); font: inherit; font-size: 14.5px; color: var(--ink, #101a2c); transition: border-color .2s, box-shadow .2s, background .2s; }
.ava-compose input:focus { outline: none; border-color: var(--blue, #0d8ad2); box-shadow: 0 0 0 3px rgba(13,138,210,.18); background: #fff; }
.ava-compose input::placeholder { color: rgba(91,103,118,.8); }
.ava-mic, .ava-send { position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; transition: background .25s var(--ease, ease), transform .25s var(--ease, ease), box-shadow .25s; }
.ava-mic { width: 56px; height: 56px; background: var(--blue-button, #0c7bbb); color: #fff; box-shadow: 0 8px 20px rgba(13,138,210,.35); }
.ava-mic:hover { background: var(--blue-deep, #0a6cab); transform: translateY(-2px); }
.ava-mic svg, .ava-send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ava-mic[aria-pressed="true"] { background: var(--ava-green, #1fa971); color: #fff; box-shadow: 0 8px 20px rgba(31,169,113,.35); }
.ava-mic[aria-pressed="true"]:hover { background: #178a5c; }
.ava-mic-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ava-green, #1fa971); opacity: 0; pointer-events: none; }
.ava-mic[aria-pressed="true"] .ava-mic-ring { animation: avaPulse 1.6s ease-out infinite; }
.ava-send { background: var(--navy, #0b2545); color: #fff; }
.ava-send svg { width: 18px; height: 18px; }
.ava-send:hover { background: var(--blue-deep, #0a6cab); transform: translateX(1px); }
.ava-foot { margin: 0; padding: 4px 18px 14px; font-family: var(--ui, "DM Sans", sans-serif); font-size: 10px; line-height: 1.5; letter-spacing: .02em; color: var(--muted, #5b6776); background: #fff; }
.ava-foot a { color: var(--blue-deep, #0a6cab); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Ava pointing at the page */
.ava-highlight { animation: avaGlow 2.4s var(--ease, ease) both; }
@keyframes avaGlow { 0% { box-shadow: 0 0 0 0 rgba(13,138,210,0); } 15% { box-shadow: 0 0 0 6px rgba(13,138,210,.45), 0 0 60px rgba(13,138,210,.25); } 100% { box-shadow: 0 0 0 0 rgba(13,138,210,0); } }
.ava-filled { animation: avaFill 1.3s ease both; }
@keyframes avaFill { 0% { box-shadow: 0 0 0 0 rgba(31,169,113,0); } 20% { box-shadow: 0 0 0 4px rgba(31,169,113,.45); } 100% { box-shadow: 0 0 0 0 rgba(31,169,113,0); } }

/* Keep the assistant out of the way of the site's own overlays */
body.menu-open .ava { visibility: hidden; }
body.modal-open .ava-launch { transform: translateY(0) scale(.86); opacity: .55; pointer-events: none; }
/* While Ava is open, the lead form modal slides left so both stay visible and Ava can fill it in. */
/* Only the full panel needs the room; the compact bar sits in the corner under the form. */
@media (min-width: 901px) { body.ava-open[data-ava-layout="full"] .assessment-modal { margin-right: calc(var(--ava-w, 392px) + 48px); width: min(100% - var(--gutter) - var(--ava-w, 392px) - 48px, 1040px); } }
@media (max-width: 900px) and (min-width: 621px) { body.ava-open .ava-panel:popover-open { --ava-w: 360px; } body.ava-open[data-ava-layout="full"] .assessment-modal { margin-right: calc(360px + 32px); width: min(100% - var(--gutter) - 392px, 1040px); } }

@media (max-width: 900px) { .ava { --ava-w: 360px; } }
@media (max-width: 620px) {
  /* Sit above the floating mobile action bar (52px pill + 12px inset + safe area) and retain the primary label. */
  .ava { --ava-right: 12px; --ava-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .ava-launch { height: 52px; max-width: calc(100vw - 24px); padding: 0 18px 0 5px; gap: 10px; }
  .ava-launch-label small { display: none; }
  .ava-launch-orb { width: 40px; height: 40px; }
  .ava.is-open .ava-launch { display: none; }
  .ava-panel, .ava-panel:popover-open { position: fixed; inset: 0; width: auto; max-width: none; height: auto; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ava-panel.ava-entering { animation-name: avaSheetIn; }
  /* Compact: a bottom bar in the action bar's place (full width minus 12px gutters). */
  /* The popover resets --ava-bottom/--ava-right to the desktop values; the orb must sit where the launcher does, above the action bar. */
  .ava-panel[data-layout="mini"], .ava-panel[data-layout="mini"]:popover-open { --ava-right: 12px; --ava-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); inset: auto var(--ava-right) calc(var(--ava-bottom) + var(--ava-lift, 0px)) auto; width: auto; height: auto; border: 0; border-radius: 0; padding-bottom: 0; animation: none; box-shadow: none; background: transparent; }
  .ava-mini { flex-direction: column; align-items: flex-end; gap: 10px; padding: 8px 2px 2px; }
  .ava-mini-orb { width: 46px; height: 46px; }
  .ava-mini-expand { top: auto; right: 0; bottom: 48px; }
  /* With the lead form sheet open, the full panel docks to the bottom 40% and the sheet keeps the top. */
  /* With the lead form sheet open, phones show only the orb, floating inside the sheet above its sticky CTA
   * (--ava-over-bottom is measured by the script). The sheet keeps its normal height. */
  .ava-panel[data-over-form][data-layout="mini"], .ava-panel[data-over-form][data-layout="mini"]:popover-open { inset: auto 12px var(--ava-over-bottom, 12px) auto; transition: bottom .18s var(--ease, ease); }
  .ava-mini[data-over-form] .ava-mini-orb { width: 46px; height: 46px; box-shadow: 0 0 0 3px #fff, inset 0 2px 0 rgba(255,255,255,.3), 0 10px 24px rgba(7,26,51,.45); }
  .ava-mini[data-over-form] .ava-mini-orb i { inset: -7px; }
  .ava-mini[data-over-form] .ava-mini-orb i:nth-child(2) { inset: -13px; }
  .ava-mini[data-over-form] .ava-mini-expand { width: 22px; height: 22px; font-size: 12px; }
  @keyframes avaSheetIn { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
  .ava-head { padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px 18px; }
  .ava-stage .ava-orb { width: 148px; height: 148px; }
  .ava-stage { gap: 30px; }
  .ava-msg { font-size: 16px; }
  .ava-compose input { font-size: 16px; } /* prevents iOS zoom on focus */
  .ava-controls { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.ava-open[data-ava-layout="full"] .mobile-action-bar { transform: translateY(140%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ava-launch .jarvis-robot-eye { animation: none; }
  .ava-launch, .ava-panel, .ava-msg { animation: none; transition: none; }
  .ava-launch-orb i, .ava-avatar i, .ava-mic-ring, .ava-orb, .ava-orb i, .ava-bar, .ava-mini-caption, .ava-panel[data-layout="mini"] { animation: none; }
  :is(.ava-stage, .ava-bar, .ava-mini)[data-state="listening"] .ava-orb i, :is(.ava-stage, .ava-bar, .ava-mini)[data-state="thinking"] .ava-orb i:nth-child(1) { opacity: 1; transform: none; }
  .ava-highlight, .ava-filled { animation-duration: .01s; }
}

/* Invitation has two separate keyboard targets and never starts audio on its own. */
/* The invitation extends the edge tab into one blue surface. */
.ava-invitation { position: absolute; right: 56px; bottom: 0; display: flex; align-items: center; width: min(244px, calc(100vw - 68px)); height: 52px; margin: 0; border: 1px solid var(--ava-glass-line); border-right: 0; border-radius: 28px 0 0 28px; background: var(--blue-button, #0c7bbb); color: #fff; animation: avaInviteIn .22s ease-out; }
.ava-invitation[hidden] { display: none; }
.ava-invitation button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ava-invitation-open { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 0 0 18px; text-align: left; line-height: 1.2; }
.ava-invitation-open > span { font-size: 11px; font-weight: 500; color: rgba(255,255,255,.88); white-space: nowrap; }
.ava-invitation-open strong { font-family: var(--ui, "DM Sans", sans-serif); font-size: 15px; font-weight: 700; }
.ava-invitation-open strong span { display: inline-block; margin-left: 5px; color: #bceaff; }
.ava-invitation-dismiss { flex: none; width: 44px; height: 44px; padding: 0; font-size: 20px !important; border-radius: 50%; color: rgba(255,255,255,.75) !important; }
.ava-invitation button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; border-radius: 24px; }
.ava-invitation-dismiss:hover { background: rgba(255,255,255,.12); }
@keyframes avaInviteIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ava-invitation { animation: none; } }

/* Keep voice activation inside the text field, with its own keyboard target. */
.ava-compose-field { position: relative; display: flex; flex: 1; min-width: 0; }
.ava-panel[data-mode="text"] .ava-compose-field input { padding-right: 56px; }
.ava-panel[data-mode="text"] .ava-compose-field .ava-mic { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; }

/* Desktop: a small edge tab, centered two-thirds down the viewport. */
@media (min-width: 621px) {
  .ava:not(.is-open) { right: 0; bottom: max(calc(33.333dvh - 26px), var(--ava-lift, 0px)); }
  .ava:not(.is-open) .ava-launch { gap: 0; padding: 0 10px 0 6px; border-right: 0; border-radius: 28px 0 0 28px; box-shadow: 0 0 0 1px rgba(120,218,255,.6), 0 0 26px rgba(36,173,242,.72), 0 0 54px rgba(13,138,210,.45), 0 6px 20px rgba(7,26,51,.24); }
  .ava:not(.is-open) .ava-launch-label { max-width: 0; margin-left: 0; overflow: hidden; opacity: 0; visibility: hidden; white-space: nowrap; transition: max-width .2s ease, margin-left .2s ease, opacity .2s ease; }
  .ava:not(.is-open) .ava-launch:is(:hover, :focus-visible) .ava-launch-label { max-width: 160px; margin-left: 10px; opacity: 1; visibility: visible; }
  .ava:not(.is-open).is-ready .ava-launch:hover { transform: none; }
  .ava:not(.is-open) .ava-launch:focus-visible { outline-color: #fff; outline-offset: -4px; }

}
@media (min-width: 621px) and (prefers-reduced-motion: reduce) {
  .ava:not(.is-open) .ava-launch-label { transition: none; }
}

/* Attention lives on a non-interactive halo: the control never moves. */
.ava-launch { position: relative; }
.ava-launch::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 16px 4px rgba(36,173,242,.55), 0 0 32px 8px rgba(13,138,210,.22); opacity: .25; animation: jarvisAttention 4s ease-in-out infinite; }
@keyframes jarvisAttention { 0%, 65%, 100% { opacity: .2; } 82% { opacity: .85; } }
.ava[data-attention-paused] .ava-launch::before { animation: none; opacity: 0; }
.ava.is-ready .ava-launch:hover { transform: none; }
.ava-header-slot { display: none; }
@media (max-width: 620px) {
  .pill-brand.has-jarvis-slot { padding-right: 150px; }
  .has-jarvis-slot .brand { min-width: 0; max-width: 100%; }
  .has-jarvis-slot .ava-header-slot { display: block; position: absolute; right: 102px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; pointer-events: none; }
  .ava:not(.is-open) { right: 0; bottom: var(--ava-bottom); }
  .ava .ava-launch { width: 57px; height: 52px; padding: 0 10px 0 6px; gap: 0; border-right: 0; border-radius: 28px 0 0 28px; }
  .ava-launch-label { display: none; }
  .ava:not(.is-open)[data-dock="header"] { left: var(--ava-header-left); top: var(--ava-header-top); right: auto; bottom: auto; }
  .ava.is-ready[data-dock="header"] .ava-launch, .ava.is-ready[data-dock="header"] .ava-launch:hover { width: 44px; height: 44px; padding: 1px; border: 1px solid var(--ava-glass-line); border-radius: 50%; transform: none; box-shadow: 0 0 8px rgba(36,173,242,.3); }
  .ava[data-dock="header"] .ava-launch::before { inset: 0; box-shadow: 0 0 8px 2px rgba(36,173,242,.5); }

}
@media (prefers-reduced-motion: reduce) {
  .ava-launch::before { animation: none; opacity: .4; }
}

@media (max-width: 360px) {
  .has-jarvis-slot .brand { gap: 6px; }
  .has-jarvis-slot .brand-mark { height: 32px; }
  .has-jarvis-slot .brand-type strong { font-size: 15px; }
  .has-jarvis-slot .brand-type small { font-size: 5.5px; }
}

/* Share a single outline and attention halo while the invitation is expanded. */
.ava:not(.is-open):has(.ava-invitation:not([hidden]))::before { content: ""; position: absolute; right: 0; bottom: 0; width: min(300px, calc(100vw - 12px)); height: 52px; border-radius: 28px 0 0 28px; box-shadow: 0 0 0 1px rgba(104,207,255,.4), 0 0 16px 4px rgba(36,173,242,.55), 0 0 32px 8px rgba(13,138,210,.22); opacity: .25; pointer-events: none; animation: jarvisAttention 4s ease-in-out infinite; }
.ava:not(.is-open):has(.ava-invitation:not([hidden])) .ava-launch { width: 57px; padding: 0 10px 0 6px; gap: 0; border-left-color: transparent; border-radius: 0; box-shadow: none; }
.ava:has(.ava-invitation:not([hidden])) .ava-launch::before { display: none; }
.ava:not(.is-open):has(.ava-invitation:not([hidden])) .ava-launch .ava-launch-label { display: none; }
.ava[data-attention-paused]:has(.ava-invitation:not([hidden]))::before { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .ava:not(.is-open):has(.ava-invitation:not([hidden]))::before { animation: none; opacity: .4; }
  .ava[data-attention-paused]:has(.ava-invitation:not([hidden]))::before { opacity: 0; }
}
