/* Aivastark — the wp-admin app.
 *
 * Loaded only on Aivastark screens (body.avs-screen). Everything is scoped to
 * .avs-* classes or to body.avs-screen, so nothing leaks into the rest of
 * wp-admin. Colours follow the Aivastark dashboard's light theme
 * (src/styles/palette.css, the --mk-* tokens): ink primary buttons, cyan
 * accent, white cards on a sky gradient.
 */

body.avs-screen {
	--avs-ink: #0d1220;
	--avs-ink-2: #475165;
	--avs-ink-3: #6b7488;
	--avs-line: #e3e8ef;
	--avs-line-2: #d3dbe6;
	--avs-card: #ffffff;
	--avs-card-2: #f6f9fc;
	--avs-accent: #00d4ff;
	--avs-accent-text: #0a7a99;
	--avs-accent-soft: rgba(0, 212, 255, 0.12);
	--avs-accent-ring: rgba(0, 190, 236, 0.45);
	--avs-violet: #6d3fe0;
	--avs-ok: #0f9d63;
	--avs-ok-soft: #e2f6ec;
	--avs-warn: #b45309;
	--avs-warn-soft: #fdf1df;
	--avs-danger: #d93f44;
	--avs-danger-soft: #fdecec;
	--avs-radius: 16px;
	--avs-radius-sm: 10px;
	--avs-shadow: 0 1px 2px rgba(13, 18, 32, 0.04), 0 10px 28px -18px rgba(13, 18, 32, 0.22);
	--avs-shadow-lg: 0 2px 6px rgba(13, 18, 32, 0.06), 0 24px 60px -28px rgba(13, 18, 32, 0.35);
	--avs-adminbar: 32px;
	--avs-nav-w: 248px;
	--avs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--avs-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

	background:
		radial-gradient(1200px 720px at 4% -6%, rgba(144, 225, 254, 0.5), transparent 62%),
		linear-gradient(158deg, #d9ecfa 0%, #e9f4fd 42%, #fbfdff 78%, #ffffff 100%) fixed;
}

@media screen and (max-width: 782px) {
	body.avs-screen { --avs-adminbar: 46px; }
}

/* ─── Take over wp-admin's content area ─────────────────────────────── */

body.avs-screen #wpcontent { padding-left: 0; }
body.avs-screen #wpbody-content { padding-bottom: 0; }
body.avs-screen #wpfooter { display: none; }
/* Anything another plugin prints into the page (banners, upsells, notices
   added by script) — the app is the only thing on this screen. */
body.avs-screen #wpbody-content > :not(.avs-app) { display: none !important; }
body.avs-screen #wpcontent > :not(#wpadminbar):not(#wpbody) { display: none !important; }

/* Full screen: WordPress's own sidebar goes away (desktop only; on phones it
   is already an off-canvas drawer). The menu button brings it back. */
@media screen and (min-width: 783px) {
	body.avs-screen.avs-focus #adminmenumain { display: none; }
	body.avs-screen.avs-focus #wpcontent,
	body.avs-screen.avs-focus #wpfooter { margin-left: 0; }
}

/* ─── App frame ─────────────────────────────────────────────────────── */

.avs-app {
	position: relative;
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--avs-adminbar));
	height: calc(100dvh - var(--avs-adminbar));
	min-height: 520px;
	font-family: var(--avs-font);
	color: var(--avs-ink);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.avs-app *,
.avs-app *::before,
.avs-app *::after { box-sizing: border-box; }

/* Classes below set display (inline-flex buttons, flex rows), which would
   otherwise beat the hidden attribute admin.js toggles. */
.avs-app [hidden] { display: none !important; }

.avs-app a { color: var(--avs-accent-text); }
.avs-app a:focus,
.avs-app button:focus { box-shadow: none; outline: none; }
.avs-app a:focus-visible,
.avs-app button:focus-visible,
.avs-app input:focus-visible,
.avs-app textarea:focus-visible,
.avs-app label:focus-within > input + .avs-switch-track {
	outline: 2px solid var(--avs-accent-ring);
	outline-offset: 2px;
}

.avs-icon { flex: none; display: block; }
.avs-mark { flex: none; display: block; }

/* Top bar: a floating glass card, as in the dashboard. */
.avs-topbar {
	position: relative;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	margin: 14px 16px 0;
	padding: 10px 14px 10px 10px;
	background: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid rgba(255, 255, 255, 0.9);
	border-radius: 18px;
	box-shadow: var(--avs-shadow);
}

.avs-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 6px;
	border-radius: 10px;
	text-decoration: none;
	color: var(--avs-ink) !important;
}

.avs-brand-name {
	font-size: 19px;
	font-weight: 750;
	letter-spacing: -0.025em;
}

.avs-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 320px;
	height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	background: var(--avs-card-2);
	border: 1px solid var(--avs-line);
	color: var(--avs-ink-2);
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	white-space: nowrap;
}

.avs-chip-text { overflow: hidden; text-overflow: ellipsis; }
.avs-chip.is-on { background: #fff; color: var(--avs-ink); }
a.avs-chip.is-off:hover { border-color: var(--avs-line-2); color: var(--avs-ink); }

.avs-dot {
	flex: none;
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #b7bfcc;
}

.avs-dot.is-on {
	background: var(--avs-ok);
	box-shadow: 0 0 0 3px rgba(15, 157, 99, 0.16);
}

.avs-badge {
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--avs-accent-soft);
	color: var(--avs-accent-text);
	font-size: 11.5px;
	font-weight: 650;
	letter-spacing: 0.01em;
}

.avs-badge.is-ok { background: var(--avs-ok-soft); color: var(--avs-ok); }

.avs-topbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

/* ─── Buttons (mirrors the dashboard's mk-btn kit) ──────────────────── */

.avs-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	color: var(--avs-ink);
	font: 600 14.5px/1.1 var(--avs-font);
	letter-spacing: -0.005em;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease, color 0.18s ease;
}

.avs-btn:active { transform: scale(0.985); }
.avs-btn[disabled] { opacity: 0.5; pointer-events: none; }

.avs-btn-sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.avs-btn-lg { min-height: 52px; padding: 0 26px; font-size: 15.5px; border-radius: 14px; }

.avs-app .avs-btn-primary {
	background: linear-gradient(180deg, #1c2333 0%, #0d1220 100%);
	border-color: rgba(0, 0, 0, 0.45);
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(13, 18, 32, 0.25), 0 6px 16px -10px rgba(13, 18, 32, 0.5);
}

.avs-app .avs-btn-primary:hover {
	color: #fff;
	background: linear-gradient(180deg, #273049 0%, #141a2b 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 4px rgba(13, 18, 32, 0.25), 0 12px 28px -12px rgba(13, 18, 32, 0.6);
}

.avs-app .avs-btn-ghost {
	background: #fff;
	border-color: var(--avs-line-2);
	color: var(--avs-ink);
}

.avs-app .avs-btn-ghost:hover { border-color: #b6c0cf; color: var(--avs-ink); background: #fbfcfe; }

.avs-app .avs-btn-danger {
	background: var(--avs-danger);
	border-color: rgba(0, 0, 0, 0.1);
	color: #fff;
}

.avs-app .avs-btn-danger:hover { background: #e9555a; color: #fff; }

.avs-app .avs-btn-link {
	min-height: 0;
	padding: 6px 4px;
	color: var(--avs-ink-2);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--avs-line-2);
}

.avs-app .avs-btn-link:hover { color: var(--avs-ink); text-decoration-color: currentColor; }
.avs-app .avs-btn-danger-text { color: var(--avs-danger); }
.avs-app .avs-btn-danger-text:hover { color: #b3262b; }

.avs-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--avs-line);
	border-radius: 12px;
	background: #fff;
	color: var(--avs-ink-2);
	cursor: pointer;
	transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.avs-iconbtn:hover { color: var(--avs-ink); border-color: var(--avs-line-2); background: #fbfcfe; }
.avs-iconbtn-sm { width: 34px; height: 34px; border-radius: 9px; }

/* ─── Body: nav + main ──────────────────────────────────────────────── */

.avs-body {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
}

.avs-nav {
	display: flex;
	flex-direction: column;
	flex: none;
	width: var(--avs-nav-w);
	padding: 18px 12px 14px 16px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.avs-nav-group + .avs-nav-group { margin-top: 10px; }

.avs-nav-heading {
	margin: 0 0 4px;
	padding: 0 12px;
	color: var(--avs-ink-3);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.avs-app .avs-nav-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 11px;
	min-height: 37px;
	padding: 0 12px;
	border-radius: 11px;
	color: var(--avs-ink-2);
	font-weight: 560;
	font-size: 14px;
	text-decoration: none;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.avs-app .avs-nav-item:hover { background: rgba(255, 255, 255, 0.65); color: var(--avs-ink); }

.avs-app .avs-nav-item.is-active {
	background: #fff;
	color: var(--avs-ink);
	font-weight: 650;
	box-shadow: 0 1px 2px rgba(13, 18, 32, 0.05), 0 6px 18px -12px rgba(13, 18, 32, 0.3);
}

.avs-app .avs-nav-item.is-active::before {
	content: "";
	position: absolute;
	left: -10px;
	top: 9px;
	bottom: 9px;
	width: 3px;
	border-radius: 3px;
	background: linear-gradient(180deg, #33deff, #00a9d6);
}

.avs-app .avs-nav-item.is-active .avs-icon { color: var(--avs-accent-text); }
.avs-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avs-nav-lock { color: var(--avs-ink-3); opacity: 0.8; }

.avs-nav-foot {
	margin-top: auto;
	padding-top: 12px;
}

.avs-app .avs-nav-item--quiet { min-height: 36px; font-size: 13.5px; color: var(--avs-ink-3); }
.avs-app .avs-nav-item--quiet > .avs-icon:last-child { opacity: 0.6; }

.avs-nav-version {
	margin: 10px 12px 0;
	color: var(--avs-ink-3);
	font-size: 11.5px;
}

.avs-main {
	position: relative;
	flex: 1;
	min-width: 0;
	overflow-y: auto;
	scrollbar-width: thin;
}

.avs-app--embed .avs-main {
	display: flex;
	overflow: hidden;
	padding: 14px 16px 16px 0;
}

/* ─── Pages ─────────────────────────────────────────────────────────── */

.avs-page {
	width: 100%;
	max-width: 1000px;
	padding: 22px 24px 48px 8px;
}

.avs-page--wide { max-width: 1240px; }

.avs-pagehead { margin: 4px 0 22px; }

.avs-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px;
	color: var(--avs-accent-text);
	font-size: 13px;
	font-weight: 650;
}

.avs-display {
	margin: 0 0 14px;
	color: var(--avs-ink);
	font-size: clamp(30px, 3.4vw, 44px);
	font-weight: 780;
	line-height: 1.08;
	letter-spacing: -0.035em;
}

.avs-grad {
	background: linear-gradient(100deg, #00a9d6 0%, #2b7bff 45%, #6d3fe0 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.avs-h1 {
	margin: 0 0 6px;
	padding: 0;
	color: var(--avs-ink);
	font-size: 27px;
	font-weight: 750;
	line-height: 1.2;
	letter-spacing: -0.025em;
}

.avs-h2 {
	margin: 0 0 4px;
	padding: 0;
	color: var(--avs-ink);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.015em;
}

.avs-h3 {
	margin: 0;
	padding: 0;
	color: var(--avs-ink);
	font-size: 15.5px;
	font-weight: 680;
	letter-spacing: -0.01em;
}

.avs-lead { margin: 0 0 18px; color: var(--avs-ink-2); font-size: 16px; line-height: 1.6; max-width: 620px; }
.avs-muted { margin: 0; color: var(--avs-ink-2); }
.avs-small { font-size: 13px; }
.avs-help { margin: 10px 0 0; color: var(--avs-ink-3); font-size: 13px; }

.avs-card {
	position: relative;
	padding: 20px 22px;
	background: var(--avs-card);
	border: 1px solid var(--avs-line);
	border-radius: var(--avs-radius);
	box-shadow: var(--avs-shadow);
}

.avs-card + .avs-card,
.avs-form > .avs-card + .avs-card { margin-top: 14px; }

.avs-card-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

.avs-section { margin-top: 30px; }
.avs-section .avs-muted { margin-bottom: 14px; }
.avs-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }

.avs-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
}

.avs-actions form { margin: 0; }
.avs-inline { display: inline; margin: 0; }
.avs-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.avs-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	font-weight: 600;
	text-decoration: none;
}

.avs-link:hover { text-decoration: underline; }

.avs-code {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 7px;
	background: var(--avs-card-2);
	border: 1px solid var(--avs-line);
	color: var(--avs-ink);
	font: 12.5px/1.5 var(--avs-mono);
	word-break: break-all;
}

/* Hero (not connected) */
.avs-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: 32px;
	align-items: center;
	padding: 36px 40px;
	background:
		radial-gradient(520px 320px at 100% 0%, rgba(109, 63, 224, 0.1), transparent 70%),
		radial-gradient(520px 320px at 0% 100%, rgba(0, 212, 255, 0.12), transparent 70%),
		#fff;
	border: 1px solid var(--avs-line);
	border-radius: 22px;
	box-shadow: var(--avs-shadow-lg);
}

.avs-steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 26px 0 0;
	padding: 0;
	list-style: none;
}

.avs-steps li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 12px;
	border-radius: 12px;
	background: var(--avs-card-2);
	border: 1px solid var(--avs-line);
}

.avs-steps strong { display: block; font-size: 13.5px; }
.avs-steps li span:not(.avs-step-n) { display: block; color: var(--avs-ink-3); font-size: 12.5px; line-height: 1.4; }

.avs-step-n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 8px;
	background: var(--avs-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

/* The chat widget mock beside the hero copy. */
.avs-hero-art {
	position: relative;
	display: flex;
	justify-content: center;
	padding: 8px 28px 40px 8px;
}

.avs-mock {
	width: 100%;
	max-width: 330px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--avs-line);
	border-radius: 20px;
	box-shadow: 0 30px 60px -30px rgba(13, 18, 32, 0.45), 0 2px 6px rgba(13, 18, 32, 0.06);
	transform: rotate(-1.2deg);
}

.avs-mock-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: linear-gradient(135deg, #0d1220, #1f2a44);
	color: #fff;
}

.avs-mock-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: #fff;
}

.avs-mock-who strong { display: block; font-size: 13.5px; }
.avs-mock-who span { display: inline-flex; align-items: center; gap: 6px; color: #b8c2d6; font-size: 12px; }
.avs-mock-who .avs-dot { width: 6px; height: 6px; box-shadow: none; }

.avs-mock-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	background: linear-gradient(180deg, #f7fafd, #fff);
}

.avs-bubble {
	max-width: 85%;
	margin: 0;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 13px;
	line-height: 1.45;
	animation: avs-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.avs-bubble.is-agent { align-self: flex-start; background: #eef3f9; color: var(--avs-ink); border-bottom-left-radius: 5px; }
.avs-bubble.is-visitor { align-self: flex-end; background: #00b8e0; color: #03141c; border-bottom-right-radius: 5px; }
.avs-bubble:nth-child(2) { animation-delay: 0.25s; }
.avs-bubble:nth-child(3) { animation-delay: 0.5s; }

.avs-typing {
	display: inline-flex;
	gap: 4px;
	align-self: flex-start;
	margin: 0;
	padding: 10px 12px;
	border-radius: 14px;
	background: #eef3f9;
}

.avs-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9aa6b8;
	animation: avs-blink 1.2s infinite ease-in-out;
}

.avs-typing span:nth-child(2) { animation-delay: 0.15s; }
.avs-typing span:nth-child(3) { animation-delay: 0.3s; }

.avs-mock-input {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 12px 12px;
	padding: 8px 8px 8px 14px;
	border: 1px solid var(--avs-line);
	border-radius: 12px;
	color: var(--avs-ink-3);
	font-size: 13px;
}

.avs-mock-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--avs-ink);
	color: #fff;
}

.avs-mock-launcher {
	position: absolute;
	right: 4px;
	bottom: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 14px 30px -12px rgba(13, 18, 32, 0.45), 0 0 0 6px rgba(0, 212, 255, 0.12);
}

/* Tiles: the way into each section. */
.avs-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 12px;
}

.avs-app .avs-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 138px;
	padding: 18px;
	background: #fff;
	border: 1px solid var(--avs-line);
	border-radius: var(--avs-radius);
	box-shadow: var(--avs-shadow);
	color: var(--avs-ink);
	text-decoration: none;
	transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.avs-app .avs-tile:hover {
	transform: translateY(-2px);
	border-color: #cfe9f2;
	box-shadow: var(--avs-shadow-lg);
	color: var(--avs-ink);
}

.avs-tile-icon,
.avs-stat-icon,
.avs-option-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--avs-accent-soft);
	color: var(--avs-accent-text);
}

.avs-tile-icon { margin-bottom: 8px; }
.avs-tile-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 680; }
.avs-tile-lock { color: var(--avs-ink-3); }
.avs-tile-desc { color: var(--avs-ink-2); font-size: 13px; line-height: 1.45; }

.avs-tile-arrow {
	position: absolute;
	top: 18px;
	right: 18px;
	color: var(--avs-ink-3);
	transition: transform 0.18s ease, color 0.18s ease;
}

.avs-tile:hover .avs-tile-arrow { transform: translateX(3px); color: var(--avs-accent-text); }

.avs-row-card {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 24px;
}

/* Connected home: main column + aside. */
.avs-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 22px;
	align-items: start;
}

.avs-layout-aside { display: flex; flex-direction: column; gap: 14px; }
.avs-layout-aside .avs-card + .avs-card { margin-top: 0; }
.avs-layout-aside .avs-h3 { margin-bottom: 10px; }

.avs-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.avs-stats .avs-card + .avs-card { margin-top: 0; }

.avs-stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px;
}

.avs-stat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avs-stat-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--avs-card-2); color: var(--avs-ink-3); }
.avs-stat-icon.is-ok { background: var(--avs-ok-soft); color: var(--avs-ok); }
.avs-stat-icon.is-warn { background: var(--avs-warn-soft); color: var(--avs-warn); }
.avs-stat-label { color: var(--avs-ink-2); font-size: 13px; font-weight: 600; }
.avs-stat-value { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.avs-stat-sub { margin: 0 0 12px; color: var(--avs-ink-3); font-size: 12.5px; line-height: 1.45; }
.avs-stat form { margin-top: auto; }

.avs-linklist { margin: 0; padding: 0; list-style: none; }
.avs-linklist li { margin: 0; }

.avs-app .avs-linklist a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	margin: 0 -10px;
	border-radius: 10px;
	color: var(--avs-ink-2);
	font-weight: 560;
	text-decoration: none;
}

.avs-app .avs-linklist a:hover { background: var(--avs-card-2); color: var(--avs-ink); }

.avs-copy { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.avs-copy .avs-code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; word-break: normal; scrollbar-width: thin; }

.avs-dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 14px;
	margin: 0 0 12px;
	font-size: 13px;
}

.avs-dl dt { color: var(--avs-ink-3); }
.avs-dl dd { margin: 0; color: var(--avs-ink); font-weight: 560; overflow-wrap: anywhere; }

/* ─── Switches ──────────────────────────────────────────────────────── */

.avs-switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--avs-ink-2);
	font: 600 13px/1 var(--avs-font);
	cursor: pointer;
}

.avs-switch--input { position: relative; flex: none; }

.avs-switch--input input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.avs-switch-track {
	position: relative;
	display: inline-block;
	flex: none;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: #cdd5e0;
	transition: background-color 0.2s ease;
}

.avs-switch-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(13, 18, 32, 0.3);
	transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.avs-switch.is-on .avs-switch-track,
.avs-switch--input input:checked + .avs-switch-track { background: linear-gradient(180deg, #14d9ff, #00bfec); }

.avs-switch.is-on .avs-switch-thumb,
.avs-switch--input input:checked + .avs-switch-track .avs-switch-thumb { transform: translateX(18px); }

.avs-switch--input input:focus-visible + .avs-switch-track { outline: 2px solid var(--avs-accent-ring); outline-offset: 2px; }

/* ─── Forms ─────────────────────────────────────────────────────────── */

.avs-setting {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.avs-setting-text { flex: 1; min-width: 0; }
.avs-setting-text .avs-h3 { margin-bottom: 4px; }
.avs-card > .avs-h3 { margin-bottom: 14px; }

.avs-field { margin-top: 18px; }

.avs-label {
	display: block;
	margin: 0 0 8px;
	color: var(--avs-ink);
	font-size: 13px;
	font-weight: 650;
}

.avs-app .avs-input {
	width: 100%;
	min-height: 42px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--avs-line-2);
	border-radius: 11px;
	background: #f7fbfe;
	color: var(--avs-ink);
	font: 14px/1.4 var(--avs-font);
	box-shadow: none;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.avs-app .avs-input:focus {
	border-color: #6fd7f0;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.16);
	outline: none;
}

.avs-app .avs-input-mono { font-family: var(--avs-mono); font-size: 13.5px; }
.avs-app .avs-input-sm { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.avs-app .avs-input-xs { width: 64px; min-height: 30px; padding: 3px 8px; font-size: 13px; text-align: center; }
.avs-app .avs-textarea { min-height: 96px; resize: vertical; font-family: var(--avs-mono); font-size: 13px; }

.avs-reveal { display: flex; gap: 8px; }
.avs-reveal .avs-input { flex: 1; }

/* Segmented radio */
.avs-segmented {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
	border-radius: 13px;
	background: var(--avs-card-2);
	border: 1px solid var(--avs-line);
}

.avs-segment { position: relative; margin: 0; cursor: pointer; }
.avs-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.avs-segment span {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 0 14px;
	border-radius: 9px;
	color: var(--avs-ink-2);
	font-weight: 600;
	font-size: 13.5px;
	transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.avs-segment:hover span { color: var(--avs-ink); }
.avs-segment input:checked + span { background: #fff; color: var(--avs-ink); box-shadow: 0 1px 2px rgba(13, 18, 32, 0.08), 0 4px 12px -8px rgba(13, 18, 32, 0.4); }
.avs-segment input:focus-visible + span { outline: 2px solid var(--avs-accent-ring); outline-offset: 1px; }

.avs-rules { margin-top: 4px; }
.avs-rules[hidden] { display: none; }

/* Chip checkboxes */
.avs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.avs-chip-check { position: relative; margin: 0; cursor: pointer; }
.avs-chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.avs-chip-check span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding: 0 13px;
	border: 1px solid var(--avs-line-2);
	border-radius: 999px;
	background: #fff;
	color: var(--avs-ink-2);
	font-weight: 560;
	font-size: 13px;
	transition: all 0.16s ease;
}

.avs-chip-check:hover span { border-color: #b6c0cf; color: var(--avs-ink); }

.avs-chip-check input:checked + span {
	border-color: #7fdcf2;
	background: var(--avs-accent-soft);
	color: #075d75;
}

.avs-chip-check input:checked + span::before {
	content: "";
	width: 7px;
	height: 11px;
	margin: -3px 2px 0 0;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.avs-chip-check input:focus-visible + span { outline: 2px solid var(--avs-accent-ring); outline-offset: 2px; }

/* Page picker */
.avs-picker {
	border: 1px solid var(--avs-line-2);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

.avs-picker > .avs-input { border: 0; border-bottom: 1px solid var(--avs-line); border-radius: 0; }
.avs-picker-list { max-height: 228px; overflow-y: auto; padding: 4px; }

.avs-picker-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.avs-picker-item:hover { background: var(--avs-card-2); }
.avs-picker-item[hidden] { display: none; }
.avs-picker-item input { margin: 0 !important; }
.avs-picker-title { font-weight: 560; }
.avs-picker-path { margin-left: auto; color: var(--avs-ink-3); font: 12px/1.4 var(--avs-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }

/* Option cards (devices, audience, loading) */
.avs-options { display: grid; gap: 10px; }
.avs-options--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.avs-options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.avs-option {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 14px 14px 14px 40px;
	border: 1px solid var(--avs-line-2);
	border-radius: 14px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.avs-option:hover { border-color: #b6c0cf; }

.avs-app .avs-option > input {
	position: absolute;
	top: 16px;
	left: 14px;
	margin: 0;
}

.avs-option:has(input:checked) {
	border-color: #6fd7f0;
	background: linear-gradient(180deg, #f3fcff, #fff);
	box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

.avs-option-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--avs-card-2); color: var(--avs-ink-3); }
.avs-option input:checked ~ .avs-option-icon { background: var(--avs-accent-soft); color: var(--avs-accent-text); }
.avs-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.avs-option-text strong { font-size: 13.5px; }
.avs-option-text > span { color: var(--avs-ink-3); font-size: 12.5px; line-height: 1.4; }
.avs-inline-input { display: inline-flex; align-items: center; gap: 6px; }

/* The top bar carries the same Save button, so this one simply ends the form. */
.avs-formbar {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 18px;
	padding: 4px 0;
}

.avs-dirty { color: var(--avs-warn); font-weight: 600; font-size: 13px; }
.avs-dirty[hidden] { display: none; }
.avs-reset { margin-top: 2px; }

.avs-hooks { margin: 0; }
.avs-hooks dt { margin-top: 12px; }
.avs-hooks dt:first-child { margin-top: 0; }
.avs-hooks dd { margin: 4px 0 0; color: var(--avs-ink-2); font-size: 13px; }

.avs-danger {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-top: 14px;
	border-color: #f5cfd0;
	background: linear-gradient(180deg, #fffafa, #fff);
}

.avs-danger form { margin: 0; flex: none; }

/* ─── Embedded section frame ────────────────────────────────────────── */

.avs-frame {
	position: relative;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--avs-line);
	border-radius: 18px;
	box-shadow: var(--avs-shadow-lg);
}

.avs-frame-iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.avs-frame.is-ready .avs-frame-iframe { opacity: 1; }

.avs-frame-state {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: #fff;
	transition: opacity 0.25s ease;
}

.avs-frame-state[hidden] { display: none; }
.avs-frame.is-ready .avs-frame-loading { opacity: 0; pointer-events: none; }

.avs-skeleton {
	position: absolute;
	inset: 0;
	padding: 28px;
	opacity: 0.9;
}

.avs-skel {
	border-radius: 12px;
	background: linear-gradient(90deg, #eef2f7 0%, #f7f9fc 40%, #eef2f7 80%);
	background-size: 200% 100%;
	animation: avs-shimmer 1.4s infinite linear;
}

.avs-skel-title { width: 34%; height: 26px; margin-bottom: 22px; }
.avs-skel-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.avs-skel-card { height: 110px; }
.avs-skel-block { height: calc(100% - 210px); min-height: 160px; }

.avs-frame-caption {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: var(--avs-shadow);
	color: var(--avs-ink-2);
	font-weight: 600;
}

.avs-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid var(--avs-accent);
	border-top-color: transparent;
	border-radius: 50%;
	animation: avs-spin 0.8s linear infinite;
}

.avs-frame-error { background: linear-gradient(180deg, #fbfdff, #fff); }

.avs-lockcard {
	max-width: 620px;
	margin: 6vh auto 0;
	padding: 34px 36px;
	text-align: left;
}

.avs-frame-error .avs-lockcard { margin: 0; }

.avs-lockcard-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 16px;
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(0, 212, 255, 0.16), rgba(109, 63, 224, 0.14));
	color: var(--avs-accent-text);
}

.avs-lockcard-icon.is-warn { background: var(--avs-warn-soft); color: var(--avs-warn); }
.avs-lockcard .avs-muted { margin-bottom: 20px; }
.avs-lockcard .avs-actions { margin-bottom: 0; }

/* ─── Toasts ────────────────────────────────────────────────────────── */

.avs-toasts {
	position: absolute;
	top: 88px;
	right: 20px;
	z-index: 60;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: min(440px, calc(100% - 40px));
	pointer-events: none;
}

.avs-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 12px 12px 14px;
	border-radius: 14px;
	background: #0d1220;
	color: #eef1f6;
	font-weight: 560;
	box-shadow: 0 18px 40px -16px rgba(13, 18, 32, 0.6);
	pointer-events: auto;
	animation: avs-rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.avs-toast > .avs-icon { margin-top: 1px; }
.avs-toast.is-success > .avs-icon { color: #34d399; }
.avs-toast.is-error { background: #3b1013; }
.avs-toast.is-error > .avs-icon { color: #ff8a8e; }
.avs-toast span { flex: 1; }
.avs-toast a { color: #5ee3ff; font-weight: 650; }
.avs-toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.25s ease, transform 0.25s ease; }

.avs-toast-close {
	display: inline-flex;
	padding: 2px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: #9aa6b8;
	cursor: pointer;
}

.avs-toast-close:hover { color: #fff; }

/* ─── Motion ────────────────────────────────────────────────────────── */

@keyframes avs-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes avs-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
@keyframes avs-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes avs-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.avs-app *,
	.avs-app *::before,
	.avs-app *::after { animation: none !important; transition: none !important; }
}

/* ─── Responsive ────────────────────────────────────────────────────── */

@media screen and (max-width: 1200px) {
	.avs-layout { grid-template-columns: minmax(0, 1fr); }
	.avs-layout-aside { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media screen and (max-width: 1100px) {
	.avs-hero { grid-template-columns: minmax(0, 1fr); padding: 28px; }
	.avs-hero-art { display: none; }
}

/* The app nav becomes a drawer, opened by the menu button. */
@media screen and (max-width: 960px) {
	.avs-nav {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 40;
		padding-top: 14px;
		background: #f4f9fd;
		border-right: 1px solid var(--avs-line);
		box-shadow: 16px 0 40px -20px rgba(13, 18, 32, 0.35);
		transform: translateX(-105%);
		transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	.avs-app.avs-nav-open .avs-nav { transform: none; }

	.avs-scrim {
		position: absolute;
		inset: 0;
		z-index: 35;
		background: rgba(13, 18, 32, 0.28);
	}

	.avs-scrim[hidden] { display: none; }
	.avs-page { padding-left: 16px; padding-right: 16px; }
	.avs-app--embed .avs-main { padding-left: 12px; padding-right: 12px; }
	.avs-stats { grid-template-columns: minmax(0, 1fr); }
	.avs-options--3 { grid-template-columns: minmax(0, 1fr); }
}

@media screen and (max-width: 782px) {
	.avs-topbar { margin: 10px 10px 0; min-height: 58px; }
	.avs-hide-sm { display: none; }
	.avs-btn-sm { padding: 0 11px; }
	.avs-chip { max-width: 160px; }
	.avs-steps { grid-template-columns: minmax(0, 1fr); }
	.avs-options--2 { grid-template-columns: minmax(0, 1fr); }
	.avs-setting { flex-direction: row; gap: 14px; }
	.avs-danger { flex-direction: column; align-items: flex-start; gap: 14px; }
	.avs-toasts { top: 76px; right: 10px; }
	.avs-display { font-size: 30px; }
}

@media screen and (max-width: 520px) {
	.avs-brand-name { display: none; }
	.avs-hide-xs { display: none; }
	.avs-chip .avs-badge { display: none; }
	.avs-hero { padding: 22px; }
	.avs-card { padding: 18px; }
}
