/* Two Way Solutions intake assistant */
.tws-intake {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
	font-size: 15px;
	line-height: 1.5;
	color: #15202E;
}
.tws-intake-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 999px;
	background: #B84A17;
	color: #FFFFFF;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(7, 30, 58, 0.28);
}
.tws-intake-launcher:hover { background: #9A3D12; }
.tws-intake-launcher:focus-visible,
.tws-intake button:focus-visible,
.tws-intake a:focus-visible { outline: 2px solid #F0A47C; outline-offset: 3px; }
.tws-intake.is-open .tws-intake-launcher-label { display: none; }
.tws-intake.is-open .tws-intake-launcher { padding: 0 16px; }

.tws-intake-panel {
	width: min(380px, calc(100vw - 24px));
	height: min(600px, calc(100vh - 110px));
	display: flex;
	flex-direction: column;
	background: #FFFFFF;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 18px 48px rgba(7, 30, 58, 0.32);
	border: 1px solid #E2DDD4;
}
.tws-intake-panel[hidden] { display: none; }
.tws-intake-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 14px 18px;
	background: #0B2B52;
	color: #FFFFFF;
}
.tws-intake-title { margin: 0; font-weight: 600; font-size: 16px; color: #FFFFFF; }
.tws-intake-sub { margin: 2px 0 0; font-size: 13px; color: #C5D0DD; line-height: 1.4; }
.tws-intake-close {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	margin: -8px -8px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #FFFFFF;
	cursor: pointer;
}
.tws-intake-close:hover { background: rgba(255, 255, 255, 0.1); }

.tws-intake-log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #F4F1EC;
}
.tws-intake-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 12px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.tws-intake-msg.is-bot { align-self: flex-start; background: #FFFFFF; border: 1px solid #E2DDD4; border-bottom-left-radius: 4px; }
.tws-intake-msg.is-user { align-self: flex-end; background: #0B2B52; color: #FFFFFF; border-bottom-right-radius: 4px; }
.tws-intake-summary {
	margin: 0;
	padding: 12px 14px;
	background: #FFFFFF;
	border: 1px solid #E2DDD4;
	border-radius: 8px;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 12px;
	font-size: 14px;
}
.tws-intake-summary dt { color: #5A6573; }
.tws-intake-summary dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

.tws-intake-composer {
	flex-shrink: 0;
	padding: 12px 14px;
	border-top: 1px solid #E2DDD4;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 55%;
	overflow-y: auto;
}
.tws-intake-input.is-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.tws-intake-form { display: flex; gap: 8px; align-items: flex-end; }
.tws-intake-form input,
.tws-intake-form textarea {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 10px 12px;
	font: inherit;
	color: inherit;
	background: #FBFAF7;
	border: 1px solid #C9C2B6;
	border-radius: 6px;
	box-sizing: border-box;
	resize: none;
}
.tws-intake-form :is(input, textarea):focus { outline: 2px solid #B84A17; outline-offset: 0; border-color: #B84A17; }
.tws-intake-send {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 6px;
	background: #B84A17;
	color: #FFFFFF;
	cursor: pointer;
}
.tws-intake-send:hover { background: #9A3D12; }
.tws-intake-btn { font: inherit; cursor: pointer; border-radius: 6px; }
.tws-intake-btn.is-chip {
	min-height: 40px;
	padding: 8px 12px;
	background: #FFFFFF;
	color: #0B2B52;
	border: 1px solid #0B2B52;
	font-size: 14px;
	font-weight: 500;
	text-align: left;
}
.tws-intake-btn.is-chip:hover { background: #0B2B52; color: #FFFFFF; }
.tws-intake-btn.is-primary { min-height: 48px; border: 0; background: #B84A17; color: #FFFFFF; font-weight: 600; }
.tws-intake-btn.is-primary:hover { background: #9A3D12; }
.tws-intake-btn.is-primary:disabled { opacity: 0.7; cursor: wait; }
.tws-intake-btn.is-secondary { min-height: 44px; border: 1px solid #0B2B52; background: #FFFFFF; color: #0B2B52; font-weight: 600; }
.tws-intake-btn.is-link { align-self: flex-start; min-height: 36px; padding: 0 2px; border: 0; background: none; color: #0B2B52; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.tws-intake-error { margin: 0; font-size: 13px; color: #8A2F0B; }
.tws-intake-error:empty { display: none; }
.tws-intake-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; }
.tws-intake-foot { margin: 0; padding: 8px 14px 12px; font-size: 12.5px; color: #5A6573; border-top: 1px solid #F0ECE5; }
.tws-intake-foot a { color: #0B2B52; }
.tws-intake .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 480px) {
	.tws-intake { right: 12px; bottom: 12px; }
	.tws-intake.is-open { inset: 0; right: 0; bottom: 0; gap: 0; }
	.tws-intake.is-open .tws-intake-panel { width: 100vw; height: 100%; border-radius: 0; border: 0; }
	.tws-intake.is-open .tws-intake-launcher { display: none; }
	.tws-intake-launcher { min-height: 48px; padding: 0 16px 0 14px; }
}
@media (prefers-reduced-motion: no-preference) {
	.tws-intake-msg { animation: tws-intake-in 160ms ease-out; }
	@keyframes tws-intake-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
