:root{
	--gad-ink:#111827;
	--gad-accent:#2563eb;
	--gad-line:#e4e6ea;
	--gad-bg:#f7f8fa;
}

.gad-widget{ position:fixed; bottom:20px; z-index:99999; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; }
.gad-widget.gad-pos-right{ right:20px; }
.gad-widget.gad-pos-left{ left:20px; }

.gad-bubble{
	width:56px; height:56px; border-radius:50%; background:var(--gad-ink); color:#fff; border:none;
	display:flex; align-items:center; justify-content:center; box-shadow:0 12px 28px rgba(0,0,0,0.22); cursor:pointer;
	transition:transform .15s ease;
}
.gad-bubble:hover{ transform:scale(1.05); }
.gad-bubble svg{ width:24px; height:24px; }
.gad-icon-close{ display:none; }
.gad-widget.open .gad-icon-open{ display:none; }
.gad-widget.open .gad-icon-close{ display:block; }

.gad-panel{
	position:absolute; bottom:72px; width:350px; max-width:calc(100vw - 40px);
	background:#fff; border:1px solid var(--gad-line); box-shadow:0 24px 60px rgba(0,0,0,0.24);
	display:flex; flex-direction:column; height:460px; max-height:70vh; border-radius:10px; overflow:hidden;
}
.gad-pos-right .gad-panel{ right:0; }
.gad-pos-left .gad-panel{ left:0; }

.gad-head{ background:var(--gad-ink); color:#fff; padding:14px 12px 14px 18px; display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.gad-head-title{ font-weight:700; font-size:15px; }
.gad-head-sub{ font-size:11px; color:#c3c9d4; margin-top:3px; }
.gad-head-sub kbd{ background:rgba(255,255,255,0.15); border-radius:3px; padding:1px 5px; font-family:monospace; }

.gad-head-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.gad-icon-btn{ background:none; border:none; color:#fff; opacity:0.75; cursor:pointer; padding:4px; display:flex; }
.gad-icon-btn:hover{ opacity:1; }
.gad-icon-btn[aria-pressed="true"]{ opacity:1; color:#7dd3fc; }
.gad-icon-btn svg{ width:18px; height:18px; }

.gad-close-btn{ background:none; border:none; color:#fff; opacity:0.75; cursor:pointer; padding:4px; flex-shrink:0; display:flex; }
.gad-close-btn:hover{ opacity:1; }
.gad-close-btn svg{ width:16px; height:16px; }

.gad-messages{ flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; background:var(--gad-bg); }
.gad-row{ display:flex; }
.gad-row.from-user{ justify-content:flex-end; }
.gad-msg-col{ display:flex; flex-direction:column; max-width:82%; }
.gad-row.from-user .gad-msg-col{ align-items:flex-end; }
.gad-row.from-bot .gad-msg-col{ align-items:flex-start; }
.gad-msg{ padding:10px 13px; font-size:13.5px; line-height:1.5; border-radius:10px; background:#fff; border:1px solid var(--gad-line); color:var(--gad-ink); }
.gad-row.from-user .gad-msg{ background:var(--gad-accent); color:#fff; border-color:var(--gad-accent); }

.gad-typing{ display:flex; gap:4px; align-items:center; padding:12px 13px; }
.gad-typing span{ width:6px; height:6px; border-radius:50%; background:#8a94a3; display:inline-block; animation:gadTyping 1.2s infinite ease-in-out; }
.gad-typing span:nth-child(2){ animation-delay:.15s; }
.gad-typing span:nth-child(3){ animation-delay:.3s; }
@keyframes gadTyping{ 0%,60%,100%{ opacity:0.3; transform:translateY(0); } 30%{ opacity:1; transform:translateY(-3px); } }

.gad-input-row{ display:flex; gap:8px; padding:12px; border-top:1px solid var(--gad-line); background:#fff; }
.gad-text-input{ flex:1; padding:10px 12px; font-size:13.5px; border:1px solid var(--gad-line); border-radius:8px; font-family:inherit; }
.gad-send{ width:40px; height:40px; flex-shrink:0; background:var(--gad-ink); color:#fff; border:none; border-radius:8px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.gad-send svg{ width:16px; height:16px; }

.gad-mic-btn{
	width:40px; height:40px; flex-shrink:0; background:#fff; color:var(--gad-ink); border:1px solid var(--gad-line);
	border-radius:8px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .15s ease, color .15s ease;
}
.gad-mic-btn:hover{ border-color:var(--gad-accent); color:var(--gad-accent); }
.gad-mic-btn svg{ width:17px; height:17px; }
.gad-mic-btn.listening{ background:#dc2626; border-color:#dc2626; color:#fff; animation:gadMicPulse 1.4s infinite; }
@keyframes gadMicPulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(220,38,38,0.4); } 50%{ box-shadow:0 0 0 8px rgba(220,38,38,0); } }

.gad-msg-speak{
	background:none; border:none; padding:0; margin-top:6px; display:inline-flex; align-items:center; gap:4px;
	font-size:10.5px; color:#8a94a3; cursor:pointer; opacity:0.7;
}
.gad-msg-speak:hover{ opacity:1; color:var(--gad-accent); }
.gad-msg-speak svg{ width:12px; height:12px; }
.gad-msg-speak.speaking{ color:var(--gad-accent); opacity:1; }

/* ---------- Gallery cards ---------- */
.gad-gallery-row{ display:flex; gap:10px; overflow-x:auto; max-width:100%; padding-bottom:2px; }
.gad-gallery-card{ flex:0 0 132px; background:#fff; border:1px solid var(--gad-line); border-radius:8px; overflow:hidden; display:flex; flex-direction:column; }
.gad-gallery-img{ width:100%; height:100px; background-size:cover; background-position:center; background-color:var(--gad-bg); }
.gad-gallery-placeholder{ background:repeating-linear-gradient(135deg, var(--gad-bg), var(--gad-bg) 10px, #eceef1 10px, #eceef1 20px); }
.gad-gallery-title{ font-size:11.5px; font-weight:600; padding:8px 8px 2px; line-height:1.3; }
.gad-gallery-tag{ font-size:10px; color:#6b7280; padding:0 8px 8px; }
.gad-gallery-link{ display:block; text-align:center; font-size:11px; font-weight:600; color:#fff; background:var(--gad-accent); padding:7px 6px; margin-top:auto; }
.gad-gallery-link:hover{ opacity:0.9; }

@media (max-width:480px){
	.gad-widget.gad-pos-right{ right:14px; }
	.gad-widget.gad-pos-left{ left:14px; }
	.gad-widget{ bottom:14px; }
	.gad-panel{ width:calc(100vw - 28px); height:64vh; }
}
