/* Channel badge (Web / LINE / etc.) shown in the Session cell */
.raplsaich-channel-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.02em;
    vertical-align: middle;
    white-space: nowrap;
}
.raplsaich-channel-web {
    background: #e3f2fd;
    color: #0d47a1;
}
.raplsaich-channel-line {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Conversations admin: prevent cell content from overflowing into siblings.
   Without this, the screenshot badge in Msgs and the long email/name in
   Lead can visually collide on narrow viewports. */
.raplsaich-admin .wp-list-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.raplsaich-admin .raplsaich-lead-info {
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.raplsaich-admin .raplsaich-lead-info a {
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Handoff badges */
.raplsaich-handoff-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.raplsaich-handoff-badge--pending {
    background: #fff3e0;
    color: #e65100;
}
.raplsaich-handoff-badge--active {
    background: #e8f5e9;
    color: #2e7d32;
}
.raplsaich-handoff-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e65100;
    animation: raplsaich-pulse 1.5s ease-in-out infinite;
}
.raplsaich-handoff-dot--active {
    background: #2e7d32;
}
@keyframes raplsaich-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.raplsaich-screenshot-badge {
    display: inline-block;
    margin-left: 4px;
    font-size: 14px;
    vertical-align: middle;
    cursor: help;
}

/* Message metadata */
.raplsaich-msg-meta {
    display: inline-flex;
    gap: 6px;
    margin-top: 4px;
}
.raplsaich-msg-meta-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.4;
    background: #f0f0f1;
    color: #50575e;
}
.raplsaich-msg-meta-badge.cached {
    background: #dff0d8;
    color: #3c763d;
}
.raplsaich-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.raplsaich-modal-header h2 {
    flex: 0 0 auto;
}
.raplsaich-modal-header-actions {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.raplsaich-modal-header .raplsaich-modal-close {
    flex: 0 0 auto;
}
.raplsaich-operator-reply {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
    align-items: flex-end;
}
.raplsaich-operator-reply textarea {
    flex: 1;
    resize: vertical;
    min-height: 36px;
    max-height: 120px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.raplsaich-operator-reply .button {
    flex: 0 0 auto;
    height: 36px;
}
.raplsaich-message.message-operator {
    background: #e8f0fe !important;
    border-left: 3px solid #1a73e8 !important;
}
.raplsaich-operator-role-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    background: #1a73e8;
    color: #fff;
    margin-left: 6px;
}

/*
 * Start Page column — a compact "URL" button that opens the originating
 * page in a new tab. The cell is given a small fixed width so the column
 * never competes for horizontal space with Status. Full URL is preserved
 * in the link's title/aria-label attributes for hover and screen-reader.
 */
table.wp-list-table td.raplsaich-col-page-url {
    text-align: center;
}
table.wp-list-table td.raplsaich-col-page-url .button {
    padding: 0 8px;
    min-height: 24px;
    line-height: 22px;
}
