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

:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bg-panel: #ffffff;
    --bg-section: #f8f9fb;
    --bg-hover: #eef1f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #1565c0;
    --accent-hover: #1976d2;
    --accent-subtle: #eff6ff;
    --green: #16a34a;
    --orange: #ea580c;
    --red: #dc2626;
    --impact-negative: #dc2626;
    --impact-moderate: #ea580c;
    --impact-low: #16a34a;
    --border: #e5e7eb;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
    --sheet-width: 380px;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Layout: map fills everything === */
#app {
    position: relative;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* === Skip Link (accessibility) === */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Map Hint (subtle inline guidance) === */
.map-hint {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
    max-width: 320px;
    animation: hintPulse 3s ease-in-out infinite;
}
.map-hint.fade-out { opacity: 0; }
@keyframes hintPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}
@media (max-width: 768px) {
    .map-hint { display: none; }
}

/* === Welcome Card === */
.welcome-card {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 210;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 380px;
    width: calc(100vw - 48px);
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-top: 3px solid var(--accent);
}
.welcome-card.hidden {
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
    pointer-events: none;
}
.welcome-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.welcome-card-icon {
    color: var(--accent);
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    border-radius: 12px;
}
.welcome-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.welcome-card-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 2px;
}
.welcome-card-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--bg-section);
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    /* WCAG 2.5.5 / Apple HIG: 44x44 minimum touch target */
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.welcome-card-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Welcome card — analysis feature grid */
.welcome-analysis-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.welcome-feature {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.welcome-feature svg { flex-shrink: 0; margin-top: 1px; }
.welcome-feature div { min-width: 0; }
.welcome-feature strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.welcome-feature span {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 1px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

@media (max-width: 768px) {
    .welcome-card {
        bottom: auto;
        top: 50%;
        transform: translateX(-50%) translateY(-50%);
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .welcome-card.hidden {
        transform: translateX(-50%) translateY(-50%) scale(0.95);
        opacity: 0;
        pointer-events: none;
    }
    .welcome-analysis-features {
        display: none !important;
    }
    .welcome-badges {
        display: none !important;
    }
    .welcome-mode-label {
        display: none;
    }
    .welcome-step-text { white-space: normal; }
}

/* Welcome steps flow */
.welcome-steps {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}
.welcome-step {
    display: flex;
    align-items: center;
    gap: 6px;
}
.welcome-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.welcome-step-arrow {
    display: none;
}
.welcome-step-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}
.welcome-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.welcome-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 3px 8px;
    background: var(--bg-section);
    border-radius: 12px;
}

/* Sound gauge comparison text */
.gauge-comparison {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-style: italic;
}
.gauge-zone-labels {
    display: flex;
    justify-content: space-between;
    padding: 4px 2px 0;
}
.gauge-zone-label {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.gauge-zone-label--limit {
    color: #b71c1c;
    font-weight: 700;
}

/* Loading steps progress */
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.loading-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
}
.loading-step.active {
    opacity: 1;
    color: var(--text-secondary);
}
.loading-step.done {
    opacity: 0.7;
    color: var(--green);
}
.loading-step.done .loading-step-icon svg {
    stroke: var(--green);
}
.loading-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.loading-step.active .loading-step-icon {
    animation: loadPulse 1.2s ease-in-out infinite;
}
@keyframes loadPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Section icons */
.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}
.section-icon--sound { background: #eff6ff; color: var(--accent); }
.section-icon--property { background: #fef3c7; color: #b45309; }
.section-icon--shadow { background: #fff7ed; color: var(--orange); }
.section-icon--visual { background: #f0fdf4; color: var(--green); }
.section-icon--weather { background: #f0f9ff; color: #0284c7; }

/* === Loading State === */
.sheet-loading {
    padding: 16px 20px;
}
.sheet-loading.hidden { display: none; }
.loading-bar {
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.loading-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    animation: loadingProgress 3s ease-out forwards;
}
@keyframes loadingProgress {
    0% { width: 0%; }
    20% { width: 30%; }
    50% { width: 60%; }
    80% { width: 85%; }
    100% { width: 95%; }
}
.loading-status {
    font-size: 12px;
    color: var(--text-muted);
}

/* === Summary Card === */
.summary-card {
    background: var(--bg-section);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.summary-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.summary-icon.severity-good { background: var(--green); }
.summary-icon.severity-moderate { background: var(--orange); }
.summary-icon.severity-bad { background: var(--red); }
.summary-verdict {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}
.summary-verdict strong {
    font-weight: 700;
}
.summary-stats {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
}
.summary-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.summary-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.summary-stat-dot.good { background: var(--green); }
.summary-stat-dot.moderate { background: var(--orange); }
.summary-stat-dot.bad { background: var(--red); }
.summary-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.summary-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.summary-explain {
    margin-top: 4px;
}
.summary-explain summary {
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    list-style: none;
}
.summary-explain summary::before {
    content: '? ';
}
.summary-explain[open] summary::before {
    content: '';
}
.summary-explain p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    padding: 8px;
    background: #fff;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

/* === Property Value Input (inline in results) === */
.property-value-section {
    padding: 8px 0 !important;
    border-bottom: none !important;
}
.property-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.property-input-row label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 120px;
}
.property-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 8px;
}
.property-input-wrap input {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-primary);
    padding: 6px 0;
    width: 100%;
    outline: none;
}
.property-input-wrap input::-webkit-inner-spin-button { opacity: 0.3; }
.property-input-unit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.property-input-hint {
    font-size: 11px;
    color: var(--text-muted);
    width: 100%;
    margin-top: -4px;
}

/* === Info Panel (inline expandable) === */
.info-panel {
    background: #eff6ff;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    animation: infoSlideIn 0.2s ease;
    position: relative;
    white-space: pre-line;
}
.info-panel strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 13px;
}
.info-panel-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 1;
}
@keyframes infoSlideIn {
    from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
    to { opacity: 1; max-height: 300px; }
}

/* === Floating Search Pill === */
#search-float {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border-radius: 28px;
    padding: 4px 6px 4px 12px;
    box-shadow: var(--shadow-lg);
    width: 340px;
    max-width: calc(100vw - 220px);
}

.sf-icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
    flex-shrink: 0;
}

#search-float input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 16px;
    padding: 8px 4px;
    background: transparent;
    min-width: 0;
    text-overflow: ellipsis;
}

.sf-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}

.sf-btn:hover { background: var(--accent-hover); }

.sf-btn.reset-btn {
    background: transparent;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
}

.sf-btn.reset-btn:hover { color: var(--red); background: rgba(0,0,0,0.05); }

#search-float .address-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.address-result-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.address-result-item:hover { background: var(--bg-hover); }
.address-status { font-size: 12px; color: var(--text-muted); padding: 4px 8px; }
.address-status.error { color: var(--red); }

/* === Floating Buttons (top-right) === */
.float-top-right {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 200;
    display: flex;
    gap: 8px;
    align-items: center;
}

.float-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition);
}

.float-btn:hover { background: var(--bg-hover); }

.float-btn svg { flex-shrink: 0; }

/* === Controls FAB & Floating Card === */
.controls-fab {
    position: fixed;
    bottom: 80px;
    left: 12px;
    z-index: 300;
    padding: 12px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.controls-fab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.controls-card {
    position: fixed;
    bottom: 132px;
    left: 12px;
    z-index: 301;
    width: 320px;
    max-height: 70vh;
    background: var(--bg-panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.controls-card.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.controls-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.controls-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.controls-card-close {
    /* WCAG 2.5.5: 44x44 minimum touch target on mobile (inflated via padding for desktop look) */
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-section);
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls-card-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.controls-card-body {
    overflow-y: auto;
    padding: 0 16px 12px;
    flex: 1;
}

.controls-card-body .sheet-detail {
    border-bottom: 1px solid var(--border);
}

.controls-card-body .sheet-detail:last-child {
    border-bottom: none;
}

.controls-layer-toggles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.controls-layer-toggles .action-btn {
    flex: none;
    font-size: 12px;
    padding: 8px 10px;
}

.controls-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

@media (max-width: 768px) {
    .controls-card {
        left: 0;
        right: 0;
        width: 100%;
        bottom: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* === Legend Button & Popover === */
.legend-float-btn {
    position: fixed;
    bottom: 24px;
    left: 12px;
    z-index: 200;
    padding: 10px;
    border-radius: 50%;
}

.legend-popover {
    position: fixed;
    bottom: 70px;
    left: 12px;
    z-index: 201;
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
}

.legend-popover-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 13px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Stat Chips === */
.stat-chips {
    position: fixed;
    z-index: 199;
    display: flex;
    gap: 8px;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.chip-icon {
    font-size: 12px;
    opacity: 0.5;
}

.stat-chip.severity-good { border-bottom: 2px solid var(--green); }
.stat-chip.severity-moderate { border-bottom: 2px solid var(--orange); }
.stat-chip.severity-bad { border-bottom: 2px solid var(--red); }
.stat-chip.impact-high .chip-value { color: var(--red); }
.stat-chip.impact-moderate .chip-value { color: var(--orange); }
.stat-chip.impact-low .chip-value { color: var(--green); }

/* === Preset Bar === */
.preset-bar {
    position: fixed;
    z-index: 199;
    display: flex;
    gap: 6px;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
}

.preset-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
}

.preset-pill:hover { background: #fff; box-shadow: var(--shadow-sm); }
.preset-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.preset-pill.active .preset-dot { border-color: #fff; }

.preset-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.preset-dot--high { background: var(--red); }
.preset-dot--medium { background: var(--orange); }
.preset-dot--low { background: var(--green); }

/* === Bottom Sheet === */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 300;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: right-side panel */
@media (min-width: 769px) {
    .bottom-sheet {
        top: 0;
        width: var(--sheet-width);
        border-left: 1px solid var(--border);
        border-radius: 0;
        box-shadow: -4px 0 24px rgba(0,0,0,0.08);
        transform: translateX(100%);
    }
    .bottom-sheet.state-peek { transform: translateX(0); }
    .bottom-sheet.state-half { transform: translateX(0); }
    .bottom-sheet.state-full { transform: translateX(0); }

    /* Adjust stat chips when sheet is open */
    .stat-chips.sheet-open {
        right: calc(var(--sheet-width) + 24px);
        left: auto;
        transform: none;
    }
    .preset-bar.sheet-peek,
    .preset-bar.sheet-half,
    .preset-bar.sheet-full {
        right: calc(var(--sheet-width) + 24px);
        left: auto;
        transform: none;
    }
}

/* Mobile: bottom sheet */
@media (max-width: 768px) {
    .bottom-sheet {
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
        max-height: 90dvh;
        transform: translateY(100%);
    }
    /* Peek: show summary card (~180px visible) */
    .bottom-sheet.state-peek { transform: translateY(calc(100% - 180px)); }
    /* Half: 60% visible — leaves 40% for map */
    .bottom-sheet.state-half { transform: translateY(40%); }
    /* Full: nearly full screen */
    .bottom-sheet.state-full { transform: translateY(max(4%, env(safe-area-inset-top, 0px))); }

    .stat-chips { bottom: 190px; }
    .stat-chips.sheet-open { display: none; }

    /* Preset bar — floating pills on mobile, positioned by sheet state */
    #preset-bar {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        z-index: 310;
        bottom: 188px;
        gap: 4px;
        transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    }
    #preset-bar.sheet-peek { bottom: 188px; }
    #preset-bar.sheet-half { bottom: calc(60% + 12px); }
    #preset-bar.sheet-full { opacity: 0; pointer-events: none; }
    #preset-bar.sheet-closed { opacity: 0; pointer-events: none; }
    #preset-bar .preset-label { display: inline; font-size: 11px; color: rgba(0,0,0,0.5); }
    #preset-bar .preset-pill {
        font-size: 12px;
        padding: 8px 14px;
        min-height: 36px;
        box-shadow: var(--shadow-md);
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    #preset-bar .preset-pill.active {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }
    #preset-bar .preset-pill.active .preset-dot { border-color: #fff; }
}

/* Sheet header (handle + close) */
.sheet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sheet-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0 8px;
    cursor: grab;
    flex: 1;
    /* Generous tap area for dragging */
    min-height: 28px;
}
.sheet-handle:active { cursor: grabbing; }

.sheet-handle-bar {
    width: 48px;
    height: 5px;
    background: #c4c8cc;
    border-radius: 3px;
    transition: background 0.2s;
}
.sheet-handle:hover .sheet-handle-bar,
.sheet-handle:active .sheet-handle-bar {
    background: #9ca3af;
}

.sheet-close-btn {
    position: absolute;
    right: 12px;
    top: 6px;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-section);
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.sheet-close-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Sheet toggle button (reopen after close) */
.sheet-toggle-btn {
    position: fixed;
    z-index: 250;
}
@media (min-width: 769px) {
    .sheet-toggle-btn {
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
    }
}
@media (max-width: 768px) {
    .sheet-toggle-btn {
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        justify-content: center;
    }
    .sheet-toggle-btn svg { transform: rotate(-90deg); }
}

@media (min-width: 769px) {
    .sheet-handle { display: none; }
}
@media (max-width: 768px) {
    .sheet-close-btn { display: none; }
}

/* Sheet pre-analysis */
.sheet-pre {
    padding: 8px 20px 16px;
}

.sheet-pre-coords {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sheet-pre-row {
    display: flex;
    gap: 8px;
}

.sheet-pre-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 16px;
    min-width: 0;
}

.sheet-pre-row button {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition);
}

.sheet-pre-row button:hover { background: var(--accent-hover); }

/* Sheet tabs wrapper — must flex-fill so sheet-content can scroll */
#sheet-tabs-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable results content */
.sheet-content {
    padding: 0 20px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Sheet-inline presets (mobile only) */
.sheet-presets {
    display: none;
}
.sheet-presets-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}
.sheet-presets-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}
@media (max-width: 768px) {
    /* Hide in-sheet presets on mobile — floating pills are used instead */
    .sheet-presets {
        display: none;
    }
}

/* Results sections */
.results-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.results-section:last-child { border-bottom: none; }

.results-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.results-section-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text-primary);
    flex: 1;
}

.sound-model-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-section);
    padding: 2px 6px;
    border-radius: 4px;
}

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

/* === Result rows === */
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.result-row + .result-row { border-top: 1px solid var(--border); }

.impact-highlight {
    background: #fef2f2;
    border-left: 3px solid var(--red);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin: 8px 0;
    font-size: 15px;
    font-weight: 600;
}

.impact-highlight.severity-good { background: #f0fdf4; border-color: var(--green); }
.impact-highlight.severity-moderate { background: #fff7ed; border-color: var(--orange); }
.impact-highlight.severity-bad, .impact-highlight.negative { background: #fef2f2; border-color: var(--red); }

.result-detail { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Impact value with SEK below */
.impact-value-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.impact-sek {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    display: block;
}

/* Empty state messaging */
.empty-state {
    text-align: center;
    padding: 16px 8px;
    color: var(--text-muted);
    font-size: 13px;
}
.empty-state-hint {
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Street View */
/* Turbine list */
.turbine-list-container { margin-top: 12px; }
.turbine-list { max-height: 200px; overflow-y: auto; }
.turbine-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    transition: background var(--transition);
}
.turbine-row:hover { background: var(--bg-hover); }
.turbine-row:last-child { border-bottom: none; }
.turbine-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.turbine-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.turbine-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turbine-row-status { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turbine-row-dist { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.turbine-row-power { font-size: 12px; color: var(--text-muted); white-space: nowrap; min-width: 45px; text-align: right; }

#street-view-container { margin-top: 12px; }
#street-view-img {
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
#street-view-status { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.result-label { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; color: var(--text-muted); margin-bottom: 6px; display: block; }

/* Tab actions */
.tab-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* === Shadow flicker tab === */
.shadow-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.shadow-values { margin: 8px 0; }
.shadow-val-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}
.shadow-val-row.muted { font-size: 12px; color: var(--text-secondary); }
.shadow-limit-note {
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 10px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    margin: 8px 0;
    text-align: center;
}

/* Monthly breakdown bars */
.monthly-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 60px;
    margin: 8px 0 12px;
}
.monthly-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.monthly-bar {
    width: 100%;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}
.monthly-label { font-size: 8px; color: var(--text-muted); margin-top: 2px; }

/* Shadow time controls */
.shadow-time-controls { margin: 8px 0; }
.shadow-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 12px;
}
#shadow-time-display { font-weight: 600; font-size: 14px; }
.shadow-time-status { color: var(--text-muted); font-size: 11px; }
.shadow-time-status.flicker-active { color: var(--orange); font-weight: 600; }

/* === Visual impact tab === */
.horizon-gauge { margin: 4px 0 12px; }
.horizon-bar {
    height: 16px;
    background: var(--bg-section);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.horizon-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 8px;
    transition: width 0.4s ease, background 0.3s ease;
    min-width: 0;
}
.horizon-scale {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
    padding: 0 2px;
}
.vis-visible { }
.vis-hidden { opacity: 0.5; }
.vis-icon { font-size: 12px; width: 20px; text-align: center; }
.vis-angle { font-size: 11px; color: var(--text-muted); min-width: 30px; text-align: right; }

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    min-height: 44px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-btn--primary:hover { background: #bf4500; color: #fff; }
.action-btn.danger { color: var(--red); }
.action-btn.danger:hover { background: #fef2f2; }

/* === Sound section === */
/* Sound gauge */
.sound-gauge { margin-top: 16px; margin-bottom: 12px; }
.gauge-bar {
    position: relative;
    height: 16px;
    border-radius: 8px;
    display: flex;
    overflow: visible;
    background: #e5e7eb;
}
.gauge-zone { height: 100%; }
.gauge-green { width: 58.3%; background: linear-gradient(90deg, #c8e6c9, #66bb6a); border-radius: 8px 0 0 8px; }
.gauge-yellow { width: 8.3%; background: linear-gradient(90deg, #ffe082, #ffa726); }
.gauge-red { width: 33.4%; background: linear-gradient(90deg, #ef5350, #c62828); border-radius: 0 8px 8px 0; }
.gauge-limit-line {
    position: absolute;
    left: 66.7%;
    top: -6px;
    bottom: -6px;
    width: 2px;
    background: #b71c1c;
    z-index: 2;
}
.gauge-limit-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 700;
    color: #b71c1c;
    white-space: nowrap;
}
.gauge-needle {
    position: absolute;
    top: -4px;
    width: 3px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 2px;
    z-index: 3;
    transform: translateX(-50%);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.gauge-value {
    text-align: center;
    margin-top: 6px;
    font-size: 20px;
    font-weight: 700;
}
.gauge-unit { font-size: 13px; font-weight: 400; color: var(--text-muted); }

.sound-model-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.sound-model-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sound-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.sound-assessment {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0;
    border-left: 3px solid transparent;
}

.sound-assessment.good { background: #f0fdf4; color: #15803d; border-color: var(--green); }
.sound-assessment.moderate { background: #fff7ed; color: #c2410c; border-color: var(--orange); }
.sound-assessment.bad { background: #fef2f2; color: #b91c1c; border-color: var(--red); }
.sound-assessment.none { background: var(--bg-section); color: var(--text-muted); }

/* Audio player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-section);
    border-radius: var(--radius);
    margin: 8px 0;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}

.audio-play-btn:hover { background: var(--accent-hover); }
.audio-play-btn:disabled { opacity: 0.4; cursor: default; }

.audio-info { flex: 1; min-width: 0; }
.audio-label { font-size: 12px; font-weight: 500; }
.audio-detail { font-size: 11px; color: var(--text-muted); }

.audio-volume {
    width: 32px;
    height: 24px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.audio-vol-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--green), var(--orange), var(--red));
    border-radius: 2px;
    opacity: 0.3;
}

/* === Weather section === */
.weather-mode-toggle {
    display: flex;
    background: var(--bg-section);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 7px 8px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.mode-btn:hover { color: var(--text-primary); }
.mode-btn.active {
    background: #fff;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.weather-card {
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.weather-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.weather-unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.weather-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

/* Simulation presets */
.sim-presets {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.preset-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    text-align: center;
    transition: all var(--transition);
}

.preset-btn:hover { border-color: var(--accent); background: var(--accent-subtle); }
.preset-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.preset-label { font-size: 12px; font-weight: 600; display: block; }
.preset-desc { font-size: 10px; color: var(--text-muted); display: block; margin-top: 2px; }
.preset-btn.active .preset-desc { color: rgba(255,255,255,0.7); }

/* Simulation sliders */
.sim-sliders { display: flex; flex-direction: column; gap: 10px; }

.sim-slider-group { }

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

.slider-value { font-weight: 600; color: var(--accent); }
.compass-tag { font-size: 10px; font-weight: 600; color: var(--text-muted); }

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

.sim-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

/* Timeline */
.timeline-scrubber { margin-bottom: 8px; }
.timeline-time { font-size: 12px; font-weight: 500; text-align: center; margin-top: 4px; color: var(--text-secondary); }
.timeline-stats { font-size: 11px; color: var(--text-secondary); text-align: center; margin-top: 4px; }
#timeline-chart { width: 100%; height: 60px; border-radius: var(--radius-sm); }

/* === Sheet Footer (advanced features) === */
.sheet-footer {
    border-top: 1px solid var(--border);
    padding: 8px 20px 20px;
}

.sheet-detail {
    border-bottom: 1px solid var(--border);
}

.sheet-detail summary {
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    list-style: none;
}

.sheet-detail summary::before {
    content: '+';
    display: inline-block;
    width: 16px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 6px;
}

.sheet-detail[open] summary::before { content: '\2212'; }

.sheet-detail p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-bottom: 10px;
}

.sheet-detail:last-child { border-bottom: none; }

/* Manual turbine form */
.manual-turbine-form { padding: 8px 0; }

.input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.input-group { flex: 1; }
.input-group.compact label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: block;
}

.input-group input, .input-group.compact input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 16px;
}

.manual-btn-row {
    display: flex;
    gap: 6px;
}

.manual-turbine-list { margin-top: 8px; }
.manual-turbine-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.remove-manual {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 16px;
}

/* Sources */
.sources-list {
    list-style: none;
    padding: 0;
}

.sources-list li {
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.sources-list a { color: var(--accent); text-decoration: none; }
.sources-list a:hover { text-decoration: underline; }

/* === Info buttons === */
.info-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    /* Expand touch target beyond visual size */
    position: relative;
}
.info-btn::before {
    content: '';
    position: absolute;
    inset: -10px;
}

.info-btn:hover { background: var(--accent-subtle); color: var(--accent); }

/* Info tooltip popups */
.info-popup {
    position: fixed;
    z-index: 500;
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    font-size: 13px;
    line-height: 1.5;
}

.info-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
}

/* === Rich turbine popup card === */
.turbine-card { min-width: 220px; }
.tc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.tc-name { font-size: 14px; }
.tc-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; color: #fff; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tc-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; margin-bottom: 10px; }
.tc-label { color: var(--text-muted); }
.tc-metrics { display: flex; gap: 20px; padding-top: 8px; border-top: 1px solid var(--border); }
.tc-metric { text-align: center; }
.tc-metric-val { display: block; font-size: 16px; font-weight: 700; }
.tc-metric-lbl { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.tc-note { font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 6px; }

/* === Google Maps overrides === */
.gm-style .gm-style-iw-c {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
}

.gm-style .gm-style-iw-d {
    font-size: 13px;
    line-height: 1.6;
    padding: 12px 16px;
    color: var(--text-primary);
    overflow: auto !important;
}

.gm-style .gm-style-iw-d strong { color: var(--accent); }

.pac-container {
    font-family: var(--font);
    font-size: 13px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: none;
    z-index: 10000;
}

.pac-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.pac-item:hover { background: var(--bg-hover); }
.pac-item-query { font-weight: 500; color: var(--text-primary); }

/* === Tour === */
.tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
}

.tour-tooltip {
    position: fixed;
    z-index: 901;
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 300px;
}

.tour-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.tour-counter { font-size: 12px; color: var(--text-muted); }

.tour-skip, .tour-next {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 12px;
    cursor: pointer;
}

.tour-skip { background: transparent; color: var(--text-muted); }
.tour-next { background: var(--accent); color: #fff; }

/* === Utility === */
.hidden { display: none !important; }

/* Loading spinner */
.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

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

/* Wind arrow */
.wind-arrow-icon { background: none !important; border: none !important; }

/* Map audio marker */
.map-audio-marker {
    background: none !important;
    border: none !important;
    /* Offset diagonally below-right of the property marker so they don't overlap */
    transform: translate(28px, 18px);
}
.map-audio-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: transform 0.15s ease, background 0.2s ease;
}
.map-audio-btn:hover { transform: scale(1.08); }
.map-audio-btn:active { transform: scale(0.95); }

.map-audio-btn.playing { background: var(--orange); }
.map-audio-btn .map-audio-icon-stop { display: none; }
.map-audio-btn.playing .map-audio-icon-play { display: none; }
.map-audio-btn.playing .map-audio-icon-stop { display: block; }

/* Pick mode cursor */
.pick-mode-active { cursor: crosshair !important; }

/* === Mobile adjustments === */
@media (max-width: 768px) {
    /* Search pill — fill width with breathing room */
    #search-float {
        max-width: calc(100vw - 24px);
        top: max(12px, env(safe-area-inset-top, 0px));
    }
    #search-float input { font-size: 16px; } /* prevent iOS zoom on focus */

    /* Float buttons — icon-only on mobile, compact row */
    .float-top-right {
        top: max(64px, calc(env(safe-area-inset-top, 0px) + 56px));
        right: 8px;
        gap: 6px;
    }
    .float-btn {
        padding: 10px;
        font-size: 0; /* hide text */
        border-radius: 50%;
        /* WCAG 2.5.5: 44x44 minimum touch target on mobile */
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
    .float-btn svg { width: 18px; height: 18px; }
    .float-btn span { display: none; }
    #lang-toggle.float-btn {
        font-size: 11px;
        width: auto;
        min-width: 44px;
        padding: 8px 12px;
        border-radius: 22px;
    }

    /* Legend — safe area aware */
    .legend-float-btn {
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        left: 8px;
    }
    .legend-popover {
        bottom: max(60px, calc(env(safe-area-inset-bottom, 0px) + 44px));
        left: 8px;
    }

    /* Controls FAB — sits above the sheet, always reachable */
    .controls-fab {
        bottom: max(72px, calc(env(safe-area-inset-bottom, 0px) + 56px));
        left: 8px;
        z-index: 350;
    }

    .weather-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .sim-presets { flex-direction: column; }

    /* Stat chips — above sheet peek */
    .stat-chips {
        bottom: max(100px, calc(env(safe-area-inset-bottom, 0px) + 84px));
        flex-wrap: nowrap;
        gap: 6px;
    }
    .stat-chip { padding: 6px 10px; font-size: 12px; }
    .stat-chips.sheet-open { display: none; }

    .preset-bar { bottom: 100px; }
    .preset-pill { font-size: 11px; padding: 5px 10px; }

    /* Sheet content — compact padding + safe area bottom */
    .sheet-content {
        padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    }

    /* Action buttons — sticky at bottom of sheet for easy thumb reach.
       Extra bottom padding so Safari's bottom UI bar never covers them. */
    .results-actions {
        position: sticky;
        bottom: 0;
        background: var(--bg-panel);
        padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        margin: 0 -16px;
        border-top: 1px solid var(--border);
        z-index: 2;
    }
}

/* Use small viewport height where supported so the sheet clears Safari's UI */
@supports (height: 100svh) {
    @media (max-width: 768px) {
        .bottom-sheet { max-height: 92svh; }
    }
}

/* === Very narrow phones (iPhone SE 1st gen, small Androids) === */
@media (max-width: 480px) {
    /* Float-btn cluster: keep clickable but less crowded on narrow viewports */
    .float-top-right {
        gap: 4px;
        right: 6px;
    }

    /* Welcome card — tighter padding so the close button doesn't crowd content */
    .welcome-card { padding: 14px 14px 12px; }
    .welcome-analysis-features { gap: 6px; }

    /* Stat chips: shrink so 3-4 fit on a 320px iPhone SE */
    .stat-chip { padding: 5px 8px; font-size: 11px; }

    /* Comparison table: allow horizontal scroll, narrower cells */
    .comparison-table { font-size: 11px; }
    .comparison-table th,
    .comparison-table td { padding: 4px 3px; }
    .comparison-table th { max-width: 80px; }

    /* Sheet content: even tighter padding */
    .sheet-content { padding-left: 12px; padding-right: 12px; }
    .results-actions { padding-left: 12px; padding-right: 12px; margin: 0 -12px; }

    /* Weather grid → single column on tiny screens for legibility */
    .weather-grid { grid-template-columns: 1fr; }
}

/* === Area Impact === */
.area-impact-btn {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}
.area-impact-summary {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.area-impact-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.area-impact-label { font-size: 13px; font-weight: 600; }
.area-impact-value { font-size: 16px; font-weight: 700; color: var(--red); }
.area-impact-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}
.area-impact-bands { display: flex; flex-direction: column; gap: 2px; }
.area-band-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.area-band-row:last-child { border-bottom: none; }
.area-band-dist { width: 55px; color: var(--text-secondary); }
.area-band-pct { width: 35px; font-weight: 600; color: var(--red); }
.area-band-props { flex: 1; color: var(--text-muted); }
.area-band-val { font-weight: 500; text-align: right; min-width: 80px; }

/* Map labels for area bands */
.area-band-label {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--red);
    border: 1px solid rgba(198,40,40,0.3);
    white-space: nowrap;
}

/* === Scenario Comparison === */
.scenario-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.scenario-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.scenario-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 30px);
}
.scenario-delete {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    /* WCAG 2.5.5: 44x44 minimum touch target */
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.scenario-delete:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.scenario-metrics {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}
.scenario-date {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}
.comparison-table th {
    text-align: center;
    padding: 6px 4px;
    background: var(--card-bg);
    font-weight: 600;
    font-size: 11px;
    border-bottom: 2px solid var(--border);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comparison-table td {
    padding: 5px 4px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 12px;
}
.comparison-table .comp-label {
    text-align: left;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}
.text-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
}
.text-btn:hover {
    text-decoration: underline;
}
.scenarios-list {
    max-height: 200px;
    overflow-y: auto;
}
.scenarios-comparison {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    width: 340px;
}
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--text-muted);
    animation: toast-in 0.3s ease;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
}
.toast.toast-error { border-left-color: var(--red); }
.toast.toast-warning { border-left-color: var(--orange); }
.toast.toast-info { border-left-color: var(--accent); }
.toast-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-msg { font-size: 12px; color: var(--text-secondary); }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 16px; padding: 0 0 0 8px;
    line-height: 1;
}
.toast-action {
    margin-top: 6px;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 4px 10px;
    font-size: 11px; font-family: var(--font);
    cursor: pointer; color: var(--accent); font-weight: 600;
}
.toast-action:hover { background: var(--accent-subtle); }
.toast.removing { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }

/* === Preset label === */
.preset-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0,0,0,0.5);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding-right: 2px;
}

/* === Focus states === */
.sf-btn:focus-visible,
.float-btn:focus-visible,
.action-btn:focus-visible,
.preset-pill:focus-visible,
.info-btn:focus-visible,
.sheet-close-btn:focus-visible,
.welcome-card-close:focus-visible,
.audio-play-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Inputs that suppress default outline need a visible focus ring for keyboard users */
#search-float input:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
    border-radius: 4px;
}
.property-input-wrap input:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
    border-radius: 4px;
}
.sim-range:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Empty state === */
.empty-state {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}
.empty-state-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   VALUE MODE — Dedicated property value analysis
   ============================================ */

/* Mode selector in welcome card */
.welcome-mode-selector {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 2px;
}
.welcome-mode-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}
.welcome-mode-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.welcome-mode-btn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-section);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-family: var(--font);
}
.welcome-mode-btn:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}
.welcome-mode-btn.active {
    border-color: var(--accent);
    background: var(--accent-subtle);
    box-shadow: 0 0 0 1px var(--accent);
}
.welcome-mode-btn svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent);
}
.welcome-mode-btn strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.welcome-mode-btn span {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 2px;
}

/* Mode-based visibility — hide irrelevant sections */
[data-mode="value"] .sheet-presets,
[data-mode="value"] #tab-sound,
[data-mode="value"] #tab-shadow,
[data-mode="value"] #tab-visual,
[data-mode="value"] #tab-weather,
[data-mode="value"] #street-view-container,
[data-mode="value"] #scenarios-section,
[data-mode="value"] #preset-bar,
[data-mode="value"] #controls-fab,
[data-mode="value"] #stat-chips { display: none !important; }

[data-mode="full"] .value-mode-results { display: none !important; }

/* Value mode results container */
.value-mode-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Property type selector */
.vm-input-section {
    padding: 0 2px;
}
.vm-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
.vm-type-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.vm-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-section);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.vm-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(21,101,192,0.15);
}

/* Headline impact display */
.vm-headline {
    text-align: center;
    padding: 16px 0 8px;
}
.vm-headline-pct {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}
.vm-sev-high { color: var(--red); }
.vm-sev-moderate { color: var(--orange); }
.vm-sev-low { color: var(--green); }
.vm-sev-none { color: var(--text-muted); }
.vm-headline-sek {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}
.vm-headline-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.vm-headline-adjusted {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Confidence interval */
.vm-confidence {
    padding: 0 2px;
}
.vm-ci-bar-wrap {
    margin-top: 8px;
}
.vm-ci-bar {
    position: relative;
    height: 10px;
    background: var(--bg-section);
    border-radius: 5px;
    border: 1px solid var(--border);
    overflow: visible;
}
.vm-ci-range {
    position: absolute;
    top: -1px;
    height: 10px;
    background: linear-gradient(90deg, rgba(22,163,74,0.3), rgba(234,88,12,0.3), rgba(220,38,38,0.3));
    border-radius: 5px;
}
.vm-ci-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 18px;
    background: var(--text-primary);
    border-radius: 2px;
    transform: translateX(-50%);
}
.vm-ci-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 2px;
}
.vm-ci-end {
    text-align: center;
    line-height: 1.3;
}
.vm-ci-center {
    font-weight: 600;
}
.vm-ci-pct {
    font-size: 13px;
    color: var(--text-primary);
    display: block;
}
.vm-ci-pct-bold {
    font-weight: 700;
    font-size: 14px;
}
.vm-ci-sek {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
}
.vm-ci-tag {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin-top: 2px;
}

/* Depreciation chart */
.vm-chart-wrap {
    padding: 0 2px;
}
.vm-chart {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

/* Section labels */
.vm-section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.vm-section-sublabel {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 12px;
}

/* Project breakdown table */
.vm-breakdown {
    padding: 0 2px;
}
.vm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.vm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.vm-table th {
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    padding: 6px 6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.vm-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.vm-row-dominant td {
    color: var(--text-primary);
    font-weight: 500;
}
.vm-row-secondary td {
    opacity: 0.6;
}
.vm-td-impact {
    text-align: right;
}
.vm-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.vm-status-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-section);
    border-radius: 3px;
}
.vm-muted {
    color: var(--text-muted);
}
.vm-note {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

/* Distance sensitivity cards */
.vm-sensitivity {
    padding: 0 2px;
}
.vm-sens-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.vm-sens-card {
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border);
}
.vm-sens-worse {
    background: rgba(220,38,38,0.04);
    border-color: rgba(220,38,38,0.15);
}
.vm-sens-now {
    background: var(--accent-subtle);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(21,101,192,0.1);
}
.vm-sens-better {
    background: rgba(22,163,74,0.04);
    border-color: rgba(22,163,74,0.15);
}
.vm-sens-arrow {
    font-size: 14px;
    line-height: 1;
}
.vm-sens-worse .vm-sens-arrow { color: var(--red); }
.vm-sens-now .vm-sens-arrow { color: var(--accent); }
.vm-sens-better .vm-sens-arrow { color: var(--green); }
.vm-sens-dist {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}
.vm-sens-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}
.vm-sens-diff {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}
.vm-sens-worse .vm-sens-diff { color: var(--red); }
.vm-sens-better .vm-sens-diff { color: var(--green); }
.vm-sens-now .vm-sens-diff { color: var(--accent); }
.vm-sens-tag {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Area impact summary (value mode) */
.vm-area-impact {
    padding: 0 2px;
}
.vm-area-summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.vm-area-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.vm-area-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Methodology section */
.vm-methodology {
    padding: 0 2px;
}
.vm-method-detail {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    overflow: hidden;
}
.vm-method-detail summary {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    background: var(--bg-section);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vm-method-detail summary::before {
    content: '\25B6';
    font-size: 8px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.vm-method-detail[open] summary::before {
    transform: rotate(90deg);
}
.vm-method-detail summary::-webkit-details-marker { display: none; }
.vm-method-text {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.vm-method-text p {
    margin-bottom: 10px;
}
.vm-method-note {
    padding: 8px 10px;
    background: var(--accent-subtle);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Research bands mini-chart */
.vm-method-bands {
    margin: 8px 0;
}
.vm-band-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.vm-band-dist {
    width: 55px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.vm-band-bar-wrap {
    flex: 1;
    height: 14px;
    background: var(--bg-section);
    border-radius: 3px;
    overflow: hidden;
}
.vm-band-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--orange));
    border-radius: 3px;
    transition: width 0.3s ease;
}
.vm-band-pct {
    width: 40px;
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Limitations list */
.vm-limit-list {
    list-style: none;
    padding: 0;
}
.vm-limit-list li {
    padding: 6px 0 6px 16px;
    position: relative;
    font-size: 12px;
    line-height: 1.5;
}
.vm-limit-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--orange);
    font-weight: 700;
}

/* Sheet mode toggle (segmented control) */
.sheet-mode-toggle {
    display: flex;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 12px;
}
.smt-btn {
    flex: 1;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.smt-btn:hover {
    color: var(--text-secondary);
}
.smt-btn.active {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Living area input */
.vm-area-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.vm-area-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.vm-area-input {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-section);
}
.vm-area-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(21,101,192,0.15);
}
.vm-area-optional {
    font-size: 11px;
    color: var(--text-muted);
}

/* Before/After comparison */
.vm-before-after {
    padding: 0 2px;
}
.vm-ba-card {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.vm-ba-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.vm-ba-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.vm-ba-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.vm-ba-adjusted {
    color: var(--accent);
}
.vm-ba-loss-row {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.vm-ba-loss {
    color: var(--red);
    font-weight: 700;
}
.vm-ba-bar-wrap {
    padding: 10px 0;
}
.vm-ba-bar-full {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.vm-ba-bar-kept {
    background: linear-gradient(90deg, #dbeafe, var(--accent-subtle));
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    transition: width 0.4s ease;
}
.vm-ba-bar-lost {
    background: linear-gradient(90deg, rgba(220,38,38,0.08), rgba(220,38,38,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    transition: width 0.4s ease;
}
.vm-ba-bar-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* CI spread note */
.vm-ci-spread {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Per-sqm display */
.vm-per-sqm {
    padding: 0 2px;
}
.vm-sqm-grid {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.vm-sqm-card {
    padding: 10px 14px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    flex: 1;
}
.vm-sqm-after {
    border-color: var(--accent);
    background: var(--accent-subtle);
}
.vm-sqm-loss {
    border-color: rgba(220,38,38,0.2);
    background: rgba(220,38,38,0.03);
}
.vm-sqm-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.vm-sqm-loss .vm-sqm-val {
    color: var(--red);
}
.vm-sqm-unit {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}
.vm-sqm-tag {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    margin-top: 4px;
}
.vm-sqm-arrow {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Factor decomposition */
.vm-factors {
    padding: 0 2px;
}
.vm-factor-card {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.vm-factor-step {
    display: flex;
    gap: 10px;
    padding: 8px 0;
}
.vm-factor-step + .vm-factor-op {
    border-top: none;
}
.vm-factor-num {
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.vm-factor-content {
    flex: 1;
    min-width: 0;
}
.vm-factor-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.vm-factor-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}
.vm-factor-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}
.vm-factor-op {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    padding: 2px 0;
    font-weight: 600;
}
.vm-factor-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 4px;
    border-top: 2px solid var(--accent);
    margin-top: 4px;
}
.vm-factor-eq {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.vm-factor-final {
    font-size: 22px;
    font-weight: 800;
    color: var(--red);
}
.vm-factor-final-sek {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Turbine list */
.vm-turbine-list {
    padding: 0 2px;
}
.vm-turb-wrap {
    padding: 0 12px 12px;
}
.vm-turb-table td, .vm-turb-table th {
    font-size: 11px;
    padding: 5px 4px;
}
.vm-turb-idx {
    color: var(--text-muted);
    font-size: 10px;
    width: 20px;
}
.vm-turb-nearest td {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(21,101,192,0.04);
}
.vm-turb-dist {
    font-variant-numeric: tabular-nums;
}
.vm-turb-project {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.vm-turb-mfg {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vm-turb-hidden {
    display: none;
}
.vm-turb-more-cell {
    text-align: center;
    padding: 8px !important;
}
.vm-turb-more-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid rgba(21,101,192,0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
}
.vm-turb-more-btn:hover {
    background: rgba(21,101,192,0.12);
}

/* Per-band breakdown */
.vm-band-breakdown {
    padding: 0 2px;
}
.vm-bb-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.vm-bb-row {
    display: grid;
    grid-template-columns: 60px 45px 1fr 70px;
    gap: 6px;
    padding: 8px 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.vm-bb-row:last-child { border-bottom: none; }
.vm-bb-active { background: #fff; }
.vm-bb-empty { background: var(--bg-section); opacity: 0.6; }
.vm-bb-dist {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
}
.vm-bb-dep {
    font-weight: 700;
    font-size: 11px;
}
.vm-band-sev-high { color: var(--red); }
.vm-band-sev-mod { color: var(--orange); }
.vm-band-sev-low { color: var(--green); }
.vm-bb-bar-wrap {
    height: 12px;
    background: var(--bg-section);
    border-radius: 3px;
    overflow: hidden;
}
.vm-bb-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    min-width: 2px;
    transition: width 0.3s ease;
}
.vm-bb-count {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
}
.vm-bb-projects {
    display: none; /* shown on wider screens */
}
.vm-bb-summary {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

/* Multi-sensitivity table */
.vm-multi-sensitivity {
    padding: 0 2px;
}
.vm-ms-wrap {
    padding: 0 12px 12px;
}
.vm-ms-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}
.vm-ms-table td, .vm-ms-table th {
    font-size: 11px;
    padding: 5px 6px;
}
.vm-ms-current td {
    font-weight: 700;
    background: var(--accent-subtle);
    color: var(--text-primary);
}
.vm-ms-diff {
    font-weight: 600;
    text-align: right;
}
.vm-ms-worse .vm-ms-diff { color: var(--red); }
.vm-ms-better .vm-ms-diff { color: var(--green); }

/* Lifecycle timeline */
.vm-lifecycle {
    padding: 0 2px;
}
.vm-lc-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.vm-lc-phase {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 8px;
    padding: 8px 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    font-size: 12px;
}
.vm-lc-phase:last-child { border-bottom: none; }
.vm-lc-current {
    background: var(--accent-subtle);
    border-left: 3px solid var(--accent);
}
.vm-lc-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
}
.vm-lc-bar-wrap {
    height: 14px;
    background: var(--bg-section);
    border-radius: 3px;
    overflow: hidden;
}
.vm-lc-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(220,38,38,0.3), rgba(220,38,38,0.6));
    border-radius: 3px;
    transition: width 0.4s ease;
}
.vm-lc-values {
    display: flex;
    gap: 6px;
    align-items: baseline;
    white-space: nowrap;
}
.vm-lc-pct {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 12px;
}
.vm-lc-sek {
    font-size: 10px;
    color: var(--text-muted);
}
.vm-lc-marker {
    position: absolute;
    top: 3px;
    right: 8px;
    font-size: 8px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    background: rgba(21,101,192,0.08);
    padding: 1px 5px;
    border-radius: 3px;
}

/* International comparison */
.vm-international {
    padding: 0 2px;
}
.vm-intl-wrap {
    padding: 0 12px 12px;
}
.vm-intl-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}
.vm-intl-table td, .vm-intl-table th {
    font-size: 11px;
    padding: 5px 6px;
}
.vm-intl-highlight td {
    font-weight: 600;
    background: var(--accent-subtle);
}
.vm-intl-range {
    font-weight: 700;
    color: var(--red);
    white-space: nowrap;
}
.vm-intl-note {
    font-size: 10px;
    color: var(--text-muted);
    max-width: 140px;
}

/* Formula display */
.vm-formula-block {
    background: #1e293b;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 10px 0;
    text-align: center;
}
.vm-formula {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #e2e8f0;
    font-weight: 600;
}
.vm-formula sub {
    font-size: 10px;
}
.vm-formula-small {
    font-size: 12px;
    display: block;
    background: #1e293b;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 8px 0;
    text-align: center;
}
.vm-formula-legend {
    margin: 10px 0;
}
.vm-formula-legend p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 4px;
}
.vm-formula-detail {
    margin-top: 12px;
}
.vm-formula-detail p {
    font-size: 11px;
    line-height: 1.5;
}
.vm-formula-note {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Data quality grid */
.vm-dq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.vm-dq-item {
    padding: 8px 10px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.vm-dq-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.vm-dq-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Sources list */
.vm-sources-list {
    padding: 8px 12px;
}
.vm-sources-list li {
    margin-bottom: 8px;
}
.vm-sources-list a {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    line-height: 1.5;
}
.vm-sources-list a:hover {
    text-decoration: underline;
}

/* Mobile adjustments for value mode */
@media (max-width: 768px) {
    .vm-sens-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .vm-sens-card {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
        padding: 8px 12px;
    }
    .vm-sens-arrow { font-size: 16px; }
    .vm-sens-dist { margin-top: 0; }
    .vm-sens-pct { margin-top: 0; }
    .vm-sens-diff { margin-top: 0; }
    .vm-sens-tag { display: none; }

    .welcome-mode-btns {
        grid-template-columns: 1fr;
    }

    .vm-sqm-grid {
        flex-wrap: wrap;
    }
    .vm-sqm-arrow { display: none; }
    .vm-sqm-card { min-width: 80px; }

    .vm-ba-bar-label { font-size: 9px; }

    .vm-bb-row {
        grid-template-columns: 55px 40px 1fr 60px;
        font-size: 11px;
        padding: 6px 8px;
    }

    .vm-lc-phase {
        grid-template-columns: 75px 1fr auto;
        gap: 6px;
        padding: 6px 8px;
    }
    .vm-lc-sek { display: none; }

    .vm-dq-grid {
        grid-template-columns: 1fr;
    }
}
