/* ==========================================================================
   Maya Floating Chatbot Widget
   ========================================================================== */

/* Maya-powered button — signals "this opens Maya, not a page" */
.btn.btn-maya {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-color: #6d28d9;
    color: #fff;
    transition: all 0.2s ease;
}
.btn.btn-maya:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    border-color: #5b21b6;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.btn.btn-maya i {
    width: 16px;
    height: 16px;
}

/* Bubble */
.maya-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    z-index: 9998;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.maya-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.maya-bubble.open {
    transform: scale(0);
    pointer-events: none;
}

.maya-bubble i {
    width: 24px;
    height: 24px;
}

/* Badge */
.maya-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--error, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--background, #fff);
}

.maya-badge:empty,
.maya-badge[data-count="0"] {
    display: none;
}

/* Panel */
.maya-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 560px;
    max-height: calc(100vh - 48px);
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.maya-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Panel header */
.maya-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    flex-shrink: 0;
}

.maya-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.maya-panel-header h3 i,
.maya-panel-header h3 svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

#maya-header-title {
    color: #fff;
}

.maya-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.maya-panel-clear,
.maya-panel-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    transition: color 0.2s;
}

.maya-panel-clear:hover,
.maya-panel-close:hover {
    color: #fff;
}

.maya-panel-clear i,
.maya-panel-close i {
    width: 16px;
    height: 16px;
}

/* Insights bar */
.maya-insights-bar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-shrink: 0;
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-secondary, #f9fafb);
}

.maya-insight-chip {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-sm, 4px);
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.maya-insight-chip:last-child {
    margin-bottom: 0;
}

.maya-insight-chip-text {
    flex: 1;
    color: var(--text-primary);
}

.maya-insight-chip-priority {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.maya-insight-chip-priority.critical { background: #fef2f2; color: #dc2626; }
.maya-insight-chip-priority.high { background: #fef3c7; color: #92400e; }
.maya-insight-chip-priority.medium { background: var(--bg-secondary); color: var(--text-secondary); }
.maya-insight-chip-priority.low { background: var(--bg-secondary); color: var(--text-tertiary); }

.maya-insight-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.maya-insight-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--text-muted, #9ca3af);
    border-radius: 3px;
    transition: color 0.2s, background 0.2s;
}

.maya-insight-actions button:hover {
    color: var(--text-primary);
    background: var(--bg-secondary, #f3f4f6);
}

.maya-insight-actions button i {
    width: 14px;
    height: 14px;
}

/* Messages area */
.maya-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maya-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 90%;
    animation: mayaFadeIn 0.2s ease;
}

@keyframes mayaFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.maya-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.maya-msg--assistant {
    align-self: flex-start;
}

.maya-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
}

.maya-msg-avatar--pm {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.maya-msg-avatar--user {
    background: var(--primary, #FFC400);
    color: var(--text-primary, #1f2937);
}

.maya-msg-avatar--user i {
    width: 14px;
    height: 14px;
}

.maya-msg-bubble {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
    word-wrap: break-word;
}

.maya-msg--user .maya-msg-bubble {
    background: var(--primary, #FFC400);
    border-color: var(--primary, #FFC400);
    color: #000;
}

.maya-msg-bubble p {
    margin: 0 0 8px 0;
}

.maya-msg-bubble p:last-child {
    margin-bottom: 0;
}

/* Typing indicator */
.maya-typing {
    display: none;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    padding: 0 16px;  /* Match .maya-messages padding for avatar alignment */
    margin-bottom: 12px;  /* Space above input area divider */
}

.maya-typing.active {
    display: flex;
}

.maya-typing-dots {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 8px);
}

.maya-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #9ca3af);
    animation: mayaTypingBounce 1.4s infinite;
}

.maya-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.maya-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes mayaTypingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Quick action conversation starters */
.maya-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
}

.maya-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-bg, #fff);
    border: 1px dashed var(--border, #d1d5db);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary, #111827);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.maya-quick-action:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    border-style: solid;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.maya-quick-action i,
.maya-quick-action svg {
    width: 14px;
    height: 14px;
    color: var(--text-secondary, #6b7280);
    transition: color 0.2s ease;
}

.maya-quick-action:hover i,
.maya-quick-action:hover svg {
    color: #fff;
}

.maya-quick-action-text {
    font-weight: 500;
}

/* Input area */
.maya-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border, #e5e7eb);
    flex-shrink: 0;
    background: var(--card-bg, #fff);
}

.maya-input-area textarea {
    flex: 1;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    min-height: 36px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
    background: var(--background, #fff);
    color: var(--text-primary);
    margin-left: 36px;  /* Align with message bubbles: avatar (28px) + gap (8px) */
}

.maya-input-area textarea:focus {
    border-color: #6366f1;
}

.maya-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.maya-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.maya-send-btn i,
.maya-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Insight type badge */
.maya-insight-chip-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #6b7280);
    background: var(--background, #f3f4f6);
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Impact indicator */
.maya-insight-impact {
    color: #f59e0b;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.maya-insight-impact i {
    width: 14px;
    height: 14px;
}

/* Dashboard widget */
.maya-dashboard-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: var(--spacing-lg, 16px);
    margin-bottom: var(--spacing-lg, 16px);
}

.maya-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md, 12px);
}

.maya-dashboard-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.maya-dashboard-header h3 i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary, #6b7280);
}

.maya-dashboard-header a {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
    transition: color 0.2s ease;
}

.maya-dashboard-header a:hover {
    color: var(--text-primary, #111827);
}

.maya-dashboard-row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm, 8px);
    padding: var(--spacing-sm, 8px) 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
    transition: background 0.2s ease;
}

.maya-dashboard-row:last-child {
    border-bottom: none;
}

.maya-dashboard-row:hover {
    background: var(--background, #f9fafb);
    border-radius: 6px;
    padding-left: 4px;
    padding-right: 4px;
}

.maya-dashboard-row-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--background, #f3f4f6);
}

.maya-dashboard-row-icon i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary, #6b7280);
}

.maya-dashboard-row-content {
    flex: 1;
    min-width: 0;
}

.maya-dashboard-row-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 2px;
}

.maya-dashboard-row-rationale {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.maya-dashboard-row-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: center;
}

.maya-dashboard-row-badge.high,
.maya-dashboard-row-badge.critical {
    color: #dc2626;
    background: #fef2f2;
}

.maya-dashboard-row-badge.medium {
    color: #d97706;
    background: #fffbeb;
}

.maya-dashboard-row-badge.low {
    color: #059669;
    background: #ecfdf5;
}

.maya-dashboard-row-action {
    flex-shrink: 0;
    align-self: center;
}

.maya-dashboard-row-action .btn-secondary {
    font-size: 12px;
    padding: 4px 10px;
}

/* Action Cards (from tool use) */
.maya-action-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.maya-action-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--background, #f8f9fa);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    color: var(--primary, #7c3aed);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.maya-action-card:hover {
    background: var(--primary, #7c3aed);
    color: #fff;
    border-color: var(--primary, #7c3aed);
}

.maya-action-card i,
.maya-action-card svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Auto-linked URLs in messages */
.maya-msg-bubble a {
    color: var(--primary, #7c3aed);
    text-decoration: underline;
    text-decoration-style: dotted;
}

.maya-msg-bubble a:hover {
    text-decoration-style: solid;
}

/* Markdown formatting in messages */
.maya-msg-bubble .maya-h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    color: var(--text-primary);
}

.maya-msg-bubble .maya-h3:first-child {
    margin-top: 0;
}

.maya-msg-bubble .maya-h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0 6px 0;
    color: var(--text-primary);
}

.maya-msg-bubble .maya-list {
    margin: 6px 0 10px 0;
    padding-left: 18px;
    list-style-type: disc;
}

.maya-msg-bubble .maya-list li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.maya-msg-bubble .maya-numbered {
    margin: 6px 0;
    padding-left: 4px;
}

.maya-msg-bubble em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Suggestion cards for article reviews */
.maya-suggestion-card {
    background: var(--background, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.maya-suggestion-card.applied {
    opacity: 0.6;
    border-color: var(--success, #10b981);
}

.maya-suggestion-issue {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.maya-suggestion-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.maya-suggestion-before .maya-suggestion-label {
    color: var(--error, #ef4444);
}

.maya-suggestion-after .maya-suggestion-label {
    color: var(--success, #10b981);
}

.maya-suggestion-card blockquote {
    margin: 0 0 10px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--border, #e5e7eb);
    background: var(--card-bg, #fff);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    border-radius: 0 4px 4px 0;
}

.maya-suggestion-before blockquote {
    border-left-color: var(--error, #ef4444);
    text-decoration: line-through;
    opacity: 0.7;
}

.maya-suggestion-after blockquote {
    border-left-color: var(--success, #10b981);
    color: var(--text-primary);
}

.maya-suggestion-apply {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--primary, #FFC400);
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.maya-suggestion-apply:hover {
    background: #e6b000;
    transform: translateY(-1px);
}

.maya-suggestion-apply:disabled {
    background: var(--success, #10b981);
    color: #fff;
    cursor: default;
    transform: none;
}

.maya-suggestion-apply i {
    width: 14px;
    height: 14px;
}

/* Applied state with undo option */
.maya-suggestion-applied-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.maya-suggestion-applied-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success, #10b981);
}

.maya-suggestion-applied-label i {
    width: 14px;
    height: 14px;
}

.maya-suggestion-undo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.maya-suggestion-undo:hover {
    background: var(--background, #f9fafb);
    color: var(--text-primary, #111827);
    border-color: var(--text-secondary, #9ca3af);
}

.maya-suggestion-undo i {
    width: 12px;
    height: 12px;
}

/* Warning when "before" text doesn't exist in article (hallucination detected) */
.maya-suggestion-warning {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--warning, #d97706);
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: 4px;
}

.maya-suggestion-warning i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Sentence-level highlight - precise highlight of the exact text being changed */
.maya-sentence-highlight {
    background: linear-gradient(to bottom, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.3)) !important;
    border-radius: 2px;
    padding: 2px 0;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    animation: maya-sentence-pulse 1.5s ease-in-out infinite;
}

@keyframes maya-sentence-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
}

/* Fallback: paragraph-level highlight when sentence can't be isolated */
.maya-inline-highlight {
    background: rgba(139, 92, 246, 0.08) !important;
    border-left: 3px solid rgba(139, 92, 246, 0.5) !important;
    padding-left: 12px !important;
    margin-left: -15px !important;
    position: relative;
    border-radius: 0 4px 4px 0;
}

/* Replacement popover */
.maya-replacement-popover {
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    overflow: hidden;
    animation: maya-popover-appear 0.2s ease;
}

@keyframes maya-popover-appear {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.maya-popover-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
}

.maya-popover-header:active {
    cursor: grabbing;
}

.maya-popover-drag-handle {
    opacity: 0.7;
    display: flex;
    align-items: center;
    transition: opacity 0.15s;
}

.maya-popover-drag-handle:hover {
    opacity: 1;
}

.maya-popover-drag-handle i,
.maya-popover-drag-handle svg {
    width: 16px;
    height: 16px;
}

.maya-popover-before,
.maya-popover-after {
    padding: 10px 14px;
}

.maya-popover-before {
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.maya-popover-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.maya-popover-before .maya-popover-label {
    color: var(--error, #ef4444);
}

.maya-popover-after .maya-popover-label {
    color: var(--success, #10b981);
}

.maya-popover-text {
    font-size: 13px;
    line-height: 1.55;
    padding: 8px 10px;
    border-radius: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.maya-popover-before .maya-popover-text {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--error, #ef4444);
    text-decoration: line-through;
    color: var(--text-secondary);
}

.maya-popover-after .maya-popover-text {
    background: rgba(16, 185, 129, 0.08);
    border-left: 3px solid var(--success, #10b981);
    color: var(--text-primary);
}

/* Legacy content class for backwards compatibility */
.maya-popover-content {
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    border-left: 3px solid var(--success, #10b981);
    margin: 12px;
    padding-left: 12px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 0 4px 4px 0;
}

.maya-popover-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border, #e5e7eb);
    justify-content: flex-end;
}

.maya-popover-cancel {
    padding: 8px 16px;
    font-size: 13px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.maya-popover-cancel:hover {
    background: #e5e7eb;
}

.maya-popover-accept {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--success, #10b981);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.maya-popover-accept:hover {
    background: #059669;
}

/* History button */
.maya-panel-history {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    transition: color 0.2s;
}

.maya-panel-history:hover {
    color: #fff;
}

.maya-panel-history i {
    width: 16px;
    height: 16px;
}

/* History panel */
.maya-history-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--card-bg, #fff);
}

.maya-history-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-shrink: 0;
}

.maya-history-new {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.maya-history-new:hover {
    opacity: 0.9;
}

.maya-history-new i {
    width: 14px;
    height: 14px;
}

.maya-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.maya-history-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: background 0.2s;
}

.maya-history-item:hover {
    background: var(--bg-secondary, #f3f4f6);
}

.maya-history-item.active {
    background: var(--bg-secondary, #f3f4f6);
    border-left: 3px solid #6366f1;
}

.maya-history-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.maya-history-item-meta {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
}

.maya-history-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
}

/* Mobile */
@media (max-width: 480px) {
    .maya-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 8px;
        height: calc(100vh - 80px);
    }

    .maya-quick-actions {
        gap: 6px;
        padding: 10px 12px;
    }

    .maya-quick-action {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Channel badges in history */
.maya-channel-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    color: #fff;
    background: var(--text-muted, #888);
}
.maya-channel-sms { background: #10b981; }
.maya-channel-whatsapp { background: #25d366; }

/* Continue on web bar */
.maya-continue-web-bar {
    display: flex;
    justify-content: center;
    padding: 16px 0;
    margin-top: 8px;
    border-top: 1px solid var(--border-light, #e5e7eb);
}
.maya-continue-web-btn {
    background: var(--primary, #f5c518);
    color: var(--text-primary, #1a1a2e);
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.maya-continue-web-btn:hover {
    opacity: 0.85;
}
