.chat-form-view[hidden],
.hwn-chat-transcript[hidden],
.hwn-chat-tools[hidden],
.hwn-typing[hidden],
.hwn-end-chat[hidden],
#supportChatForm input[type="file"][hidden],
#supportChatForm label[hidden] {
	display: none !important;
}

.chat-form-view {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 12px 18px 72px;
}

.chat-form-view .chat-back {
	align-self: flex-start;
}

.hwn-agent-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	margin: 8px 0 6px;
	padding: 9px 11px;
	border: 1px solid #d7e3ef;
	border-radius: 12px;
	background: #f7fafe;
	color: #183b5b;
}

.hwn-agent-bar img,
.hwn-agent-avatar {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 50%;
	object-fit: cover;
	display: grid;
	place-items: center;
	background: #e6f0fb;
}

.hwn-agent-copy {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
	line-height: 1.25;
}

.hwn-agent-copy strong {
	font-size: 13px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hwn-agent-copy small {
	margin-top: 2px;
	color: #62778a;
	font-size: 10px;
}

.hwn-status-dot {
	width: 9px;
	height: 9px;
	flex: 0 0 9px;
	border-radius: 50%;
	background: #94a3b8;
	box-shadow: 0 0 0 3px rgba(148, 163, 184, .16);
}

.hwn-agent-bar.is-online .hwn-status-dot {
	background: #22a06b;
	box-shadow: 0 0 0 3px rgba(34, 160, 107, .15);
}

.hwn-agent-bar.is-checking .hwn-status-dot {
	background: #e5a000;
	animation: hwnPulse 1.2s infinite;
}

.hwn-agent-bar.is-closed {
	background: #f7f7f8;
	color: #59636e;
}

.hwn-agent-bar.is-offline {
	background: #fff8e8;
	border-color: #f1d99a;
}

@keyframes hwnPulse {
	50% { opacity: .35; transform: scale(.8); }
}

.hwn-chat-transcript {
	display: block;
	flex: 1 1 auto;
	min-height: 130px;
	max-height: 300px;
	overflow: auto;
	margin: 7px 0 8px;
	padding: 4px 3px 10px;
	scroll-behavior: smooth;
}

.hwn-chat-msg {
	max-width: 86%;
	margin: 8px 0;
	padding: 9px 11px;
	border-radius: 12px;
	font-size: 12px;
	line-height: 1.45;
	word-break: break-word;
	box-shadow: 0 1px 2px rgba(20, 50, 80, .06);
}

.hwn-chat-msg.customer {
	margin-left: auto;
	border-bottom-right-radius: 4px;
	background: #dff0ff;
	color: #153a5b;
}

.hwn-chat-msg.agent {
	margin-right: auto;
	border: 1px solid #dce7f1;
	border-bottom-left-radius: 4px;
	background: #fff;
	color: #263746;
}

.hwn-chat-msg header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 3px;
}

.hwn-chat-msg strong {
	font-size: 11px;
}

.hwn-chat-msg time {
	color: #718398;
	font-size: 9px;
	white-space: nowrap;
}

.hwn-message-body p {
	margin: 0 0 6px;
}

.hwn-message-body p:last-child {
	margin-bottom: 0;
}

.hwn-message-body a {
	color: #005fa8;
	text-decoration: underline;
}

.hwn-read-state {
	display: block;
	margin-top: 3px;
	color: #638097;
	font-size: 9px;
	text-align: right;
}

.hwn-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}

.hwn-file-chip {
	max-width: 100%;
	padding: 3px 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .72);
	font-size: 10px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hwn-typing {
	margin: -4px 0 7px 9px;
	color: #60758a;
	font-size: 10px;
	font-style: italic;
}

#supportChatForm {
	min-height: 0;
}

#supportChatForm.is-chatting {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 7px;
	align-items: end;
	margin-top: auto;
	padding-top: 9px;
	border-top: 1px solid #dce8f5;
}

#supportChatForm.is-chatting .hwn-message-label {
	grid-column: 1 / -1;
	margin: 0;
	color: #52697e;
	font-size: 10px;
}

#supportChatForm.is-chatting textarea {
	width: 100%;
	min-height: 46px;
	max-height: 110px;
	margin-top: 4px;
	resize: vertical;
	border-radius: 10px;
}

.hwn-chat-tools {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 6px;
}

#supportChatForm .hwn-attach {
	display: inline-flex;
	width: auto;
	max-width: 92px;
	flex: 0 0 auto;
	align-items: center;
	justify-content: flex-start;
	padding: 4px 6px;
	font-size: 10px;
	line-height: 1.2;
}

.hwn-attach,
.hwn-end-chat {
	border: 0;
	background: transparent;
	color: #33658d;
	cursor: pointer;
	font-size: 11px;
	padding: 5px 2px;
}

.hwn-attach:hover,
.hwn-end-chat:hover {
	color: #004f8b;
	text-decoration: underline;
}

.hwn-attach:disabled,
.hwn-end-chat:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.hwn-file-name {
	max-width: 150px;
	color: #60758a;
	font-size: 9px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#supportChatForm.is-chatting .chat-send {
	min-width: 64px;
	height: 40px;
	padding: 0 14px;
	border-radius: 9px;
}

#supportChatForm.is-chatting .hwn-end-chat {
	grid-column: 1 / -1;
	justify-self: end;
	margin-top: -3px;
	color: #8b4850;
}

.hwn-chat-error {
	margin: 6px 0;
	padding: 8px 10px;
	border: 1px solid #f0b9b5;
	border-radius: 8px;
	background: #fff1f0;
	color: #a12622;
	font-size: 11px;
}

.chat-form-view.is-disconnected .hwn-agent-bar {
	border-color: #edc4c0;
	background: #fff5f4;
}

/* Keep both pre-chat forms compact and fully reachable in the widget. */
#supportWidget .chat-form-view {
	padding: 9px 12px 56px;
	overflow-y: auto;
}

#supportWidget .chat-form-view h4 {
	margin: 4px 0 1px;
	font-size: 18px;
	line-height: 1.25;
}

#supportWidget .chat-form-view > p {
	margin: 3px 0 5px;
	line-height: 1.35;
}

#supportWidget .chat-form-view .hwn-agent-bar {
	min-height: 44px;
	margin: 5px 0;
	padding: 7px 9px;
}

#supportWidget #supportChatForm:not(.is-chatting) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 7px 8px;
}

#supportWidget #supportChatForm:not(.is-chatting) > label {
	min-width: 0;
	margin: 0;
}

#supportWidget #supportChatForm:not(.is-chatting) > label.hwn-chat-identity,
#supportWidget #supportChatForm:not(.is-chatting) > label.hwn-message-label,
#supportWidget #supportChatForm:not(.is-chatting) > .hwn-chat-tools,
#supportWidget #supportChatForm:not(.is-chatting) > .chat-send,
#supportWidget #supportChatForm:not(.is-chatting) > .hwn-end-chat {
	grid-column: 1 / -1;
}

#supportWidget #supportChatForm:not(.is-chatting) input,
#supportWidget #supportChatForm:not(.is-chatting) textarea {
	box-sizing: border-box;
	width: 100%;
	margin-top: 3px;
	padding: 7px 8px;
}

#supportWidget #supportChatForm:not(.is-chatting) textarea {
	min-height: 58px;
	max-height: 76px;
	resize: vertical;
}

#supportWidget #supportChatForm:not(.is-chatting) .chat-send {
	min-height: 36px;
	padding: 8px 12px;
}

@media (max-width: 480px) {
	.chat-form-view {
		padding-right: 14px;
		padding-left: 14px;
	}

	.hwn-chat-transcript {
		max-height: 44vh;
	}

	.hwn-chat-msg {
		max-width: 91%;
	}

	.hwn-agent-copy small {
		white-space: normal;
	}

	#supportChatForm.is-chatting .chat-send {
		min-width: 58px;
		padding: 0 11px;
	}
}