.sac, .sac * { box-sizing: border-box; }
.sac {
	--sac-color: #1f6f5c;
	position: fixed; bottom: 20px; z-index: 99999;
	font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Nastaliq Urdu", sans-serif;
	color: #1c1f1e;
}
.sac-right { right: 20px; }
.sac-left { left: 20px; }

.sac-launcher {
	width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer;
	background: var(--sac-color); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.sac-launcher:focus-visible, .sac-close:focus-visible, .sac-chip:focus-visible, .sac-send:focus-visible, .sac-input:focus-visible {
	outline: 3px solid #f2b705; outline-offset: 2px;
}
.sac-launcher[hidden], .sac-panel[hidden], .sac-chips[hidden] { display: none; }

.sac-panel {
	width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 40px);
	display: flex; flex-direction: column;
	background: #fff; border-radius: 14px; overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
}
.sac-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 16px; background: var(--sac-color); color: #fff;
}
.sac-close { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }

.sac-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f6f7f6; }
.sac-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sac-bot { align-self: flex-start; background: #fff; border: 1px solid #e2e6e4; }
.sac-user { align-self: flex-end; background: var(--sac-color); color: #fff; }
.sac-user a { color: #fff; }
.sac-bot a { color: var(--sac-color); }
.sac-typing { color: #7a8481; letter-spacing: 2px; }

.sac-cards { display: flex; flex-direction: column; gap: 8px; }
.sac-card {
	display: flex; gap: 10px; padding: 8px; text-decoration: none; color: inherit;
	background: #fff; border: 1px solid #e2e6e4; border-radius: 10px;
}
a.sac-card:hover { border-color: var(--sac-color); }
.sac-card img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; }
.sac-card-body { display: flex; flex-direction: column; min-width: 0; }
.sac-card-title { font-weight: 600; }
.sac-card-meta { color: var(--sac-color); font-size: 13px; font-weight: 600; }
.sac-card-desc { color: #5a6360; font-size: 13px; }

.sac-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: #f6f7f6; }
.sac-chip {
	border: 1px solid var(--sac-color); color: var(--sac-color); background: #fff;
	border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.sac-chip:hover { background: var(--sac-color); color: #fff; }

.sac-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e2e6e4; background: #fff; }
.sac-input { flex: 1; min-width: 0; border: 1px solid #c9d0cd; border-radius: 8px; padding: 9px 10px; font: inherit; }
.sac-send { border: 0; border-radius: 8px; padding: 0 16px; background: var(--sac-color); color: #fff; font: inherit; cursor: pointer; }
.sac-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
	.sac { bottom: 12px; }
	.sac-right { right: 12px; }
	.sac-left { left: 12px; }
	.sac-panel { height: calc(100vh - 24px); }
}
