/* RefBite floating help assistance */
.rb-help {
    --rbh-ink: #1c1410;
    --rbh-muted: #6f6258;
    --rbh-accent: #c2410c;
    --rbh-accent-deep: #9a3412;
    --rbh-surface: #fffcf8;
    --rbh-line: #e6ddd3;
    --rbh-green: #166534;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    font-family: 'Source Sans 3', 'DM Sans', system-ui, sans-serif;
}

.rb-help-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0.65rem 1.05rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--rbh-accent) 0%, var(--rbh-accent-deep) 100%);
    color: #fff7ed;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(154, 52, 18, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rb-help-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(154, 52, 18, 0.42);
}

.rb-help-fab-ico {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 247, 237, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.rb-help.is-open .rb-help-fab-label-closed { display: none; }
.rb-help:not(.is-open) .rb-help-fab-label-open { display: none; }

.rb-help-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.65rem);
    width: min(360px, calc(100vw - 1.5rem));
    max-height: min(520px, calc(100dvh - 6rem));
    display: flex;
    flex-direction: column;
    background: var(--rbh-surface);
    color: var(--rbh-ink);
    border: 1px solid var(--rbh-line);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(28, 20, 16, 0.22);
    overflow: hidden;
}

.rb-help-panel[hidden] {
    display: none !important;
}

.rb-help-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(135deg, #1c1410 0%, #3f342c 100%);
    color: #fff7ed;
}

.rb-help-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.rb-help-head p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    opacity: 0.85;
    line-height: 1.35;
}

.rb-help-close {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.rb-help-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #f7f2ec;
    min-height: 220px;
    max-height: 320px;
}

.rb-help-bubble {
    max-width: 92%;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.rb-help-bubble--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--rbh-line);
    color: var(--rbh-ink);
    border-bottom-left-radius: 4px;
}

.rb-help-bubble--user {
    align-self: flex-end;
    background: var(--rbh-accent);
    color: #fff7ed;
    border-bottom-right-radius: 4px;
}

.rb-help-bubble a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.rb-help-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.85rem 0.55rem;
    background: #f7f2ec;
    max-height: 7.5rem;
    overflow-y: auto;
}

.rb-help-chip {
    appearance: none;
    border: 1px solid var(--rbh-line);
    background: #fff;
    color: var(--rbh-ink);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    cursor: pointer;
}

.rb-help-chip:hover {
    border-color: #fdba74;
    background: #fff7ed;
    color: var(--rbh-accent-deep);
}

.rb-help-form {
    display: flex;
    gap: 0.4rem;
    padding: 0.65rem;
    border-top: 1px solid var(--rbh-line);
    background: #fff;
}

.rb-help-form input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1.5px solid var(--rbh-line);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    font-size: 0.9rem;
}

.rb-help-form input:focus {
    outline: none;
    border-color: var(--rbh-accent);
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.rb-help-send {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    background: var(--rbh-accent);
    color: #fff7ed;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

.rb-help-send:hover {
    background: var(--rbh-accent-deep);
}

.rb-help-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    background: #ecfdf5;
    color: var(--rbh-green);
    font-weight: 800;
    text-decoration: none;
    border: 1px solid #a7f3d0;
}

@media (max-width: 480px) {
    .rb-help {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .rb-help-panel {
        width: min(100vw - 1.25rem, 360px);
    }

    .rb-help-fab-text {
        display: none;
    }

    .rb-help-fab {
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
        border-radius: 999px;
    }

    .rb-help-fab-ico {
        width: 1.5rem;
        height: 1.5rem;
    }
}
