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

/* Any element styled with an explicit `display` (the panel, mic button, speak
   toggle) needs this — otherwise setting the HTML `hidden` attribute via JS has
   no visible effect, because a normal-priority author `display` rule always
   overrides the browser's own `[hidden]{display:none}` default regardless of
   selector specificity. This was the cause of the close button appearing not
   to work — the panel's `display:flex` rule was silently cancelling `hidden`. */
[hidden]{ display:none !important; }

.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:400px; max-width:calc(100vw - 32px);
	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:620px; max-height:80vh; 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:center; justify-content:space-between; gap:10px; }
.gad-head-text{ min-width:0; flex:1; }
.gad-head-title{
	font-weight:700; font-size:15px; overflow:hidden; text-overflow:ellipsis;
	display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; word-break:break-all;
}
.gad-head-sub{ font-size:11px; color:#c3c9d4; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.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-text-input:disabled, .gad-send:disabled{ opacity:0.45; cursor:not-allowed; }

.gad-consent-gate{ padding:14px 16px; border-top:1px solid var(--gad-line); background:#fffaf0; }
.gad-consent-gate p{ font-size:12.5px; color:#5b5343; margin-bottom:8px; line-height:1.5; }
.gad-consent-link{ display:inline-block; font-size:12px; color:var(--gad-accent); margin-bottom:10px; text-decoration:underline; }
.gad-consent-checkbox-row{ display:flex; align-items:flex-start; gap:8px; font-size:12px; color:#5b5343; margin-bottom:12px; cursor:pointer; }
.gad-consent-checkbox-row input{ margin-top:2px; flex-shrink:0; width:15px; height:15px; }
.gad-consent-accept{ display:block; width:100%; background:var(--gad-ink); color:#fff; border:none; padding:10px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; }
.gad-consent-accept:hover{ opacity:0.9; }
.gad-consent-accept:disabled{ opacity:0.4; cursor:not-allowed; }
.gad-consent-admin-reset{ display:block; width:100%; text-align:center; background:none; border:1px dashed #c9a227; color:#8a6d00; font-size:11px; padding:6px; margin:8px 16px 0; cursor:pointer; border-radius:6px; }
.gad-consent-admin-reset:hover{ background:#fdf6e3; }

.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; }

/* ---------- Promotion cards ---------- */
.gad-promo-row{ display:flex; flex-direction:column; gap:10px; max-width:100%; }
.gad-promo-card{ background:#fff; border:1px solid var(--gad-line); border-radius:8px; overflow:hidden; display:flex; }
.gad-promo-img{ width:84px; flex-shrink:0; background-size:cover; background-position:center; background-color:var(--gad-bg); }
.gad-promo-body{ padding:10px 12px; flex:1; min-width:0; }
.gad-promo-badge{ display:inline-block; background:#fef3c7; color:#92400e; font-size:11px; font-weight:700; padding:2px 8px; border-radius:20px; margin-bottom:5px; }
.gad-promo-title{ font-size:12.5px; font-weight:600; margin-bottom:3px; }
.gad-promo-desc{ font-size:11.5px; color:#6b7280; margin-bottom:4px; line-height:1.4; }
.gad-promo-meta{ font-size:10.5px; color:#8a94a3; margin-bottom:6px; }
.gad-promo-link{ display:inline-block; font-size:11px; font-weight:600; color:var(--gad-accent); text-decoration:underline; }
.gad-promo-link:hover{ opacity:0.8; }

.gad-quick{ padding:0 16px 12px; }
.gad-chip{ font-size:12px; border:1px solid var(--gad-line); background:#fff; padding:7px 12px; border-radius:20px; color:#5b6675; cursor:pointer; transition:border-color .15s ease, color .15s ease; }
.gad-chip:hover{ border-color:var(--gad-accent); color:var(--gad-accent); }

@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:74vh; }
}
