<style>
    /* Comparison table */
    .comparison-table-wrap { overflow-x: auto; margin: 16px 0; }
    .comparison-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
    .comparison-table th { background: var(--primary-xlight); color: var(--primary-dark); padding: 10px 12px; text-align: left; font-weight: 700; position: sticky; top: 0; }
    .comparison-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
    .comparison-table .metric-label { font-weight: 600; color: var(--text); }
    .comparison-table .best-value { background: #d1fae5; color: #065f46; font-weight: 700; }
    [data-theme="dark"] .comparison-table .best-value { background: #064e3b; color: #6ee7b7; }
    .best-badge { color: #f59e0b; font-size: 0.8em; }
    .comparison-verdict { margin-top: 16px; padding: 16px; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border); }
    .verdict-item { padding: 6px 0; display: flex; justify-content: space-between; }
    .empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
    .saved-list { max-height: 200px; overflow-y: auto; }
    .scenario-pills { display: flex; flex-wrap: wrap; gap: 8px; }
    .scenario-pill { padding: 6px 12px; background: var(--primary-xlight); color: var(--primary-dark); border-radius: 16px; cursor: pointer; font-size: 0.85rem; }
    .scenario-pill:hover { background: var(--primary); color: white; }

    /* Summary Cards */
    .summary-cards { display: flex; flex-direction: column; gap: 12px; }
    .summary-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--bg); border-radius: 8px; }
    .sc-icon { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
    .checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
    .checkbox-group label { display: flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg); border-radius: 6px; font-size: 0.85rem; cursor: pointer; }

    /* Amortization table */
    .amort-table-wrap { overflow-x: auto; margin: 12px 0; }
    .amort-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
    .amort-table th { background: var(--bg); padding: 6px 8px; text-align: right; font-weight: 600; border-bottom: 2px solid var(--border); }
    .amort-table td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--border); }
    .amort-table th:first-child, .amort-table td:first-child { text-align: center; }
    .amort-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
    .amort-stat { text-align: center; padding: 12px; background: var(--bg); border-radius: 8px; }
    .amort-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
    .amort-value { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text); }

    /* DSCR card */
    .dscr-card { padding: 16px; background: var(--bg); border-radius: 8px; margin: 8px 0; }
    .dscr-main { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
    .dscr-label { font-size: 1rem; font-weight: 600; color: var(--text); }
    .dscr-value { font-size: 1.5rem; font-weight: 800; }
    .dscr-band { display: flex; align-items: center; gap: 10px; }
    .dscr-band-badge { padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
    .dscr-band-desc { font-size: 0.82rem; color: var(--text-muted); }

    /* Break-Even */
    .breakeven-card { padding: 16px; background: var(--bg); border-radius: 8px; }
    .be-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
    .be-item { padding: 12px; border-radius: 8px; border: 1px solid var(--border); }
    .be-item.safe { border-left: 4px solid #10b981; }
    .be-item.danger { border-left: 4px solid #ef4444; }
    .be-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
    .be-value { display: block; font-size: 1.15rem; font-weight: 700; color: var(--text); }
    .be-delta { display: block; font-size: 0.82rem; margin-top: 4px; color: var(--text-light); }
    .be-item.safe .be-delta { color: #059669; }
    .be-item.danger .be-delta { color: #dc2626; }

    /* Max Offer */
    .max-offer-result { padding: 20px; border-radius: 10px; margin: 16px 0; }
    .max-offer-result.targets-met { background: #d1fae5; border: 1px solid #6ee7b7; }
    .max-offer-result.targets-missed { background: #fef3c7; border: 1px solid #fcd34d; }
    [data-theme="dark"] .max-offer-result.targets-met { background: #064e3b; border-color: #059669; }
    [data-theme="dark"] .max-offer-result.targets-missed { background: #78350f; border-color: #d97706; }
    .mo-header { text-align: center; margin-bottom: 16px; }
    .mo-price { display: block; font-size: 2rem; font-weight: 900; color: var(--text); margin: 8px 0; }
    .mo-status { display: block; font-size: 0.85rem; font-weight: 600; }
    .targets-met .mo-status { color: #059669; }
    .targets-missed .mo-status { color: #d97706; }
    .mo-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
    .mo-metric { padding: 10px; background: var(--bg); border-radius: 6px; text-align: center; }
    .mo-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
    .mo-value { display: block; font-size: 1.05rem; font-weight: 700; color: var(--text); }
    .mo-value.positive { color: #059669; }
    .mo-value.negative { color: #dc2626; }
    .mo-value small { font-size: 0.75rem; font-weight: 400; color: var(--text-light); }

    /* Loan Compare */
    .loan-compare-table-wrap { overflow-x: auto; margin: 16px 0; }
    .loan-compare-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
    .loan-compare-table th { background: var(--primary-xlight); color: var(--primary-dark); padding: 10px; text-align: center; font-weight: 700; }
    .loan-compare-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); }
    .loan-compare-table td:first-child { text-align: left; font-weight: 600; }
    .highlight-row td { background: var(--bg); font-weight: 700; }
    .metric-value { color: var(--primary); font-weight: 700; }
    .loan-verdict { margin-top: 16px; padding: 16px; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border); }
    .loan-verdict p { margin: 4px 0; }

    /* Rent vs Sell */
    .rent-vs-sell-result { margin: 16px 0; }
    .rvs-verdict { padding: 16px 20px; background: var(--bg); border-radius: 8px; margin-bottom: 16px; display: flex; flex-direction: column; }
    .rvs-recommendation { font-size: 1.3rem; font-weight: 800; }
    .rvs-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
    .rvs-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    @media (max-width: 640px) { .rvs-columns { grid-template-columns: 1fr; } }
    .rvs-col { padding: 16px; border-radius: 8px; border: 1px solid var(--border); }
    .sell-col { background: #fef2f2; }
    .rent-col { background: #f0fdf4; }
    [data-theme="dark"] .sell-col { background: #450a0a; }
    [data-theme="dark"] .rent-col { background: #052e16; }
    .rvs-col h4 { margin: 0 0 12px 0; font-size: 0.95rem; font-weight: 700; }
    .rvs-metric { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; border-bottom: 1px solid rgba(0,0,0,0.05); }
    [data-theme="dark"] .rvs-metric { border-bottom-color: rgba(255,255,255,0.05); }
    .rvs-metric.highlight { font-weight: 700; font-size: 0.9rem; border-bottom: none; padding-top: 10px; margin-top: 4px; border-top: 2px solid var(--border); }
    .rvs-metric .positive { color: #059669; }
    .rvs-metric .negative { color: #dc2626; }

    /* Analysis details (expandable) */
    .analysis-details { margin: 12px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .analysis-details summary { padding: 12px 16px; background: var(--bg); cursor: pointer; font-weight: 600; font-size: 0.92rem; user-select: none; }
    .analysis-details summary:hover { background: var(--primary-xlight); }
    .analysis-details[open] summary { border-bottom: 1px solid var(--border); }

    /* Placeholder */
    .placeholder-card { text-align: center; padding: 40px 16px; color: var(--text-muted); background: var(--bg); border-radius: 8px; }
    .placeholder-card p { margin: 8px 0; }

    /* Panel header */
    .panel-header { text-align: center; padding: 20px 16px 16px; }
    .panel-header h2 { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; color: var(--text); }
    .panel-subtitle { font-size: 0.9rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }
  </style>