/* Amazing Grace Visitor Guide */
.agg-root {
	--agg-accent: #5b4b8a;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: #1f1d24;
}
.agg-root *, .agg-root *::before, .agg-root *::after { box-sizing: border-box; }
.agg-root button { text-transform: none; letter-spacing: normal; min-height: 0; margin: 0; }
.agg-root p { margin: 0; }

/* Launcher */
.agg-launcher {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px 12px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--agg-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}
.agg-launcher svg { width: 22px; height: 22px; flex: none; }
.agg-launcher:hover { filter: brightness(1.1); }
.agg-open .agg-launcher { display: none; }

.agg-root button:focus-visible,
.agg-root a:focus-visible { outline: 3px solid #f2b632; outline-offset: 2px; }

/* Teaser bubble */
.agg-teaser {
	position: relative;
	width: 240px;
	margin-bottom: 12px;
	padding: 12px 32px 12px 14px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
}
.agg-teaser[hidden] { display: none; }
.agg-teaser-text {
	background: none;
	border: 0;
	padding: 0;
	text-align: left;
	font: inherit;
	color: inherit;
	cursor: pointer;
}
.agg-teaser-close {
	position: absolute;
	top: 4px;
	right: 6px;
	background: none;
	border: 0;
	font-size: 20px;
	line-height: 1;
	color: #6d6879;
	cursor: pointer;
	padding: 2px 6px;
}

/* Panel */
.agg-panel {
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 540px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .24);
}
.agg-panel[hidden] { display: none; }

.agg-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--agg-accent);
	color: #fff;
}
.agg-title { font-weight: 700; font-size: 16px; }
.agg-sub { font-size: 13px; opacity: .9; margin-top: 2px; }
.agg-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 8px;
}
.agg-close:hover { background: rgba(255, 255, 255, .15); }

.agg-log {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	background: #f7f6fa;
}
.agg-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	white-space: pre-line;
}
.agg-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e6e3ee;
	border-bottom-left-radius: 4px;
}
.agg-user {
	align-self: flex-end;
	background: var(--agg-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.agg-typing span {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px;
	border-radius: 50%;
	background: #9a94a8;
	animation: agg-blink 1s infinite;
}
.agg-typing span:nth-child(2) { animation-delay: .15s; }
.agg-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes agg-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.agg-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid #ece9f2;
	background: #fff;
	min-height: 20px;
}
.agg-opt {
	display: inline-block;
	padding: 8px 14px;
	border: 1.5px solid var(--agg-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--agg-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.agg-opt:hover { background: var(--agg-accent); color: #fff; text-decoration: none; }
.agg-link::after { content: " \2192"; }
.agg-subtle { border-color: #cfcad9; color: #5c5668; font-weight: 500; }
.agg-subtle:hover { background: #f0eef5; color: #1f1d24; }

.agg-foot {
	padding: 0 16px 10px;
	background: #fff;
	font-size: 11.5px;
	color: #6d6879;
}

@media (max-width: 480px) {
	.agg-root { right: 12px; bottom: 12px; }
	.agg-panel { width: calc(100vw - 24px); height: calc(100vh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
	.agg-typing span { animation: none; }
}
