/* ============================================================
   GTA Home Guide: First-Time Buyer Guide
   Dark theme, minimalist, Apple-level design
   ============================================================ */

:root {
    --bg-deepest: #0a0a0a;
    --bg-deep: #111111;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --bg-elevated: #1e1e1e;
    --bg-input: #1a1a1a;
    --bg-sidebar: #0e0e0e;

    --accent: #c9a227;
    --accent-light: #d4b44a;
    --accent-muted: rgba(201, 162, 39, 0.15);
    --accent-border: rgba(201, 162, 39, 0.3);

    --text: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-dim: #444444;

    --border: #222222;
    --border-light: #2a2a2a;
    --border-subtle: #1a1a1a;

    --success: #34d399;
    --success-muted: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-muted: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-muted: rgba(248, 113, 113, 0.15);
    --info: #60a5fa;
    --info-muted: rgba(96, 165, 250, 0.15);

    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(201, 162, 39, 0.1);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-deepest);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================================
   LAYOUT: Sidebar + Main
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #e6c44d);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-logo .logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    user-select: none;
    position: relative;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-muted);
    border-left-color: var(--accent);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
}

.nav-group {
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.nav-group-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    padding: 0.75rem 1.25rem 0.25rem;
    opacity: 0.7;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ---- Mobile sidebar toggle ---- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-border);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    backdrop-filter: blur(4px);
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.content-area {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ---- Section visibility ---- */
.section-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.card-glass {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(26, 26, 26, 0.7));
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
}

.card-glass:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

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

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stat-value.accent {
    color: var(--accent);
}

.stat-note {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* ============================================================
   FORMS
   ============================================================ */

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

.form-group {
    margin-bottom: 1.25rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* Select */
.form-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: all var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Toggle / Switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-light);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-muted);
}

.toggle-switch input:checked + .toggle-slider::before {
    background: var(--accent);
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border-light);
    outline: none;
    transition: background var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-deepest);
    box-shadow: 0 0 6px rgba(201, 162, 39, 0.3);
    transition: all var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-deepest);
}

.range-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-row input[type="range"] {
    flex: 1;
}

.range-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 50px;
    text-align: right;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #d4b44a);
    color: #0a0a0a;
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
    transform: translateY(-1px);
}

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

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

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

.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent-border);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

/* ============================================================
   RESULT / OUTPUT DISPLAYS
   ============================================================ */

.result-banner {
    background: linear-gradient(135deg, var(--accent-muted), rgba(201, 162, 39, 0.05));
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.result-big {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.03em;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row .label {
    color: var(--text-secondary);
}

.result-row .value {
    font-weight: 600;
    color: var(--text);
}

.result-row .value.accent {
    color: var(--accent);
}

.result-row .value.success {
    color: var(--success);
}

.result-row .value.danger {
    color: var(--danger);
}

/* Gauge */
.gauge-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.gauge-bar {
    width: 100%;
    max-width: 500px;
    height: 12px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
    background: linear-gradient(90deg, var(--success), var(--accent), var(--danger));
}

.gauge-marker {
    position: absolute;
    top: -6px;
    width: 2px;
    height: 24px;
    background: var(--text);
    transition: left 0.8s ease;
}

/* ============================================================
   GDS/TDS RATIO GAUGE BARS
   ============================================================ */

.ratio-gauge-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.ratio-gauge-row:last-of-type {
    border-bottom: none;
}

.ratio-gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ratio-gauge-track {
    position: relative;
    width: 100%;
    height: 10px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: visible;
}

.ratio-gauge-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease, background 0.3s ease;
}

.ratio-gauge-fill.ratio-gauge-success {
    background: var(--success);
}

.ratio-gauge-fill.ratio-gauge-warning {
    background: var(--warning);
}

.ratio-gauge-fill.ratio-gauge-danger {
    background: var(--danger);
}

.ratio-gauge-threshold {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 1px;
    z-index: 1;
}

.ratio-gauge-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.ratio-gauge-limit {
    font-weight: 600;
    color: var(--text-muted);
}

/* ============================================================
   RATE SENSITIVITY TABLE
   ============================================================ */

.sensitivity-current td {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    font-weight: 600;
}

.sensitivity-moderate td {
    background: rgba(251, 191, 36, 0.06);
    color: var(--warning);
}

.sensitivity-high td {
    background: rgba(248, 113, 113, 0.06);
    color: var(--danger);
}

/* ============================================================
   CHARTS
   ============================================================ */

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.chart-container canvas {
    max-height: 350px;
}

.chart-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

.table-compact td,
.table-compact th {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* ============================================================
   CHECKLIST
   ============================================================ */

.checklist-section {
    margin-bottom: 2rem;
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.checklist-progress {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.checklist-bar {
    width: 100%;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.checklist-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition);
}

.check-item:last-child {
    border-bottom: none;
}

.check-item:hover {
    background: rgba(255, 255, 255, 0.02);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-xs);
}

.check-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-top: 1px;
    font-size: 0.7rem;
    color: transparent;
}

.check-item.checked .check-box {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

.check-item.checked .check-text {
    color: var(--text-dim);
    text-decoration: line-through;
}

.check-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: all var(--transition);
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-step {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.1rem;
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 1;
    transition: all var(--transition);
}

.timeline-step.completed .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

.timeline-step.active-step .timeline-dot {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-muted);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
}

.timeline-content:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-timing {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

.timeline-body {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline-body.open {
    display: block;
    animation: fadeIn 0.3s ease;
}

.timeline-body ul {
    list-style: none;
    margin-top: 0.5rem;
}

.timeline-body ul li {
    padding: 0.3rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.timeline-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* ============================================================
   EXPANDABLE CARDS (Programs, Offer Guide, etc.)
   ============================================================ */

.expand-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all var(--transition);
}

.expand-card:hover {
    border-color: var(--border-light);
}

.expand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
}

.expand-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.expand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.expand-title {
    flex: 1;
}

.expand-title h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.1rem;
}

.expand-title p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.expand-arrow {
    color: var(--text-dim);
    transition: transform var(--transition);
    font-size: 0.8rem;
}

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

.expand-body {
    display: none;
    padding: 0 1.25rem 1.25rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.expand-card.open .expand-body {
    display: block;
    animation: fadeIn 0.3s ease;
}

.expand-body p {
    margin-bottom: 0.75rem;
}

.expand-body ul {
    list-style: none;
    margin-bottom: 0.75rem;
}

.expand-body ul li {
    padding: 0.25rem 0 0.25rem 1.25rem;
    position: relative;
}

.expand-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* ============================================================
   NEIGHBORHOOD CARDS (Oshawa Guide)
   ============================================================ */

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

.neighborhood-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.neighborhood-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.neighborhood-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.neighborhood-price {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.neighborhood-vibe {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.neighborhood-details {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.neighborhood-details dt {
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.neighborhood-details dd {
    margin-bottom: 0.25rem;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
}

.tag-success {
    background: var(--success-muted);
    color: var(--success);
}

.tag-warning {
    background: var(--warning-muted);
    color: var(--warning);
}

.tag-info {
    background: var(--info-muted);
    color: var(--info);
}

.tag-accent {
    background: var(--accent-muted);
    color: var(--accent);
}

/* ============================================================
   ENRICHED NEIGHBORHOOD CARDS (Score bars, details grid)
   ============================================================ */

.neighborhood-scores {
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.oshawa-score-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
}

.oshawa-score-label {
    min-width: 5.5em;
    color: var(--text-secondary);
    font-weight: 500;
}

.oshawa-score-bar {
    flex: 1;
    height: 5px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.oshawa-score-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.oshawa-score-fill.score-high {
    background: var(--success);
}

.oshawa-score-fill.score-mid {
    background: var(--warning);
}

.oshawa-score-fill.score-low {
    background: var(--danger);
}

.oshawa-score-val {
    min-width: 2em;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
}

.oshawa-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.oshawa-detail-section {
    font-size: 0.78rem;
    line-height: 1.45;
}

.oshawa-detail-section h4 {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid var(--border-light);
}

.oshawa-detail-section p,
.oshawa-detail-section ul {
    color: var(--text-secondary);
    font-size: 0.76rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.oshawa-detail-section ul li {
    margin-bottom: 0.15rem;
}

.oshawa-detail-section ul li::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.oshawa-school-tag,
.oshawa-amenity-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 500;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.oshawa-school-tag {
    background: var(--info-muted);
    color: var(--info);
}

.oshawa-amenity-tag {
    background: var(--success-muted);
    color: var(--success);
}

.neighborhood-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0.6rem 0;
}

.oshawa-detail-full {
    grid-column: 1 / -1;
}

/* Pros/Considerations in the enriched card */
.neighborhood-card .neighborhood-details dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.neighborhood-card .neighborhood-details dd {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

/* ============================================================
   PROGRESS / READINESS
   ============================================================ */

.readiness-ring {
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
    position: relative;
}

.readiness-ring svg {
    transform: rotate(-90deg);
}

.readiness-ring .bg-ring {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 8;
}

.readiness-ring .fg-ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.readiness-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.readiness-score {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.readiness-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.progress-item:hover {
    border-color: var(--accent-border);
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
    flex-shrink: 0;
    transition: all var(--transition);
}

.progress-item.done .progress-dot {
    background: var(--success);
}

.progress-item.partial .progress-dot {
    background: var(--warning);
}

.progress-item-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ============================================================
   COMPARISON: Rent vs Buy
   ============================================================ */

.comparison-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.comparison-col h3 {
    text-align: center;
    margin-bottom: 1rem;
}

.vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent-muted);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================================
   RATE COMPARISON TABLE
   ============================================================ */

.rate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.rate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    transition: all var(--transition);
}

.rate-card:hover {
    border-color: var(--accent-border);
}

.rate-card.highlighted {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.rate-card .rate-pct {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.rate-card .rate-payment {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.25rem 0;
}

.rate-card .rate-total {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================================
   TABS (within sections)
   ============================================================ */

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.6rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   DIVIDERS & SPACERS
   ============================================================ */

.divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

.spacer { height: 1rem; }
.spacer-lg { height: 2rem; }

/* ============================================================
   INFO CALLOUTS
   ============================================================ */

.callout {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.callout-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.callout-info {
    background: var(--info-muted);
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: var(--info);
}

.callout-success {
    background: var(--success-muted);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: var(--success);
}

.callout-warning {
    background: var(--warning-muted);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.callout-accent {
    background: var(--accent-muted);
    border: 1px solid var(--accent-border);
    color: var(--accent-light);
}

/* ============================================================
   QUICK CALC (Dashboard)
   ============================================================ */

.quick-calc {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.quick-calc-result {
    text-align: center;
    padding: 0.5rem 1.5rem;
    background: var(--accent-muted);
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-border);
}

.quick-calc-result .amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.quick-calc-result .calc-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================================
   CLOSING COSTS BAR CHART ITEMS
   ============================================================ */

.cost-bar-item {
    margin-bottom: 0.75rem;
}

.cost-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.cost-bar-name {
    color: var(--text-secondary);
}

.cost-bar-amount {
    font-weight: 600;
    color: var(--text);
}

.cost-bar-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.cost-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .content-area {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 4.5rem 1rem 2rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-calc {
        grid-template-columns: 1fr;
    }

    .comparison-cols {
        grid-template-columns: 1fr;
    }

    .progress-sections {
        grid-template-columns: 1fr;
    }

    .neighborhood-grid {
        grid-template-columns: 1fr;
    }

    .oshawa-detail-grid {
        grid-template-columns: 1fr;
    }

    .rate-grid {
        grid-template-columns: 1fr 1fr;
    }

    .result-big {
        font-size: 1.75rem;
    }
}

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

    .rate-grid {
        grid-template-columns: 1fr;
    }

    .tab-bar {
        gap: 0;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ============================================================
   GTA AREA COMPARISON
   ============================================================ */

/* Filter Bar */
.comparison-filters {
    padding: 1.25rem 1.5rem;
}

.comparison-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.comp-toggle-group {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.comp-toggle-btn {
    padding: 0.5rem 0.9rem;
    background: var(--bg-input);
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border-right: 1px solid var(--border);
}

.comp-toggle-btn:last-child {
    border-right: none;
}

.comp-toggle-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.comp-toggle-btn.active {
    background: var(--accent-muted);
    color: var(--accent);
}

.comp-type-tabs {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.comparison-table thead th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.sort-header {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.sort-header:hover {
    color: var(--accent-light);
}

.sort-indicator {
    font-size: 0.65rem;
    color: var(--accent);
    margin-left: 2px;
}

.comparison-table tbody td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.comp-row {
    cursor: pointer;
    transition: background var(--transition);
}

.comp-row:hover {
    background: rgba(201, 162, 39, 0.04);
}

.comp-row-active {
    background: rgba(201, 162, 39, 0.08) !important;
    border-left: 3px solid var(--accent);
}

.comp-row td strong {
    color: var(--text);
    font-weight: 600;
}

/* Direction Badges */
.direction-badge {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    vertical-align: middle;
    margin-right: 4px;
}

.dir-east {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.dir-north {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.dir-west {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

/* YoY Change Colors */
.yoy-positive {
    color: var(--success);
    font-weight: 600;
}

.yoy-negative {
    color: var(--danger);
    font-weight: 500;
}

/* Rating Badge */
.comp-rating {
    display: inline-block;
    background: var(--accent-muted);
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.8rem;
}

/* Area Detail Card */
.area-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
    animation: detailSlideIn 0.3s ease;
}

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

.area-detail-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.area-detail-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-right: 0.75rem;
}

.comp-close-btn {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.comp-close-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.area-detail-body {
    padding: 1.5rem;
}

.area-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.area-detail-stat {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.area-detail-stat .stat-label {
    font-size: 0.68rem;
    margin-bottom: 0.25rem;
}

.area-detail-stat .stat-value {
    font-size: 1.1rem;
}

.area-detail-verdict {
    background: var(--accent-muted);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--accent-light);
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.area-detail-tags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-pro {
    display: inline-block;
    background: var(--success-muted);
    color: var(--success);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
}

.tag-con {
    display: inline-block;
    background: var(--warning-muted);
    color: var(--warning);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
}

/* Top Picks Grid */
.top-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1rem;
}

.top-pick-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.top-pick-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

.top-pick-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.top-pick-card h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.top-pick-card p {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.top-pick-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Demographics columns in comparison table */
.comp-col-demo {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Comparison responsive */
@media (max-width: 1024px) {
    .comp-col-demo {
        display: none;
    }
}

@media (max-width: 768px) {
    .comparison-filter-row {
        flex-direction: column;
    }

    .comparison-filter-row .form-group {
        width: 100%;
    }

    .comp-toggle-group {
        flex-wrap: wrap;
    }

    .area-detail-tags {
        grid-template-columns: 1fr;
    }

    .area-detail-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

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

    .area-detail-stats {
        grid-template-columns: 1fr 1fr;
    }

    .comparison-table {
        font-size: 0.78rem;
    }

    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 0.5rem 0.6rem;
    }
}

/* ============================================================
   DEMOGRAPHICS EXPLORER
   ============================================================ */

/* Section header decoration */
#section-demographics .section-title {
    position: relative;
    padding-top: 1rem;
}

#section-demographics .section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-full);
}

.demo-intro-card {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.04) 0%, rgba(20, 20, 20, 0) 60%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.demo-intro-card .section-title {
    margin-bottom: 0.4rem;
}

.demo-intro-card .section-subtitle {
    margin-bottom: 0;
}

/* Area Selector */
.demo-selector-card {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.demo-selector-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-selector-actions {
    display: flex;
    align-items: center;
    padding-bottom: 2px;
}

.demo-compare-selector {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* Stats grid (4-column default, 2x2 in compare) */
.demo-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.demo-compare-active .demo-stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* 3-column employment grid stays 3 normally, 1 col in compare */
.demo-stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.demo-compare-active .demo-stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Stat card hover in demographics (inherits base hover, add transform) */
#section-demographics .stat-card {
    transition: all var(--transition);
}

#section-demographics .stat-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

/* Charts grid (2x2 default, single column in compare) */
.demo-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.demo-compare-active .demo-charts-grid {
    grid-template-columns: 1fr;
}

.demo-charts-grid .chart-container {
    margin: 0;
    min-height: 200px;
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-card);
}

/* Panel styling */
.demo-panel h3 {
    margin-bottom: 1.25rem;
}

/* Percentage bars */
.demo-bar-group {
    margin-bottom: 1rem;
}

.demo-bar-group:last-of-type {
    margin-bottom: 1.5rem;
}

.demo-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.demo-bar-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.demo-bar-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    min-width: 4em;
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
}

.demo-bar-track {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.demo-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tags section (two columns) */
.demo-tags-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.demo-tags-section h4 {
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--accent);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Tag pills */
.demo-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.demo-tag {
    display: inline-block;
    background: var(--accent-muted);
    color: var(--accent-light);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--accent-border);
    transition: all var(--transition);
}

.demo-tag:hover {
    background: rgba(201, 162, 39, 0.22);
    border-color: var(--accent);
}

/* Compare mode layout */
.demo-compare-container {
    transition: opacity 0.3s ease;
}

.demo-compare-container.demo-compare-active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.demo-column-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-border);
    letter-spacing: -0.01em;
    position: sticky;
    top: 80px;
    z-index: 5;
    background: var(--bg-deepest);
    padding-top: 0.5rem;
}

/* Vertical divider between compare columns */
.demo-compare-active .demo-column:first-child {
    padding-right: 1rem;
    border-right: 1px solid var(--border);
}

.demo-compare-active .demo-column:last-child {
    padding-left: 1rem;
}

/* Fade-in animation for demographics content */
@keyframes demoFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.demo-column {
    animation: demoFadeIn 0.35s ease;
}

/* Stat value animation */
.demo-stat-animate {
    animation: demoFadeIn 0.4s ease;
}

/* Demographics responsive */
@media (max-width: 1024px) {
    .demo-compare-container.demo-compare-active {
        grid-template-columns: 1fr;
    }

    /* Remove vertical divider on stacked layout */
    .demo-compare-active .demo-column:first-child {
        padding-right: 0;
        border-right: none;
        padding-bottom: 2rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--accent-border);
    }

    .demo-compare-active .demo-column:last-child {
        padding-left: 0;
    }

    .demo-column-label {
        position: relative;
        top: auto;
    }
}

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

    .demo-stats-grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .demo-charts-grid {
        grid-template-columns: 1fr;
    }

    .demo-tags-section {
        grid-template-columns: 1fr;
    }

    .demo-selector-row {
        flex-direction: column;
        align-items: stretch;
    }

    .demo-selector-actions {
        align-self: flex-start;
    }
}

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

    .demo-stats-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   CRIME & SAFETY
   ============================================================ */

.safety-ranking-chart {
    width: 100%;
}

.safety-ranking-chart .chart-container {
    margin-bottom: 0;
}

/* Safety Grade display */
.safety-grade {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
}

/* Trend indicator */
.safety-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 1.25rem;
}

/* CSI component bars */
.safety-bar-violent {
    background: linear-gradient(90deg, #f87171, #ef4444);
    border-radius: 4px;
    height: 100%;
}

.safety-bar-nonviolent {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 4px;
    height: 100%;
}

.safety-bar-overall {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 4px;
    height: 100%;
}

/* Highlight list */
.safety-highlight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.safety-highlight {
    position: relative;
    padding: 0.65rem 0 0.65rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-bottom: 1px solid var(--border-subtle);
}

.safety-highlight:last-child {
    border-bottom: none;
}

.safety-highlight::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Neighborhood safety badge pills */
.safety-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.safety-badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all var(--transition);
}

.safety-badge:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.4);
}

/* ============================================================
   SCHOOLS & EDUCATION
   ============================================================ */

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

.school-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.school-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

.school-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.school-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.school-type-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.school-type-public {
    background: rgba(96, 165, 250, 0.12);
    color: var(--info);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.school-type-catholic {
    background: rgba(192, 132, 252, 0.12);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.25);
}

/* Fraser rating bar */
.school-card-rating {
    margin-bottom: 0.75rem;
}

.school-card-rating-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.school-card-rating-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.school-card-rating-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    min-width: 28px;
    text-align: right;
}

.school-rating-bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.school-rating-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.school-rating-bar.rating-green {
    background: linear-gradient(90deg, #22c55e, #34d399);
}

.school-rating-bar.rating-yellow {
    background: linear-gradient(90deg, #eab308, #fbbf24);
}

.school-rating-bar.rating-red {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* EQAO scores */
.school-eqao-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.school-eqao-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.school-eqao-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 55px;
    flex-shrink: 0;
}

.school-eqao-bar-track {
    flex: 1;
    height: 5px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.school-eqao-bar-fill {
    height: 100%;
    background: rgba(201, 162, 39, 0.5);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.school-eqao-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

/* School card footer */
.school-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.school-enrollment {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.school-card-programs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

/* School badges */
.school-badge {
    display: inline-block;
    background: var(--accent-muted);
    color: var(--accent-light);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: all var(--transition);
}

.school-badge:hover {
    background: rgba(201, 162, 39, 0.22);
    border-color: var(--accent);
}

.school-badge-sm {
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
}

/* Program badges container */
.school-program-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

@media (max-width: 480px) {
    .school-card-header {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* ============================================================
   MARKET TRENDS
   ============================================================ */

/* Selector row */
.mt-selector-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.mt-selector-actions {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 1px;
}

.mt-compare-selector {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Market type badges */
.mt-market-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.mt-badge-buyer {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.mt-badge-balanced {
    background: var(--warning-muted);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.mt-badge-seller {
    background: var(--danger-muted);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Gauge visualization */
.mt-gauge-section {
    max-width: 500px;
}

.mt-gauge-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mt-gauge-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mt-gauge-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
}

.mt-gauge-track {
    position: relative;
    height: 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: visible;
    border: 1px solid var(--border);
}

.mt-gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--success), var(--warning));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mt-gauge-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mt-gauge-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 1px;
    opacity: 0.6;
}

.mt-gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stats table in market indicators */
.mt-stats-table .result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.mt-stats-table .result-row:last-child {
    border-bottom: none;
}

/* Color classes for stat values */
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }

/* Market Trends responsive */
@media (max-width: 768px) {
    .mt-selector-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mt-selector-actions {
        align-self: flex-start;
    }

    .mt-gauge-section {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .mt-compare-selector {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   SCHOOLS & EDUCATION
   ============================================================ */

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

.school-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.school-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

.school-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.school-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.school-type-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.school-type-public {
    background: rgba(96, 165, 250, 0.12);
    color: var(--info);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.school-type-catholic {
    background: rgba(192, 132, 252, 0.12);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.25);
}

/* Fraser rating bar */
.school-card-rating {
    margin-bottom: 0.75rem;
}

.school-card-rating-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.school-card-rating-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.school-card-rating-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    min-width: 28px;
    text-align: right;
}

.school-rating-bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.school-rating-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.school-rating-bar.rating-green {
    background: linear-gradient(90deg, #22c55e, #34d399);
}

.school-rating-bar.rating-yellow {
    background: linear-gradient(90deg, #eab308, #fbbf24);
}

.school-rating-bar.rating-red {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* EQAO scores */
.school-eqao-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.school-eqao-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.school-eqao-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 55px;
    flex-shrink: 0;
}

.school-eqao-bar-track {
    flex: 1;
    height: 5px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.school-eqao-bar-fill {
    height: 100%;
    background: rgba(201, 162, 39, 0.5);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.school-eqao-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

/* School card footer */
.school-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.school-enrollment {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.school-card-programs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

/* School badges */
.school-badge {
    display: inline-block;
    background: var(--accent-muted);
    color: var(--accent-light);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: all var(--transition);
}

.school-badge:hover {
    background: rgba(201, 162, 39, 0.22);
    border-color: var(--accent);
}

.school-badge-sm {
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
}

/* Program badges container */
.school-program-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* School comparison chart: needs more height for horizontal bar */
#school-comparison-chart {
    max-height: none !important;
}

/* Schools responsive */
@media (max-width: 768px) {
    .school-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .school-card-header {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* ============================================================
   GLOSSARY & FAQ
   ============================================================ */

.glossary-search {
    margin-top: 0.75rem;
}

.glossary-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all var(--transition);
}

.glossary-item:hover {
    border-color: var(--border-light);
}

.glossary-term {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    transition: all var(--transition);
    user-select: none;
}

.glossary-term:hover {
    background: rgba(255, 255, 255, 0.02);
}

.glossary-arrow {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 1rem;
}

.glossary-item.open .glossary-arrow {
    transform: rotate(45deg);
}

.glossary-def {
    display: none;
    padding: 0 1.25rem 1rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border-subtle);
}

.glossary-item.open .glossary-def {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* FAQ */
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all var(--transition);
}

.faq-item:hover {
    border-color: var(--border-light);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    transition: all var(--transition);
    user-select: none;
    gap: 1rem;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-arrow {
    color: var(--accent);
    font-size: 0.85rem;
    transition: transform var(--transition);
    flex-shrink: 0;
}

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

.faq-answer {
    display: none;
    padding: 0 1.25rem 1.25rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border-subtle);
}

.faq-item.open .faq-answer {
    display: block;
    animation: fadeIn 0.3s ease;
}

.faq-answer p {
    margin-bottom: 0.75rem;
}

.faq-answer ul {
    list-style: none;
    margin-bottom: 0.75rem;
}

.faq-answer ul li {
    padding: 0.25rem 0 0.25rem 1.25rem;
    position: relative;
}

.faq-answer ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* ============================================================
   PRE-CONSTRUCTION GUIDE
   ============================================================ */

/* Pre-construction timeline */
.precon-timeline {
    position: relative;
    padding-left: 2.5rem;
    margin-top: 0.5rem;
}

.precon-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.precon-step {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.precon-step:last-child {
    margin-bottom: 0;
}

.precon-step-num {
    position: absolute;
    left: -2.5rem;
    top: 0.1rem;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #0a0a0a;
    z-index: 1;
}

.precon-step-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    flex: 1;
    transition: all var(--transition);
}

.precon-step-content:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow);
}

.precon-step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.precon-step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Deposit table */
.precon-deposit-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.precon-deposit-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0.75rem 1.25rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.precon-deposit-row:last-child {
    border-bottom: none;
}

.precon-deposit-header {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.precon-deposit-total {
    background: var(--accent-muted);
    font-weight: 600;
    color: var(--accent-light);
}

.precon-deposit-when {
    font-weight: 500;
}

.precon-deposit-pct {
    text-align: center;
}

.precon-deposit-amt {
    text-align: right;
}

/* Warranty grid */
.precon-warranty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.precon-warranty-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.precon-warranty-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

.precon-warranty-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.precon-warranty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.precon-warranty-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Pre-construction info sections */
.precon-info-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.precon-info-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.precon-info-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 0.5rem;
}

.precon-info-section p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.precon-info-section ul {
    list-style: none;
    margin-top: 0.5rem;
}

.precon-info-section ul li {
    padding: 0.25rem 0 0.25rem 1.25rem;
    position: relative;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.precon-info-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Pre-construction responsive */
@media (max-width: 768px) {
    .precon-warranty-grid {
        grid-template-columns: 1fr;
    }

    .precon-deposit-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }

    .precon-deposit-amt {
        display: none;
    }
}

@media (max-width: 480px) {
    .precon-deposit-row {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .precon-deposit-pct {
        text-align: left;
    }
}

/* ============================================================
   DASHBOARD: MARKET PULSE CARD
   ============================================================ */

.market-pulse-card {
    border: 1px solid var(--border);
}

.market-pulse-card-buyer {
    border-color: rgba(52, 211, 153, 0.35);
    background: linear-gradient(135deg, var(--bg-card), rgba(52, 211, 153, 0.04));
}

.market-pulse-card-seller {
    border-color: rgba(248, 113, 113, 0.35);
    background: linear-gradient(135deg, var(--bg-card), rgba(248, 113, 113, 0.04));
}

.market-pulse-card-balanced {
    border-color: rgba(201, 162, 39, 0.35);
    background: linear-gradient(135deg, var(--bg-card), rgba(201, 162, 39, 0.04));
}

.market-pulse-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.market-pulse-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.market-pulse-title-block h3 {
    font-size: 1rem;
    color: var(--text);
}

.market-pulse-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.market-pulse-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.market-pulse-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    width: fit-content;
}

.market-pulse-buyer {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.market-pulse-seller {
    background: var(--danger-muted);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.market-pulse-balanced {
    background: var(--warning-muted);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.market-pulse-stats {
    display: flex;
    gap: 2rem;
}

.market-pulse-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.market-pulse-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.market-pulse-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* ============================================================
   DASHBOARD: YOUR NUMBERS AT A GLANCE
   ============================================================ */

.dash-numbers-card {
    border: 1px solid rgba(201, 162, 39, 0.2);
}

.dash-numbers-card h3 {
    margin-bottom: 0.25rem;
}

.dash-numbers-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dash-numbers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.dash-number-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    text-align: center;
}

.dash-number-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.dash-number-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.dash-number-value.has-value {
    color: var(--accent);
}

.dash-number-link {
    font-size: 0.75rem;
    color: var(--accent-light);
    text-decoration: none;
    cursor: pointer;
}

.dash-number-link:hover {
    text-decoration: underline;
}

/* ============================================================
   DASHBOARD: QUICK-LINK NAVIGATION CARDS
   ============================================================ */

.dash-quicklinks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.dash-quicklink-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.dash-quicklink-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.dash-quicklink-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.6rem;
}

.dash-quicklink-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.dash-quicklink-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.dash-quicklink-external {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}

@media (max-width: 900px) {
    .dash-quicklinks {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dash-quicklinks {
        grid-template-columns: 1fr;
    }

    .dash-numbers-grid {
        grid-template-columns: 1fr;
    }

    .market-pulse-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .finder-prefs-grid {
        grid-template-columns: 1fr !important;
    }

    .finder-card-main {
        grid-template-columns: auto 1fr !important;
    }

    .finder-card-scores {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .finder-score-ring { margin: 0; }

    .finder-details-grid {
        grid-template-columns: 1fr !important;
    }

    .finder-comparison-cards {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   NEIGHBORHOOD FINDER (Find My Match)
   Scoped styles for the merged finder section
   ============================================================ */

.finder-prefs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.finder-slider-group {
    margin-bottom: 1rem;
}

.finder-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.finder-slider-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.finder-slider-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    min-width: 28px;
    text-align: center;
}

.finder-slider-desc {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.finder-error-msg {
    background: var(--danger-muted);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.88rem;
}

.finder-live-status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.finder-refresh-msg {
    font-size: 0.78rem;
    color: var(--accent);
    margin-top: 0.5rem;
    font-weight: 500;
}

.finder-live-badge {
    display: inline-block;
    background: var(--success);
    color: #0a0a0a;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.25rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.finder-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(10, 10, 10, 0.2);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ---- Finder Results ---- */

.finder-results-summary {
    background: var(--accent-muted);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--accent-light);
}

.finder-sort-controls {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.finder-sort-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    font-weight: 500;
    color: var(--text-muted);
}

.finder-sort-btn:hover {
    border-color: var(--accent-border);
    color: var(--accent);
}

.finder-sort-btn.active {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
}

.finder-results-grid {
    display: grid;
    gap: 1rem;
}

/* ---- Finder Result Card ---- */

.finder-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.finder-result-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.finder-rank-1 { border-color: var(--accent) !important; }
.finder-rank-2 { border-color: var(--text-muted) !important; }
.finder-rank-3 { border-color: #c27c3b !important; }

.finder-card-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1.25rem;
    align-items: center;
    cursor: pointer;
}

.finder-rank-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #0a0a0a;
    background: var(--text-dim);
    flex-shrink: 0;
}

.finder-rank-1 .finder-rank-badge { background: var(--accent); }
.finder-rank-2 .finder-rank-badge { background: var(--text-muted); }
.finder-rank-3 .finder-rank-badge { background: #c27c3b; }

.finder-card-highlights {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.finder-highlight-pill {
    background: var(--success-muted);
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.finder-demo-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.finder-demo-badge {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.finder-card-scores {
    text-align: center;
    flex-shrink: 0;
}

.finder-score-ring {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 0.25rem;
}

.finder-score-ring svg { transform: rotate(-90deg); }

.finder-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 5;
}

.finder-ring-fg {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.finder-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

/* ---- Finder Card Details (expandable) ---- */

.finder-card-details {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.finder-card-details.open {
    display: block;
    animation: fadeIn 0.3s ease;
}

.finder-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}

.finder-detail-section h4 {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Score bars */
.finder-score-bar-item {
    display: grid;
    grid-template-columns: 110px 1fr 30px;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.finder-score-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.finder-score-bar-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

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

.finder-score-bar-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
}

/* ---- Finder Comparison ---- */

.finder-comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1rem;
}

.finder-comparison-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
}

.finder-comparison-card:hover {
    border-color: var(--accent-border);
}

.finder-remove-compare {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
}

.finder-remove-compare:hover {
    color: var(--danger);
}

/* ============================================================
   COMPARE PROPERTIES
   ============================================================ */

.cp-form {
    margin-bottom: 1.5rem;
    border-color: var(--accent-border);
}

.cp-form h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

/* ---- Property Cards Grid ---- */

.cp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    transition: all var(--transition);
}

.cp-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-glow);
}

.cp-card-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.cp-card-remove:hover {
    color: var(--danger);
    background: var(--danger-muted);
}

.cp-card-address {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.25rem;
    padding-right: 1.5rem;
}

.cp-card-area {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cp-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.cp-card-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Comparison Table ---- */

.cp-table-wrap {
    margin-top: 1.5rem;
}

.cp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.cp-table thead th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-table tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.cp-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cp-table tbody tr:last-child td {
    border-bottom: none;
}

.cp-table-label {
    font-weight: 600;
    color: var(--text) !important;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: var(--bg-card);
    z-index: 1;
    min-width: 140px;
}

.cp-table thead .cp-table-label {
    background: var(--bg-elevated);
    z-index: 2;
}

.cp-best {
    background: var(--success-muted) !important;
    color: var(--success) !important;
    font-weight: 700;
}

/* ---- Compare Properties Responsive ---- */

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

    .cp-form .form-grid {
        grid-template-columns: 1fr;
    }
}

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

/* ============================================================
   MARKET INTELLIGENCE
   ============================================================ */

/* ---- Loading State ---- */

.mi-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    gap: 1rem;
}

.mi-loading p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.mi-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: mi-spin 0.8s linear infinite;
}

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

/* ---- Chart containers ---- */

.mi-chart-tall {
    min-height: 380px;
}

.mi-chart-tall canvas {
    max-height: 380px;
}

.mi-chart-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

/* ---- Donut section ---- */

.mi-donut-section {
    text-align: center;
}

.mi-donut-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.mi-donut-wrap canvas {
    max-height: 360px;
}

.mi-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    text-align: center;
    pointer-events: none;
}

.mi-donut-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.mi-donut-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.15rem;
}

.mi-donut-date {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* ---- Cost Breakdown Grid ---- */

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

.mi-cost-card {
    background: var(--bg-deepest);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.mi-cost-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(201, 162, 39, 0.04);
}

.mi-cost-card-icon {
    font-size: 1rem;
}

.mi-cost-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mi-cost-card-body {
    padding: 0.75rem 1rem;
}

.mi-cost-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.mi-cost-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mi-cost-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.mi-cost-range {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.mi-cost-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ---- Worked Example ---- */

.mi-worked-example {
    background: var(--bg-deepest);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.mi-example-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.mi-example-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.mi-example-total {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.mi-example-total strong {
    color: var(--accent);
}

.mi-example-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mi-example-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.mi-example-item:last-child {
    border-bottom: none;
}

.mi-example-item span:last-child {
    font-weight: 600;
    color: var(--text);
}

/* ---- Market Intelligence Responsive ---- */

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

    .mi-chart-tall {
        min-height: 280px;
    }

    .mi-chart-tall canvas {
        max-height: 280px;
    }

    .mi-donut-wrap {
        max-width: 300px;
    }

    .mi-donut-total {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .mi-chart-tall {
        min-height: 240px;
    }

    .mi-chart-tall canvas {
        max-height: 240px;
    }

    .mi-donut-center {
        transform: translate(-50%, -55%);
    }

    .mi-donut-total {
        font-size: 1rem;
    }
}

/* ============================================================
   LISTING TOOLKIT — glossary / flags / scanner / deposit
   (Appended 2026-04-16 for Durham Buyer Toolkit Stage 1)
   ============================================================ */

/* Field cards (MLS glossary) */
.glossary-field-list .field-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    overflow: hidden;
    transition: border-color var(--transition);
}
.glossary-field-list .field-card:hover { border-color: var(--accent-muted); }
.glossary-field-list .field-head {
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.glossary-field-list .field-head:hover { background: var(--bg-elevated); }
.glossary-field-list .field-label { font-weight: 600; color: var(--text); }
.glossary-field-list .field-category {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.glossary-field-list .field-body {
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.glossary-field-list .field-card.open .field-body { display: block; }
.glossary-field-list .field-card.open .field-arrow { transform: rotate(180deg); }
.glossary-field-list .field-arrow { color: var(--text-muted); transition: transform var(--transition); }
.glossary-subhead {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0.85rem 0 0.25rem;
    font-weight: 600;
}
.glossary-subhead.danger { color: var(--danger); }
.glossary-subhead.success { color: var(--success); }
.chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin: 0.2rem 0.25rem 0.2rem 0;
}

/* Flag cards (library + scan results) */
.flag-card-list .flag-card,
#scan-red-list .flag-card,
#scan-green-list .flag-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 0.55rem;
}
.flag-card.flag-red { border-left-color: var(--danger); }
.flag-card.flag-green { border-left-color: var(--success); }
.flag-card .flag-title { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.flag-card .flag-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}
.flag-card .flag-meta-sep { color: var(--border); }
.flag-card .flag-note { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.45rem; line-height: 1.5; }
.flag-card .flag-cost {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 0.76rem;
    margin-top: 0.4rem;
}
.flag-card .severity-pill {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.flag-card .severity-pill.severity-1,
.flag-card .severity-pill.severity-2 { background: var(--warning-muted, rgba(251,191,36,0.15)); color: var(--warning, #fbbf24); }
.flag-card .severity-pill.severity-3 { background: var(--warning-muted, rgba(251,191,36,0.15)); color: var(--warning, #fbbf24); }
.flag-card .severity-pill.severity-4,
.flag-card .severity-pill.severity-5 { background: var(--danger-muted); color: var(--danger); }
.flag-card .flag-matched {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text);
    background: var(--bg-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Scanner layout */
.scan-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 768px) {
    .scan-results-grid { grid-template-columns: 1fr; }
}

/* Closing tab panels (scoped) */
.closing-tab-panel { display: none; }
.closing-tab-panel.active { display: block; }

/* Deposit helper */
.deposit-flow svg {
    width: 100%;
    height: auto;
    max-width: 640px;
    display: block;
    margin: 0 auto;
}
.deposit-flow .flow-node {
    fill: var(--bg-elevated);
    stroke: var(--accent);
    stroke-width: 1.5;
}
.deposit-flow .flow-label {
    fill: var(--text);
    font-size: 12px;
    font-family: inherit;
}
.deposit-flow .flow-arrow {
    stroke: var(--accent);
    stroke-width: 2;
    fill: none;
}
.deposit-bullets { list-style: none; padding: 0; margin-top: 0.5rem; }
.deposit-bullets li {
    padding: 0.35rem 0 0.35rem 1.25rem;
    position: relative;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.deposit-bullets li::before {
    content: "\203A";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}
.deposit-check { list-style: none; padding: 0; }
.deposit-check li {
    padding: 0.5rem 0;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.deposit-check li:last-child { border-bottom: none; }
.deposit-check .check-input {
    margin-top: 0.2rem;
    accent-color: var(--accent);
    cursor: pointer;
}
.deposit-check label { cursor: pointer; flex: 1; }

/* Scenario table highlight (enhanced closing) */
#cd-scenario-rows tr.scenario-active { background: var(--accent-muted); }
#cd-scenario-rows td:first-child { font-weight: 600; color: var(--accent); }

/* ============================================================
   WATCHLIST (Durham Buyer Toolkit Stage 2)
   ============================================================ */

.watchlist-tier-heading {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.watchlist-tier-heading:first-child { margin-top: 0; }

.watchlist-table { width: 100%; margin-bottom: 1.5rem; }
.watchlist-table th {
    text-align: left;
    padding: 0.6rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.watchlist-table td {
    padding: 0.65rem 0.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
    vertical-align: middle;
}
.watchlist-table tr.watchlist-row { cursor: pointer; transition: background var(--transition); }
.watchlist-table tr.watchlist-row:hover { background: var(--bg-card-hover); }
.watchlist-table code { font-size: 0.82rem; color: var(--text-secondary); }

/* Tier badges */
.tier-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.tier-badge.tier-1 { background: var(--success-muted); color: var(--success); }
.tier-badge.tier-2 { background: var(--info-muted); color: var(--info); }
.tier-badge.tier-3 { background: var(--warning-muted); color: var(--warning); }
.tier-badge.tier-4 { background: rgba(120,120,120,0.15); color: var(--text-muted); }

/* Verdict badges */
.verdict-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.verdict-badge.verdict-offer { background: var(--success-muted); color: var(--success); }
.verdict-badge.verdict-view { background: var(--info-muted); color: var(--info); }
.verdict-badge.verdict-conditional { background: var(--warning-muted); color: var(--warning); }
.verdict-badge.verdict-skip { background: var(--danger-muted); color: var(--danger); }

/* DD progress bar */
.dd-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.dd-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width var(--transition);
}

/* DD item list */
.dd-item {
    padding: 0.85rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    background: var(--bg-elevated);
}
.dd-item-main {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
}
.dd-item-main .check-input {
    margin-top: 0.25rem;
    accent-color: var(--accent);
}
.dd-item-label { flex: 1; }
.dd-item-cat {
    margin-left: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dd-item-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.5;
}
.dd-item-link { margin-top: 0.35rem; font-size: 0.85rem; }
.dd-item-link a { color: var(--accent); text-decoration: none; }
.dd-item-link a:hover { text-decoration: underline; }
.dd-item-note { margin-top: 0.5rem; }
.dd-item-note .form-input { padding: 0.4rem 0.6rem; font-size: 0.85rem; }

/* Capex */
.capex-chart-container {
    background: var(--bg-elevated);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    height: 320px;
    position: relative;
}
.capex-row {
    padding: 0.65rem 0.75rem;
    border-left: 3px solid var(--accent);
    background: var(--bg-elevated);
    margin-bottom: 0.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.capex-row-head { font-size: 0.95rem; margin-bottom: 0.3rem; }
.capex-offset {
    display: inline-block;
    min-width: 2.4rem;
    padding: 0.1rem 0.4rem;
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    margin-right: 0.5rem;
}
.capex-row-cost { font-size: 0.85rem; color: var(--text-secondary); }
.capex-row-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.5; }

/* Property detail grid */
.property-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}
.property-detail-grid > .card { margin-bottom: 0; }
@media (max-width: 900px) {
    .property-detail-grid { grid-template-columns: 1fr; }
}

/* Accordion */
.accordion-card { padding: 0; overflow: hidden; }
.accordion-head {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition);
}
.accordion-head:hover { background: var(--bg-card-hover); }
.accordion-arrow { font-size: 0.75rem; color: var(--text-muted); transition: transform var(--transition); }
.accordion-card.accordion-collapsed .accordion-arrow { transform: rotate(-90deg); }
.accordion-body { padding: 1rem 1.25rem; }
.accordion-card.accordion-collapsed .accordion-body { display: none; }
.accordion-card.accordion-collapsed .accordion-head { border-bottom: none; }

/* Flag overlay rows */
.flag-overlay-row {
    padding: 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: var(--bg-elevated);
}
.flag-overlay-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.55; }
.empty-state h3 { margin-bottom: 0.5rem; color: var(--text); }

/* Small button variants (used in watchlist action cells) */
.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}
.btn-danger {
    background: var(--danger-muted);
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: var(--bg-deepest); }

/* Stat blocks used by capex totals */
.stat-block {
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    text-align: center;
}
.stat-block .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}
.stat-block .stat-value { font-size: 1.15rem; font-weight: 600; }
.stat-block .stat-value.accent { color: var(--accent); }

/* ============================================================
   Stage 3 — Offer Strategy + FHSA/HBP Optimizer + Scenarios
   ============================================================ */

/* Offer strategy headline — 4-cell banner (opening / expected / walk-away / irrevocable) */
.offer-strategy-headline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.offer-strategy-headline .osh-cell {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.9rem 0.75rem;
    text-align: center;
}
.offer-strategy-headline .osh-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}
.offer-strategy-headline .osh-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}
@media (max-width: 700px) {
    .offer-strategy-headline { grid-template-columns: repeat(2, 1fr); }
}

/* Bully-vs-wait verdict pill */
.bully-verdict {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--bg-deepest);
}
.bully-verdict-bully { background: #c9a227; }
.bully-verdict-wait { background: #60a5fa; color: #0b0b0b; }
.bully-verdict-either { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border-subtle); }
.bully-reasoning {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.bully-reasoning li { margin-bottom: 0.3rem; }

/* Condition chips */
.condition-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.condition-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: help;
    transition: background var(--transition), border-color var(--transition);
}
.condition-chip:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.condition-chip-required { border-color: var(--accent); }
.condition-chip .condition-days {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.condition-chip .condition-required-badge {
    background: var(--accent);
    color: var(--bg-deepest);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Negotiation script cards */
.script-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    overflow: hidden;
}
.script-card .script-head {
    padding: 0.75rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.script-card .script-head:hover { background: var(--bg-card-hover); }
.script-card .script-arrow { font-size: 0.72rem; color: var(--text-muted); transition: transform var(--transition); }
.script-card.script-collapsed .script-arrow { transform: rotate(-90deg); }
.script-card.script-collapsed .script-body { display: none; }
.script-card .script-body { padding: 0.1rem 0.9rem 0.85rem 0.9rem; }
.script-card .script-line {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-subtle);
    align-items: start;
}
.script-card .script-line:first-child { border-top: none; }
.script-card .script-line-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding-top: 0.2rem;
}
.script-card .script-line-text {
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text);
}
@media (max-width: 700px) {
    .script-card .script-line { grid-template-columns: 1fr; }
    .script-card .script-line .btn-xs { justify-self: start; }
}

/* Drawdown plan table (FHSA/HBP) */
.drawdown-plan-table { width: 100%; }
.drawdown-plan-table th { text-align: left; }
.drawdown-plan-table .drawdown-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 32rem;
}
.drawdown-source-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #0b0b0b;
}
.drawdown-source-fhsa { background: #34d399; }
.drawdown-source-hbp { background: #60a5fa; }
.drawdown-source-tfsa { background: #fbbf24; }
.drawdown-source-nonregistered { background: #f87171; }
.drawdown-row td { padding: 0.55rem 0.5rem; vertical-align: top; border-top: 1px solid var(--border-subtle); }
.drawdown-row:first-child td { border-top: none; }

/* Rules fired list (transparency) */
.rules-fired-list {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.83rem;
    list-style: none;
}
.rules-fired-list li { padding: 0.2rem 0; border-top: 1px dashed var(--border-subtle); }
.rules-fired-list li:first-child { border-top: none; }
.rules-fired-list code {
    background: var(--bg-elevated);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Scenario recommendation highlight (closing detailed → scenarios) */
.scenario-recommended td:first-child {
    position: relative;
}
.recommended-badge {
    background: var(--accent);
    color: var(--bg-deepest);
    padding: 0.08rem 0.45rem;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.35rem;
    font-weight: 700;
    vertical-align: middle;
}

/* ============================================================
   Stage 4 — Polish (mobile, empty state, print CSS, archival, bulk)
   ============================================================ */

/* Dashboard hero — Stage 4 consolidated summary card */
.dash-hero-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.dash-hero-card h3 { margin: 0 0 0.75rem 0; }
.dash-hero-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}
.dash-hero-cell {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}
.dash-hero-cell .dhc-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.dash-hero-cell .dhc-value { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.dash-hero-cell .dhc-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* Empty state refinements */
.empty-state p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }
.empty-state .btn-row { justify-content: center; margin-top: 1rem; }

/* Watchlist archive mode */
.watchlist-view-tabs {
    display: inline-flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
    gap: 0.2rem;
    margin-bottom: 1rem;
}
.watchlist-view-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: background var(--transition), color var(--transition);
    font-family: inherit;
}
.watchlist-view-tab:hover { color: var(--text); }
.watchlist-view-tab.active { background: var(--accent); color: var(--bg-deepest); font-weight: 600; }

.watchlist-row.archived { opacity: 0.55; }
.watchlist-row.archived .tier-badge { filter: grayscale(0.85); }

/* Bulk selection bar */
.bulk-actions-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    display: none;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.9rem;
}
.bulk-actions-bar.active { display: flex; }
.bulk-actions-bar .bulk-count {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}
.bulk-actions-bar .bulk-spacer { flex: 1; }

/* Export dropdown */
.export-dropdown { position: relative; display: inline-block; }
.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    min-width: 160px;
    display: none;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}
.export-menu.open { display: block; }
.export-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-family: inherit;
}
.export-menu button:hover { background: var(--bg-card-hover); color: var(--accent); }

/* Focus visible (a11y) */
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.accordion-head:focus-visible,
.nav-item:focus-visible,
.watchlist-row:focus-visible,
.tier-badge:focus-visible,
.verdict-badge:focus-visible,
.flag-card:focus-visible,
.condition-chip:focus-visible,
.tab-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Stage 4 — Mobile responsiveness for watchlist + new Stage 1-3 UI */
@media (max-width: 768px) {
    /* Watchlist list → stack rows as label/value card blocks */
    .watchlist-table,
    .watchlist-table thead,
    .watchlist-table tbody,
    .watchlist-table tr,
    .watchlist-table td,
    .watchlist-table th { display: block; width: 100%; }
    .watchlist-table thead { display: none; }
    .watchlist-table tr.watchlist-row {
        background: var(--bg-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.7rem;
    }
    .watchlist-table tr.watchlist-row:hover { background: var(--bg-card-hover); }
    .watchlist-table td {
        padding: 0.35rem 0;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.9rem;
    }
    .watchlist-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex: 0 0 auto;
    }
    .watchlist-table td.wl-cell-select,
    .watchlist-table td.wl-cell-actions { justify-content: flex-end; }
    .watchlist-table td.wl-cell-select::before,
    .watchlist-table td.wl-cell-actions::before { content: ''; }

    /* Property detail grid — enforce single col (already at 900, belt+braces) */
    .property-detail-grid { grid-template-columns: 1fr; }

    /* Offer strategy banner — stack vertically */
    .offer-strategy-headline { grid-template-columns: 1fr; gap: 0.5rem; }

    /* Scan results grid — already handled, but re-assert */
    .scan-results-grid { grid-template-columns: 1fr; }

    /* Horizontal scroll for tab bars that overflow on mobile */
    .tab-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .tab-bar .tab-btn { flex-shrink: 0; }

    /* Form grids — 1 col on mobile */
    .form-grid { grid-template-columns: 1fr; }

    /* Dash hero — 2 col at tablet, 1 col at phone */
    .dash-hero-grid { grid-template-columns: repeat(2, 1fr); }

    /* Bulk actions bar wraps nicely */
    .bulk-actions-bar { position: static; }
    .bulk-actions-bar .bulk-spacer { display: none; }

    /* Touch-friendly hit targets — 44x44 min */
    .tier-badge,
    .verdict-badge {
        min-height: 28px;
        padding: 0.3rem 0.6rem;
        display: inline-flex;
        align-items: center;
    }
    .flag-card { min-height: 44px; }
    .condition-chip { min-height: 38px; padding: 0.5rem 0.75rem; }
    .accordion-head { min-height: 48px; }

    /* Export dropdown menu — full width */
    .export-dropdown, .export-menu { width: 100%; }
    .export-menu { right: auto; left: 0; }
}

@media (max-width: 480px) {
    .dash-hero-grid { grid-template-columns: 1fr; }
    .watchlist-view-tabs { width: 100%; display: flex; }
    .watchlist-view-tab { flex: 1; text-align: center; }
}

/* ============================================================
   Stage 4 — Print CSS (one-page property summary)
   ============================================================ */
@media print {
    /* Force light color scheme for ink economy */
    :root {
        --bg-deepest: #ffffff;
        --bg-deep: #ffffff;
        --bg-card: #ffffff;
        --bg-card-hover: #ffffff;
        --bg-elevated: #ffffff;
        --bg-input: #ffffff;
        --bg-sidebar: #ffffff;
        --text: #000000;
        --text-secondary: #333333;
        --text-muted: #555555;
        --text-dim: #888888;
        --border: #bbbbbb;
        --border-light: #cccccc;
        --border-subtle: #dddddd;
        --accent: #000000;
        --accent-muted: #f0f0f0;
        --accent-border: #888888;
        --success: #000000;
        --warning: #000000;
        --danger: #000000;
        --info: #000000;
        --shadow: none;
        --shadow-lg: none;
        --shadow-glow: none;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
        line-height: 1.4;
        font-size: 11pt;
    }
    /* Chrome/UI hidden */
    .sidebar,
    .sidebar-toggle,
    .sidebar-overlay,
    .sidebar-footer,
    .btn-row,
    .btn,
    button,
    .export-dropdown,
    .export-menu,
    .bulk-actions-bar,
    .watchlist-view-tabs,
    #watchlist-add-form,
    #watchlist-csv-modal,
    .dash-quicklinks,
    .tab-bar,
    .market-pulse-card,
    .callout-warning,
    .no-print {
        display: none !important;
    }
    /* Main content takes full width */
    .main-content, .content-area {
        margin-left: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .app-layout { display: block !important; }
    /* Only the active section prints */
    .section-panel { display: none !important; }
    .section-panel.active { display: block !important; page-break-inside: auto; }
    /* Force single-column content */
    .property-detail-grid,
    .form-grid,
    .stats-grid,
    .dash-hero-grid,
    .offer-strategy-headline,
    .scan-results-grid {
        display: block !important;
        grid-template-columns: 1fr !important;
    }
    .property-detail-grid > .card,
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        background: #ffffff !important;
        border: 1px solid #888 !important;
        margin-bottom: 0.75rem !important;
        box-shadow: none !important;
    }
    /* Accordions always expanded */
    .accordion-card.accordion-collapsed .accordion-body,
    .accordion-card .accordion-body { display: block !important; }
    .accordion-arrow { display: none !important; }
    .accordion-head { cursor: default !important; border-bottom: 1px solid #ccc !important; }
    /* Tables — classic black borders */
    table {
        border-collapse: collapse;
        width: 100%;
    }
    table, table th, table td {
        border: 1px solid #888 !important;
        padding: 0.35rem 0.5rem !important;
        font-size: 10pt;
        color: #000 !important;
        background: #fff !important;
    }
    /* Badges keep black borders, remove fills */
    .tier-badge,
    .verdict-badge,
    .drawdown-source-badge,
    .recommended-badge,
    .bully-verdict,
    .tier-badge.tier-1,
    .tier-badge.tier-2,
    .tier-badge.tier-3,
    .tier-badge.tier-4,
    .verdict-badge.verdict-offer,
    .verdict-badge.verdict-view,
    .verdict-badge.verdict-conditional,
    .verdict-badge.verdict-skip {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    h1, h2, h3, h4, h5 { color: #000 !important; page-break-after: avoid; }
    /* Print banner */
    .print-banner {
        display: block !important;
        border-bottom: 2px solid #000;
        padding-bottom: 0.4rem;
        margin-bottom: 1rem;
    }
    .print-banner h1 { font-size: 14pt; margin: 0; }
    .print-banner .print-meta { font-size: 9pt; color: #555; margin-top: 0.15rem; }
    /* Hide chart canvases — Chart.js renders dark; use the list fallback */
    .capex-chart-container { display: none !important; }
    /* Hide nav-group in sidebar */
    .nav-group, .nav-item { display: none !important; }
}
.print-banner { display: none; }

