/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --surface: #ffffff;
    --border: #d6dde2;
    --text: #1a1f2e;
    --text-muted: #565e6b;
    --blue: #3c8da0;
    --blue-dark: #2d7a8c;
    --blue-subtle: rgba(60, 141, 160, 0.08);
    --red: #e0674e;
    --red-dark: #c4503a;
    --red-subtle: rgba(224, 103, 78, 0.08);
    --green: #388e3c;
    --orange: #f57c00;
    --font: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    /* shadow scale mirrored from the FE design tokens (styles.scss) */
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* ===== Fixed background blobs (like FE about page) ===== */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}
.bg-blob-blue-top {
    top: -10vw; left: -10vw;
    width: 28vw; height: 28vw;
    background: var(--blue);
    opacity: 0.2;
}
.bg-blob-red-right {
    top: 15vh; right: -18vw;
    width: 45vw; height: 45vw;
    background: var(--red);
    opacity: 0.12;
}
.bg-blob-blue-bottom {
    bottom: -15vw; left: -5vw;
    width: 32vw; height: 32vw;
    background: var(--blue);
    opacity: 0.15;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { color: var(--blue); }

/* ===== Floating Bubbles (sides) ===== */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubble {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 100px; /* Material M3 filled-button stadium shape */
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary {
    background: var(--blue-dark);
    color: #ffffff;
    box-shadow: var(--shadow);
}
.btn-primary:hover {
    background: var(--blue);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--blue);
    color: var(--blue-dark);
    background: var(--blue-subtle);
    transform: translateY(-1px);
}
.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    background: var(--blue-dark);
    color: #ffffff !important;
    border-radius: 100px;
}
.btn-sm:hover { background: var(--blue); color: #ffffff !important; }

/* ===== Nav ===== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.nav-logo:hover { color: var(--text); }
.logo-mark {
    display: inline-block; width: 32px; height: 32px;
    background: url('favicon.svg') no-repeat center / contain;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

/* Language switch */
.lang-switch {
    display: inline-flex; align-items: center;
    border: 1px solid var(--border); border-radius: 100px; overflow: hidden;
    font-size: 0.78rem; font-weight: 600; line-height: 1;
}
.lang-switch a { padding: 5px 11px; color: var(--text-muted); transition: background 0.2s, color 0.2s; }
.lang-switch a:hover { color: var(--blue-dark); background: var(--blue-subtle); }
.lang-switch a.active { background: var(--blue-dark); color: #fff; }
.lang-switch a.active:hover { color: #fff; }

@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: var(--bg); flex-direction: column; padding: 20px;
        border-bottom: 1px solid var(--border); gap: 16px;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
}

/* ===== Hero ===== */
.hero {
    position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden;
}
.hero-map { position: absolute; inset: 0; z-index: 0; }
.hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.5) 100%);
}
.hero-content {
    position: relative; z-index: 2;
    padding-top: 140px; padding-bottom: 100px; max-width: 640px;
}
.hero-badge {
    display: inline-block; padding: 6px 16px;
    background: var(--blue-subtle); border: 1px solid rgba(60,141,160,0.2);
    border-radius: 100px; font-size: 0.8rem; font-weight: 500;
    color: var(--blue-dark); margin-bottom: 28px; letter-spacing: 0.02em;
}
.hero h1 {
    margin-bottom: 24px;
}
.hero .title-main {
    display: block;
    font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 400;
    line-height: 1.15; letter-spacing: -0.02em;
}
.hero .title-main strong {
    font-weight: 700; font-style: italic;
}
.hero .title-breakdown {
    display: flex; flex-direction: column; gap: 0;
    margin-top: 8px;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-weight: 400; color: var(--text-muted);
    line-height: 1.5;
}
.hero .title-breakdown span:nth-child(1) { padding-left: 0; }
.hero .title-breakdown span:nth-child(2) { padding-left: 2em; }
.hero .title-breakdown span:nth-child(3) { padding-left: 4em; }
.hero .title-breakdown strong {
    font-weight: 700; color: var(--text);
}
.hero-sub {
    font-size: 1.12rem; color: var(--text-muted); line-height: 1.75;
    margin-bottom: 36px; max-width: 520px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero side decoration */
.hero-deco {
    position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
    z-index: 2; opacity: 0.6;
}
.hero-deco .deco-circle {
    border-radius: 50%; position: absolute;
}
@media (max-width: 900px) { .hero-deco { display: none; } }

/* ===== Metrics ===== */
.metrics {
    padding: 40px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; }
.metric {
    padding: 20px;
    border-radius: var(--radius);
    transition: transform 0.3s, box-shadow 0.3s;
}
.metric:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.metric-value {
    display: block; font-size: 2.4rem; font-weight: 700;
    color: var(--blue-dark); letter-spacing: -0.01em;
}
.metric-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 600px) { .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

/* ===== Content surface (FE rule: off-map content is a SOLID card, not glass —
   glass is reserved for map overlays). Mirrors .content-container on the FE about page. */
.glass-wrap {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: -60px auto 0;
    padding: 3rem 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .glass-wrap { margin: -40px 12px 0; padding: 2rem 1.2rem; border-radius: var(--radius); }
}

/* ===== Sections (inside glass) ===== */
.section { padding: 60px 0; }
.section + .section { border-top: 1px solid rgba(0,0,0,0.06); }
.section-alt { background: transparent; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 {
    font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px;
    display: inline-block; position: relative;
}
.section-header h2::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 52px; height: 3px; border-radius: 2px;
    background: color-mix(in srgb, var(--blue-dark) 65%, transparent);
}
.section-header p { color: var(--text-muted); max-width: 520px; margin: 20px auto 0; font-size: 1.02rem; }

/* Section side bubbles */
.section-bubble {
    position: absolute; border-radius: 50%; pointer-events: none;
}

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.about-card {
    background: var(--surface); border: 1px solid var(--border);
    border-top: 4px solid var(--blue); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.3s;
}
.about-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.about-icon {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    background: var(--blue-subtle); border-radius: var(--radius-sm);
    color: var(--blue-dark); margin-bottom: 14px;
}
.about-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.about-card p { color: var(--text-muted); font-size: 0.9rem; }

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

/* ===== Features ===== */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature {
    padding: 28px; background: var(--surface);
    border: 1px solid var(--border); border-top: 4px solid var(--red);
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.3s;
}
.feature:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.feature-number {
    font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
    color: var(--red-dark); margin-bottom: 10px;
}
.feature h3 { font-size: 1rem; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 0.88rem; }

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

/* ===== Charts ===== */
.charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.chart-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.chart-card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); }
.chart-card canvas { width: 100% !important; max-height: 260px; }

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

/* ===== App preview (map UI showcase) ===== */
.app-preview { max-width: 920px; margin: 0 auto; }
.demo-note {
    display: flex; align-items: center; gap: 10px; max-width: 920px; margin: 0 auto 16px;
    padding: 10px 16px; border-radius: 10px; font-size: 0.85rem; line-height: 1.45;
    background: var(--blue-subtle); border: 1px solid color-mix(in srgb, var(--blue-dark) 22%, transparent);
    color: var(--blue-dark);
}
.demo-note svg { flex-shrink: 0; }
.demo-note a { color: var(--blue-dark); font-weight: 600; text-decoration: underline; }
.app-window {
    /* design tokens mirrored from the FE (styles.scss / _theme-colors.scss) */
    --fe-surface: #ffffff; --fe-container: #eef1f3; --fe-ink: #1a1f2e; --fe-muted: #5b6470;
    --fe-outline: #d8dee2; --fe-primary: #2d7a8c; --fe-teal: #2a9d8f; --fe-teal-ink: #1b7f5e;
    --fe-sh-sm: 0 2px 8px rgba(0,0,0,0.08); --fe-sh-md: 0 4px 20px rgba(0,0,0,0.1); --fe-rad: 12px;
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--fe-outline); box-shadow: var(--fe-sh-md); background: #fff;
}
/* Chrome-on-Windows browser chrome */
.app-chrome { background: #dee1e6; border-bottom: 1px solid #c6cacf; }
.ac-tabstrip { display: flex; align-items: flex-end; height: 34px; }
.ac-tab {
    display: inline-flex; align-items: center; gap: 7px; height: 27px;
    margin: 7px 0 0 8px; padding: 0 8px 0 11px; background: #fff;
    border-radius: 9px 9px 0 0; font-size: 0.74rem; color: var(--fe-ink); max-width: 250px;
}
.ac-fav { width: 13px; height: 13px; border-radius: 3px; flex-shrink: 0; }
.ac-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-tabx { color: var(--fe-muted); font-size: 0.95rem; line-height: 1; margin-left: 3px; }
.ac-plus { color: #5f6368; font-size: 1.15rem; line-height: 1; padding: 0 9px; margin-bottom: 5px; }
.ac-winctl { margin-left: auto; display: inline-flex; height: 34px; }
.ac-winctl button {
    width: 44px; height: 34px; border: none; background: transparent; cursor: default; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; color: #44474a;
}
.ac-winctl button:hover { background: rgba(0,0,0,0.07); }
.ac-min::before { content: ''; width: 10px; height: 1px; background: currentColor; }
.ac-max::before { content: ''; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 1px; }
.ac-close::before { content: '\2715'; font-size: 0.82rem; }
.ac-close:hover { background: #e81123; color: #fff; }
.ac-toolbar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; background: #fff; }
.ac-icons { display: inline-flex; align-items: center; gap: 7px; color: #5f6368; flex-shrink: 0; }
.ac-icons svg { width: 16px; height: 16px; }
.app-window-url {
    flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 8px;
    background: #f1f3f4; border-radius: 100px; padding: 6px 14px;
    font-size: 0.78rem; color: var(--fe-ink); font-family: var(--mono);
}
.app-window-url .ac-lock { width: 13px; height: 13px; color: var(--fe-muted); flex-shrink: 0; }
.app-window-url [data-url-bar] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-map-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #eef2f0; }
#preview-map.preview-map { position: absolute; inset: 0; } /* id beats maplibre's .maplibregl-map */

.preview-toolbar {
    position: absolute; top: 16px; left: 16px; z-index: 3;
    display: flex; align-items: center; gap: 9px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-md); padding: 9px 13px; width: min(56%, 330px);
}
.preview-toolbar svg { color: var(--text-muted); flex-shrink: 0; }
.preview-toolbar .ph { color: var(--text-muted); font-size: 0.86rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-toolbar .count-chip {
    background: var(--blue-subtle); color: var(--blue-dark);
    font-size: 0.72rem; font-weight: 600; border-radius: 100px; padding: 2px 8px;
}

.preview-legend {
    position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 3;
    width: 244px; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-md); overflow: hidden;
}
.preview-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.preview-tabs .tab {
    flex: 1; text-align: center; padding: 11px 6px; font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted);
}
.preview-tabs .tab.active { color: var(--blue-dark); box-shadow: inset 0 -2px 0 var(--blue); }
.preview-legend-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.preview-legend-body::-webkit-scrollbar { width: 8px; }
.preview-legend-body::-webkit-scrollbar-thumb { background: #d3d8e0; border-radius: 4px; }
.legend-group { padding: 6px 12px 2px; }
.legend-group-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.78rem; font-weight: 700; color: var(--text); padding: 3px 2px 5px;
}
.legend-group-head .gcount { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; }
.legend-row {
    display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 7px;
    border-left: 4px solid transparent; border-radius: 0 6px 6px 0; margin-bottom: 2px;
}
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.legend-text .lt { font-size: 0.82rem; color: var(--text); }
.legend-text .lc { font-size: 0.72rem; color: var(--text-muted); }
.preview-footer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); flex-shrink: 0; }
.preview-footer .pf-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 0.76rem; font-weight: 600; border-radius: 8px; padding: 8px 6px; white-space: nowrap;
}
.pf-btn.stroked { border: 1.5px solid var(--border); color: var(--text-muted); background: #fff; }
.pf-btn.primary { background: var(--blue-dark); color: #fff; }

.preview-zoom {
    position: absolute; left: 16px; bottom: 16px; z-index: 3;
    display: flex; flex-direction: column; border-radius: 8px; overflow: hidden;
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.preview-zoom span {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--text); font-size: 1.05rem; line-height: 1;
}
.preview-zoom span:first-child { border-bottom: 1px solid var(--border); }
.preview-attr {
    position: absolute; right: 8px; bottom: 6px; z-index: 3;
    font-size: 0.66rem; color: #5c6478; background: rgba(255,255,255,0.72);
    padding: 1px 6px; border-radius: 4px;
}
.preview-caption { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin: 18px auto 0; max-width: 620px; }

/* parcel hover popup — FE .parcel-tooltip (dark) */
.preview-popup .maplibregl-popup-content {
    padding: 8px 12px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.85); color: #fff; font-family: var(--font); font-size: 0.78rem; line-height: 1.4;
}
.preview-popup .maplibregl-popup-tip { border-top-color: rgba(0,0,0,0.85); border-bottom-color: rgba(0,0,0,0.85); }
.preview-popup .maplibregl-popup-content b { font-weight: 600; }
.preview-popup .maplibregl-popup-content span { display: block; color: #87cefa; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.preview-zoom span { cursor: pointer; }
.preview-zoom span:hover { background: var(--blue-subtle); color: var(--blue-dark); }

/* ===== App-window tabs + screens (styled from FE design tokens) ===== */
.app-tabs { display: flex; gap: 2px; padding: 0 10px; background: var(--fe-container); border-bottom: 1px solid var(--fe-outline); }
.app-tab {
    appearance: none; border: none; background: transparent; cursor: pointer;
    padding: 10px 16px; font-size: 0.82rem; font-weight: 600; color: var(--fe-muted);
    border-bottom: 2px solid transparent; font-family: var(--font);
}
.app-tab:hover { color: var(--fe-ink); }
.app-tab.active { color: var(--fe-primary); border-bottom-color: var(--fe-primary); background: var(--fe-surface); }

.app-body { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #eef2f0; overflow: hidden; }
.app-screen { position: absolute; inset: 0; display: none; }
.app-screen.active { display: block; }
.app-screen[data-screen="building"], .app-screen[data-screen="settings"], .app-screen[data-screen="results"] {
    overflow-y: auto; background: #f4f6f7;
}

/* Building detail */
.bld { display: flex; flex-direction: column; min-height: 100%; }
.bld-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; background: var(--fe-surface); border-bottom: 1px solid var(--fe-outline); }
.bld-addr { font-weight: 600; font-size: 1rem; color: var(--fe-ink); }
.bld-sub { color: var(--fe-muted); font-size: 0.78rem; }
.bld-tabs { display: flex; gap: 6px; flex-shrink: 0; }
.bld-tabs span { font-size: 0.76rem; padding: 5px 12px; border-radius: 999px; color: var(--fe-muted); }
.bld-tabs .on { background: color-mix(in srgb, var(--fe-primary) 14%, transparent); color: var(--fe-primary); font-weight: 600; }
.bld-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 18px; }
.bld-subtabs { display: flex; gap: 18px; margin-bottom: 12px; border-bottom: 1px solid var(--fe-outline); }
.bld-subtabs span { font-size: 0.8rem; padding-bottom: 7px; color: var(--fe-muted); }
.bld-subtabs .on { color: var(--fe-primary); font-weight: 600; box-shadow: inset 0 -2px 0 var(--fe-primary); }
.bld-field { margin-bottom: 9px; }
.bld-field label { display: block; font-size: 0.68rem; color: var(--fe-muted); margin-bottom: 4px; }
.bld-val { background: var(--fe-surface); border: 1px solid var(--fe-outline); border-radius: 8px; padding: 8px 12px; font-size: 0.84rem; color: var(--fe-ink); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bld-val.ro { background: #f1f4f5; color: var(--fe-muted); }
.bld-val.gen { border-color: #ecd34a; background: rgba(253,240,138,0.4); }
.bld-val .tag { font-size: 0.62rem; background: #fdf08a; color: #5f5400; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.bld-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin-top: 4px; }
.bld-graph { background: var(--fe-surface); border: 1px solid var(--fe-outline); border-radius: var(--fe-rad); box-shadow: var(--fe-sh-sm); padding: 14px; display: flex; flex-direction: column; }
.bld-graph-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--fe-ink); margin-bottom: 10px; }
.bld-graph-canvas { position: relative; height: 165px; }
.bld-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.bld-chips .chip { border: 1px solid var(--fe-outline); border-radius: 10px; background: var(--fe-container); padding: 9px 4px; text-align: center; }
.bld-chips .cv { display: block; font-weight: 700; font-size: 1rem; color: var(--fe-ink); }
.bld-chips .cl { display: block; font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); margin-top: 3px; }

/* mat-button-toggle-style season switch */
.bld-graph-head .seg { display: inline-flex; border: 1px solid var(--fe-outline); border-radius: 999px; overflow: hidden; }
.bld-graph-head .seg button {
    border: none; background: var(--fe-surface); cursor: pointer; font-family: var(--font);
    font-size: 0.72rem; color: var(--fe-muted); padding: 4px 13px;
}
.bld-graph-head .seg button.on { color: var(--fe-primary); background: color-mix(in srgb, var(--fe-primary) 14%, transparent); font-weight: 600; }

/* Simulation settings */
.set { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; padding: 16px 18px; min-height: 100%; }
.set-card, .set-right { background: var(--fe-surface); border: 1px solid var(--fe-outline); border-radius: var(--fe-rad); box-shadow: var(--fe-sh-sm); padding: 16px; }
.set-card-h, .set-panel-h { font-weight: 600; font-size: 1rem; color: var(--fe-ink); display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.badge-live { flex-shrink: 0; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; background: color-mix(in srgb, var(--fe-teal) 16%, transparent); color: var(--fe-teal-ink); border-radius: 999px; padding: 3px 9px; }
.hero-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.hero-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border: 1px solid var(--fe-outline); border-radius: var(--fe-rad); background: var(--fe-container); text-align: center; }
.hero-card.accent { border-color: color-mix(in srgb, var(--fe-teal) 45%, transparent); background: color-mix(in srgb, var(--fe-teal) 10%, var(--fe-container)); }
.hero-card .hc-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--fe-ink); }
.hero-card.accent .hc-value { color: var(--fe-teal-ink); }
.hc-label { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); }
.set-bars { position: relative; height: 128px; }
.set-foot { font-size: 0.74rem; color: var(--fe-muted); margin-top: 10px; text-align: center; }
.knob { margin-bottom: 16px; }
.knob-h { font-size: 0.82rem; font-weight: 600; color: var(--fe-ink); margin-bottom: 4px; }
.slider { position: relative; height: 6px; background: var(--fe-outline); border-radius: 3px; margin: 14px 6px 8px; }
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fe-primary); border-radius: 3px; }
.slider-knob { position: absolute; top: 50%; width: 16px; height: 16px; background: #fff; border: 3px solid var(--fe-primary); border-radius: 50%; transform: translate(-50%, -50%); }
.knob-row { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--fe-muted); }
.knob-row b { color: var(--fe-ink); }
.radio { display: flex; align-items: center; gap: 9px; font-size: 0.82rem; padding: 6px 0; color: var(--fe-ink); }
.radio .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fe-outline); flex-shrink: 0; }
.radio.on .dot { border-color: var(--fe-primary); box-shadow: inset 0 0 0 3.5px var(--fe-primary); }
.pill { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; border-radius: 999px; padding: 2px 7px; margin-left: auto; }
.pill.live { background: #d3f5d8; color: #1f7a30; }
.pill.soon { background: #eceef1; color: #9aa1ad; }
.legal-h { font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); margin: 6px 0 8px; }
.lbadge { display: inline-block; font-size: 0.66rem; background: var(--fe-container); border: 1px solid var(--fe-outline); border-radius: 999px; padding: 3px 9px; margin: 0 4px 5px 0; color: var(--fe-muted); }

/* Results */
.res { padding: 16px 18px; min-height: 100%; }
.res-hero { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; margin-bottom: 14px;
    border: 1px solid color-mix(in srgb, var(--fe-teal) 40%, transparent); border-radius: var(--fe-rad);
    background: color-mix(in srgb, var(--fe-teal) 10%, var(--fe-surface)); }
.res-big { font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--fe-teal-ink); margin-top: 2px; }
.res-sub { font-size: 0.76rem; color: var(--fe-muted); margin-top: 4px; }
.res-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.res-strip .tile { border: 1px solid var(--fe-outline); border-radius: 10px; background: var(--fe-container); padding: 9px 5px; text-align: center; }
.res-strip .tv { display: block; font-weight: 700; font-size: 0.98rem; color: var(--fe-ink); }
.res-strip .tl { display: block; font-size: 0.56rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); margin-top: 2px; }
.res-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.res-cards .rcard { border: 1px solid var(--fe-outline); border-radius: var(--fe-rad); background: var(--fe-surface); box-shadow: var(--fe-sh-sm); padding: 12px 13px; }
.res-cards .rv { display: block; font-weight: 700; font-size: 1.1rem; color: var(--fe-ink); }
.res-cards .rl { display: block; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); margin-top: 3px; }
.res-chart-h, .res-table-h { font-size: 0.82rem; font-weight: 600; color: var(--fe-ink); margin: 6px 0 8px; }
.res-chart-wrap { position: relative; height: 150px; margin-bottom: 10px; }
.res-charts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.res-charts2 .res-chart-wrap { height: 160px; margin-bottom: 0; }
.res-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.res-table th { text-align: left; color: var(--fe-muted); font-weight: 600; padding: 7px 4px; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--fe-outline); }
.res-table td { padding: 7px 4px; border-bottom: 1px solid var(--fe-outline); color: var(--fe-ink); }
.res-table td:not(:first-child), .res-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.res-note { font-size: 0.7rem; color: var(--fe-muted); margin-top: 10px; font-style: italic; text-align: center; }

/* SSE group cards */
.sse-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.sse-card { background: var(--fe-surface); border: 1px solid var(--fe-outline); border-radius: var(--fe-rad); box-shadow: var(--fe-sh-sm); padding: 14px 16px; }
.sse-card h4 { font-size: 0.92rem; font-weight: 600; color: var(--fe-ink); margin-bottom: 10px; }
.sse-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.sse-stats span { display: block; border: 1px solid var(--fe-outline); border-radius: 8px; background: var(--fe-container); padding: 7px 4px; text-align: center; font-size: 0.54rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); }
.sse-stats b { display: block; font-size: 0.86rem; color: var(--fe-ink); margin-top: 2px; }
.sse-list .row { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--fe-ink); padding: 3px 0; border-bottom: 1px solid var(--fe-outline); }
.sse-list .row span:last-child { color: var(--fe-muted); font-variant-numeric: tabular-nums; }
.sse-list .lab { font-size: 0.58rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fe-muted); margin: 9px 0 3px; }

/* snapshot KPI row (energy billboard) */
.bld-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.bld-kpis .sk-v { display: block; font-size: 0.92rem; font-weight: 700; color: var(--fe-ink); }
.bld-kpis .sk-l { display: block; font-size: 0.54rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); margin-top: 1px; }

/* settings: computed note, week head, price triangle stand-in */
.computed-note { font-size: 0.72rem; font-weight: 600; color: var(--fe-teal-ink); margin: 8px 0 2px; }
.week-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; }
.week-head .wk-caption { font-size: 0.78rem; font-weight: 600; color: var(--fe-muted); }
.price-readout { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 8px; }
.price-readout b { font-size: 1.1rem; font-weight: 700; color: var(--fe-teal-ink); }
.price-readout span { font-size: 0.78rem; color: var(--fe-muted); }
.price-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.price-tiles > div { border: 1px solid var(--fe-outline); border-radius: 8px; background: var(--fe-container); padding: 7px 4px; text-align: center; }
.price-tiles .pt-v { display: block; font-size: 0.86rem; font-weight: 700; color: var(--fe-ink); }
.price-tiles .pt-l { display: block; font-size: 0.54rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fe-muted); }
.price-bar { position: relative; display: flex; justify-content: space-between; align-items: center; height: 18px; border-radius: 9px; overflow: hidden; background: linear-gradient(90deg, var(--fe-teal) 0 50%, var(--fe-amber) 50% 100%); padding: 0 9px; font-size: 0.56rem; color: #fff; font-weight: 600; }
.price-bar .pb-knob { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: #1a1f2e; }

/* results: donut + sankey + two-tier bridge + economics */
.res-top { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.res-donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.res-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.res-donut-center b { font-size: 1.5rem; font-weight: 700; color: var(--fe-teal-ink); line-height: 1; }
.res-donut-center span { font-size: 0.66rem; color: var(--fe-muted); }
.res-donut-side { flex: 1; }
.res-donut-legend div { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--fe-ink); padding: 3px 0; }
.res-donut-legend i { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.res-donut-legend b { font-variant-numeric: tabular-nums; }
.res-donut-note { font-size: 0.78rem; color: var(--fe-muted); margin-top: 8px; }
.res-sankey-h { font-size: 0.74rem; color: var(--fe-muted); text-align: center; margin: 4px 0; }
.res-sankey { margin-bottom: 14px; }
.res-bridge { margin: 0 0 16px; }
.bridge-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 0.78rem; }
.bridge-row .br-l { width: 168px; color: var(--fe-muted); flex-shrink: 0; }
.bridge-row .br-bar { flex: 1; height: 12px; background: var(--fe-container); border-radius: 6px; overflow: hidden; }
.bridge-row .br-bar i { display: block; height: 100%; border-radius: 6px; }
.bridge-row .br-v { width: 54px; text-align: right; font-weight: 700; color: var(--fe-ink); font-variant-numeric: tabular-nums; }
.res-econ { font-size: 0.8rem; color: var(--fe-ink); background: var(--fe-container); border: 1px solid var(--fe-outline); border-radius: 10px; padding: 10px 14px; margin: 6px 0 2px; }
.res-econ strong { color: var(--fe-teal-ink); }
.res-econ em { color: var(--fe-muted); font-size: 0.72rem; }

@media (max-width: 720px) {
    .app-tab { padding: 9px 10px; font-size: 0.74rem; }
    .bld-body { grid-template-columns: 1fr; }
    .bld-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .bld-kpis { grid-template-columns: repeat(2, 1fr); }
    .set { grid-template-columns: 1fr; }
    .res-strip { grid-template-columns: repeat(2, 1fr); }
    .res-cards { grid-template-columns: repeat(2, 1fr); }
    .res-charts2 { grid-template-columns: 1fr; }
    .sse-groups { grid-template-columns: 1fr; }
    .res-top { flex-direction: column; }
    .bridge-row .br-l { width: 110px; }
}

@media (max-width: 720px) {
    .preview-legend { width: 150px; }
    .preview-toolbar { width: 50%; padding: 8px 10px; }
    .legend-text .lc { display: none; }
    .ac-icons.ac-right, .ac-plus { display: none; }
}

/* ===== Architecture ===== */
.arch-diagram {
    max-width: 560px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center;
}
.arch-layer { width: 100%; text-align: center; }
.arch-label {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px;
}
.arch-boxes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.arch-box {
    padding: 10px 18px; background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.85rem;
    font-family: var(--mono); font-weight: 500;
    transition: all 0.2s;
}
.arch-box:hover { border-color: var(--blue); background: var(--blue-subtle); }
.arch-box.accent {
    border-color: var(--blue); color: var(--blue-dark); background: var(--blue-subtle);
}
.arch-arrow {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 0; color: var(--text-muted); font-size: 0.76rem; font-family: var(--mono);
}

/* ===== Publications ===== */
.publications-list { max-width: 660px; margin: 0 auto; }
.pub-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
    box-shadow: var(--shadow); border-left: 4px solid var(--blue);
    transition: box-shadow 0.3s;
}
.pub-card:hover { box-shadow: var(--shadow-md); }
.pub-type {
    display: inline-block; padding: 3px 10px;
    background: rgba(217,119,6,0.1); color: var(--orange);
    border-radius: 100px; font-size: 0.73rem; font-weight: 600; margin-bottom: 10px;
}
.pub-type.accepted { background: #d3f5d8; color: #1f7a30; }
.pub-award {
    display: inline-block; margin-left: 8px; padding: 3px 10px;
    background: rgba(184,134,11,0.12); color: #9c6f0a;
    border-radius: 100px; font-size: 0.72rem; font-weight: 600;
    vertical-align: middle;
}
.pub-card h3 { font-size: 1rem; margin-bottom: 6px; }
.pub-meta { color: var(--text-muted); font-size: 0.83rem; margin-bottom: 6px; }
.pub-desc { color: var(--text-muted); font-size: 0.88rem; }

/* ===== Team ===== */
.team-row { margin-bottom: 32px; }
.team-row-label {
    text-align: center; font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin-bottom: 12px;
}
.team-row-cards {
    display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.team-card {
    text-align: center; padding: 24px 20px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    min-width: 180px; max-width: 220px; flex: 1;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}
.team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.team-vut { border-top: 4px solid var(--red); }
.team-egu { border-top: 4px solid var(--blue); }
.team-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--blue);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.05rem; margin-bottom: 12px;
}
.team-card h3 { font-size: 0.95rem; margin-bottom: 4px; }
.team-card p { color: var(--text-muted); font-size: 0.85rem; }
.team-vut .team-avatar { background: var(--red); }
.team-egu .team-avatar { background: var(--blue); }
.affiliation-bar {
    text-align: center; padding: 20px; border-radius: var(--radius);
    color: var(--text-muted); font-size: 0.9rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
}

/* ===== CTA ===== */
.cta {
    padding: 60px 0; text-align: center;
}
.cta h2 { font-size: 2rem; margin-bottom: 12px; }
.cta p { color: var(--text-muted); margin-bottom: 28px; font-size: 1.05rem; }
.cta .hero-actions { justify-content: center; }

/* ===== Footer ===== */
.footer {
    padding: 36px 0; border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 2rem;
}
.footer-inner {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 20px;
}
.footer-left p { color: var(--text-muted); font-size: 0.83rem; margin-top: 4px; }
.footer-right { text-align: right; }
.footer-right p { color: var(--text-muted); font-size: 0.83rem; }
.footer-right a { color: var(--text-muted); }
.footer-right a:hover { color: var(--blue); }

@media (max-width: 600px) {
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-right { text-align: center; }
}

/* ===== Gradient divider ===== */
.gradient-divider {
    height: 3px; border: none; margin: 0;
    background: linear-gradient(90deg, transparent, var(--blue) 35%, var(--blue) 45%, transparent 50%, var(--red) 55%, var(--red) 65%, transparent);
}

/* ===== Scroll reveal ===== */
.reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1; transform: translateY(0);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-content > * { animation: fadeInUp 0.7s ease-out both; }
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ===== Mobile responsive ===== */
@media (max-width: 768px) {
    .section { padding: 64px 0; }
    .section-header { margin-bottom: 36px; }
    .section-header h2 { font-size: 1.5rem; }
    .section-header p { font-size: 0.92rem; }

    .hero { min-height: 85vh; }
    .hero-content { padding-top: 100px; padding-bottom: 60px; }
    .hero .title-main { font-size: 1.8rem; }
    .hero .title-breakdown { font-size: 1rem; }
    .hero-sub { font-size: 1rem; }
    .hero-badge { font-size: 0.7rem; padding: 5px 12px; }

    .metrics { padding: 32px 0; }
    .metric-value { font-size: 1.8rem; }

    .arch-boxes { flex-direction: column; align-items: center; }
    .arch-box { width: 100%; max-width: 260px; text-align: center; }

    .pub-card h3 { font-size: 0.92rem; }

    .team-card { min-width: 140px; max-width: 100%; padding: 20px 16px; }
    .team-row-cards { gap: 12px; }

    .cta { padding: 56px 0; }
    .cta h2 { font-size: 1.5rem; }

    .btn { padding: 12px 22px; font-size: 0.88rem; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .cta .hero-actions { align-items: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero .title-main { font-size: 1.5rem; }
    .hero .title-breakdown { font-size: 0.9rem; }
    .metric-value { font-size: 1.5rem; }
    .metric-label { font-size: 0.75rem; }
    .team-avatar { width: 48px; height: 48px; font-size: 0.9rem; }
    .team-card h3 { font-size: 0.85rem; }
    .nav-logo span:last-child { font-size: 0.95rem; }
}
