/* PMR AI Retirement Finance & Investment Coach Agent Styles */
.finance-agent-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin: 2.5rem 0;
}

.finance-agent-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #ffffff;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #818cf8;
}

.finance-agent-header .agent-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.finance-agent-header .agent-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.finance-agent-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.finance-agent-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #cbd5e1;
}

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

.finance-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.finance-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
}

.finance-agent-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    min-height: 600px;
    transition: grid-template-columns 0.3s ease;
}

.finance-agent-body.drawer-collapsed {
    grid-template-columns: 1fr 0px;
}

.finance-agent-body.drawer-collapsed .finance-passport-pane {
    display: none;
}

@media (max-width: 900px) {
    .finance-agent-body {
        grid-template-columns: 1fr;
    }
    .finance-agent-body.drawer-collapsed .finance-passport-pane {
        display: none;
    }
}

/* Chat Pane */
.finance-chat-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    height: 640px;
    background: #f8fafc;
    min-width: 0; /* Prevent flex children from overflowing */
}

.finance-agent-body.drawer-collapsed .finance-chat-pane {
    border-right: none;
}

.finance-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.finance-msg {
    display: flex;
    gap: 0.75rem;
    max-width: 96%;
    min-width: 0;
}

.finance-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 90%;
}

.finance-msg.model {
    align-self: flex-start;
    width: 100%;
    max-width: 98%;
}

.finance-msg-bubble {
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.65;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    box-sizing: border-box;
}

.finance-msg.user .finance-msg-bubble {
    background: #4f46e5;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.finance-msg.model .finance-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
    overflow-x: auto;
}

.finance-msg-bubble p {
    margin: 0 0 0.75rem 0;
}
.finance-msg-bubble p:last-child {
    margin-bottom: 0;
}

.finance-msg-bubble ul, .finance-msg-bubble ol {
    margin: 0.5rem 0 0.75rem 0;
    padding-left: 1.5rem;
}

.finance-msg-bubble li {
    margin-bottom: 0.35rem;
}

.finance-msg-bubble pre, .finance-msg-bubble code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}

.finance-msg-bubble pre {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.finance-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.finance-chat-input-box {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.finance-quick-prompts {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.finance-quick-btn {
    white-space: nowrap;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.finance-quick-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.finance-input-row {
    display: flex;
    gap: 0.75rem;
}

.finance-input-row input {
    flex: 1;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.finance-input-row input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.finance-input-row button {
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.finance-input-row button:hover {
    background: #4338ca;
}

.finance-disclaimer-strip {
    font-size: 0.725rem;
    color: #64748b;
    text-align: center;
    background: #f8fafc;
    padding: 0.4rem 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Financial Passport Side Panel */
.finance-passport-pane {
    padding: 1.5rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 580px;
    overflow-y: auto;
}

.finance-passport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.finance-passport-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.finance-metric-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.finance-metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.finance-metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.finance-metric-sub {
    font-size: 0.75rem;
    color: #4f46e5;
}

.finance-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.finance-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.725rem;
    font-weight: 500;
}
