.ss-aiw-root,
.ss-aiw-root * {
	box-sizing: border-box;
}

.ss-aiw-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ss-aiw-root[data-call-state="idle"] {
	--ss-aiw-display-padding-top: 14px;
	--ss-aiw-display-padding-bottom: 8px;
	--ss-aiw-display-number-size: clamp(26px, 4.2vh, 30px);
	--ss-aiw-display-subtitle-size: 13px;
	--ss-aiw-key-width: min(100%, 68px);
	--ss-aiw-key-main-size: clamp(24px, 3.8vh, 32px);
	--ss-aiw-key-sub-size: 10px;
	--ss-aiw-keypad-gap-row: 6px;
	--ss-aiw-keypad-gap-col: 8px;
	--ss-aiw-keypad-padding-top: 8px;
	--ss-aiw-keypad-padding-bottom: 10px;
	--ss-aiw-call-btn-size: clamp(72px, 9vh, 82px);
	--ss-aiw-bottom-gap: 10px;
	--ss-aiw-bottom-margin-top: 4px;
	--ss-aiw-control-min-height: 46px;
	--ss-aiw-control-padding-y: 12px;
	--ss-aiw-control-padding-x: 14px;
}

.ss-aiw-root[data-call-state="connecting"],
.ss-aiw-root[data-call-state="active"] {
	--ss-aiw-display-padding-top: 8px;
	--ss-aiw-display-padding-bottom: 4px;
	--ss-aiw-display-number-size: clamp(20px, 3.2vh, 24px);
	--ss-aiw-display-subtitle-size: 12px;
	--ss-aiw-key-width: min(100%, 56px);
	--ss-aiw-key-main-size: clamp(20px, 3vh, 24px);
	--ss-aiw-key-sub-size: 8px;
	--ss-aiw-keypad-gap-row: 4px;
	--ss-aiw-keypad-gap-col: 8px;
	--ss-aiw-keypad-padding-top: 4px;
	--ss-aiw-keypad-padding-bottom: 6px;
	--ss-aiw-call-btn-size: 62px;
	--ss-aiw-bottom-gap: 8px;
	--ss-aiw-bottom-margin-top: 2px;
	--ss-aiw-control-min-height: 40px;
	--ss-aiw-control-padding-y: 10px;
	--ss-aiw-control-padding-x: 12px;
}

.ss-aiw-root[data-state="open"] {
	gap: 0;
}

.ss-aiw-root[data-state="open"] .ss-aiw-launcher-btn {
	display: none;
}

.ss-aiw-root [hidden] {
	display: none !important;
}

.ss-aiw-launcher-btn,
.ss-aiw-call-btn,
.ss-aiw-mute-btn,
.ss-aiw-end-btn,
.ss-aiw-accept,
.ss-aiw-cancel,
.ss-aiw-close-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
}

.ss-aiw-launcher-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 14px 18px;
	border-radius: 999px;
	background: rgba(10, 27, 68, 0.92);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	box-shadow: 0 20px 45px rgba(5, 17, 43, 0.28);
	border: 1px solid rgba(122, 162, 255, 0.28);
	backdrop-filter: blur(14px);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ss-aiw-launcher-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 24px 54px rgba(5, 17, 43, 0.35);
}

.ss-aiw-launcher-icon {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: linear-gradient(135deg, #2f7cff 0%, #0b5cff 100%);
	font-size: 14px;
	line-height: 1;
	flex: 0 0 auto;
}

.ss-aiw-panel {
	width: min(350px, calc(100vw - 24px));
	height: min(680px, calc(100vh - 40px));
	max-height: calc(100vh - 40px);
}

.ss-aiw-phone {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	border-radius: 34px;
	padding: 10px;
	background: linear-gradient(180deg, #17356f 0%, #0b46b7 100%);
	box-shadow: 0 30px 80px rgba(5, 17, 43, 0.42);
	border: 1px solid rgba(255, 255, 255, 0.16);
}

.ss-aiw-notch {
	width: 124px;
	height: 24px;
	margin: 0 auto 10px;
	border-radius: 0 0 18px 18px;
	background: #081224;
}

.ss-aiw-screen {
	position: relative;
	overflow: hidden;
	flex: 1 1 auto;
	height: auto;
	max-height: none;
	min-height: 0;
	border-radius: 26px;
	padding: 18px 18px 20px;
	background: linear-gradient(180deg, #06080d 0%, #111722 100%);
	border: 1px solid rgba(255, 255, 255, 0.7);
}

.ss-aiw-shell {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.ss-aiw-bg-blur {
	position: absolute;
	border-radius: 999px;
	filter: blur(36px);
	opacity: 0.42;
	pointer-events: none;
}

.ss-aiw-bg-blur-1 {
	width: 160px;
	height: 160px;
	top: -55px;
	right: -24px;
	background: rgba(34, 197, 94, 0.16);
}

.ss-aiw-bg-blur-2 {
	width: 160px;
	height: 160px;
	left: -48px;
	bottom: -50px;
	background: rgba(59, 130, 246, 0.12);
}

.ss-aiw-top,
.ss-aiw-center,
.ss-aiw-bottom,
.ss-aiw-main-view,
.ss-aiw-terms-view {
	position: relative;
	z-index: 2;
}

.ss-aiw-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.ss-aiw-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ss-aiw-logo,
.ss-aiw-logo-fallback {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	flex: 0 0 auto;
}

.ss-aiw-logo {
	object-fit: contain;
	background: #fff;
	padding: 7px;
	box-shadow: 0 10px 25px rgba(11, 92, 255, 0.12);
}

.ss-aiw-logo-fallback {
	display: grid;
	place-items: center;
	font-weight: 800;
	font-size: 15px;
	color: #fff;
	background: linear-gradient(135deg, #0b5cff 0%, #56adff 100%);
}

.ss-aiw-copy {
	min-width: 0;
}

.ss-aiw-title {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.05;
	color: #f8fafc;
}

.ss-aiw-status {
	font-size: 13px;
	line-height: 1.35;
	color: rgba(226, 232, 240, 0.72);
}

.ss-aiw-top-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ss-aiw-pill {
	padding: 8px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	background: rgba(30, 41, 59, 0.9);
	color: #bfdbfe;
	border: 1px solid rgba(96, 165, 250, 0.2);
	white-space: nowrap;
}

.ss-aiw-pill[data-mode="connecting"] {
	background: #eff6ff;
	color: #1d4ed8;
	border-color: #93c5fd;
}

.ss-aiw-pill[data-mode="connected"],
.ss-aiw-pill[data-mode="listening"],
.ss-aiw-pill[data-mode="speaking"] {
	background: #dbeafe;
	color: #1d4ed8;
	border-color: #93c5fd;
}

.ss-aiw-pill[data-mode="error"] {
	background: rgba(127, 29, 29, 0.24);
	color: #fecaca;
	border-color: rgba(248, 113, 113, 0.25);
}

.ss-aiw-close-btn {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: #f8fafc;
	font-size: 22px;
	line-height: 1;
}

.ss-aiw-main-view {
	display: grid;
	grid-template-rows: auto 1fr auto;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.ss-aiw-display {
	padding: var(--ss-aiw-display-padding-top) 8px var(--ss-aiw-display-padding-bottom);
	text-align: center;
}

.ss-aiw-display-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(148, 163, 184, 0.76);
}

.ss-aiw-display-number {
	margin-top: 8px;
	font-size: var(--ss-aiw-display-number-size);
	line-height: 1.1;
	font-weight: 300;
	color: #f8fafc;
}

.ss-aiw-display-subtitle {
	margin-top: 6px;
	font-size: var(--ss-aiw-display-subtitle-size);
	color: rgba(148, 163, 184, 0.88);
}

.ss-aiw-keypad {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--ss-aiw-keypad-gap-row) var(--ss-aiw-keypad-gap-col);
	padding: var(--ss-aiw-keypad-padding-top) 0 var(--ss-aiw-keypad-padding-bottom);
	margin-top: 4px;
	align-content: center;
	min-height: 0;
	overflow: hidden;
}

.ss-aiw-key {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: var(--ss-aiw-key-width);
	aspect-ratio: 1 / 1;
	min-height: 0;
	justify-self: center;
	border-radius: 999px;
	background: transparent;
	border: 2px solid rgba(148, 163, 184, 0.58);
	color: #f8fafc;
	cursor: default;
}

.ss-aiw-key-main {
	font-size: var(--ss-aiw-key-main-size);
	line-height: 1;
	font-weight: 300;
}

.ss-aiw-key-sub {
	min-height: 14px;
	margin-top: 1px;
	font-size: var(--ss-aiw-key-sub-size);
	letter-spacing: 0.08em;
	color: rgba(148, 163, 184, 0.82);
}

.ss-aiw-bottom {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--ss-aiw-bottom-gap);
	margin-top: var(--ss-aiw-bottom-margin-top);
}

.ss-aiw-call-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: var(--ss-aiw-call-btn-size);
	height: var(--ss-aiw-call-btn-size);
	padding: 0;
	border-radius: 999px;
	font-size: 0;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(180deg, #23c76c 0%, #16a34a 100%);
	box-shadow: 0 18px 36px rgba(34, 197, 94, 0.28);
	transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ss-aiw-call-btn > span:last-child {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ss-aiw-call-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 22px 42px rgba(34, 197, 94, 0.34);
}

.ss-aiw-call-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.ss-aiw-call-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	color: #fff;
	line-height: 0;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.ss-aiw-call-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.ss-aiw-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	width: 100%;
}

.ss-aiw-mute-btn,
.ss-aiw-end-btn {
	min-height: var(--ss-aiw-control-min-height);
	padding: var(--ss-aiw-control-padding-y) var(--ss-aiw-control-padding-x);
	border-radius: 14px;
	font-size: 14px;
	font-weight: 700;
}

.ss-aiw-mute-btn {
	background: #eaf2ff;
	color: #0b5cff;
	border: 1px solid #bfdbfe;
}

.ss-aiw-mute-btn[data-muted="true"] {
	background: #dbeafe;
	color: #083ea9;
}

.ss-aiw-end-btn {
	background: #152038;
	color: #fff;
}

.ss-aiw-mute-btn:disabled,
.ss-aiw-end-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.ss-aiw-terms-view {
	display: flex;
	flex: 1 1 auto;
	align-items: stretch;
	min-height: 0;
}

.ss-aiw-terms-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: 0;
	border-radius: 18px;
	background: rgba(15, 23, 42, 0.82);
	border: 1px solid rgba(51, 65, 85, 0.9);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
	backdrop-filter: blur(10px);
	overflow: hidden;
}

.ss-aiw-terms-content {
	padding: 20px 20px 8px;
	color: #e2e8f0;
	line-height: 1.65;
	font-size: 14px;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

.ss-aiw-terms-content h3 {
	margin: 0 0 12px;
	font-size: 22px;
	line-height: 1.15;
}

.ss-aiw-terms-content p {
	margin: 0 0 12px;
}

.ss-aiw-terms-content ul {
	margin: 0 0 12px 18px;
	padding: 0;
}

.ss-aiw-terms-content li {
	margin: 0 0 8px;
}

.ss-aiw-terms-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 20px 20px;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.92) 100%);
}

.ss-aiw-cancel,
.ss-aiw-accept {
	min-height: 46px;
	padding: 12px 18px;
	border-radius: 14px;
	font-size: 15px;
	font-weight: 800;
}

.ss-aiw-cancel {
	background: #f1f5f9;
	color: #0f172a;
}

.ss-aiw-accept {
	background: linear-gradient(135deg, #0b5cff 0%, #083ea9 100%);
	color: #fff;
}

@media (max-width: 640px) {
	.ss-aiw-root[data-call-state="idle"] {
		--ss-aiw-key-width: min(100%, 62px);
		--ss-aiw-key-main-size: 26px;
		--ss-aiw-key-sub-size: 9px;
		--ss-aiw-keypad-padding-bottom: 14px;
	}

	.ss-aiw-root[data-call-state="connecting"],
	.ss-aiw-root[data-call-state="active"] {
		--ss-aiw-key-width: min(100%, 52px);
		--ss-aiw-key-main-size: 22px;
		--ss-aiw-key-sub-size: 8px;
		--ss-aiw-call-btn-size: 58px;
		--ss-aiw-control-min-height: 38px;
		--ss-aiw-control-padding-y: 9px;
		--ss-aiw-control-padding-x: 12px;
	}

	.ss-aiw-root {
		right: 12px;
		left: 12px;
		bottom: 12px;
		align-items: stretch;
	}

	.ss-aiw-launcher-btn,
	.ss-aiw-panel {
		width: 100%;
	}

	.ss-aiw-panel {
		height: min(640px, calc(100vh - 24px));
		max-height: calc(100vh - 24px);
	}

	.ss-aiw-screen {
		padding: 14px 14px 16px;
	}

	.ss-aiw-display {
		padding: 12px 4px 6px;
	}

	.ss-aiw-display-number {
		font-size: var(--ss-aiw-display-number-size);
	}

	.ss-aiw-call-icon {
		width: 28px;
		height: 28px;
	}

	.ss-aiw-controls {
		grid-template-columns: 1fr;
	}
}
