.cellresrobot-host {
    --robot-primary: #31708f;
    --robot-primary-dark: #24566a;
    --robot-border: #d8e2e7;
    --robot-surface: #ffffff;
    --robot-muted: #61727b;
    color: #1f2c33;
    font-family: Arial, Helvetica, sans-serif;
}

.cellresrobot-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--robot-surface);
    border: 1px solid var(--robot-border);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(31, 64, 78, 0.14);
}

.cellresrobot-embedded .cellresrobot-panel {
    width: 100%;
    min-height: 520px;
    max-height: 680px;
}

.cellresrobot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--robot-primary-dark), var(--robot-primary));
}

.cellresrobot-title-wrap {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.cellresrobot-title {
    font-size: 17px;
    line-height: 1.3;
}

.cellresrobot-subtitle {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
}

.cellresrobot-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cellresrobot-clear,
.cellresrobot-close {
    padding: 5px 8px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    cursor: pointer;
}

.cellresrobot-close {
    width: 31px;
    font-size: 20px;
    line-height: 19px;
}

.cellresrobot-messages {
    flex: 1;
    min-height: 250px;
    padding: 16px;
    overflow-y: auto;
    background: #f6f9fa;
}

.cellresrobot-message-row {
    display: flex;
    margin: 0 0 12px;
}

.cellresrobot-message-user {
    justify-content: flex-end;
}

.cellresrobot-bubble {
    max-width: 86%;
    padding: 10px 12px;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    border: 1px solid var(--robot-border);
    border-radius: 4px 12px 12px 12px;
    line-height: 1.52;
}

.cellresrobot-message-user .cellresrobot-bubble {
    color: #fff;
    background: var(--robot-primary);
    border-color: var(--robot-primary);
    border-radius: 12px 4px 12px 12px;
}

.cellresrobot-message-error .cellresrobot-bubble {
    color: #8a2c2c;
    background: #fff2f2;
    border-color: #e6bcbc;
}

.cellresrobot-bubble a {
    color: #116f99;
    text-decoration: underline;
}

.cellresrobot-examples {
    display: flex;
    gap: 6px;
    padding: 10px 12px 4px;
    overflow-x: auto;
    background: #fff;
}

.cellresrobot-example {
    flex: 0 0 auto;
    max-width: 260px;
    padding: 6px 9px;
    color: var(--robot-primary-dark);
    text-align: left;
    background: #eef6f8;
    border: 1px solid #cce0e7;
    border-radius: 14px;
    cursor: pointer;
    font-size: 11px;
}

.cellresrobot-status {
    min-height: 23px;
    padding: 4px 14px;
    color: var(--robot-muted);
    background: #fff;
    font-size: 11px;
}

.cellresrobot-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #fff;
    border-top: 1px solid #edf1f3;
}

.cellresrobot-input {
    flex: 1;
    min-height: 46px;
    max-height: 130px;
    padding: 10px;
    resize: vertical;
    border: 1px solid #b9cbd3;
    border-radius: 8px;
    outline: none;
    font: inherit;
}

.cellresrobot-input:focus {
    border-color: var(--robot-primary);
    box-shadow: 0 0 0 2px rgba(49, 112, 143, 0.12);
}

.cellresrobot-send {
    min-width: 72px;
    height: 42px;
    padding: 0 14px;
    color: #fff;
    background: var(--robot-primary);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.cellresrobot-send:disabled {
    cursor: wait;
    opacity: 0.65;
}

.cellresrobot-floating {
    position: relative;
    z-index: 1000;
}

.cellresrobot-floating .cellresrobot-launcher {
    width: 52px;
    height: 52px;
    color: #fff;
    background: linear-gradient(135deg, var(--robot-primary-dark), var(--robot-primary));
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(31, 64, 78, 0.28);
    cursor: pointer;
    font-weight: bold;
}

.cellresrobot-floating .cellresrobot-launcher.cellresrobot-hidden {
    visibility: hidden;
}

.cellresrobot-floating .cellresrobot-panel {
    display: none;
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: min(430px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 48px));
    z-index: 1001;
}

.cellresrobot-floating .cellresrobot-panel.cellresrobot-open {
    display: flex;
}

@media (max-width: 640px) {
    .cellresrobot-embedded .cellresrobot-panel {
        min-height: 560px;
    }

    .cellresrobot-floating .cellresrobot-panel {
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }

    .cellresrobot-examples {
        padding-bottom: 6px;
    }

    .cellresrobot-bubble {
        max-width: 94%;
    }
}

