.hf-ai-root {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9999;
    font-family: Inter, system-ui, sans-serif;
    pointer-events: none;
}

.hf-ai-root > * {
    pointer-events: auto;
}

.hf-ai-launcher {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hf-ai-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.15rem 0.7rem 0.85rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    background: linear-gradient(135deg, #0d9488, #2563eb);
    color: #fff;
    box-shadow: 0 10px 28px rgba(13, 148, 136, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hf-ai-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(13, 148, 136, 0.4), 0 6px 16px rgba(0, 0, 0, 0.18);
}

.hf-ai-fab__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 1rem;
    line-height: 1;
}

.hf-ai-launcher-dismiss {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.18);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    opacity: 0.45;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.hf-ai-launcher:hover .hf-ai-launcher-dismiss,
.hf-ai-launcher-dismiss:hover,
.hf-ai-launcher-dismiss:focus-visible {
    opacity: 0.85;
    background: rgba(15, 23, 42, 0.32);
    color: rgba(255, 255, 255, 0.9);
}

.hf-ai-root[hidden] {
    display: none !important;
}

.hf-ai-root.is-panel-open .hf-ai-launcher {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hf-ai-panel-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hf-ai-panel-brand__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.hf-ai-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(360px, calc(100vw - 2rem));
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0f172a;
    color: #e2e8f0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.hf-ai-panel[hidden] {
    display: none !important;
}

.hf-ai-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hf-ai-close {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(226, 232, 240, 0.4);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.hf-ai-close:hover,
.hf-ai-close:focus-visible {
    color: rgba(226, 232, 240, 0.75);
    background: rgba(255, 255, 255, 0.05);
}

.hf-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hf-ai-msg {
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.45;
    max-width: 95%;
    white-space: pre-wrap;
}

.hf-ai-msg--bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
}

.hf-ai-msg--user {
    align-self: flex-end;
    background: rgba(13, 148, 136, 0.35);
}

.hf-ai-form {
    display: flex;
    gap: 0.35rem;
    padding: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hf-ai-form input[type="text"] {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #1e293b;
    color: #fff;
    padding: 0.5rem 0.85rem;
}

.hf-ai-send {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
}

.hf-ai-send:hover {
    filter: brightness(1.06);
}

.hf-ai-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.65rem 0.65rem;
}

.hf-ai-quick {
    font-size: 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #cbd5e1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.hf-ai-hide-widget {
    width: 100%;
    margin-top: 0.15rem;
    font-size: 0.68rem;
    border: none;
    background: transparent;
    color: rgba(148, 163, 184, 0.45);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(148, 163, 184, 0.25);
}

.hf-ai-hide-widget:hover,
.hf-ai-hide-widget:focus-visible {
    color: rgba(148, 163, 184, 0.75);
    text-decoration-color: rgba(148, 163, 184, 0.45);
}

@media (max-width: 480px) {
    .hf-ai-root {
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
    }

    .hf-ai-fab__label {
        display: none;
    }

    .hf-ai-fab {
        padding: 0.65rem;
        border-radius: 50%;
        width: 3.25rem;
        height: 3.25rem;
        justify-content: center;
    }
}

.hf-ai-alerts {
    margin: 0;
    padding-left: 1.1rem;
}

.hf-ai-builder label {
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.hf-ai-builder-block {
    margin: 1rem 0;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px dashed var(--admin-border, #cbd5e1);
}

.hf-ai-builder-block h3 {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.hf-ai-builder-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hf-ai-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}
