/* One Source Datacom Helpdesk */
.osd-hd-wrap { container-type: inline-size; width: 100%; max-width: 1240px; margin-left: auto; margin-right: auto; }
.osd-hd-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.osd-hd {
	--osd-navy: #12355b;
	--osd-blue: #1f6fd1;
	--osd-blue-d: #1859aa;
	--osd-ink: #1c2733;
	--osd-muted: #5b6878;
	--osd-line: #dbe3ec;
	--osd-bg: #f4f7fb;
	--osd-red: #c62828;
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
	max-width: 1240px;
	margin: 24px auto;
	background: #fff;
	border: 1px solid var(--osd-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(18, 53, 91, .12);
	color: var(--osd-ink);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}
.osd-hd *, .osd-hd *::before, .osd-hd *::after { box-sizing: border-box; }

/* Stage */
.osd-hd-stage { position: relative; background: linear-gradient(#e6edf5 50%, #aeb9c6 50%); display: flex; align-items: center; }
.osd-hd-scene { width: 100%; line-height: 0; }
.osd-hd-svg { width: 100%; height: auto; display: block; }
.osd-hd-nameplate {
	position: absolute; left: 16px; bottom: 16px;
	background: rgba(18, 53, 91, .92); color: #fff;
	font-weight: 700; font-size: 14px; padding: 7px 12px; border-radius: 999px;
	display: flex; align-items: center; gap: 8px;
}
.osd-hd-dot { width: 9px; height: 9px; border-radius: 50%; background: #39d353; box-shadow: 0 0 0 3px rgba(57, 211, 83, .25); }
.osd-hd-stage.is-thinking::after {
	content: "…"; position: absolute; top: 9%; left: 58%;
	background: #fff; color: var(--osd-navy); font-weight: 800; font-size: 26px; line-height: 1;
	padding: 4px 14px 14px; border-radius: 18px; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
	animation: osdPulse 1s ease-in-out infinite;
}
@keyframes osdPulse { 50% { transform: translateY(-4px); } }

/* Avatar: blink, glances, breathing, head motion and lip-sync (data-mouth 0-3 set by the script) */
.osd-hd .osd-eyes-closed { opacity: 0; }
.osd-hd .osd-eyes-open { animation: osdBlinkOpen 5.2s infinite; }
.osd-hd .osd-eyes-closed { animation: osdBlinkClosed 5.2s infinite; }
@keyframes osdBlinkOpen { 0%, 94% { opacity: 1; } 95%, 98% { opacity: 0; } 100% { opacity: 1; } }
@keyframes osdBlinkClosed { 0%, 94% { opacity: 0; } 95%, 98% { opacity: 1; } 100% { opacity: 0; } }
.osd-hd .osd-mouth { opacity: 0; }
.osd-hd .osd-mouth-0, .osd-hd[data-mouth="0"] .osd-mouth-0 { opacity: 1; }
.osd-hd[data-mouth="1"] .osd-mouth-0, .osd-hd[data-mouth="2"] .osd-mouth-0, .osd-hd[data-mouth="3"] .osd-mouth-0 { opacity: 0; }
.osd-hd[data-mouth="1"] .osd-mouth-1, .osd-hd[data-mouth="2"] .osd-mouth-2, .osd-hd[data-mouth="3"] .osd-mouth-3 { opacity: 1; }
.osd-hd .osd-upper { transform-box: fill-box; transform-origin: 50% 100%; animation: osdBreathe 4.8s ease-in-out infinite; }
@keyframes osdBreathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.osd-hd .osd-head { transform-box: fill-box; transform-origin: 50% 92%; animation: osdSway 8s ease-in-out infinite; }
@keyframes osdSway { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(1.1deg); } 65% { transform: rotate(-0.9deg); } }
.osd-hd.is-talking .osd-head { animation: osdNod 1.9s ease-in-out infinite; }
@keyframes osdNod { 0%, 100% { transform: rotate(0deg) translateY(0); } 25% { transform: rotate(-1.4deg) translateY(1px); } 55% { transform: rotate(1deg) translateY(-1px); } 80% { transform: rotate(-0.4deg); } }
.osd-hd .osd-irises { animation: osdGlance 11s ease-in-out infinite; }
@keyframes osdGlance { 0%, 38%, 100% { transform: translate(0, 0); } 42%, 52% { transform: translate(-2.5px, 0.5px); } 56%, 78% { transform: translate(0, 0); } 82%, 90% { transform: translate(2.5px, -0.5px); } }
.osd-hd-stage.is-thinking .osd-irises { animation: none; transform: translate(3px, -3.5px); transition: transform .3s; }
.osd-hd-stage.is-thinking .osd-brows { transform: translateY(-3px); transition: transform .3s; }

/* Chat */
.osd-hd-chat { display: flex; flex-direction: column; min-height: 0; height: 620px; border-left: 1px solid var(--osd-line); }
.osd-hd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--osd-navy); color: #fff; }
.osd-hd-title { font-weight: 800; font-size: 17px; line-height: 1.25; }
.osd-hd-sub { font-size: 13px; color: #c9dbef; }
.osd-hd-voice {
	display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
	background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600;
}
.osd-hd-voice .osd-hd-wave { opacity: .35; }
.osd-hd-voice.is-on { background: #fff; color: var(--osd-navy); border-color: #fff; }
.osd-hd-voice.is-on .osd-hd-wave { opacity: 1; }
.osd-hd-voice:focus-visible, .osd-hd button:focus-visible, .osd-hd textarea:focus-visible, .osd-hd input:focus-visible { outline: 3px solid #8ab8f0; outline-offset: 2px; }

.osd-hd-log { flex: 1; overflow-y: auto; padding: 16px; background: var(--osd-bg); display: flex; flex-direction: column; gap: 12px; }
.osd-hd-msg { display: flex; flex-direction: column; max-width: 88%; }
.osd-hd-user { align-self: flex-end; align-items: flex-end; }
.osd-hd-who { font-size: 12px; font-weight: 700; color: var(--osd-muted); margin: 0 0 3px 4px; }
.osd-hd-bubble { padding: 10px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--osd-line); overflow-wrap: anywhere; }
.osd-hd-user .osd-hd-bubble { background: var(--osd-blue); color: #fff; border-color: var(--osd-blue); border-bottom-right-radius: 4px; }
.osd-hd-bot .osd-hd-bubble { border-bottom-left-radius: 4px; }
.osd-hd-bubble p { margin: 0 0 8px; }
.osd-hd-bubble p:last-child, .osd-hd-bubble ol:last-child, .osd-hd-bubble ul:last-child { margin-bottom: 0; }
.osd-hd-bubble ol, .osd-hd-bubble ul { margin: 0 0 8px; padding-left: 22px; }
.osd-hd-bubble li { margin: 2px 0; }
.osd-hd-bubble code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.osd-hd-bubble a { color: var(--osd-blue-d); font-weight: 600; }
.osd-hd-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.osd-hd-dots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa7b6; animation: osdDot 1.2s infinite; }
.osd-hd-dots i:nth-child(2) { animation-delay: .15s; }
.osd-hd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes osdDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.osd-hd-card { background: #fff; border: 1px solid var(--osd-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.osd-hd-card-title { font-weight: 800; }
.osd-hd-card-sub { font-size: 14px; color: var(--osd-muted); }
.osd-hd-contact label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; gap: 3px; }
.osd-hd-contact input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--osd-line); border-radius: 8px; width: 100%; }
.osd-hd-contact.needs-one input[name="email"], .osd-hd-contact.needs-one input[name="phone"] { border-color: var(--osd-red); }
.osd-hd-choice { border: 0; margin: 2px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.osd-hd-choice legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 4px; width: 100%; }
.osd-hd-contact .osd-hd-choice label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.osd-hd-contact .osd-hd-choice input { width: auto; }
.osd-hd-row { display: flex; gap: 8px; }
.osd-hd-row label { flex: 1; }
.osd-hd-row .osd-hd-state { flex: 0 0 84px; }
.osd-hd-contact select { font: inherit; font-size: 15px; padding: 8px 6px; border: 1px solid var(--osd-line); border-radius: 8px; width: 100%; background: #fff; }
.osd-hd-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.osd-hd-primary { background: var(--osd-blue); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.osd-hd-skip { background: transparent; border: 1px solid var(--osd-line); color: var(--osd-muted); border-radius: 8px; padding: 9px 14px; font: inherit; cursor: pointer; }
.osd-hd-alert { border-color: #f1b5b5; background: #fff4f4; color: #7a1414; }
.osd-hd-call { align-self: flex-start; background: var(--osd-red); color: #fff !important; text-decoration: none; font-weight: 800; border-radius: 8px; padding: 9px 16px; }

.osd-hd-verify { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 16px 0; background: var(--osd-bg); font-size: 13px; color: var(--osd-muted); }
.osd-hd-verify[hidden] { display: none; }
.osd-hd-verify.is-ok span { color: #1b7f3b; font-weight: 700; }
.osd-hd-turnstile { min-height: 65px; }
.osd-hd-form textarea:disabled { background: #eef2f7; cursor: not-allowed; }
.osd-hd-chips button:disabled { opacity: .5; cursor: not-allowed; }
.osd-hd-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; background: var(--osd-bg); }
.osd-hd-chips.is-hidden { display: none; }
.osd-hd-chips button { font: inherit; font-size: 13px; background: #fff; color: var(--osd-blue-d); border: 1px solid #bcd3ee; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.osd-hd-chips button:hover { background: #eaf2fc; }

.osd-hd-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; background: var(--osd-bg); border-top: 1px solid var(--osd-line); }
.osd-hd-form textarea { flex: 1; resize: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 10px 12px; border: 1px solid var(--osd-line); border-radius: 12px; background: #fff; min-height: 44px; max-height: 140px; }
.osd-hd-send { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 0; background: var(--osd-blue); color: #fff; cursor: pointer; display: grid; place-items: center; }
.osd-hd-send:disabled { opacity: .5; cursor: wait; }
.osd-hd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.osd-hd-note { font-size: 12px; color: var(--osd-muted); padding: 0 16px 12px; background: var(--osd-bg); }
.osd-hd-note a { color: var(--osd-blue-d); font-weight: 600; }

@container (max-width: 860px) {
	.osd-hd { grid-template-columns: 1fr; margin: 12px auto; border-radius: 14px; }
	.osd-hd-chat { border-left: 0; border-top: 1px solid var(--osd-line); height: 70vh; min-height: 460px; }
	.osd-hd-nameplate { left: 10px; bottom: 10px; font-size: 12px; padding: 5px 10px; }
	.osd-hd-msg { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) {
	.osd-hd .osd-eyes-open, .osd-hd .osd-eyes-closed, .osd-hd-dots i, .osd-hd-stage.is-thinking::after,
	.osd-hd .osd-upper, .osd-hd .osd-head, .osd-hd.is-talking .osd-head, .osd-hd .osd-irises { animation: none; }
}
