.me-ai-help-button {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2500;
    display: none;
    align-items: center;
    gap: 6px;
    border: 1px solid #dbe6ef;
    border-radius: 999px;
    padding: 12px 16px;
    background: #fff;
    color: #172033;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.14), 0 1px 4px rgba(15, 23, 42, 0.1);
    cursor: pointer;
}

body.me-ai-results-ready .me-ai-help-button {
    display: inline-flex;
}

.me-ai-help-button:hover {
    border-color: #c7d7e6;
    background: #f8fafc;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.1);
}

.me-ai-help-button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transform: translateY(-2px);
}

.me-ai-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 2490;
    width: min(420px, 100vw);
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -8px 0 22px rgba(15, 23, 42, 0.055);
    display: none;
    flex-direction: column;
}

body.me-ai-chat-open .me-ai-panel {
    display: flex;
}

body.me-ai-chat-open .me-ai-help-button {
    display: none;
}

@media (min-width: 901px) and (max-width: 1199px) {
    body.me-ai-chat-open .me-ai-panel {
        width: clamp(360px, 42vw, 400px);
    }
}

@media (min-width: 1200px) {
    body.me-ai-chat-open {
        padding-right: clamp(390px, 32vw, 430px);
        transition: padding-right 0.18s ease;
    }

    body.me-ai-chat-open .me-ai-panel {
        width: clamp(390px, 32vw, 430px);
    }
}

.me-ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    box-sizing: border-box;
}

.me-ai-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #172033;
    font-size: 15px;
    font-weight: 900;
}

.me-ai-panel-title img {
    width: 24px;
    height: 24px;
    transform: translateY(-2px);
}

.me-ai-panel-actions {
    display: inline-flex;
    gap: 6px;
}

.me-ai-icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.me-ai-icon-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.me-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.me-ai-message {
    max-width: 92%;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #263449;
    word-break: break-word;
}

.me-ai-message.user {
    align-self: flex-end;
    background: #4cb476;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.me-ai-message.assistant {
    align-self: flex-start;
    background: #ededed;
    border: 1px solid #e7edf4;
    border-bottom-left-radius: 5px;
}

.me-ai-message.loading {
    color: #64748b;
}

.me-ai-thinking {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.me-ai-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-top-color: #334155;
    border-radius: 999px;
    box-sizing: border-box;
    animation: me-ai-spin 0.75s linear infinite;
}

@keyframes me-ai-spin {
    to {
        transform: rotate(360deg);
    }
}

.me-ai-message p {
    margin: 0 0 8px;
}

.me-ai-message p:last-child,
.me-ai-message ul:last-child,
.me-ai-message ol:last-child {
    margin-bottom: 0;
}

.me-ai-message ul,
.me-ai-message ol {
    margin: 6px 0 8px 18px;
    padding: 0;
}

.me-ai-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 8px 0 10px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #fff;
}

.me-ai-table-wrap table {
    width: 100%;
    min-width: 360px;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.35;
}

.me-ai-table-wrap th,
.me-ai-table-wrap td {
    border-bottom: 1px solid #e5edf5;
    border-right: 1px solid #e5edf5;
    padding: 7px 8px;
    vertical-align: top;
    text-align: left;
}

.me-ai-table-wrap th:last-child,
.me-ai-table-wrap td:last-child {
    border-right: 0;
}

.me-ai-table-wrap tr:last-child td {
    border-bottom: 0;
}

.me-ai-table-wrap th {
    background: #f8fafc;
    color: #172033;
    font-weight: 800;
}

.me-ai-candidate-card,
.me-ai-search-card {
    width: 100%;
    border: 1px solid #dbe6ef;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    color: #263449;
    box-sizing: border-box;
    margin: 8px 0 0;
}

.me-ai-candidate-card:hover,
.me-ai-search-card:hover {
    border-color: #4cb476;
    box-shadow: 0 6px 16px rgba(76, 180, 118, 0.12);
}

.me-ai-candidate-card + div,
.me-ai-search-card + div {
    margin-top: 12px;
}

.me-ai-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: 900;
    color: #172033;
}

.me-ai-card-note {
    margin-top: 6px;
    font-size: 13px;
    color: #475569;
    line-height: 1.35;
}

.me-ai-satisfaction {
    width: 100%;
    max-width: 92%;
    box-sizing: border-box;
}

.me-ai-satisfaction-title {
    font-size: 14px;
    font-weight: 700;
    color: #263449;
    margin-bottom: 9px;
}

.me-ai-satisfaction-actions {
    display: flex;
    gap: 8px;
}

.me-ai-satisfaction-actions button {
    border: 1px solid #cfdbe7;
    background: #fff;
    color: #263449;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.me-ai-satisfaction-actions button:hover {
    border-color: #4cb476;
    color: #2f8450;
}

.me-ai-satisfaction-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.me-ai-composer {
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    background: #fff;
}

.me-ai-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.me-ai-input {
    flex: 1;
    min-height: 42px;
    max-height: 120px;
    resize: none;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
    outline: none;
}

.me-ai-input:focus {
    border-color: #4cb476;
    box-shadow: 0 0 0 3px rgba(76, 180, 118, 0.12);
}

.me-ai-send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.me-ai-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#resultadoBusca .me-ai-highlight {
    background: #f0fbf5 !important;
    border-color: #4cb476 !important;
    box-shadow: 0 0 0 3px rgba(76, 180, 118, 0.22), 0 12px 28px rgba(76, 180, 118, 0.13) !important;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 900px) {
    .me-ai-help-button {
        display: none !important;
    }

    .me-ai-panel {
        display: none !important;
    }

    body.me-ai-chat-open {
        padding-right: 0;
    }
}
