:host { all: initial; display: block; }

.ax {
	--ax-primary: #157bcc;
	--ax-on-primary: #fff;
	--ax-radius: 16px;
	--ax-width: 380px;
	--ax-height: 600px;
	--ax-x: 20px;
	--ax-y: 20px;
	--ax-z: 999999;
	--ax-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ax-bg: #ffffff;
	--ax-surface: #f6f7f9;
	--ax-fg: #1f2329;
	--ax-muted: #6b7280;
	--ax-border: #e6e8eb;
	--ax-shadow: 0 32px 72px -20px rgba(15, 23, 42, .42), 0 14px 32px -14px rgba(15, 23, 42, .28);
	font: 14px/1.5 var(--ax-font);
	color: var(--ax-fg);
	-webkit-font-smoothing: antialiased;
}
.ax--theme-dark {
	--ax-bg: #16191e; --ax-surface: #1d2127; --ax-fg: #eef0f3; --ax-muted: #9aa3ae;
	--ax-border: #2b3038; --ax-shadow: 0 32px 72px -16px rgba(0, 0, 0, .7);
}
@media (prefers-color-scheme: dark) {
	.ax--theme-auto {
		--ax-bg: #16191e; --ax-surface: #1d2127; --ax-fg: #eef0f3; --ax-muted: #9aa3ae;
		--ax-border: #2b3038; --ax-shadow: 0 32px 72px -16px rgba(0, 0, 0, .7);
	}
}
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- floating container ---------- */
.ax--float { position: fixed; bottom: var(--ax-y); z-index: var(--ax-z); display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.ax--float.ax--right { right: var(--ax-x); }
.ax--float.ax--left { left: var(--ax-x); align-items: flex-start; }
@media (max-width: 768px) { .ax--float { bottom: var(--ax-y-mobile); } }
/* Admin preview: same layout, contained in the preview box. */
.ax--float.ax--contained { position: absolute; inset: 0; z-index: 1; justify-content: flex-end; padding: calc(var(--ax-y) + var(--ax-close-space, 0px)) var(--ax-x) var(--ax-y); pointer-events: none; }
.ax--contained > * { pointer-events: auto; }

.ax-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 22, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.ax--contained .ax-backdrop { position: absolute; inset: 0; }
.ax.is-open .ax-backdrop { opacity: 1; pointer-events: auto; }

/* ---------- launcher ---------- */
.ax-launcher {
	--ax-l-size: 60px; --ax-l-bg: var(--ax-primary); --ax-l-fg: var(--ax-on-primary); --ax-l-icon: 27px; --ax-l-border: 0;
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	height: var(--ax-l-size); min-width: var(--ax-l-size); padding: 0; border: var(--ax-l-border); cursor: pointer;
	background: var(--ax-l-bg); color: var(--ax-l-fg); font-weight: 600; font-size: 15px; letter-spacing: .01em;
	-webkit-tap-highlight-color: transparent;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.ax-launcher--icon { width: var(--ax-l-size); }
.ax-launcher--pill { padding: 0 calc(var(--ax-l-size) * .38) 0 calc(var(--ax-l-size) * .3); }
.ax-shape--circle { border-radius: 999px; }
.ax-shape--rounded { border-radius: calc(var(--ax-l-size) * .3); }
.ax-shape--square { border-radius: 6px; }
.ax-launcher:focus-visible { outline: 3px solid var(--ax-primary); outline-offset: 3px; }
.ax-l-icon, .ax-l-close { display: inline-grid; place-items: center; width: var(--ax-l-icon); height: var(--ax-l-icon); flex: none; transition: transform .25s ease, opacity .2s ease; }
.ax-l-icon svg, .ax-l-close svg { width: 100%; height: 100%; }
.ax-l-icon img { width: 100%; height: 100%; object-fit: contain; }
.ax-l-icon .ax-l-avatar { object-fit: cover; border-radius: 50%; }
.ax-launcher--icon .ax-l-icon:has(.ax-l-avatar) { width: calc(var(--ax-l-size) - 8px); height: calc(var(--ax-l-size) - 8px); }
.ax-l-close { display: none; }
.ax-launcher-label { white-space: nowrap; }

/* shadows */
.ax-shadow--soft { box-shadow: 0 10px 28px -6px rgba(15, 23, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .18); }
.ax-shadow--strong { box-shadow: 0 18px 40px -8px rgba(15, 23, 42, .5), 0 4px 10px rgba(15, 23, 42, .2), inset 0 1px 0 rgba(255, 255, 255, .2); }
.ax-shadow--glow { box-shadow: 0 8px 28px color-mix(in srgb, var(--ax-l-glow, var(--ax-primary)) 55%, transparent); }
.ax-shadow--none { box-shadow: none; }
/* hover */
.ax-hover--lift:hover { transform: translateY(-3px); }
.ax-hover--grow:hover { transform: scale(1.08); }
.ax-hover--brighten:hover { filter: brightness(1.1); }

/* open state: hide, or morph into a close button */
.ax--float.is-open .ax-launcher:not(.ax-launcher--toggle) { display: none; }
.ax.is-open .ax-launcher--toggle { width: var(--ax-l-size); padding: 0; border-radius: 999px; }
.ax.is-open .ax-launcher--toggle .ax-l-icon,
.ax.is-open .ax-launcher--toggle .ax-launcher-label,
.ax.is-open .ax-launcher--toggle .ax-l-dot { display: none; }
.ax.is-open .ax-launcher--toggle .ax-l-close { display: inline-grid; width: calc(var(--ax-l-size) * .4); height: calc(var(--ax-l-size) * .4); animation: ax-spin-in .25s ease; }
@keyframes ax-spin-in { from { transform: rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* side tab */
.ax-launcher--tab {
	position: fixed; bottom: calc(var(--ax-y) + 120px); height: auto; min-width: 0; padding: 12px 18px; gap: 8px;
	--ax-l-icon: 20px; font-size: 15px;
}
.ax--contained .ax-launcher--tab { position: absolute; bottom: calc(var(--ax-y) + 120px); }
.ax--right .ax-launcher--tab { right: 0; border-radius: 22px 0 0 22px; }
.ax--left .ax-launcher--tab { left: 0; border-radius: 0 22px 22px 0; }
.ax--float.is-open .ax-launcher--tab { display: none; }
.ax--right .ax-launcher--tab.ax-hover--lift:hover { transform: translateX(-4px); }
.ax--left .ax-launcher--tab.ax-hover--lift:hover { transform: translateX(4px); }

/* notification dot */
.ax-l-dot { position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px #fff; }
/* tooltip */
.ax-launcher.has-tooltip::after {
	content: attr(data-tooltip); position: absolute; bottom: calc(100% + 10px); right: 0; white-space: nowrap;
	padding: 6px 10px; border-radius: 8px; background: #111827; color: #fff; font-size: 12px; font-weight: 500;
	opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.ax--left .ax-launcher.has-tooltip::after { right: auto; left: 0; }
.ax-launcher--tab.has-tooltip::after { bottom: auto; top: -36px; }
.ax-launcher.has-tooltip:hover::after, .ax-launcher.has-tooltip:focus-visible::after { opacity: 1; transform: none; }
.ax.is-open .ax-launcher.has-tooltip::after { display: none; }

/* attention animations */
.ax-attn--bounce { animation: ax-bounce .9s ease; }
@keyframes ax-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } 50% { transform: translateY(0); } 70% { transform: translateY(-5px); } }
.ax-attn--wiggle { animation: ax-wiggle .8s ease; }
@keyframes ax-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
.ax-attn--breathe { animation: ax-breathe 1.6s ease; }
@keyframes ax-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.ax-attn--pulse::before {
	content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--ax-l-glow, var(--ax-primary));
	animation: ax-ring 1.4s ease-out; z-index: -1;
}
@keyframes ax-ring { from { transform: scale(1); opacity: .55; } to { transform: scale(1.7); opacity: 0; } }

/* ---------- teaser ---------- */
.ax-teaser {
	position: relative; max-width: 260px; display: flex; align-items: flex-start;
	background: var(--ax-bg); color: var(--ax-fg); border: 0;
	border-radius: 16px; box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .4); animation: ax-pop .25s ease-out;
	order: -1;
}
.ax-teaser-text { background: none; border: 0; text-align: start; padding: 12px 14px; cursor: pointer; }
.ax-teaser-x { background: none; border: 0; padding: 8px; color: var(--ax-muted); cursor: pointer; }
.ax--float.is-open .ax-teaser { display: none; }

/* ---------- panel ---------- */
.ax-panel {
	display: none; flex-direction: column; overflow: hidden; position: relative; isolation: isolate;
	background: var(--ax-bg); border: 0; border-radius: var(--ax-radius);
}
.ax.is-open .ax-panel { display: flex; }
.ax--float .ax-panel {
	width: var(--ax-width); height: min(var(--ax-height), calc(100vh - var(--ax-y) - var(--ax-close-space, 0px) - 110px));
	box-shadow: var(--ax-shadow); transform-origin: bottom right;
}
.ax--float .ax-panel { width: min(var(--ax-width), calc(100vw - 2 * var(--ax-x))); }
.ax--float.ax--fit .ax-panel { height: min(680px, calc(100vh - var(--ax-top, 0px) - var(--ax-y) - var(--ax-close-space, 0px) - var(--ax-launcher-h) - 40px)); }
.ax--contained .ax-panel { flex: 0 1 auto; min-height: 0; height: var(--ax-height); max-height: 100%; width: min(var(--ax-width), 100%); }
.ax--contained.ax--fit .ax-panel { flex-grow: 1; height: auto; max-height: 680px; }
.ax--contained .ax-launcher, .ax--contained .ax-teaser { flex-shrink: 0; }
.ax.is-closing .ax-panel { animation: ax-close .18s ease-in forwards; }
@keyframes ax-close { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.ax--float.ax--left .ax-panel { transform-origin: bottom left; }
.ax--anim-pop.is-open .ax-panel { animation: ax-pop .22s ease-out; }
.ax--anim-slide.is-open .ax-panel { animation: ax-slide .28s cubic-bezier(.2, .8, .2, 1); }
.ax--anim-fade.is-open .ax-panel { animation: ax-fade .2s ease-out; }
.ax--inline .ax-panel { width: 100%; height: var(--ax-height); animation: none; box-shadow: 0 18px 50px -24px rgba(15, 23, 42, .35); }
@keyframes ax-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ax-slide { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes ax-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ax-panel, .ax-teaser, .ax-launcher, .ax-launcher::before { animation: none !important; transition: none !important; } }

/* Phones (and short landscape screens): a full-screen sheet that respects notches, home bars and the keyboard. */
@media (max-width: 640px), (max-height: 520px) {
	.ax--float:not(.ax--contained) { --ax-x: 16px; }
	.ax--float.ax--mobile-full.is-open:not(.ax--contained) { inset: 0; gap: 0; }
	.ax--float.ax--mobile-full:not(.ax--contained) .ax-panel {
		position: fixed; inset: var(--ax-vvt, 0px) 0 auto 0; width: 100%; max-width: none;
		height: 100vh; height: 100dvh; height: var(--ax-vvh, 100dvh); max-height: none; border-radius: 0;
	}
	.ax--float.ax--mobile-full.is-open:not(.ax--contained) .ax-launcher,
	.ax--float.ax--mobile-full.is-open:not(.ax--contained) .ax-teaser { display: none; }
	.ax--float.ax--mobile-full:not(.ax--contained) .ax-header { padding-top: max(14px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
	.ax--float.ax--mobile-full:not(.ax--contained) .ax-frame-box { padding-bottom: env(safe-area-inset-bottom); }
	/* Without a header the sheet stops below the status bar, leaving room for the close button above it. */
	.ax--float.ax--mobile-full.ax--no-header.is-open:not(.ax--contained)::before { content: ""; position: fixed; inset: 0; background: rgba(15, 18, 22, .55); }
	.ax--float.ax--mobile-full.ax--no-header:not(.ax--contained) .ax-panel {
		inset: calc(var(--ax-vvt, 0px) + 56px + env(safe-area-inset-top)) 0 auto 0; height: calc(var(--ax-vvh, 100dvh) - 56px - env(safe-area-inset-top)); border-radius: 18px 18px 0 0;
	}
	.ax--float.ax--mobile-full.ax--no-header:not(.ax--contained) .ax-float-close { bottom: calc(100% + 12px); inset-inline-end: 16px; }
	.ax--float.ax--mobile-full.is-open:not(.ax--contained) .ax-panel { animation: ax-sheet .3s cubic-bezier(.2, .8, .2, 1); }
	.ax--float.ax--mobile-full.is-closing:not(.ax--contained) .ax-panel { animation: ax-sheet-out .2s ease-in forwards; }
	.ax--float:not(.ax--mobile-full):not(.ax--contained) .ax-panel { height: min(var(--ax-height), calc(var(--ax-vvh, 100dvh) - var(--ax-y-mobile) - var(--ax-close-space, 0px) - var(--ax-launcher-h) - 32px)); }
	.ax-teaser { max-width: calc(100vw - 110px); }
	.ax-launcher--tab { padding: 10px 14px; font-size: 14px; }
	.ax-brand span { display: none; }
}
@keyframes ax-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ax-sheet-out { to { transform: translateY(100%); } }

/* No header: the close button sits just above the window's top corner (right, or left on RTL sites), clear of the workflow. */
.ax--float.ax--no-header { --ax-close-space: 44px; }
.ax--float.ax--no-header .ax-panel { overflow: visible; }
.ax--no-header .ax-body { border-radius: inherit; overflow: hidden; }
.ax-float-close {
	position: absolute; bottom: calc(100% + 10px); inset-inline-end: 0; z-index: 3; display: grid; place-items: center; width: 32px; height: 32px;
	border: 0; border-radius: 50%; background: var(--ax-bg); color: var(--ax-fg); cursor: pointer; -webkit-tap-highlight-color: transparent;
	box-shadow: 0 6px 18px -6px rgba(15, 23, 42, .35), 0 1px 3px rgba(15, 23, 42, .12); transition: transform .15s;
}
.ax-float-close:hover { transform: scale(1.06); }
.ax-float-close:focus-visible { outline: 2px solid var(--ax-primary); outline-offset: 1px; }

/* ---------- embedded workflow (iframe) ---------- */
.ax-frame-box { position: relative; flex: 1; min-height: 0; display: flex; background: var(--ax-bg); }
.ax-frame { flex: 1; width: 100%; height: 100%; border: 0; display: block; background: var(--ax-bg); }
.ax-frame-loading {
	position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	color: var(--ax-muted); background: var(--ax-bg); text-align: center; padding: 24px; z-index: 1;
}
.ax-frame-empty { margin: auto; padding: 32px; text-align: center; color: var(--ax-muted); }
.ax-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ax-border); border-top-color: var(--ax-primary); animation: ax-rot .8s linear infinite; }
@keyframes ax-rot { to { transform: rotate(360deg); } }
.ax-gate--card { margin: auto 20px; border: 0; border-radius: 16px; background: var(--ax-surface); padding: 20px; }
.ax-test { flex: none; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #93370d; font-size: 9.5px; font-weight: 700; line-height: 1.5; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
a.ax-icon-btn { color: inherit; }

/* ---------- header ---------- */
.ax-header {
	position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; flex: none;
	background: linear-gradient(135deg, var(--ax-primary) 0%, color-mix(in srgb, var(--ax-primary) 78%, #000) 100%);
	color: var(--ax-on-primary);
	box-shadow: 0 6px 18px -10px rgba(15, 23, 42, .5);
}
.ax-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.ax-avatar--ph { display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.ax-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ax-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ax-title { font-size: 15.5px; font-weight: 650; letter-spacing: .005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .85; min-width: 0; }
.ax-sub-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa3ae; flex: none; }
.ax-dot.is-on { background: #3ddc84; box-shadow: 0 0 0 2px rgba(61, 220, 132, .3); }
.ax-icon-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.ax-icon-btn:hover { background: rgba(255, 255, 255, .16); }
.ax-icon-btn:active { background: rgba(255, 255, 255, .24); }
.ax-brand { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: inherit; text-decoration: none; font-size: 10.5px; opacity: .85; transition: opacity .15s; }
.ax-brand:hover { opacity: 1; }
.ax-brand img { height: 11px; width: auto; }
.ax-icon-btn:focus-visible { outline: 2px solid var(--ax-on-primary); outline-offset: -2px; }

/* ---------- body ---------- */
.ax-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; background: var(--ax-bg); }

/* ---------- gate (consent / offline) ---------- */
.ax-gate { padding: 14px 16px 16px; background: var(--ax-surface); }
.ax-gate-text { margin: 0 0 10px; color: var(--ax-muted); font-size: 13px; }
.ax-gate-form { display: flex; flex-direction: column; gap: 10px; }
.ax-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ax-muted); }
.ax-consent input { margin-top: 2px; accent-color: var(--ax-primary); }
.ax-consent a { color: var(--ax-primary); }
.ax-btn {
	padding: 10px 14px; border: 0; border-radius: 10px; background: var(--ax-primary); color: var(--ax-on-primary);
	font-weight: 600; cursor: pointer;
}
.ax-btn:hover { filter: brightness(1.06); }
