.ai-helper-button {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 12px 35px rgba(37, 99, 235, .35);
}

.ai-helper-panel {
    position: fixed;
    right: 22px;
    bottom: 92px;
    width: min(390px, calc(100% - 28px));
    max-height: 72vh;
    display: none;
    flex-direction: column;
    background: #10141d;
    border: 1px solid #2b3444;
    border-radius: 18px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 24px 70px rgba(0,0,0,.48);
}

.ai-helper-panel.open {
    display: flex;
}

.ai-helper-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #252c38;
}

.ai-helper-title {
    font-weight: 800;
    font-size: 18px;
}

.ai-helper-subtitle {
    color: #8791a4;
    font-size: 13px;
    margin-top: 3px;
}

.ai-helper-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.ai-helper-body {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
}

.ai-helper-message {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 10px;
    line-height: 1.45;
    font-size: 14px;
}

.ai-helper-message.bot {
    background: #18202c;
    color: #e9edf5;
}

.ai-helper-message.user {
    background: #2563eb;
    color: #fff;
    margin-left: 34px;
}

.ai-helper-copy {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 12px 0 4px;
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: #7cf7ca;
    color: #07110d;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.ai-helper-copy[hidden], .ai-helper-copy-error[hidden] { display: none; }
.ai-helper-copy:disabled { opacity: .8; cursor: default; }
.ai-helper-copy-error { color: #ffb7b7; font-size: 13px; line-height: 1.4; }

.ai-helper-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.ai-helper-quick button {
    border: 1px solid #334155;
    background: #151b25;
    color: #dce3ef;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
}

.ai-helper-input {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    padding: 12px;
    background: #10141d;
    border-top: 1px solid #252c38;
}

.ai-helper-input input {
    flex: 1;
    min-width: 0;
    background: #0c1017;
    color: #fff;
    border: 1px solid #303949;
    border-radius: 12px;
    padding: 11px 12px;
    outline: none;
}

.ai-helper-input button {
    border: 0;
    background: #2563eb;
    color: #fff;
    border-radius: 12px;
    padding: 0 15px;
    cursor: pointer;
    font-weight: 700;
}

@media (max-width: 700px) {
    .ai-helper-button {
        right: 14px;
        bottom: 14px;
    }

    .ai-helper-panel {
        right: 14px;
        bottom: 82px;
        max-height: 70vh;
    }
}

/* AI HELPER — INPUT FINAL FIX */
.ai-helper-input {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
}

.ai-helper-input #ai-helper-text {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 52px !important;
    display: block !important;
    padding: 0 16px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
}

.ai-helper-input #ai-helper-send {
    flex: 0 0 52px !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
}

/* Bilingual prompts: preserve paragraphs and contain long words on mobile. */
.ai-helper-panel, .ai-helper-panel * { box-sizing: border-box; }
.ai-helper-message { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.ai-helper-copy { white-space: normal; overflow-wrap: anywhere; }
