        :root {
            --primary: #1a365d;
            --primary-light: #2b6cb0;
            --accent: #e8a838;
            --accent-dark: #c77e1a;
            --bg: #f7fafc;
            --card: #ffffff;
            --text: #2d3748;
            --text-light: #718096;
            --border: #e2e8f0;
            --success: #38a169;
            --gold: #d4a020;
            --silver: #8a8a8a;
            --bronze: #b87333;
        }

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

        html { font-size: 18px; }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
        }

        header {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: white;
            padding: 2rem;
            text-align: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        header h1 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }

        header p {
            font-size: 1rem;
            opacity: 0.85;
        }

        .badge {
            display: inline-block;
            background: var(--accent);
            color: var(--primary);
            font-weight: 700;
            padding: 0.2rem 0.75rem;
            border-radius: 20px;
            font-size: 0.8rem;
            margin-top: 0.5rem;
        }

        .container {
            max-width: 1100px;
            margin: 0 auto;
            padding: 2rem 1.5rem;
        }

        .intro-box {
            background: var(--card);
            border-left: 4px solid var(--accent);
            padding: 1.25rem 1.5rem;
            border-radius: 0 8px 8px 0;
            margin-bottom: 2rem;
            box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        }

        .intro-box h3 { color: var(--primary); margin-bottom: 0.5rem; }
        .intro-box p { font-size: 0.92rem; color: var(--text-light); }

        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
        }

        @media (max-width: 768px) {
            .form-grid { grid-template-columns: 1fr; }
            header h1 { font-size: 1.5rem; }
        }

        .section {
            background: var(--card);
            border-radius: 12px;
            padding: 1.75rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }

        .section h2 {
            font-size: 1.1rem;
            color: var(--primary);
            border-bottom: 2px solid var(--border);
            padding-bottom: 0.5rem;
            margin-bottom: 1.25rem;
        }

        .field { margin-bottom: 1.1rem; }
        .field:last-child { margin-bottom: 0; }

        label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 0.3rem;
        }

        label .hint {
            font-weight: 400;
            color: var(--text-light);
            font-size: 0.78rem;
        }

        select, input[type="number"], input[type="text"] {
            width: 100%;
            padding: 0.6rem 0.75rem;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            font-size: 0.92rem;
            color: var(--text);
            background: #fff;
            transition: border-color 0.2s;
        }

        select:focus, input:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(43,108,176,0.12);
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.88rem;
        }

        .checkbox-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--primary-light);
        }

        /* Address Lookup */
        .address-section {
            background: var(--card);
            border-radius: 12px;
            padding: 1.75rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            margin-bottom: 2rem;
            border: 2px solid var(--primary-light);
        }

        .address-section h2 {
            font-size: 1.1rem;
            color: var(--primary);
            border-bottom: 2px solid var(--border);
            padding-bottom: 0.5rem;
            margin-bottom: 1.25rem;
        }

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

        .address-row .field { flex: 1; margin-bottom: 0; }

        .btn-lookup {
            padding: 0.6rem 1.5rem;
            font-size: 0.92rem;
            font-weight: 700;
            color: white;
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            border: none;
            border-radius: 8px;
            cursor: pointer;
            white-space: nowrap;
            transition: transform 0.15s, box-shadow 0.15s;
            box-shadow: 0 2px 8px rgba(26,54,93,0.25);
            height: 40px;
        }

        .btn-lookup:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(26,54,93,0.35);
        }

        .btn-lookup:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .lookup-status {
            margin-top: 0.75rem;
            font-size: 0.85rem;
            min-height: 1.4em;
        }

        .lookup-status .status-item {
            display: inline-block;
            margin-right: 1rem;
            margin-bottom: 0.25rem;
        }

        .lookup-status .ok { color: var(--success); }
        .lookup-status .warn { color: var(--accent-dark); }
        .lookup-status .err { color: #e53e3e; }
        .lookup-status .loading { color: var(--primary-light); }

        .autofill-notice {
            display: none;
            background: #ebf8ff;
            border: 1px solid #bee3f8;
            border-radius: 8px;
            padding: 0.7rem 1rem;
            font-size: 0.82rem;
            color: #2b6cb0;
            margin-top: 0.75rem;
        }

        .autofill-notice.visible { display: block; }

        .field.autofilled select,
        .field.autofilled input {
            border-color: #4299e1;
            background: #ebf8ff;
        }

        .field .autofill-badge {
            display: none;
            font-size: 0.7rem;
            color: #4299e1;
            font-weight: 400;
            margin-left: 0.4rem;
        }

        .field.autofilled .autofill-badge { display: inline; }

        @media (max-width: 768px) {
            .address-row { flex-direction: column; }
            .btn-lookup { width: 100%; }
        }

        .btn-calculate {
            display: block;
            width: 100%;
            max-width: 400px;
            margin: 2rem auto;
            padding: 1rem 2rem;
            font-size: 1.15rem;
            font-weight: 700;
            color: white;
            background: linear-gradient(135deg, var(--accent-dark), var(--accent));
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
            box-shadow: 0 4px 12px rgba(232,168,56,0.35);
        }

        .btn-calculate:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(232,168,56,0.45);
        }

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

        /* Results */
        #results {
            display: none;
            margin-top: 1rem;
        }

        #results.visible { display: block; }

        .results-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .results-header h2 {
            font-size: 1.5rem;
            color: var(--primary);
        }

        .results-header p {
            color: var(--text-light);
            font-size: 0.92rem;
        }


        .result-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        @media (max-width: 900px) {
            .result-cards { grid-template-columns: 1fr; }
        }

        .result-card {
            background: var(--card);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
            transition: transform 0.2s;
        }

        .result-card:hover { transform: translateY(-4px); }

        .result-card .rank-banner {
            text-align: center;
            padding: 1rem;
            color: white;
            font-size: 0.9rem;
            font-weight: 700;
        }

        .rank-1 .rank-banner { background: linear-gradient(135deg, #b8860b, #daa520); }
        .rank-2 .rank-banner { background: linear-gradient(135deg, #6a6a6a, #a0a0a0); }
        .rank-3 .rank-banner { background: linear-gradient(135deg, #8b4513, #cd853f); }

        .rank-banner .rank-num {
            display: block;
            font-size: 2rem;
            line-height: 1;
        }

        .result-card .card-body {
            padding: 1.5rem;
        }

        .result-card .use-name {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.75rem;
        }

        .score-bar-container {
            margin-bottom: 0.75rem;
        }

        .score-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }

        .score-bar {
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
        }

        .score-bar-fill {
            height: 100%;
            border-radius: 4px;
            transition: width 0.8s ease-out;
        }

        .score-bar-fill.legal { background: #4299e1; }
        .score-bar-fill.physical { background: #48bb78; }
        .score-bar-fill.financial { background: #ed8936; }
        .score-bar-fill.productive { background: #9f7aea; }

        .overall-score {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
        }

        .overall-score .big-score {
            font-size: 2rem;
            font-weight: 800;
            color: var(--primary);
        }

        .overall-score span {
            font-size: 0.85rem;
            color: var(--text-light);
        }

        .rationale {
            margin-top: 1rem;
            font-size: 0.85rem;
            color: var(--text-light);
            line-height: 1.5;
        }

        /* Key Metrics section on result cards */
        .key-metrics {
            margin-top: 1rem;
            padding-top: 0.85rem;
            border-top: 1px dashed var(--border);
        }

        .key-metrics-title {
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-light);
            margin-bottom: 0.5rem;
        }

        .metrics-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.4rem;
        }

        .metric-item {
            background: #f7fafc;
            border-radius: 6px;
            padding: 0.4rem 0.55rem;
        }

        .metric-icon-label {
            font-size: 0.68rem;
            color: var(--text-light);
            margin-bottom: 0.15rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .metric-value {
            font-size: 0.88rem;
            font-weight: 700;
            color: var(--text);
        }

        .metric-value.positive { color: #276749; }
        .metric-value.caution  { color: #b7791f; }
        .metric-value.negative { color: #c53030; }

        .risk-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            font-size: 0.78rem;
            font-weight: 700;
            padding: 0.15rem 0.5rem;
            border-radius: 999px;
        }

        .risk-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            display: inline-block;
        }

        .ease-bar-bg {
            width: 100%;
            height: 5px;
            background: #e2e8f0;
            border-radius: 3px;
            margin-top: 0.25rem;
            overflow: hidden;
        }

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

        /* Details table */
        .details-section {
            background: var(--card);
            border-radius: 12px;
            padding: 1.75rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            margin-bottom: 2rem;
        }

        .details-section h3 {
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .details-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.88rem;
        }

        .details-table th {
            background: var(--primary);
            color: white;
            padding: 0.65rem 0.75rem;
            text-align: left;
            font-weight: 600;
        }

        .details-table th:first-child { border-radius: 8px 0 0 0; }
        .details-table th:last-child { border-radius: 0 8px 0 0; }

        .details-table td {
            padding: 0.6rem 0.75rem;
            border-bottom: 1px solid var(--border);
        }

        .details-table tr:nth-child(even) { background: #f8fafc; }
        .details-table tr.top-3 { font-weight: 600; }
        .details-table tr.top-3 td:first-child { color: var(--primary); }

        .pass { color: var(--success); font-weight: 600; }
        .fail { color: #e53e3e; font-weight: 600; }
        .partial { color: var(--accent-dark); font-weight: 600; }

        .disclaimer {
            background: #fffbeb;
            border: 1px solid #f6e05e;
            border-radius: 8px;
            padding: 1rem 1.25rem;
            font-size: 0.82rem;
            color: #744210;
            margin-top: 1rem;
        }

        footer {
            text-align: center;
            padding: 2rem;
            color: var(--text-light);
            font-size: 0.82rem;
            border-top: 1px solid var(--border);
            margin-top: 2rem;
        }

        /* Print / Export Button */
        .btn-print {
            display: none;
            width: 100%;
            max-width: 400px;
            margin: 0 auto 2rem;
            padding: 0.85rem 2rem;
            font-size: 1rem;
            font-weight: 700;
            color: white;
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
            box-shadow: 0 4px 12px rgba(26,54,93,0.3);
        }

        .btn-print.visible { display: block; }

        .btn-print:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(26,54,93,0.4);
        }

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

        .print-date {
            display: none;
            text-align: center;
            font-size: 0.85rem;
            color: var(--text-light);
            margin-bottom: 1rem;
        }

        /* Print Styles */
        @media print {
            * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

            html { font-size: 14px; }
            body { background: white; font-size: 11pt; }

            header {
                background: var(--primary) !important;
                -webkit-print-color-adjust: exact;
                padding: 1.25rem;
                box-shadow: none;
            }

            header h1 { font-size: 1.5rem; }

            .container { padding: 1rem; }

            .intro-box, .btn-calculate, .btn-print, .address-section, footer { display: none !important; }

            .form-grid {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 1rem;
                margin-bottom: 1rem;
            }

            .section {
                box-shadow: none;
                border: 1px solid #ddd;
                padding: 1rem;
                page-break-inside: avoid;
            }

            .section h2 { font-size: 0.95rem; margin-bottom: 0.75rem; }

            .field { margin-bottom: 0.5rem; }
            label { font-size: 0.78rem; }

            select, input[type="number"], input[type="text"] {
                border: none;
                padding: 0;
                font-size: 0.82rem;
                font-weight: 600;
                color: var(--primary);
                background: transparent;
                -webkit-appearance: none;
                appearance: none;
            }

            .checkbox-item { font-size: 0.78rem; }

            #results { display: block !important; page-break-before: auto; }

            .results-header { margin-bottom: 1rem; }
            .results-header h2 { font-size: 1.2rem; }

            .result-cards {
                grid-template-columns: repeat(3, 1fr);
                gap: 0.75rem;
                margin-bottom: 1rem;
            }

            .result-card {
                box-shadow: none;
                border: 1px solid #ddd;
                page-break-inside: avoid;
            }

            .result-card:hover { transform: none; }

            .rank-banner { padding: 0.6rem; font-size: 0.8rem; }
            .rank-banner .rank-num { font-size: 1.4rem; }
            .result-card .card-body { padding: 1rem; }
            .result-card .use-name { font-size: 1rem; margin-bottom: 0.5rem; }
            .score-bar-container { margin-bottom: 0.4rem; }
            .overall-score { margin-top: 0.5rem; padding-top: 0.5rem; }
            .overall-score .big-score { font-size: 1.5rem; }
            .rationale { font-size: 0.78rem; margin-top: 0.5rem; }

            .key-metrics { margin-top: 0.5rem; padding-top: 0.5rem; }
            .key-metrics-title { font-size: 0.6rem; margin-bottom: 0.3rem; }
            .metrics-grid { gap: 0.25rem; }
            .metric-item { padding: 0.25rem 0.4rem; }
            .metric-icon-label { font-size: 0.6rem; }
            .metric-value { font-size: 0.75rem; }

            .details-section {
                box-shadow: none;
                border: 1px solid #ddd;
                padding: 1rem;
                page-break-inside: avoid;
            }

            .details-table { font-size: 0.78rem; }
            .details-table th { padding: 0.4rem 0.5rem; }
            .details-table td { padding: 0.35rem 0.5rem; }

            .disclaimer {
                font-size: 0.72rem;
                padding: 0.75rem;
                page-break-inside: avoid;
            }

            .print-date { display: block !important; }

            .legislation-section {
                page-break-inside: avoid;
                box-shadow: none;
                border: 1px solid #ddd;
                padding: 1rem;
            }
            .legislation-section .legislation-card {
                page-break-inside: avoid;
                border-left-color: #4299e1 !important;
            }
        }

        /* Legislation Section */
        .legislation-section {
            background: var(--card);
            border-radius: 12px;
            padding: 1.75rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            margin-bottom: 2rem;
        }

        .legislation-section h3 {
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .legislation-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }

        .legislation-card {
            background: #f8fafc;
            border-left: 4px solid #4299e1;
            border-radius: 0 8px 8px 0;
            padding: 1rem 1.25rem;
        }

        .legislation-card strong {
            color: var(--primary);
            font-size: 0.92rem;
            display: block;
            margin-bottom: 0.35rem;
        }

        .legislation-card p {
            color: var(--text-light);
            font-size: 0.82rem;
            margin: 0;
            line-height: 1.45;
        }

        .legislation-badge {
            display: inline-block;
            background: #ebf8ff;
            color: #2b6cb0;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.15rem 0.5rem;
            border-radius: 12px;
            margin-right: 0.3rem;
            margin-bottom: 0.25rem;
            border: 1px solid #bee3f8;
        }

        .legislation-badges {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
        }

        .legislation-badges .leg-label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-light);
            margin-bottom: 0.35rem;
        }

        /* Analysis Modal */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            z-index: 1000;
            overflow-y: auto;
            padding: 2rem 1rem;
        }

        .modal-content {
            max-width: 1000px;
            margin: 0 auto;
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            position: relative;
        }

        .modal-top-bar {
            position: sticky;
            top: 0;
            display: flex;
            justify-content: flex-end;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            background: rgba(255,255,255,0.95);
            border-radius: 16px 16px 0 0;
            z-index: 10;
            backdrop-filter: blur(6px);
        }

        .modal-close {
            width: 36px; height: 36px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: #f7fafc;
            font-size: 1.3rem;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            color: var(--text-light);
            transition: background 0.15s;
        }
        .modal-close:hover { background: #edf2f7; }

        .modal-print-btn {
            padding: 0.45rem 1.25rem;
            font-size: 0.85rem;
            font-weight: 700;
            color: white;
            background: var(--primary-light);
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }
        .modal-print-btn:hover { background: var(--primary); }

        .modal-header {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: white;
            padding: 1.75rem 2rem;
        }
        .modal-header h2 { font-size: 1.4rem; margin-bottom: 0.25rem; }
        .modal-header p { font-size: 0.88rem; opacity: 0.85; }

        .modal-body { padding: 2rem; }

        .analysis-section { margin-bottom: 2rem; }
        .analysis-section h3 {
            color: var(--primary);
            border-bottom: 2px solid var(--border);
            padding-bottom: 0.5rem;
            margin-bottom: 1rem;
            font-size: 1rem;
        }

        .program-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
        }
        @media (max-width: 600px) { .program-grid { grid-template-columns: repeat(2, 1fr); } }
        .program-item {
            text-align: center;
            padding: 0.85rem;
            background: #f8fafc;
            border-radius: 8px;
        }
        .program-item .program-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--primary);
        }
        .program-item .program-label {
            font-size: 0.75rem;
            color: var(--text-light);
            margin-top: 0.15rem;
        }

        .rendering-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }
        @media (max-width: 700px) { .rendering-container { grid-template-columns: 1fr; } }
        .rendering-container svg {
            width: 100%;
            height: auto;
            border: 1px solid var(--border);
            border-radius: 8px;
        }

        .budget-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
        }
        .budget-table th {
            padding: 0.35rem 0.6rem;
            text-align: right;
            font-weight: 600;
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: var(--text-light);
            border-bottom: 2px solid var(--border);
        }
        .budget-table th:first-child { text-align: left; }
        .budget-table td {
            padding: 0.35rem 0.6rem;
            border-bottom: 1px solid var(--border);
            font-variant-numeric: tabular-nums;
        }
        .budget-table td:not(:first-child) {
            text-align: right;
            white-space: nowrap;
        }
        .budget-table td.dim {
            color: var(--text-light);
            font-size: 0.78rem;
        }
        .budget-table .section-header td {
            font-weight: 700;
            background: #f8fafc;
            color: var(--primary);
            padding-top: 0.65rem;
            border-bottom: 2px solid var(--border);
        }
        .budget-table .subtotal td {
            font-weight: 700;
            background: #f0f4f8;
        }
        .budget-table .grand-total td {
            font-weight: 700;
            background: var(--primary);
            color: white;
            font-size: 0.88rem;
            padding: 0.55rem 0.6rem;
        }
        .budget-table .pct-col {
            font-size: 0.72rem;
            color: var(--text-light);
        }

        .returns-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
            margin-bottom: 1.25rem;
        }
        @media (max-width: 700px) { .returns-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 400px) { .returns-grid { grid-template-columns: 1fr; } }
        .return-card {
            text-align: center;
            padding: 1rem;
            background: #f8fafc;
            border-radius: 8px;
        }
        .return-card .return-value {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--primary);
        }
        .return-card .return-label {
            font-size: 0.78rem;
            color: var(--text-light);
            margin-top: 0.15rem;
        }

        .timeline-bar {
            display: flex;
            border-radius: 8px;
            overflow: hidden;
            height: 36px;
            margin-bottom: 0.5rem;
        }
        .timeline-segment {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.68rem;
            font-weight: 600;
            color: white;
            line-height: 1.2;
            text-align: center;
            padding: 0 0.25rem;
        }
        .timeline-legend {
            font-size: 0.8rem;
            color: var(--text-light);
            margin-top: 0.35rem;
        }

        .risk-card {
            background: #fff5f5;
            border-left: 4px solid #fc8181;
            border-radius: 0 8px 8px 0;
            padding: 0.85rem 1.1rem;
            margin-bottom: 0.6rem;
        }
        .risk-card strong { color: #c53030; font-size: 0.88rem; display: block; margin-bottom: 0.2rem; }
        .risk-card p { color: var(--text-light); font-size: 0.82rem; margin: 0; line-height: 1.45; }

        .click-hint {
            font-size: 0.75rem;
            color: var(--primary-light);
            text-align: center;
            margin-top: 0.5rem;
            font-weight: 600;
        }

        /* Print: analysis modal */
        @media print {
            body.printing-analysis > *:not(#analysisModal) { display: none !important; }
            body.printing-analysis #analysisModal {
                position: static;
                padding: 0;
                background: white;
                overflow: visible;
            }
            body.printing-analysis .modal-content {
                box-shadow: none;
                border-radius: 0;
            }
            body.printing-analysis .modal-top-bar { display: none !important; }
            body.printing-analysis .modal-header {
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }
            body.printing-analysis .analysis-section { page-break-inside: avoid; }
            body.printing-analysis .rendering-container svg { border: 1px solid #ddd; }
            body.printing-analysis .budget-table .grand-total td {
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }
            body.printing-analysis .assumptions-panel { border-color: #ddd; background: #fafafa; }
            body.printing-analysis .assumption-input { border: none; background: transparent; padding: 0; }
            body.printing-analysis .leg-detail-overlay { display: none !important; }
        }

        /* Editable Assumptions Panel */
        .assumptions-panel {
            background: #fffdf5;
            border: 1.5px solid var(--accent);
            border-radius: 10px;
            padding: 1rem 1.25rem;
            margin-bottom: 1.5rem;
        }
        .assumptions-panel h4 {
            font-size: 0.88rem;
            color: var(--accent-dark);
            margin-bottom: 0.75rem;
            font-weight: 700;
        }
        .assumptions-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.75rem;
        }
        @media (max-width: 600px) { .assumptions-grid { grid-template-columns: repeat(2, 1fr); } }
        .assumption-field {
            display: flex;
            flex-direction: column;
        }
        .assumption-field label {
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--text-light);
            margin-bottom: 0.2rem;
        }
        .assumption-input {
            width: 100%;
            padding: 0.45rem 0.5rem;
            border: 1.5px solid var(--border);
            border-radius: 6px;
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--primary);
            background: #fffdf5;
            transition: border-color 0.2s;
        }
        .assumption-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(232,168,56,0.15);
        }
        /* Dynamic tab slider controls */
        .dt-controls {
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 14px 18px;
            margin-bottom: 1.25rem;
        }
        .dt-controls-title {
            font-size: 0.78rem;
            font-weight: 700;
            color: #2d3748;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .dt-controls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 10px 18px;
        }
        .dt-slider-group {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .dt-slider-label {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            font-size: 0.7rem;
            color: #4a5568;
        }
        .dt-slider-label .dt-val {
            font-weight: 700;
            color: var(--primary);
            font-size: 0.75rem;
        }
        .dt-slider-row {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .dt-slider-row input[type="range"] {
            flex: 1;
            height: 5px;
            -webkit-appearance: none;
            appearance: none;
            background: #e2e8f0;
            border-radius: 3px;
            outline: none;
        }
        .dt-slider-row input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            border: 2px solid #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.18);
        }
        .dt-slider-row input[type="range"]::-moz-range-thumb {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            border: 2px solid #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.18);
        }
        .dt-slider-row input[type="number"] {
            width: 62px;
            padding: 3px 5px;
            border: 1px solid #cbd5e0;
            border-radius: 4px;
            font-size: 0.73rem;
            font-weight: 600;
            color: var(--primary);
            text-align: right;
            background: #fffdf5;
        }
        .dt-slider-row input[type="number"]:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(232,168,56,0.15);
        }
        .dt-reset-btn {
            font-size: 0.65rem;
            color: #a0aec0;
            border: 1px solid #e2e8f0;
            background: #fff;
            border-radius: 4px;
            padding: 2px 8px;
            cursor: pointer;
            margin-left: auto;
        }
        .dt-reset-btn:hover { color: #e53e3e; border-color: #feb2b2; }

        /* Design Configurator (Tab 11) */
        .configurator-layout {
            display: grid;
            grid-template-columns: 320px 1fr;
            gap: 1.25rem;
            align-items: start;
        }
        @media (max-width: 900px) {
            .configurator-layout { grid-template-columns: 1fr; }
        }
        .configurator-panel {
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 1rem 1rem 1.25rem;
            max-height: 80vh;
            overflow-y: auto;
        }
        .cfg-kpi-strip {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
            margin-bottom: 1.25rem;
        }
        @media (max-width: 600px) { .cfg-kpi-strip { grid-template-columns: repeat(2, 1fr); } }
        .cfg-kpi {
            text-align: center;
            background: #fff;
            border-radius: 8px;
            padding: 0.6rem 0.5rem;
            border: 1px solid var(--border);
        }
        .cfg-kpi-value {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--primary);
        }
        .cfg-kpi-label {
            font-size: 0.65rem;
            color: var(--text-light);
            margin-top: 2px;
        }
        .cfg-section-title {
            font-size: 0.7rem;
            font-weight: 700;
            color: #805ad5;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin: 0.85rem 0 0.4rem;
            padding-bottom: 0.2rem;
            border-bottom: 1px solid #e9d8fd;
        }
        .cfg-section-title:first-child { margin-top: 0; }
        .cfg-auto-display {
            font-size: 0.72rem;
            color: #718096;
            padding: 4px 0;
            display: flex;
            justify-content: space-between;
        }
        .cfg-auto-display .cfg-auto-val {
            font-weight: 700;
            color: var(--primary);
        }

        /* Clickable Legislation Cards & Badges */
        .legislation-card.clickable {
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .legislation-card.clickable:hover {
            transform: translateY(-2px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .legislation-badge.clickable {
            cursor: pointer;
            transition: background 0.15s;
        }
        .legislation-badge.clickable:hover {
            background: #bee3f8;
        }

        /* Legislation Detail Popup */
        .leg-detail-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.45);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }
        .leg-detail-content {
            background: white;
            border-radius: 14px;
            max-width: 440px;
            max-height: 80vh;
            width: 100%;
            box-shadow: 0 16px 48px rgba(0,0,0,0.25);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .leg-detail-header {
            background: linear-gradient(135deg, #2b6cb0, #4299e1);
            color: white;
            padding: 1.25rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }
        .leg-detail-header h3 { font-size: 1.1rem; margin: 0; }
        .leg-detail-close {
            width: 28px; height: 28px;
            border-radius: 50%;
            border: none;
            background: rgba(255,255,255,0.2);
            color: white;
            font-size: 1.1rem;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .leg-detail-close:hover { background: rgba(255,255,255,0.35); }
        .leg-detail-body {
            padding: 1.25rem;
            overflow-y: auto;
            flex: 1;
        }
        .leg-detail-body .leg-summary {
            font-size: 0.85rem;
            color: var(--text-light);
            margin-bottom: 0.75rem;
            font-style: italic;
        }
        .leg-detail-body .leg-full {
            font-size: 0.88rem;
            color: var(--text);
            line-height: 1.65;
        }
        /* SB 79 Transit Map */
        .map-section {
            background: var(--card);
            border-radius: 12px;
            padding: 1.75rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            margin-top: 2rem;
        }
        .map-section .section-header { text-align: center; margin-bottom: 1.25rem; }
        .map-section .section-header h2 { font-size: 1.3rem; color: var(--primary); margin-bottom: 0.25rem; }
        .map-section .section-subtitle { font-size: 0.88rem; color: var(--text-light); }
        #sb79Map { width: 100%; height: 500px; border-radius: 10px; border: 1.5px solid var(--border); z-index: 1; }
        .map-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; justify-content: center; }
        .layer-btn {
            padding: 0.4rem 1rem; font-size: 0.82rem; font-weight: 600; border: 1.5px solid var(--border);
            border-radius: 20px; background: #fff; color: var(--text-light); cursor: pointer; transition: all 0.2s;
        }
        .layer-btn:hover { border-color: var(--primary-light); color: var(--primary); }
        .layer-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
        .map-legend {
            display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 0.75rem;
            padding: 0.75rem 1rem; background: #f7fafc; border-radius: 8px; font-size: 0.78rem; color: var(--text-light);
        }
        .map-legend .legend-item { display: flex; align-items: center; gap: 0.35rem; }
        .legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
        .legend-line { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
        .sb79-eligibility {
            margin-top: 1rem; padding: 1.25rem; border-radius: 10px;
            background: linear-gradient(135deg, #ebf8ff, #f0fff4); border: 1.5px solid #bee3f8;
        }
        .sb79-eligibility h3 { font-size: 1rem; color: var(--primary); margin-bottom: 0.75rem; }
        .sb79-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; }
        .sb79-stat { background: #fff; border-radius: 8px; padding: 0.6rem 0.75rem; text-align: center; }
        .sb79-stat .stat-label { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }
        .sb79-stat .stat-value { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
        .tier-badge, .zone-badge {
            display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem;
            border-radius: 10px; margin-right: 0.3rem;
        }
        .tier-badge.tier1 { background: #e9d8fd; color: #553c9a; }
        .tier-badge.tier2 { background: #bee3f8; color: #2b6cb0; }
        .zone-badge.adjacent { background: #fed7d7; color: #c53030; }
        .zone-badge.inner { background: #fefcbf; color: #975a16; }
        .zone-badge.outer { background: #c6f6d5; color: #276749; }
        .station-popup .popup-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.3rem; }
        .station-popup .popup-line { font-size: 0.8rem; color: #555; }
        .station-popup .popup-allowances { margin-top: 0.4rem; font-size: 0.78rem; }
        .station-popup .popup-allowances span { display: block; }
        @media print { .map-section { display: none !important; } }
        @media (max-width: 768px) { #sb79Map, #finderMap, #pipelineMap { height: 350px !important; } }
        @media (max-width: 480px) { #sb79Map, #finderMap, #pipelineMap, #massingMapContainer { height: 260px !important; } }

        /* Tab Bar */
        .tab-bar {
            display: flex;
            justify-content: center;
            gap: 0;
            background: #fff;
            border-bottom: 2px solid var(--border);
            box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        }
        .tab-btn {
            flex: 1;
            max-width: 320px;
            padding: 1rem 2rem;
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-light);
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            transition: color 0.2s, border-color 0.2s, background 0.2s;
        }
        .tab-btn:hover {
            color: var(--primary);
            background: #f7fafc;
        }
        .tab-btn.active {
            color: var(--primary);
            border-bottom-color: var(--accent);
            background: #fff;
        }
        .tab-content { display: none; }
        .tab-content.active { display: block; }
        @media print {
            .tab-bar { display: none !important; }
            #tabFinder { display: none !important; }
            #tabCalculator { display: block !important; }
        }

        /* Auth Overlay */
        #authOverlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 50%, #1a365d 100%);
            z-index: 9999;
            display: flex; align-items: center; justify-content: center;
            transition: opacity 0.4s ease;
        }
        #authOverlay.fade-out { opacity: 0; pointer-events: none; }
        .auth-box {
            background: white; border-radius: 16px; padding: 2.5rem 2rem;
            text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            max-width: 380px; width: 90%;
        }
        .auth-box h2 { color: var(--primary); font-size: 1.4rem; margin-bottom: 0.25rem; }
        .auth-box > p { color: var(--text-light); font-size: 0.92rem; margin-bottom: 1.5rem; }
        .auth-box input[type="password"] {
            width: 100%; padding: 0.7rem 1rem; border: 1.5px solid var(--border);
            border-radius: 8px; font-size: 1rem; text-align: center; margin-bottom: 1rem;
        }
        .auth-box input[type="password"]:focus {
            outline: none; border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(43,108,176,0.12);
        }
        .auth-btn {
            display: block; width: 100%; padding: 0.75rem; font-size: 1rem; font-weight: 700;
            color: white; background: linear-gradient(135deg, var(--accent-dark), var(--accent));
            border: none; border-radius: 10px; cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
            box-shadow: 0 4px 12px rgba(232,168,56,0.35);
        }
        .auth-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232,168,56,0.45); }
        .auth-error { color: #e53e3e; font-size: 0.85rem; margin-top: 0.75rem; min-height: 1.2em; }
        @media print { #authOverlay { display: none !important; } }

        /* Opportunity Finder */
        .finder-section {
            margin-top: 1.5rem; padding: 1.25rem; border-radius: 10px;
            background: var(--card); border: 1.5px solid var(--border);
        }
        .finder-toggle {
            display: flex; align-items: center; justify-content: space-between;
            cursor: pointer; user-select: none;
        }
        .finder-toggle h3 { font-size: 1.05rem; color: var(--primary); margin: 0; }
        .finder-toggle .finder-arrow {
            font-size: 1.2rem; color: var(--text-light); transition: transform 0.2s;
        }
        .finder-toggle .finder-arrow.open { transform: rotate(90deg); }
        .finder-body { display: none; margin-top: 1rem; }
        .finder-body.open { display: block; }
        .finder-controls {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 0.75rem; margin-bottom: 1rem;
        }
        .finder-field label { font-size: 0.78rem; font-weight: 600; color: var(--text-light); margin-bottom: 0.2rem; display: block; }
        .finder-field select, .finder-field input {
            width: 100%; padding: 0.5rem 0.6rem; border: 1.5px solid var(--border);
            border-radius: 6px; font-size: 0.88rem;
        }
        .finder-field select:focus, .finder-field input:focus {
            outline: none; border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(43,108,176,0.12);
        }
        .finder-radios { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .finder-radios label {
            font-size: 0.82rem; font-weight: 500; color: var(--text);
            display: flex; align-items: center; gap: 0.25rem; cursor: pointer;
        }
        .finder-checks { display: flex; gap: 0.75rem; flex-wrap: wrap; }
        .finder-checks label {
            font-size: 0.82rem; font-weight: 500; color: var(--text);
            display: flex; align-items: center; gap: 0.25rem; cursor: pointer;
        }
        .finder-range-wrap { display: flex; align-items: center; gap: 0.5rem; }
        .finder-range-wrap input[type="range"] { flex: 1; }
        .finder-range-wrap .range-val { font-size: 0.85rem; font-weight: 700; color: var(--primary); min-width: 2.5rem; text-align: right; }
        .finder-btn-search {
            padding: 0.65rem 2rem; font-size: 0.95rem; font-weight: 700;
            color: white; background: linear-gradient(135deg, var(--primary), var(--primary-light));
            border: none; border-radius: 8px; cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
            box-shadow: 0 2px 8px rgba(26,54,93,0.25);
        }
        .finder-btn-search:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,54,93,0.35); }
        .finder-btn-search:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
        .finder-progress { display: none; margin: 1rem 0; }
        .finder-progress.active { display: block; }
        .finder-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
        .finder-progress-fill { height: 100%; background: var(--primary-light); border-radius: 3px; transition: width 0.3s; width: 0; }
        .finder-progress-text { font-size: 0.78rem; color: var(--text-light); margin-top: 0.35rem; }
        .finder-table-wrapper { overflow-x: auto; margin-top: 1rem; }
        .finder-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
        .finder-table th {
            background: var(--primary); color: white; padding: 0.5rem 0.6rem;
            text-align: left; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none;
        }
        .finder-table th:first-child { border-radius: 8px 0 0 0; }
        .finder-table th:last-child { border-radius: 0 8px 0 0; }
        .finder-table th:hover { background: var(--primary-light); }
        .finder-table th.sort-asc::after { content: ' \u25B2'; font-size: 0.7rem; }
        .finder-table th.sort-desc::after { content: ' \u25BC'; font-size: 0.7rem; }
        .finder-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
        .finder-table tr:nth-child(even) { background: #f8fafc; }
        .finder-table tr:hover { background: #ebf8ff; cursor: pointer; }
        .finder-table tr.highlighted { background: #bee3f8 !important; }
        .imp-ratio-hot { color: #e53e3e; font-weight: 700; }
        .imp-ratio-warm { color: #dd6b20; font-weight: 600; }
        .imp-ratio-cool { color: #38a169; }
        .finder-btn-export {
            margin-top: 0.75rem; padding: 0.5rem 1.25rem; font-size: 0.85rem; font-weight: 600;
            color: var(--primary); background: #ebf8ff; border: 1.5px solid #bee3f8;
            border-radius: 8px; cursor: pointer; transition: background 0.15s;
        }
        .finder-btn-export:hover { background: #bee3f8; }
        .finder-no-results { text-align: center; padding: 2rem 1rem; color: var(--text-light); font-size: 0.92rem; }
        .finder-error { background: #fff5f5; border: 1px solid #fc8181; border-radius: 8px; padding: 1rem; color: #c53030; font-size: 0.88rem; margin-top: 1rem; }
        .finder-summary { font-size: 0.85rem; color: var(--text-light); margin-top: 0.5rem; }
        .prop-links a { font-weight: 700; font-size: 0.78rem; color: var(--primary); text-decoration: none; }
        .prop-links a:hover { text-decoration: underline; }
        .selection-bar {
            position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 0.75rem;
            background: #ebf8ff; border: 1.5px solid #bee3f8; border-radius: 8px;
            padding: 0.5rem 1rem; margin-bottom: 0.75rem; font-size: 0.88rem; font-weight: 600; color: var(--primary);
        }
        .saved-list-panel {
            background: var(--card); border-radius: 12px; padding: 1.75rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 2rem;
            border-left: 4px solid #38a169;
        }
        .saved-list-panel h2 { font-size: 1.1rem; color: #276749; border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1rem; }
        .saved-list-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
        .saved-list-header span { font-size: 0.88rem; color: var(--text-light); font-weight: 600; }
        .saved-list-actions { display: flex; gap: 0.5rem; }
        .saved-btn { padding: 0.4rem 1rem; font-size: 0.82rem; font-weight: 600; border-radius: 6px; cursor: pointer; border: 1.5px solid; transition: background 0.15s; }
        .saved-btn-export { color: #276749; background: #f0fff4; border-color: #9ae6b4; }
        .saved-btn-export:hover { background: #c6f6d5; }
        .saved-btn-clear { color: #c53030; background: #fff5f5; border-color: #fc8181; }
        .saved-btn-clear:hover { background: #fed7d7; }
        .saved-btn-remove { background: none; border: none; color: #c53030; cursor: pointer; font-size: 0.85rem; padding: 0.2rem 0.4rem; }
        .saved-btn-remove:hover { text-decoration: underline; }

        /* Deep Analysis Button */
        .saved-btn-deep {
            color: white;
            background: linear-gradient(135deg, #805ad5, #6b46c1);
            border-color: #6b46c1;
            font-weight: 700;
            box-shadow: 0 2px 8px rgba(107,70,193,0.3);
        }
        .saved-btn-deep:hover { background: linear-gradient(135deg, #6b46c1, #553c9a); }

        /* Deep Analysis Modal */
        .deep-modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 1100;
            overflow-y: auto;
            padding: 1rem;
        }
        .deep-modal-content {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.35);
            position: relative;
            min-height: 80vh;
        }
        .deep-modal-top-bar {
            position: sticky;
            top: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1.25rem;
            background: rgba(255,255,255,0.97);
            border-radius: 16px 16px 0 0;
            z-index: 10;
            backdrop-filter: blur(6px);
            border-bottom: 1px solid var(--border);
        }
        .deep-modal-top-bar h3 {
            font-size: 1rem;
            color: var(--primary);
            margin: 0;
        }
        .deep-modal-top-bar .btn-group { display: flex; gap: 0.5rem; }

        /* Tab Navigation */
        .deep-tabs {
            display: flex;
            align-items: flex-end;
            overflow-x: auto;
            background: #f8fafc;
            border-bottom: 2px solid var(--border);
            padding: 0 0.5rem;
            gap: 0;
        }
        .deep-tab-btn {
            padding: 0.65rem 1rem;
            font-size: 0.78rem;
            font-weight: 600;
            border: none;
            background: none;
            cursor: pointer;
            white-space: nowrap;
            color: var(--text-light);
            border-bottom: 3px solid transparent;
            transition: color 0.15s, border-color 0.15s;
        }
        .deep-tab-btn:hover { color: var(--primary); background: #edf2f7; }
        .deep-tab-btn.active {
            color: var(--primary);
            border-bottom-color: #805ad5;
            background: white;
        }
        .deep-tab-btn.coming-soon {
            color: #cbd5e0;
            cursor: default;
        }
        .deep-tab-btn.coming-soon::after {
            content: ' (Soon)';
            font-size: 0.65rem;
            font-weight: 400;
        }
        .deep-tab-btn.coming-soon:hover { color: #cbd5e0; background: none; }
        .deep-tab-group {
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
        }
        .deep-tab-group-label {
            font-size: 0.6rem;
            font-weight: 700;
            letter-spacing: 0.07em;
            text-transform: uppercase;
            color: #805ad5;
            text-align: center;
            padding: 0.35rem 0.5rem 0;
            user-select: none;
            white-space: nowrap;
        }
        .deep-tab-group-btns {
            display: flex;
        }

        .deep-tab-panel {
            display: none;
            padding: 2rem;
        }
        .deep-tab-panel.active { display: block; }

        /* Executive Summary */
        .exec-summary-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        @media (max-width: 768px) { .exec-summary-grid { grid-template-columns: 1fr; } }
        .exec-summary-card {
            background: #f8fafc;
            border-radius: 10px;
            padding: 1.25rem;
            border: 1px solid var(--border);
        }
        .exec-summary-card h4 {
            font-size: 0.85rem;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        .exec-metric-lg {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--primary);
        }
        .exec-metric-sub {
            font-size: 0.8rem;
            color: var(--text-light);
        }
        .exec-recommendation {
            background: linear-gradient(135deg, #f0fff4, #e6fffa);
            border: 2px solid #9ae6b4;
            border-radius: 10px;
            padding: 1.25rem;
            margin-top: 1.5rem;
        }
        .exec-recommendation h4 {
            color: #276749;
            margin-bottom: 0.5rem;
        }

        /* Entitlement Flowchart */
        .entitle-flow {
            display: flex;
            flex-wrap: wrap;
            gap: 0;
            align-items: center;
            margin: 1.5rem 0;
        }
        .entitle-step {
            flex: 0 0 auto;
            text-align: center;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            font-size: 0.78rem;
            font-weight: 600;
            min-width: 110px;
            position: relative;
        }
        .entitle-step .step-duration {
            display: block;
            font-size: 0.7rem;
            font-weight: 400;
            color: rgba(255,255,255,0.85);
            margin-top: 0.2rem;
        }
        .entitle-step .step-cost {
            display: block;
            font-size: 0.68rem;
            font-weight: 400;
            color: rgba(255,255,255,0.75);
        }
        .entitle-arrow {
            font-size: 1.2rem;
            color: var(--text-light);
            padding: 0 0.35rem;
        }
        .entitle-type-badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.78rem;
            font-weight: 700;
            margin-bottom: 1rem;
        }
        .entitle-ministerial { background: #c6f6d5; color: #276749; }
        .entitle-discretionary { background: #fed7d7; color: #c53030; }
        .ceqa-badge { background: #fefcbf; color: #975a16; }

        .entitle-cost-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
            margin-top: 1rem;
        }
        .entitle-cost-table th {
            text-align: left;
            padding: 0.4rem 0.6rem;
            background: #f8fafc;
            border-bottom: 2px solid var(--border);
            font-weight: 600;
            color: var(--primary);
        }
        .entitle-cost-table td {
            padding: 0.35rem 0.6rem;
            border-bottom: 1px solid #f0f0f0;
        }
        .entitle-cost-table td:last-child { text-align: right; font-weight: 600; }
        .entitle-cost-table tr.total-row td {
            font-weight: 700;
            border-top: 2px solid var(--primary);
            color: var(--primary);
        }

        /* Sensitivity / Tornado */
        .scenario-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
            margin: 1rem 0;
        }
        .scenario-table th {
            padding: 0.5rem 0.6rem;
            text-align: center;
            font-weight: 700;
            border-bottom: 2px solid var(--border);
        }
        .scenario-table th:first-child { text-align: left; }
        .scenario-table td {
            padding: 0.4rem 0.6rem;
            text-align: center;
            border-bottom: 1px solid #f0f0f0;
        }
        .scenario-table td:first-child { text-align: left; font-weight: 500; }
        .scenario-bear { background: #fff5f5; }
        .scenario-base { background: #f0fff4; }
        .scenario-bull { background: #ebf8ff; }
        .tornado-svg-bar { transition: opacity 0.15s; cursor: default; }
        .tornado-svg-bar:hover { opacity: 0.75; }
        .breakeven-card {
            background: #fffff0;
            border: 2px solid #ecc94b;
            border-radius: 10px;
            padding: 1rem 1.25rem;
            margin-top: 1.5rem;
        }
        .breakeven-card h4 { color: #975a16; margin-bottom: 0.5rem; }
        .breakeven-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 0.75rem;
        }
        .breakeven-item {
            text-align: center;
            padding: 0.5rem;
            background: white;
            border-radius: 6px;
        }
        .breakeven-value { font-size: 1.3rem; font-weight: 700; color: #975a16; }
        .breakeven-label { font-size: 0.72rem; color: var(--text-light); }

        /* Heat Map */
        .heatmap-svg-cell { transition: opacity 0.15s; cursor: default; }
        .heatmap-svg-cell:hover { opacity: 0.8; }

        /* Affordable Housing */
        .afford-tier-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin: 1rem 0;
        }
        .afford-tier-card {
            background: #f8fafc;
            border-radius: 10px;
            padding: 1rem;
            border: 1px solid var(--border);
        }
        .afford-tier-card h5 {
            font-size: 0.85rem;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        .afford-comparison-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
            margin: 1rem 0;
        }
        .afford-comparison-table th {
            padding: 0.4rem 0.6rem;
            text-align: left;
            background: #f8fafc;
            border-bottom: 2px solid var(--border);
            font-weight: 600;
            color: var(--primary);
        }
        .afford-comparison-table td {
            padding: 0.35rem 0.6rem;
            border-bottom: 1px solid #f0f0f0;
        }
        .afford-comparison-table td:not(:first-child) { text-align: right; }
        .afford-strategy-card {
            background: linear-gradient(135deg, #ebf8ff, #e6fffa);
            border: 2px solid #63b3ed;
            border-radius: 10px;
            padding: 1.25rem;
            margin-top: 1.5rem;
        }
        .afford-strategy-card h4 {
            color: #2b6cb0;
            margin-bottom: 0.5rem;
        }
        .density-bonus-bar {
            height: 24px;
            background: #edf2f7;
            border-radius: 12px;
            overflow: hidden;
            margin: 0.5rem 0;
            position: relative;
        }
        .density-bonus-fill {
            height: 100%;
            border-radius: 12px;
            background: linear-gradient(90deg, #805ad5, #6b46c1);
            transition: width 0.5s;
        }
        .density-bonus-label {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.72rem;
            font-weight: 700;
            color: white;
        }

        /* Coming Soon placeholder */
        .coming-soon-panel {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-light);
        }
        .coming-soon-panel .icon { font-size: 3rem; margin-bottom: 1rem; }
        .coming-soon-panel h3 { color: var(--text-light); margin-bottom: 0.5rem; }

        /* Construction & Code Compliance */
        .code-matrix { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 0.75rem 0; }
        .code-matrix th, .code-matrix td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); text-align: left; }
        .code-matrix th { background: #f7fafc; font-weight: 600; color: var(--primary); }
        .code-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-weight: 600; font-size: 0.78rem; }
        .code-badge.type-ia { background: #c6f6d5; color: #22543d; }
        .code-badge.type-iii { background: #fefcbf; color: #744210; }
        .code-badge.type-v { background: #fed7d7; color: #742a2a; }
        .risk-meter { height: 24px; background: #edf2f7; border-radius: 12px; overflow: hidden; margin: 0.5rem 0; }
        .risk-meter-fill { height: 100%; border-radius: 12px; transition: width 0.5s; }
        .risk-factor-list { list-style: none; padding: 0; }
        .risk-factor-list li { padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; }
        .risk-factor-list li:last-child { border-bottom: none; }
        .engagement-card { background: #f0fff4; border: 1px solid #c6f6d5; border-radius: 8px; padding: 1rem; margin-top: 0.75rem; }
        .infra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
        .infra-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
        .infra-card h5 { font-size: 0.82rem; color: var(--primary); margin-bottom: 0.5rem; }
        .infra-status { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
        .infra-status.good { background: #c6f6d5; color: #22543d; }
        .infra-status.caution { background: #fefcbf; color: #744210; }
        .infra-status.upgrade { background: #fed7d7; color: #742a2a; }
        .comparison-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
        .comparison-table th, .comparison-table td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); text-align: center; }
        .comparison-table th { background: var(--primary); color: white; }
        .comparison-table td:first-child { text-align: left; font-weight: 600; background: #f7fafc; }
        .comparison-winner { background: #f0fff4 !important; font-weight: 700; }
        .site-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
        @media (max-width: 768px) { .site-plan-grid { grid-template-columns: 1fr; } }
        .site-plan-cell { background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; text-align: center; }
        .site-plan-cell h5 { font-size: 0.78rem; color: var(--primary); margin-bottom: 0.25rem; }
        .coverage-bar { display: flex; height: 24px; border-radius: 4px; overflow: hidden; margin: 0.5rem 0; }
        .coverage-segment { display: flex; align-items: center; justify-content: center; font-size: 0.68rem; color: white; font-weight: 600; }
        .parking-strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
        .parking-strategy-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; position: relative; }
        .parking-strategy-card.recommended { border-color: var(--success); border-width: 2px; }
        .parking-strategy-card.recommended::after { content: 'BEST VALUE'; position: absolute; top: -10px; right: 10px; background: var(--success); color: white; font-size: 0.65rem; padding: 0.1rem 0.5rem; border-radius: 3px; font-weight: 700; }
        .scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
        .scenario-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
        .scenario-card.winner { border-color: var(--accent); border-width: 2px; box-shadow: 0 4px 12px rgba(232,168,56,0.2); }
        .scenario-card .scenario-rank { font-size: 0.7rem; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; margin-bottom: 0.5rem; }
        .scenario-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
        .scenario-metric { text-align: center; }
        .scenario-metric .val { font-size: 1rem; font-weight: 700; color: var(--primary); }
        .scenario-metric .lbl { font-size: 0.68rem; color: var(--text-light); }
        .opt-goal-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
        .opt-goal-btn { padding: 0.4rem 1rem; border: 1px solid var(--border); border-radius: 20px; background: white; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
        .opt-goal-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
        .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
        .kpi-card { background: #f8fafc; border: 2px solid var(--border); border-radius: 10px; padding: 1rem; text-align: center; transition: all 0.2s; }
        .kpi-card.highlight { border-color: var(--primary); background: #ebf8ff; }
        .kpi-card .kpi-val { font-size: 1.3rem; font-weight: 700; }
        .kpi-card .kpi-label { font-size: 0.72rem; color: var(--text-light); margin-top: 0.25rem; }
        .kpi-card.green { border-color: #48bb78; } .kpi-card.green .kpi-val { color: #276749; }
        .kpi-card.yellow { border-color: #ecc94b; } .kpi-card.yellow .kpi-val { color: #744210; }
        .kpi-card.red { border-color: #fc8181; } .kpi-card.red .kpi-val { color: #c53030; }
        .preset-btns { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
        .preset-btn { padding: 0.35rem 0.9rem; border: 1px solid var(--border); border-radius: 6px; background: white; cursor: pointer; font-size: 0.78rem; font-weight: 600; }
        .preset-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
        .export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
        .export-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; text-align: center; cursor: pointer; transition: all 0.2s; }
        .export-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
        .export-card .export-icon { font-size: 2rem; margin-bottom: 0.75rem; }
        .export-card h4 { font-size: 0.92rem; color: var(--primary); margin-bottom: 0.25rem; }
        .export-card p { font-size: 0.78rem; color: var(--text-light); }

        /* Market Comps */
        .market-rent-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 0.75rem;
            margin: 1rem 0;
        }
        .market-rent-card {
            background: #f8fafc;
            border-radius: 8px;
            padding: 0.85rem;
            text-align: center;
            border: 1px solid var(--border);
        }
        .market-rent-card .rent-value { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
        .market-rent-card .rent-label { font-size: 0.72rem; color: var(--text-light); }
        .market-rent-card .rent-sub { font-size: 0.68rem; color: #a0aec0; }
        .massing-tooltip { font-size: 0.78rem; line-height: 1.4; }
        .vacancy-bar {
            height: 20px;
            background: #edf2f7;
            border-radius: 10px;
            overflow: visible;
            position: relative;
            margin: 0.3rem 0;
        }
        .vacancy-fill {
            height: 100%;
            border-radius: 10px;
        }
        .vacancy-label {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.7rem;
            font-weight: 700;
        }
        .market-comp-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
            margin: 1rem 0;
        }
        .market-comp-table th {
            padding: 0.45rem 0.6rem;
            text-align: left;
            background: #f8fafc;
            border-bottom: 2px solid var(--border);
            font-weight: 600;
            color: var(--primary);
        }
        .market-comp-table td {
            padding: 0.4rem 0.6rem;
            border-bottom: 1px solid #f0f0f0;
        }
        .market-comp-table td:not(:first-child) { text-align: right; }
        .residual-land-card {
            background: linear-gradient(135deg, #fffff0, #fefcbf);
            border: 2px solid #ecc94b;
            border-radius: 10px;
            padding: 1.25rem;
            margin-top: 1.5rem;
        }
        .residual-land-card h4 { color: #975a16; margin-bottom: 0.5rem; }
        .market-support-meter {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0.75rem 0;
        }
        .market-support-bar {
            flex: 1;
            height: 12px;
            background: #edf2f7;
            border-radius: 6px;
            overflow: hidden;
        }
        .market-support-fill {
            height: 100%;
            border-radius: 6px;
            transition: width 0.5s;
        }
        .market-support-score {
            font-size: 1rem;
            font-weight: 700;
            min-width: 45px;
            text-align: right;
        }

        /* Incentive Summary — removed */

        /* Tax & Incentives */
        .tax-timeline-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
            margin: 1rem 0;
        }
        .tax-timeline-table th {
            padding: 0.4rem 0.5rem;
            text-align: center;
            font-weight: 600;
            background: #f8fafc;
            border-bottom: 2px solid var(--border);
            color: var(--primary);
        }
        .tax-timeline-table th:first-child { text-align: left; }
        .tax-timeline-table td {
            padding: 0.35rem 0.5rem;
            text-align: center;
            border-bottom: 1px solid #f0f0f0;
            font-size: 0.78rem;
        }
        .tax-timeline-table td:first-child { text-align: left; font-weight: 500; }
        .tax-incentive-card {
            background: #f8fafc;
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            margin-bottom: 0.75rem;
        }
        .tax-incentive-card h5 {
            font-size: 0.85rem;
            color: var(--primary);
            margin-bottom: 0.4rem;
        }
        .tax-incentive-card .eligible { color: #276749; font-weight: 700; }
        .tax-incentive-card .ineligible { color: #c53030; font-weight: 700; }
        .tax-incentive-card .maybe { color: #b7791f; font-weight: 700; }
        .tax-summary-banner {
            background: linear-gradient(135deg, #ebf8ff, #f0fff4);
            border: 2px solid #63b3ed;
            border-radius: 10px;
            padding: 1.25rem;
            margin-top: 1.5rem;
        }
        .tax-summary-banner h4 { color: #2b6cb0; margin-bottom: 0.5rem; }

        /* Unit Mix */
        .unit-mix-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
            margin: 1rem 0;
        }
        @media (max-width: 700px) { .unit-mix-grid { grid-template-columns: repeat(2, 1fr); } }
        .unit-mix-card {
            background: #f8fafc;
            border-radius: 10px;
            padding: 1rem;
            text-align: center;
            border: 2px solid var(--border);
            transition: border-color 0.2s;
        }
        .unit-mix-card.highlighted { border-color: #805ad5; background: #faf5ff; }
        .unit-mix-card .unit-pct { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
        .unit-mix-card .unit-type { font-size: 0.82rem; font-weight: 600; }
        .unit-mix-card .unit-count { font-size: 0.78rem; color: var(--text-light); }
        .unit-mix-card .unit-rent { font-size: 0.85rem; font-weight: 600; color: #276749; }
        .unit-mix-card .unit-psf { font-size: 0.7rem; color: var(--text-light); }
        .unit-mix-slider-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
            font-size: 0.82rem;
        }
        .unit-mix-slider-row label {
            width: 80px;
            text-align: right;
            font-weight: 600;
            flex-shrink: 0;
        }
        .unit-mix-slider-row input[type="range"] {
            flex: 1;
            height: 6px;
            accent-color: #805ad5;
        }
        .unit-mix-slider-row .slider-val {
            width: 40px;
            text-align: center;
            font-weight: 700;
            color: var(--primary);
        }
        .rent-roll-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
            margin: 1rem 0;
        }
        .rent-roll-table th {
            padding: 0.4rem 0.6rem;
            text-align: right;
            font-weight: 600;
            background: #f8fafc;
            border-bottom: 2px solid var(--border);
            color: var(--primary);
        }
        .rent-roll-table th:first-child { text-align: left; }
        .rent-roll-table td {
            padding: 0.35rem 0.6rem;
            text-align: right;
            border-bottom: 1px solid #f0f0f0;
        }
        .rent-roll-table td:first-child { text-align: left; font-weight: 500; }
        .rent-roll-table tr.total-row td {
            font-weight: 700;
            border-top: 2px solid var(--primary);
            color: var(--primary);
        }
        .absorption-chart {
            display: flex;
            align-items: flex-end;
            gap: 4px;
            height: 100px;
            margin: 1rem 0;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--border);
        }
        .absorption-bar {
            flex: 1;
            border-radius: 4px 4px 0 0;
            position: relative;
            min-width: 20px;
        }
        .absorption-bar .bar-label {
            position: absolute;
            bottom: -18px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.6rem;
            color: var(--text-light);
            white-space: nowrap;
        }
        .absorption-bar .bar-value {
            position: absolute;
            top: -16px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.65rem;
            font-weight: 700;
            white-space: nowrap;
        }

        @media print {
            .deep-modal-overlay { position: static; padding: 0; background: none; }
            .deep-modal-content { box-shadow: none; border-radius: 0; max-width: none; }
            .deep-modal-top-bar { display: none; }
            .deep-tabs { display: none; }
            .deep-tab-panel { display: block !important; page-break-before: always; }
            .deep-tab-panel:first-of-type { page-break-before: avoid; }
            .coming-soon-panel { display: none; }
            /* Hide interactive controls in print */
            .dt-controls { display: none !important; }
            .dt-reset-btn { display: none !important; }
            /* Ensure tables don't break mid-row */
            .afford-comparison-table tr, .scenario-table tr { page-break-inside: avoid; }
            /* Keep analysis sections together when possible */
            .analysis-section { page-break-inside: avoid; }
            .exec-summary-grid { page-break-inside: avoid; }
            .breakeven-card { page-break-inside: avoid; }
            /* Print-friendly backgrounds */
            .exec-summary-card { border: 1px solid #ddd !important; }
        }

        @media print { .finder-section { display: none !important; } }
        @media print { #tabPipeline { display: none !important; } }

        /* Pipeline Tab Styles */
        .pipeline-badge {
            display: inline-block; padding: 0.15rem 0.55rem; border-radius: 10px;
            font-size: 0.72rem; font-weight: 700; color: #fff; white-space: nowrap;
        }
        .pipeline-badge.submitted { background: #d69e2e; }
        .pipeline-badge.plan_check { background: #dd6b20; }
        .pipeline-badge.issued { background: #3182ce; }
        .pipeline-badge.inspection { background: #38a169; }
        .pipeline-badge.finaled { background: #718096; }
        .pipeline-badge.coo { background: #276749; }
        .pipeline-val-high { color: #c53030; font-weight: 700; }
        .pipeline-val-mid { color: #dd6b20; font-weight: 600; }
        .pipeline-overlay-btn {
            position: absolute; top: 10px; right: 10px; z-index: 1000;
            padding: 0.4rem 0.85rem; font-size: 0.78rem; font-weight: 600;
            background: #fff; border: 1.5px solid var(--primary-light); border-radius: 8px;
            color: var(--primary); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.12);
        }
        .pipeline-overlay-btn:hover { background: #ebf8ff; }
        .pipeline-overlay-btn.active { background: var(--primary); color: #fff; }
        .pipeline-legend {
            display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 0; font-size: 0.78rem;
        }
        .pipeline-legend-item { display: flex; align-items: center; gap: 0.3rem; }
        .pipeline-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

        /* === Deep Analysis Mobile Responsiveness === */
        @media (max-width: 768px) {
            html { font-size: 17px; }
            header { padding: 1.25rem 1rem; }
            header p { font-size: 0.85rem; }
            .container { padding: 1.25rem 0.75rem; }
            .deep-tab-panel { padding: 1rem; }
            .dt-controls-grid { grid-template-columns: 1fr !important; }
            .dt-slider-row { flex-wrap: wrap; }
            .dt-slider-row input[type="range"] { min-width: 0; flex: 1; }
            .dt-slider-row input[type="number"] { width: 60px !important; flex-shrink: 0; }
            .scenario-table { font-size: 0.72rem; }
            .scenario-table th, .scenario-table td { padding: 0.4rem 0.3rem; }
            .afford-comparison-table { font-size: 0.72rem; }
            .afford-comparison-table th, .afford-comparison-table td { padding: 0.3rem 0.4rem; }
            .sens-scenario-grid { grid-template-columns: 1fr !important; }
            .breakeven-grid { grid-template-columns: 1fr !important; }
            .kpi-grid { grid-template-columns: 1fr !important; }
            /* Deep tab navigation — horizontal scroll with fade hint */
            #deepTabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
                scrollbar-width: thin; }
            .deep-tab-btn { white-space: nowrap; flex-shrink: 0; font-size: 0.65rem; padding: 0.4rem 0.6rem; }
            .deep-tab-group-label { font-size: 0.5rem; padding: 0.2rem 0.3rem 0; }
            .exec-metric-lg { font-size: 1.3rem; }
            /* Tables — ensure horizontal scroll */
            .budget-table, .market-comp-table, .details-table, .comparison-table { font-size: 0.75rem; }
            .budget-table td, .budget-table th, .market-comp-table td, .market-comp-table th { padding: 0.3rem 0.4rem; }
            /* Auth overlay mobile */
            .auth-box { padding: 1.75rem 1.25rem; max-width: 320px; }
            .auth-box h2 { font-size: 1.2rem; }
            /* Finder controls stacked on mobile */
            .finder-controls { grid-template-columns: 1fr !important; gap: 0.6rem; }
            .finder-field[style*="grid-column"] { grid-column: span 1 !important; }
            .finder-checks { gap: 0.4rem 0.75rem; }
            .finder-checks label { font-size: 0.78rem; }
            .finder-field select, .finder-field input[type="number"], .finder-field input[type="text"] { font-size: 0.82rem; padding: 0.45rem 0.5rem; }
            .finder-field label { font-size: 0.75rem; }
            .saved-list-actions { gap: 0.35rem !important; flex-wrap: wrap !important; }
            .saved-list-actions .saved-btn { font-size: 0.72rem; padding: 0.35rem 0.6rem; }
        }
        @media (max-width: 480px) {
            html { font-size: 16px; }
            header { padding: 1rem 0.75rem; }
            header h1 { font-size: 1.25rem; }
            header p { font-size: 0.78rem; }
            .container { padding: 1rem 0.5rem; }
            .section { padding: 1rem; border-radius: 8px; }
            .deep-tab-panel { padding: 0.5rem; }
            .deep-tab-btn { font-size: 0.6rem; padding: 0.35rem 0.5rem; }
            .analysis-section { padding: 0.75rem !important; }
            .analysis-section h3 { font-size: 0.9rem; }
            .exec-summary-grid { gap: 0.75rem; }
            .exec-summary-card { padding: 0.75rem; }
            .exec-metric-lg { font-size: 1.1rem; }
            .scenario-table { font-size: 0.65rem; }
            .breakeven-card { padding: 0.75rem; }
            /* Tab bar main */
            .tab-btn { padding: 0.6rem 0.5rem; font-size: 0.78rem; }
            /* Auth overlay small phones */
            .auth-box { padding: 1.5rem 1rem; max-width: 280px; }
            .auth-box h2 { font-size: 1.1rem; }
            .auth-btn { padding: 0.6rem 1.5rem; font-size: 0.88rem; }
            /* Finder table */
            .finder-table { font-size: 0.72rem; }
            .finder-table th, .finder-table td { padding: 0.3rem; }
        }


/* === Sensitivity Matrix === */
.sensitivity-matrix-panel{background:#fff;border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,.08);padding:1.5rem;margin-top:1.5rem;display:none;}
.sensitivity-matrix-panel h2{font-size:1.15rem;margin:0 0 .25rem;color:#1a202c;}
.sensitivity-matrix-panel .panel-subtitle{font-size:.8rem;color:#718096;margin:0 0 1rem;}
.sens-matrix-table{width:100%;border-collapse:collapse;font-size:.75rem;text-align:center;}
.sens-matrix-table th,.sens-matrix-table td{padding:6px 4px;border:1px solid #e2e8f0;}
.sens-matrix-table th{background:#f7fafc;font-weight:600;color:#4a5568;}
.sens-matrix-table .base-cell{outline:3px solid #1a202c;outline-offset:-2px;font-weight:700;}
.sens-green{background:#c6f6d5;color:#22543d;}.sens-ltgreen{background:#e6ffed;color:#276749;}
.sens-yellow{background:#fefcbf;color:#744210;}.sens-orange{background:#feebc8;color:#7b341e;}
.sens-red{background:#fed7d7;color:#9b2c2c;}

/* === Sources & Uses === */
.sources-uses-panel{background:#fff;border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,.08);padding:1.5rem;margin-top:1.5rem;display:none;}
.sources-uses-panel h2{font-size:1.15rem;margin:0 0 .25rem;color:#1a202c;}
.sources-uses-panel .panel-subtitle{font-size:.8rem;color:#718096;margin:0 0 1rem;}
.su-columns{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;}
@media(max-width:700px){.su-columns{grid-template-columns:1fr;}}
.su-col h3{font-size:.95rem;margin:0 0 .5rem;color:#2d3748;border-bottom:2px solid #667eea;padding-bottom:.35rem;}
.su-table{width:100%;border-collapse:collapse;font-size:.82rem;}
.su-table td{padding:5px 6px;border-bottom:1px solid #edf2f7;}
.su-table td:last-child{text-align:right;font-variant-numeric:tabular-nums;}
.su-table .su-total td{font-weight:700;border-top:2px solid #2d3748;border-bottom:none;font-size:.88rem;}
.su-table .su-subtotal td{font-weight:600;color:#4a5568;border-top:1px solid #cbd5e0;}

/* === Levered Returns === */
.levered-returns-panel{background:#fff;border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,.08);padding:1.5rem;margin-top:1.5rem;display:none;}
.levered-returns-panel h2{font-size:1.15rem;margin:0 0 .25rem;color:#1a202c;}
.levered-returns-panel .panel-subtitle{font-size:.8rem;color:#718096;margin:0 0 1rem;}
.lr-metrics-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1rem;}
.lr-metric-card{border-radius:10px;padding:1rem;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.lr-metric-card .lr-value{font-size:1.35rem;font-weight:700;margin:.25rem 0;}
.lr-metric-card .lr-label{font-size:.72rem;color:#4a5568;text-transform:uppercase;letter-spacing:.03em;}
.lr-positive{background:#f0fff4;border:1px solid #c6f6d5;}.lr-positive .lr-value{color:#22543d;}
.lr-warning{background:#fffff0;border:1px solid #fefcbf;}.lr-warning .lr-value{color:#744210;}
.lr-negative{background:#fff5f5;border:1px solid #fed7d7;}.lr-negative .lr-value{color:#9b2c2c;}
.lr-neutral{background:#f7fafc;border:1px solid #e2e8f0;}.lr-neutral .lr-value{color:#2d3748;}

/* === Demo Mode === */
.demo-banner{position:fixed;top:0;left:0;right:0;z-index:10000;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;text-align:center;padding:8px 0;font-size:.85rem;font-weight:700;letter-spacing:.08em;box-shadow:0 2px 8px rgba(0,0,0,.18);}
.demo-banner~header{margin-top:36px;}
.demo-btn{display:inline-block;margin-top:.75rem;padding:.5rem 1.5rem;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:none;border-radius:8px;font-size:.85rem;font-weight:600;cursor:pointer;transition:transform .15s,box-shadow .15s;}
.demo-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(102,126,234,.4);}

/* === Parcel Lot Lines & Popup === */
.parcel-popup{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;max-width:320px;}
.parcel-popup .pp-header{font-size:.95rem;font-weight:700;color:#2d3748;margin-bottom:6px;border-bottom:2px solid #667eea;padding-bottom:4px;}
.parcel-popup .pp-grid{display:grid;grid-template-columns:1fr 1fr;gap:2px 12px;font-size:.8rem;}
.parcel-popup .pp-label{color:#718096;font-weight:600;}
.parcel-popup .pp-value{color:#2d3748;text-align:right;}
.parcel-popup .pp-full{grid-column:1/-1;color:#2d3748;font-size:.8rem;margin-top:2px;}
.parcel-popup .pp-link{display:inline-block;margin-top:8px;color:#667eea;font-weight:600;font-size:.8rem;text-decoration:none;}
.parcel-popup .pp-link:hover{text-decoration:underline;}
