.gh-pet-bubble {
	display: grid; gap: 9px; width: max-content; min-width: 170px; max-width: min(270px, calc(100vw - 28px));
	padding: 11px; border-radius: 14px 14px 4px 14px; line-height: 1.75;
	background: color-mix(in srgb, var(--gh-bg-raised) 94%, transparent); backdrop-filter: blur(14px);
}
.gh-pet-bubble[hidden] { display: none; }
.gh-pet :is(.gh-pet-bubble,.gh-pet-panel) { left: 0; right: auto; inset-inline-start: auto; }
.gh-pet.is-right:not(.is-dragged) :is(.gh-pet-bubble,.gh-pet-panel),
.gh-pet.is-dragged.is-near-right :is(.gh-pet-bubble,.gh-pet-panel) { left: auto; right: 0; }
.gh-pet.is-near-top .gh-pet-bubble,
.gh-pet.is-near-top .gh-pet-panel { bottom: auto; top: 84px; }
.gh-pet.is-near-top .gh-pet-bubble { border-radius: 4px 14px 14px 14px; }
.gh-pet-message { display: block; padding-inline: 2px; color: var(--gh-text-primary); font-size: 12px; font-weight: 750; }
.gh-pet-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-block-start: 8px; border-block-start: 1px solid var(--gh-border-subtle); }
.gh-pet-quick-actions[hidden] { display: none; }
.gh-pet-quick-actions [hidden] { display: none; }
.gh-pet-quick-actions :is(a,button) {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; max-width: 100%;
	padding: 6px 9px; border: 1px solid var(--gh-border-default); border-radius: 9px; font: 800 10px/1.4 var(--gh-font-family);
	color: var(--gh-text-primary); background: var(--gh-bg-surface); text-decoration: none; cursor: pointer;
	transition: transform var(--gh-dur-fast) var(--gh-ease-out), border-color var(--gh-dur-fast), background-color var(--gh-dur-fast);
}
.gh-pet-quick-actions :is(a,button):hover { transform: translateY(-1px); border-color: var(--gh-accent-border); background: var(--gh-accent-surface); }
.gh-pet-quick-actions [data-pet-action="ai"] { color: var(--gh-accent-on-solid); border-color: transparent; background: var(--gh-accent-solid); }
.gh-pet-quick-actions svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.gh-pet-quick-actions [data-pet-action="palette"] svg circle { fill: currentColor; stroke: none; }

.gh-pet-sprite::before { content:""; position:absolute; z-index:-1; inset:7px 5px 4px; background:color-mix(in srgb,var(--main) 34%,transparent); filter:blur(12px); opacity:.72; }
.gh-pet-body { outline: 1px solid color-mix(in srgb, #fff 20%, transparent); outline-offset: -5px; }
.gh-pet .gh-pet-face i { width: 10px; height: 12px; box-shadow: 0 0 0 2px color-mix(in srgb,var(--light) 45%,transparent); }
.gh-pet .gh-pet-face i::after { width: 3px; height: 3px; }
.gh-pet.is-thinking .gh-pet-antenna { animation: gh-pet-assistant-signal .65s steps(2,end) infinite; }
.gh-pet.is-thinking .gh-pet-stars { opacity: 1; animation: gh-pet-assistant-spark 1s steps(3,end) infinite; }
@keyframes gh-pet-assistant-signal { 50% { transform: translateY(-3px); filter: brightness(1.3); } }
@keyframes gh-pet-assistant-spark { 50% { transform: translate(5px,-4px) scale(1.2); } }

.gh-pet-toolbar {
	position: absolute; z-index: 12; left: 0; bottom: -30px; display: flex; align-items: center; gap: 3px;
	width: max-content; padding: 4px; border: 1px solid color-mix(in srgb, var(--gh-border-default) 82%, transparent);
	border-radius: 999px; background: color-mix(in srgb, var(--gh-bg-raised) 91%, transparent);
	box-shadow: 0 10px 28px rgba(20,13,10,.18), inset 0 1px color-mix(in srgb,#fff 18%,transparent);
	backdrop-filter: blur(16px) saturate(1.2); transform: translateY(2px); opacity: .88;
	transition: opacity .18s ease, transform .24s cubic-bezier(.2,.8,.2,1), border-color .18s ease;
}
.gh-pet.is-right:not(.is-dragged) .gh-pet-toolbar,
.gh-pet.is-dragged.is-near-right .gh-pet-toolbar { left: auto; right: 0; }
.gh-pet:hover .gh-pet-toolbar,
.gh-pet:focus-within .gh-pet-toolbar { opacity: 1; transform: translateY(0); border-color: var(--gh-accent-border); }
.gh-pet-toolbar button {
	position: relative; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 0;
	border-radius: 50%; color: var(--gh-text-secondary); background: transparent; cursor: pointer;
	transition: color .16s ease, background-color .16s ease, transform .18s cubic-bezier(.2,.8,.2,1);
}
.gh-pet-toolbar button:hover,
.gh-pet-toolbar button:focus-visible { color: var(--gh-accent-on-solid); background: var(--gh-accent-solid); transform: translateY(-2px) scale(1.06); outline: none; }
.gh-pet-toolbar button:focus-visible { box-shadow: 0 0 0 3px var(--gh-accent-surface); }
.gh-pet-toolbar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.gh-pet-toolbar [data-pet-tip]::after {
	content: attr(data-pet-tip); position: absolute; left: 50%; bottom: calc(100% + 9px); padding: 4px 7px;
	border: 1px solid var(--gh-border-default); border-radius: 7px; color: var(--gh-text-primary); background: var(--gh-bg-raised);
	box-shadow: var(--gh-shadow-2); font: 750 9px/1.4 var(--gh-font-family); white-space: nowrap;
	transform: translate(-50%,4px); opacity: 0; visibility: hidden; pointer-events: none; transition: .15s ease;
}
.gh-pet-toolbar [data-pet-tip]:hover::after,
.gh-pet-toolbar [data-pet-tip]:focus-visible::after { transform: translate(-50%,0); opacity: 1; visibility: visible; }
.gh-pet.is-hovering .gh-pet-character { filter: drop-shadow(0 16px 16px rgba(0,0,0,.2)) brightness(1.04); }
.gh-pet.is-hovering .gh-pet-face { background-color: color-mix(in srgb,var(--screen) 90%,#fff); }
.gh-pet.is-hovering .gh-pet-stars { animation: gh-pet-hover-spark .9s steps(3,end); }
@keyframes gh-pet-hover-spark { 20%,70% { opacity: 1; transform: translate(-8px,-12px) rotate(90deg) scale(1.25); } }

@media (max-width: 640px) {
	.gh-pet-bubble { min-width: 156px; max-width: min(238px, calc(100vw - 20px)); padding: 9px; }
	.gh-pet-quick-actions :is(a,button) { flex: 1 1 auto; min-height: 32px; padding: 5px 7px; }
	.gh-pet-toolbar { bottom: -25px; padding: 3px; gap: 2px; }
	.gh-pet-toolbar button { width: 27px; height: 27px; }
	.gh-pet-toolbar [data-pet-tip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.gh-pet.is-thinking :is(.gh-pet-antenna,.gh-pet-stars), .gh-pet.is-hovering .gh-pet-stars { animation: none; }
	.gh-pet-toolbar, .gh-pet-toolbar button { transition: none; }
}
