/* ============================================================
   Urban AI Chat — Premium widget UI
   ============================================================ */

.ugai-chat {
	--ugai-bg: rgba(255, 255, 255, 0.82);
	--ugai-bg-solid: #ffffff;
	--ugai-surface: rgba(255, 255, 255, 0.55);
	--ugai-text: #111111;
	--ugai-muted: #6b6b6b;
	--ugai-border: rgba(0, 0, 0, 0.08);
	--ugai-glow: color-mix(in srgb, var(--ugai-accent, #111) 35%, transparent);
	--ugai-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
	--ugai-radius: 1.35rem;
	--ugai-blur: 18px;
	position: fixed;
	z-index: 99999;
	bottom: 1.35rem;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}

.ugai-chat[data-position="left"] { left: 1.35rem; }
.ugai-chat[data-position="right"] { right: 1.35rem; }

html[data-theme="dark"] .ugai-chat {
	--ugai-bg: rgba(18, 18, 18, 0.88);
	--ugai-bg-solid: #121212;
	--ugai-surface: rgba(255, 255, 255, 0.04);
	--ugai-text: #f3f3f3;
	--ugai-muted: #a3a3a3;
	--ugai-border: rgba(255, 255, 255, 0.1);
	--ugai-shadow: 0 28px 90px rgba(0, 0, 0, 0.55), 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ── Launcher ── */
.ugai-chat__launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 3.85rem;
	height: 3.85rem;
	padding: 0 1rem 0 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	background:
		linear-gradient(145deg, color-mix(in srgb, var(--ugai-accent, #111) 88%, #fff 12%), var(--ugai-accent, #111));
	color: #fff;
	cursor: pointer;
	box-shadow:
		0 14px 40px var(--ugai-glow),
		0 4px 14px rgba(0, 0, 0, 0.18),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
	overflow: hidden;
	transition:
		transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1),
		box-shadow 0.35s ease,
		width 0.35s ease,
		padding 0.35s ease;
}

.ugai-chat__launcher:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow:
		0 18px 50px var(--ugai-glow),
		0 8px 20px rgba(0, 0, 0, 0.22),
		inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ugai-chat__launcher-glow {
	position: absolute;
	inset: -40%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 62%);
	opacity: 0.55;
	pointer-events: none;
	animation: ugaiShimmer 4s ease-in-out infinite;
}

.ugai-chat__launcher-ring {
	position: absolute;
	inset: -3px;
	border-radius: inherit;
	border: 1px solid rgba(255, 255, 255, 0.22);
	opacity: 0.7;
	pointer-events: none;
}

.ugai-chat__launcher-icon {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
	transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.ugai-chat__launcher-icon svg {
	width: 100%;
	height: 100%;
}

.ugai-chat__launcher-icon--close {
	position: absolute;
	left: 50%;
	top: 50%;
	opacity: 0;
	transform: translate(-50%, -50%) rotate(-90deg) scale(0.6);
}

.ugai-chat__launcher-label {
	position: relative;
	z-index: 1;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	white-space: nowrap;
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-width 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}

.ugai-chat__launcher:hover .ugai-chat__launcher-label {
	max-width: 5rem;
	opacity: 1;
	margin-inline-start: 0.15rem;
}

.ugai-chat.is-open .ugai-chat__launcher {
	width: 3.85rem;
	padding: 0;
	justify-content: center;
}

.ugai-chat.is-open .ugai-chat__launcher-label {
	max-width: 0;
	opacity: 0;
	margin: 0;
}

.ugai-chat.is-open .ugai-chat__launcher-icon--chat {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

.ugai-chat.is-open .ugai-chat__launcher-icon--close {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

@keyframes ugaiShimmer {
	0%, 100% { transform: translate(-10%, -10%) scale(1); opacity: 0.45; }
	50% { transform: translate(8%, 8%) scale(1.08); opacity: 0.75; }
}

/* ── Panel shell ── */
.ugai-chat__panel {
	position: absolute;
	bottom: calc(100% + 1rem);
	width: min(24rem, calc(100vw - 2rem));
	height: min(36rem, calc(100vh - 5.5rem));
	border-radius: calc(var(--ugai-radius) + 0.15rem);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(18px) scale(0.94);
	transform-origin: bottom center;
	transition:
		opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.38s ease;
	filter: drop-shadow(0 0 0 transparent);
}

.ugai-chat[data-position="left"] .ugai-chat__panel { left: 0; }
.ugai-chat[data-position="right"] .ugai-chat__panel { right: 0; }

.ugai-chat.is-open .ugai-chat__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	filter: drop-shadow(0 0 24px var(--ugai-glow));
}

.ugai-chat__panel-bg {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(165deg, var(--ugai-bg-solid) 0%, color-mix(in srgb, var(--ugai-bg-solid) 92%, var(--ugai-accent, #111) 8%) 100%);
	pointer-events: none;
}

.ugai-chat__panel-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 38%, transparent 72%, rgba(0, 0, 0, 0.04));
}

html[data-theme="dark"] .ugai-chat__panel-bg::after {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%, transparent 70%, rgba(0, 0, 0, 0.18));
}

.ugai-chat__orb {
	position: absolute;
	border-radius: 999px;
	filter: blur(42px);
	opacity: 0.55;
	animation: ugaiFloat 9s ease-in-out infinite;
}

.ugai-chat__orb--1 {
	width: 11rem;
	height: 11rem;
	top: -3rem;
	left: -2rem;
	background: color-mix(in srgb, var(--ugai-accent, #111) 28%, #8b5cf6 72%);
}

.ugai-chat__orb--2 {
	width: 9rem;
	height: 9rem;
	right: -2rem;
	bottom: 4rem;
	background: color-mix(in srgb, var(--ugai-accent, #111) 20%, #06b6d4 80%);
	animation-delay: -3s;
}

.ugai-chat__grid {
	position: absolute;
	inset: 0;
	opacity: 0.35;
	background-image:
		linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
	background-size: 22px 22px;
	mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}

html[data-theme="dark"] .ugai-chat__grid {
	opacity: 0.22;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

@keyframes ugaiFloat {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(12px, -10px) scale(1.06); }
}

.ugai-chat__panel-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--ugai-bg);
	border: 1px solid var(--ugai-border);
	border-radius: inherit;
	backdrop-filter: blur(var(--ugai-blur)) saturate(1.35);
	-webkit-backdrop-filter: blur(var(--ugai-blur)) saturate(1.35);
	box-shadow: var(--ugai-shadow);
	overflow: hidden;
}

/* ── Header ── */
.ugai-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1rem 0.85rem;
	border-bottom: 1px solid var(--ugai-border);
	background: linear-gradient(180deg, var(--ugai-surface), transparent);
}

.ugai-chat__brand {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	min-width: 0;
}

.ugai-chat__avatar {
	position: relative;
	width: 2.75rem;
	height: 2.75rem;
	flex-shrink: 0;
}

.ugai-chat__avatar-core {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 0.95rem;
	background:
		linear-gradient(145deg, color-mix(in srgb, var(--ugai-accent, #111) 75%, #fff 25%), var(--ugai-accent, #111));
	color: #fff;
	font-size: 0.68rem;
	font-weight: 900;
	letter-spacing: 0.12em;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ugai-chat__avatar-ring {
	position: absolute;
	inset: -3px;
	border-radius: 1.1rem;
	background: conic-gradient(from 180deg, var(--ugai-accent, #111), #8b5cf6, #06b6d4, var(--ugai-accent, #111));
	animation: ugaiSpin 5s linear infinite;
	opacity: 0.85;
}

.ugai-chat__avatar-ring::after {
	content: "";
	position: absolute;
	inset: 2px;
	border-radius: inherit;
	background: var(--ugai-bg-solid);
}

@keyframes ugaiSpin {
	to { transform: rotate(360deg); }
}

.ugai-chat__brand-text {
	min-width: 0;
}

.ugai-chat__title {
	display: block;
	font-size: 0.98rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

.ugai-chat__status {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.18rem;
	font-size: 0.72rem;
	color: var(--ugai-muted);
}

.ugai-chat__status-dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 999px;
	background: #22c55e;
	box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
	animation: ugaiLivePulse 2s infinite;
}

.ugai-chat__close {
	width: 2.15rem;
	height: 2.15rem;
	border: 1px solid var(--ugai-border);
	border-radius: 0.75rem;
	background: var(--ugai-surface);
	color: inherit;
	cursor: pointer;
	display: grid;
	place-items: center;
	transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.ugai-chat__close:hover {
	background: color-mix(in srgb, var(--ugai-accent, #111) 10%, var(--ugai-surface));
	transform: rotate(90deg);
}

.ugai-chat__close svg {
	width: 0.95rem;
	height: 0.95rem;
}

/* ── Tabs ── */
.ugai-chat__tabs {
	display: flex;
	gap: 0.35rem;
	margin: 0.75rem 0.85rem 0;
	padding: 0.28rem;
	border-radius: 999px;
	background: var(--ugai-surface);
	border: 1px solid var(--ugai-border);
}

.ugai-chat__tab {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ugai-muted);
	padding: 0.58rem 0.65rem;
	cursor: pointer;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ugai-chat__tab svg {
	width: 0.95rem;
	height: 0.95rem;
	flex-shrink: 0;
	opacity: 0.75;
}

.ugai-chat__tab.is-active {
	background: var(--ugai-bg-solid);
	color: var(--ugai-text);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

html[data-theme="dark"] .ugai-chat__tab.is-active {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.ugai-chat__tab.is-active svg {
	opacity: 1;
	color: var(--ugai-accent, #111);
}

/* ── Body / views ── */
.ugai-chat__body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.ugai-chat__view {
	display: none;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.ugai-chat__view.is-active {
	display: flex;
	animation: ugaiViewIn 0.32s ease;
}

@keyframes ugaiViewIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ── Messages ── */
.ugai-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 0.95rem;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	direction: rtl;
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, var(--ugai-accent, #111) 25%, transparent) transparent;
}

.ugai-chat__messages::-webkit-scrollbar {
	width: 5px;
}

.ugai-chat__messages::-webkit-scrollbar-thumb {
	background: color-mix(in srgb, var(--ugai-accent, #111) 28%, transparent);
	border-radius: 999px;
}

.ugai-chat__bubble {
	max-width: 86%;
	padding: 0.72rem 0.9rem;
	border-radius: 1.05rem;
	line-height: 1.7;
	font-size: 0.9rem;
	white-space: pre-wrap;
	animation: ugaiBubbleIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ugaiBubbleIn {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.ugai-chat__bubble--bot {
	align-self: flex-start;
	background: var(--ugai-surface);
	border: 1px solid var(--ugai-border);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
	border-bottom-right-radius: 0.35rem;
}

.ugai-chat__bubble--user {
	align-self: flex-end;
	background: linear-gradient(135deg, var(--ugai-accent, #111), color-mix(in srgb, var(--ugai-accent, #111) 78%, #000 22%));
	color: #fff;
	border-bottom-left-radius: 0.35rem;
	box-shadow: 0 8px 22px var(--ugai-glow);
}

.ugai-chat__bubble--typing {
	opacity: 0.75;
	font-style: italic;
}

/* ── Product cards in chat ── */
.ugai-chat__cards {
	display: grid;
	gap: 0.55rem;
	margin-top: 0.45rem;
}

.ugai-chat__cards-title {
	font-size: 0.74rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ugai-muted);
	margin: 0.15rem 0;
}

.ugai-chat__product {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.58rem;
	border: 1px solid var(--ugai-border);
	border-radius: 0.9rem;
	color: inherit;
	background: color-mix(in srgb, var(--ugai-bg-solid) 88%, var(--ugai-surface));
	transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ugai-chat__product:hover {
	transform: translateX(-4px);
	border-color: color-mix(in srgb, var(--ugai-accent, #111) 25%, var(--ugai-border));
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.ugai-chat__product img,
.ugai-chat__product .ugai-chat__ph {
	width: 3.1rem;
	height: 3.1rem;
	border-radius: 0.65rem;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--ugai-surface);
}

.ugai-chat__product-body { min-width: 0; flex: 1; }

.ugai-chat__product-title {
	margin: 0;
	font-size: 0.84rem;
	font-weight: 800;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ugai-chat__product-price {
	margin: 0.15rem 0 0;
	font-size: 0.76rem;
	color: var(--ugai-muted);
}

/* ── Composer ── */
.ugai-chat__composer {
	padding: 0.85rem 0.95rem 1rem;
	border-top: 1px solid var(--ugai-border);
	background: linear-gradient(0deg, var(--ugai-surface), transparent);
}

.ugai-chat__composer-field {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.32rem;
	border-radius: 999px;
	border: 1px solid var(--ugai-border);
	background: color-mix(in srgb, var(--ugai-bg-solid) 90%, var(--ugai-surface));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ugai-chat__composer-field:focus-within {
	border-color: color-mix(in srgb, var(--ugai-accent, #111) 35%, var(--ugai-border));
	box-shadow: 0 0 0 3px var(--ugai-glow);
}

.ugai-chat__input {
	flex: 1;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	padding: 0.62rem 0.85rem;
	font: inherit;
	font-size: 0.88rem;
	direction: rtl;
	outline: none;
}

.ugai-chat__input::placeholder {
	color: color-mix(in srgb, var(--ugai-muted) 85%, transparent);
}

.ugai-chat__send,
.ugai-chat__order-btn {
	border: 0;
	border-radius: 999px;
	background: linear-gradient(145deg, var(--ugai-accent, #111), color-mix(in srgb, var(--ugai-accent, #111) 80%, #000 20%));
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	white-space: nowrap;
	box-shadow: 0 6px 18px var(--ugai-glow);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ugai-chat__send:hover,
.ugai-chat__order-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px var(--ugai-glow);
}

.ugai-chat__send {
	width: 2.55rem;
	height: 2.55rem;
	display: grid;
	place-items: center;
	padding: 0;
	flex-shrink: 0;
}

.ugai-chat__send svg {
	width: 1rem;
	height: 1rem;
}

/* ── Order tracking view ── */
.ugai-chat__order {
	padding: 1rem 0.95rem 1.1rem;
	direction: rtl;
	overflow-y: auto;
	flex: 1;
}

.ugai-chat__order-card-intro {
	padding: 0.85rem 0.95rem;
	margin-bottom: 0.85rem;
	border-radius: 1rem;
	border: 1px dashed color-mix(in srgb, var(--ugai-accent, #111) 22%, var(--ugai-border));
	background: var(--ugai-surface);
}

.ugai-chat__order-hint {
	margin: 0;
	color: var(--ugai-muted);
	font-size: 0.86rem;
	line-height: 1.75;
}

.ugai-chat__order-form {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.ugai-chat__order-form .ugai-chat__input {
	border: 1px solid var(--ugai-border);
	border-radius: 0.95rem;
	background: color-mix(in srgb, var(--ugai-bg-solid) 92%, var(--ugai-surface));
	padding: 0.75rem 0.9rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ugai-chat__order-form .ugai-chat__input:focus {
	border-color: color-mix(in srgb, var(--ugai-accent, #111) 35%, var(--ugai-border));
	box-shadow: 0 0 0 3px var(--ugai-glow);
}

.ugai-chat__order-btn {
	padding: 0.78rem 1rem;
}

.ugai-chat__order-results {
	display: grid;
	gap: 0.65rem;
	margin-top: 1rem;
}

.ugai-chat__order-card {
	border: 1px solid var(--ugai-border);
	border-radius: 1rem;
	padding: 0.85rem;
	background: color-mix(in srgb, var(--ugai-bg-solid) 88%, var(--ugai-surface));
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ugai-chat__order-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

.ugai-chat__order-card h4 {
	margin: 0 0 0.35rem;
	font-size: 0.94rem;
	font-weight: 800;
}

.ugai-chat__order-card p {
	margin: 0.15rem 0;
	font-size: 0.82rem;
	color: var(--ugai-muted);
}

.ugai-chat__order-card a {
	display: inline-flex;
	align-items: center;
	margin-top: 0.5rem;
	font-size: 0.8rem;
	font-weight: 800;
	color: var(--ugai-accent, #111);
}

.ugai-chat__order-live {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-top: 0.85rem;
	padding: 0.45rem 0.7rem;
	border-radius: 999px;
	font-size: 0.74rem;
	color: var(--ugai-muted);
	background: rgba(34, 197, 94, 0.08);
	border: 1px solid rgba(34, 197, 94, 0.18);
}

.ugai-chat__live-dot {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 999px;
	background: #22c55e;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
	animation: ugaiLivePulse 1.8s infinite;
}

@keyframes ugaiLivePulse {
	0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
	70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.ugai-chat__order-updated {
	margin: 0 0 0.65rem;
	font-size: 0.74rem;
	color: var(--ugai-muted);
}

.ugai-chat__status {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.18rem 0.6rem;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 800;
}

.ugai-chat__status--processing { background: rgba(59, 130, 246, 0.14); color: #2563eb; }
.ugai-chat__status--completed { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.ugai-chat__status--pending { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.ugai-chat__status--hold { background: rgba(168, 85, 247, 0.14); color: #7e22ce; }
.ugai-chat__status--cancelled,
.ugai-chat__status--failed,
.ugai-chat__status--refunded { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }

.ugai-chat__order-card.is-updated {
	animation: ugaiOrderFlash 1.2s ease;
}

@keyframes ugaiOrderFlash {
	0% { background: rgba(34, 197, 94, 0.18); transform: scale(1.01); }
	100% { background: color-mix(in srgb, var(--ugai-bg-solid) 88%, var(--ugai-surface)); transform: scale(1); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
	.ugai-chat {
		bottom: 0.85rem;
	}

	.ugai-chat[data-position="left"] { left: 0.85rem; }
	.ugai-chat[data-position="right"] { right: 0.85rem; }

	.ugai-chat__panel {
		width: min(24rem, calc(100vw - 1.1rem));
		height: min(34rem, calc(100dvh - 5rem));
	}

	.ugai-chat__launcher:hover .ugai-chat__launcher-label {
		max-width: 0;
		opacity: 0;
	}

	.ugai-chat__tab {
		font-size: 0.72rem;
		padding-inline: 0.45rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ugai-chat__launcher,
	.ugai-chat__panel,
	.ugai-chat__bubble,
	.ugai-chat__orb,
	.ugai-chat__avatar-ring,
	.ugai-chat__launcher-glow {
		animation: none !important;
		transition-duration: 0.01ms !important;
	}
}
