.aisc-root {
	--aisc-primary: #2563eb;
	--aisc-bg: #ffffff;
	--aisc-text: #1f2937;
	--aisc-muted: #6b7280;
	--aisc-bubble: #f3f4f6;
	--aisc-border: #e5e7eb;
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--aisc-text);
}
.aisc-root *, .aisc-root *::before, .aisc-root *::after { box-sizing: border-box; }
.aisc-pos-left { left: 20px; }
.aisc-pos-right { right: 20px; }

.aisc-launcher {
	width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--aisc-primary); color: #fff; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 20px rgba(0,0,0,.2); position: relative; padding: 0;
	transition: transform .15s ease;
}
.aisc-launcher:hover { transform: scale(1.06); }
.aisc-launcher:focus-visible { outline: 3px solid rgba(0,0,0,.35); outline-offset: 3px; }
.aisc-badge {
	display: none; position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 10px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700;
	align-items: center; justify-content: center;
}

.aisc-panel {
	position: absolute; bottom: 76px; width: 370px; height: 560px; max-height: calc(100vh - 120px);
	background: var(--aisc-bg); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.22);
	display: none; flex-direction: column; overflow: hidden;
}
.aisc-pos-left .aisc-panel { left: 0; }
.aisc-pos-right .aisc-panel { right: 0; }
.aisc-open .aisc-panel { display: flex; animation: aisc-in .18s ease-out; }
@keyframes aisc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.aisc-header {
	background: var(--aisc-primary); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.aisc-head-text { flex: 1; min-width: 0; }
.aisc-title { font-weight: 700; font-size: 16px; }
.aisc-subtitle { font-size: 12px; opacity: .9; }
.aisc-close {
	background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}

.aisc-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.aisc-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.aisc-msg a { color: inherit; text-decoration: underline; }
.aisc-msg code { background: rgba(0,0,0,.07); padding: 1px 4px; border-radius: 4px; font-size: 13px; }
.aisc-ai, .aisc-agent { align-self: flex-start; background: var(--aisc-bubble); border-bottom-left-radius: 4px; }
.aisc-agent { border-left: 3px solid var(--aisc-primary); }
.aisc-author { font-size: 11px; font-weight: 700; color: var(--aisc-primary); margin-bottom: 2px; }
.aisc-customer { align-self: flex-end; background: var(--aisc-primary); color: #fff; border-bottom-right-radius: 4px; }
.aisc-system { align-self: center; background: transparent; color: var(--aisc-muted); font-size: 12px; text-align: center; padding: 2px 8px; }

.aisc-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.aisc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--aisc-muted); animation: aisc-dot 1.2s infinite ease-in-out; }
.aisc-typing span:nth-child(2) { animation-delay: .15s; }
.aisc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aisc-dot { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.aisc-contact { padding: 12px 16px; border-top: 1px solid var(--aisc-border); background: #fafafa; }
.aisc-contact p { margin: 0 0 8px; font-size: 13px; color: var(--aisc-muted); }
.aisc-contact input {
	width: 100%; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--aisc-border); border-radius: 8px; font: inherit; font-size: 14px;
}
.aisc-contact-btns { display: flex; gap: 8px; align-items: center; }
.aisc-btn-primary { background: var(--aisc-primary); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 14px; }
.aisc-btn-link { background: none; border: 0; color: var(--aisc-muted); cursor: pointer; font: inherit; font-size: 14px; }

.aisc-footer { border-top: 1px solid var(--aisc-border); padding: 8px 12px 12px; }
.aisc-foot-actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 6px; }
.aisc-human {
	background: none; border: 0; color: var(--aisc-primary); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 2px;
}
.aisc-human[hidden], .aisc-contact[hidden] { display: none; }
.aisc-form { display: flex; gap: 8px; align-items: flex-end; }
.aisc-form textarea {
	flex: 1; resize: none; border: 1px solid var(--aisc-border); border-radius: 10px; padding: 9px 12px;
	font: inherit; font-size: 14px; line-height: 1.4; max-height: 120px; color: var(--aisc-text); background: #fff;
}
.aisc-form textarea:focus { outline: none; border-color: var(--aisc-primary); }
.aisc-send {
	width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--aisc-primary); color: #fff;
	cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}
.aisc-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
	.aisc-root { bottom: 16px; }
	.aisc-pos-left { left: 16px; }
	.aisc-pos-right { right: 16px; }
	.aisc-open .aisc-panel {
		position: fixed; inset: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; bottom: 0;
	}
	.aisc-open .aisc-launcher { display: none; }
}
