.pablo-widget {
    --pablo-forest: #244c37;
    --pablo-ink: #1e2520;
    --pablo-muted: #515e54;
    --pablo-layer: 25; /* Above navigation (21), below site editing overlays (30). */
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--pablo-keyboard-inset, 0px));
    z-index: var(--pablo-layer);
    color: var(--pablo-ink);
    font: 400 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pablo-widget [hidden] { display: none !important; }
.pablo-widget button, .pablo-widget textarea { font: inherit; }
.pablo-widget button { cursor: pointer; }
.pablo-widget button:disabled { cursor: default; opacity: .55; }
.pablo-widget :is(button, textarea, a):focus-visible { outline: 3px solid #bd762f; outline-offset: 3px; }
.pablo-widget__launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 17px 10px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--pablo-forest);
    color: white;
    box-shadow: 0 3px 8px #102a2033;
    font-weight: 650 !important;
    transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.pablo-widget__launcher:hover { background: #173725; transform: translateY(-2px); }
.pablo-widget__avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #e8eddf; color: #244c37; font: italic 600 25px/1 Georgia, serif; }
.pablo-widget__panel {
    display: flex;
    flex-direction: column;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(var(--pablo-visible-height, 100dvh) - 40px);
    border: 1px solid #b8c4b7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    animation: pablo-open 180ms ease-out;
}
.pablo-widget__header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--pablo-forest); color: #fff; }
.pablo-widget__header h2 { margin: 0; font: 650 18px/1.3 system-ui, sans-serif; letter-spacing: 0; }
.pablo-widget__header p { margin: 2px 0 0; font-size: 12px; color: #e1ebde; }
.pablo-widget__close { margin-left: auto; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 30px !important; border-radius: 6px; }
.pablo-widget__close:hover { background: #ffffff20; }
.pablo-widget__conversation { flex: 1; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; padding: 18px; scroll-behavior: smooth; }
.pablo-widget__message { padding: 12px 14px; margin: 0 24px 14px 0; border-radius: 3px 12px 12px; background: #eef2eb; overflow-wrap: anywhere; }
.pablo-widget__message strong { font-size: 12px; }
.pablo-widget__message p { margin: 5px 0 0; white-space: pre-wrap; }
.pablo-widget__message a { color: #244c37; text-decoration: underline; font-weight: 650; }
.pablo-widget__message--user { margin-left: 24px; margin-right: 0; border-radius: 12px 3px 12px 12px; background: #244c37; color: #fff; }
.pablo-widget__prompts { display: flex; gap: 8px; padding: 0 18px 12px; flex-wrap: wrap; }
.pablo-widget__prompts button { background: #fff; border: 1px solid #bbc9b8; border-radius: 6px; padding: 9px 11px; color: #244c37; font-size: 13px; min-height: 40px; }
.pablo-widget__prompts button:hover { background: #eef2eb; }
.pablo-widget__form { margin: 0; padding: 12px 18px 8px; border-top: 1px solid #d9ded6; }
.pablo-widget__form label { display: block; font-size: 12px; font-weight: 650; margin: 0 0 6px; }
.pablo-widget__compose { display: flex; align-items: flex-end; gap: 8px; }
.pablo-widget__compose textarea { width: 100%; min-width: 0; height: 64px; max-height: 100px; resize: vertical; border: 1px solid #a7b3a6; border-radius: 6px; padding: 9px; color: #1e2520; background: #fff; font-size: 16px; }
.pablo-widget__compose textarea::placeholder { color: #515e54; }
.pablo-widget__compose button { border: 0; border-radius: 6px; min-width: 44px; min-height: 44px; background: #244c37; color: #fff; font-size: 24px; }
.pablo-widget__compose button:hover:not(:disabled) { background: #173725; }
.pablo-widget__status { font-size: 12px; color: #515e54; margin: 6px 0 0; }
.pablo-widget__status:empty { display: none; }
.pablo-widget__footer { padding: 0 18px 12px; font-size: 11px; line-height: 1.45; color: #515e54; }
.pablo-widget__footer p { margin: 4px 0; }
.pablo-widget__footer a, .pablo-widget__footer button { color: #244c37; text-decoration: underline; }
.pablo-widget__footer button { border: 0; background: none; padding: 5px 0; font-size: 12px; min-height: 30px; }
@keyframes pablo-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
    .pablo-widget { right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--pablo-keyboard-inset, 0px)); }
    .pablo-widget__panel { width: calc(100vw - 24px); max-width: none; max-height: calc(var(--pablo-visible-height, 100dvh) - 24px); }
}
@media (prefers-reduced-motion: reduce) {
    .pablo-widget__panel { animation: none; }
    .pablo-widget__launcher { transition: none; }
    .pablo-widget__conversation { scroll-behavior: auto; }
}
