:root {
	--hva-primary: #039D55;
	--hva-secondary: #02773f;
	--hva-text: #1f2937;
	--hva-background: #ffffff;
	--hva-radius: 18px;
	--hva-button-size: 64px;
	--hva-panel-width: 380px;
	--hva-panel-height: 560px;
	--hva-z-index: 999999;
}

.hva-widget {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--hva-text);
	box-sizing: border-box;
}

.hva-widget * {
	box-sizing: border-box;
}

.hva-layout-floating {
	position: fixed;
	bottom: 24px;
	z-index: var(--hva-z-index);
}

.hva-position-bottom-right {
	right: 24px;
}

.hva-position-bottom-left {
	left: 24px;
}

.hva-layout-inline {
	position: relative;
	max-width: var(--hva-panel-width);
}

.hva-launch-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--hva-primary);
	color: #fff;
	border: none;
	border-radius: calc(var(--hva-button-size) / 2);
	height: var(--hva-button-size);
	min-width: var(--hva-button-size);
	padding: 0 18px 0 16px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	font-size: 14px;
	font-weight: 600;
}

.hva-layout-inline .hva-launch-button {
	border-radius: var(--hva-radius);
}

.hva-launch-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.hva-launch-button:focus-visible,
.hva-widget button:focus-visible {
	outline: 3px solid var(--hva-secondary);
	outline-offset: 2px;
}

.hva-launch-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.hva-widget[data-state="closed"] .hva-launch-label,
.hva-widget:not([data-state="closed"]) .hva-launch-button {
	display: none;
}

.hva-widget[data-state="closed"] .hva-launch-button {
	display: inline-flex;
}

.hva-panel {
	width: min(var(--hva-panel-width), 92vw);
	height: min(var(--hva-panel-height), 80vh);
	background: var(--hva-background);
	border-radius: var(--hva-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.hva-layout-floating .hva-panel {
	position: absolute;
	bottom: calc(var(--hva-button-size) + 16px);
}

.hva-position-bottom-right .hva-panel {
	right: 0;
}

.hva-position-bottom-left .hva-panel {
	left: 0;
}

.hva-widget[data-state="closed"] .hva-panel {
	display: none;
}

.hva-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--hva-primary);
	color: #fff;
}

.hva-panel-heading {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.hva-assistant-name {
	font-weight: 700;
	font-size: 15px;
}

.hva-status-text {
	font-size: 12px;
	opacity: 0.85;
}

.hva-panel-controls {
	display: flex;
	align-items: center;
	gap: 4px;
}

.hva-panel-controls button {
	background: rgba(255, 255, 255, 0.16);
	border: none;
	color: #fff;
	border-radius: 8px;
	min-width: 32px;
	min-height: 32px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.hva-panel-controls button[aria-pressed="true"] {
	background: rgba(255, 255, 255, 0.4);
}

.hva-panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.hva-indicator {
	width: 88px;
	height: 88px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hva-indicator-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 3px solid var(--hva-primary);
	opacity: 0.25;
}

.hva-indicator-core {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--hva-primary);
	transition: transform 0.2s ease, background 0.2s ease;
}

[data-state="listening"] .hva-indicator-ring {
	animation: hva-pulse 1.4s ease-out infinite;
}

[data-state="speaking"] .hva-indicator-core {
	animation: hva-speak 0.6s ease-in-out infinite alternate;
}

[data-state="thinking"] .hva-indicator-core,
[data-state="connecting"] .hva-indicator-core,
[data-state="reconnecting"] .hva-indicator-core {
	animation: hva-think 1s linear infinite;
}

[data-state="error"] .hva-indicator-core {
	background: #d63638;
}

[data-state="muted"] .hva-indicator-core {
	background: #9aa1a9;
}

@keyframes hva-pulse {
	0% { transform: scale(1); opacity: 0.35; }
	100% { transform: scale(1.6); opacity: 0; }
}

@keyframes hva-speak {
	from { transform: scale(1); }
	to { transform: scale(1.15); }
}

@keyframes hva-think {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.hva-live-status {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	min-height: 1.2em;
}

.hva-transcript {
	width: 100%;
	flex: 1;
	overflow-y: auto;
	font-size: 13px;
	line-height: 1.5;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 12px;
	padding: 10px 12px;
	max-height: 220px;
}

.hva-transcript p {
	margin: 0 0 8px;
}

.hva-transcript .hva-t-visitor {
	text-align: right;
	color: var(--hva-primary);
}

.hva-transcript .hva-t-assistant {
	text-align: left;
}

.hva-error {
	width: 100%;
	background: #fdecea;
	color: #611a15;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
}

.hva-privacy-notice {
	font-size: 11px;
	opacity: 0.7;
	text-align: center;
	margin: 0;
}

.hva-privacy-notice a {
	color: inherit;
}

.hva-panel-footer {
	padding: 14px 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	display: flex;
	gap: 8px;
}

.hva-panel-footer button {
	flex: 1;
	border: none;
	border-radius: var(--hva-radius);
	padding: 12px 14px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	min-height: 44px;
}

.hva-start-button {
	background: var(--hva-primary);
	color: #fff;
}

.hva-end-button {
	background: #f0f0f1;
	color: #1f2937;
}

.hva-retry-button {
	background: #dba617;
	color: #1f2937;
}

@media (prefers-reduced-motion: reduce) {
	.hva-indicator-ring,
	.hva-indicator-core {
		animation: none !important;
	}
}

@media (prefers-contrast: more) {
	.hva-panel {
		border: 2px solid currentColor;
	}
}

@media (max-width: 480px) {
	.hva-layout-floating {
		right: 12px !important;
		left: 12px !important;
		bottom: 12px;
	}

	.hva-panel {
		width: 100%;
	}
}
