/* CSS variables for Theme Control */
:root {
    --font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Light Theme (default) */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #191c1d;
    --text-muted: #444651;
    --border-color: rgba(196, 198, 210, 0.4);
    
    --primary-color: #002D72; /* 机构深海蓝 */
    --primary-hover: #001a48;
    --primary-light: #dae2ff;
    
    --secondary-color: #C5A869; /* 财富金 */
    --secondary-light: #fae0a5;
    
    --accent-deposit: #002D72;
    --accent-wealth: #2E7D32;
    --accent-fund: #7c3aed;
    
    --success-bg: rgba(46, 125, 50, 0.08);
    --success-text: #2e7d32;
    
    --shadow-sm: 0 2px 8px rgba(0, 26, 72, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 26, 72, 0.04);
    --shadow-lg: 0 10px 24px rgba(0, 26, 72, 0.08);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-speed: 0.25s;
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(51, 65, 85, 0.5);
    
    --primary-color: #b1c5ff;
    --primary-hover: #dae2ff;
    --primary-light: #002d72;
    
    --secondary-color: #fae0a5;
    --secondary-light: #756233;
    
    --accent-deposit: #b1c5ff;
    --accent-wealth: #34d399;
    --accent-fund: #a78bfa;
    
    --success-bg: #064e3b;
    --success-text: #a7f3d0;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* App Container Layout */
.app-container {
    max-width: 600px; /* Limit width to mobile viewport size on desktop */
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
    position: relative;
}

/* Header */
.app-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.title-sub h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary-color);
}

.sub-title {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: -2px;
}

.theme-toggle-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--transition-speed);
}

.theme-toggle-btn:hover {
    background: var(--border-color);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 69px; /* offset header height */
    z-index: 90;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-speed);
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-size: 11px;
}

/* Main Main Content */
.app-main {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn var(--transition-speed) ease-in-out;
}

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

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* Preset Scenarios */
.preset-scenarios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: var(--font-family);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.preset-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.preset-btn:active {
    transform: scale(0.97);
}

/* Input Area */
.input-area textarea {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    color: var(--text-color);
    font-family: var(--font-family);
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.input-area textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* Buttons */
.primary-btn, .secondary-btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
    transition: all 0.2s;
}

.primary-btn {
    background-color: var(--primary-color);
    color: #ffffff;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background-color: var(--border-color);
}

.secondary-btn:active {
    transform: scale(0.98);
}

/* Loading Overlay */
.loading-overlay {
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.loading-overlay.hidden {
    display: none !important;
}

.loader-box {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-steps {
    list-style: none;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.step {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.step.active {
    color: var(--primary-color);
    font-weight: 600;
}

.step.done {
    color: var(--accent-wealth);
    font-weight: 500;
}

.step.done::after {
    content: " ✓";
    font-weight: bold;
}

/* Profile tags */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}

.profile-tags {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tag-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
}

.tag-item.full-width {
    grid-column: span 2;
}

.tag-label {
    color: var(--text-muted);
    font-weight: 500;
}

.tag-val {
    font-weight: 700;
    color: var(--text-color);
    margin-left: 4px;
}

.tag-val-text {
    font-weight: 500;
    color: var(--text-color);
    display: block;
    margin-top: 2px;
}

/* Risk colors */
.risk-level-c1 { color: var(--accent-deposit) !important; }
.risk-level-c2 { color: var(--accent-wealth) !important; }
.risk-level-c3 { color: var(--secondary-color) !important; }
.risk-level-c4 { color: #e11d48 !important; }
.risk-level-c5 { color: #be123c !important; }

/* Edit form fields */
.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group select, .form-group input {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-color);
    outline: none;
    font-family: var(--font-family);
}

.form-group select:focus, .form-group input:focus {
    border-color: var(--primary-color);
}

.full-width-input {
    width: 100%;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* Recommendations list visual cards */
.section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recommendations-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Card Header highlights */
.prod-head {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.prod-head.type-deposit {
    background: linear-gradient(135deg, #f0f4ff, #e0e8ff);
    color: #002D72;
}
.prod-head.type-wealth {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #14532d;
}
.prod-head.type-fund {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #4c1d95;
}

body.dark-theme .prod-head.type-deposit {
    background: linear-gradient(135deg, #1e293b, #002d72);
    color: #b1c5ff;
}
body.dark-theme .prod-head.type-wealth {
    background: linear-gradient(135deg, #064e3b, #047857);
    color: #a7f3d0;
}
body.dark-theme .prod-head.type-fund {
    background: linear-gradient(135deg, #2e1065, #4c1d95);
    color: #ddd6fe;
}

.prod-name-box {
    display: flex;
    flex-direction: column;
}

.prod-badge {
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
    width: fit-content;
    margin-bottom: 4px;
}

.type-deposit .prod-badge {
    background-color: rgba(0, 45, 114, 0.1);
    color: #002D72;
}
.type-wealth .prod-badge {
    background-color: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}
.type-fund .prod-badge {
    background-color: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

body.dark-theme .type-deposit .prod-badge {
    background-color: rgba(177, 197, 255, 0.2);
    color: #b1c5ff;
}
body.dark-theme .type-wealth .prod-badge {
    background-color: rgba(167, 243, 208, 0.2);
    color: #a7f3d0;
}
body.dark-theme .type-fund .prod-badge {
    background-color: rgba(221, 214, 254, 0.2);
    color: #ddd6fe;
}

.prod-name {
    font-size: 16px;
    font-weight: 700;
}

.match-badge {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    min-width: 60px;
}

.match-badge.type-deposit { color: #002D72; }
.match-badge.type-wealth { color: #2e7d32; }
.match-badge.type-fund { color: #7c3aed; }

body.dark-theme .match-badge.type-deposit { color: #b1c5ff; }
body.dark-theme .match-badge.type-wealth { color: #a7f3d0; }
body.dark-theme .match-badge.type-fund { color: #ddd6fe; }

.match-score-text {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
}

.match-label {
    font-size: 8px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Product specs body */
.prod-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.prod-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.grid-cell {
    display: flex;
    flex-direction: column;
}

.cell-lbl {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.cell-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.cell-val.highlight-rate {
    font-size: 22px;
    color: #d32f2f;
    font-weight: 700;
    letter-spacing: -0.01em;
}

body.dark-theme .cell-val.highlight-rate {
    color: #f87171;
}

.prod-desc-box {
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.desc-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
}

.desc-val {
    font-size: 12px;
    color: var(--text-muted);
}

/* Accordion scripts folder */
.prod-footer {
    background-color: var(--card-bg);
}

.accordion-toggle {
    background: none;
    border: none;
    width: 100%;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
}

.accordion-arrow {
    transition: transform 0.2s;
}

.accordion-arrow.open {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 0 16px 16px 16px;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.2s ease-out;
}

.accordion-content.open {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1000px; }
}

/* Script items styling */
.script-item {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    position: relative;
    background-color: var(--bg-color);
}

.script-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.script-txt {
    font-size: 12.5px;
    color: var(--text-color);
    padding-right: 32px;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.1s;
}

.copy-btn:hover {
    background-color: var(--border-color);
    color: var(--primary-color);
}

.copy-btn:active {
    transform: scale(0.9);
}

/* Tab 2: Product Search UI */
.filter-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-bar-container {
    display: flex;
    gap: 8px;
}

.search-bar-container input {
    flex: 1;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-color);
    outline: none;
    font-family: var(--font-family);
}

.search-bar-container input:focus {
    border-color: var(--primary-color);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.filter-chips {
    display: flex;
    gap: 6px;
}

.chip {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 3px 12px;
    font-size: 11px;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}

.chip.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

#search-risk-select {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-color);
    outline: none;
}

.results-header-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Simple list item card in browser */
.list-item-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.li-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.li-badge-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.li-type-badge {
    font-size: 9px;
    font-weight: 700;
    color: #ffffff;
    padding: 1px 6px;
    border-radius: 8px;
}

.li-type-badge.存款 { background-color: var(--accent-deposit); }
.li-type-badge.理财 { background-color: var(--accent-wealth); }
.li-type-badge.基金 { background-color: var(--accent-fund); }

.li-risk-badge {
    font-size: 9px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.li-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-color);
}

.li-specs {
    font-size: 11px;
    color: var(--text-muted);
}

.li-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.li-rate {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

.li-rate-lbl {
    font-size: 9px;
    color: var(--text-muted);
}

/* History tab timeline */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.history-item:active {
    transform: scale(0.99);
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
}

.history-time {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.history-profile-tags {
    display: flex;
    gap: 4px;
}

.hist-tag {
    font-size: 9px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
}

.hist-tag.risk-tag {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.history-snippet {
    font-size: 12.5px;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-products-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hist-prod-pill {
    font-size: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 12px;
    color: var(--text-muted);
}

/* Toast styling */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(30, 41, 59, 0.95);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Footer disclaimer */
.app-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    text-align: center;
    margin-top: auto;
}

.app-footer p {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Loader btn spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Enriched Fund styling */
.enriched-fund-details {
    margin-top: 12px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.2s ease-out;
}

.fund-spec-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.fund-spec-item {
    display: flex;
    flex-direction: column;
}

.spec-lbl {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.spec-val {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-color);
}

.up-red {
    color: #e11d48 !important; /* Red for gain */
}

.down-green {
    color: #10b981 !important; /* Green for loss */
}

.fund-yields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 2px 0;
}

.yield-badge {
    font-size: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 600;
    color: var(--text-muted);
}

.fund-stocks-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    border: 1px solid var(--border-color);
}

.stocks-lbl {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-color);
}

.stocks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.stock-pill {
    font-size: 9px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2px 8px;
    color: var(--text-color);
    font-weight: 500;
}

/* Clickable search items */
.list-item-card.expandable {
    cursor: pointer;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    transition: border-color var(--transition-speed);
}

.list-item-card.expandable:hover {
    border-color: var(--primary-color);
}

.li-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.li-expand-indicator {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Pagination Controls */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-color);
}

.page-indicator {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Compliance Highlight & Banner */
.compliance-highlight {
    background-color: rgba(239, 68, 68, 0.12);
    color: #ef4444 !important;
    font-weight: 700;
    border-bottom: 2px dashed #ef4444;
    padding: 1px 4px;
    border-radius: 4px;
    font-style: normal;
    display: inline-block;
}

body.dark-theme .compliance-highlight {
    background-color: rgba(248, 113, 113, 0.18);
    color: #f87171 !important;
    border-bottom-color: #f87171;
}

.compliance-banner {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12px;
    color: #991b1b;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    line-height: 1.4;
    animation: shake 0.5s ease-in-out;
}

body.dark-theme .compliance-banner {
    background-color: #451b1b;
    border-color: #7f1d1d;
    color: #fca5a5;
}

.compliance-banner-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Fund Purchase Suggestions Styles */
.advice-section-card {
    border-left: 4px solid var(--secondary-color);
}

.advice-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advice-sub-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 8px;
    margin-top: 6px;
    margin-bottom: 2px;
}

.advice-text {
    font-size: 12.5px;
    color: var(--text-color);
    line-height: 1.5;
}

/* 1. Metric Grid */
.advice-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 6px 0;
}

.advice-metric-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary-color);
}

.metric-lbl {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* 2. Theme Chips */
.theme-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.theme-chip {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
}

/* 3. Alloc Box */
.fund-type-allocation {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.alloc-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.alloc-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.alloc-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 4. Strategy Steps */
.strategy-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.strategy-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-num {
    background-color: var(--primary-color);
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: var(--shadow-sm);
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-body h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
}

.step-body p {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 5. Manager Grid & Cards */
.manager-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manager-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s;
}

.manager-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.manager-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
}

.m-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.badge-active {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.badge-process {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
}

.badge-batch {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.manager-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.company-name {
    color: var(--text-muted);
    font-weight: 500;
}

.fund-tag {
    color: var(--primary-color);
    font-weight: 600;
}

.manager-card.highlight-bond {
    border-left: 3px solid var(--accent-wealth);
}

.manager-card.highlight-process {
    border-left: 3px solid var(--secondary-color);
}

