/* The site helper (16 Oct 2026): a chat bubble in the bottom-right of every
   page. Self-contained (theme tokens with fallbacks), every class starts with
   cubh- so neither the theme overlay nor a page's own CSS can reach it. */
.cubh-launch {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 8900;
    display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 6px;
    border-radius: 999px; cursor: pointer;
    background: linear-gradient(180deg, #16181e, #0c0d11); color: var(--cub-text, #dfe2e6);
    border: 1px solid rgba(165, 15, 18, .65);
    box-shadow: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04) inset, 0 0 18px rgba(165,15,18,.25);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    font: 600 .82rem/1 var(--cub-sans, Inter, system-ui, sans-serif); letter-spacing: .01em;
}
.cubh-launch:hover { transform: translateY(-2px); border-color: var(--cub-red-bright, #d10a10);
    box-shadow: 0 16px 38px rgba(0,0,0,.65), 0 0 24px rgba(209,10,16,.35); }
.cubh-launch:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cubh-av { position: relative; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
    background: #0a0b0e url('/static/images/favicon-192.png?v=bear3') center / 112% no-repeat; }
.cubh-av::after { content: ''; position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--cub-green, #3f9e63); box-shadow: 0 0 0 2px #0c0d11; }
.cubh-label { white-space: nowrap; }
.cubh-label small { display: block; margin-top: 3px; font: 500 .62rem/1 var(--cub-mono, monospace); letter-spacing: .14em; text-transform: uppercase; color: var(--cub-muted, #6b737e); }
.cubh-xmark { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; font-size: 1.1rem; }
.cubh-open .cubh-launch { padding: 0 6px; }
.cubh-open .cubh-av, .cubh-open .cubh-label { display: none; }
.cubh-open .cubh-xmark { display: inline-flex; }

.cubh-panel {
    position: fixed; right: 1.25rem; bottom: calc(1.25rem + 64px); z-index: 8901;
    width: min(400px, calc(100vw - 2rem)); height: min(600px, calc(100vh - 7rem)); height: min(600px, calc(100dvh - 7rem));
    display: none; flex-direction: column; overflow: hidden;
    background: var(--cub-panel, #0e1013); border: 1px solid var(--cub-line, #1e2228);
    box-shadow: 0 30px 80px rgba(0,0,0,.65);
    color: var(--cub-text, #dfe2e6); font: 400 14px/1.55 var(--cub-sans, Inter, system-ui, sans-serif);
}
.cubh-open .cubh-panel { display: flex; }
.cubh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--cub-line, #1e2228); background: #0a0b0e; }
.cubh-head b { display: block; font: 700 .78rem/1.2 var(--cub-mono, monospace); letter-spacing: .16em; text-transform: uppercase; }
.cubh-head small { display: block; color: var(--cub-muted, #6b737e); font: .66rem/1.3 var(--cub-mono, monospace); letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.cubh-head small i { color: var(--cub-green, #3f9e63); font-style: normal; }
.cubh-head small i::before { content: '● '; }
.cubh-x, .cubh-new { background: none; border: 1px solid var(--cub-line, #1e2228); color: var(--cub-text-dim, #98a0aa); cursor: pointer; padding: 5px 8px; font: .7rem var(--cub-mono, monospace); letter-spacing: .1em; text-transform: uppercase; }
.cubh-x:hover, .cubh-new:hover { color: #fff; border-color: var(--cub-red, #a50f12); }
.cubh-head-btns { display: flex; gap: 6px; }

.cubh-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.cubh-me { align-self: flex-end; max-width: 85%; background: var(--cub-red, #a50f12); color: #fff; padding: 8px 12px; word-wrap: break-word; }
.cubh-bot { align-self: flex-start; max-width: 95%; background: #121419; border: 1px solid var(--cub-line, #1e2228); border-left: 2px solid var(--cub-red, #a50f12); padding: 10px 12px; }
.cubh-bot h4 { margin: 0 0 6px; font-size: .92rem; color: var(--cub-text, #dfe2e6); }
.cubh-bot p { margin: 0 0 8px; color: var(--cub-text-dim, #b6bcc4); }
.cubh-bot p:last-child { margin-bottom: 0; }
.cubh-bot ul, .cubh-bot ol { margin: 0 0 8px; padding-left: 18px; color: var(--cub-text-dim, #b6bcc4); }
.cubh-bot li { margin: 2px 0; }
.cubh-bot code { font: .82em var(--cub-mono, monospace); background: rgba(255,255,255,.06); padding: 1px 5px; color: #fff; }
.cubh-bot strong { color: #fff; }
.cubh-links, .cubh-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cubh-links a { font: .7rem var(--cub-mono, monospace); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: #fff; background: var(--cub-red, #a50f12); padding: 6px 9px; }
.cubh-links a:hover { background: var(--cub-red-bright, #d10a10); }
.cubh-opts button, .cubh-sugg button { cursor: pointer; text-align: left; background: transparent; color: var(--cub-text, #dfe2e6); border: 1px solid var(--cub-line, #2a2f37); padding: 6px 9px; font: .8rem/1.3 var(--cub-sans, Inter, sans-serif); }
.cubh-opts button:hover, .cubh-sugg button:hover { border-color: var(--cub-red, #a50f12); background: rgba(165,15,18,.12); }
.cubh-also { margin-top: 10px; font-size: .76rem; color: var(--cub-muted, #6b737e); }
.cubh-also .cubh-opts { margin-top: 5px; }
.cubh-live { margin: 8px 0 0; padding: 8px 10px; background: #0b0c0f; border: 1px solid var(--cub-line, #1e2228); font: .76rem/1.5 var(--cub-mono, monospace); }
.cubh-live .ok { color: var(--cub-green, #3f9e63); }
.cubh-live .bad { color: #ff8a8e; }
.cubh-fb { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--cub-line, #1e2228); font: .72rem var(--cub-mono, monospace); color: var(--cub-muted, #6b737e); display: flex; align-items: center; gap: 6px; }
.cubh-fb button { cursor: pointer; background: transparent; border: 1px solid var(--cub-line, #2a2f37); padding: 2px 7px; font-size: .85rem; line-height: 1.3; }
.cubh-fb button:hover { border-color: var(--cub-red, #a50f12); background: rgba(165,15,18,.12); }
.cubh-group { margin-top: 12px; }
.cubh-group-t { font: 600 .66rem var(--cub-mono, monospace); letter-spacing: .14em; text-transform: uppercase; color: var(--cub-muted, #6b737e); margin-bottom: 6px; }
.cubh-chips { margin-top: 0; gap: 5px; }
.cubh-chips button { font-size: .76rem; padding: 5px 8px; }
.cubh-sugg { display: flex; flex-direction: column; gap: 6px; }
.cubh-typing { align-self: flex-start; color: var(--cub-muted, #6b737e); font: .74rem var(--cub-mono, monospace); letter-spacing: .1em; }

.cubh-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--cub-line, #1e2228); background: #0a0b0e; }
.cubh-form input { flex: 1; min-width: 0; background: var(--cub-void, #08090b); border: 1px solid var(--cub-line, #1e2228); color: var(--cub-text, #dfe2e6); padding: 10px 11px; font: 14px var(--cub-sans, Inter, sans-serif); }
.cubh-form input:focus { outline: 1px solid var(--cub-red, #a50f12); border-color: var(--cub-red, #a50f12); }
.cubh-form button { background: var(--cub-red, #a50f12); color: #fff; border: 0; padding: 0 14px; cursor: pointer; font: 700 .72rem var(--cub-mono, monospace); letter-spacing: .12em; text-transform: uppercase; }
.cubh-form button:hover { background: var(--cub-red-bright, #d10a10); }
.cubh-foot { padding: 6px 12px 9px; font: .66rem var(--cub-mono, monospace); color: var(--cub-muted, #6b737e); letter-spacing: .06em; background: #0a0b0e; }
.cubh-foot a { color: var(--cub-text-dim, #98a0aa); }

/* The coffee button shared the bottom-right corner; it moves to the bottom-left
   (the cookie button that sat there is gone, 16 Oct 2026). */
.cubh-on .bmac-float { right: auto !important; left: 1.25rem !important; bottom: 1.25rem !important; }

@media (max-width: 560px) {
    .cubh-launch { padding: 0 6px; }
    .cubh-label { display: none; }
    .cubh-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 88vh; height: 88dvh; border-left: 0; border-right: 0; }
    .cubh-open .cubh-launch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cubh-launch { transition: none; }
}
@media print { .cubh-launch, .cubh-panel { display: none !important; } }
