.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #00bcd4;
    color: white;
    border: none;
    font-size: 22px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .chat-fab:hover {
        background: #0097a7;
        transform: scale(1.05);
    }


/* ── Conversation scroll area ───────────────────────────────── */
.chat-blade-body {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 12px;
}

/* ── Input footer ───────────────────────────────────────────── */
.chat-blade-footer {
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-blade-textarea {
    flex: 1;
    resize: none;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}

.chat-blade-textarea:focus {
    border-color: #00bcd4;
}

.chat-blade-send {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #00bcd4;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-blade-send:hover {
    background: #0097a7;
}

.chat-blade-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ── Full-page header (AgentChatPage only) ──────────────────── */
.chat-blade-header {
    padding: 14px 16px;
    background: #152e4d;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-blade-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.chat-blade-actions {
    display: flex;
    gap: 6px;
}

.chat-blade-actions button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.chat-blade-actions button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* ── Message bubbles ────────────────────────────────────────── */
.chat-bubble-user {
    background: #00bcd4;
    color: white;
    padding: 10px 14px;
    border-radius: 12px 12px 0 12px;
    max-width: 70%;
    align-self: flex-end;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.chat-bubble-agent {
    background: white;
    color: #333;
    padding: 10px 14px;
    border-radius: 12px 12px 12px 0;
    max-width: 80%;
    align-self: flex-start;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
}

.chat-bubble-system {
    color: #9e9e9e;
    font-size: 11px;
    align-self: flex-start;
    padding: 2px 0;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Rich content (tables and headings from markdown) ───────── */
.chat-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #152e4d;
    margin: 10px 0 4px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #00bcd4;
}

.chat-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin: 6px 0;
}

.chat-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.chat-data-table thead th {
    background: #152e4d;
    color: #ffffff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 2px solid #0e2240;
}

.chat-data-table tbody td {
    padding: 7px 12px;
    border-bottom: 1px solid #eef1f5;
}

.chat-data-table tbody tr:hover {
    background: #e6f7f9;
}

/* ── Links inside chat bubbles and tables ──────────────────── */
.chat-bubble-agent a {
    color: #0077cc;
    text-decoration: underline;
    text-decoration-color: rgba(0, 119, 204, 0.4);
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color 0.15s, text-decoration-color 0.15s;
}

.chat-bubble-agent a:hover {
    color: #005fa3;
    text-decoration-color: #005fa3;
}

.chat-data-table a {
    color: #0077cc;
    text-decoration: none;
    font-weight: 600;
}

.chat-data-table a:hover {
    text-decoration: underline;
    color: #005fa3;
}
