/* AIKU Chat widget */
.aikuc, .aikuc * { box-sizing: border-box; }
.aikuc {
	--aikuc-accent: #111111;
	--aikuc-gold: #B8966A;
	--aikuc-cream: #F7F1E8;
	--aikuc-beige: #EDE3D4;
	--aikuc-ink: #111111;
	--aikuc-muted: #6b6259;
	position: fixed; bottom: 20px; right: 20px; z-index: 99990;
	font-family: Jost, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--aikuc-ink); font-size: 15px; line-height: 1.45;
}
.aikuc.is-left { right: auto; left: 20px; }

/* Launcher */
.aikuc-launch {
	display: flex; align-items: center; gap: 10px;
	height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--aikuc-accent); color: #fff; font: inherit; font-size: 14px; letter-spacing: .04em;
	box-shadow: 0 10px 30px rgba(17,17,17,.22); transition: transform .2s ease, box-shadow .2s ease;
}
.aikuc-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(17,17,17,.28); }
.aikuc-launch:focus-visible, .aikuc button:focus-visible, .aikuc textarea:focus-visible, .aikuc a:focus-visible { outline: 2px solid var(--aikuc-gold); outline-offset: 2px; }
.aikuc-launch svg { width: 24px; height: 24px; flex: none; }
.aikuc-launch .aikuc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aikuc-gold); margin-left: -2px; }
.aikuc.is-open .aikuc-launch { display: none; }

/* Panel */
.aikuc-panel {
	position: absolute; bottom: 0; right: 0; width: 380px; height: min(620px, calc(100vh - 100px));
	display: none; flex-direction: column; overflow: hidden;
	background: var(--aikuc-cream); border-radius: 18px; box-shadow: 0 24px 60px rgba(17,17,17,.28);
	animation: aikuc-in .22s ease-out;
}
.aikuc.is-left .aikuc-panel { right: auto; left: 0; }
.aikuc.is-open .aikuc-panel { display: flex; }
@keyframes aikuc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.aikuc-head {
	display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px;
	background: var(--aikuc-accent); color: #fff;
}
.aikuc-avatar {
	width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
	background: var(--aikuc-gold); color: #fff; font-family: "Cormorant Garamond", Georgia, serif; font-size: 12px; font-weight: 600; letter-spacing: .08em;
}
.aikuc-title { flex: 1; min-width: 0; }
.aikuc-title strong { display: block; font-size: 15px; font-weight: 500; letter-spacing: .03em; }
.aikuc-title span { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; }
.aikuc-title span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4cc38a; }
.aikuc-icon-btn {
	width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
	display: grid; place-items: center; opacity: .85;
}
.aikuc-icon-btn:hover { background: rgba(255,255,255,.12); opacity: 1; }
.aikuc-icon-btn svg { width: 20px; height: 20px; }

.aikuc-body { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.aikuc-body > * { flex-shrink: 0; }
.aikuc-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; word-wrap: break-word; }
.aikuc-msg p { margin: 0; white-space: normal; }
.aikuc-msg p + p { margin-top: 9px; }
.aikuc-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.aikuc-bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(17,17,17,.06); }
.aikuc-user { align-self: flex-end; background: var(--aikuc-accent); color: #fff; border-bottom-right-radius: 4px; }
.aikuc-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.aikuc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--aikuc-sand, #c9b79c); animation: aikuc-b 1s infinite ease-in-out; }
.aikuc-typing i:nth-child(2) { animation-delay: .15s; } .aikuc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aikuc-b { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Product cards */
.aikuc-cards { align-self: stretch; display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--aikuc-beige) transparent; }
.aikuc-card {
	flex: 0 0 148px; scroll-snap-align: start; background: #fff; border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit;
	box-shadow: 0 1px 2px rgba(17,17,17,.08); display: flex; flex-direction: column; transition: transform .15s;
}
.aikuc-card:hover { transform: translateY(-2px); }
.aikuc-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--aikuc-beige); display: block; }
.aikuc-card .aikuc-ph { width: 100%; aspect-ratio: 1; background: var(--aikuc-beige); }
.aikuc-card-b { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.aikuc-card-n { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aikuc-card-p { font-size: 13px; font-weight: 600; }
.aikuc-card-p s { font-weight: 400; color: var(--aikuc-muted); margin-left: 4px; }
.aikuc-card-t { font-size: 11px; color: var(--aikuc-muted); }
.aikuc-card-t.is-out { color: #b3412e; }

/* Chips & actions */
.aikuc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: stretch; }
.aikuc-chip {
	border: 1px solid var(--aikuc-sand, #d9c7ae); background: transparent; color: var(--aikuc-ink); border-radius: 999px;
	padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.aikuc-chip:hover { background: #fff; border-color: var(--aikuc-gold); }
.aikuc-wa {
	align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
	background: #1f8f4e; color: #fff !important; text-decoration: none !important; font-size: 14px;
}
.aikuc-wa:hover { background: #1a7a43; }
.aikuc-wa svg { width: 18px; height: 18px; }
.aikuc-more { align-self: flex-start; font-size: 13px; color: var(--aikuc-ink); }

/* Composer */
.aikuc-foot { padding: 10px 12px 12px; background: var(--aikuc-cream); border-top: 1px solid var(--aikuc-beige); }
.aikuc-form { display: flex; align-items: flex-end; gap: 8px; background: #fff; border-radius: 22px; padding: 6px 6px 6px 14px; box-shadow: 0 1px 2px rgba(17,17,17,.06); }
.aikuc .aikuc-form textarea {
	flex: 1; width: auto; margin: 0; border: 0 !important; outline: none !important; box-shadow: none !important; resize: none;
	background: transparent !important; font: inherit; font-size: 16px; color: inherit; border-radius: 0;
	height: 38px; max-height: 110px; min-height: 0; padding: 8px 0; line-height: 1.4; overflow-y: auto; scrollbar-width: none;
}
.aikuc .aikuc-form textarea::-webkit-scrollbar { display: none; }
.aikuc-head, .aikuc-foot { position: static !important; top: auto !important; }
.aikuc button { text-transform: none; letter-spacing: normal; min-height: 0; }
.aikuc-send {
	width: 38px; height: 38px; border: 0; border-radius: 50%; flex: none; cursor: pointer;
	background: var(--aikuc-accent); color: #fff; display: grid; place-items: center;
}
.aikuc-send:disabled { opacity: .35; cursor: default; }
.aikuc-send svg { width: 18px; height: 18px; }
.aikuc-note { margin-top: 7px; text-align: center; font-size: 11px; color: var(--aikuc-muted); }
.aikuc-note a { color: inherit; }

@media (max-width: 520px) {
	.aikuc { bottom: 14px; right: 14px; }
	.aikuc.is-left { left: 14px; }
	.aikuc-launch { height: 52px; padding: 0 16px; }
	.aikuc-launch .aikuc-label { display: none; }
	.aikuc-panel { position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; height: calc(100vh - 110px); height: calc(100dvh - 110px); max-height: 640px; border-radius: 18px; box-shadow: 0 18px 50px rgba(17,17,17,.35); }
	.aikuc.is-left .aikuc-panel { left: 12px; }
	.aikuc-panel { animation: none; }
	/* Keyboard open: compact header and footer so more of the conversation shows. */
	.aikuc.is-kb .aikuc-head { padding: 8px 10px 8px 14px; }
	.aikuc.is-kb .aikuc-avatar { width: 32px; height: 32px; font-size: 10px; }
	.aikuc.is-kb .aikuc-title span, .aikuc.is-kb .aikuc-note { display: none; }
	.aikuc.is-kb .aikuc-foot { padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.aikuc-panel, .aikuc-typing i, .aikuc-launch, .aikuc-card { animation: none; transition: none; }
}
.aikuc .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
