/* Website chatbot (SA_Chat): a bubble bottom right that opens a chat panel. Square corners and the
   site's red, like the rest of the theme. Hidden while the cookie banner is showing. */
.sa-chat { --sa-chat-red: var(--sam-red, #e3262d); --sa-chat-ink: var(--sam-ink, #141010); --sa-chat-line: var(--sam-line, #e3e3e3); --sa-chat-muted: var(--sam-muted, #6b6b6b);
	position: fixed; right: 20px; bottom: 20px; z-index: 9990; font-family: var(--sam-font, system-ui, sans-serif); color: var(--sa-chat-ink); }
.sa-chat[hidden], .sa-chat [hidden] { display: none !important; }
.sam-cookie-open .sa-chat:not(.is-open) { display: none; }
.sa-chat *, .sa-chat *::before, .sa-chat *::after { box-sizing: border-box; }

.sa-chat__launcher { display: flex; align-items: center; gap: 10px; margin-left: auto; padding: 12px 18px 12px 14px; border: 0; background: var(--sam-blue, #00aad2); color: #fff; font: 600 15px/1.2 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 8px 24px rgba(20, 16, 16, .25); transition: background-color .15s; }
.sa-chat__launcher:hover, .sa-chat__launcher:focus-visible { background: #0090b3; } /* the logo blue ("STUDY"), darker on hover */
.sa-chat__launcher:focus-visible { outline: 3px solid var(--sa-chat-ink); outline-offset: 2px; }
.sa-chat__launcher-icon { width: 22px; height: 22px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v12H9l-5 4z'/%3E%3C/svg%3E"); }
.sa-chat.is-open .sa-chat__launcher { display: none; }

.sa-chat__panel { display: flex; flex-direction: column; width: 380px; height: min(600px, calc(100vh - 40px)); background: #fff; border: 1px solid var(--sa-chat-line); border-top: 4px solid var(--sa-chat-red); box-shadow: 0 12px 40px rgba(20, 16, 16, .22); }
.sa-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--sa-chat-line); }
.sa-chat__head strong { display: block; font-size: 16px; font-weight: 600; }
.sa-chat__head span { display: block; font-size: 12px; color: var(--sa-chat-muted); }
.sa-chat__close { width: 36px; height: 36px; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--sa-chat-ink); cursor: pointer; }
.sa-chat__close:hover { color: var(--sa-chat-red); }

.sa-chat__log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--sam-grey, #f7f7f7); overscroll-behavior: contain; }
.sa-chat.is-emailing .sa-chat__log { display: none; }
.sa-chat__msg { max-width: 88%; padding: 10px 13px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.sa-chat__msg p { margin: 0 0 8px; }
.sa-chat__msg p:last-child, .sa-chat__msg ul:last-child { margin-bottom: 0; }
.sa-chat__msg ul { margin: 0 0 8px; padding-left: 18px; }
.sa-chat__msg a { color: var(--sa-chat-red); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.sa-chat__msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--sa-chat-line); }
.sa-chat__msg--user { align-self: flex-end; background: var(--sa-chat-ink); color: #fff; }
.sa-chat__msg-email { margin-top: 8px; padding: 7px 12px; border: 2px solid var(--sa-chat-ink); background: #fff; font: 500 13px/1.2 inherit; font-family: inherit; color: var(--sa-chat-ink); cursor: pointer; }
.sa-chat__msg-email:hover { background: var(--sa-chat-ink); color: #fff; }
.sa-chat__msg.is-typing { display: flex; gap: 4px; padding: 14px; }
.sa-chat__msg.is-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b5b5b5; animation: sa-chat-dot 1s infinite ease-in-out; }
.sa-chat__msg.is-typing span:nth-child(2) { animation-delay: .15s; }
.sa-chat__msg.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sa-chat-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.sa-chat__ask { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--sa-chat-line); }
.sa-chat__ask textarea { flex: 1 1 auto; min-height: 42px; max-height: 120px; padding: 10px 12px; border: 1px solid #c9c9c9; font: 15px/1.4 inherit; font-family: inherit; resize: none; color: var(--sa-chat-ink); background: #fff; }
.sa-chat__ask textarea:focus, .sa-chat__email input:focus, .sa-chat__email textarea:focus { outline: 2px solid var(--sa-chat-ink); outline-offset: -1px; border-color: var(--sa-chat-ink); }
.sa-chat__send { flex: 0 0 42px; width: 42px; height: 42px; border: 0; background: var(--sa-chat-red) no-repeat center / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); cursor: pointer; }
.sa-chat__send:hover { background-color: var(--sam-red-dark, #c41d23); }

.sa-chat__foot { display: flex; align-items: center; gap: 10px; padding: 0 12px 10px; font-size: 11px; line-height: 1.35; color: var(--sa-chat-muted); }
.sa-chat__email-open { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--sa-chat-ink); background: #fff; font: 500 13px/1.2 inherit; font-family: inherit; color: var(--sa-chat-ink); cursor: pointer; }
.sa-chat__email-open:hover { background: var(--sa-chat-ink); color: #fff; }
.sa-chat.is-emailing .sa-chat__foot { display: none; }

.sa-chat__email { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.sa-chat__email-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.sa-chat__email-intro { margin: 0; font-size: 15px; font-weight: 500; }
.sa-chat__email label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.sa-chat__email input[type="text"], .sa-chat__email input[type="email"], .sa-chat__email textarea { width: 100%; padding: 9px 11px; border: 1px solid #c9c9c9; font: 15px/1.4 inherit; font-family: inherit; color: var(--sa-chat-ink); background: #fff; }
.sa-chat__email label.sa-chat__check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.sa-chat__email .sa-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.sa-chat__error { margin: 0; padding: 8px 10px; background: #fdecec; border-left: 3px solid var(--sa-chat-red); font-size: 13px; }
.sa-chat__email-actions { display: flex; gap: 8px; justify-content: space-between; }
.sa-chat__back { padding: 10px 12px; border: 1px solid #c9c9c9; background: #fff; font: 14px/1.2 inherit; font-family: inherit; color: var(--sa-chat-ink); cursor: pointer; }
.sa-chat__send-email { padding: 10px 16px; border: 0; background: var(--sa-chat-red); color: #fff; font: 600 14px/1.2 inherit; font-family: inherit; cursor: pointer; }
.sa-chat__send-email:disabled { opacity: .6; cursor: wait; }
.sa-chat__fine { margin: 0; font-size: 11px; color: var(--sa-chat-muted); }
.sa-chat__fine a { color: inherit; }
/* The contact form's captcha, drawn inside the chat. */
.sa-chat__captcha .sa-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sa-chat__captcha .sa-contact__cap-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sa-chat__captcha .sa-contact__cap-img { display: block; width: 180px; height: auto; border: 1px solid var(--sa-chat-line); }
.sa-chat__captcha .sa-contact__cap-new { padding: 6px 10px; border: 1px solid #c9c9c9; background: #fff; font: 13px/1.2 inherit; font-family: inherit; cursor: pointer; }
.sa-chat__captcha input[name="sa_cap"] { width: 180px; padding: 9px 11px; border: 1px solid #c9c9c9; font: 15px/1.4 monospace; letter-spacing: 2px; text-transform: uppercase; }
.sa-chat__captcha .sa-field__help { margin: 0; font-size: 11px; color: var(--sa-chat-muted); }
.sa-chat__captcha .sa-req { color: var(--sa-chat-red); }

/* Phones: a full-width bubble bar is too much, so a round button; the panel fills the screen. */
@media (max-width: 600px) {
	.sa-chat { right: 12px; bottom: 12px; }
	.sa-chat__launcher { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
	.sa-chat__launcher-icon { width: 26px; height: 26px; }
	.sa-chat__launcher-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.sa-chat.is-open { inset: 0; right: 0; bottom: 0; }
	.sa-chat__panel { width: 100%; height: 100%; height: 100dvh; border: 0; border-top: 4px solid var(--sa-chat-red); }
	.sa-chat__ask textarea { font-size: 16px; } /* stops iOS zooming in */
}
@media (prefers-reduced-motion: reduce) {
	.sa-chat__msg.is-typing span { animation: none; opacity: .6; }
}
.sa-chat .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
