/* O'zDJTU AI-yordamchi vidjeti — Stratis uslubi (minimal, kartochkali) */
.aic {
	--aic-ink: #111827;
	--aic-text: #1f2937;
	--aic-muted: #6b7280;
	--aic-faint: #9ca3af;
	--aic-line: #e5e7eb;
	--aic-card: #ffffff;
	--aic-bg: #f5f6f8;
	--aic-brand: #392C7D;
	--aic-green: #1fbf8f;
	font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--aic-text);
}
.aic *, .aic *::before, .aic *::after { box-sizing: border-box; }
.aic button { font-family: inherit; }

/* ---------- Yopiq holat: kichik tugma ---------- */
.aic-fab {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 10040;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 1px solid var(--aic-line);
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(17, 24, 39, .14), 0 1px 3px rgba(17, 24, 39, .08);
	transition: transform .15s ease, box-shadow .15s ease;
}
.aic-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(17, 24, 39, .18); }
.aic-fab:focus-visible { outline: 3px solid var(--aic-brand); outline-offset: 3px; }
.aic-fab img { display: block; width: 40px; height: 40px; margin: auto; border-radius: 50%; }
.aic-fab-badge {
	position: absolute;
	right: -3px;
	bottom: -3px;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--aic-ink);
	color: #fff;
}
.aic-fab-badge svg { width: 12px; height: 12px; }
.aic-fab-tip {
	position: absolute;
	right: 66px;
	top: 50%;
	transform: translateY(-50%);
	padding: 6px 10px;
	border-radius: 8px;
	background: var(--aic-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease;
}
.aic-fab:hover .aic-fab-tip, .aic-fab:focus-visible .aic-fab-tip { opacity: 1; }
.aic.is-open .aic-fab { display: none; }

/* ---------- Ochiq holat: oyna ---------- */
.aic-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 10050;
	display: none;
	flex-direction: column;
	width: 400px;
	height: min(640px, calc(100vh - 40px));
	border: 1px solid var(--aic-line);
	border-radius: 16px;
	background: var(--aic-bg);
	box-shadow: 0 24px 64px rgba(17, 24, 39, .22);
	overflow: hidden;
}
.aic.is-open .aic-panel { display: flex; animation: aic-in .18s ease-out; }
@keyframes aic-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.aic-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 12px 12px 14px;
	border-bottom: 1px solid var(--aic-line);
	background: #fff;
}
.aic-head img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.aic-title { flex: 1; min-width: 0; }
.aic-title strong { display: block; color: var(--aic-ink); font-size: 14px; font-weight: 600; line-height: 1.25; }
.aic-title span { display: flex; align-items: center; gap: 6px; color: var(--aic-muted); font-size: 12px; }
.aic-title span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--aic-green); }
.aic-icon-btn {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--aic-muted);
	cursor: pointer;
}
.aic-icon-btn:hover { background: var(--aic-bg); color: var(--aic-ink); }
.aic-icon-btn svg { width: 18px; height: 18px; }

/* Xabarlar */
.aic-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	scroll-behavior: smooth;
}
.aic-card {
	display: flex;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--aic-line);
	border-radius: 10px;
	background: var(--aic-card);
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
	animation: aic-msg .2s ease-out;
}
@keyframes aic-msg { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.aic-ava {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	flex: none;
	overflow: hidden;
}
.aic-ava img { width: 24px; height: 24px; border-radius: 50%; }
.aic-ava-user { border-radius: 50%; background: #eef0f3; color: var(--aic-muted); }
.aic-ava-user svg { width: 14px; height: 14px; }
.aic-ava-bot { background: var(--aic-ink); color: #fff; }
.aic-ava-bot svg { width: 14px; height: 14px; }
.aic-content { flex: 1; min-width: 0; }
.aic-text { color: var(--aic-text); word-wrap: break-word; }
.aic-text p { margin: 0 0 6px; }
.aic-text p:last-child { margin: 0; }
.aic-text ul { margin: 4px 0 6px; padding-left: 18px; }
.aic-text li { margin: 2px 0; }
.aic-text strong { color: var(--aic-ink); font-weight: 600; }
.aic-text a { color: var(--aic-brand); text-decoration: none; border-bottom: 1px solid rgba(57, 44, 125, .3); word-break: break-word; }
.aic-text a:hover { border-bottom-color: var(--aic-brand); }
.aic-meta { display: flex; align-items: center; gap: 4px; margin-top: 6px; min-height: 20px; }
.aic-time { flex: 1; color: var(--aic-faint); font-size: 11px; }
.aic-act {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--aic-faint);
	cursor: pointer;
}
.aic-act:hover { background: var(--aic-bg); color: var(--aic-ink); }
.aic-act.is-on { color: var(--aic-ink); }
.aic-act svg { width: 14px; height: 14px; }
.aic-card-error { border-color: #fecaca; background: #fef2f2; }
.aic-card-error .aic-text { color: #991b1b; }
.aic-card-error .aic-ava-bot { background: #dc2626; }

.aic-typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.aic-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--aic-faint); animation: aic-dot 1s infinite; }
.aic-typing i:nth-child(2) { animation-delay: .15s; }
.aic-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aic-dot { 50% { opacity: .3; transform: translateY(-2px); } }

/* Tayyor savollar */
.aic-suggest { display: grid; gap: 6px; margin-top: 2px; }
.aic-suggest-label { margin: 4px 2px 0; color: var(--aic-faint); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.aic-chip {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--aic-line);
	border-radius: 10px;
	background: #fff;
	color: var(--aic-text);
	font-size: 13px;
	text-align: left;
	cursor: pointer;
	transition: border-color .12s ease, background .12s ease;
}
.aic-chip svg { width: 14px; height: 14px; color: var(--aic-faint); flex: none; }
.aic-chip:hover { border-color: #cbd0d8; background: #fafafa; }
.aic-chip:hover svg { color: var(--aic-ink); }

/* Yozish maydoni */
.aic-form { padding: 10px 12px 12px; background: var(--aic-bg); }
.aic-inputbox {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 8px 8px 8px 12px;
	border: 1px solid var(--aic-line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
	transition: border-color .12s ease, box-shadow .12s ease;
}
.aic-inputbox:focus-within { border-color: #c7cbd3; box-shadow: 0 0 0 3px rgba(17, 24, 39, .06); }
.aic-inputbox > svg { width: 16px; height: 16px; margin-bottom: 7px; color: var(--aic-muted); flex: none; }
.aic-input {
	flex: 1;
	min-height: 30px;
	max-height: 110px;
	padding: 5px 0;
	border: 0;
	outline: none;
	background: transparent;
	color: var(--aic-ink);
	font: inherit;
	resize: none;
}
.aic-input::placeholder { color: var(--aic-faint); }
.aic-send {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 30px;
	padding: 0 10px;
	border: 1px solid var(--aic-line);
	border-radius: 8px;
	background: #fff;
	color: var(--aic-muted);
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	flex: none;
}
.aic-send svg { width: 13px; height: 13px; }
.aic-send:not(:disabled) { border-color: var(--aic-ink); background: var(--aic-ink); color: #fff; }
.aic-send:disabled { cursor: default; }
.aic-note { margin-top: 6px; color: var(--aic-faint); font-size: 11px; text-align: center; }

/* Mobil */
@media (max-width: 575px) {
	.aic-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; }
	.aic-fab img { width: 36px; height: 36px; }
	.aic-fab-tip { display: none; }
	.aic-panel { right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; }
	.aic-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.aic-panel, .aic-card, .aic-typing i, .aic-fab { animation: none !important; transition: none !important; }
}
