.affina-chatbot-page {
    padding: 32px 0 64px;
}

.affina-chatbot-shell {
    max-width: 980px;
    margin: 0 auto;
}

.affina-chatbot-hero {
    margin-bottom: 20px;
}

.affina-chatbot-kicker {
    margin: 0 0 8px;
    color: #f755ff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.affina-chatbot-hero h1 {
    margin: 0 0 12px;
    color: #17131a;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.05;
}

.affina-chatbot-hero p {
    margin: 0;
    max-width: 720px;
    color: #5f5968;
    font-size: 18px;
    line-height: 1.6;
}

.affina-chatbot-widget {
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 22px 70px rgba(30, 41, 59, 0.08);
    overflow: hidden;
}

.affina-chatbot-tabs {
    display: flex;
    gap: 24px;
    padding: 0 28px;
    border-bottom: 1px solid #e5e7eb;
}

.affina-chatbot-tab {
    position: relative;
    padding: 18px 0 16px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 16px;
    font-weight: 700;
}

.affina-chatbot-tab.is-active {
    color: #2563eb;
}

.affina-chatbot-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: #2563eb;
}

.affina-chatbot-panel {
    padding: 24px 28px 28px;
}

.affina-chatbot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.affina-chatbot-field {
    margin-bottom: 18px;
}

.affina-chatbot-field label {
    display: inline-block;
    margin-bottom: 10px;
    color: #374151;
    font-size: 15px;
    font-weight: 700;
}

.affina-chatbot-required {
    color: #ef4444;
}

.affina-chatbot-control {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    line-height: 1.5;
    outline: none;
}

.affina-chatbot-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.affina-chatbot-control::placeholder {
    color: #9ca3af;
}

.affina-chatbot-control--textarea {
    min-height: 68px;
    resize: vertical;
}

.affina-chatbot-actions {
    display: flex;
    justify-content: flex-end;
}

.affina-chatbot-actions--recommend {
    justify-content: flex-start;
}

.affina-chatbot-submit {
    min-width: 148px;
    padding: 12px 20px;
    border: 0;
    border-radius: 12px;
    background: #4f7df3;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.affina-chatbot-submit:disabled {
    opacity: 0.65;
}

.affina-chatbot-recommend-result {
    display: none;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.affina-chatbot-recommend-result.has-content {
    display: block;
}

.affina-chatbot-recommend-result-inner {
    color: #111827;
    font-size: 16px;
    line-height: 1.8;
}

.affina-chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 320px;
    max-height: 56vh;
    margin-bottom: 18px;
    overflow-y: auto;
}

.affina-chatbot-message {
    display: flex;
}

.affina-chatbot-message.is-user {
    justify-content: flex-end;
}

.affina-chatbot-bubble {
    max-width: min(720px, 88%);
    padding: 15px 17px;
    border-radius: 18px;
    color: #17131a;
    font-size: 16px;
    line-height: 1.7;
}

.affina-chatbot-message.is-bot .affina-chatbot-bubble {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.affina-chatbot-welcome {
    display: grid;
    gap: 12px;
    line-height: 1.3;
}

.affina-chatbot-welcome p {
    margin: 0;
}

.affina-chatbot-message.is-user .affina-chatbot-bubble {
    border: 1px solid #DBE5FF;
    background: #F8FBFF;
    color: #2A65FF;
    box-shadow: none;
}

.affina-chatbot-loading-animation {
    width: 120px;
    height: 120px;
    background: transparent url("../images/chatbot-loading-240.gif") center / contain no-repeat;
}

.affina-chatbot-loading-rive {
    display: block;
    width: 120px;
    height: 120px;
    opacity: 0;
}

.affina-chatbot-loading-animation.has-rive-animation {
    background-image: none;
}

.affina-chatbot-loading-animation.has-rive-animation .affina-chatbot-loading-rive {
    opacity: 1;
}

.affina-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
}

.affina-chatbot-followups {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    max-width: min(720px, 88%);
}

.affina-chatbot-suggestions[hidden] {
    display: none;
}

.affina-chatbot-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 2px 8px rgba(30, 41, 59, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.affina-chatbot-suggestion:hover,
.affina-chatbot-suggestion:focus-visible {
    border-color: #4F94F1;
    color: #4F94F1;
    box-shadow: 0 0 0 3px rgba(79, 148, 241, 0.12);
    outline: none;
}

.affina-chatbot-suggestion-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #4F94F1;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.affina-chatbot-suggestion-icon circle {
    fill: #4F94F1;
    stroke: none;
}

.affina-chatbot-budget-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.affina-chatbot-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.affina-chatbot-preset-chip {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
}

.affina-chatbot-preset-chip.is-active {
    border-color: #f755ff;
    color: #6b1770;
    background: rgba(247, 85, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(247, 85, 255, 0.1);
}

.affina-chatbot-budget-chip {
    min-height: 38px;
    padding: 8px 12px;
}

.affina-chatbot-budget-chip.is-active {
    border-color: #f755ff;
    color: #6b1770;
    box-shadow: 0 0 0 3px rgba(247, 85, 255, 0.1);
}

.affina-chatbot-followup {
    min-height: 40px;
    padding: 9px 13px;
}

.affina-chatbot-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.affina-chatbot-input {
    width: 100%;
    min-height: 116px;
    padding: 18px 20px;
    border: 1px solid rgba(247, 85, 255, 0.38);
    border-radius: 22px;
    color: #6b1770;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(247, 85, 255, 0.08);
}

.affina-chatbot-input::placeholder {
    color: #b255b8;
}

.affina-chatbot-input:focus {
    border-color: #f755ff;
    box-shadow: 0 0 0 4px rgba(247, 85, 255, 0.12);
}

.affina-chatbot-floating-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-height: 72px;
    padding: 24px 16px 24px 80px;
    border: 1px solid #DBE5FF;
    border-radius: 20px;
    background: linear-gradient(180deg, #F8FBFF 75.56%, #DBE5FF 107.72%);
    color: #2A65FF;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 19px 23.5px rgba(134, 161, 249, 0.24);
}

.affina-chatbot-floating-rive {
    position: absolute;
    left: -28px;
    top: -45px;
    width: 120px;
    height: 120px;
    pointer-events: none;
    opacity: 0;
}

.affina-chatbot-floating-button.has-rive-animation .affina-chatbot-floating-rive {
    opacity: 1;
}

.affina-chatbot-floating-button:hover,
.affina-chatbot-floating-button:focus {
    color: #2A65FF;
    text-decoration: none;
}

.affina-chatbot-footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 18px;
    border: 1px solid rgba(247, 85, 255, 0.32);
    border-radius: 999px;
    color: #a100a9;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.affina-chatbot-footer-link:hover,
.affina-chatbot-footer-link:focus {
    color: #7f0086;
    text-decoration: none;
}

@media (max-width: 767.98px) {
    .affina-chatbot-page {
        padding: 22px 0 42px;
    }

    .affina-chatbot-widget {
        border-radius: 16px;
    }

    .affina-chatbot-tabs {
        gap: 18px;
        padding: 0 16px;
    }

    .affina-chatbot-panel {
        padding: 18px 16px 20px;
    }

    .affina-chatbot-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .affina-chatbot-field {
        margin-bottom: 16px;
    }

    .affina-chatbot-messages {
        min-height: 280px;
        max-height: none;
    }

    .affina-chatbot-bubble {
        max-width: 100%;
        font-size: 15px;
    }

    .affina-chatbot-suggestions {
        gap: 10px;
    }

    .affina-chatbot-suggestion {
        width: 100%;
    }

    .affina-chatbot-followups {
        max-width: 100%;
        gap: 10px;
    }

    .affina-chatbot-actions,
    .affina-chatbot-actions--recommend {
        justify-content: stretch;
    }

    .affina-chatbot-submit {
        width: 100%;
    }

    .affina-chatbot-floating-button {
        right: 8px;
        bottom: 8px;
        min-height: 44px;
        max-width: calc(100vw - 16px);
        padding: 8px 10px 8px 44px;
        border-radius: 12px;
        font-size: 11px;
        line-height: 1.2;
    }

    .affina-chatbot-floating-rive {
        left: -10px;
        top: -18px;
        width: 60px;
        height: 60px;
    }
}
