/* ============================================================
   Theme System — v1.22.1
   Default: dark chrome. [data-theme="light"] = light chrome.
   ============================================================ */

:root {
    /* Chrome (header, tab nav, body bg) */
    --chrome-bg:        #0f172a;
    --chrome-bg2:       #1e293b;
    --chrome-border:    rgba(255,255,255,0.06);
    --chrome-text:      #f1f5f9;
    --chrome-text-dim:  #475569;
    --chrome-tab-btn:   rgba(255,255,255,0.05);
    --chrome-tab-hover: rgba(255,255,255,0.09);
    --chrome-tab-color: #64748b;
    --chrome-tab-hover-color: #94a3b8;
    --chrome-tab-border: rgba(255,255,255,0.08);
    --chrome-tab-hover-border: rgba(255,255,255,0.15);
    --body-bg:          #1a1f3a;
    --body-bg2:         #4a1a4a;
    /* Toggle button */
    --toggle-bg:        rgba(255,255,255,0.08);
    --toggle-border:    rgba(255,255,255,0.15);
    --toggle-color:     #94a3b8;
    --toggle-hover-bg:  rgba(255,255,255,0.14);
}

[data-theme="light"] {
    --chrome-bg:        #ffffff;
    --chrome-bg2:       #f8fafc;
    --chrome-border:    rgba(0,0,0,0.08);
    --chrome-text:      #0f172a;
    --chrome-text-dim:  #64748b;
    --chrome-tab-btn:   rgba(0,0,0,0.04);
    --chrome-tab-hover: rgba(0,0,0,0.07);
    --chrome-tab-color: #64748b;
    --chrome-tab-hover-color: #1e293b;
    --chrome-tab-border: rgba(0,0,0,0.08);
    --chrome-tab-hover-border: rgba(0,0,0,0.15);
    --body-bg:          #eef2f7;
    --body-bg2:         #dde3ed;
    --toggle-bg:        rgba(0,0,0,0.05);
    --toggle-border:    rgba(0,0,0,0.12);
    --toggle-color:     #475569;
    --toggle-hover-bg:  rgba(0,0,0,0.09);
}

/* ============================================================
   TFSA Calculator Styles with ETF Portfolio Selection
   ============================================================ */

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

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--body-bg) 0%, var(--body-bg2) 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 0; /* JS sets this dynamically in initApp based on banner heights */
}

/* Fixed banner stack — single fixed container, legal + example stacked inside */
.fixed-banner-stack {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10001;
    display: flex;
    flex-direction: column;
}

/* Legal Warning Banner */
.legal-banner {
    position: relative; /* stacks inside .fixed-banner-stack */
    width: 100%;
    background: #0f172a;
    border-bottom: 1px solid rgba(239,68,68,0.4);
    color: #f1f5f9;
    padding: 10px 20px;
    text-align: center;
    z-index: 10001; /* above everything including app-shell and example banner */
    box-shadow: 0 1px 0 rgba(239,68,68,0.2), 0 4px 16px rgba(0,0,0,0.4);
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.legal-banner-content {
    max-width: 1200px;
    margin: 0 auto;
}

.legal-banner strong {
    font-weight: 700;
    text-transform: uppercase;
}

.legal-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.legal-banner a:hover {
    color: #ffeb3b;
}

/* ==================== Layout ==================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    /* overflow: hidden removed — it creates a stacking context that covers position:fixed elements */
    overflow: visible;
}

/* ==================== Header ==================== */

.header {
    background: linear-gradient(135deg, #1a1f3a 0%, #4a1a4a 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 0.95em;
}

/* Welcome & Guide Section */
.welcome-guide-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
    gap: 15px;
}

.welcome-message {
    color: white;
    font-size: 1.05em;
    font-weight: 500;
    opacity: 0.95;
}

.welcome-guide-section .guide-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.welcome-guide-section .guide-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ==================== Input Section ==================== */

.input-section {
    padding: 40px;
    background: #f8f9fa;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.input-help {
    font-size: 0.85em;
    color: #718096;
    margin-top: 4px;
    font-style: italic;
}

/* Inline Status Badge for Modified Inputs */
.input-status.modified {
    display: block;
    color: #f59e0b;
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 6px;
    padding: 6px 10px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-in;
}

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

/* ==================== V1.6 New Styles ==================== */

/* Return Used Column Styling */
.return-column {
    color: #2e7d32;
    font-weight: 600;
    text-align: center;
    font-size: 0.95em;
}

/* PDF return column - slightly smaller */
.pdf-table-container .return-column {
    font-size: 0.85em;
}

/* ETF Selection Counter Badge */
.etf-count {
    color: #5c6bc0;
    font-size: 0.9em;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Error Message Styling */
.error-message {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    border-left: 5px solid #b71c1c;
}

.error-message::before {
    content: "";
    font-size: 1.2em;
    margin-right: 8px;
}

/* Invalid Input Styling */
.input-error {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2) !important;
    background: #ffebee !important;
}

/* V1.6.1: Annual Limit Validation Styling */
.input-overlimit {
    color: #d32f2f !important;
    border-color: #f44336 !important;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2) !important;
    background: #ffebee !important;
    font-weight: 600;
}

.annual-limit-warning {
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #f57c00;
    border-radius: 6px;
    color: #e65100;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.2);
}

/* Tooltip Icon Styling */
.tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #7986cb 0%, #3f51b5 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 0.75em;
    cursor: help;
    margin-left: 6px;
    font-weight: bold;
}

.tooltip-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.4);
}

/* Annual Usage Tip Styling */
.annual-tip {
    display: block;
    font-size: 0.85em;
    color: #718096;
    margin-top: 6px;
    font-style: italic;
    padding-left: 24px;
}

/* Existing TFSA Fields Container */
.existing-tfsa-fields {
    margin-top: 20px;
    padding: 20px;
    background: #f0f4f8;
    border-radius: 8px;
    border: 2px solid #cbd5e0;
}

/* Share Container Styling */
.share-container {
    margin-top: 30px;
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.share-container h3 {
    margin-bottom: 20px;
    color: #1a1f3a;
    font-size: 1.3em;
}

.share-url-container {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 15px auto;
    align-items: stretch;
}

.share-url-container input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: monospace;
    background: white;
    color: #475569;
}

.share-url-container input[type="text"]:focus {
    outline: none;
    border-color: #10b981;
}

.copy-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.copy-button:active {
    transform: translateY(0);
}

.success-message {
    display: inline-block;
    color: #059669;
    font-weight: 600;
    font-size: 0.95em;
    animation: fadeIn 0.3s ease;
}

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

.share-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Success Message Styling */
.success-message {
    display: inline-block;
    margin-left: 15px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.success-message.show {
    opacity: 1;
}

/* ==================== End V1.6 New Styles ==================== */

/* ==================== V1.6.2: Cap Validation Messages ==================== */

.cap-validation-message {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    display: none;
}

.cap-validation-message::before {
    margin-right: 8px;
    font-size: 1.1em;
}

.cap-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
    color: #856404;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.cap-warning::before {
    content: "";
}

.cap-error {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
    border-left: 4px solid #ff9800;
    color: #e65100;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.cap-error::before {
    content: "";
}

/* ==================== Live Balance Validation ==================== */

/* Valid balance state - green border */
.balance-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15) !important;
    background: #f1f9f3 !important;
}

/* Invalid balance state - red border */
.balance-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
    background: #fff5f5 !important;
}

/* Inline balance validation message */
.balance-validation-message {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    display: none;
    background: linear-gradient(135deg, #ffe0e0 0%, #ffcccc 100%);
    border-left: 4px solid #dc3545;
    color: #721c24;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.balance-validation-message::before {
    content: "";
    margin-right: 8px;
    font-size: 1.1em;
}
}

/* ==================== End V1.6.2 Styles ==================== */

/* ==================== V1.10: Return Realism Warning Styles ==================== */

.return-realism-warning {
    margin-top: 20px;
    padding: 20px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    line-height: 1.6;
}

.return-realism-warning strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 12px;
}

.return-realism-warning p {
    margin: 10px 0;
}

.return-realism-warning ul {
    margin: 12px 0;
    padding-left: 24px;
}

.return-realism-warning li {
    margin: 6px 0;
}

/* High Warning (15-20%) - Yellow/Orange */
.warning-high {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe0b2 100%);
    border-left: 5px solid #ff9800;
    color: #663c00;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.warning-high strong {
    color: #e65100;
}

/* Extreme Warning (20%+) - Red */
.warning-extreme {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 5px solid #f44336;
    color: #c62828;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.warning-extreme strong {
    color: #b71c1c;
}

/* ==================== End V1.10 Styles ==================== */

.input-group input,
.input-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #4a1a4a;
    box-shadow: 0 0 0 3px rgba(74, 26, 74, 0.2);
}

/* ==================== ETF Selection Section ==================== */

.etf-section {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    border-radius: 12px;
    border-left: 5px solid #3f51b5;
}

.etf-section h3 {
    color: #1a237e;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.etf-section > p {
    color: #303f9f;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.etf-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.etf-search-group,
.etf-filter-group,
.return-period-group,
.etf-sort-group {
    display: flex;
    flex-direction: column;
}

.etf-search-group label,
.etf-filter-group label,
.return-period-group label,
.etf-sort-group label {
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.etf-search-group input,
.etf-filter-group select,
.return-period-group select,
.etf-sort-group select {
    padding: 12px 16px;
    border: 2px solid #7986cb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.etf-search-group input:focus,
.etf-filter-group select:focus,
.return-period-group select:focus,
.etf-sort-group select:focus {
    outline: none;
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.2);
}

/* ETF List */
.etf-list-container {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #9fa8da;
}

/* ETF Expand Controls */
.etf-expand-controls {
    text-align: center;
    padding: 15px 0 5px 0;
}

.etf-expand-btn {
    background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.etf-expand-btn:hover {
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

.etf-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.etf-card {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.etf-card:hover {
    border-color: #5c6bc0;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.15);
    transform: translateY(-2px);
}

.etf-card.selected {
    border-color: #3f51b5;
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
}

.etf-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.etf-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-badge {
    background: linear-gradient(135deg, #1a1f3a 0%, #4a1a4a 100%);
    color: white;
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.etf-code {
    font-weight: 700;
    color: #1a237e;
    font-size: 0.95em;
}

.tfsa-badge {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: white;
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.etf-card-name {
    font-size: 0.8em;
    color: #424242;
    margin-bottom: 8px;
    line-height: 1.3;
}

.etf-card-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: #757575;
    margin-bottom: 8px;
}

.etf-card-return {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.etf-card-return .return-label {
    color: #616161;
}

.etf-card-return .return-value {
    font-weight: 700;
}

.etf-card-return.positive .return-value {
    color: #1565c0;
}

.etf-card-return.negative .return-value {
    color: #c62828;
}

.etf-card-return.na .return-value {
    color: #9e9e9e;
}

.selected-indicator {
    margin-top: 8px;
    text-align: center;
    color: #3f51b5;
    font-weight: 600;
    font-size: 0.85em;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #757575;
    padding: 30px;
    font-style: italic;
}

/* Selected ETFs Section */
.selected-etfs-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #7986cb;
}

.selected-etfs-section h4 {
    color: #1a237e;
    margin-bottom: 15px;
}

.portfolio-summary {
    margin-bottom: 15px;
}

.allocation-meter {
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.allocation-bar {
    height: 100%;
    background: linear-gradient(135deg, #7986cb 0%, #5c6bc0 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
}

.allocation-bar.complete {
    background: linear-gradient(135deg, #3f51b5 0%, #1a237e 100%);
}

.allocation-bar.over {
    background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
}

.allocation-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: white;
    font-size: 0.9em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Portfolio Action Buttons */
.portfolio-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.equal-split-btn {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.equal-split-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

.equal-split-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

.clear-portfolio-btn {
    background: transparent;
    color: #7b1fa2;
    border: 2px solid #7b1fa2;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-portfolio-btn:hover:not(:disabled) {
    background: #7b1fa2;
    color: white;
}

.clear-portfolio-btn:disabled {
    border-color: #bdbdbd;
    color: #bdbdbd;
    cursor: not-allowed;
}

.selected-etfs-list {
    max-height: 350px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    background: white;
}

/* Custom scrollbar for webkit browsers (Chrome, Safari, Edge) */
.selected-etfs-list::-webkit-scrollbar {
    width: 8px;
}

.selected-etfs-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.selected-etfs-list::-webkit-scrollbar-thumb {
    background: #c5cae9;
    border-radius: 4px;
}

.selected-etfs-list::-webkit-scrollbar-thumb:hover {
    background: #9fa8da;
}

/* Firefox scrollbar */
.selected-etfs-list {
    scrollbar-width: thin;
    scrollbar-color: #c5cae9 #f1f1f1;
}

.no-etfs-msg {
    text-align: center;
    color: #757575;
    font-style: italic;
    padding: 20px;
}

.selected-etf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 8px;
}

.selected-etf-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.selected-etf-code {
    font-weight: 700;
    color: #1a237e;
}

.selected-etf-name {
    font-size: 0.85em;
    color: #616161;
}

.selected-etf-return {
    font-size: 0.8em;
    color: #3f51b5;
}

.selected-etf-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.allocation-with-value {
    display: flex;
    align-items: center;
    gap: 4px;
}

.allocation-input {
    width: 55px;
    padding: 6px 8px;
    border: 2px solid #7986cb;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9em;
}

.allocation-percent {
    color: #616161;
    font-size: 0.9em;
}

.allocation-monetary {
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    color: #1a237e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 4px;
}

.remove-etf-btn {
    background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-etf-btn:hover {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.remove-etf-btn .remove-icon {
    width: 12px;
    height: 12px;
    position: relative;
}

.remove-etf-btn .remove-icon::before,
.remove-etf-btn .remove-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background: white;
    top: 50%;
    left: 0;
}

.remove-etf-btn .remove-icon::before {
    transform: rotate(45deg);
}

.remove-etf-btn .remove-icon::after {
    transform: rotate(-45deg);
}

/* Calculated Return Box */
.calculated-return-box {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #ede7f6 0%, #d1c4e9 100%);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

.return-display .return-label {
    font-weight: 600;
    color: #4a148c;
}

.return-display .return-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #311b92;
}

.apply-return-btn {
    background: linear-gradient(135deg, #4a148c 0%, #311b92 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-return-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 20, 140, 0.3);
}

.apply-return-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

/* Data Disclaimer */
.data-disclaimer {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.05) 0%, rgba(103, 58, 183, 0.08) 100%);
    border-radius: 8px;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.data-disclaimer p {
    font-size: 0.85em;
    color: #424242;
    margin: 0;
    line-height: 1.5;
}

.data-disclaimer a {
    color: #3f51b5;
    text-decoration: none;
    font-weight: 600;
}

.data-disclaimer a:hover {
    text-decoration: underline;
}

/* Manual Return Section */
.manual-return-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #9fa8da;
}

.manual-return-section h4 {
    color: #616161;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.manual-return-input {
    display: flex;
    flex-direction: column;
    max-width: 200px;
}

.manual-return-input label {
    font-weight: 600;
    color: #424242;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.manual-return-input input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

/* ==================== Withdrawal Section ==================== */

.withdrawal-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #faf5fc 0%, #f3e5f5 100%);
    border-radius: 12px;
    border-left: 5px solid #7b1fa2;
    box-shadow: 0 4px 15px rgba(123, 31, 162, 0.1);
}

.withdrawal-section h3 {
    color: #4a148c;
    margin-bottom: 8px;
    font-size: 1.15em;
}

.withdrawal-section > p {
    color: #6a1b9a;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border: 1px dashed #ce93d8;
}

.withdrawal-inputs {
    margin-top: 15px;
}

.withdrawal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.withdrawal-input-group {
    display: flex;
    flex-direction: column;
}

.withdrawal-input-group label {
    font-weight: 600;
    color: #4a148c;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.withdrawal-input-group input {
    padding: 12px 16px;
    border: 2px solid #ce93d8;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.withdrawal-input-group input:focus {
    outline: none;
    border-color: #7b1fa2;
    box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.15);
}

.withdrawal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.add-withdrawal-btn {
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-withdrawal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(123, 31, 162, 0.4);
}

.clear-withdrawal-btn {
    background: linear-gradient(135deg, #c2185b 0%, #880e4f 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.withdrawals-list {
    margin-top: 20px;
}

.withdrawal-item {
    background: white;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #9c27b0;
}

.withdrawal-item-info {
    flex: 1;
}

.withdrawal-item-actions {
    display: flex;
    gap: 8px;
}

.edit-withdrawal-btn {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.edit-withdrawal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(106, 27, 154, 0.3);
}

.remove-withdrawal-btn {
    background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.remove-withdrawal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(198, 40, 40, 0.3);
}

/* ==================== Buttons ==================== */

.button-container {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    background: linear-gradient(135deg, #1a1f3a 0%, #4a1a4a 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

.pdf-btn {
    background: linear-gradient(135deg, #00838f 0%, #006064 100%);
}

.guide-btn {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
}

.guide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 27, 154, 0.4);
}

/* ==================== Recalculation Needed State ==================== */

/* Keyframe for intense pulsing glow */
@keyframes intense-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 26, 74, 0.7),
                    0 0 20px rgba(138, 43, 226, 0.6),
                    0 0 40px rgba(138, 43, 226, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(74, 26, 74, 0),
                    0 0 30px rgba(138, 43, 226, 0.8),
                    0 0 60px rgba(138, 43, 226, 0.6);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 26, 74, 0),
                    0 0 20px rgba(138, 43, 226, 0.6),
                    0 0 40px rgba(138, 43, 226, 0.4);
        transform: scale(1);
    }
}

/* Recalculation needed button state */
button.needs-recalc {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%) !important;
    animation: intense-pulse 2s ease-in-out infinite;
    position: relative;
    font-weight: 700;
}

button.needs-recalc:hover {
    animation: intense-pulse 1s ease-in-out infinite;
    transform: translateY(-2px);
}

/* ==================== Results (Screen) ==================== */

.results-section {
    padding: 30px 40px;
}

/* ==================== Summary Cards (Screen) ==================== */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    margin-top: 15px;
}

.summary-card {
    background: linear-gradient(135deg, #1a1f3a 0%, #4a1a4a 100%);
    color: white;
    padding: 20px;
    border-radius: 8px; /* More square, less rounded */
    text-align: center;
}

/* Enhanced Primary Summary Card */
.summary-card-primary {
    grid-column: span 2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.summary-card-primary h3 {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-card-primary .value {
    font-size: 2em;
    font-weight: 800;
}

.summary-card-primary .sub-value {
    font-size: 0.85em;
}

.summary-card.warning {
    background: linear-gradient(135deg, #c2185b 0%, #880e4f 100%);
}

.summary-card.penalty {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
}

.summary-card h3 {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.summary-card .value {
    font-size: 1.4em;
    font-weight: 700;
}

.summary-card .sub-value {
    font-size: 0.75em;
    opacity: 0.8;
}

/* ==================== Portfolio Summary Box ==================== */

.portfolio-summary-box {
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 5px solid #3f51b5;
}

.portfolio-summary-box h3 {
    color: #1a237e;
    margin-bottom: 15px;
}

.portfolio-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.portfolio-table th,
.portfolio-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.portfolio-table th {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: white;
    font-weight: 600;
}

.portfolio-table td small {
    color: #757575;
    display: block;
}

.portfolio-table .positive {
    color: #1565c0;
    font-weight: 600;
}

.portfolio-table .negative {
    color: #c62828;
    font-weight: 600;
}

.portfolio-table tfoot {
    background: #f5f5f5;
}

.portfolio-table tfoot td {
    font-weight: 600;
}

/* ==================== Table (Screen) ==================== */

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

th, td {
    padding: 14px 8px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

th {
    background: #2d3748;
    color: white;
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: #f7f9fc;
}

tr:hover {
    background: #f7fafc;
}

/* ==================== Warnings (Screen) ==================== */

.warnings-box {
    margin-top: 40px;
    padding: 25px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.warnings-box h3 {
    margin-bottom: 15px;
    color: #856404;
}

.warnings-box ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.warnings-box p {
    margin-bottom: 8px;
    color: #856404;
}

.warnings-box li {
    color: #856404;
    margin-bottom: 4px;
}

/* ==================== PDF Elements ==================== */

.pdf-report-header {
    display: none;
    text-align: center;
    padding: 12px;
    border-bottom: 3px solid #1a1f3a;
    margin-bottom: 15px;
}

.pdf-report-header h2 {
    color: #1a1f3a;
    font-size: 1.3em;
    margin-bottom: 3px;
}

.pdf-report-header p {
    color: #666;
    font-size: 0.8em;
}

.pdf-input-summary {
    display: none;
    margin: 0 0 8px 0;
    padding: 10px 14px;
    background: #f3e5f5;
    border-radius: 8px;
    border-left: 4px solid #7b1fa2;
}

.pdf-input-summary h4 {
    color: #4a148c;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.pdf-input-summary .input-grid-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.pdf-input-summary .input-item {
    background: white;
    border-radius: 4px;
    padding: 5px 8px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #ce93d8;
    font-size: 0.75em;
}

.pdf-input-summary .input-label {
    color: #6a1b9a;
    font-weight: 600;
}

.pdf-input-summary .input-value {
    font-weight: 700;
    color: #4a148c;
}

.pdf-portfolio-summary {
    display: none;
    margin: 0 0 8px 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    border-left: 4px solid #3f51b5;
    border-radius: 8px;
}

.pdf-portfolio-summary h4 {
    color: #1a237e;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.pdf-portfolio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75em;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.pdf-portfolio-table th,
.pdf-portfolio-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.pdf-portfolio-table th {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: white;
    font-weight: 600;
    font-size: 0.85em;
}

.pdf-portfolio-table td:nth-child(3),
.pdf-portfolio-table td:nth-child(4),
.pdf-portfolio-table td:nth-child(5),
.pdf-portfolio-table td:nth-child(6),
.pdf-portfolio-table th:nth-child(3),
.pdf-portfolio-table th:nth-child(4),
.pdf-portfolio-table th:nth-child(5),
.pdf-portfolio-table th:nth-child(6) {
    text-align: right;
}

.pdf-portfolio-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.pdf-portfolio-table tfoot {
    background: #e8eaf6;
}

.pdf-portfolio-table tfoot td {
    border-top: 2px solid #3f51b5;
}

.pdf-withdrawals-summary {
    display: none;
    margin: 0 0 8px 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    border-left: 4px solid #c2185b;
    border-radius: 8px;
}

.pdf-withdrawals-summary h4 {
    margin-bottom: 6px;
    color: #880e4f;
    font-size: 0.9em;
}

.pdf-withdrawals-summary ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}

.pdf-withdrawals-summary li {
    background: white;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.75em;
    color: #880e4f;
    border: 1px solid #f48fb1;
    display: flex;
    justify-content: space-between;
}

.pdf-withdrawals-summary .no-withdrawals {
    color: #ad1457;
    font-style: italic;
    font-size: 0.8em;
}

.pdf-summary-cards {
    display: none;
    margin-bottom: 10px;
}

.pdf-summary-cards .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}

.pdf-summary-cards .card {
    background: linear-gradient(135deg, #1a1f3a 0%, #4a1a4a 100%);
    color: white;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
}

.pdf-summary-cards .card.warning {
    background: linear-gradient(135deg, #c2185b 0%, #880e4f 100%);
}

.pdf-summary-cards .card.penalty {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
}

.pdf-summary-cards .card h5 {
    font-size: 0.65em;
    opacity: 0.9;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.pdf-summary-cards .card .value {
    font-size: 0.9em;
    font-weight: 700;
}

.pdf-summary-cards .card .sub {
    font-size: 0.6em;
    opacity: 0.8;
}

.pdf-table-container {
    display: none;
    margin-top: 10px;
    page-break-before: always;
}

.pdf-table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75em;
}

.pdf-table-container th,
.pdf-table-container td {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #ddd;
}

.pdf-table-container th {
    background: #2d3748;
    color: white;
    font-weight: 600;
    font-size: 0.7em;
    text-transform: uppercase;
}

.pdf-table-container tbody tr:nth-child(even) {
    background-color: #f7f9fc;
}

.pdf-table-container .withdrawal-highlight {
    color: #c2185b;
    font-weight: bold;
}

.pdf-table-container .penalty-highlight {
    color: #d32f2f;
    font-weight: bold;
}

.pdf-warnings {
    display: none;
    margin-top: 15px;
    padding: 15px 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    font-size: 0.8em;
    page-break-inside: avoid;
}

.pdf-warnings h4 {
    margin-bottom: 12px;
    color: #856404;
}

.pdf-warnings p {
    margin-bottom: 6px;
    color: #856404;
    font-weight: 600;
}

.pdf-warnings ul {
    margin: 0 0 12px 20px;
}

.pdf-warnings li {
    color: #856404;
    margin-bottom: 3px;
}

/* ==================== Print ==================== */

@media print {
    body {
        background: white;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }

    .pdf-report-header,
    .pdf-input-summary,
    .pdf-portfolio-summary,
    .pdf-withdrawals-summary,
    .pdf-summary-cards,
    .pdf-warnings {
        display: block !important;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .summary-cards,
    .portfolio-summary-box,
    .warnings-box {
        display: none !important;
    }
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    /* Enhanced summary card - full width on mobile */
    .summary-card-primary {
        grid-column: span 1;
        transform: scale(1);
    }
    
    .summary-card-primary h3 {
        font-size: 0.9em;
    }
    
    .summary-card-primary .value {
        font-size: 1.8em;
    }
    
    .etf-controls {
        grid-template-columns: 1fr;
    }
    
    .etf-list {
        grid-template-columns: 1fr;
    }
    
    .selected-etf-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .calculated-return-box {
        flex-direction: column;
        text-align: center;
    }
    
    .portfolio-actions {
        flex-direction: column;
    }
    
    .portfolio-actions button {
        width: 100%;
    }
    
    .withdrawal-buttons {
        flex-direction: column;
    }
    
    .pdf-input-summary .input-grid-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* ETF Counter - Compact on mobile */
    .etf-count {
        font-size: 0.85em;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .etf-count {
        font-size: 0.8em;
    }
    
    .summary-card-primary .value {
        font-size: 1.5em;
    }
    
    /* Reduce selected ETFs height on phones */
    .selected-etfs-list {
        max-height: 250px;
        padding: 6px;
    }
    
    .selected-etfs-list::-webkit-scrollbar {
        width: 6px;
    }
}

/* ==================== Floating Action Buttons ==================== */

#floatingButtons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* Allow clicks through container */
}

.floating-btn {
    pointer-events: all; /* But buttons are clickable */
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInFromBottom 0.4s ease-out;
    white-space: nowrap;
}

/* Primary floating button (Recalculate) */
.floating-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.floating-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4), 0 3px 6px rgba(0,0,0,0.15);
}

.floating-btn-primary:active {
    transform: translateY(0);
}

/* Secondary floating button (Apply Return) */
.floating-btn-secondary {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
}

.floating-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.4), 0 3px 6px rgba(0,0,0,0.15);
}

.floating-btn-secondary:active {
    transform: translateY(0);
}

/* Button icon — SVG wrapper, not text */
.floating-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}
.floating-btn .btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Button text */
.floating-btn .btn-text {
    font-size: 15px;
    font-weight: 600;
}

/* Dismiss button */
.btn-dismiss {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.btn-dismiss:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Pulse animation for recalculate button when form changes */
.floating-btn.pulse {
    animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5), 0 2px 4px rgba(102, 126, 234, 0.3), 0 0 0 8px rgba(102, 126, 234, 0.1);
    }
}

/* Slide in animation */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Slide out animation */
@keyframes slideOutToBottom {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(60px) scale(0.8);
    }
}

.floating-btn.dismissing {
    animation: slideOutToBottom 0.3s ease-in forwards;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #floatingButtons {
        bottom: 15px;
        right: 15px;
        left: 15px;
        align-items: stretch;
    }
    
    .floating-btn {
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .floating-btn .btn-text {
        font-size: 14px;
    }
    
    .floating-btn .btn-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .floating-btn {
        padding: 10px 14px;
    }
    
    .floating-btn .btn-text {
        font-size: 13px;
    }
}

/* ==================== PDF Logo Placeholder ==================== */

.pdf-logo-placeholder {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    /* LOGO INTEGRATION: Replace .brand-name with actual logo image */
    /* background-image: url('path/to/logo.png'); */
    /* background-size: contain; */
    /* background-repeat: no-repeat; */
    /* background-position: center; */
    /* height: 50px; */
}

.pdf-logo-placeholder .brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #6a1b9a;
    letter-spacing: 1px;
    /* PLACEHOLDER: Remove this span when logo image is added */
}

/* ==================== PDF Footer Watermark ==================== */

.pdf-footer-watermark {
    margin-top: 30px;
    padding: 15px 20px;
    border-top: 2px solid #e0e0e0;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%);
    font-size: 9px;
    color: #666;
    text-align: center;
    page-break-inside: avoid;
}

.pdf-footer-watermark .watermark-line {
    margin: 3px 0;
    line-height: 1.4;
}

.pdf-footer-watermark .user-info {
    color: #424242;
    font-size: 10px;
}

.pdf-footer-watermark .user-info strong {
    color: #6a1b9a;
    font-weight: 600;
    /* AWS/DynamoDB INTEGRATION: These will be replaced with actual user data */
    /* [Name Surname] → {user.firstName} {user.lastName} */
    /* [Age] → {user.age} */
}

.pdf-footer-watermark .disclaimer {
    color: #d32f2f;
    font-weight: 600;
    font-size: 9px;
    margin-top: 5px;
}

.pdf-footer-watermark strong {
    font-weight: 600;
    color: #333;
}

/* Hide watermark from screen view (PDF only) */
.screen-only ~ .pdf-footer-watermark {
    display: none;
}

/* Show watermark only when PDF elements are visible */
.pdf-report-header ~ .pdf-footer-watermark,
.pdf-table-container ~ .pdf-footer-watermark {
    display: block;
}

/* Ensure watermark appears on every PDF page */
@media print {
    .pdf-footer-watermark {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #ccc;
    }
}


/* ============================================================
   FI GEARS SECTION — v1.13.0
   ============================================================ */

.fi-section-outer { margin-top: 48px; }

.fi-section {
    background: linear-gradient(160deg, #0f172a 0%, #1a1040 60%, #0f172a 100%);
    border-radius: 20px;
    padding: 40px 40px 32px;
    color: #f1f5f9;
    border: 1px solid #312e81;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

/* ── Header ─────────────────────────────────────────── */
.fi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.fi-header-text h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0 0 6px;
}

.fi-header-text p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
    max-width: 500px;
    line-height: 1.6;
}

/* ── Master FI badge ────────────────────────────────── */
.fi-master-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fi-master-ring-wrap {
    position: relative;
    width: 88px;
    height: 88px;
}

.fi-master-ring-svg {
    width: 88px;
    height: 88px;
    transform: rotate(-90deg);
}

.fi-master-ring-svg .fi-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.07);
    stroke-width: 8;
}

.fi-master-ring-fill {
    fill: none;
    stroke: #6366f1;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.fi-master-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.fi-master-icon { font-size: 1.3rem; }
.fi-master-pct  { font-size: 0.95rem; font-weight: 800; color: #f1f5f9; }

.fi-master-label {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.4;
}

.fi-master-label small { color: #475569; font-size: 0.7rem; }
.fi-master-achieved .fi-master-pct  { color: #10b981; }
.fi-master-achieved .fi-master-label { color: #10b981; }

/* ── Global inputs ──────────────────────────────────── */
.fi-global-row {
    display: flex;
    gap: 20px;
    margin-bottom: 36px;
    padding: 20px 24px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    flex-wrap: wrap;
}

.fi-global-input-group { flex: 1; min-width: 180px; }

.fi-global-input-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.fi-global-input-group input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #f1f5f9;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.fi-global-input-group input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99,102,241,0.1);
}

.fi-input-hint {
    display: block;
    font-size: 0.7rem;
    color: #334155;
    margin-top: 4px;
}

/* ── Gears Grid — fluid, fills available width ──────── */
.fi-gears-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* ── Individual Gear Card ───────────────────────────── */
.fi-gear-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 28px;
    transition: background 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.fi-gear-card:hover {
    background: rgba(255,255,255,0.07);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.fi-gear-achieved {
    background: rgba(16,185,129,0.07) !important;
    border-color: rgba(16,185,129,0.3) !important;
}

/* Card Header */
.fi-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.fi-card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fi-card-icon { font-size: 1.5rem; }

.fi-card-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.fi-card-desc {
    font-size: 0.78rem;
    color: #64748b;
}

/* Progress row: ring left, stats right */
.fi-card-progress-row {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 4px 0;
}

.fi-ring-wrap {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.fi-ring-svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg);
}

.fi-ring-track {
    fill: none;
    stroke: rgba(255,255,255,0.07);
    stroke-width: 9;
}

.fi-ring-fill {
    fill: none;
    stroke-width: 9;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.fi-ring-centre {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.fi-ring-pct {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
}

.fi-ring-pct-sym {
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: super;
}

.fi-ring-label {
    font-size: 0.65rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.fi-achieved-check {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
    border: 2px solid #0f172a;
}

/* Stats column */
.fi-card-stats { flex: 1; }

.fi-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.fi-stat-row:last-of-type { border-bottom: none; }

.fi-stat-label {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fi-stat-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
}

.fi-stat-current { color: var(--gear-color); }
.fi-stat-gap     { color: #94a3b8; }

.fi-bar-track {
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.fi-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Status chip row */
.fi-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fi-status-chip {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.fi-status-achieved {
    background: rgba(16,185,129,0.15);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.3);
}

.fi-status-active {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.3);
}

.fi-status-pending {
    background: rgba(100,116,139,0.15);
    color: #94a3b8;
    border: 1px solid rgba(100,116,139,0.3);
}

.fi-age-note {
    font-size: 0.78rem;
    color: #64748b;
}

.fi-age-note strong { color: #94a3b8; }

/* Input fields */
.fi-card-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.fi-input-field {}

.fi-input-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.fi-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.fi-input-wrap:focus-within {
    border-color: var(--gear-color, #6366f1);
    background: rgba(255,255,255,0.08);
}

.fi-input-r {
    padding: 9px 6px 9px 10px;
    font-size: 0.8rem;
    color: #334155;
    font-weight: 700;
    flex-shrink: 0;
}

.fi-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: #f1f5f9;
    padding: 9px 8px 9px 0;
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 0;
}

.fi-input-wrap input:focus { outline: none; }
.fi-input-wrap input::placeholder { color: #1e293b; }

.fi-field-hint {
    display: block;
    font-size: 0.65rem;
    color: #1e293b;
    margin-top: 4px;
    line-height: 1.4;
}

/* Footer row */
.fi-footer-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.fi-add-btn {
    background: rgba(99,102,241,0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.25);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fi-add-btn:hover {
    background: rgba(99,102,241,0.22);
    border-color: #6366f1;
}

.fi-disclaimer {
    font-size: 0.72rem;
    color: #334155;
    margin: 0;
    line-height: 1.5;
}

/* ========== Custom Goal Form (inline panel below Add button) ========== */

.fi-add-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-shrink: 0;
}

.fi-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fi-custom-goal-form {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
    padding: 18px 20px 16px;
    max-width: 640px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.fi-custom-form-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fi-custom-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    margin-bottom: 12px;
}

.fi-custom-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Goal name field spans the full width so long names have room to breathe */
.fi-custom-field:first-child {
    grid-column: 1 / -1;
}

.fi-custom-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fi-custom-req {
    color: #f87171;
    font-weight: 700;
}

.fi-custom-opt {
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-style: italic;
}

.fi-custom-input {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.6);
    border-radius: 6px;
    padding: 9px 12px;
    color: #f1f5f9;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.fi-custom-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.fi-custom-input::placeholder {
    color: #475569;
}

.fi-custom-hint {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

.fi-custom-err {
    color: #fca5a5;
    font-size: 0.82rem;
    min-height: 1.2em;
    margin: 4px 0 8px;
    font-weight: 500;
}

.fi-custom-err:empty {
    display: none;
}

.fi-custom-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.fi-custom-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    font-family: inherit;
}

.fi-custom-btn-cancel {
    background: transparent;
    color: #94a3b8;
    border-color: rgba(71, 85, 105, 0.5);
}

.fi-custom-btn-cancel:hover {
    color: #e2e8f0;
    border-color: #64748b;
    background: rgba(71, 85, 105, 0.15);
}

.fi-custom-btn-save {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.fi-custom-btn-save:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* ========== Custom Goal: delete button on the gear card ========== */

.fi-gear-delete-btn {
    background: transparent;
    border: 1px solid rgba(71, 85, 105, 0.35);
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 4px;
    transition: all 0.15s;
    padding: 0;
}

.fi-gear-delete-btn:hover {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.08);
}

.fi-gear-delete-btn:active {
    transform: scale(0.95);
}

/* "custom" tag shown next to custom goal names */
.fi-custom-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 6px;
}

/* Responsive */
@media (max-width: 1000px) {
    .fi-gears-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .fi-card-inputs { grid-template-columns: 1fr 1fr; }
    .fi-custom-form-grid { grid-template-columns: 1fr; }
    .fi-custom-field:first-child { grid-column: auto; }
}

@media (max-width: 560px) {
    .fi-section { padding: 24px 16px; }
    .fi-card-inputs { grid-template-columns: 1fr; }
    .fi-card-progress-row { flex-direction: column; align-items: flex-start; }
    .fi-header { flex-direction: column; }
}

/* ============================================================
   ANNUAL REVIEW SECTION — v1.15.0
   ============================================================ */

.review-section-outer { margin-top: 48px; margin-bottom: 48px; }

.review-section {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.review-header { margin-bottom: 28px; }
.review-header h2 { font-size: 1.75rem; font-weight: 800; color: #1e293b; margin: 0 0 8px; }
.review-subtitle { color: #64748b; font-size: 0.92rem; margin: 0; line-height: 1.6; }

.review-add-panel {
    background: #f8fafc;
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
}

.review-add-panel h3 { color: #1e293b; margin: 0 0 6px; font-size: 1.05rem; }
.review-add-hint { font-size: 0.78rem; color: #94a3b8; margin: 0 0 20px; }

.review-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.review-input-full { grid-column: 1 / -1; }

.review-input-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.review-input-group input,
.review-input-group textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.9rem;
    color: #1e293b;
    background: white;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
    resize: vertical;
}

.review-input-group input:focus,
.review-input-group textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.review-input-prefix {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: border-color 0.2s;
}

.review-input-prefix:focus-within { border-color: #6366f1; }

.review-input-prefix span {
    padding: 9px 8px 9px 12px;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.review-input-prefix input {
    border: none !important;
    padding: 9px 8px 9px 0 !important;
    flex: 1;
    min-width: 0;
}

/* Gear review blocks */
.review-gears-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.review-gear-block {
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--gear-color);
    border-radius: 10px;
    padding: 16px;
    background: white;
}

.review-gear-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.review-gear-icon { font-size: 1.1rem; }

.review-gear-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e293b;
    flex: 1;
}

.review-gear-target {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

.review-gear-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.review-add-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 13px 28px;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.review-add-btn:hover { background: #0f172a; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* History */
.review-table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.review-table-header h3 { font-size: 1.1rem; color: #1e293b; margin: 0; }

.review-export-btn {
    background: #10b981; color: white; border: none;
    padding: 9px 18px; border-radius: 7px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.review-export-btn:hover { background: #059669; }

.review-history-list { display: flex; flex-direction: column; gap: 16px; }

.review-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    background: white;
    transition: box-shadow 0.2s;
}
.review-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.review-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.review-card-year { font-size: 1.05rem; font-weight: 800; color: #1e293b; }
.review-card-age { font-size: 0.78rem; color: #94a3b8; background: #f1f5f9; padding: 2px 10px; border-radius: 20px; }

.review-card-totals { flex: 1; }

.review-total-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
}

.rv-delete-btn { background:none; border:none; cursor:pointer; opacity:0.4; transition:opacity 0.2s; padding:4px; display:inline-flex; align-items:center; color:inherit; }
.rv-delete-btn:hover { opacity:1; }

.review-card-accounts { display: flex; flex-direction: column; gap: 8px; }

.review-account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--gear-color);
    flex-wrap: wrap;
}

.rv-acct-icon { font-size: 1rem; flex-shrink: 0; }
.rv-acct-name { font-size: 0.82rem; font-weight: 600; color: #475569; flex: 1; min-width: 80px; }
.rv-acct-actual { font-size: 0.9rem; font-weight: 800; color: #1e293b; margin-left: auto; }
.rv-acct-projected { font-size: 0.75rem; color: #94a3b8; }

.rv-delta-pos { font-size: 0.78rem; font-weight: 700; color: #10b981; }
.rv-delta-neg { font-size: 0.78rem; font-weight: 700; color: #ef4444; }

.review-card-notes {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
    border-left: 3px solid #e2e8f0;
}

.review-no-gears {
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.review-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.7;
}
.review-empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }

@media (max-width: 640px) {
    .review-section { padding: 24px 16px; }
    .review-meta-grid { grid-template-columns: 1fr; }
    .review-gear-inputs { grid-template-columns: 1fr; }
    .review-gears-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ETF FILTER ENHANCEMENTS — v1.11.1
   ============================================================ */

/* Highlight active (non-default) filter selects */
#returnDataFilter:not([value="any"]),
#terFilter:not([value="any"]) {
    border-color: #7c3aed;
    background-color: #f5f3ff;
    font-weight: 600;
    color: #5b21b6;
}

/* Active filter badge shown in ETF results count area */
.etf-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 4px;
    min-height: 0;
}

.etf-filter-badge {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.etf-filter-badge .badge-clear {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.85rem;
    line-height: 1;
}

.etf-filter-badge .badge-clear:hover {
    opacity: 1;
}

.etf-results-count {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
}

.etf-results-count strong {
    color: #1e293b;
}

/* ============================================================
   INFLATION ADJUSTMENT — v1.13.0
   ============================================================ */

/* Control Panel */
.inflation-control-panel {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.inflation-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.inflation-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.inflation-label-icon { font-size: 1.2rem; }

.inflation-label-text {
    font-weight: 700;
    color: #0c4a6e;
    font-size: 0.95rem;
}

.inflation-label-sub {
    display: block;
    font-weight: 400;
    color: #0369a1;
    font-size: 0.78rem;
    margin-top: 1px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: #0284c7; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

/* Rate input row */
.inflation-rate-row {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inflation-rate-row label {
    font-weight: 600;
    color: #0c4a6e;
    font-size: 0.85rem;
    white-space: nowrap;
}

.inflation-rate-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #bae6fd;
    border-radius: 7px;
    padding: 6px 12px;
}

.inflation-rate-input-wrap input {
    width: 60px;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0c4a6e;
    background: none;
}

.inflation-rate-input-wrap input:focus { outline: none; }

.inflation-rate-suffix {
    font-size: 0.8rem;
    color: #0369a1;
    white-space: nowrap;
}

.inflation-rate-hint {
    font-size: 0.75rem;
    color: #64748b;
}

/* Insight Card */
.inflation-insight-card {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    border-radius: 16px;
    padding: 28px 32px;
    color: white;
    margin: 0;
}

.inflation-insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.inflation-insight-icon { font-size: 1.4rem; }

.inflation-insight-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #e0f2fe;
}

.inflation-insight-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inflation-insight-item { flex: 1; min-width: 160px; }

.ii-label {
    font-size: 0.75rem;
    color: #7dd3fc;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ii-value {
    font-size: 1.6rem;
    font-weight: 800;
}

.ii-nominal { color: #e0f2fe; }
.ii-real    { color: #34d399; }

.inflation-insight-arrow {
    font-size: 1.5rem;
    color: #38bdf8;
    flex-shrink: 0;
}

/* Erosion bar */
.inflation-erosion-bar-wrap {
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    height: 10px;
    position: relative;
    margin-bottom: 8px;
    overflow: hidden;
}

.inflation-erosion-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f87171, #fbbf24);
    border-radius: 6px;
    transition: width 0.6s ease;
}

.inflation-erosion-label {
    display: block;
    font-size: 0.72rem;
    color: #7dd3fc;
    margin-top: 4px;
    margin-bottom: 16px;
}

/* Stats row */
.inflation-insight-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ii-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ii-stat-label {
    font-size: 0.72rem;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ii-stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: #e0f2fe;
}

.ii-real-return { color: #34d399; }

.inflation-insight-note {
    font-size: 0.82rem;
    color: #bae6fd;
    line-height: 1.6;
    margin: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 14px;
}

/* Real value in summary cards */
.real-value-sub {
    font-size: 0.75rem;
    color: #34d399;
    margin-top: 4px;
    font-weight: 600;
}

/* Inflation column in table */
.inflation-col {
    background: #f0f9ff !important;
    color: #0369a1 !important;
}

th.inflation-col {
    background: #e0f2fe !important;
    color: #0c4a6e !important;
    font-weight: 700;
}

.inflation-val {
    font-weight: 600;
    color: #0369a1 !important;
}

/* ============================================================
   FI NUMBER PANEL & PROGRESS SUMMARY — v1.14.0
   ============================================================ */

.fi-number-panel {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 32px;
}

.fi-number-header {
    margin-bottom: 20px;
}

.fi-number-title {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.fi-number-subtitle {
    font-size: 0.8rem;
    color: #64748b;
}

/* Method radio options */
.fi-number-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fi-method-option {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.03);
}

.fi-method-option input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #6366f1;
}

.fi-method-option:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(99,102,241,0.3);
}

.fi-method-active {
    background: rgba(99,102,241,0.1) !important;
    border-color: rgba(99,102,241,0.4) !important;
}

.fi-method-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.fi-method-desc {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

/* Number inputs */
.fi-number-inputs { margin-bottom: 8px; }

.fi-input-lg {
    max-width: 320px;
}

.fi-fire-result {
    margin-top: 10px;
    padding: 10px 16px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #a5b4fc;
    max-width: 420px;
}

.fi-fire-empty {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.07);
    color: #334155;
    font-weight: 400;
}

.fi-fire-calc {
    font-size: 0.75rem;
    color: #6366f1;
    font-weight: 400;
    margin-left: 6px;
}

/* Progress Summary */
.fi-progress-summary {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.fi-ps-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fi-ps-item { flex: 1; min-width: 120px; }

.fi-ps-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.fi-ps-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: #f1f5f9;
}

.fi-ps-current { color: #6366f1; }

.fi-ps-time { flex: 1.5; }

.fi-ps-years {
    font-size: 1.3rem;
    font-weight: 800;
    color: #10b981;
}

.fi-ps-age {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 400;
}

.fi-ps-na {
    font-size: 0.82rem;
    color: #334155;
    font-weight: 400;
}

.fi-ps-arrow {
    font-size: 1.4rem;
    color: #334155;
    flex-shrink: 0;
}

.fi-ps-bar-wrap {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
}

.fi-ps-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.fi-ps-bar-label {
    font-size: 0.72rem;
    color: #475569;
    display: block;
    margin-bottom: 12px;
}

.fi-ps-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.72rem;
    color: #475569;
    align-items: center;
}

.fi-ps-account-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Include in FI toggle on gear card */
.fi-include-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

.fi-include-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

.fi-include-label {
    font-size: 0.62rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Excluded card visual */
.fi-gear-excluded {
    opacity: 0.5;
    border-color: rgba(255,255,255,0.04) !important;
}

.fi-gear-excluded .fi-ring-fill {
    stroke: #475569 !important;
}

/* ============================================================
   GEAR CARD SPECIAL TYPES — v1.15.0
   ============================================================ */

/* Interest Cash insight panel */
.fi-card-inputs-interest {
    grid-template-columns: 1fr 1fr 1fr !important;
}

.fi-interest-insight {
    grid-column: 1 / -1;
    background: rgba(139,92,246,0.08);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.fi-ii-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.fi-ii-row span { color: #94a3b8; }
.fi-ii-row strong { color: #f1f5f9; font-weight: 700; }

.fi-ii-ok   { color: #10b981 !important; }
.fi-ii-over { color: #f87171 !important; }

.fi-ii-status {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: #94a3b8;
}

/* Interest threshold select — needs solid bg for option readability */
.fi-card-inputs select {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #f1f5f9;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
    -webkit-appearance: auto;
}

.fi-card-inputs select:focus {
    outline: none;
    border-color: var(--gear-color);
    background: #1e3a5f;
}

.fi-card-inputs select option {
    background: #1e293b;
    color: #f1f5f9;
    font-weight: 600;
    padding: 8px;
}

/* Pension card */
.fi-card-inputs-pension {
    grid-template-columns: 1fr 1fr !important;
}

.fi-pension-total {
    grid-column: 1 / -1;
    font-size: 0.82rem;
    color: #64748b;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.07);
    margin-top: 4px;
}

.fi-pension-total strong { color: #a5b4fc; }

/* Number input (no text formatting) */
.fi-card-inputs input[type="number"] {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    color: #f1f5f9;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.fi-card-inputs input[type="number"]:focus { outline: none; border-color: var(--gear-color); }

/* Card padding and input grid — consistent 2-col layout */
.fi-gear-card { padding: 32px; }

.fi-card-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Interest card: 2-col for inputs, insight spans full width */
.fi-card-inputs-interest {
    grid-template-columns: 1fr 1fr !important;
}

/* Pension card: 2-col */
.fi-card-inputs-pension {
    grid-template-columns: 1fr 1fr !important;
}

@media (max-width: 560px) {
    .fi-card-inputs,
    .fi-card-inputs-interest,
    .fi-card-inputs-pension { grid-template-columns: 1fr !important; }
    .fi-gear-card { padding: 20px; }
}

/* ============================================================
   RETIREMENT CONTRIBUTION CAP PANEL — v1.15.3
   ============================================================ */

.fi-retirement-cap {
    grid-column: 1 / -1;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.fi-rc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.fi-rc-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #93c5fd;
}

.fi-rc-limit {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 600;
}

.fi-rc-bar-wrap {
    height: 7px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
}

.fi-rc-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.fi-rc-bar-fill.fi-rc-over {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

.fi-rc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.fi-rc-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fi-rc-stat span {
    font-size: 0.67rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fi-rc-stat strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
}

.fi-rc-over-text { color: #f87171 !important; }
.fi-rc-ok-text   { color: #34d399 !important; }

.fi-rc-warning {
    font-size: 0.75rem;
    color: #fca5a5;
    background: rgba(239,68,68,0.08);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(239,68,68,0.2);
    line-height: 1.5;
}

.fi-rc-note {
    font-size: 0.72rem;
    color: #334155;
    line-height: 1.5;
}

@media (max-width: 560px) {
    .fi-rc-stats { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   ANNUAL REVIEW — AUTO-PROJECTED VALUES — v1.15.4
   ============================================================ */

.rv-label-required {
    color: #ef4444;
    font-weight: 700;
}

.rv-label-auto {
    font-size: 0.65rem;
    color: #10b981;
    font-weight: 600;
    background: #d1fae5;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rv-projected-wrap {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.rv-projected-input {
    background: transparent !important;
    color: #475569 !important;
    cursor: default;
    font-style: italic;
}

.rv-pct-of-target {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 3px;
}

.rv-delta-preview {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

.rv-delta-preview.rv-delta-pos {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.rv-delta-preview.rv-delta-neg {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

/* ============================================================
   PORTFOLIO TRAJECTORY — v1.16.0
   ============================================================ */

.traj-section-outer { margin-top: 48px; }

.traj-section {
    background: linear-gradient(160deg, #0f172a 0%, #0d1f3c 100%);
    border-radius: 20px;
    padding: 40px 36px;
    color: #f1f5f9;
    border: 1px solid #1e3a5f;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

/* Header */
.traj-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.traj-header-text h2 { font-size: 1.65rem; font-weight: 800; color: #f1f5f9; margin: 0 0 6px; }
.traj-header-text p  { color: #64748b; font-size: 0.88rem; margin: 0; }

.traj-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.traj-horizon-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.traj-btn-group { display: flex; gap: 4px; }

.traj-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #64748b;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.traj-btn:hover { background: rgba(255,255,255,0.1); color: #94a3b8; }
.traj-btn-active { background: rgba(99,102,241,0.2) !important; border-color: #6366f1 !important; color: #a5b4fc !important; }

.traj-inflation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
}

.traj-inflation-toggle input { accent-color: #6366f1; }

/* Mode Tabs */
.traj-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.traj-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #475569;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.traj-tab:hover { color: #94a3b8; }
.traj-tab-active { color: #a5b4fc !important; border-bottom-color: #6366f1 !important; }

/* Snapshot cards */
.traj-snapshot-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.traj-snap-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 18px 20px;
}

.traj-snap-label { font-size: 0.72rem; color: #475569; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; font-weight: 700; }
.traj-snap-value { font-size: 1.35rem; font-weight: 800; color: #f1f5f9; margin-bottom: 3px; }
.traj-snap-sub   { font-size: 0.72rem; color: #475569; }

.traj-snap-real .traj-snap-value { color: #34d399; }
.traj-snap-fi   .traj-snap-value { color: #a5b4fc; }

/* Chart */
.traj-chart-wrap { background: rgba(0,0,0,0.2); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.traj-chart { width: 100%; min-height: 200px; }

.traj-hover-zone { cursor: crosshair; }

/* Legend */
.traj-legend-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.traj-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.traj-legend-total { font-weight: 700; color: #f1f5f9; }
.traj-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.traj-legend-val { font-weight: 700; color: #f1f5f9; margin-left: 4px; }

/* Scenario panel */
.traj-scenario-panel { }
.traj-scenario-hint { font-size: 0.82rem; color: #64748b; margin: 0 0 20px; }

.traj-scenario-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }

.traj-scenario-row {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid var(--gear-color);
    border-radius: 10px;
    padding: 14px 18px;
    flex-wrap: wrap;
}

.traj-scenario-acct {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #e2e8f0;
    font-size: 0.88rem;
    min-width: 160px;
}

.traj-scenario-inputs { display: flex; gap: 24px; flex-wrap: wrap; }

.traj-sc-field { display: flex; flex-direction: column; gap: 4px; }
.traj-sc-field label { font-size: 0.68rem; color: #475569; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 700; }
.traj-sc-base { font-size: 0.88rem; color: #94a3b8; font-weight: 600; padding-top: 2px; }

.traj-sc-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.2s;
    min-width: 140px;
}

.traj-sc-input-wrap:focus-within { border-color: #6366f1; }

.traj-sc-input-wrap span {
    padding: 7px 6px 7px 10px;
    font-size: 0.8rem;
    color: #334155;
    font-weight: 600;
    flex-shrink: 0;
}

.traj-sc-input-wrap input {
    background: none;
    border: none;
    color: #f1f5f9;
    padding: 7px 8px 7px 0;
    font-size: 0.88rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.traj-sc-input-wrap input:focus { outline: none; }
.traj-sc-input-wrap input::placeholder { color: #1e293b; }

.traj-scenario-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.traj-sc-chart-wrap { }
.traj-sc-label { font-size: 0.78rem; font-weight: 700; margin-bottom: 8px; padding: 4px 10px; border-radius: 6px; display: inline-block; }
.traj-sc-a { background: rgba(100,116,139,0.15); color: #94a3b8; }
.traj-sc-b { background: rgba(99,102,241,0.15); color: #a5b4fc; }

.traj-sc-summary { margin-top: 4px; }
.traj-sc-summary-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.traj-sc-sum-item { display: flex; flex-direction: column; gap: 3px; }
.traj-sc-sum-item span { font-size: 0.72rem; color: #475569; text-transform: uppercase; letter-spacing: 0.3px; }
.traj-sc-sum-item strong { font-size: 1rem; font-weight: 800; color: #f1f5f9; }

.traj-sc-sum-diff { font-size: 0.88rem; font-weight: 700; padding: 6px 14px; border-radius: 20px; }
.diff-pos { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.diff-neg { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* Timeline events */
.traj-events-panel { }
.traj-events-hint { font-size: 0.82rem; color: #64748b; margin: 0 0 20px; }

.traj-event-add h4 { font-size: 0.9rem; color: #e2e8f0; margin: 0 0 12px; font-weight: 700; }

.traj-event-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 20px;
}

.traj-ef-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }

.traj-ef-field label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.traj-ef-field select,
.traj-ef-field input[type="number"] {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #f1f5f9;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
}

.traj-ef-field select { cursor: pointer; }
.traj-ef-field select option { background: #1e293b; color: #f1f5f9; }

.traj-ev-add-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    align-self: flex-end;
}

.traj-ev-add-btn:hover { background: #4f46e5; }

.traj-events-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }

.traj-event-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #fbbf24;
}

.traj-ev-icon { font-size: 0.9rem; }
.traj-ev-text { font-weight: 600; }

.traj-ev-remove {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}

.traj-events-empty { font-size: 0.82rem; color: #334155; margin: 0; }

.traj-ev-chart-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: #64748b;
    align-items: center;
}

.ev-leg-line {
    display: inline-block;
    width: 24px;
    height: 2px;
    border-radius: 1px;
    margin-right: 4px;
    vertical-align: middle;
}

.ev-leg-base   { background: #475569; }
.ev-leg-events { background: #f1f5f9; }

.traj-ev-comparison { margin-top: 12px; }

@media (max-width: 768px) {
    .traj-section { padding: 24px 16px; }
    .traj-scenario-charts { grid-template-columns: 1fr; }
    .traj-scenario-row { flex-direction: column; align-items: flex-start; }
    .traj-header { flex-direction: column; }
}

/* ============================================================
   TRAJECTORY TOOLTIP + INPUT READABILITY FIXES — v1.16.1
   ============================================================ */

/* DOM tooltip panel */
.traj-tooltip-panel {
    position: fixed;
    z-index: 9999;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 14px 16px;
    width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: none;
    display: none;
}

.traj-tip-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.traj-tip-year { font-size: 1rem; font-weight: 800; color: #f1f5f9; }
.traj-tip-cal  { font-size: 0.78rem; color: #475569; }

.traj-tip-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.traj-tip-total span  { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; }
.traj-tip-total strong { font-size: 1.05rem; font-weight: 800; color: #f1f5f9; }

.traj-tip-real {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #34d399;
    margin-bottom: 6px;
}

.traj-tip-divider {
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 8px 0;
}

.traj-tip-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.traj-tip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.traj-tip-name {
    font-size: 0.78rem;
    color: #94a3b8;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.traj-tip-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
}

/* Fix input text colour across all dark-theme inputs */
.fi-input-wrap input,
.fi-input-prefix-wrap input,
.fi-card-inputs input[type="text"],
.fi-card-inputs input[type="number"],
.fi-global-input-group input,
.traj-sc-input-wrap input,
.traj-ef-field input {
    color: #f1f5f9 !important;
    caret-color: #a5b4fc;
}

/* Make placeholder text clearly distinct from entered values */
.fi-input-wrap input::placeholder,
.fi-input-prefix-wrap input::placeholder,
.fi-card-inputs input::placeholder,
.traj-sc-input-wrap input::placeholder {
    color: #334155 !important;
    font-weight: 400 !important;
}

/* Ensure typed numbers are bright and easy to read */
.fi-input-wrap input:not(:placeholder-shown),
.fi-input-prefix-wrap input:not(:placeholder-shown),
.traj-sc-input-wrap input:not(:placeholder-shown) {
    color: #f1f5f9 !important;
    font-weight: 700 !important;
}

/* ============================================================
   TRAJECTORY HISTORY OVERLAY + CLEANUP — v1.16.2
   ============================================================ */

.traj-legend-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #64748b;
}

.traj-leg-white {
    display: inline-block;
    width: 18px;
    height: 2.5px;
    background: #f1f5f9;
    border-radius: 2px;
}

.traj-leg-coloured {
    display: inline-block;
    width: 18px;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #f59e0b);
    border-radius: 2px;
    opacity: 0.8;
}

.traj-leg-actual {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #f59e0b;
    border-radius: 50%;
    border: 2px solid #0f172a;
}

/* History note */
.traj-no-history {
    font-size: 0.82rem;
    color: #475569;
    padding: 14px 18px;
    background: rgba(245,158,11,0.05);
    border: 1px solid rgba(245,158,11,0.1);
    border-radius: 10px;
    margin-top: 12px;
    line-height: 1.6;
}

.traj-history-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.traj-hs-label  { font-size: 0.78rem; color: #64748b; }
.traj-hs-actual { font-size: 0.92rem; font-weight: 800; color: #f1f5f9; }
.traj-hs-vs     { font-size: 0.75rem; color: #475569; }
.traj-hs-ahead  { font-size: 0.85rem; font-weight: 700; color: #10b981; }
.traj-hs-behind { font-size: 0.85rem; font-weight: 700; color: #f87171; }

.traj-history-dot { cursor: pointer; }

/* ============================================================
   COLLAPSIBLE SECTIONS — v1.16.3
   ============================================================ */

.collapsible-section { }

.collapse-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px 24px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0;
    color: #f1f5f9;
}

/* Light theme sections (Annual Review) */
.review-section-outer .collapse-toggle {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.review-section-outer .collapse-toggle:hover { background: #f1f5f9; }

.collapse-toggle:hover {
    background: rgba(255,255,255,0.06);
}

.collapse-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.collapse-chevron {
    font-size: 0.78rem;
    color: #475569;
    transition: transform 0.25s;
}

.collapse-content {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    max-height: 9999px;
    opacity: 1;
}

.collapsible-section.collapsed .collapse-toggle {
    border-radius: 14px;
    margin-bottom: 0;
}

.collapsible-section.collapsed .collapse-content {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.collapsible-section:not(.collapsed) .collapse-toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.collapsible-section:not(.collapsed) .collapse-content > * {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ============================================================
   RA TAX BENEFIT CALCULATOR — v1.17.0
   ============================================================ */

.ra-tax-section-outer { margin-top: 48px; }

.ra-tax-section {
    background: linear-gradient(160deg, #0f172a 0%, #1a1040 100%);
    border-radius: 20px;
    padding: 40px 36px;
    color: #f1f5f9;
    border: 1px solid #312e81;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

/* Header */
.ra-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ra-header-text h2 { font-size: 1.65rem; font-weight: 800; color: #f1f5f9; margin: 0 0 6px; }
.ra-header-text p  { color: #64748b; font-size: 0.88rem; margin: 0; }

.ra-tax-year-badge {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* Inputs grid */
.ra-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.ra-input-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 24px;
}

.ra-block-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.ra-block-hint {
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 20px;
}

/* Income type radio */
.ra-income-type-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.ra-income-type {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #64748b;
    transition: all 0.2s;
    font-weight: 600;
}

.ra-income-type.active {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.4);
    color: #a5b4fc;
}

.ra-income-type input { accent-color: #6366f1; }

/* Fields */
.ra-field { margin-bottom: 16px; }

.ra-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.ra-optional { font-weight: 400; text-transform: none; color: #334155; }

.ra-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ra-input-wrap:focus-within {
    border-color: #6366f1;
    background: rgba(99,102,241,0.08);
}

.ra-input-wrap span {
    padding: 10px 8px 10px 12px;
    font-size: 0.82rem;
    color: #334155;
    font-weight: 600;
    flex-shrink: 0;
}

.ra-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: #f1f5f9;
    padding: 10px 10px 10px 0;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 0;
    caret-color: #a5b4fc;
}

.ra-input-wrap input:focus { outline: none; }
.ra-input-wrap input::placeholder { color: #1e293b; }

.ra-field input[type="number"] {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #f1f5f9;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ra-field input[type="number"]:focus { outline: none; border-color: #6366f1; }

.ra-field-hint {
    font-size: 0.7rem;
    color: #334155;
    margin-top: 4px;
    display: block;
}

/* Contribution cap */
.ra-cap-note { font-size: 0.78rem; color: #475569; margin-top: 12px; }

.ra-cap-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
    margin-bottom: 6px;
}

.ra-cap-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.ra-cap-bar-fill.over { background: linear-gradient(90deg, #f87171, #ef4444); }

.ra-cap-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ra-cap-limit { color: #475569; }

.ra-cap-warning {
    font-size: 0.75rem;
    color: #fca5a5;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px;
    padding: 7px 10px;
    margin-top: 6px;
}

/* Results */
.ra-empty {
    text-align: center;
    color: #334155;
    font-size: 0.9rem;
    padding: 32px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.07);
}

.ra-results-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.ra-panel-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #e2e8f0;
    margin: 0 0 16px;
}

/* Comparison table */
.ra-breakdown-panel, .ra-insight-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 24px;
}

.ra-comparison-table { margin-bottom: 20px; }

.ra-ct-header {
    display: grid;
    grid-template-columns: 1fr 90px 90px 90px;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 4px;
}

.ra-ct-header span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: right;
}

.ra-ct-without { color: #64748b; }
.ra-ct-with    { color: #a5b4fc; }
.ra-ct-saving  { color: #34d399; }

.ra-ct-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px 90px;
    gap: 4px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    align-items: center;
}

.ra-ct-row:last-child { border-bottom: none; }
.ra-ct-bold  { font-weight: 700; }
.ra-ct-small { opacity: 0.65; }

.ra-ct-label  { font-size: 0.78rem; color: #94a3b8; }
.ra-ct-col    { font-size: 0.78rem; color: #e2e8f0; text-align: right; }
.ra-ct-bold .ra-ct-label { color: #f1f5f9; font-size: 0.82rem; }
.ra-ct-bold .ra-ct-col   { font-size: 0.85rem; }

.ra-ct-saving-val { font-size: 0.78rem; text-align: right; font-weight: 700; }
.saving-pos { color: #34d399; }
.saving-neg { color: #f87171; }

.ra-ct-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 4px 0;
}

/* Bracket bar */
.ra-bracket-info { margin-bottom: 16px; }
.ra-bracket-bar-label { font-size: 0.7rem; color: #475569; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }

.ra-bracket-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 6px;
}

.ra-bracket-segment {
    flex: 1;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s;
}

.ra-bracket-segment.active {
    background: #6366f1;
    flex: 1.5;
}

.ra-bracket-rate {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
}

.ra-bracket-segment.active .ra-bracket-rate { color: white; }

.ra-bracket-caption { font-size: 0.75rem; color: #64748b; }

/* Rate pills */
.ra-rate-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ra-rate-pill {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 100px;
}

.ra-rate-pill span  { font-size: 0.65rem; color: #475569; text-transform: uppercase; letter-spacing: 0.3px; }
.ra-rate-pill strong { font-size: 0.92rem; font-weight: 800; color: #f1f5f9; }
.ra-rate-saving strong { color: #34d399; }

/* Insight cards */
.ra-insight-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.ra-insight-primary { border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.08); }
.ra-insight-icon   { font-size: 1.4rem; flex-shrink: 0; }
.ra-insight-label  { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.ra-insight-value  { font-size: 1.1rem; font-weight: 800; color: #f1f5f9; margin-bottom: 2px; }
.ra-insight-sub    { font-size: 0.72rem; color: #475569; }

/* Reinvestment card */
.ra-reinvest-card {
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 12px;
    padding: 18px;
    margin-top: 4px;
}

.ra-reinvest-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ra-reinvest-icon  { font-size: 1.1rem; }
.ra-reinvest-title { font-size: 0.88rem; font-weight: 700; color: #34d399; }
.ra-reinvest-desc  { font-size: 0.78rem; color: #64748b; margin-bottom: 14px; line-height: 1.5; }

.ra-reinvest-projections {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ra-rp-item {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.ra-rp-highlight { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); }
.ra-rp-years  { display: block; font-size: 0.65rem; color: #475569; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.ra-rp-value  { display: block; font-size: 0.88rem; font-weight: 800; color: #f1f5f9; }
.ra-rp-highlight .ra-rp-value { color: #34d399; }

.ra-reinvest-brokerage {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.ra-reinvest-brokerage strong { color: #34d399; }

/* What-if slider */
.ra-whatif-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 24px;
}

.ra-whatif-hint { font-size: 0.82rem; color: #475569; margin: 0 0 16px; }

.ra-slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ra-slider-label { font-size: 0.82rem; color: #94a3b8; white-space: nowrap; min-width: 160px; font-weight: 600; }

.ra-slider-row input[type="range"] {
    flex: 1;
    accent-color: #6366f1;
    height: 6px;
    min-width: 120px;
}

.ra-slider-val { font-size: 0.88rem; font-weight: 800; color: #a5b4fc; min-width: 120px; text-align: right; }

.ra-whatif-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ra-wf-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ra-wf-label { font-size: 0.68rem; color: #475569; text-transform: uppercase; letter-spacing: 0.3px; }
.ra-wf-val   { font-size: 1rem; font-weight: 800; color: #f1f5f9; }
.ra-wf-val.pos { color: #34d399; }
.ra-wf-val.neg { color: #f87171; }
/* ── Calculate button & stale indicator ─────────────────── */
.ra-calculate-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 8px;
}
.ra-calculate-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.ra-calculate-btn:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.ra-calculate-btn:active { transform: translateY(0); }
.ra-calculate-btn.ra-btn-stale {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245,158,11,0.3);
    animation: ra-pulse 1.5s ease-in-out infinite;
}
@keyframes ra-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
    50%       { box-shadow: 0 4px 20px rgba(245,158,11,0.6); }
}
.ra-stale-note {
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 600;
}
.ra-return-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(99,102,241,0.08);
    border-radius: 6px;
    border-left: 3px solid #6366f1;
}
/* ── Slider explainer ───────────────────────────────────── */
.ra-whatif-explainer {
    margin-bottom: 20px;
}
.ra-whatif-explainer-lead {
    font-size: 0.88rem;
    color: #94a3b8;
    margin: 0 0 14px;
    line-height: 1.5;
}
.ra-whatif-explainer-lead strong { color: #e2e8f0; }
.ra-whatif-explainer-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}
.ra-we-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 12px;
}
.ra-we-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.ra-we-card strong { font-size: 0.8rem; color: #e2e8f0; display: block; margin-bottom: 4px; }
.ra-we-card p { font-size: 0.75rem; color: #64748b; margin: 0; line-height: 1.45; }
@media (max-width: 600px) {
    .ra-whatif-explainer-cards { grid-template-columns: 1fr; }
}
/* ── Slider custom amount input ─────────────────────────── */
.ra-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ra-slider-custom {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 4px 10px;
    flex-shrink: 0;
}
.ra-slider-custom span {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 600;
}
.ra-slider-custom input[type="text"] {
    background: transparent;
    border: none;
    outline: none;
    color: #a5b4fc;
    font-weight: 800;
    font-size: 0.82rem;
    width: 110px;
    text-align: right;
}
.ra-slider-custom input[type="text"]::placeholder { color: #475569; font-size: 0.72rem; font-weight: 400; }




/* Responsive */
@media (max-width: 900px) {
    .ra-inputs-grid { grid-template-columns: 1fr; }
    .ra-results-grid { grid-template-columns: 1fr; }
    .ra-whatif-cards { grid-template-columns: 1fr 1fr; }
    .ra-ct-row, .ra-ct-header { grid-template-columns: 1fr 80px 80px 80px; }
}

@media (max-width: 560px) {
    .ra-tax-section { padding: 24px 16px; }
    .ra-whatif-cards { grid-template-columns: 1fr 1fr; }
    .ra-reinvest-projections { flex-direction: column; }
    .ra-ct-row, .ra-ct-header { grid-template-columns: 1fr 70px 70px 70px; font-size: 0.7rem; }
}

/* ============================================================
   APP SHELL + TAB NAVIGATION — v1.17.1
   ============================================================ */

/* Reset container for new shell */
body { margin: 0; padding: 0; }

.app-shell {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 0 60px;
    background: #f1f5f9;
    min-height: 100vh;
    position: relative; /* ensure stacking context below fixed banners */
    z-index: 1;
}

/* Dark header + tabs, light content panels */
#tab_projection { background: #f1f5f9; }
#tab_tax        { background: #f1f5f9; }
#tab_fi         { background: #f1f5f9; }
#tab_review     { background: #f1f5f9; }

/* App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px 24px;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-border);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Guide button in header — matches toggle pill exactly */
.app-header-actions .guide-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--toggle-bg);
    border: 1px solid var(--toggle-border);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--toggle-color);
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.2px;
    transition: all 0.2s;
    flex-shrink: 0;
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

.app-header-actions .guide-btn:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    transform: none;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

[data-theme="light"] .app-header-actions .guide-btn {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

/* ── Save State Button (v1.9.0) ───────────────────────────────────────── */
.save-state-btn {
    background: var(--color-accent, #10b981) !important;
    border-color: var(--color-accent, #10b981) !important;
    color: #ffffff !important;
    min-width: 80px;
}
.save-state-btn:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.4);
}
.save-state-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.save-state-ts {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-left: 4px;
    white-space: nowrap;
}


.app-header-brand h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--chrome-text);
    margin: 0 0 2px;
    letter-spacing: -0.3px;
}

.app-header-brand p {
    font-size: 0.78rem;
    color: var(--chrome-text-dim);
    margin: 0;
}

/* Tab Nav */
.tab-nav {
    display: flex;
    gap: 8px;
    padding: 20px 32px;
    background: var(--chrome-bg);
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--chrome-border);
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav-btn {
    background: var(--chrome-tab-btn);
    border: 1px solid var(--chrome-tab-border);
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--chrome-tab-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.1px;
}

.tab-nav-btn:hover {
    background: var(--chrome-tab-hover);
    color: var(--chrome-tab-hover-color);
    border-color: var(--chrome-tab-hover-border);
}

.tab-nav-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: tabFadeIn 0.2s ease;
}

.tab-panel.active { display: block; }

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

.tab-inner {
    padding: 32px;
    max-width: 1300px;
}

/* Projection tab keeps the existing .container styles */
#tab_projection .container {
    padding-top: 24px;
}

/* Override container max-width inside shell */
.app-shell .container {
    max-width: 100%;
    padding-left: 32px;
    padding-right: 32px;
}

/* Remove top margin from section wrappers inside tabs */
.tab-inner .fi-section-outer,
.tab-inner .ra-tax-section-outer,
.tab-inner .review-section-outer,
.tab-inner .traj-section-outer {
    margin-top: 0;
}

/* Legal banner at top stays full width */
.legal-banner { position: relative; z-index: 10; }

@media (max-width: 640px) {
    .app-header { padding: 16px 16px 0; }
    .tab-nav    { padding: 12px 16px 0; gap: 0; }
    .tab-nav-btn { padding: 10px 14px; font-size: 0.8rem; }
    .tab-inner  { padding: 20px 16px; }
    .app-shell .container { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================
   TERMS OF SERVICE MODAL — v1.17.7
   ============================================================ */

.terms-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.terms-modal-box {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    color: #f1f5f9;
    text-align: center;
}

.terms-modal-header {
    margin-bottom: 20px;
}

.terms-modal-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }

.terms-modal-box h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0;
}

.terms-modal-body {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 16px;
    line-height: 1.6;
}

.terms-modal-disclaimer {
    font-size: 0.82rem;
    color: #64748b;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 28px;
    line-height: 1.5;
    text-align: left;
}

.terms-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.terms-read-btn {
    display: block;
    padding: 12px 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.terms-read-btn:hover { background: rgba(255,255,255,0.1); }

.terms-accept-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #6366f1;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.terms-accept-btn:hover {
    background: #4f46e5;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.terms-modal-note {
    font-size: 0.72rem;
    color: #334155;
    margin: 0;
}

/* ============================================================
   ANNUAL REVIEW HOW-TO NOTE — v1.17.9
   ============================================================ */

.review-how-to-use {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.82rem;
    color: #0c4a6e;
    line-height: 1.6;
    margin-bottom: 20px;
}

.review-how-to-use em {
    font-style: normal;
    font-weight: 700;
    color: #0369a1;
}

/* ── What-if summary sentence ───────────────────────────── */
.ra-whatif-summary {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(99,102,241,0.08);
    border-left: 3px solid #6366f1;
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.55;
}
.ra-whatif-summary strong { color: #e2e8f0; }

/* ── Slider step note ───────────────────────────────────── */
.ra-slider-step-note {
    font-size: 0.75rem;
    color: #475569;
    margin: 6px 0 0;
    font-style: italic;
}

/* ── Split contribution breakdown card ──────────────────── */
.ra-insight-split { flex-direction: column; align-items: flex-start; }
.ra-split-note {
    font-size: 0.75rem;
    color: #64748b;
    margin: 6px 0 12px;
    line-height: 1.5;
    font-style: italic;
}
.ra-split-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ra-split-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
}
.ra-split-label { color: #cbd5e1; font-weight: 600; }
.ra-split-amount { color: #94a3b8; font-weight: 400; margin-left: 6px; }
.ra-split-saving { color: #34d399; font-weight: 700; white-space: nowrap; }
.ra-split-net { color: #94a3b8; font-size: 0.75rem; white-space: nowrap; }
@media (max-width: 600px) {
    .ra-split-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Reinvest card pension note ─────────────────────────── */
.ra-reinvest-note {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    font-style: italic;
    margin-top: 4px;
}

/* ============================================================
   DRAWDOWN CALCULATOR — v1.18.2
   ============================================================ */

.dd-section-outer { padding: 0; }

.dd-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 0 48px;
}

/* Header */
.dd-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.dd-header h2 { margin: 0 0 6px; font-size: 1.5rem; color: var(--text-primary, #1a202c); }
.dd-header p  { margin: 0; color: var(--text-muted, #64748b); font-size: 0.95rem; }
.dd-disclaimer-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Global inputs */
.dd-global-inputs {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.dd-global-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 28px;
    align-items: start;
}
/* Cap hint text so it doesn't stretch the card height excessively */
.dd-field-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.4;
    max-height: 5.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    position: relative; /* tooltip anchor */
}

/* ── Tooltip (desktop hover) ───────────────────────────────────────────── */
.dd-field-hint::after {
    content: attr(data-tooltip);
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 280px;
    max-width: min(280px, 90vw);
    background: var(--surface-2, #1e293b);
    color: var(--text, #f1f5f9);
    font-size: 0.75rem;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    z-index: 200;
    white-space: normal;
    pointer-events: none;
}
/* Arrow */
.dd-field-hint::before {
    content: '';
    display: none;
    position: absolute;
    bottom: calc(100% + 2px);
    left: 14px;
    border: 6px solid transparent;
    border-top-color: var(--surface-2, #1e293b);
    z-index: 201;
    pointer-events: none;
}

/* ── ⓘ icon (hidden on desktop, shown on mobile) ──────────────────────── */
.dd-hint-icon {
    display: none;
    background: none;
    border: none;
    padding: 0 0 0 4px;
    font-size: 0.8rem;
    color: var(--primary, #38bdf8);
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Desktop: hover over hint text shows tooltip */
@media (hover: hover) and (pointer: fine) {
    .dd-field-hint:hover {
        overflow: visible;
        -webkit-line-clamp: unset;
        max-height: none;
    }
    .dd-field-hint:hover::after,
    .dd-field-hint:hover::before {
        display: block;
    }
}

/* Mobile: show ⓘ icon; tap to toggle tooltip via .dd-hint-open class */
@media (hover: none), (pointer: coarse) {
    .dd-hint-icon {
        display: inline;
    }
    .dd-field-hint.dd-hint-open {
        overflow: visible;
        -webkit-line-clamp: unset;
        max-height: none;
    }
    .dd-field-hint.dd-hint-open::after,
    .dd-field-hint.dd-hint-open::before {
        display: block;
    }
}
.dd-fi-sync-note {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dd-sync-btn {
    background: none;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-primary, #1a202c);
    transition: background 0.15s;
}
.dd-sync-btn:hover { background: var(--border, #e2e8f0); }

/* Cards */
.dd-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.dd-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}
.dd-card-header h3 { margin: 0 0 4px; font-size: 1.15rem; color: var(--text-primary, #1a202c); }
.dd-card-subtitle  { margin: 0; color: var(--text-muted, #64748b); font-size: 0.88rem; }

/* Fields */
.dd-field { display: flex; flex-direction: column; gap: 5px; }
.dd-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #374151);
}
/* Labels in global grid: consistent 2-line reserve so inputs align.
   Only applies inside the global grid, not the flex inputs row or toggle. */
.dd-global-grid .dd-field > label:not(.dd-toggle) {
    min-height: 2.4em;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3px;
}
.dd-unit { font-weight: 400; color: var(--text-muted, #64748b); }
.dd-field input[type="number"],
.dd-field input[type="text"] {
    padding: 9px 12px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #1a202c);
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.dd-field input:focus { outline: none; border-color: #10b981; }


.dd-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    background: var(--input-bg, #fff);
    transition: border-color 0.15s;
}
.dd-input-wrap:focus-within { border-color: #10b981; }
.dd-input-wrap > span {
    padding: 0 10px;
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    background: var(--surface, #f8fafc);
    border-right: 1px solid var(--border, #e2e8f0);
    align-self: stretch;
    display: flex;
    align-items: center;
}
.dd-input-wrap input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
    padding: 9px 12px;
}
.dd-input-wrap input:focus { outline: none; }

.dd-inputs-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 20px;
    margin-bottom: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .dd-inputs-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .dd-inputs-row { grid-template-columns: 1fr; }
}

.dd-field-toggle { justify-content: flex-start; }

/* Toggle switch */
.dd-toggle { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.dd-toggle input { opacity: 0; width: 0; height: 0; }
.dd-toggle-slider {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s;
}
.dd-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.dd-toggle input:checked + .dd-toggle-slider { background: #10b981; }
.dd-toggle input:checked + .dd-toggle-slider::before { transform: translateX(20px); }

/* Calculate button */
.dd-calculate-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    margin-bottom: 24px;
}
.dd-calculate-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.dd-calculate-btn:active { transform: translateY(0); }

/* Results */
.dd-results { animation: ddFadeIn 0.3s ease; }
@keyframes ddFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.dd-result-summary {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dd-summary-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    min-width: 240px;
    flex: 1;
}
.dd-status-good    { background: #d1fae5; border: 1.5px solid #6ee7b7; }
.dd-status-warning { background: #fef3c7; border: 1.5px solid #fcd34d; }
.dd-status-danger  { background: #fee2e2; border: 1.5px solid #fca5a5; }
.dd-status-info    { background: #dbeafe; border: 1.5px solid #93c5fd; }

.dd-summary-icon  { font-size: 2rem; }
.dd-summary-label { font-size: 0.8rem; font-weight: 600; color: #374151; text-transform: uppercase; letter-spacing: 0.04em; }
.dd-summary-value { font-size: 1.5rem; font-weight: 700; color: #111827; line-height: 1.2; }
.dd-summary-sub   { font-size: 0.82rem; color: #4b5563; margin-top: 3px; }

.dd-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 2;
    align-items: center;
}
.dd-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    min-width: 110px;
}
.dd-kpi-label { font-size: 0.75rem; color: var(--text-muted, #64748b); }
.dd-kpi-value { font-size: 1.05rem; font-weight: 700; color: var(--text-primary, #111827); }

/* Chart */
.dd-chart-wrap {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}
.dd-chart-title { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary, #374151); margin-bottom: 8px; }
.dd-chart { width: 100%; max-height: 200px; display: block; }
.dd-chart-label { font-size: 11px; fill: #94a3b8; font-family: inherit; }
.dd-chart-grid  { stroke: #e2e8f0; stroke-width: 0.5; }

/* Tables */
.dd-milestone-table { margin-bottom: 24px; }
.dd-milestone-table h4 { font-size: 0.95rem; margin: 0 0 12px; color: var(--text-primary, #1a202c); }
.dd-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border, #e2e8f0); }
.dd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.dd-table th {
    background: var(--surface, #f8fafc);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #374151);
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.dd-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    color: var(--text-primary, #1a202c);
}
.dd-table tr:last-child td { border-bottom: none; }
.dd-row-depleted td { background: #fef2f2; }
.dd-row-low td { background: #fffbeb; }
.dd-row-active { background: #f0fdf4 !important; font-weight: 600; }
.dd-col-growth     { color: #059669; }
.dd-col-withdrawal { color: #dc2626; }
.dd-col-depleted   { color: #dc2626; font-weight: 600; }
.dd-col-warning    { color: #d97706; font-weight: 600; }

/* Insight box */
.dd-insight-box {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-left: 4px solid #10b981;
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    font-size: 0.88rem;
    color: var(--text-secondary, #374151);
    line-height: 1.6;
    margin-bottom: 16px;
}
.dd-insight-annuity { border-left-color: #3b82f6; }
.dd-insight-box ul  { margin: 8px 0 0; padding-left: 18px; }
.dd-insight-box li  { margin-bottom: 4px; }

.dd-empty {
    text-align: center;
    padding: 28px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
    background: var(--surface, #f8fafc);
    border-radius: 10px;
    border: 1px dashed var(--border, #e2e8f0);
}

/* Annuity explainer */
.dd-annuity-explainer {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--text-secondary, #374151);
}
.dd-annuity-explainer p { margin: 0 0 12px; line-height: 1.6; }
.dd-annuity-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.dd-at-card {
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.85rem;
}
.dd-at-card strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.dd-at-card p { margin: 0; color: var(--text-muted, #64748b); line-height: 1.4; }
.dd-at-living.active { border-color: #10b981; background: #f0fdf4; }
.dd-at-life.active   { border-color: #3b82f6; background: #eff6ff; }
.dd-at-card:hover    { border-color: #94a3b8; }
.dd-annuity-advice-note {
    margin: 0 !important;
    color: #92400e !important;
    background: #fef3c7;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem !important;
}

.dd-lump-summary {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.dd-lump-summary h4 { margin: 0 0 12px; font-size: 0.95rem; }
.dd-lump-note {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: 10px;
}
.dd-annuity-income-summary { margin-bottom: 24px; }
.dd-annuity-income-summary h4 { margin: 0 0 12px; font-size: 0.95rem; }
.dd-annuity-comparison { margin-bottom: 24px; }
.dd-annuity-comparison h4 { margin: 0 0 6px; font-size: 0.95rem; }
.dd-comparison-note { font-size: 0.85rem; color: var(--text-muted, #64748b); margin: 0 0 12px; }

/* Mobile */
@media (max-width: 600px) {
    .dd-card { padding: 18px 14px; }
    .dd-global-grid { grid-template-columns: 1fr 1fr; gap: 16px 20px; }
    .dd-field-hint { -webkit-line-clamp: 6; max-height: 8em; } /* slightly more lines on tablet */
    .dd-inputs-row  { grid-template-columns: 1fr; }
    .dd-annuity-types { grid-template-columns: 1fr; }
    .dd-result-summary { flex-direction: column; }
    .dd-kpi-row { flex-direction: row; flex-wrap: wrap; }
    .dd-summary-card { min-width: unset; width: 100%; }
    .dd-header { flex-direction: column; }
    .dd-disclaimer-badge { align-self: flex-start; }
}

/* ============================================================
   DRAWDOWN — Educational / Explainer Elements
   ============================================================ */

.dd-tab-intro {
    background: linear-gradient(135deg, #f0fdf4, #eff6ff);
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 24px;
}
.dd-intro-lead {
    font-size: 1.05rem;
    color: #1e3a5f;
    margin-bottom: 12px;
    line-height: 1.5;
}
.dd-tab-intro p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.65;
}
.dd-tab-intro p:last-of-type { margin-bottom: 0; }

.dd-intro-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 16px 0;
}
.dd-intro-section-card {
    display: flex;
    gap: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    align-items: flex-start;
}
.dd-intro-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.dd-intro-section-card strong { display: block; font-size: 0.9rem; margin-bottom: 5px; color: #111827; }
.dd-intro-section-card p { margin: 0; font-size: 0.83rem; color: #4b5563; line-height: 1.5; }

.dd-intro-note {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #713f12;
    line-height: 1.5;
    margin-top: 16px;
}

/* Global inputs header */
.dd-global-header { margin-bottom: 16px; }
.dd-global-header h3 { margin: 0 0 4px; font-size: 1rem; color: var(--text-primary, #1a202c); }
.dd-global-subtitle { margin: 0; font-size: 0.85rem; color: var(--text-muted, #64748b); }

.dd-fi-sync-empty {
    color: #6b7280;
    font-style: italic;
}

/* Section explainers */
.dd-section-explainer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.dd-section-explainer > div { }
.dd-section-explainer strong {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #374151;
    margin-bottom: 8px;
}
.dd-section-explainer p {
    margin: 0 0 8px;
    font-size: 0.87rem;
    color: #4b5563;
    line-height: 1.65;
}
.dd-section-explainer p:last-child { margin-bottom: 0; }
.dd-explainer-rule {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 16px;
    margin-top: 4px;
}

/* Annuity explainer improvements */
.dd-annuity-explainer > p:first-child {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 14px;
}
.dd-at-card p { font-size: 0.83rem; }
.dd-at-card em { font-size: 0.8rem; color: #6b7280; display: block; margin-top: 8px; font-style: italic; }

@media (max-width: 600px) {
    .dd-intro-sections  { grid-template-columns: 1fr; }
    .dd-section-explainer { grid-template-columns: 1fr; }
    .dd-explainer-rule  { grid-column: 1; }
    .dd-tab-intro       { padding: 16px; }
}

/* ============================================================
   DRAWDOWN — Three-scenario results + summary sentence
   ============================================================ */

.dd-scenario-explainer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.85rem;
    color: #1e3a5f;
    line-height: 1.6;
    margin-bottom: 20px;
}
.dd-scenario-explainer strong { margin-right: 4px; }

.dd-scenarios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.dd-scenario-card {
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dd-scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.88rem;
}
.dd-scenario-rate {
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.8;
}
.dd-scenario-outcome { font-size: 1rem; font-weight: 700; }
.dd-scenario-good { color: #065f46; }
.dd-scenario-bad  { color: #991b1b; }
.dd-scenario-balance { font-size: 0.78rem; opacity: 0.75; }

.dd-summary-sentence {
    background: linear-gradient(135deg, #f0fdf4, #eff6ff);
    border: 1.5px solid #a7f3d0;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 0.92rem;
    color: #1a202c;
    line-height: 1.7;
    margin-top: 20px;
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .dd-scenarios { grid-template-columns: 1fr; }
}

/* ============================================================
   DRAWDOWN — Combined Income Panel
   ============================================================ */

.dd-combined-panel {
    margin-top: 8px;
    animation: ddFadeIn 0.3s ease;
}

.dd-combined-inner {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 28px 32px;
    color: white;
}

[data-theme="light"] .dd-combined-inner {
    background: #1e293b;
    border-color: rgba(255,255,255,0.1);
}

.dd-combined-inner h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    color: white;
}

.dd-combined-subtitle {
    margin: 0 0 24px;
    font-size: 0.88rem;
    color: #94a3b8;
}

/* .dd-combined-kpis replaced by .dd-combined-layout */

.dd-ckpi {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}
.dd-ckpi-empty {
    color: #475569;
    font-size: 0.85rem;
    font-style: italic;
    border-style: dashed;
}
.dd-ckpi-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}
.dd-ckpi-value {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
    line-height: 1.1;
    word-break: break-word;
}
.dd-ckpi-sub {
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.4;
}
.dd-ckpi-plus,
.dd-ckpi-equals {
    font-size: 1.3rem;
    color: #475569;
    flex: 0 0 auto;
    padding: 0;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 32px;
}
.dd-ckpi-total {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}
.dd-ckpi-total .dd-ckpi-value {
    color: #34d399;
    font-size: 1.45rem;
}

.dd-combined-gap {
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.dd-gap-surplus {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}
.dd-gap-shortfall {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.dd-combined-scenarios {
    margin-bottom: 20px;
}
.dd-combined-scenarios-label {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.dd-combined-scenario {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.87rem;
}
.dd-combined-scenario.dd-status-good    { background: rgba(16,185,129,0.1);  border: 1px solid rgba(16,185,129,0.2); }
.dd-combined-scenario.dd-status-warning { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.2); }
.dd-combined-scenario.dd-status-danger  { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.2);  }
.dd-cs-header { flex: 1; font-weight: 600; color: #e2e8f0; }
.dd-cs-income { font-weight: 700; color: white; min-width: 140px; text-align: right; }
.dd-cs-note   { font-size: 0.78rem; color: #94a3b8; min-width: 180px; text-align: right; }

.dd-combined-note {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.6;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 14px;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .dd-combined-inner    { padding: 18px 16px; }
    .dd-combined-kpis     { grid-template-columns: 1fr; gap: 8px 0; }
    .dd-ckpi-plus,
    .dd-ckpi-equals       { justify-content: center; align-self: auto; width: auto; font-size: 1.1rem; }
    .dd-cs-note           { display: none; }
    .dd-cs-income         { min-width: unset; }
}

/* ============================================================
   DRAWDOWN — Projection breakdown display
   ============================================================ */

.dd-proj-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dd-projection-breakdown {
    margin-top: 10px;
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.8rem;
}

.dd-proj-header {
    color: #4b5563;
    margin-bottom: 10px;
    font-weight: 500;
    line-height: 1.5;
}

.dd-proj-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    flex-wrap: wrap;
}
.dd-proj-row:last-of-type { border-bottom: none; }

.dd-proj-icon    { font-size: 0.95rem; flex-shrink: 0; }
.dd-proj-label   { flex: 1; min-width: 100px; color: #374151; font-weight: 500; }
.dd-proj-current { color: #94a3b8; white-space: nowrap; }
.dd-proj-arrow   { color: #cbd5e1; }
.dd-proj-value   { color: #111827; font-weight: 600; white-space: nowrap; }
.dd-proj-growth  { color: #059669; font-size: 0.75rem; white-space: nowrap; }

.dd-proj-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border, #e2e8f0);
    font-weight: 700;
    color: #111827;
    text-align: right;
}

@media (max-width: 600px) {
    .dd-proj-current,
    .dd-proj-arrow,
    .dd-proj-growth { display: none; }
    .dd-proj-row    { gap: 6px; }
}

/* ============================================================
   DRAWDOWN — Progressive disclosure & split tool
   ============================================================ */

/* Learn more toggles */
.dd-learn-more {
    margin-top: 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}
.dd-learn-more summary {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
    background: #eff6ff;
    list-style: none;
    user-select: none;
}
.dd-learn-more summary::-webkit-details-marker { display: none; }
.dd-learn-more summary::before { content: '▶ '; font-size: 0.75rem; }
.dd-learn-more[open] summary::before { content: '▼ '; }
.dd-learn-more-body {
    padding: 14px 16px;
    font-size: 0.87rem;
    color: #374151;
    line-height: 1.65;
    background: white;
    border-top: 1px solid #dbeafe;
}
.dd-learn-more-body p { margin: 0 0 10px; }
.dd-learn-more-body p:last-child { margin-bottom: 0; }

/* Compact explainer */
.dd-explainer-compact {
    display: block !important;
    padding: 16px 20px;
}
.dd-explainer-compact > p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

/* Rate source note */
.dd-rate-source {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--surface, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
    line-height: 1.5;
}
.dd-escalation-projection {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-weight: 500;
    color: #374151;
}
.dd-escalation-projection strong { display: block; width: 100%; margin-bottom: 2px; }

/* Split tool */
.dd-split-tool {
    background: var(--card-bg, #fff);
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 20px;
}
.dd-split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}
.dd-split-header h4 { margin: 0; font-size: 1rem; color: #1e3a5f; }
.dd-split-toggle {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.82rem;
    color: #1d4ed8;
    cursor: pointer;
    font-weight: 600;
}
.dd-split-body {
    display: none;
    margin-top: 18px;
    animation: ddFadeIn 0.25s ease;
}
.dd-split-body.dd-split-open { display: block; }

.dd-split-explainer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.6;
}
.dd-split-explainer p { margin: 0 0 12px; }
.dd-split-explainer p:last-child { margin-bottom: 0; }

.dd-split-strategy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}
.dd-split-strat-card {
    display: flex;
    gap: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    align-items: flex-start;
}
.dd-split-strat-icon { font-size: 1.3rem; flex-shrink: 0; }
.dd-split-strat-card strong { display: block; font-size: 0.85rem; margin-bottom: 4px; color: #111827; }
.dd-split-strat-card p { margin: 0; font-size: 0.82rem; color: #4b5563; line-height: 1.5; }
.dd-split-key-q { background: #fef9c3; border-radius: 6px; padding: 10px 12px; font-size: 0.85rem !important; }

.dd-split-factors { margin-bottom: 16px; }
.dd-split-detail {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.dd-split-detail summary {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    background: #f8fafc;
    list-style: none;
}
.dd-split-detail summary::-webkit-details-marker { display: none; }
.dd-split-detail summary::before { content: '▶ '; font-size: 0.75rem; color: #94a3b8; }
.dd-split-detail[open] summary::before { content: '▼ '; }
.dd-split-detail-body { padding: 14px 16px; }

.dd-split-factor-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dd-split-factor-table th {
    background: #f1f5f9;
    padding: 8px 12px;
    text-align: left;
    font-size: 0.78rem;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
}
.dd-split-factor-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #4b5563;
    vertical-align: top;
}
.dd-split-factor-table tr:last-child td { border-bottom: none; }
.dd-split-factor-table td:first-child { font-weight: 600; color: #111827; white-space: nowrap; }

.dd-split-table-title { margin: 0 0 6px; font-size: 0.92rem; color: #1a202c; }

.dd-split-summary-sentence {
    background: linear-gradient(135deg, #f0fdf4, #eff6ff);
    border: 1.5px solid #a7f3d0;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #1a202c;
    line-height: 1.7;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .dd-split-strategy  { grid-template-columns: 1fr; }
    .dd-split-header    { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dd-split-factor-table td:first-child { white-space: normal; }
    .dd-escalation-projection { flex-direction: column; gap: 4px; }
}

/* ============================================================
   DRAWDOWN — Current age display
   ============================================================ */
.dd-current-age-note {
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1d4ed8;
    padding: 6px 12px;
    background: #eff6ff;
    border-radius: 6px;
    display: inline-block;
}

/* ============================================================
   DRAWDOWN — Tax panel, disclosures, rate mismatch
   ============================================================ */

/* Rate mismatch note */
.dd-rate-mismatch-note {
    margin-top: 8px;
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.8rem;
    color: #713f12;
    line-height: 1.55;
}

/* Income tax panel */
.dd-tax-panel {
    background: var(--surface, #f8fafc);
    border: 1.5px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 0 12px 12px 0;
    margin: 16px 0;
    overflow: hidden;
}
.dd-tax-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #eef2ff;
    font-weight: 600;
    font-size: 0.88rem;
    color: #3730a3;
    gap: 12px;
}
.dd-tax-year-badge {
    font-size: 0.75rem;
    background: #c7d2fe;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.dd-tax-body { padding: 14px 16px; }
.dd-tax-explainer {
    font-size: 0.85rem;
    color: #374151;
    margin: 0 0 12px;
    line-height: 1.6;
}
.dd-tax-kpis {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.dd-tax-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    flex: 1;
    min-width: 120px;
}
.dd-tax-kpi-net {
    border-color: #6366f1;
    background: #eef2ff;
}
.dd-tax-kpi-label {
    font-size: 0.75rem;
    color: #64748b;
}
.dd-tax-kpi strong {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}
.dd-tax-kpi-net strong { color: #3730a3; }
.dd-tax-disclaimer {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.55;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 4px;
}

/* Flex disclosures */
.dd-flex-disclosures {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.dd-disclosure-item {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.83rem;
    color: #374151;
    line-height: 1.6;
}
.dd-disclosure-item strong {
    display: block;
    margin-bottom: 5px;
    color: #111827;
    font-size: 0.85rem;
}
.dd-disclosure-item p { margin: 0; }

/* Combined panel tax note */
.dd-combined-tax-note {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #c7d2fe;
    margin-bottom: 16px;
    line-height: 1.55;
}
.dd-combined-tax-note strong { color: white; }

@media (max-width: 600px) {
    .dd-tax-kpis { flex-direction: column; }
    .dd-tax-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   DRAWDOWN — Combined panel gear breakdown
   ============================================================ */
.dd-ckpi-breakdown {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.dd-ckpi-gear {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: #94a3b8;
    gap: 8px;
}
.dd-ckpi-gear-note {
    color: #475569;
    font-style: italic;
    font-size: 0.72rem;
    justify-content: flex-start;
    margin-top: 2px;
}

/* ============================================================
   DRAWDOWN — Projection breakdown full-width horizontal layout
   ============================================================ */

/* Override — when breakdown is full-width, display as horizontal cards */
.dd-projection-breakdown {
    margin-top: 12px;
    margin-bottom: 4px;
}

.dd-proj-rows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0 4px;
}

.dd-proj-card {
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dd-proj-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.dd-proj-card-current {
    font-size: 0.78rem;
    color: #94a3b8;
}

.dd-proj-card-value {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.dd-proj-card-growth {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
}

.dd-proj-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border, #e2e8f0);
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
    gap: 8px;
}

.dd-proj-total-label { color: #374151; font-weight: 600; }

@media (max-width: 600px) {
    .dd-proj-rows-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   SUMMARY TAB — v1.19.5
   ============================================================ */

.sum-section-outer { padding: 0; }
.sum-section { max-width: 960px; margin: 0 auto; padding: 0 0 48px; }

/* Header */
.sum-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.sum-header h2 { margin: 0 0 4px; font-size: 1.5rem; color: var(--text-primary, #1a202c); }
.sum-date { margin: 0; font-size: 0.85rem; color: var(--text-muted, #64748b); }
.sum-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.sum-verify-btn {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-primary, #1a202c);
    font-weight: 500;
}
.sum-download-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.sum-download-btn:hover { opacity: 0.9; }
.sum-download-partial { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Verification panel */
.sum-verify-panel {
    background: var(--card-bg, #fff);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.sum-verify-header {
    margin-bottom: 16px;
}
.sum-verify-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #1a202c);
    margin-bottom: 4px;
}
.sum-verify-soft {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}
.sum-verify-items { display: flex; flex-direction: column; gap: 8px; }
.sum-verify-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
}
.sum-verify-ok      { background: #f0fdf4; border: 1px solid #bbf7d0; }
.sum-verify-warning { background: #fefce8; border: 1px solid #fde68a; }
.sum-verify-missing { background: #fef2f2; border: 1px solid #fecaca; }
.sum-verify-info    { background: #eff6ff; border: 1px solid #bfdbfe; }

.sum-verify-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.sum-verify-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sum-verify-tab { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #374151; }
.sum-verify-label { font-weight: 600; color: #111827; }
.sum-verify-detail { font-size: 0.8rem; color: #6b7280; line-height: 1.4; }
.sum-go-btn {
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    color: #374151;
}
.sum-go-btn:hover { background: #f8fafc; }

/* Summary cards grid */
.sum-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sum-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sum-card-empty { opacity: 0.7; }
.sum-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.sum-card-icon { font-size: 1.1rem; }
.sum-card-title { flex: 1; font-size: 0.88rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.04em; }
.sum-card-link {
    background: none;
    border: none;
    color: #10b981;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
}
.sum-card-main { font-size: 1.5rem; font-weight: 800; color: #111827; line-height: 1.2; margin-bottom: 2px; }
.sum-card-sub { font-size: 0.82rem; color: #64748b; margin-bottom: 8px; }
.sum-card-detail { font-size: 0.8rem; color: #4b5563; margin-top: 4px; }
.sum-card-note { font-size: 0.78rem; color: #64748b; font-style: italic; margin-top: 6px; }
.sum-card-empty-msg { font-size: 0.85rem; color: #94a3b8; font-style: italic; }

/* FI Progress bar */
.sum-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0 4px;
}
.sum-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Portfolio gear list */
.sum-gear-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sum-gear-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    padding: 4px 0;
}
.sum-gear-icon { font-size: 0.9rem; flex-shrink: 0; }
.sum-gear-label { flex: 1; color: #374151; }
.sum-gear-value { font-weight: 600; color: #111827; white-space: nowrap; }
.sum-gear-bar {
    width: 60px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.sum-gear-bar-fill { height: 100%; border-radius: 2px; }
.sum-portfolio-total {
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 8px;
}

/* Download section */
.sum-download-section {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 20px 24px;
}
.sum-download-section h3 { margin: 0 0 6px; font-size: 1rem; color: var(--text-primary, #1a202c); }
.sum-download-note { margin: 0 0 16px; font-size: 0.85rem; color: var(--text-muted, #64748b); }
.sum-download-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.sum-dl-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border, #e2e8f0);
    background: white;
    color: var(--text-primary, #1a202c);
    transition: background 0.15s;
}
.sum-dl-btn:hover { background: var(--surface, #f8fafc); }
.sum-dl-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
}
.sum-dl-primary:hover { opacity: 0.92; background: linear-gradient(135deg, #10b981, #059669); }
.sum-dl-partial { display: block; font-size: 0.75rem; font-weight: 400; opacity: 0.85; margin-top: 2px; }

/* Card accent colours */
.sum-card-fi       { border-top: 3px solid #10b981; }
.sum-card-tfsa     { border-top: 3px solid #10b981; }
.sum-card-ra       { border-top: 3px solid #6366f1; }
.sum-card-drawdown { border-top: 3px solid #3b82f6; }
.sum-card-review   { border-top: 3px solid #f59e0b; }
.sum-card-portfolio { border-top: 3px solid #8b5cf6; }

/* Mobile */
@media (max-width: 600px) {
    .sum-header         { flex-direction: column; }
    .sum-cards          { grid-template-columns: 1fr; }
    .sum-download-buttons { flex-direction: column; }
    .sum-card-main      { font-size: 1.2rem; }
}

/* ── Lucide Icon System ──────────────────────────────────────────────────── */
.lucide-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}

.lc-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 1;
}

/* Tab nav icon alignment */
.tab-nav-btn .lc-icon,
.tab-nav-btn .lucide-icon {
    margin-right: 5px;
    opacity: 0.85;
}

/* Heading icon alignment */
h2 .lc-icon, h3 .lc-icon, h4 .lc-icon,
h2 .lucide-icon, h3 .lucide-icon, h4 .lucide-icon {
    margin-right: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Scenario status dots */
.scenario-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 3px;
    flex-shrink: 0;
}
.dot-green  { background-color: #22c55e; }
.dot-yellow { background-color: #eab308; }
.dot-red    { background-color: #ef4444; }

/* Tax-free badge */
.tax-free-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #059669;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 3px;
    padding: 0 4px;
    vertical-align: middle;
    line-height: 1.4;
}

/* Inline icon in text/labels */
.lc-icon + *, * + .lc-icon {
    vertical-align: middle;
}

/* Button icon spacing */
button .lc-icon, button .lucide-icon {
    pointer-events: none;
}

/* ============================================================
   Prior Lump Sum Panel & Drawdown Summary — M3 redesign
   ============================================================ */

/* Prior lump sum panel */
.dd-prior-lumpsum-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 0 0 24px;
}
.dd-prior-header-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.dd-prior-icon {
    color: #6366f1;
    flex-shrink: 0;
    margin-top: 2px;
}
.dd-prior-header-text strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 4px;
}
.dd-prior-subtext {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
}
.dd-prior-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.dd-prior-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #374151;
    background: white;
    transition: all 0.15s;
    user-select: none;
}
.dd-prior-option:hover { border-color: #6366f1; color: #4f46e5; }
.dd-prior-option.dd-prior-active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}
.dd-prior-option input[type="radio"] { accent-color: #6366f1; }
.dd-prior-opt-text { pointer-events: none; }

.dd-prior-amount-row {
    margin: 12px 0;
}
.dd-prior-amount-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.dd-prior-amount-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
}
.dd-prior-r {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
}
.dd-prior-amount-wrap input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0f172a;
}
.dd-prior-amount-wrap input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Cap progress bar */
.dd-prior-cap-display { margin-top: 14px; }
.dd-prior-cap-bar-wrap {
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}
.dd-prior-cap-bar { width: 100%; height: 100%; position: relative; }
.dd-prior-cap-used {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 99px;
    transition: width 0.3s ease;
}
.dd-prior-cap-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #64748b;
}
.dd-prior-cap-used-label { color: #92400e; font-weight: 600; }
.dd-prior-cap-left-label { font-weight: 600; }
.dd-prior-cap-full-label { color: #166534; font-weight: 600; }

.dd-prior-unsure-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #92400e;
    background: #fef3c7;
    border-radius: 6px;
    padding: 8px 12px;
}

/* Lump sum results redesign */
.dd-lump-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.dd-lump-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 1rem;
}
.dd-lump-header svg { color: #6366f1; }
.dd-lump-cap-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}
.dd-lump-cap-item { display: flex; flex-direction: column; gap: 2px; }
.dd-lump-cap-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; font-weight: 600; }
.dd-lump-cap-val { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.dd-lump-cap-zero .dd-lump-cap-val { color: #dc2626; }
.dd-lump-kpi-row { margin-top: 0; }
.dd-lump-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #991b1b;
    margin: 10px 0;
}
.dd-lump-note {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 10px;
    line-height: 1.5;
}

/* Legal banner refinement */
.legal-banner strong { color: #f87171; letter-spacing: 0.03em; }
.legal-banner a { color: #94a3b8; text-decoration: none; border-bottom: 1px solid rgba(148,163,184,0.3); transition: color 0.15s; }
.legal-banner a:hover { color: #f1f5f9; }

/* FI multiplier selector */
.fi-multiplier-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 4px;
    flex-wrap: wrap;
}
.fi-multiplier-label { font-size: 0.8rem; color: #64748b; font-weight: 500; }
.fi-multiplier-options { display: flex; gap: 8px; }
.fi-mult-btn {
    padding: 6px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fi-mult-btn:hover { border-color: #6366f1; color: #4f46e5; }
.fi-mult-btn.fi-mult-active { border-color: #6366f1; background: #eef2ff; color: #4338ca; }
.fi-mult-sub { font-size: 0.72rem; font-weight: 400; color: #64748b; }
.fi-mult-btn.fi-mult-active .fi-mult-sub { color: #6366f1; }
.fi-fire-primary { display: block; font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.fi-fire-alt { display: block; font-size: 0.8rem; color: #64748b; margin-top: 2px; }

/* Today's money toggle */
.fi-gears-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 16px;
    flex-wrap: wrap;
}
.fi-real-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}
.fi-real-toggle-label input[type="checkbox"] { accent-color: #6366f1; width: 15px; height: 15px; }
.fi-real-toggle-text { font-weight: 500; }
.fi-real-toggle-hint { font-size: 0.76rem; color: #6366f1; }
.fi-real-note {
    display: block;
    font-size: 0.72rem;
    color: #6366f1;
    background: #eef2ff;
    border-radius: 4px;
    padding: 2px 7px;
    margin-top: 4px;
    width: fit-content;
}

/* ETF regression note */
.etf-regression-note {
    display: block;
    font-size: 0.73rem;
    color: #92400e;
    background: #fef3c7;
    border-radius: 4px;
    padding: 3px 8px;
    margin: 2px 0 4px;
}
.portfolio-regression-explainer {
    font-size: 0.78rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    line-height: 1.5;
}

/* ============================================================
   M4 — Onboarding, Empty States, Example Data
   ============================================================ */

/* Onboarding modal backdrop */
.ob-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10100;
    animation: obFadeIn 0.25s ease;
}
@keyframes obFadeIn { from { opacity: 0; } to { opacity: 1; } }
#onboarding-modal.ob-exit .ob-backdrop {
    animation: obFadeOut 0.3s ease forwards;
}
@keyframes obFadeOut { to { opacity: 0; transform: scale(0.97); } }

.ob-modal {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    animation: obSlideIn 0.28s ease;
}
@keyframes obSlideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.ob-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ob-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #818cf8;
}
.ob-skip {
    background: none;
    border: none;
    color: #475569;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s;
}
.ob-skip:hover { color: #94a3b8; }

.ob-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 22px 0;
}
.ob-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1e293b;
    border: 1.5px solid #334155;
    transition: all 0.2s;
}
.ob-dot-active { background: #6366f1; border-color: #6366f1; width: 20px; border-radius: 4px; }
.ob-dot-done   { background: #4ade80; border-color: #4ade80; }
.ob-step-label { font-size: 0.72rem; color: #475569; margin-left: 4px; }

.ob-body { padding: 20px 22px 24px; }
.ob-question {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 6px;
    line-height: 1.3;
}
.ob-sub { font-size: 0.8rem; color: #64748b; margin-bottom: 18px; }

.ob-options { display: flex; flex-direction: column; gap: 9px; }
.ob-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: #1e293b;
    border: 1.5px solid #334155;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.15s;
    width: 100%;
}
.ob-option:hover { border-color: #6366f1; background: #1e293b; }
.ob-option-selected { border-color: #6366f1 !important; background: rgba(99,102,241,0.12) !important; }
.ob-opt-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border-radius: 8px;
    color: #818cf8;
    transition: background 0.15s, color 0.15s;
}
.ob-option:hover .ob-opt-icon,
.ob-option-selected .ob-opt-icon {
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
}
.ob-opt-svg { display: block; }
.ob-opt-text { display: flex; flex-direction: column; gap: 2px; }
.ob-opt-text strong { font-size: 0.9rem; color: #f1f5f9; font-weight: 700; }
.ob-opt-text span   { font-size: 0.76rem; color: #64748b; }

/* Example data banner (below legal banner) */

/* ETF "New" badge — partial year data */
.etf-partial-note {
    font-size: 0.72rem;
    color: #818cf8;
    margin-top: 2px;
    margin-bottom: 2px;
    font-style: italic;
}

.etf-new-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}


/* ============================================================
   Theme Toggle Button — v1.22.1
   ============================================================ */

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--toggle-bg);
    border: 1px solid var(--toggle-border);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--toggle-color);
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.2px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: var(--toggle-hover-bg);
    color: var(--chrome-text);
}

.theme-toggle-btn svg {
    flex-shrink: 0;
}

/* Light mode: flip legal banner to light chrome */
[data-theme="light"] .legal-banner {
    background: #f1f5f9;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    color: #1e293b;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.08);
}

[data-theme="light"] .legal-banner a {
    color: #1e293b;
}

[data-theme="light"] .legal-banner a:hover {
    color: #6366f1;
}

/* Light mode: app-shell background */
[data-theme="light"] .app-shell {
    background: #f1f5f9;
}

/* Guide button in light mode */
[data-theme="light"] .guide-btn {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.15);
    color: var(--chrome-text);
}

[data-theme="light"] .guide-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* ============================================================
   Account Menu — Dropdown Panel (Task 32, v1.8.5)
   ============================================================ */

.account-menu-wrap {
    position: relative;
    display: inline-block;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 260px;
    background: var(--panel-bg, #1e293b);
    border: 1px solid var(--panel-border, rgba(255,255,255,0.1));
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    padding: 14px 0 8px;
    z-index: 9999;
    animation: accountDropFade 0.15s ease;
}

.account-dropdown--open {
    display: block;
}

@keyframes accountDropFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.account-dropdown-header {
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--panel-border, rgba(255,255,255,0.08));
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.account-dropdown-row {
    padding: 4px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.account-dropdown-label {
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.account-dropdown-name {
    font-size: 0.85rem;
    color: var(--chrome-text, #e2e8f0);
    font-weight: 500;
    word-break: break-all;
}

.account-dropdown-email {
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    font-weight: 400;
    word-break: break-all;
}

.account-dropdown-value {
    font-size: 0.85rem;
    color: var(--chrome-text, #e2e8f0);
}

.account-sub-status {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.account-sub-active {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.account-sub-cancelled {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.account-sub-expired {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.account-dropdown-divider {
    height: 1px;
    background: var(--panel-border, rgba(255,255,255,0.08));
    margin: 8px 0;
}

.account-dropdown-action {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    border-radius: 0;
    transition: background 0.15s;
}

.account-signout-btn {
    color: var(--chrome-text, #e2e8f0);
}

.account-signout-btn:hover {
    background: rgba(255,255,255,0.06);
}

.account-cancel-wrap {
    padding: 0 4px;
}

.account-cancel-btn {
    color: var(--text-muted, rgba(255,255,255,0.45));
    font-size: 0.8rem;
    padding: 6px 12px;
}

.account-cancel-btn:hover {
    color: #f87171;
    background: rgba(248,113,113,0.08);
    border-radius: 6px;
}

.account-cancel-confirm {
    padding: 10px 12px;
    background: rgba(248,113,113,0.07);
    border-radius: 8px;
    margin: 4px 0;
}

.account-cancel-confirm p {
    font-size: 0.8rem;
    color: var(--chrome-text, #e2e8f0);
    margin: 0 0 10px;
    line-height: 1.4;
}

.account-cancel-actions {
    display: flex;
    gap: 8px;
}

.account-cancel-confirm-btn {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}

.account-cancel-confirm-btn:hover {
    background: #b91c1c;
}

.account-cancel-dismiss-btn {
    background: rgba(255,255,255,0.08);
    color: var(--chrome-text, #e2e8f0);
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}

.account-cancel-dismiss-btn:hover {
    background: rgba(255,255,255,0.14);
}

.account-cancel-notice {
    font-size: 0.8rem;
    color: var(--chrome-text, #e2e8f0);
    margin: 0;
    line-height: 1.4;
}

.account-cancel-notice a {
    color: #60a5fa;
    text-decoration: underline;
}

/* Light mode overrides */
[data-theme="light"] .account-dropdown {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

[data-theme="light"] .account-dropdown-header {
    border-bottom-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .account-dropdown-label {
    color: rgba(0,0,0,0.4);
}

[data-theme="light"] .account-dropdown-name,
[data-theme="light"] .account-dropdown-value {
    color: #1e293b;
}

[data-theme="light"] .account-dropdown-email {
    color: rgba(0,0,0,0.45);
}

[data-theme="light"] .account-dropdown-divider {
    background: rgba(0,0,0,0.08);
}

[data-theme="light"] .account-signout-btn {
    color: #1e293b;
}

[data-theme="light"] .account-signout-btn:hover {
    background: rgba(0,0,0,0.04);
}

[data-theme="light"] .account-cancel-btn {
    color: rgba(0,0,0,0.4);
}

[data-theme="light"] .account-cancel-confirm {
    background: rgba(220,38,38,0.05);
}

[data-theme="light"] .account-cancel-confirm p,
[data-theme="light"] .account-cancel-notice {
    color: #1e293b;
}

[data-theme="light"] .account-cancel-dismiss-btn {
    background: rgba(0,0,0,0.06);
    color: #1e293b;
}

[data-theme="light"] .account-cancel-dismiss-btn:hover {
    background: rgba(0,0,0,0.1);
}



/* ============================================================
   Combined Income — Redesigned two-column layout (v1.22.1)
   ============================================================ */

.dd-combined-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* Left: sources list */
.dd-combined-sources {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 18px 20px;
}

.dd-source-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 4px 0;
}

.dd-source-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dd-source-gross {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.1);
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
}

.dd-source-amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.dd-source-divider {
    text-align: center;
    color: #334155;
    font-size: 1.1rem;
    font-weight: 300;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin: 10px 0;
}

.dd-source-gear {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #64748b;
    padding: 2px 0 2px 18px;
    gap: 8px;
}

.dd-source-note {
    font-style: italic;
    color: #475569;
    padding-top: 4px;
}

.dd-source-uncalc {
    font-size: 0.8rem;
    color: #475569;
    font-style: italic;
    padding: 6px 0;
}

.dd-source-tax-note {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #f87171;
    padding: 6px 10px;
    background: rgba(248,113,113,0.08);
    border-radius: 6px;
    border: 1px solid rgba(248,113,113,0.15);
}

/* Right: total panel */
.dd-combined-total-panel {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.35);
    border-radius: 12px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
}

.dd-total-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #34d399;
    margin-bottom: 6px;
}

.dd-total-value {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    color: #34d399;
    letter-spacing: -0.03em;
    line-height: 1;
    word-break: break-word;
}

.dd-total-sub {
    font-size: 0.82rem;
    color: #10b981;
    margin-top: 2px;
}

.dd-total-annual {
    font-size: 0.78rem;
    color: #475569;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(16,185,129,0.2);
    width: 100%;
}

.dd-total-net {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(16,185,129,0.2);
    width: 100%;
}

.dd-total-net-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.dd-total-net-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #a7f3d0;
}

/* Responsive: stack on narrow screens */
@media (max-width: 640px) {
    .dd-combined-layout {
        grid-template-columns: 1fr;
    }
    .dd-combined-total-panel {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    .dd-total-annual, .dd-total-net { border-top: none; padding-top: 0; margin-top: 0; }
}



/* ============================================================
   M5 — Brokerage / Investment Account Tab
   Design language matches FI Tracker: dark gradient card,
   indigo accent, subtle glass inputs.
   ============================================================ */

/* ============================================================
   Brokerage tab
   ============================================================ */

.brk-outer { margin-top: 32px; }

.brk-section-card {
    background: linear-gradient(160deg, #0f172a 0%, #1a1040 60%, #0f172a 100%);
    border-radius: 20px;
    padding: 36px 36px 32px;
    color: #f1f5f9;
    border: 1px solid #312e81;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    margin-bottom: 24px;
}

/* Header */
.brk-header { margin-bottom: 20px; }
.brk-title { font-size: 1.45rem; font-weight: 800; color: #f1f5f9; margin: 0 0 5px; letter-spacing: -0.02em; }
.brk-subtitle { font-size: 0.85rem; color: #64748b; margin: 0; line-height: 1.5; }

/* FI horizon banner */
.brk-fi-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99,102,241,0.10);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.83rem;
    color: #c7d2fe;
    margin-bottom: 24px;
}
.brk-fi-missing { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: #fde68a; }

/* Two-column layout */
.brk-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

/* Section headings */
.brk-section { margin-bottom: 22px; }
.brk-section-title {
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 7px;
}
.brk-section-note { font-size: 0.74rem; color: #475569; margin: -4px 0 10px; line-height: 1.45; }
.brk-empty-hint { font-size: 0.76rem; color: #334155; padding: 8px 0 4px; font-style: italic; }

/* Two-col field layout within section */
.brk-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }

/* Field rows */
.brk-field-row { margin-bottom: 12px; }
.brk-label { display: block; font-size: 0.78rem; color: #94a3b8; margin-bottom: 5px; font-weight: 500; }
.brk-label-sm { font-size: 0.71rem; color: #64748b; margin-bottom: 3px; display: block; }
.brk-hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: rgba(148,163,184,0.15); color: #64748b;
    font-size: 0.65rem; cursor: help; vertical-align: middle; margin-left: 3px;
}

/* Inputs */
.brk-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.88rem;
    padding: 9px 12px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
}
.brk-input:focus { outline: none; border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.06); }
.brk-input::placeholder { color: #334155; }
.brk-input-sm  { width: 100%; }
.brk-input-xs  { width: 64px; }
.brk-input-label { flex: 1; min-width: 0; }
.brk-field-inline { display: flex; flex-direction: column; }
.brk-field-hint { display: block; font-size: 0.70rem; color: #475569; margin-top: 4px; line-height: 1.4; }

/* Row cards (step-ups / lump sums) */
.brk-row-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    padding: 11px 12px;
    margin-bottom: 8px;
}
.brk-row-fields {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.brk-field-grow { flex: 1; min-width: 100px; }
.brk-field-yr   { flex-shrink: 0; }
.brk-lumpsum-label-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.brk-static-val { font-size: 0.83rem; color: #64748b; padding: 7px 0; }

/* Add / remove buttons */
.brk-add-btn {
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 6px;
    color: #a5b4fc;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.03em;
    margin-left: auto;
}
.brk-add-btn:hover { background: rgba(99,102,241,0.22); }

.brk-remove-btn {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.18);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.73rem;
    padding: 5px 8px;
    cursor: pointer;
    align-self: flex-end;
    flex-shrink: 0;
}
.brk-remove-btn:hover { background: rgba(239,68,68,0.18); }

/* Calculate button */
.brk-calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 12px 20px;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.02em;
}
.brk-calculate-btn:hover  { opacity: 0.9; }
.brk-calculate-btn:active { transform: scale(0.98); }

/* Results column */
.brk-results-col {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 22px;
    min-height: 220px;
}
.brk-placeholder { color: #334155; font-size: 0.85rem; text-align: center; padding: 60px 0; line-height: 1.6; }

/* Summary cards */
.brk-summary-cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.brk-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 14px 16px;
}
.brk-card-primary  { border-color: rgba(99,102,241,0.3);  background: rgba(99,102,241,0.08); }
.brk-card-positive { border-color: rgba(16,185,129,0.3);  background: rgba(16,185,129,0.06); }
.brk-card-label { font-size: 0.71rem; color: #64748b; margin-bottom: 5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.brk-card-value { font-size: 1.45rem; font-weight: 800; color: #f1f5f9; }
.brk-card-primary .brk-card-value { font-size: 1.7rem; }
.brk-card-warn  { color: #fca5a5; }
.brk-card-sub   { font-size: 0.67rem; color: #475569; margin-top: 4px; }

/* CGT disclaimer */
.brk-summary-sentence {
    font-size: 0.80rem;
    color: #94a3b8;
    background: rgba(99,102,241,0.05);
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: 8px;
    padding: 11px 14px;
    margin: 4px 0 10px;
    line-height: 1.55;
}
.brk-summary-sentence strong { color: #e2e8f0; }
.brk-summary-sentence em { color: #64748b; font-style: italic; }

.brk-cgt-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 0.73rem;
    color: #475569;
    background: rgba(245,158,11,0.05);
    border: 1px solid rgba(245,158,11,0.12);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 4px;
    line-height: 1.5;
}

/* Chart */
.brk-chart-wrap {
    position: relative;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px 8px 8px;
    margin: 12px 0;
}
.brk-tooltip {
    position: absolute;
    background: #1e293b;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #e2e8f0;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.brk-title-hint {
    font-size: 0.68rem;
    color: #475569;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.brk-results-inner { width: 100%; }

@media (max-width: 860px) {
    .brk-grid { grid-template-columns: 1fr; }
    .brk-section-card { padding: 22px 18px; }
    .brk-two-col { grid-template-columns: 1fr; }
}


/* Drawdown — sustainability sentence */
.dd-sustainability-sentence {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(16,185,129,0.07);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 16px 0 12px;
    font-size: 0.85rem;
    color: #d1fae5;
    line-height: 1.55;
}
.dd-sust-icon {
    color: #10b981;
    flex-shrink: 0;
    margin-top: 2px;
}

.account-terms-link {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.82rem;
    color: var(--text-muted, rgba(255,255,255,0.4));
    text-decoration: none;
    cursor: pointer;
    margin-top: 2px;
}
.account-terms-link:hover {
    color: var(--chrome-text, #e2e8f0);
}
[data-theme="light"] .account-terms-link {
    color: rgba(0,0,0,0.35);
}
[data-theme="light"] .account-terms-link:hover {
    color: #1e293b;
}

/* ── Onboarding empty state overlays ─────────────────────────────────────── */
/* Matches .review-empty / .dd-empty / .ra-empty design language              */

.ob-empty-state {
    margin: 24px 0;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.7;
    background: var(--surface, rgba(255,255,255,0.02));
    border: 1px dashed var(--border, rgba(255,255,255,0.07));
    border-radius: 12px;
}

.ob-empty-inner {
    max-width: 520px;
    margin: 0 auto;
}

.ob-empty-headline {
    font-size: 1rem;
    font-weight: 600;
    color: var(--chrome-text, #e2e8f0);
    margin: 0 0 8px;
}

.ob-empty-body {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.7;
    margin: 0 0 10px;
}

.ob-empty-hint {
    font-size: 0.82rem;
    color: #6366f1;
    font-weight: 500;
    margin: 0;
}

[data-theme="light"] .ob-empty-state {
    color: #64748b;
    background: var(--surface, #f8fafc);
    border-color: var(--border, #e2e8f0);
}

[data-theme="light"] .ob-empty-headline {
    color: #1e293b;
}

[data-theme="light"] .ob-empty-body {
    color: #64748b;
}

/* ── Signup consent block ────────────────────────────────────────────────── */
.consent-block {
    margin: 4px 0 16px;
    padding: 14px 16px;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--chrome-text, #e2e8f0);
    line-height: 1.5;
}

.consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.consent-label strong {
    color: #a5b4fc;
}

[data-theme="light"] .consent-block {
    background: rgba(99,102,241,0.04);
    border-color: rgba(99,102,241,0.15);
}

[data-theme="light"] .consent-label {
    color: #1e293b;
}

[data-theme="light"] .consent-label strong {
    color: #4f46e5;
}
