.bwa-widget,
.bwa-widget * {
	box-sizing: border-box;
}
.bwa-widget {
	position: fixed;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.bwa-position-right { right: 24px; }
.bwa-position-left { left: 24px; }

.bwa-fab {
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	box-shadow: none;
	border: 0;
	margin: 0;
	background: var(--bwa-color, #25D366);
	color: #fff;
	display: flex;
	align-items: center;
	height: 60px;
	padding: 0;
	cursor: pointer;
	overflow: hidden;
	transition: padding 0.3s ease, transform 0.15s ease;
}
.bwa-fab:hover { transform: scale(1.04); }
.bwa-fab:focus { outline: none; box-shadow: none; }

.bwa-fab-icon {
	width: 60px;
	height: 60px;
	flex: 0 0 60px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Collapsed by default: the label column is 0fr (effectively width 0).
   Hover or the one-time "peek" class expand it to 1fr (auto width),
   animated smoothly without needing to measure text with JS. */
.bwa-fab-label-wrap {
	display: grid;
	grid-template-columns: minmax(0, 0fr);
	transition: grid-template-columns 0.3s ease;
	min-width: 0;
}
.bwa-fab-label {
	overflow: hidden;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	text-align: left;
	white-space: nowrap;
	padding-right: 18px;
}
.bwa-fab-label-main {
	font-size: 15px;
	font-weight: 700;
}
.bwa-fab-label-sub {
	font-size: 11.5px;
	font-weight: 400;
	opacity: 0.92;
}

.bwa-fab:hover .bwa-fab-label-wrap,
.bwa-fab.bwa-peek .bwa-fab-label-wrap {
	grid-template-columns: minmax(0, 1fr);
}

/* Icon-only mode (chat name left blank) never renders a label-wrap at all,
   so it's naturally unaffected by hover/peek — always just the icon. */
.bwa-fab.bwa-icon-only {
	width: 60px;
}

/* Shape: applied on top of the reset above, so it always wins over theme CSS. */
.bwa-fab.bwa-shape-round { border-radius: 999px !important; }
.bwa-fab.bwa-shape-square { border-radius: 14px !important; }

/* Border: off by default; enabled + colored from Settings -> General. */
.bwa-fab.bwa-has-border {
	border: 2px solid var(--bwa-border-color, #ffffff) !important;
}

.bwa-panel {
	position: absolute;
	bottom: 74px;
	width: 300px;
	max-width: 85vw;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 28px rgba(0,0,0,0.22);
	overflow: hidden;
}
.bwa-position-right .bwa-panel { right: 0; }
.bwa-position-left .bwa-panel { left: 0; }

.bwa-panel-header {
	background: var(--bwa-color, #25D366);
	color: #fff;
	padding: 14px 14px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
}
.bwa-panel-header-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.bwa-panel-title {
	font-weight: 700;
	font-size: 15px;
}
.bwa-panel-subtitle {
	font-weight: 400;
	font-size: 12.5px;
	opacity: 0.92;
}

/* Exact spec provided for the close button. */
.bwa-panel-close {
	background: none;
	border: 0px;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0px;
	font-weight: bolder;
	flex-shrink: 0;
	margin-left: 8px;
}

.bwa-panel-body {
	max-height: 420px;
	overflow-y: auto;
	padding: 14px;
}

.bwa-query-form {
	display: flex;
	flex-direction: column;
}
.bwa-query-form[hidden],
.bwa-confirmation[hidden] {
	display: none;
}

.bwa-field-label {
	font-size: 12.5px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 5px;
	margin-top: 10px;
}
.bwa-field-label:first-child { margin-top: 0; }
.bwa-required { color: #DC2626; }

.bwa-field {
	width: 100%;
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13.5px;
	font-family: inherit;
	color: #111827;
	background: #fff;
}
.bwa-field:focus {
	outline: none;
	border-color: var(--bwa-color, #25D366);
}
.bwa-field.bwa-invalid {
	border-color: #DC2626;
}

.bwa-category-select {
	appearance: auto;
	cursor: pointer;
}

.bwa-message-input {
	resize: vertical;
	min-height: 80px;
}

.bwa-char-counter {
	text-align: right;
	font-size: 11px;
	color: #9CA3AF;
	margin-top: 3px;
}

.bwa-field-error {
	display: none;
	color: #DC2626;
	font-size: 11.5px;
	margin-top: 4px;
}
.bwa-field-error.bwa-visible { display: block; }

.bwa-send-btn {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	outline: none;
	box-shadow: none;
	background: var(--bwa-color, #25D366);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	padding: 11px 14px;
	border-radius: 8px;
	cursor: pointer;
	width: 100%;
	margin-top: 14px;
	transition: opacity 0.15s ease;
}
.bwa-send-btn:hover { opacity: 0.92; }
.bwa-send-btn:disabled { opacity: 0.6; cursor: default; }

.bwa-hours-note {
	text-align: center;
	font-size: 11px;
	color: #9CA3AF;
	margin: 10px 0 0;
}

.bwa-confirmation {
	font-size: 13.5px;
	color: #1F2937;
	line-height: 1.5;
	text-align: center;
	padding: 12px 4px;
}
.bwa-confirmation strong {
	display: block;
	font-size: 14.5px;
	margin-bottom: 6px;
	color: #0a7d31;
}

/* Respect reduced-motion preference: skip the expand animation, just show/hide instantly. */
@media (prefers-reduced-motion: reduce) {
	.bwa-fab, .bwa-fab-label-wrap { transition: none; }
}
