/* Vivid Instant Answers. Colors and offsets come from the settings page as
   custom properties on .via (printed inline). Everything uses Inter so theme
   display fonts (condensed headings etc.) don't leak in. */
.via {
	--via-accent: #111;
	--via-btn-bg: #ffe500;
	--via-btn-fg: #111;
	--via-x: 24px;
	--via-y: 104px;
	--via-size: 60px;
	--via-mx: 16px;
	--via-my: 104px;
	--via-msize: 54px;
	--via-ink: #15171a;
	--via-muted: #5b6168;
	--via-line: #e6e8eb;
	--via-soft: #f5f6f7;
	--via-radius: 18px;
	--via-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--via-ink);
	font-family: var(--via-font);
	font-size: 15px;
	line-height: 1.55;
}
.via *, .via *::before, .via *::after { box-sizing: border-box; }
.via h2, .via h3, .via p, .via li, .via a, .via button, .via input, .via strong, .via span { font-family: var(--via-font) !important; text-transform: none; }
.via [hidden] { display: none !important; }
.via .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.via button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: none; }

/* ---------- Floating button ---------- */
.via-launch {
	position: fixed; z-index: 99980; bottom: var(--via-y); right: var(--via-x);
	width: var(--via-size); height: var(--via-size); padding: 0; margin: 0;
	display: grid; place-items: center;
	border: 0; border-radius: 50%; cursor: pointer;
	background: var(--via-btn-bg); color: var(--via-btn-fg);
	box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.12);
	transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.via--left .via-launch { right: auto; left: var(--via-x); }
.via-launch svg { width: 56%; height: 56%; }
.via-launch:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 28px rgba(0,0,0,.22), 0 3px 8px rgba(0,0,0,.12); }
.via-launch:focus-visible { outline: 3px solid var(--via-accent); outline-offset: 3px; }
.via-launch-label {
	position: absolute; top: 50%; right: calc(100% + 12px); transform: translate(6px, -50%);
	padding: 7px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none;
	background: var(--via-accent); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2;
	opacity: 0; transition: opacity .15s ease, transform .15s ease;
}
.via--left .via-launch-label { right: auto; left: calc(100% + 12px); transform: translate(-6px, -50%); }
.via-launch:hover .via-launch-label, .via-launch:focus-visible .via-launch-label { opacity: 1; transform: translate(0, -50%); }
.via.is-open .via-launch { opacity: 0; pointer-events: none; }

/* ---------- Panel ---------- */
.via-backdrop {
	position: fixed; inset: 0; z-index: 99990; background: rgba(10,12,14,.38);
	opacity: 0; transition: opacity .2s ease;
}
.via-panel {
	position: fixed; z-index: 99991; right: 16px; bottom: 16px;
	width: min(430px, calc(100vw - 32px));
	height: min(720px, calc(100vh - 32px)); height: min(720px, calc(100dvh - 32px));
	display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border-radius: var(--via-radius);
	box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 4px 14px rgba(0,0,0,.12);
	opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right;
	transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.via--left .via-panel { right: auto; left: 16px; transform-origin: bottom left; }
.via.is-open .via-panel { opacity: 1; transform: none; }
.via.is-open .via-backdrop { opacity: 1; }
body.admin-bar .via-panel { height: min(720px, calc(100vh - 64px)); height: min(720px, calc(100dvh - 64px)); }

.via-head {
	flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
	padding: 22px 22px 20px; background: var(--via-accent); color: #fff;
}
.via-head h2 { margin: 0; color: #fff; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.via-head p { margin: 6px 0 0; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.45; }
.via-close {
	flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin: -6px -8px 0 0; padding: 0;
	border: 0; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.12); color: #fff !important;
	transition: background .15s ease;
}
.via-close svg { width: 20px; height: 20px; }
.via-close:hover { background: rgba(255,255,255,.24); }
.via-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The fix for the Avada panel: this is the only scrolling area, it can shrink
   inside the flex column (min-height:0), and its scroll never moves the page. */
.via-scroll {
	position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* ---------- Search and topics ---------- */
.via-tools { padding: 16px 18px 12px; background: #fff; }
.via--float .via-tools { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--via-line); }
.via-search { position: relative; display: block; margin: 0; }
.via-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--via-muted); pointer-events: none; }
.via-search input[type="search"] {
	width: 100%; height: 46px; margin: 0; padding: 0 16px 0 42px;
	border: 1.5px solid var(--via-line); border-radius: 999px; background: var(--via-soft);
	color: var(--via-ink); font: inherit; font-size: 15px; box-shadow: none; outline: none;
	transition: border-color .15s ease, background .15s ease;
}
.via-search input[type="search"]:focus { border-color: var(--via-accent); background: #fff; }
.via-chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.via-chips::-webkit-scrollbar { display: none; }
.via-search + .via-chips { margin-top: 12px; }
.via-tools > .via-chips:first-child { margin-top: 0; }
.via-chip {
	flex: none; height: 34px; padding: 0 14px; margin: 0; border-radius: 999px; cursor: pointer;
	border: 1.5px solid var(--via-line); background: #fff; color: var(--via-ink) !important;
	font-size: 13px !important; font-weight: 600; line-height: 1;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.via-chip:hover { border-color: var(--via-accent); }
.via-chip[aria-pressed="true"] { background: var(--via-accent); border-color: var(--via-accent); color: #fff !important; }
.via-chip:focus-visible { outline: 2px solid var(--via-accent); outline-offset: 2px; }

/* ---------- Accordion ---------- */
.via-items { padding: 4px 18px 18px; }
.via-item { border-bottom: 1px solid var(--via-line); }
.via-item:last-of-type { border-bottom: 0; }
.via-q { margin: 0 !important; padding: 0 !important; font-size: inherit !important; line-height: inherit !important; }
.via-q button {
	display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 14px;
	margin: 0; padding: 16px 2px; border: 0; background: none; cursor: pointer; text-align: left;
	color: var(--via-ink) !important; font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em;
}
.via-q button:hover .via-q-text { text-decoration: underline; text-underline-offset: 3px; }
.via-q button:focus-visible { outline: 2px solid var(--via-accent); outline-offset: 2px; border-radius: 6px; }
.via-icon {
	position: relative; flex: none; width: 26px; height: 26px; border-radius: 7px;
	background: var(--via-accent); transition: transform .2s ease;
}
.via-icon::before, .via-icon::after {
	content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px;
	background: #fff; border-radius: 2px; transition: transform .2s ease;
}
.via-icon::after { transform: rotate(90deg); }
.via-item.is-open .via-icon::after { transform: rotate(0deg); }

/* Without JavaScript every answer is shown; the script collapses them. */
.via-a { padding: 0 2px 16px; color: var(--via-muted); font-size: 15px; }
.via.via-js .via-a { display: none; }
.via.via-js .via-item.is-open .via-a { display: block; animation: via-in .22s ease; }
.via-a > :first-child { margin-top: 0; }
.via-a > :last-child { margin-bottom: 0; }
.via-a p, .via-a ul, .via-a ol { margin: 0 0 10px; }
.via-a ul, .via-a ol { padding-left: 20px; }
.via-a li { margin: 0 0 6px; }
.via-a strong, .via-a b { color: var(--via-ink); }
.via-a a { color: var(--via-ink) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.via-a a:hover { text-decoration-thickness: 2px; }
.via-item.is-target { animation: via-flash 1.2s ease; }
.via-empty { margin: 18px 2px; padding: 16px; border-radius: 12px; background: var(--via-soft); color: var(--via-muted); font-size: 14px; }
@keyframes via-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes via-flash { 0%, 40% { background: rgba(255,229,0,.25); } 100% { background: transparent; } }

/* ---------- Still need help ---------- */
.via-help {
	flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	padding: 14px 18px; border-top: 1px solid var(--via-line); background: var(--via-soft);
}
.via-help p { margin: 0; font-size: 14px; font-weight: 600; color: var(--via-ink); }
.via-help-links { display: flex; gap: 8px; flex-wrap: wrap; }
.via-btn {
	display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px;
	border: 1.5px solid var(--via-accent); border-radius: 999px; background: var(--via-accent);
	color: #fff !important; font-size: 13px; font-weight: 700; line-height: 1; text-decoration: none !important;
	transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.via-btn:hover { opacity: .88; }
.via-btn--ghost { background: transparent; color: var(--via-accent) !important; }
.via-btn--ghost:hover { background: var(--via-accent); color: #fff !important; opacity: 1; }
.via-btn:focus-visible { outline: 2px solid var(--via-accent); outline-offset: 2px; }

/* ---------- Inline ([instant_answers]) ---------- */
/* Its own white card, so it reads on dark and light page backgrounds alike. */
.via--inline {
	max-width: 860px; margin: 48px auto 64px; padding: clamp(20px, 4vw, 40px);
	border-radius: var(--via-radius); background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.12);
}
.via--inline .via-tools { padding: 0 0 12px; }
.via--inline .via-items { padding: 0; }
.via--inline .via-q button { padding: 20px 2px; font-size: 18px; }
.via--inline .via-help { margin-top: 24px; border: 1px solid var(--via-line); border-radius: 14px; }

/* ---------- Phones: a bottom sheet ---------- */
@media (max-width: 600px) {
	/* Phone placement comes from its own settings (--via-mx/--via-my/--via-msize). */
	.via-launch, .via--left .via-launch {
		width: var(--via-msize); height: var(--via-msize);
		bottom: var(--via-my); right: var(--via-mx); left: auto;
	}
	.via--m-left .via-launch, .via--left.via--m-left .via-launch { left: var(--via-mx); right: auto; }
	.via-launch-label { display: none; }
	.via-panel, .via--left .via-panel {
		left: 0; right: 0; bottom: 0; width: 100%;
		height: 88vh; height: 88dvh; border-radius: var(--via-radius) var(--via-radius) 0 0;
		transform: translateY(40px);
	}
	body.admin-bar .via-panel { height: 88vh; height: 88dvh; }
	.via-head { padding: 18px 18px 16px; }
	.via--inline { margin: 32px auto 48px; border-radius: 14px; }
	.via-head h2 { font-size: 22px; }
	.via-help { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
	.via-help p { width: 100%; }
	.via-help-links { width: 100%; }
	.via-help-links .via-btn { flex: 1; }
}
html.via-lock, html.via-lock body { overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
	.via-launch, .via-panel, .via-backdrop, .via-icon::after { transition: none !important; }
	.via.via-js .via-item.is-open .via-a, .via-item.is-target { animation: none !important; }
}
