/* Stonehill Website Agent: uses the theme's colours when available. */
.swa {
	--swa-navy: var(--navy, #13233d);
	--swa-navy-2: var(--navy-2, #1c3254);
	--swa-gold: var(--gold, #b08a55);
	--swa-gold-2: var(--gold-2, #c9a46c);
	--swa-ivory: var(--ivory, #faf7f2);
	--swa-sand: var(--sand, #f1ebe1);
	--swa-line: var(--line, #e4ddd2);
	--swa-ink: var(--ink, #1a2230);
	--swa-muted: var(--muted, #6b7484);
	--swa-urgent: #a1301f;
	font-family: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	font-size: 15px;
	line-height: 1.5;
	color: var(--swa-ink);
}
.swa *, .swa *::before, .swa *::after { box-sizing: border-box; }
.swa-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Launcher ------------------------------------------------------------ */
.swa-launcher {
	position: fixed; right: 24px; bottom: 24px; z-index: 45;
	display: inline-flex; align-items: center; gap: 10px;
	height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px;
	background: var(--swa-gold-2); color: var(--swa-navy); cursor: pointer;
	font: 700 15px/1 var(--font-body, system-ui, sans-serif);
	box-shadow: 0 0 0 3px #fff, 0 14px 30px -8px rgba(19, 35, 61, .6);
	transition: transform .2s ease, background .2s ease;
}
.swa .swa-launcher:hover { background: #d9b984; color: var(--swa-navy); transform: translateY(-1px); }
.swa-launcher:focus-visible { outline: 3px solid var(--swa-navy); outline-offset: 4px; }
.swa-launcher svg { width: 24px; height: 24px; color: var(--swa-navy); flex: none; }
.swa.is-open .swa-launcher { display: none; }

/* Panel --------------------------------------------------------------- */
.swa-panel {
	position: fixed; right: 24px; bottom: 24px; z-index: 70;
	width: 390px; max-width: calc(100vw - 32px);
	height: min(640px, calc(100vh - 48px));
	display: flex; flex-direction: column;
	background: #fff; border-radius: 18px; overflow: hidden;
	box-shadow: 0 30px 60px -20px rgba(19, 35, 61, .45), 0 0 0 1px rgba(19, 35, 61, .06);
}
.swa-panel[hidden] { display: none; }

.swa-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--swa-navy); color: #fff; flex: none; }
.swa-head__icon { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .1); display: grid; place-items: center; flex: none; }
.swa-head__icon svg { width: 21px; height: 21px; color: var(--swa-gold-2); }
.swa-head__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.swa-head__text strong { font-family: var(--font-display, Georgia, serif); font-weight: 500; font-size: 17px; letter-spacing: .01em; }
.swa-head__text span { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.swa-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; flex: none; }
.swa-close:hover { background: rgba(255, 255, 255, .12); }
.swa-close:focus-visible { outline: 2px solid var(--swa-gold-2); outline-offset: 1px; }

.swa-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--swa-ivory); scroll-behavior: smooth; overscroll-behavior: contain; }
@media (prefers-reduced-motion: reduce) { .swa-log { scroll-behavior: auto; } .swa-launcher { transition: none; } }

.swa-msg { max-width: 92%; margin: 0 0 12px; padding: 11px 14px; border-radius: 14px; word-wrap: break-word; }
.swa-msg p { margin: 0 0 8px; }
.swa-msg p:last-child { margin-bottom: 0; }
.swa-msg ul { margin: 0 0 8px; padding-left: 20px; }
.swa-msg li { margin-bottom: 3px; }
.swa-msg a { color: var(--swa-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.swa-msg--bot { background: #fff; border: 1px solid var(--swa-line); border-top-left-radius: 4px; }
.swa-msg--user { margin-left: auto; background: var(--swa-navy); color: #fff; border-top-right-radius: 4px; width: fit-content; }
.swa-msg--info { background: var(--swa-sand); border-color: transparent; font-size: 14px; }
.swa-msg--urgent { border-left: 4px solid var(--swa-urgent); }
.swa-msg--chips { max-width: 100%; padding: 0; background: none; }

.swa-hours { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 14px; }
.swa-hours th, .swa-hours td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--swa-line); font-weight: 400; }
.swa-hours th { color: var(--swa-muted); }
.swa-hours tr.is-today th, .swa-hours tr.is-today td { font-weight: 700; color: var(--swa-navy); background: var(--swa-sand); }

.swa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.swa-chip {
	border: 1px solid var(--swa-gold); background: #fff; color: var(--swa-navy);
	border-radius: 999px; padding: 7px 13px; font: 500 13.5px/1.2 var(--font-body, system-ui, sans-serif);
	cursor: pointer; text-align: left;
}
.swa-chip:hover { background: var(--swa-sand); }
.swa-chip:focus-visible { outline: 2px solid var(--swa-navy); outline-offset: 2px; }
.swa-chip--ghost { border-color: var(--swa-line); color: var(--swa-muted); }
.swa-related { margin: 10px 0 0 !important; font-size: 13px; color: var(--swa-muted); }

.swa-links { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; }
.swa-msg a.swa-link { font-size: 14px; text-decoration: none; color: var(--swa-navy); }
.swa-msg a.swa-link:hover { text-decoration: underline; }
.swa-msg a.swa-link span { color: var(--swa-gold); }
.swa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.swa-msg a.swa-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 12px; border-radius: 10px; border: 1px solid var(--swa-navy);
	font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--swa-navy); background: #fff;
}
.swa-msg a.swa-btn svg { width: 16px; height: 16px; }
.swa-msg a.swa-btn--primary { background: var(--swa-navy); color: #fff; }
.swa-msg a.swa-btn:focus-visible { outline: 2px solid var(--swa-gold); outline-offset: 2px; }

.swa-form { display: flex; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--swa-line); background: #fff; flex: none; }
.swa-input {
	flex: 1; min-width: 0; height: 44px; padding: 0 14px;
	border: 1px solid var(--swa-line); border-radius: 12px; background: #fff;
	font: 400 16px/1.2 var(--font-body, system-ui, sans-serif); color: var(--swa-ink);
}
.swa-input:focus { outline: 2px solid var(--swa-navy); outline-offset: 0; border-color: transparent; }
.swa-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--swa-navy); color: #fff; cursor: pointer; display: grid; place-items: center; }
.swa-send svg { width: 20px; height: 20px; }
.swa-send:focus-visible { outline: 2px solid var(--swa-gold); outline-offset: 2px; }
.swa-note { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--swa-muted); background: #fff; flex: none; }

/* Phones: sit above the theme's Call · Book · Directions bar; open full screen. */
@media (max-width: 760px) {
	.swa-launcher { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); height: 50px; padding: 0 16px 0 14px; font-size: 14px; }
	.swa-panel { inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; border-radius: 0; }
	.swa-form { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
	html.swa-lock, html.swa-lock body { overflow: hidden; }
}
@media (max-width: 380px) {
	.swa-launcher__label { display: none; }
	.swa-launcher { width: 50px; padding: 0; justify-content: center; }
}
@media print { .swa { display: none !important; } }

/* Guard against the theme's global form, button and link styles. */
.swa .swa-form .swa-input { width: auto; margin: 0; min-height: 0; height: 44px; padding: 0 14px; background: #fff; box-shadow: none; }
.swa .swa-form .swa-input:focus { background: #fff; box-shadow: none; outline: 2px solid var(--swa-navy); border-color: transparent; }
.swa .swa-form .swa-send { min-height: 0; width: 44px; height: 44px; padding: 0; border-radius: 12px; background: var(--swa-navy); color: #fff; }
.swa .swa-form .swa-send:hover { background: var(--swa-navy-2); }
.swa .swa-msg a.swa-btn:hover { color: var(--swa-navy); background: var(--swa-sand); }
.swa .swa-msg a.swa-btn--primary:hover { color: #fff; background: var(--swa-navy-2); }
.swa .swa-msg a.swa-link:hover, .swa .swa-msg p a:hover { color: var(--swa-navy); }
.swa .swa-msg p { line-height: 1.5; }
