/* EnergyEquity — Complete rewrite with bulletproof layout */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #222636;
    --bg-input: #2a2e3f;
    --border: #2e3348;
    --text-primary: #f5f6fa;
    --text-secondary: #cdd1e0;
    --text-muted: #a0a4b8;
    --accent: #6c8cff;
    --green: #4ade80;
    --yellow: #facc15;
    --red: #f87171;
    --purple: #a78bfa;
    --energy: #4ade80;
    --energy-light: #86efac;
    --energy-bg: rgba(74, 222, 128, 0.08);
    --energy-border: rgba(74, 222, 128, 0.2);
    --text-bright: #ffffff;
    --radius: 8px;
    --header-height: 52px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

/* ============================================================
   2. PAGE LAYOUT — 3-view state architecture.

   Views (controlled by body class):
     view--landing   → Landing hero with wizard
     view--dashboard → Full-width dashboard card grid + chat drawer
     view--report    → Formatted assessment report

   Structure:
     html/body  →  exactly 100vh, no scroll
       header   →  fixed 52px, never shrinks
       .landing →  centered hero (landing view)
       .dashboard → full-width card grid (dashboard view)
       .chat-drawer → fixed slide-out right panel
       .report  → full-screen report overlay
   ============================================================ */

html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- View state visibility --- */
.landing { display: none; }
.dashboard { display: none; }
body.view--landing .landing { display: flex; }
body.view--dashboard .dashboard { display: flex; }

.header {
    flex: 0 0 var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 50;
}

/* --- Landing view --- */
.landing {
    flex: 1 1 0;
    min-height: 0;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 40px 20px;
}

.landing__hero {
    max-width: 640px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.landing__title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--energy), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.landing__subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 480px;
}

/* --- Dashboard view (full-width) --- */
.dashboard {
    flex: 1 1 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

/* --- Dashboard Tabs --- */
.dash-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 2px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.dash-tabs__tab {
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: var(--font);
}

.dash-tabs__tab:hover {
    color: var(--text-primary);
}

.dash-tabs__tab--active {
    color: var(--energy);
    border-bottom-color: var(--energy);
}

/* --- Tab Content Panels --- */
.dash-tab-content {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.dash-tab-content--hidden {
    display: none;
}

.dashboard__grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
    padding: 20px;
}

/* --- Progress Narrative --- */
.progress-narrative {
    display: flex;
    justify-content: center;
    padding: 60px 20px 40px;
    transition: opacity 0.5s ease;
}

.progress-narrative--fade {
    opacity: 0;
}

.progress-narrative__inner {
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.progress-narrative__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.progress-narrative__subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.progress-narrative__timeline {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.progress-phase {
    padding: 14px 16px;
    border-left: 2px solid var(--border);
    margin-left: 11px;
    position: relative;
    animation: dashFadeIn 0.3s ease-out;
}

.progress-phase:last-child {
    border-left-color: transparent;
}

.progress-phase--done {
    opacity: 0.55;
}

.progress-phase--done .progress-phase__detail {
    display: none;
}

.progress-phase--complete {
    border-left-color: transparent;
    opacity: 1;
}

.progress-phase--complete .progress-phase__spinner {
    color: var(--energy);
    background: var(--energy-bg);
    border-color: var(--energy);
}

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

.progress-phase__spinner {
    position: absolute;
    left: -12px;
    top: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.progress-phase--active .progress-phase__spinner {
    border-color: var(--accent);
    color: var(--accent);
}

.progress-phase--done .progress-phase__spinner {
    border-color: var(--energy);
    color: var(--energy);
    background: var(--energy-bg);
}

.progress-spin {
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.progress-phase__icon {
    font-size: 1.1rem;
    line-height: 1;
}

.progress-phase__label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-phase--done .progress-phase__label {
    color: var(--text-secondary);
}

.progress-phase__detail {
    margin-top: 6px;
    margin-left: 32px;
    font-size: 0.76rem;
    color: var(--text-muted);
    min-height: 1.2em;
    transition: opacity 0.2s;
}

/* --- Dashboard cards --- */
.dash-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    animation: dashFadeIn 0.4s ease-out;
}

.dash-card--full {
    grid-column: 1 / -1;
}

/* Card hierarchy */
.dash-card--primary {
    border-color: rgba(74, 222, 128, 0.25);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(74, 222, 128, 0.06);
}
.dash-card--primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--energy), var(--accent));
}
.dash-card--secondary {
    /* default card style */
}
.dash-card--tertiary {
    background: rgba(26, 29, 39, 0.5);
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.06);
}

/* Card grid spans */
/* dash-card--profile rule kept for backwards compat; no element matches it
   any more (standalone "Your Home" card removed 2026-05-07). */
.dash-card--profile { display: none !important; }
/* Map now spans the full 12 columns since it no longer shares row 1 with
   a profile card. */
.dash-card--map-hero { grid-column: 1 / -1; min-height: 400px; position: relative; padding: 0; overflow: hidden; }
.dash-card--energy { grid-column: span 5; }
.dash-card--comparison { grid-column: span 7; }
.dash-card--explanation { grid-column: 1 / -1; padding: 0; overflow: hidden; }
.dash-card--renovation { grid-column: span 7; }
.dash-card--subsidies { grid-column: span 5; }

/* ============================================================
   HERO METRICS BAR
   ============================================================ */
.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 20px 0;
}
.hero-metric {
    background: var(--bg-card);
    padding: 20px;
    text-align: center;
}
.hero-metric:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.hero-metric:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.hero-metric__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.hero-metric__value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-bright);
    line-height: 1;
}
.hero-metric__sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 6px;
}
.hero-metric__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
}

/* ============================================================
   PROFILE CARD (separate grid card)
   ============================================================ */
.dash-card--profile .dash-section__title {
    display: flex; align-items: center; gap: 8px;
}
.dash-card--profile .dash-section__title svg {
    width: 20px; height: 20px; color: var(--energy);
}
.map-hero__profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.map-hero__field {
    padding: 7px 9px;
    background: rgba(255,255,255,0.04);
    border-radius: 5px;
}
.map-hero__field-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.map-hero__field-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* ============================================================
   DONUT RING GAUGE
   ============================================================ */
.gauge-donut { text-align: center; padding: 16px 0; }
.gauge-donut__ring {
    position: relative;
    width: 200px; height: 200px;
    margin: 0 auto;
}
.gauge-donut__ring svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.gauge-donut__track-circle {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 18;
}
.gauge-donut__fill-circle {
    fill: none;
    stroke-width: 18;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease-out;
}
.gauge-donut__center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.gauge-donut__value {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-bright);
    line-height: 1;
}
.gauge-donut__unit {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.gauge-donut__status {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* ============================================================
   EPC ENERGY LABEL
   ============================================================ */
.epc-label { padding: 8px 0; }
.epc-label__row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 3px;
}
.epc-label__bar {
    height: 30px;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    position: relative;
    transition: all 0.2s;
}
.epc-label__bar--A { width: 30%; background: #00845a; }
.epc-label__bar--B { width: 38%; background: #2ca04b; }
.epc-label__bar--C { width: 46%; background: #7bc043; }
.epc-label__bar--D { width: 54%; background: #d4c826; color: #1a1a1a; text-shadow: none; }
.epc-label__bar--E { width: 62%; background: #e8932f; }
.epc-label__bar--F { width: 72%; background: #e05e28; }
.epc-label__bar--G { width: 82%; background: #d42020; }
.epc-label__letter { font-size: 0.88rem; }
.epc-label__range { font-size: 0.62rem; font-family: var(--font-mono); opacity: 0.85; font-weight: 500; }
.epc-label__row--active .epc-label__bar {
    height: 38px;
    box-shadow: 0 0 16px rgba(255,255,255,0.15);
    z-index: 1;
}
.epc-label__pointer {
    display: flex; align-items: center; gap: 8px;
    margin-left: 12px; white-space: nowrap;
}
.epc-label__pointer-arrow {
    width: 0; height: 0;
    border-right: 10px solid var(--text-bright);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}
.epc-label__pointer-text {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-bright);
}

/* ============================================================
   COMPARISON STRIP V2
   ============================================================ */
/* Comparison bar — zone-based */
.cmp { padding: 12px 0; }
.cmp__bar-wrap {
    position: relative;
    padding: 48px 0 16px;
    margin: 0 20px;
}
.cmp__bar {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #27ae60 0%, #f1c40f 33%, #e67e22 42%, #e74c3c 50%, #c0392b 58%, #8e44ad 75%, #6a1b9a 100%);
    position: relative;
}
/* Zone divider lines */
.cmp__zone-line {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 0;
    border-left: 1.5px dashed rgba(255,255,255,0.5);
    z-index: 1;
}
/* Zone label tags — sit below the bar */
.cmp__zone-tag {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1.3;
}
.cmp__zone-val {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-bright);
    margin-top: 1px;
}
/* User value — badge + stem + arrow pointing down into bar */
.cmp__you {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}
.cmp__you-badge {
    position: absolute;
    bottom: calc(100% + 4px);
    white-space: nowrap;
    background: var(--text-bright);
    color: var(--bg-primary);
    font-size: 0.82rem;
    font-weight: 800;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.cmp__you-badge small {
    font-weight: 600;
    font-size: 0.68rem;
    opacity: 0.7;
}
.cmp__you-stem {
    width: 2px;
    height: 14px;
    background: var(--text-bright);
}
.cmp__you-arrow {
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-bright);
}
.cmp__context {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 40px;
}
.cmp__context strong { color: var(--text-bright); }

/* ============================================================
   UNIFIED 3D HOUSE EXPLANATION
   ============================================================ */
.house3d {
    position: relative;
    overflow: hidden;
    height: 480px;
    border-radius: var(--radius);
    background: var(--bg-primary);
}
.house3d__viewport {
    width: 100%; height: 100%;
    perspective: 1200px;
    perspective-origin: 50% 45%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    cursor: grab;
    user-select: none; -webkit-user-select: none;
    touch-action: none;
}
.house3d__viewport--dragging { cursor: grabbing; }

/* CSS 3D house scene */
.house3d-scene {
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
}
.house3d-scene *, .house3d-scene *::before, .house3d-scene *::after {
    transform-style: preserve-3d;
    box-sizing: border-box;
}
.house3d-root {
    position: relative;
    transition: transform .12s ease-out;
}
.house3d-cuboid { position: absolute; }
.house3d-face { position: absolute; backface-visibility: hidden; }
.house3d__part { cursor: pointer; transition: filter .15s; }
.house3d__part--glow > .house3d-face,
.house3d__part--glow.house3d-face {
    filter: brightness(1.35) drop-shadow(0 0 6px rgba(255,255,255,0.45));
}
.house3d-scene--floating .house3d-root {
    animation: house3dFloat 6s ease-in-out infinite;
}
@keyframes house3dFloat {
    0%, 100% { transform: perspective(800px) rotateX(65deg) rotateZ(35deg); }
    50% { transform: perspective(800px) rotateX(65deg) rotateZ(25deg); }
}
.house3d__tooltip {
    position: absolute; top: 12px; left: 12px;
    background: rgba(17,24,39,0.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px; padding: 8px 14px;
    font-size: 0.78rem; color: var(--text-bright);
    pointer-events: none; opacity: 0;
    transition: opacity 0.15s; z-index: 5; white-space: nowrap;
}
.house3d__tooltip--visible { opacity: 1; }
.house3d__tooltip-name { font-weight: 700; margin-bottom: 2px; }
.house3d__tooltip-pct { font-family: var(--font-mono); font-weight: 800; font-size: 1rem; }
.house3d__tooltip-detail { font-size: 0.68rem; color: var(--text-muted); }
.house3d__controls {
    position: absolute; top: 8px; left: 8px; z-index: 10; display: flex; gap: 6px;
}
.house3d__btn {
    background: rgba(26,26,46,0.8); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 2px 10px; border-radius: 4px;
    font-size: 0.7rem; cursor: pointer; transition: all 0.2s;
    backdrop-filter: blur(8px); font-family: var(--font);
}
.house3d__btn:hover { color: var(--accent); border-color: var(--accent); }

/* Floating info panel */
.house3d__info {
    position: absolute; top: 12px; right: 12px; width: 280px;
    max-height: calc(100% - 24px); overflow-y: auto;
    background: rgba(26,26,46,0.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: 10px; z-index: 15;
}
/* Profile in info panel */
.house3d__info-profile {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.house3d__info-profile-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.house3d__info-profile-icon {
    width: 22px; height: 22px; color: var(--energy); flex-shrink: 0;
}
.house3d__info-profile-icon svg { width: 100%; height: 100%; }
.house3d__info-profile-name {
    font-weight: 700; font-size: 0.78rem; color: var(--text-bright);
}
.house3d__info-profile-sub {
    font-size: 0.66rem; color: var(--text-secondary);
}
.house3d__info-profile-tags {
    display: flex; flex-wrap: wrap; gap: 3px;
}
.house3d__info-profile-tag {
    font-size: 0.62rem; color: var(--text-muted);
    background: rgba(255,255,255,0.04); padding: 1px 6px;
    border-radius: 3px;
}
.house3d__info-header {
    padding: 12px 14px 8px; border-bottom: 1px solid var(--border);
    font-weight: 600; color: var(--accent); font-size: 0.82rem;
}
.house3d__info-summary {
    display: flex; justify-content: space-between;
    padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.72rem;
}
.house3d__info-base { color: var(--text-secondary); }
.house3d__info-base-val { font-family: var(--font-mono); font-weight: 600; color: var(--text-bright); }
.house3d__info-pred { color: var(--text-secondary); }
.house3d__info-pred-val { font-family: var(--font-mono); font-weight: 700; color: var(--energy); }
.house3d__info-section { padding: 6px 14px; }
.house3d__info-section-title {
    font-size: 0.64rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 4px;
}
.house3d__info-row {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 4px; border-radius: 4px; transition: background 0.15s;
}
.house3d__info-row[data-component] { cursor: pointer; }
.house3d__info-row--active { background: rgba(255,255,255,0.06); }
.house3d__info-dot {
    width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.house3d__info-name {
    flex: 1; color: var(--text-primary); font-size: 0.74rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.house3d__info-pct {
    font-family: var(--font-mono); font-weight: 700; font-size: 0.7rem;
    color: var(--text-bright); min-width: 28px; text-align: right;
}
.house3d__info-shap-bar {
    width: 44px; height: 12px; position: relative; flex-shrink: 0;
}
.house3d__info-shap-center {
    position: absolute; left: 50%; top: 0; width: 1px; height: 100%;
    background: rgba(255,255,255,0.15);
}
.house3d__info-shap-fill {
    position: absolute; top: 2px; height: 8px; border-radius: 2px;
}
.house3d__info-shap-fill--pos { left: 50%; background: rgba(248,113,113,0.65); }
.house3d__info-shap-fill--neg { right: 50%; background: rgba(108,140,255,0.65); }
.house3d__info-shap-val {
    font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700;
    min-width: 34px; text-align: right;
}
.house3d__info-shap-val--pos { color: var(--red); }
.house3d__info-shap-val--neg { color: var(--accent); }
.house3d__info-legend {
    display: flex; gap: 12px; justify-content: center;
    padding: 6px 14px 10px; font-size: 0.62rem; color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.04);
}
.house3d__info-legend-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 2px; margin-right: 4px; vertical-align: middle;
}

/* Detail panel (zoom-in view) */
.house3d__detail {
    position: absolute; bottom: 16px; left: 16px; right: 16px;
    background: rgba(17,24,39,0.94);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 0;
    z-index: 20; pointer-events: none;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.35s, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 360px;
}
.house3d__detail--visible {
    opacity: 1; transform: translateY(0); pointer-events: auto;
}
.house3d__detail-back {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 14px 6px; background: none; border: none;
    color: var(--text-secondary); font-size: 0.72rem; cursor: pointer;
    font-family: var(--font); transition: color 0.15s;
}
.house3d__detail-back:hover { color: var(--accent); }
.house3d__detail-header {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 14px 10px;
}
.house3d__detail-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.house3d__detail-title {
    font-size: 1.05rem; font-weight: 700; color: var(--text-bright);
}
.house3d__detail-stat {
    padding: 8px 14px 12px; border-top: 1px solid rgba(255,255,255,0.06);
}
.house3d__detail-stat-value {
    font-family: var(--font-mono); font-size: 1.6rem; font-weight: 800; line-height: 1;
}
.house3d__detail-stat-label {
    font-size: 0.7rem; color: var(--text-muted); margin-top: 2px;
}
.house3d__detail-bar {
    width: 100%; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.08); margin-top: 8px; overflow: hidden;
}
.house3d__detail-bar-fill {
    height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.house3d__detail-meta {
    padding: 6px 14px; font-size: 0.74rem; color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.04);
}
.house3d__detail-shap {
    padding: 8px 14px; border-top: 1px solid rgba(255,255,255,0.06);
}
.house3d__detail-shap-label {
    font-size: 0.64rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 4px;
}
.house3d__detail-shap-value {
    font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700;
}
.house3d__detail-shap-value--pos { color: var(--red); }
.house3d__detail-shap-value--neg { color: var(--accent); }
.house3d__detail-shap-desc {
    font-size: 0.68rem; color: var(--text-secondary); margin-top: 2px;
}
.house3d__detail-desc {
    padding: 10px 14px 14px; font-size: 0.72rem; line-height: 1.5;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.04);
}
/* Renovation info in zoom detail */
.house3d__detail-reno {
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.house3d__detail-reno-title {
    font-size: 0.64rem; color: var(--energy); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 8px; font-weight: 600;
}
.house3d__detail-reno-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.house3d__detail-reno-item:last-child { border-bottom: none; }
.house3d__detail-reno-name {
    font-size: 0.78rem; font-weight: 600; color: var(--text-bright);
}
.house3d__detail-reno-cost {
    font-size: 0.7rem; color: var(--text-secondary);
    font-family: var(--font-mono); margin-top: 2px;
}
.house3d__detail-reno-saving {
    font-size: 0.68rem; color: var(--green); margin-top: 2px; font-weight: 500;
}
/* Profile overlay (bottom-left of viewport) */
.house3d__profile {
    position: absolute; bottom: 14px; left: 14px;
    background: rgba(17,24,39,0.88);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; padding: 12px 14px;
    z-index: 12; max-width: 260px;
    transition: opacity 0.3s, transform 0.3s;
}
.house3d__profile-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.house3d__profile-icon {
    font-size: 1.5rem; line-height: 1;
}
.house3d__profile-name {
    font-weight: 700; font-size: 0.82rem; color: var(--text-bright);
}
.house3d__profile-loc {
    font-size: 0.7rem; color: var(--text-secondary);
}
.house3d__profile-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px;
}
.house3d__profile-field {
    display: flex; justify-content: space-between; gap: 6px;
    padding: 2px 0;
}
.house3d__profile-label {
    font-size: 0.64rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.03em;
}
.house3d__profile-value {
    font-size: 0.7rem; color: var(--text-primary); font-weight: 600;
    text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Focused viewport: hide info panel, profile; dim tooltip */
.house3d__viewport--focused ~ .house3d__info {
    opacity: 0.3; pointer-events: none; transition: opacity 0.35s;
}
.house3d__viewport--focused .house3d__tooltip { display: none; }
.house3d__viewport--focused .house3d__profile {
    opacity: 0; pointer-events: none; transform: translateY(10px);
}

/* ============================================================
   UNIFIED HOUSE CARD — Flex Layout + Info Panel States
   ============================================================ */
.house3d--unified {
    display: flex; height: 560px; background: var(--bg-primary); border-radius: var(--radius); overflow: hidden;
}
.house3d--unified .house3d__viewport-col {
    flex: 1; position: relative; min-width: 0;
}
.house3d--unified .house3d__viewport {
    width: 100%; height: 100%;
}
.house3d--unified .house3d__info-col {
    width: 340px; flex-shrink: 0;
    border-left: 1px solid var(--border);
    background: rgba(17,24,39,0.6);
    overflow: hidden; position: relative;
}
.house3d__info-scroll {
    height: 100%; overflow-y: auto; overflow-x: hidden;
    transition: opacity 0.2s ease;
}
.house3d__info-scroll::-webkit-scrollbar { width: 4px; }
.house3d__info-scroll::-webkit-scrollbar-track { background: transparent; }
.house3d__info-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.uinfo--transitioning { opacity: 0; }

/* uinfo sections */
.uinfo__section {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.uinfo__section:last-child { border-bottom: none; }
.uinfo__section-title {
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin-bottom: 8px; font-weight: 600;
}

/* Profile section */
.uinfo__profile-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.uinfo__profile-icon { width: 28px; height: 28px; color: var(--energy); flex-shrink: 0; }
.uinfo__profile-icon svg { width: 100%; height: 100%; }
.uinfo__profile-name { font-weight: 700; font-size: 0.88rem; color: var(--text-bright); }
.uinfo__profile-sub { font-size: 0.72rem; color: var(--text-secondary); }
.uinfo__profile-fields {
    display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 0.7rem; color: var(--text-secondary);
}
.uinfo__field strong { color: var(--text-primary); }

/* Energy hero */
.uinfo__energy-hero {
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
}
.uinfo__epc-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 7px;
    font-weight: 800; font-size: 1.15rem; color: #fff; flex-shrink: 0;
}
.uinfo__energy-kwh {
    font-family: var(--font-mono); font-weight: 800; font-size: 1.9rem; color: var(--text-bright);
    line-height: 1;
}
.uinfo__energy-unit { font-size: 0.68rem; color: var(--text-secondary); }

/* Mini comparison bar */
.uinfo__minibar { margin: 8px 0 6px; }
.uinfo__minibar-track {
    position: relative; height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, #27ae60, #f1c40f 50%, #e74c3c); opacity: 0.55;
}
.uinfo__minibar-pip {
    position: absolute; top: -4px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--text-bright);
    border: 2px solid var(--bg-primary); transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(255,255,255,0.4);
}
.uinfo__minibar-tick {
    position: absolute; top: -2px; width: 1px; height: 10px;
    background: rgba(255,255,255,0.35);
}
.uinfo__minibar-labels {
    display: flex; justify-content: space-between;
    font-size: 0.58rem; color: var(--text-muted); margin-top: 2px;
}

/* Cost & poverty */
.uinfo__energy-cost { font-size: 0.74rem; color: var(--text-secondary); margin-top: 4px; }
.uinfo__poverty {
    display: inline-block; font-size: 0.7rem; color: var(--green); margin-top: 4px;
    font-weight: 600; padding: 2px 8px; border-radius: 4px;
    background: rgba(74,222,128,0.08);
}
.uinfo__poverty--poor { color: var(--red); background: rgba(248,113,113,0.08); }

/* Heat loss rows */
.uinfo__hl-row {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 6px; border-radius: 5px; cursor: pointer;
    transition: background 0.15s;
}
.uinfo__hl-row:hover { background: rgba(255,255,255,0.06); }
.uinfo__hl-row--active { background: rgba(255,255,255,0.08); }
.uinfo__hl-dot {
    width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.uinfo__hl-name { flex: 1; font-size: 0.74rem; color: var(--text-primary); }
.uinfo__hl-pct {
    font-family: var(--font-mono); font-weight: 700; font-size: 0.72rem;
    color: var(--text-bright); min-width: 28px; text-align: right;
}
.uinfo__hl-bar {
    width: 60px; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.06); overflow: hidden; flex-shrink: 0;
}
.uinfo__hl-bar-fill { height: 100%; border-radius: 3px; }
.uinfo__reno-indicator {
    color: var(--energy); opacity: 0; font-size: 0.68rem;
    transition: opacity 0.3s; flex-shrink: 0;
}
.uinfo__reno-indicator--visible { opacity: 0.7; }

/* SHAP factor rows */
.uinfo__shap-row {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 6px; font-size: 0.72rem;
}
.uinfo__shap-name { flex: 1; color: var(--text-secondary); }
.uinfo__shap-bar {
    width: 44px; height: 12px; position: relative; flex-shrink: 0;
}
.uinfo__shap-center {
    position: absolute; left: 50%; top: 0; width: 1px; height: 100%;
    background: rgba(255,255,255,0.15);
}
.uinfo__shap-fill {
    position: absolute; top: 2px; height: 8px; border-radius: 2px;
}
.uinfo__shap-fill--pos { left: 50%; background: rgba(248,113,113,0.65); }
.uinfo__shap-fill--neg { right: 50%; background: rgba(108,140,255,0.65); }
.uinfo__shap-val {
    font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700;
    min-width: 40px; text-align: right;
}
.uinfo__shap-val--pos { color: var(--red); }
.uinfo__shap-val--neg { color: var(--accent); }

/* System upgrades */
.uinfo__upgrade-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.025); margin-bottom: 4px;
    cursor: pointer; transition: background 0.15s;
}
.uinfo__upgrade-item:hover { background: rgba(255,255,255,0.06); }
.uinfo__upgrade-icon { font-size: 1rem; flex-shrink: 0; }
.uinfo__upgrade-body { flex: 1; min-width: 0; }
.uinfo__upgrade-name { font-size: 0.78rem; color: var(--text-bright); font-weight: 600; }
.uinfo__upgrade-cost { font-size: 0.66rem; color: var(--text-secondary); font-family: var(--font-mono); }

/* Hint */
.uinfo__hint {
    padding: 14px 16px; text-align: center;
    font-size: 0.66rem; color: var(--text-muted); font-style: italic;
}
.uinfo__placeholder {
    font-size: 0.72rem; color: var(--text-muted); font-style: italic; padding: 4px 0;
}

/* ---- Component Detail State ---- */
.uinfo__back {
    display: flex; align-items: center; gap: 6px;
    padding: 14px 16px 8px; background: none; border: none;
    color: var(--text-secondary); font-size: 0.74rem;
    cursor: pointer; font-family: var(--font); transition: color 0.15s;
    width: 100%;
}
.uinfo__back:hover { color: var(--accent); }
.uinfo__comp-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.uinfo__comp-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; flex-shrink: 0;
}
.uinfo__comp-title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); }
.uinfo__stat-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 3px 0; font-size: 0.76rem;
}
.uinfo__stat-label { color: var(--text-secondary); }
.uinfo__stat-value {
    color: var(--text-bright); font-family: var(--font-mono);
    font-weight: 600; text-align: right;
}
.uinfo__stat-value--pos { color: var(--red); }
.uinfo__stat-value--neg { color: var(--accent); }
.uinfo__stat-bar {
    height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06);
    margin-top: 6px; overflow: hidden;
}
.uinfo__stat-bar-fill { height: 100%; border-radius: 3px; }

/* Renovation items in detail */
.uinfo__reno-item {
    display: flex; gap: 10px; padding: 10px;
    background: rgba(255,255,255,0.03); border-radius: 8px; margin-bottom: 6px;
    transition: background 0.15s;
}
.uinfo__reno-item:hover { background: rgba(255,255,255,0.05); }
.uinfo__reno-check { padding-top: 1px; flex-shrink: 0; }
.uinfo__reno-check input {
    accent-color: var(--energy); width: 16px; height: 16px; cursor: pointer;
}
.uinfo__reno-body { flex: 1; min-width: 0; }
.uinfo__reno-name { font-size: 0.82rem; font-weight: 600; color: var(--text-bright); }
.uinfo__reno-cost {
    font-size: 0.7rem; color: var(--text-secondary);
    font-family: var(--font-mono); margin-top: 2px;
}
.uinfo__reno-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.uinfo__reno-tag {
    display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 0.62rem;
}
.uinfo__reno-tag--saving { background: rgba(74,222,128,0.1); color: var(--green); }
.uinfo__reno-tag--payback { background: rgba(108,140,255,0.1); color: var(--accent); }

/* Subsidy items in detail */
.uinfo__subsidy-item {
    padding: 8px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.025); margin-bottom: 4px;
}
.uinfo__subsidy-name { font-size: 0.78rem; font-weight: 600; color: var(--text-bright); }
.uinfo__subsidy-amount { font-size: 0.7rem; color: var(--energy); margin-top: 2px; }
.uinfo__subsidy-badge {
    display: inline-block; font-size: 0.6rem; padding: 1px 6px; border-radius: 3px;
    margin-top: 4px; font-weight: 600;
}
.uinfo__subsidy-badge--eligible { background: rgba(74,222,128,0.12); color: var(--green); }
.uinfo__subsidy-badge--unknown { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* No content message */
.uinfo__no-reno {
    font-size: 0.72rem; color: var(--text-muted); font-style: italic; padding: 4px 0;
}
.uinfo__desc {
    padding: 12px 16px; font-size: 0.72rem; line-height: 1.55;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* Responsive */
@media (max-width: 800px) {
    .house3d--unified { flex-direction: column; height: auto; }
    .house3d--unified .house3d__viewport-col { height: 320px; }
    .house3d--unified .house3d__info-col {
        width: 100%; border-left: none;
        border-top: 1px solid var(--border); max-height: 420px;
    }
}

/* ============================================================
   FLAT HEAT LOSS (chat/report donut)
   ============================================================ */
.heatloss-flat__item { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 0.85rem; }
.heatloss-flat__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.heatloss-flat__name { flex: 1; color: rgba(255,255,255,0.8); }
.heatloss-flat__pct { font-weight: 600; color: #fff; }

/* ============================================================
   SHAP CHART (bidirectional from center)
   ============================================================ */
.shap-chart { padding: 8px 0; }
.shap-chart__header {
    display: flex; justify-content: space-between;
    margin-bottom: 16px; font-size: 0.78rem;
}
.shap-chart__base-info { color: var(--text-secondary); }
.shap-chart__base-val { font-family: var(--font-mono); font-weight: 600; color: var(--text-bright); }
.shap-chart__pred-info { color: var(--text-secondary); }
.shap-chart__pred-val { font-family: var(--font-mono); font-weight: 700; color: var(--energy); }
.shap-chart__row {
    display: flex; align-items: center;
    margin-bottom: 5px; height: 32px;
}
.shap-chart__label {
    width: 130px; text-align: right; padding-right: 14px;
    font-size: 0.8rem; color: var(--text-primary); flex-shrink: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shap-chart__bar-area {
    flex: 1; position: relative; height: 26px;
}
.shap-chart__center-line {
    position: absolute; left: 50%; top: 0;
    width: 1px; height: 100%;
    background: rgba(255,255,255,0.2);
}
.shap-chart__bar {
    position: absolute; top: 3px; height: 20px;
    border-radius: 3px; display: flex; align-items: center;
    font-size: 0.72rem; font-weight: 700;
    font-family: var(--font-mono); color: var(--text-bright);
    min-width: 2px;
}
.shap-chart__bar--pos {
    background: rgba(248, 113, 113, 0.65);
    border: 1px solid rgba(248, 113, 113, 0.4);
    left: 50%; padding-left: 8px;
}
.shap-chart__bar--neg {
    background: rgba(108, 140, 255, 0.65);
    border: 1px solid rgba(108, 140, 255, 0.4);
    padding-right: 8px; justify-content: flex-end;
}
.shap-chart__val {
    width: 55px; text-align: right;
    font-size: 0.75rem; font-weight: 700;
    font-family: var(--font-mono); flex-shrink: 0;
    padding-left: 10px;
}
.shap-chart__val--pos { color: var(--red); }
.shap-chart__val--neg { color: var(--accent); }
.shap-chart__legend {
    display: flex; gap: 20px; justify-content: center;
    margin-top: 12px; font-size: 0.72rem; color: var(--text-secondary);
}
.shap-chart__legend-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px; margin-right: 6px; vertical-align: middle;
}

/* ============================================================
   RENOVATION 2-COL GRID
   ============================================================ */
.reno-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.reno-card {
    display: flex; gap: 10px; padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s;
}
.reno-card:hover { border-color: rgba(74, 222, 128, 0.3); }
.reno-card--selected { border-color: var(--energy) !important; background: rgba(74, 222, 128, 0.04); }
.reno-card__rank {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--energy);
    font-size: 0.82rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.reno-card__body { flex: 1; min-width: 0; }
.reno-card__name { font-size: 0.88rem; font-weight: 600; color: var(--text-bright); }
.reno-card__tags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.reno-card__tag {
    font-size: 0.68rem; padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.reno-card__tag--saving { background: rgba(74,222,128,0.12); color: var(--green); }
.reno-card__tag--payback { background: rgba(108,140,255,0.12); color: var(--accent); }
.reno-card__tag--cost { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.reno-card__toggle { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.reno-card__toggle input { accent-color: var(--energy); width: 15px; height: 15px; }
.reno-card__toggle label { font-size: 0.72rem; color: var(--text-muted); }
.reno-card__cost { font-size: 0.72rem; color: var(--text-secondary); font-family: var(--font-mono); margin-top: 3px; }

/* ============================================================
   STICKY SIMULATOR BAR
   ============================================================ */
.sim-bar {
    position: sticky;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    z-index: 20;
}
.sim-bar__stat { text-align: center; min-width: 80px; }
.sim-bar__label {
    font-size: 0.62rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
}
.sim-bar__value {
    font-size: 1.1rem; font-weight: 800;
    font-family: var(--font-mono); color: var(--text-bright);
}
.sim-bar__unit {
    font-size: 0.58rem; color: var(--text-muted);
}
.sim-bar__divider {
    width: 1px; height: 36px;
    background: rgba(255,255,255,0.1);
}
.sim-bar__reset {
    margin-left: auto;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
}
.sim-bar__reset:hover {
    border-color: var(--energy);
    color: var(--energy);
}

/* --- Chat messages (shared between drawer states) --- */
.chat__messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat__loading {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat__form {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* --- Chat Drawer (slide-out right panel) --- */
.chat-drawer {
    --drawer-width: 420px;
    position: fixed;
    right: 0;
    top: var(--header-height);
    bottom: 0;
    width: var(--drawer-width);
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
}

.chat-drawer--open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
}

.chat-drawer__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.chat-drawer__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chat-drawer__close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.chat-drawer__close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* --- Chat backdrop overlay --- */
.chat-backdrop {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chat-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Chat drawer scoped: make collapsible sections fit --- */
.chat-drawer .viz-collapsible {
    max-width: 100%;
}

/* --- Header chat toggle badge --- */
.header__btn--chat {
    position: relative;
}

.header__chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--energy);
    color: var(--bg-primary);
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================================
   3. SCROLLBAR STYLING
   ============================================================ */
.chat__messages::-webkit-scrollbar,
.dashboard::-webkit-scrollbar,
.landing::-webkit-scrollbar,
.report::-webkit-scrollbar {
    width: 6px;
}

.chat__messages::-webkit-scrollbar-track,
.dashboard::-webkit-scrollbar-track,
.landing::-webkit-scrollbar-track,
.report::-webkit-scrollbar-track {
    background: transparent;
}

.chat__messages::-webkit-scrollbar-thumb,
.dashboard::-webkit-scrollbar-thumb,
.landing::-webkit-scrollbar-thumb,
.report::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ============================================================
   4. HEADER COMPONENTS
   ============================================================ */
.header__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.header__back:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

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

.header__title {
    font-size: 1.05rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--energy), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--energy-bg);
    color: var(--energy);
    border: 1px solid var(--energy-border);
}

.header__actions {
    display: flex;
    gap: 8px;
}

.header__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.header__btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* ============================================================
   5. CHAT MESSAGES
   ============================================================ */
.chat-msg {
    display: flex;
    max-width: 85%;
}

.chat-msg--user {
    align-self: flex-end;
}

.chat-msg--assistant {
    align-self: flex-start;
}

.chat-msg--system {
    align-self: center;
    max-width: 600px;
}

.chat-msg__content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-msg--user .chat-msg__content {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg--assistant .chat-msg__content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-msg--system .chat-msg__content {
    background: var(--energy-bg);
    border: 1px solid var(--energy-border);
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.85rem;
}

/* Markdown in messages */
.chat-msg__content h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 12px 0 6px 0;
    color: var(--energy-light);
}

.chat-msg__content h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 10px 0 4px 0;
    color: var(--text-primary);
}

.chat-msg__content h4 {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 8px 0 4px 0;
    color: var(--text-secondary);
}

.chat-msg__content p {
    margin: 4px 0;
}

.chat-msg__content ul,
.chat-msg__content ol {
    margin: 4px 0;
    padding-left: 20px;
}

.chat-msg__content li {
    margin: 2px 0;
}

.chat-msg__content strong {
    color: var(--text-primary);
}

.chat-msg__content code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ============================================================
   6. LOADING SPINNER
   ============================================================ */
.loading__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--energy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   7. CHAT INPUT
   ============================================================ */
.chat__input {
    flex: 1;
    resize: none;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.88rem;
    line-height: 1.5;
    max-height: 150px;
    outline: none;
    transition: border-color 0.15s;
}

.chat__input:focus {
    border-color: var(--energy);
}

.chat__input::placeholder {
    color: var(--text-muted);
}

.chat__send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: var(--energy);
    color: var(--bg-primary);
    cursor: pointer;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.chat__send:hover {
    opacity: 0.85;
}

.chat__send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   8. PIPELINE + DASHBOARD DETAILS
   ============================================================ */

/* Pipeline Visualizer */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.pipeline__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.pipeline__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s, box-shadow 0.3s;
}

.pipeline__label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.pipeline__arrow {
    color: var(--border);
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.pipeline__step--active .pipeline__dot {
    background: var(--energy);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
    animation: pulsePipe 1.2s ease-in-out infinite;
}

.pipeline__step--active .pipeline__label {
    color: var(--energy);
}

.pipeline__step--done .pipeline__dot {
    background: var(--energy);
}

.pipeline__step--done .pipeline__label {
    color: var(--text-secondary);
}

@keyframes pulsePipe {
    0%, 100% { box-shadow: 0 0 4px rgba(74, 222, 128, 0.3); }
    50% { box-shadow: 0 0 12px rgba(74, 222, 128, 0.7); }
}

/* ============================================================
   9. 3D INTERACTIVE MAP
   ============================================================ */

/* Map card spans full grid width */
#dash-map {
    grid-column: 1 / -1;
}

.map3d {
    position: relative;
    overflow: hidden;
    height: 520px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: height 0.3s ease;
}

.map3d__viewport {
    width: 100%;
    height: 100%;
    perspective: 1200px;
    perspective-origin: 50% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.map3d__viewport--dragging {
    cursor: grabbing;
}

.map3d__svg {
    width: 90%;
    max-height: 90%;
    transform-style: preserve-3d;
    transform-origin: center center;
}

/* Settlement paths */
.map3d__settlement {
    stroke: rgba(0, 0, 0, 0.4);
    stroke-width: 0.15;
    cursor: pointer;
    vector-effect: non-scaling-stroke;
    transform-box: fill-box;
    transform-origin: center;
}

/* Hover: stroke + brightness only — NO transform (avoids blur on 3155 paths) */
.map3d__settlement:hover {
    fill-opacity: 0.85;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 1.5;
}

/* Active: pops up like a building — shadow clone fills the gap underneath */
.map3d__settlement--active {
    fill-opacity: 1;
    stroke: #fff;
    stroke-width: 2.5;
    transform: translateY(-6px) scale(1.08);
}

/* Shadow clone at ground level (inserted by JS) */
.map3d__shadow {
    pointer-events: none;
    vector-effect: non-scaling-stroke;
    stroke: none;
    opacity: 0.35;
}

.map3d__settlement--user {
    stroke: #00e5ff;
    stroke-width: 2.5;
    stroke-dasharray: 4 2;
}

/* Active + user combined */
.map3d__settlement--user.map3d__settlement--active {
    stroke: #00e5ff;
    transform: translateY(-6px) scale(1.08);
}

/* Suppress hover during zoom transition */
.map3d__svg--transitioning {
    pointer-events: none;
}

/* Tooltip (fixed position — avoids getBoundingClientRect per frame) */
.map3d__tooltip {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
    font-size: 0.78rem;
    padding: 8px 12px;
    background: rgba(26, 26, 46, 0.95);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    line-height: 1.5;
    max-width: 220px;
    transition: opacity 0.12s ease;
    white-space: nowrap;
}

.map3d__tooltip--visible {
    opacity: 1;
}

.map3d__tooltip strong {
    color: var(--accent);
}

/* Info panel */
.map3d__info {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 270px;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    background: rgba(26, 26, 46, 0.92);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0;
    z-index: 15;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.map3d__info--visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.map3d__info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border);
}

.map3d__info-header h4 {
    margin: 0;
    font-size: 0.92rem;
    color: var(--accent);
    font-weight: 600;
}

.map3d__info-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.map3d__info-close:hover {
    color: var(--text-primary);
}

.map3d__info-body {
    padding: 10px 14px 14px;
}

/* Energy rating badge */
.map3d__info-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.map3d__info-rating-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.map3d__info-rating-detail {
    display: flex;
    flex-direction: column;
}

.map3d__info-rating-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.map3d__info-rating-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.map3d__info-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.map3d__info-stat:last-child {
    border-bottom: none;
}

.map3d__info-stat--secondary {
    opacity: 0.7;
}

.map3d__info-stat .label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.map3d__info-stat .value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.map3d__info-stat-note {
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 4px;
}

.map3d__info-bar {
    margin-bottom: 8px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

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

/* Percentile bar */
.map3d__info-percentile {
    margin: 6px 0 8px;
}

.map3d__info-percentile-bar {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: visible;
}

.map3d__info-percentile-fill {
    height: 100%;
    border-radius: 3px;
}

.map3d__info-percentile-marker {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 10px;
    border-radius: 1px;
    background: #fff;
    transform: translateX(-50%);
}

.map3d__info-percentile-text {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Climate-adjusted performance */
.map3d__info-climate {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    margin: 6px 0;
}

.map3d__info-climate-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.map3d__info-climate--worse {
    background: rgba(231, 76, 60, 0.1);
    color: #e67e22;
}

.map3d__info-climate--better {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.map3d__info-climate--normal {
    background: rgba(241, 196, 15, 0.08);
    color: #f1c40f;
}

/* Renovation savings potential */
.map3d__info-savings {
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(74, 222, 128, 0.08);
    border-left: 3px solid #27ae60;
    margin: 6px 0;
}

.map3d__info-savings-pct {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4ade80;
}

.map3d__info-savings-detail {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* User comparison */
.map3d__info-compare {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.map3d__info-compare--above {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.map3d__info-compare--below {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.map3d__info-compare--same {
    background: rgba(241, 196, 15, 0.15);
    color: #f39c12;
}

/* Legend */
.map3d__legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(26, 26, 46, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
    backdrop-filter: blur(6px);
    z-index: 10;
}

.map3d__legend-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.map3d__legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
}

.map3d__legend-swatch {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.map3d__legend-label {
    font-size: 0.66rem;
}

/* Controls */
.map3d__controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.map3d__btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Map search */
.map3d__search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 8px;
    height: 30px;
}

.map3d__search:focus-within {
    border-color: var(--energy);
}

.map3d__search-icon {
    flex-shrink: 0;
    opacity: 0.5;
}

.map3d__search-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.78rem;
    width: 150px;
    outline: none;
    padding: 0;
}

.map3d__search-input::placeholder {
    color: var(--text-muted);
}

.map3d__search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 240px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 50;
    display: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.map3d__sug-item {
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.map3d__sug-item:hover,
.map3d__sug-item--active {
    background: rgba(var(--energy-rgb, 74, 222, 128), 0.12);
}

.map3d__sug-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map3d__sug-match {
    color: var(--energy);
    font-weight: 600;
}

.map3d__sug-pop {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.map3d__sug-empty,
.map3d__sug-more {
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.dash-section__header--map {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.map-expand-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.dash-card--expanded {
    grid-column: 1 / -1 !important;
}

.dash-card--expanded .map3d {
    height: 600px;
}

/* ============================================================
   10. PROFILE GRID
   ============================================================ */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.profile-item {
    padding: 8px 10px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.profile-item__label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.profile-item__value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 2px;
}

/* ============================================================
   11. TOOL CALL TRACES
   ============================================================ */
.traces__empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.trace-group {
    margin-bottom: 8px;
}

.trace-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.trace-group__head:hover {
    background: rgba(34, 38, 54, 0.8);
}

.trace-group__name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.trace-group__agent-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--energy);
}

.trace-group__count {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.trace-group__toggle {
    color: var(--text-muted);
    transition: transform 0.2s;
    font-size: 0.75rem;
}

.trace-group--open .trace-group__toggle {
    transform: rotate(180deg);
}

.trace-group__body {
    display: none;
    padding: 4px 0 0 0;
}

.trace-group--open .trace-group__body {
    display: block;
}

.trace-call {
    padding: 8px 10px;
    margin: 4px 0;
    background: rgba(15, 17, 23, 0.5);
    border: 1px solid rgba(46, 51, 72, 0.4);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
}

.trace-call__name {
    color: var(--accent);
    font-weight: 500;
}

.trace-call__args {
    color: var(--text-muted);
    margin-top: 2px;
    white-space: pre-wrap;
    word-break: break-all;
}

.trace-call__result {
    color: var(--green);
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
}

/* ============================================================
   12. NEGOTIATION
   ============================================================ */
.negotiation__round {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.82rem;
}

.negotiation__round-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.negotiation__round-status {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.negotiation__round-status--consensus {
    color: var(--green);
    font-weight: 500;
}

.negotiation__round-status--revise {
    color: var(--yellow);
    font-weight: 500;
}

/* ============================================================
   13. TIMING
   ============================================================ */
.timing__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.82rem;
}

.timing__label {
    color: var(--text-muted);
}

.timing__value {
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-mono);
}

/* ============================================================
   14. VISUALIZATION COMPONENTS
   ============================================================ */

/* Collapsible wrapper */
.viz-collapsible { margin: 8px 20px; max-width: 85%; align-self: flex-start; }
.viz-collapsible__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--energy-border);
    border-radius: 8px 8px 0 0; cursor: pointer; user-select: none;
}
.viz-collapsible:not(.viz-collapsible--open) .viz-collapsible__header {
    border-radius: 8px;
}
.viz-collapsible__title { font-size: 0.82rem; font-weight: 600; color: var(--energy); }
.viz-collapsible__toggle { color: var(--text-muted); font-size: 0.75rem; transition: transform 0.2s; }
.viz-collapsible--open .viz-collapsible__toggle { transform: rotate(180deg); }
.viz-collapsible__body {
    display: none; background: var(--bg-card); border: 1px solid var(--border);
    border-top: none; border-radius: 0 0 8px 8px; padding: 16px;
}
.viz-collapsible--open .viz-collapsible__body { display: block; }

/* Container & layout */
.viz { display: flex; flex-direction: column; gap: 20px; }
.viz__row { display: flex; gap: 16px; flex-wrap: wrap; }
.viz__row > * { flex: 1; min-width: 200px; }
.viz-section__title {
    font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
}

/* Energy Gauge */
.viz-gauge { text-align: center; padding: 8px 0; }
.viz-gauge__arc {
    position: relative; width: 180px; height: 96px;
    margin: 0 auto; overflow: hidden;
}
.viz-gauge__track {
    position: absolute; inset: 0;
    border-radius: 180px 180px 0 0;
    background: conic-gradient(from 180deg, var(--green) 0deg, var(--yellow) 90deg, #fb923c 135deg, var(--red) 180deg);
    opacity: 0.15;
    -webkit-mask: radial-gradient(circle at 50% 100%, transparent 58%, black 60%);
    mask: radial-gradient(circle at 50% 100%, transparent 58%, black 60%);
}
.viz-gauge__fill {
    position: absolute; inset: 0;
    border-radius: 180px 180px 0 0;
    background: conic-gradient(from 180deg, var(--color) 0deg, var(--color) var(--angle), transparent var(--angle));
    -webkit-mask: radial-gradient(circle at 50% 100%, transparent 58%, black 60%);
    mask: radial-gradient(circle at 50% 100%, transparent 58%, black 60%);
}
.viz-gauge__avg-mark {
    position: absolute; bottom: 0; left: 50%;
    width: 2px; height: 42%; background: var(--text-muted);
    transform-origin: bottom center;
    transform: rotate(calc(var(--avg-angle) - 90deg));
    opacity: 0.6;
}
.viz-gauge__avg-label {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    font-size: 0.58rem; color: var(--text-muted); white-space: nowrap;
}
.viz-gauge__center {
    position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
}
.viz-gauge__value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.viz-gauge__unit { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.viz-gauge__labels {
    display: flex; justify-content: space-between;
    width: 180px; margin: 4px auto 0; padding: 0 4px;
    font-size: 0.58rem; color: var(--text-muted);
}
.viz-gauge__total { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; }

/* Energy Poverty Card */
.viz-poverty {
    padding: 14px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-secondary);
}
.viz-poverty--poor { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.05); }
.viz-poverty--safe { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.05); }
.viz-poverty__header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.viz-poverty__icon { font-size: 1.2rem; }
.viz-poverty__status { font-size: 0.88rem; font-weight: 600; }
.viz-poverty--poor .viz-poverty__status { color: var(--red); }
.viz-poverty--safe .viz-poverty__status { color: var(--green); }
.viz-poverty__metric { margin-bottom: 10px; }
.viz-poverty__share { font-size: 1.4rem; font-weight: 700; }
.viz-poverty__label { font-size: 0.75rem; color: var(--text-muted); margin-left: 4px; }
.viz-poverty__bar {
    position: relative; height: 6px; background: var(--bg-input);
    border-radius: 3px; margin-top: 8px; overflow: visible;
}
.viz-poverty__bar-fill {
    height: 100%; border-radius: 3px; transition: width 0.6s ease-out;
}
.viz-poverty__bar-threshold {
    position: absolute; top: -4px; width: 2px; height: 14px;
    background: var(--text-primary); border-radius: 1px;
}
.viz-poverty__costs { display: flex; gap: 16px; margin-top: 4px; }
.viz-poverty__cost-item { display: flex; flex-direction: column; gap: 2px; }
.viz-poverty__cost-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.viz-poverty__cost-value { font-size: 0.85rem; font-weight: 500; font-family: var(--font-mono); }

/* Heat Loss Breakdown */
.viz-heatloss { padding: 4px 0; }
.viz-heatloss__bar {
    display: flex; height: 28px; border-radius: 6px; overflow: hidden;
    background: var(--bg-input);
}
.viz-heatloss__segment {
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 600; color: var(--bg-primary);
    transition: width 0.6s ease-out; min-width: 0;
}
.viz-heatloss__legend {
    display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px;
}
.viz-heatloss__legend-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.72rem; color: var(--text-secondary);
}
.viz-heatloss__legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* SHAP Attribution */
.viz-shap { padding: 4px 0; }
.viz-shap__subtitle {
    font-size: 0.72rem; color: var(--text-muted); margin-bottom: 12px;
    font-family: var(--font-mono);
}
.viz-shap__row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px; font-size: 0.78rem;
}
.viz-shap__label {
    width: 100px; text-align: right; color: var(--text-secondary);
    font-size: 0.72rem; flex-shrink: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viz-shap__bar-container { flex: 1; }
.viz-shap__bar-track {
    position: relative; height: 18px; background: var(--bg-input);
    border-radius: 3px;
}
.viz-shap__bar-center {
    position: absolute; left: 50%; top: 0; width: 1px; height: 100%;
    background: var(--text-muted); opacity: 0.3;
}
.viz-shap__bar-fill {
    position: absolute; top: 3px; height: 12px; border-radius: 2px;
    transition: width 0.4s ease-out;
}
.viz-shap__val {
    width: 50px; text-align: right; font-family: var(--font-mono);
    font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0;
}

/* Before/After Comparison */
.viz-comparison { padding: 4px 0; }
.viz-comparison__grid { display: flex; gap: 10px; }
.viz-comparison__col {
    flex: 1; padding: 14px 10px; border-radius: 8px; text-align: center;
    border: 1px solid var(--border); background: var(--bg-secondary);
}
.viz-comparison__col--current { border-color: rgba(248, 113, 113, 0.3); }
.viz-comparison__col--standard { border-color: rgba(250, 204, 21, 0.3); }
.viz-comparison__col--advanced { border-color: rgba(74, 222, 128, 0.3); }
.viz-comparison__col-title {
    font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 8px; color: var(--text-muted);
}
.viz-comparison__value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.viz-comparison__unit { font-size: 0.62rem; color: var(--text-muted); display: block; }
.viz-comparison__saving {
    font-size: 0.82rem; font-weight: 600; color: var(--green); margin-top: 4px;
}
.viz-comparison__cost {
    font-size: 0.72rem; color: var(--text-secondary);
    font-family: var(--font-mono); margin-top: 6px;
}

/* Renovation Roadmap Cards */
.viz-roadmap { padding: 4px 0; }
.viz-roadmap__card {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px; margin-bottom: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 8px;
}
.viz-roadmap__rank {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--energy-bg); border: 1px solid var(--energy-border);
    color: var(--energy); font-size: 0.78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.viz-roadmap__body { flex: 1; min-width: 0; }
.viz-roadmap__name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.viz-roadmap__meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.viz-roadmap__tag {
    font-size: 0.65rem; padding: 2px 7px; border-radius: 4px; font-weight: 500;
}
.viz-roadmap__tag--saving { background: rgba(74, 222, 128, 0.1); color: var(--green); }
.viz-roadmap__tag--payback { background: rgba(108, 140, 255, 0.1); color: var(--accent); }
.viz-roadmap__cost {
    font-size: 0.75rem; color: var(--text-secondary);
    font-family: var(--font-mono); margin-top: 4px;
}
.viz-roadmap__subsidies {
    margin-top: 12px; padding: 12px;
    background: rgba(74, 222, 128, 0.04); border: 1px solid var(--energy-border);
    border-radius: 8px;
}
.viz-roadmap__sub-title {
    font-size: 0.72rem; font-weight: 600; color: var(--energy);
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px;
}
.viz-roadmap__subsidy {
    display: flex; flex-direction: column; gap: 2px;
    padding: 6px 0; border-bottom: 1px solid rgba(74, 222, 128, 0.1);
}
.viz-roadmap__subsidy:last-child { border-bottom: none; }
.viz-roadmap__subsidy-name { font-size: 0.78rem; font-weight: 500; color: var(--text-primary); }
.viz-roadmap__subsidy-amount { font-size: 0.72rem; color: var(--energy); font-weight: 500; }
.viz-roadmap__subsidy-reason { font-size: 0.65rem; color: var(--text-muted); }

/* ============================================================
   15. SUGGESTION CHIPS
   ============================================================ */
.suggestion-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; padding: 8px 0;
    max-width: 600px; align-self: center;
}
.suggestion-chip {
    padding: 8px 14px; border: 1px solid var(--border);
    border-radius: 20px; background: var(--bg-card);
    color: var(--text-secondary); font-size: 0.75rem;
    cursor: pointer; transition: all 0.15s;
    font-family: var(--font); max-width: 280px;
    text-align: left; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    line-height: 1.4;
}
.suggestion-chip:hover {
    border-color: var(--energy); color: var(--energy);
    background: var(--energy-bg);
}

/* ============================================================
   16. ASSESSMENT REPORT VIEW
   ============================================================ */
.report {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    background: var(--bg-primary);
    display: none;
}

.report__container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

.report__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 20px;
}

.report__back:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Hero */
.report__hero {
    text-align: center;
    padding: 28px 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.report__hero-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.report__hero-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.report__hero-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.report__stat {
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    min-width: 180px;
    flex: 1;
    max-width: 280px;
}

.report__stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.report__stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.report__stat-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Grid layout */
.report__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.report__card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    animation: reportFadeUp 0.4s ease-out both;
}

.report__card--full {
    margin-bottom: 16px;
}

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

/* Map in report */
.report__map {
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Footer */
.report__footer {
    text-align: center;
    padding: 24px 0 0;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.report__footer-brand {
    font-weight: 600;
    color: var(--energy);
}

/* View Report CTA in chat */
.report-cta {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

.report-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--energy), var(--accent));
    color: var(--bg-primary);
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(74, 222, 128, 0.25);
}

.report-cta__btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.report-cta__btn svg {
    transition: transform 0.15s;
}

.report-cta__btn:hover svg {
    transform: translateX(3px);
}

/* Energy Label (EU EPC style) */
.energy-label { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; }
.energy-label__row { display: flex; align-items: center; gap: 10px; height: 26px; }
.energy-label__row--active { transform: scale(1.06); transform-origin: left center; }
.energy-label__bar {
    height: 100%; border-radius: 0 4px 4px 0; display: flex; align-items: center;
    padding: 0 10px; min-width: 40px;
}
.energy-label__letter {
    font-size: 0.82rem; font-weight: 700; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.energy-label__pointer { display: flex; align-items: center; gap: 4px; }
.energy-label__pointer::before {
    content: '\25C0'; font-size: 1rem; color: var(--text-primary);
}
.energy-label__value { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

/* Verdict Card */
.report-verdict { display: flex; flex-direction: column; gap: 4px; }
.report-verdict__status { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.report-verdict__metric {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.report-verdict__metric:last-child { border-bottom: none; }
.report-verdict__metric-label { font-size: 0.82rem; color: var(--text-muted); }
.report-verdict__metric-value {
    font-size: 0.88rem; font-weight: 600; color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Building Schematic */
.building-schematic { margin: 0 auto; }
.building-schematic svg { display: block; margin: 0 auto; }

/* Renovation Waterfall */
.reno-waterfall { display: flex; flex-direction: column; gap: 6px; }
.reno-waterfall__hint {
    font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px;
}
.reno-waterfall__step {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px; border-radius: 6px;
    transition: opacity 0.2s;
    cursor: default;
}
.reno-waterfall__step[data-measure] { cursor: pointer; }
.reno-waterfall__step[data-measure]:hover { background: rgba(255,255,255,0.03); }
.reno-waterfall__step--excluded { opacity: 0.35; }
.reno-waterfall__step--current { opacity: 1 !important; cursor: default !important; }
.reno-waterfall__label {
    width: 130px; text-align: right; font-size: 0.75rem;
    color: var(--text-secondary); flex-shrink: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reno-waterfall__bar-wrap { flex: 1; position: relative; height: 28px; }
.reno-waterfall__bar {
    height: 100%; border-radius: 4px; display: flex;
    align-items: center; justify-content: flex-end; padding-right: 8px;
    transition: width 0.6s ease-out; min-width: 30px;
}
.reno-waterfall__bar-value {
    font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.9);
}
.reno-waterfall__saving {
    font-size: 0.68rem; color: var(--green); font-weight: 500;
    min-width: 50px; flex-shrink: 0;
}
.reno-waterfall__cost {
    font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono);
    min-width: 100px; flex-shrink: 0; text-align: right;
}
.reno-waterfall__toggle {
    flex-shrink: 0; display: flex; align-items: center; gap: 4px;
}
.reno-waterfall__toggle input[type="checkbox"] {
    width: 15px; height: 15px; accent-color: var(--energy);
    cursor: pointer;
}
.reno-waterfall__toggle label {
    font-size: 0.62rem; color: var(--text-muted); cursor: pointer;
    user-select: none;
}
.reno-waterfall__summary {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 8px 0; margin-top: 4px; border-top: 1px solid var(--border);
    font-size: 0.82rem;
}
.reno-waterfall__total-label { color: var(--text-muted); }
.reno-waterfall__total-value { font-weight: 600; color: var(--green); font-family: var(--font-mono); }

/* Subsidy Cards */
.subsidy-cards { display: flex; flex-direction: column; gap: 8px; }
.subsidy-card {
    border: 1px solid var(--border); border-radius: 8px;
    overflow: hidden; transition: border-color 0.2s;
}
.subsidy-card:hover { border-color: var(--energy-border); }
.subsidy-card--eligible { border-color: rgba(74, 222, 128, 0.3); }
.subsidy-card__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; cursor: pointer; background: var(--bg-secondary);
    user-select: none; gap: 12px;
}
.subsidy-card__header:hover { background: rgba(26,29,39,0.8); }
.subsidy-card__info { flex: 1; min-width: 0; }
.subsidy-card__name {
    font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.subsidy-card__badge {
    font-size: 0.6rem; padding: 2px 7px; border-radius: 4px; font-weight: 600;
    white-space: nowrap;
}
.subsidy-card__badge--eligible { background: rgba(74,222,128,0.12); color: var(--green); }
.subsidy-card__badge--unknown { background: rgba(250,204,21,0.12); color: var(--yellow); }
.subsidy-card__amount {
    font-size: 0.78rem; font-weight: 500; color: var(--energy);
    font-family: var(--font-mono); margin-top: 2px;
}
.subsidy-card__toggle {
    color: var(--text-muted); font-size: 0.72rem; transition: transform 0.2s; flex-shrink: 0;
}
.subsidy-card--open .subsidy-card__toggle { transform: rotate(180deg); }
.subsidy-card__body {
    display: none; padding: 12px 14px; border-top: 1px solid var(--border);
    font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}
.subsidy-card--open .subsidy-card__body { display: block; }
.subsidy-card__body ul { margin: 4px 0; padding-left: 16px; }
.subsidy-card__body li { margin: 2px 0; }
.subsidy-card__body li.cond-met { color: var(--green); }
.subsidy-card__body li.cond-unknown { color: var(--yellow); }

/* ============================================================
   17. RESPONSIVE
   ============================================================ */
@media (max-width: 800px) {
    /* Landing */
    .landing__title { font-size: 1.8rem; }
    .landing__subtitle { font-size: 0.9rem; }
    .landing { padding: 24px 12px; }

    /* Dashboard grid single column */
    .dashboard__grid { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
    .dash-card--profile,
    .dash-card--energy,
    .dash-card--comparison,
    .dash-card--explanation,
    .dash-card--renovation,
    .dash-card--subsidies { grid-column: span 1; }

    /* Hero metrics stack */
    .hero-metrics { grid-template-columns: repeat(2, 1fr); margin: 0 12px; }
    .hero-metric:first-child { border-radius: var(--radius) 0 0 0; }
    .hero-metric:nth-child(2) { border-radius: 0 var(--radius) 0 0; }
    .hero-metric:nth-child(3) { border-radius: 0 0 0 var(--radius); }
    .hero-metric:last-child { border-radius: 0 0 var(--radius) 0; }

    /* Chat drawer full-width on mobile */
    .chat-drawer { --drawer-width: 100vw; }

    .pipeline { gap: 2px; }
    .pipeline__label { font-size: 0.6rem; }

    .map3d { height: 320px; }
    .dash-card--expanded .map3d { height: 450px; }
    .map3d__legend { font-size: 0.6rem; padding: 5px 7px; }
    .map3d__info { width: 220px; }
    .map3d__search-input { width: 100px; }
    .map3d__svg { width: 95%; }

    .viz-collapsible { max-width: 100%; margin: 8px 12px; }
    .viz__row { flex-direction: column; }
    .viz-comparison__grid { flex-direction: column; }
    .viz-gauge__arc { width: 140px; height: 76px; }
    .viz-gauge__labels { width: 140px; }
    .viz-shap__label { width: 80px; font-size: 0.65rem; }

    .report__grid { grid-template-columns: 1fr; }
    .report__hero-stats { flex-direction: column; align-items: center; }
    .report__stat { width: 100%; max-width: 100%; }
    .report__map { height: 200px; }
    .report__container { padding: 16px 12px 40px; }

    /* New components responsive */
    .wizard__options { flex-direction: column; align-items: stretch; }
    .wizard__eras { flex-direction: column; }
    .reno-grid { grid-template-columns: 1fr; }
    .house3d { height: 360px; }
    .house3d__svg { width: 50%; }
    .house3d__info { width: 200px; font-size: 0.68rem; }
    .house3d__info-shap-bar { display: none; }
    .shap-chart__label { width: 90px; font-size: 0.72rem; }
    .sim-bar { gap: 12px; padding: 10px 16px; flex-wrap: wrap; justify-content: center; }
    .cmp__bar-wrap { margin: 0 8px; }
    .gauge-donut__ring { width: 160px; height: 160px; }
    .gauge-donut__value { font-size: 2.2rem; }
    .dash-profile-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   18. DASHBOARD CARD SECTIONS
   ============================================================ */
.dash-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dash-section__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--energy);
}

.dash-section__icon svg {
    width: 100%;
    height: 100%;
}

.dash-section__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

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

/* ============================================================
   19. DASHBOARD PROFILE GRID
   ============================================================ */
.dash-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.dash-profile-item {
    padding: 6px 8px;
    background: var(--bg-card);
    border-radius: 4px;
    border: 1px solid var(--border);
    animation: dashItemSlide 0.3s ease-out both;
}

.dash-profile-item:nth-child(1) { animation-delay: 0s; }
.dash-profile-item:nth-child(2) { animation-delay: 0.05s; }
.dash-profile-item:nth-child(3) { animation-delay: 0.1s; }
.dash-profile-item:nth-child(4) { animation-delay: 0.15s; }
.dash-profile-item:nth-child(5) { animation-delay: 0.2s; }
.dash-profile-item:nth-child(6) { animation-delay: 0.25s; }
.dash-profile-item:nth-child(7) { animation-delay: 0.3s; }
.dash-profile-item:nth-child(8) { animation-delay: 0.35s; }

@keyframes dashItemSlide {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.dash-profile-item__label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dash-profile-item__value {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================================
   20. TECHNICAL DETAILS TOGGLE
   ============================================================ */
.dash-details {
    border-top: 1px solid var(--border);
}

.dash-details__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.dash-details__header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dash-details__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    flex: 1;
}

.dash-details__badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(108, 140, 255, 0.12);
    color: var(--accent);
    margin-right: 8px;
}

.dash-details__arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.dash-details--open .dash-details__arrow {
    transform: rotate(180deg);
}

.dash-details__body {
    padding: 0 16px 16px;
}

/* ============================================================
   21. COMPARISON CONTEXT STRIP
   ============================================================ */
.ctx-strip {
    padding: 8px 0;
}

.ctx-strip__track {
    position: relative;
    height: 24px;
    border-radius: 12px;
    background: linear-gradient(90deg, #4ade80 0%, #facc15 40%, #fb923c 65%, #f87171 100%);
    margin-bottom: 8px;
}

.ctx-strip__marker {
    position: absolute;
    top: -18px;
    transform: translateX(-50%);
    font-size: 0.58rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: center;
}

.ctx-strip__marker::after {
    content: '';
    display: block;
    width: 1px;
    height: 8px;
    background: var(--text-muted);
    margin: 2px auto 0;
    opacity: 0.5;
}

.ctx-strip__pip {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--text-primary), 0 0 8px rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.ctx-strip__pip-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.ctx-strip__context {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 22px;
    line-height: 1.4;
}

/* ============================================================
   22. SIMULATOR
   ============================================================ */
.sim-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.sim-toggle__checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--energy);
    cursor: pointer;
}

.sim-toggle__label {
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
}

.viz-roadmap__card--selected {
    border-color: var(--energy-border);
    background: var(--energy-bg);
}

.sim-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--energy-border);
    border-radius: 8px;
    margin-top: 12px;
}

.sim-summary__header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sim-summary__title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--energy);
}

.sim-summary__reset {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-family: var(--font);
}

.sim-summary__reset:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.sim-summary__stat {
    padding: 8px;
    text-align: center;
}

.sim-summary__label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sim-summary__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.sim-summary__sub {
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* ============================================================
   23. WIZARD
   ============================================================ */
.wizard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    max-width: 600px;
    align-self: center;
    width: 100%;
}

.wizard__progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
}

.wizard__progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
}

.wizard__progress-dot--active {
    background: var(--energy);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.wizard__progress-dot--done {
    background: var(--energy);
}

.wizard__progress-line {
    width: 24px;
    height: 2px;
    background: var(--border);
}

.wizard__progress-line--done {
    background: var(--energy);
}

.wizard__step-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.wizard__options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.wizard__option {
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-family: var(--font);
    min-width: 120px;
}

.wizard__option:hover {
    border-color: var(--energy);
}

.wizard__option--selected {
    border-color: var(--energy);
    background: var(--energy-bg);
}

.wizard__option-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.wizard__option-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.wizard__option-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.wizard__eras {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.wizard__era-btn {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    text-align: center;
}

.wizard__era-btn:hover {
    border-color: var(--energy);
}

.wizard__era-btn--selected {
    border-color: var(--energy);
    background: var(--energy-bg);
}

.wizard__era-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.wizard__era-desc {
    font-size: 0.62rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.wizard__details-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

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

.wizard__field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.wizard__select,
.wizard__input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.82rem;
    width: 100%;
    box-sizing: border-box;
}

.wizard__select:focus,
.wizard__input:focus {
    border-color: var(--energy);
    outline: none;
}

.wizard__autocomplete {
    position: relative;
}

.wizard__combo {
    display: flex;
    align-items: stretch;
}

.wizard__input--combo {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1;
    min-width: 0;
}

.wizard__dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.wizard__dropdown-btn svg {
    transition: transform 0.2s;
}

.wizard__dropdown-btn--open svg {
    transform: rotate(180deg);
}

.wizard__dropdown-btn:hover {
    background: var(--energy);
    color: #000;
}

.wizard__suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 50;
    display: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.wizard__sug-item {
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.wizard__sug-item:hover,
.wizard__sug-item--active {
    background: var(--energy);
    color: #000;
}

.wizard__sug-item:hover .wizard__sug-pop,
.wizard__sug-item--active .wizard__sug-pop {
    color: rgba(0, 0, 0, 0.5);
}

.wizard__sug-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard__sug-match {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wizard__sug-pop {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.wizard__sug-empty {
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.wizard__sug-more {
    padding: 6px 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
}

.wizard__range {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-input);
    outline: none;
}

.wizard__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--energy);
    cursor: pointer;
}

.wizard__range-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.wizard__range-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-top: 2px;
}

.wizard__heating-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wizard__heating-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.wizard__heating-btn:hover {
    border-color: var(--energy);
}

.wizard__heating-btn--selected {
    border-color: var(--energy);
    background: var(--energy-bg);
    color: var(--energy);
}

.wizard__submit {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: var(--energy);
    color: var(--bg-primary);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity 0.15s;
    align-self: center;
    margin-top: 8px;
}

.wizard__submit:hover {
    opacity: 0.85;
}

.wizard__submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wizard__nav {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.wizard__back-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: var(--font);
    cursor: pointer;
}

.wizard__back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.wizard__chat-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.wizard__chat-link a {
    color: var(--accent);
    text-decoration: none;
}

.wizard__chat-link a:hover {
    text-decoration: underline;
}

/* ============================================================
   24. PRINT STYLES
   ============================================================ */
@media print {
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 1.5cm;
        size: A4;
    }

    body {
        background: #fff;
        color: #1a1a2e;
    }

    .header, .landing, .dashboard, .chat-drawer, .chat-backdrop {
        display: none !important;
    }

    .report {
        display: block !important;
        overflow: visible !important;
        background: #fff;
    }

    .report__container {
        max-width: 100%;
        padding: 0;
    }

    .report__card {
        break-inside: avoid;
        border-color: #ddd;
        background: #fff;
    }

    .report__back, .report__print-btn {
        display: none !important;
    }

    .report__hero {
        border-color: #ddd;
    }

    .report__stat {
        border-color: #ddd;
        background: #f9f9f9;
    }

    .viz-section__title {
        color: #333;
    }

    .report-verdict__metric-label {
        color: #666;
    }

    .report-verdict__metric-value {
        color: #1a1a2e;
    }

    .energy-label__letter {
        color: #fff !important;
    }

    .report__footer {
        border-color: #ddd;
        color: #999;
    }
}

/* (Section 25 merged into section 17 responsive block) */
