/* ═══════════════════════════════════════════════════
   JX Claims Intelligence — Premium Dark Theme
   ═══════════════════════════════════════════════════ */

:root {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-glass: rgba(0, 0, 0, 0.02);
    --border: #e2e8f0;
    --border-active: rgba(102, 126, 234, 0.5);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-blue: #667eea;
    --accent-purple: #764ba2;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.06);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.06);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    padding: 6px;
}

.logo svg { stroke: white; }

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Layout ── */
.app-container {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    height: calc(100vh - 57px);
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.25rem;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

.pipeline-steps { display: flex; flex-direction: column; }

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.step[data-status="active"] {
    background: var(--info-bg);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.step[data-status="complete"] .step-indicator {
    background: var(--success);
    border-color: var(--success);
}

.step[data-status="active"] .step-indicator {
    background: var(--accent-gradient);
    border-color: var(--accent-blue);
    animation: pulse 1.5s infinite;
}

.step-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-number {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.step[data-status="active"] .step-number,
.step[data-status="complete"] .step-number {
    color: white;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.step-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.step-connector {
    width: 2px;
    height: 16px;
    background: var(--border);
    margin-left: 19px;
    transition: background 0.3s ease;
}

.step-connector.active { background: var(--accent-blue); }

.quick-claims {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.quick-claim {
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-xs);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.quick-claim:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.quick-claim .qc-id {
    font-weight: 600;
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

.quick-claim .qc-detail {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.quick-claim.completed {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.quick-claim.completed .qc-id {
    color: #16A34A;
}

.quick-claim.completed .qc-detail {
    color: #4ADE80;
}

.quick-claim.completed::after {
    content: ' ✓';
    color: #16A34A;
    font-weight: 700;
    font-size: 0.75rem;
}

/* ── Main Content ── */
.main-content {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.input-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.input-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.input-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
}

.input-wrapper label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-wrapper input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-bg);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
}

.btn-ghost:hover { background: var(--bg-glass); }

/* ── Output Area ── */
.output-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    animation: fadeInUp 0.3s ease;
}

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

.event-card.status {
    border-left: 3px solid var(--accent-blue);
    background: var(--info-bg);
}

.event-card.tool-call {
    border-left: 3px solid var(--warning);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.event-card.tool-result {
    border-left: 3px solid var(--success);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
}

.event-card.thinking {
    border-left: 3px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.event-card.final-output {
    border: 1px solid var(--border-active);
    background: rgba(102, 126, 234, 0.05);
}

.event-card.final-output .markdown-content {
    line-height: 1.65;
}

.event-card.final-output h2 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.event-card.final-output h3 {
    font-size: 0.95rem;
    margin: 0.8rem 0 0.4rem;
    color: var(--text-primary);
}

.event-card.final-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.8rem;
}

.event-card.final-output th,
.event-card.final-output td {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    text-align: left;
}

.event-card.final-output th {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.event-card.final-output td {
    color: var(--text-secondary);
}

.event-card.final-output strong {
    color: var(--text-primary);
}

.event-card.final-output ul, .event-card.final-output ol {
    padding-left: 1.25rem;
    margin: 0.4rem 0;
}

.event-card.final-output li {
    margin: 0.2rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.event-card.final-output pre {
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.75rem;
    margin: 0.5rem 0;
}

.event-card.final-output code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.event-card.error {
    border-left: 3px solid var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

.event-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.event-label .label-icon {
    width: 14px;
    height: 14px;
}

.tool-name {
    color: var(--warning);
    font-weight: 700;
}

/* ── Approval Section ── */
.approval-section {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.approval-card {
    background: #ffffff;
    border: 1px solid var(--border-active);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.approval-icon { font-size: 1.5rem; }

.approval-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.approval-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ── Loading Spinner ── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── Database Panel ── */
.db-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.db-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.db-tab {
    flex: 1;
    padding: 0.6rem 0.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.db-tab:hover { color: var(--text-secondary); }

.db-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.db-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    font-size: 0.72rem;
}

.db-refresh {
    margin: 0.5rem;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
}

.db-table th {
    background: rgba(102, 126, 234, 0.08);
    padding: 0.4rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.6rem;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border);
}

.db-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

.db-table tr:hover td {
    color: var(--text-secondary);
    background: var(--bg-glass);
}

@keyframes highlightFade {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

.db-table tr.new-record td {
    animation: highlightFade 4s ease-out;
    border-bottom: 2px solid var(--success);
    color: var(--text-primary);
    font-weight: 500;
}

.db-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.db-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 200px 1fr 260px;
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar, .db-panel {
        display: none;
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ── Agent label badges ── */
.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-badge.rca {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.agent-badge.execution {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

/* ── Intro Screen Overlay ── */
/* ── Intro / Landing Screen ─────────────────────────────────────── */
.intro-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(140deg, #EBF4FF 0%, #F0F9FF 55%, #E0F2FE 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 0 6%;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

.intro-content {
    width: 100%;
    max-width: 1280px;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    animation: fadeInUp 0.5s ease;
}

.intro-header { text-align: left; }

.intro-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0077B6;
    background: #DBEAFE;
    padding: 0.3rem 0.85rem;
    border-radius: 2rem;
    margin-bottom: 0.65rem;
}

.intro-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1E3A5F;
    margin: 0 0 0.3rem 0;
    line-height: 1.2;
}

.intro-tagline {
    font-size: 0.9rem;
    color: #4A6785;
    margin: 0;
}

.intro-sections {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
}

.intro-section {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border-top: 3px solid;
    box-shadow: 0 2px 10px rgba(0, 60, 120, 0.07);
}

.intro-section.problem        { border-top-color: #EF4444; }
.intro-section.solution       { border-top-color: #10B981; }
.intro-section.implementation { border-top-color: #0077B6; }

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.section-icon { font-size: 1rem; }

.section-header h2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #1E3A5F;
    margin: 0;
}

.section-context {
    font-size: 0.8rem;
    color: #4A6785;
    margin: 0 0 0.65rem 0;
    line-height: 1.55;
}

.intro-section ul {
    list-style: none;
    padding: 0; margin: 0;
}

.intro-section ul li {
    font-size: 0.8rem;
    color: #1E3A5F;
    padding: 0.25rem 0 0.25rem 1.1rem;
    position: relative;
    line-height: 1.45;
}

.intro-section ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #0077B6;
    font-size: 0.72rem;
    top: 0.28rem;
}

.agent-item {
    background: #F0F7FF;
    border-radius: 7px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.6rem;
}

.agent-item:last-child { margin-bottom: 0; }

.agent-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1E3A5F;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.agent-item p {
    font-size: 0.77rem;
    color: #4A6785;
    line-height: 1.5;
    margin: 0;
}

.intro-cta { text-align: left; }

.intro-note {
    margin-top: 0.65rem;
    font-size: 0.75rem;
    color: #4A6785;
    line-height: 1.55;
}

.btn-enter {
    background: #0077B6;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 7px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-enter:hover {
    background: #023E8A;
    transform: translateY(-1px);
}

/* ── Metrics Card ── */
.metrics-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    border: 1px dashed var(--accent-blue);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 0.25rem;
    animation: fadeInUp 0.4s ease;
    background: rgba(102, 126, 234, 0.05);
}

.metric {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.metric strong {
    color: var(--text-primary);
}

.metric-icon {
    font-size: 1.1rem;
}

/* ── Claim Queue ───────────────────────────────────────────────── */
.countdown-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-left: 4px solid #0077B6;
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    margin-top: 1rem;
    font-size: 0.88rem;
    color: #1E3A5F;
    animation: fadeInUp 0.3s ease;
}

.btn-cancel-queue {
    background: transparent;
    border: 1px solid #93C5FD;
    color: #0077B6;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 1rem;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.btn-cancel-queue:hover {
    background: #DBEAFE;
}

.final-metrics {
    border-top: 3px solid #0077B6;
    background: #F0F7FF;
}

.final-metrics-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1E3A5F;
    margin-bottom: 0.5rem;
}

/* ── Payer Voice Call Panel ── */
.payer-call-panel {
    border: 1.5px solid #0077B6;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    overflow: hidden;
    margin-top: 0.5rem;
    animation: fadeInUp 0.4s ease;
}

.call-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: #0077B6;
    color: white;
}

.call-icon {
    font-size: 1.4rem;
}

.call-meta {
    flex: 1;
}

.call-title {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
}

.call-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
}

.call-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
    animation: pulse 1.5s infinite;
}

.call-transcript {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.call-turn {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.call-speaker {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1E3A5F;
    opacity: 0.75;
}

.call-bubble {
    padding: 0.65rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #1E3A5F;
    max-width: 90%;
}

.rca-bubble {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
    align-self: flex-start;
}

.payer-bubble {
    background: #dcfce7;
    border-left: 3px solid #16a34a;
    align-self: flex-start;
}

.call-audio-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.btn-play-audio {
    font-size: 0.72rem;
    padding: 0.25rem 0.7rem;
    border-radius: 2rem;
    border: 1px solid #0077B6;
    background: white;
    color: #0077B6;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-play-audio:hover {
    background: #0077B6;
    color: white;
}

.call-footer {
    padding: 0.6rem 1.25rem;
    background: rgba(0, 119, 182, 0.08);
    font-size: 0.75rem;
    color: #0077B6;
    font-weight: 500;
    border-top: 1px solid rgba(0, 119, 182, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-continue-call {
    background: #0077B6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-continue-call:hover {
    background: #005f92;
}

/* ── Ringing / calling state ── */
.payer-call-ringing .call-header {
    background: #1a5276;
    animation: headerPulse 1.2s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% { background: #1a5276; }
    50%       { background: #0077B6; }
}

.ringing-dot {
    background: #facc15 !important;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35) !important;
    animation: ringDotPulse 0.6s ease-in-out infinite !important;
}

@keyframes ringDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.6; }
}

.call-icon-ringing {
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    20%       { transform: rotate(-15deg); }
    40%       { transform: rotate(15deg); }
    60%       { transform: rotate(-10deg); }
    80%       { transform: rotate(10deg); }
}

.call-connecting {
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.ringing-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 32px;
}

.ring-bar {
    display: inline-block;
    width: 6px;
    border-radius: 3px;
    background: #0077B6;
    animation: barBounce 0.8s ease-in-out infinite;
}
.ring-bar:nth-child(1) { animation-delay: 0s;    height: 12px; }
.ring-bar:nth-child(2) { animation-delay: 0.1s;  height: 20px; }
.ring-bar:nth-child(3) { animation-delay: 0.2s;  height: 28px; }
.ring-bar:nth-child(4) { animation-delay: 0.3s;  height: 20px; }
.ring-bar:nth-child(5) { animation-delay: 0.4s;  height: 12px; }

@keyframes barBounce {
    0%, 100% { transform: scaleY(1);   opacity: 0.5; }
    50%       { transform: scaleY(1.8); opacity: 1;   }
}

.ringing-label {
    font-size: 0.82rem;
    color: #1E3A5F;
    font-weight: 500;
    opacity: 0.8;
}
