/* Reset and Base Styles */

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


:root{
    /* Designer palette (mapinamo_demo_180526) */
    --primary: #44B6C5;
    --primary-hover: #379CA9;
    --primary-light: #E2F2F5;
    --primary-light-2: #F1F9FB;
    --primary-tint: rgba(68, 182, 197, 0.14);
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --bg: #EAF1F4;
    --modal-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --border: #E4E9EE;
    --border-strong: #D7DEE5;
    --counter-bg: #F1F4F7;
    --counter-text: #6B7785;
    --icon-bg: #DEEFF3;
    --icon-color: #2A9CAB;
    --shadow-modal: 0 24px 60px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius-card: 14px;
    --radius-modal: 20px;
    --radius-pill: 999px;
    --radius-btn: 10px;

    /* Backward-compat aliases (legacy --c-* tokens map to new palette) */
    --c-text: var(--text);
    --c-text-dark: var(--text);
    --c-text-heading: var(--text);
    --c-text-dim: var(--text-secondary);
    --c-text-secondary: var(--text-secondary);
    --c-text-muted: var(--text-tertiary);
    --c-text-light: var(--text-tertiary);
    --c-popup-muted: var(--text-tertiary);
    --c-bg: var(--bg);
    --c-bg-accent: var(--bg);
    --c-white: #fff;
    --c-black: #000;
    --c-teal: var(--primary);
    --c-teal-mid: var(--primary-hover);
    --c-border: var(--border);
    --c-border-light: var(--border);
    --c-divider: var(--border);
    --c-glass: rgba(255, 255, 255, 0.95);
    --c-input-bg: var(--card-bg);
    --c-hover: var(--primary-light-2);
    --c-gray-light: var(--border);
    --c-gray-mid: var(--text-secondary);
    --c-gray-dim: var(--text-secondary);
    --c-link: var(--primary);
    --c-purple: #7C3AED;
    --c-indigo: #4F46E5;
    --c-indigo-dark: #3730A3;
    --c-copilot: #7C3AED;
    --c-copilot-mid: #6D28D9;
    --c-copilot-dark: #5B21B6;
    --c-error: #EF4444;
    --c-error-vivid: #DC2626;
    --c-error-soft: #FEE2E2;
    --c-error-alt: #FCA5A5;

    /* Accent palette (kept for charts/legends/error states) */
    --c-magenta: #C939A3;
    --grad-magenta-teal: linear-gradient(135deg, var(--c-magenta) 0%, var(--primary) 100%);
    --grad-rainbow: linear-gradient(90deg, var(--primary) 0%, var(--c-purple) 50%, var(--c-magenta) 100%);
    --grad-rainbow-rev: linear-gradient(135deg, var(--c-magenta) 0%, var(--c-purple) 50%, var(--primary) 100%);
    --grad-teal-magenta: linear-gradient(90deg, var(--primary), var(--c-magenta));
    --grad-legend: linear-gradient(90deg, #f0f921, #dea04d, #cc4778, #6d2880, #0d0887);
    --grad-legend-rev: linear-gradient(90deg, #0d0887, #6d2880, #cc4778, #dea04d, #f0f921);

    /* Typography tokens */
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Courier New', monospace;
}


body{
    font-family: var(--font-sans);
    background: var(--c-bg);
    color: var(--c-text);
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}


/* ── Landing & About Pages ── */


.landing-page, .about-page{
    min-height: 100vh;
    background: var(--c-bg);
    color: var(--c-text);
}


.landing-body .about-page{
    background: var(--c-bg-accent);
}


.landing-body{
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--c-bg-accent);
}


.navbar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px 0;
    background-color: var(--c-bg-accent);
}


.logo-container{
    display: flex;
    align-items: center;
    gap: 10px;
}


.logo-img{
    height: 32px;
    width: auto;
}


.nav-links{
    display: flex;
    gap: 24px;
}


.nav-links a{
    text-decoration: none;
    color: var(--c-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}


.nav-links a:hover{
    color: var(--c-text-heading);
}


.hero-container{
    max-width: 1400px;
    margin: 6px auto 32px;
    background-color: var(--c-bg-accent);
    border-radius: 32px;
    text-align: center;
    padding: 58px 20px 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}


.hero-title{
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--c-text-dark);
    line-height: 1.1;
    max-width: 900px;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}


.hero-subtitle{
    font-size: 1.05rem;
    color: var(--c-text-secondary);
    max-width: 640px;
    margin-bottom: 20px;
    line-height: 1.6;
}


.hero-supported{
    font-size: 0.9rem;
    color: var(--c-text-muted);
    margin-bottom: 28px;
}


.cta-button{
    background-color: var(--c-indigo);
    color: var(--c-white);
    border: none;
    padding: 14px 36px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}


.cta-button:hover{
    background-color: var(--c-indigo-dark);
    transform: translateY(-2px);
}


.landing-images{
    max-width: 1080px;
    margin: -50px auto 40px;
    padding: 0 20px 40px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    position: relative;
    z-index: 2;
}


.landing-images img{
    width: 100%;
    display: block;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}


.landing-contact{
    max-width: 600px;
    margin: 0 auto 48px;
    padding: 0 20px;
}


.landing-contact-title{
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text-dark);
    margin-bottom: 8px;
}


.landing-contact-intro{
    font-size: 0.95rem;
    color: var(--c-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}


.landing-contact-form{
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}


.landing-contact-form .landing-field{
    margin-bottom: 16px;
}


.landing-contact-form .landing-field:last-of-type{
    margin-bottom: 20px;
}


.landing-contact-form .cta-button{
    width: 100%;
}


.landing-footer{
    max-width: 1400px;
    margin: 0 auto 24px;
    padding: 0 20px;
    font-size: 12px;
    color: rgba(15, 23, 42, 0.6);
    text-align: right;
}


.landing-field{
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}


.landing-field label{
    font-size: 12px;
    font-weight: 600;
    color: rgba(0,0,0,0.65);
}


.landing-field input, .landing-field textarea{
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.14);
    background: rgba(0,0,0,0.02);
    font-size: 13px;
    resize: vertical;
}


.landing-field textarea{
    min-height: 90px;
}


@media (max-width: 840px) {
    .landing-hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero-container {
        padding: 41px 16px 41px;
        border-radius: 20px;
        margin: 12px 12px 40px;
    }
    .landing-images {
        grid-template-columns: minmax(0, 1fr);
        margin: -24px 12px 32px;
        padding: 0 0 32px;
    }
    .landing-feedback-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}


@media (max-width: 600px) {
    .landing-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .landing-main {
        padding-top: 20px;
    }
}


.about-main{
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 20px 40px;
}


.about-section{
    margin-bottom: 36px;
}


.about-hero h1{
    font-size: 26px;
    margin-bottom: 12px;
}


.about-hero p{
    font-size: 15px;
    color: rgba(0,0,0,0.7);
    text-align: justify;
    line-height: 1.65;
    margin-bottom: 16px;
}


.about-section h2{
    font-size: 18px;
    margin-bottom: 12px;
}


.about-section p{
    font-size: 14px;
    color: rgba(0,0,0,0.78);
    text-align: justify;
    line-height: 1.65;
    margin-bottom: 14px;
}


.about-section p:last-child{
    margin-bottom: 0;
}


.about-list{
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-size: 14px;
    color: rgba(0,0,0,0.8);
}


.about-list li{
    text-align: justify;
    line-height: 1.65;
}


.about-list li strong{
    display: block;
    margin-bottom: 4px;
}


.team-grid{
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 12px;
}


.team-member{
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}


.team-member .team-photo, .team-member .team-photo-placeholder{
    flex-shrink: 0;
}


.team-member .team-photo + h3, .team-member .team-photo-placeholder + h3{
    margin-top: 0;
}


.team-member-content{
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}


.team-photo{
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
}


.team-role{
    font-size: 13px;
    font-weight: 600;
    color: var(--c-teal);
}


.about-contact a{
    color: var(--c-teal);
    text-decoration: none;
}


.about-contact a:hover{
    text-decoration: underline;
}


.app-page{
    display: none;
}


.app-page.active{
    display: block;
}


#page-analysis.active{
    display: flex;
    flex-direction: column;
}


/* Full-Screen Map */


/* Top Horizontal Panel */


.top-panel-header h1{
    font-size: 32px;
    font-weight: 700;
    background: var(--grad-magenta-teal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    white-space: nowrap;
}


.top-panel-subtitle{
    font-size: 11px;
    color: rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    transition: color 0.3s ease;
}


.control-group{
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}


.control-group label{
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}


.control-group .filter-select{
    padding: 8px 12px;
    font-size: 13px;
}


/* Theme Toggle removed — light theme only */


/* Export Report button */

#share-btn{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--c-text);
    border: 1px solid var(--c-text);
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    color: var(--c-white);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
    margin-left: auto;
}


#share-btn:hover{
    background: var(--c-text-dim);
    border-color: var(--c-text-dim);
}


#share-btn:disabled{
    opacity: 0.5;
    cursor: wait;
}


/* Left Sidebar (Filters Only) */


/* ── Sidebar brand header ── */


.lsb-brand{
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.01em;
    flex: 1;
    color: var(--c-text);
}


/* Scrollable sidebar body */

.lsb-scroll{
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 24px;
}


.lsb-scroll::-webkit-scrollbar{ width: 6px; }

.lsb-scroll::-webkit-scrollbar-track{ background: transparent; }

.lsb-scroll::-webkit-scrollbar-thumb{ background: rgba(0, 0, 0, 0.15); border-radius: 3px; }

.lsb-scroll::-webkit-scrollbar-thumb:hover{ background: rgba(0, 0, 0, 0.25); }


.lsb-metrics-label{
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 16px 16px 8px;
}


#sidebar::-webkit-scrollbar, #ai-description-panel::-webkit-scrollbar{
    width: 6px;
}


#sidebar::-webkit-scrollbar-track, #ai-description-panel::-webkit-scrollbar-track{
    background: transparent;
}


#sidebar::-webkit-scrollbar-thumb, #ai-description-panel::-webkit-scrollbar-thumb{
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}


#sidebar::-webkit-scrollbar-thumb:hover{
    background: rgba(0, 0, 0, 0.25);
}


.filter-section{
    padding: 16px 20px 0;
    margin-bottom: 24px;
}


/* Collapsible filter category sections */


/* Sub-scores collapsible inside Scores section */


.filter-info-icon{
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    opacity: 0.5;
    cursor: help;
    transition: opacity 0.2s ease, transform 0.2s ease;
    user-select: none;
}


.filter-info-icon:hover{
    opacity: 1;
    transform: scale(1.15);
}


.filter-tooltip{
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 320px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    animation: tooltipFadeIn 0.2s ease;
}


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


.filter-tooltip .tooltip-title{
    font-weight: 600;
    color: var(--c-magenta);
    margin-bottom: 6px;
    font-size: 14px;
}


.filter-tooltip .tooltip-description{
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 8px;
}


.filter-tooltip .tooltip-meta{
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
}


.filter-tooltip .tooltip-meta-item{
    display: flex;
    gap: 6px;
}


.filter-tooltip .tooltip-meta-label{
    font-weight: 500;
    color: rgba(0, 0, 0, 0.5);
}


.value-separator{
    margin: 0 6px;
    color: var(--c-error);
    font-weight: 300;
    font-size: 14px;
}


.filter-select{
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    color: var(--c-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}


.filter-select:hover{
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(201, 57, 163, 0.4);
}


.filter-select:focus{
    outline: none;
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--c-magenta);
    box-shadow: 0 0 0 3px rgba(201, 57, 163, 0.2);
}


.filter-select option{
    background: var(--c-white);
    color: var(--c-text);
}


/* Range Slider */

.range-slider{
    margin: 6px 0 4px;
}


.noUi-target{
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 4px;
    box-shadow: none;
    height: 4px;
}


.noUi-connect{
    background: var(--grad-legend);
}


.noUi-handle, .noUi-horizontal .noUi-handle{
    background: var(--c-white);
    border: 1px solid var(--c-magenta);
    border-radius: 50% !important;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    right: -2px !important;
    top: -1px !important;
    width: 4px !important;
    height: 4px !important;
    cursor: grab;
    transition: all 0.15s ease;
}


.noUi-handle:hover{
    box-shadow: 0 3px 12px rgba(201, 57, 163, 0.5);
    transform: scale(1.1);
}


.noUi-handle:active{
    cursor: grabbing;
    transform: scale(0.95);
}


.noUi-handle::before, .noUi-handle::after{
    display: none;
}


.range-input:hover{
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(201, 57, 163, 0.3);
}


.range-input:focus{
    outline: none;
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--c-magenta);
    box-shadow: 0 0 0 2px rgba(201, 57, 163, 0.2);
}


/* Remove spinner buttons from number inputs */

.range-input::-webkit-inner-spin-button, .range-input::-webkit-outer-spin-button{
    -webkit-appearance: none;
    margin: 0;
}


.range-input
{
    flex: 1;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    color: var(--c-text);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-mono);
    text-align: center;
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}


/* Buttons */

button{
    padding: 7px 14px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--c-text);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: none;
}


button:hover{
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(201, 57, 163, 0.5);
    transform: none;
}


button:active{
    transform: none;
}


.btn-secondary:hover{
    background: rgba(0, 0, 0, 0.08);
}


body.light-theme .analysis-map-card .analysis-map-actions .btn-secondary{
    color: var(--c-text);
}


/* Similar hexes legend (analysis map) */

.similar-hex-legend{
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--c-text-dim);
    background: rgba(81, 162, 182, 0.12);
    border: 1px solid rgba(81, 162, 182, 0.35);
    border-radius: 8px;
}

.similar-hex-legend-inner{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.similar-hex-legend-sub{
    color: var(--c-text-light);
    font-size: 11px;
    font-weight: 500;
}

.similar-hex-clear-btn{
    margin-left: auto;
}

.similar-hex-legend-text{
    color: var(--c-text-light);
}


/* AI Analysis Button (in top panel) */

.btn-analysis{
    align-self: center;
    padding: 7px 14px;
    background: rgba(81, 162, 182, 0.08);
    border: 1px solid rgba(81, 162, 182, 0.3);
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    color: var(--c-text);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}


.btn-analysis:hover:not(:disabled){
    background: rgba(81, 162, 182, 0.15);
    border-color: rgba(81, 162, 182, 0.5);
    transform: none;
}


.btn-analysis:disabled{
    opacity: 0.35;
    cursor: not-allowed;
}


.btn-ai-analysis:hover:not(:disabled){
    background: rgba(201, 57, 163, 0.15);
    border-color: rgba(201, 57, 163, 0.5);
}


.btn-ai-analysis:disabled{
    opacity: 0.35;
    cursor: not-allowed;
}


.btn-ai-analysis.loading{
    pointer-events: none;
    opacity: 0.6;
}


#page-analysis{
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px;
    z-index: 2;
    overflow-y: auto;
}


.analysis-layout{
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 12px;
    flex: 1;
    align-items: start;
    transition: grid-template-columns 0.3s ease;
}


.analysis-layout.ai-open{
    grid-template-columns: 5fr 4fr 3fr;
}


/* Col 1: Map + Survey stacked */

.analysis-main-col{
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.analysis-map-card, .analysis-survey-card, .analysis-col, .analysis-action-row{
    background: var(--c-glass);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-card);
    padding: 14px;
}


.analysis-map-card{
    display: flex;
    flex-direction: column;
    flex: 1;
}


.analysis-survey-card{
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 50vh;
}


.analysis-survey-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
}


.analysis-survey-header h3{
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
}


/* Col 2: Action row + Scores + People + POIs */

.analysis-data-col{
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}


.analysis-action-row{
    display: flex;
    align-items: flex-end;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 10px;
}


.analysis-biz-type-ctrl{
    flex: 1;
    min-width: 0;
}


.analysis-biz-type-ctrl label{
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 2px;
}


.analysis-biz-type-label{
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    padding: 4px 0;
}


.analysis-col{
    overflow-y: auto;
}


/* Col 3: AI description (hidden until generated) */

.analysis-ai-col{
    display: none;
    background: var(--c-glass);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 14px;
    overflow-y: auto;
    flex-direction: column;
}


.analysis-ai-col.active{
    display: flex;
}


.ai-col-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}


.ai-col-title{
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}


.ai-col-header .close-btn{
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}


.ai-col-header .close-btn:hover{
    background: rgba(0, 0, 0, 0.08);
    color: var(--c-black);
}


/* Prominent AI button inside analysis action row */

.btn-ai-analysis-prominent{
    padding: 10px 16px;
    flex-shrink: 0;
    background: var(--grad-rainbow-rev);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    color: var(--c-white);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(201, 57, 163, 0.35);
}


.btn-ai-analysis-prominent:hover:not(:disabled){
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 57, 163, 0.5);
    filter: brightness(1.1);
}


.btn-ai-analysis-prominent:disabled{
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.5);
}


.btn-ai-analysis-prominent.loading{
    pointer-events: none;
    opacity: 0.6;
}


.analysis-card-header{
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}


.analysis-card-header h3{
    white-space: nowrap;
}


.analysis-location-meta{
    flex: 1;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: baseline;
}


#analysis-map{
    width: 100%;
    height: 38vh;
    min-height: 350px;
    border-radius: 10px;
    overflow: hidden;
    flex: none;
}


.hex-id-label{
    font-size: 10px;
    color: rgba(0, 0, 0, 0.45);
    font-family: var(--font-mono);
}


.hex-coords{
    font-size: 11px;
    color: rgba(0, 0, 0, 0.75);
}


.gmaps-link{
    color: var(--c-link);
    text-decoration: none;
    font-size: 11px;
}


.gmaps-link:hover{
    text-decoration: underline;
}


.hex-geocode{
    font-size: 10.5px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 3px;
    font-style: italic;
}


.analysis-parameters-placeholder{
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.75);
    font-size: 13px;
}


/* Analysis loading indicator */

.analysis-loading{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 13px;
}

.analysis-spinner{
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--c-teal);
    border-radius: 50%;
    animation: analysis-spin 0.8s linear infinite;
}

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

.poi-type-count{
    font-weight: 400;
    color: rgba(0,0,0,0.45);
    font-size: 12px;
}

.poi-category-selected{
    background: rgba(81,162,182,0.12);
    font-weight: 600;
    color: var(--c-teal);
}

.poi-category-selected .metric-val{
    color: var(--c-teal);
}


.btn-transport-small{
    font-size: 11px;
    padding: 5px 10px;
    margin-top: 12px;
}

.btn-transport-active{
    background: var(--c-teal);
    color: var(--c-white);
    border-color: var(--c-teal);
}


/* ─── Analysis panel compact metrics ─── */


.analysis-biz-ctrl .filter-select{
    width: 100%;
    max-width: none;
}


#analysis-parameters{
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}


.analysis-section:last-child{
    margin-bottom: 0;
}


.analysis-section-title{
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: rgba(0,0,0,0.45);
    margin-bottom: 8px;
}


.baseline-note{
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
    color: rgba(0,0,0,0.45);
}


.metrics-compact-grid{
    display: flex;
    flex-direction: column;
    gap: 4px;
}


/* Two-column layout for census / transport / POI sections */

.metrics-compact-grid.two-col{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
}


/* Row with percentile mini-bar (for scores) */


/* Row with just value (for census/transport/poi) */

.metric-row-simple{
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 1px 0;
}


.metric-name{
    font-size: 14px;
    color: rgba(0,0,0,0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
}


.metric-val{
    font-size: 14px;
    font-weight: 600;
    color: rgba(0,0,0,0.9);
    text-align: right;
    white-space: nowrap;
}


/* Total Score collapsible — triangle left of the row */


/* gradient bar fill specifically for scores section */


/* Categorical color legend (neighborhood profile) */

.color-legend-categorical{
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
    padding: 6px 8px;
    background: var(--c-white);
    border-radius: 6px;
}

.legend-swatch-row{
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    line-height: 1.3;
}

.legend-swatch-dot{
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-swatch-label{
    color: var(--c-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Favicon logo used as info icon inside metric rows */


/* Small info icon inside analysis metric rows */

.analysis-metric-info{
    font-size: 10px;
    opacity: 0.5;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}


.analysis-metric-info:hover{
    opacity: 0.9;
}


.metric-bar{
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 2px;
    overflow: hidden;
}


.metric-bar-fill{
    height: 100%;
    background: linear-gradient(90deg, rgba(81,162,182,0.7), rgb(81,162,182));
    border-radius: 2px;
    transition: width 0.3s;
}


.scores-section .metric-bar-fill{
    background: linear-gradient(90deg, #F0F921 0%, #CC4778 50%, var(--c-copilot) 100%);
}


/* Profile description section */

.profile-section{
    padding: 10px 12px;
}

.profile-desc-para{
    font-size: 13px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.7);
    margin: 4px 0;
}


.analysis-score-badge{
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--c-copilot);
    margin: 4px 0 6px;
    line-height: 1;
}

.analysis-score-max{
    font-size: 14px;
    font-weight: 400;
    color: rgba(0,0,0,0.4);
}


/* AI Description Panel (overlay) */

#ai-description-panel{
    position: fixed;
    right: 20px;
    top: 96px;
    width: 380px;
    max-height: calc(100vh - 116px);
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    z-index: 998;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateX(440px);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    color: var(--c-text);
}


#ai-description-panel.active{
    transform: translateX(0);
}


.ai-panel-icon{
    font-size: 18px;
}


#ai-panel-coords{
    color: var(--c-text-light);
    font-weight: 500;
}


.ai-panel-header .close-btn{
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}


.ai-panel-header .close-btn:hover{
    background: rgba(0, 0, 0, 0.1);
    color: var(--c-text);
}


#ai-panel-content{
    padding: 20px;
}


#ai-panel-content .info-placeholder{
    color: rgba(0, 0, 0, 0.4);
}


.close-btn{
    position: relative;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    color: rgba(0, 0, 0, 0.7);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


.close-btn:hover{
    background: rgba(0, 0, 0, 0.1);
    color: var(--c-text);
    transform: none;
}


.info-placeholder{
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    transition: color 0.3s ease;
}


/* Analysis Results */


.analysis-summary{
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(201, 57, 163, 0.1);
    border-left: 3px solid var(--c-magenta);
    border-radius: 6px;
    font-size: 14px;
}


.analysis-section
{
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.07);
    margin-top: 16px;
}


.analysis-section ul{
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}


.analysis-section li{
    padding: 8px 0 8px 24px;
    position: relative;
    color: var(--c-text-dim);
    line-height: 1.5;
    transition: color 0.3s ease;
}


.analysis-section li:before{
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--c-teal);
    font-size: 18px;
}


/* Loading Overlay */

#loading{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 32px 48px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    color: var(--c-text);
    font-size: 16px;
}


/* Mobile Responsive */

@media (max-width: 768px) {
    .analysis-layout,
    .analysis-layout.ai-open {
        grid-template-columns: 1fr;
    }

    .analysis-survey-card {
        max-height: none;
    }

    #analysis-map {
        height: 30vh;
        min-height: 200px;
    }

    #top-panel {
        padding: 0 16px;
    }

    .top-panel-content {
        gap: 16px;
    }

    .top-panel-header h1 {
        font-size: 20px;
    }

    .top-panel-subtitle {
        display: none;
    }

    .control-group {
        min-width: 150px;
    }

    #sidebar {
        width: 320px;
    }

    .color-legend {
        left: 332px;
    }

    #ai-description-panel {
        width: calc(100% - 40px);
        max-width: 380px;
        top: 100px; /* Below top panel */
    }
}


@media (max-width: 480px) {
    #top-panel {
        height: auto;
        padding: 12px;
    }

    .top-panel-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 0;
    }

    .top-panel-controls {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .control-group {
        width: 100%;
        min-width: 0;
    }

    #map {
        top: 160px; /* Taller panel on mobile */
        height: calc(100vh - 160px);
    }

    #filters-toggle-btn {
        display: none;
    }

    #sidebar {
        width: 100%;
        padding: 0 0 20px 0;
        top: 160px;
    }

    .color-legend {
        left: 12px;
    }

    #ai-description-panel {
        top: 170px;
        width: calc(100% - 20px);
        max-width: none;
    }
}


/* Map Loading Overlay */

.map-loading-overlay{
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.25);
    z-index: 600;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.map-loading-overlay.active{
    display: flex;
}

.map-spinner{
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--c-teal);
    border-radius: 50%;
    animation: map-spin 0.8s linear infinite;
}

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

.map-loading-text{
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(255,255,255,0.5);
}


/* Viewport Loading Indicator */

.viewport-indicator{
    display: none;
    position: absolute;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--c-text-dim);
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 500;
    font-size: 14px;
    pointer-events: none;
}


/* Error Messages */

.info-error{
    padding: 12px;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    color: var(--c-error-alt);
    font-size: 13px;
}


.info-error strong{
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}


.info-error p{
    margin: 0;
    line-height: 1.4;
    color: var(--c-text-light);
}


/* Welcome Modal — unified with keyword-overlay look */

.modal{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3000;
    animation: fadeIn 0.3s ease;
    padding: 24px;
}


.modal.active{
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Survey loading placeholder — shown immediately while configs are fetched */

.survey-loading-state{
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    min-height: 320px;
    padding: 18px;
    gap: 10px;
}

.survey-loading-map-bg{
    position: relative;
    flex: 1;
    min-height: 250px;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.survey-loading-point{
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    transform: translate(20px, 20px) scale(1);
    transition: transform 0.58s cubic-bezier(0.19, 1, 0.22, 1);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.survey-loading-caption{
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-dim, #64748b);
    letter-spacing: 0.02em;
}

.survey-loading-spinner{
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--c-teal, #51a2b6);
    border-radius: 50%;
    animation: map-spin 0.8s linear infinite;
}

.survey-data-loading-bar{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 24px;
    background: var(--c-bg-alt, #f8fafc);
    border-top: 1px solid var(--c-border, #e2e8f0);
    border-radius: 0 0 var(--radius-modal, 16px) var(--radius-modal, 16px);
    font-size: 12px;
    color: var(--c-text-dim, #94a3b8);
    flex-shrink: 0;
}

.survey-data-loading-bar .survey-loading-spinner{
    width: 14px;
    height: 14px;
    border-width: 2px;
    flex-shrink: 0;
}


/* Inner padding for modal content sections rendered by JS */

.modal-content .survey-header{
    padding: 24px 32px 0;
}


.modal-content .survey-step-icon{
    padding: 0 32px;
}


.modal-content .survey-biz-picker, .modal-content .startup-sections{
    padding: 0 8px 0;
}


.modal-content .survey-nav{
    padding: 16px 32px;
    border-top: 1px solid var(--border);
    background: var(--modal-bg);
    flex-shrink: 0;
}


/* Step indicator dots */


.survey-step-dot.active, .survey-step-dot.done{
    background: var(--primary);
}


/* Modernised progress bar */


/* AI pill button in modal toolbar */

.startup-ai-btn:active{ transform: scale(0.98); }


/* Keyword preset strip */

.survey-kw-presets{
    padding: 16px 24px 4px;
    border-bottom: 1px solid var(--border);
}


/* Keyword picker mode toggle — segmented control (presets ↔ manual) */

.survey-kw-mode-toggle{
    display: flex;
    background: var(--c-bg-alt, #f1f5f9);
    border-radius: 10px;
    padding: 3px;
    margin: 12px 16px 0;
    align-self: stretch;
}

.survey-kw-mode-btn.active{
    background: var(--modal-bg, #fff);
    color: var(--text, #1e293b);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    font-weight: 600;
}


.survey-kw-presets-label{
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}


/* Business-type preset cards grid */


.survey-kw-presets .keyword-chips{
    padding: 0;
    justify-content: flex-start;
}


.survey-biz-preset-card.selected{
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 14px rgba(81, 162, 182, 0.18);
}


.survey-biz-preset-card.selected::after{
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    background: var(--primary) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/12px no-repeat;
    border-radius: 50%;
}

/* Preset chips in keyword picker use background highlight — no checkmark overlay */

.survey-kw-presets .survey-biz-preset-card.selected::after{ display: none; }


/* City quick-pick chips */


.modal-close{
    position: absolute;
    top: 12px;
    right: 16px;
    width: auto;
    height: auto;
    background: none;
    border: none;
    color: var(--c-gray-light);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}


.modal-close:hover{ color: var(--c-text-dim); }


.btn-primary{
    width: 100%;
    padding: 12px 20px;
    background: var(--grad-magenta-teal);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(201, 57, 163, 0.3);
}


.btn-primary:hover{
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(201, 57, 163, 0.4);
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


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


/* MapLibre Controls - Transparent Background */

.maplibregl-ctrl-group, .mapboxgl-ctrl-group{
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}


.maplibregl-ctrl-group button, .mapboxgl-ctrl-group button{
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}


.maplibregl-ctrl-group button:hover, .mapboxgl-ctrl-group button:hover{
    background: rgba(0, 0, 0, 0.05) !important;
}


.maplibregl-ctrl-group button:last-child, .mapboxgl-ctrl-group button:last-child{
    border-bottom: none !important;
}


.maplibregl-ctrl-icon, .mapboxgl-ctrl-icon{
    filter: invert(0) brightness(0.3);
    transition: filter 0.3s ease;
}


/* Multi-Select Dropdown (Landuse Filter) */


/* POI Filters Section */


/* Sidebar Header */


.sidebar-section{
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}


.sidebar-section-body{
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}


.sidebar-section-body.collapsed{
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}


/* Metrics Header (with visible count + eye toggle) */

/* Kept for backwards-compat but no longer rendered */


#metrics-visible-label{
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}


#metrics-visible-label strong{
    color: rgba(0, 0, 0, 0.7);
}


.composite-range-label{
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    font-variant-numeric: tabular-nums;
}


/* noUiSlider inside composite score block */

.composite-slider{
    margin: 0 4px 10px;
}


.composite-slider .noUi-connect{
    background: var(--c-teal);
}


.composite-slider .noUi-handle{
    width: 14px;
    height: 14px;
    border-radius: 50%;
    top: -5px;
    right: -7px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}


.composite-slider .noUi-handle::before, .composite-slider .noUi-handle::after{
    display: none;
}


/* Percentile quick-filter buttons */


.percentile-btn{
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.8);
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}


.percentile-btn:hover{
    border-color: var(--c-teal);
    color: var(--c-teal);
    background: rgba(81, 162, 182, 0.08);
}


.percentile-btn.active{
    background: var(--c-teal);
    border-color: var(--c-teal);
    color: var(--c-white);
}


/* Viewing status line */


/* Metric Filters sub-header */


.competitors-empty{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
}


.competitors-empty-text{
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
}


.competitors-add-btn{
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--primary-light-3, #b8d0ff);
    background: var(--primary-light, #ddeaff);
    color: var(--primary, #3a7cff);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}


.competitors-add-btn:hover{
    background: var(--primary-light-2, #c8daff);
    border-color: var(--primary, #3a7cff);
}


.competitors-content{
    padding: 8px 0 4px;
}


.competitors-chips-row{
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 16px 10px;
}


.competitors-chips{
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}


.competitor-chip{
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--primary-light, #ddeaff);
    border: 1px solid var(--primary-light-3, #b8d0ff);
    color: var(--primary-dark, #1a4fa8);
    white-space: nowrap;
}


.metric-group.open > .metric-group-header::before{
    transform: rotate(90deg);
}


.metric-group.open > .metric-group-body{
    max-height: 2000px;
}


/* Individual Metric Row */

.metric-row
{
    display: flex;
    grid-template-columns: 1fr 44px 56px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}


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


.metric-row-slider .range-slider{
    margin: 0;
}


.metric-row:hover .metric-row-remove{
    opacity: 1;
}


/* Composite Score Row (special) */

.metric-row.composite-score-row{
    background: rgba(81, 162, 182, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px 12px;
}


.metric-row.composite-score-row .metric-row-label{
    font-weight: 600;
    color: var(--c-teal);
}


/* Competitor POI section in metric groups */


.competitor-edit-btn{
    margin-left: auto;
    background: none;
    border: none;
    color: var(--c-teal);
    font-size: 10px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}


.competitor-edit-btn:hover{
    background: rgba(81, 162, 182, 0.12);
}


.metric-category-label{
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(0, 0, 0, 0.45);
    padding: 10px 4px 6px;
}


/* Select-only categories: reuse startup-section chrome in narrow sidebar */

#sidebar.lsb #metric-groups .sidebar-filter-section{
    margin: 8px 0 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

#metric-groups .sidebar-filter-section .metric-category-label.sidebar-filter-section-label{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 4px 6px;
}

#metric-groups .sidebar-filter-section .startup-section-body{
    margin: 0 10px 10px;
    padding: 0;
    border-top: none;
    border-radius: 12px;
    background: transparent;
    min-height: 0;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-cards{
    margin: 0 0 10px;
    gap: 8px;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card{
    margin: 0 0 8px;
    min-height: 76px;
    padding: 4px 8px 12px;
    gap: 8px;
    border: none;
    border-radius: 8px;
    background: #F8FAFC;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card-header{
    min-height: auto;
    padding: 6px 8px;
    gap: 4px;
    justify-content: flex-start;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .mc-icon{
    width: 16px;
    height: 16px;
    font-size: 13px;
    color: #94A3B8;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card-label{
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: var(--text);
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card-label--binary-toggle{
    margin: 0;
    padding: 0;
    border-radius: 0;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-info-btn{
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #CFD8E3;
    border-radius: 50%;
    background: #FFFFFF;
    color: #7E8DA1;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    padding: 0;
    box-shadow: none;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-info-btn:hover{
    color: #4E6078;
    border-color: #B6C3D3;
    background: #F8FBFD;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-binary-switch-wrap{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    cursor: pointer;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-binary-toggle-visual{
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--border-strong);
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-binary-toggle-visual.on{
    background: var(--primary);
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card-body,
#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card-body--always{
    margin-top: 0;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card-slider-wrap{
    padding: 0 0 8px;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-select{
    border-radius: 10px;
    border: none;
    background-color: #F2F4F8;
    color: #1F2937;
    min-height: 52px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    padding: 0 48px 0 28px;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(#F5F8FA, #F5F8FA),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c1.8-3.2 4.3-4.8 8-4.8S18.2 16.8 20 20'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2368B3C3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h18'/%3E%3Cpath d='M6 12h12'/%3E%3Cpath d='M10 20h4'/%3E%3Cline x1='15' y1='16' x2='21' y2='22'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center, left 8px center, right 15px center;
    background-size: 32px 32px, 14px 14px, 14px 14px;
}

#sidebar.lsb #metric-groups .sidebar-filter-section .metric-card .metric-flag-remove{
    width: 32px;
    height: 32px;
    border: 1px solid #D8E0E8;
    border-radius: 8px;
    background: #F5F8FA;
    color: #68B3C3;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 0;
}


.metric-cards{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}


.metric-card:hover{
    border-color: var(--border-strong);
}


.metric-card-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}


.metric-card--select .metric-card-header{
    cursor: default;
}


.metric-card--binary-select .metric-card-header--binary-select{
    flex-wrap: nowrap;
    cursor: default;
    gap: 8px;
}


.metric-card--binary-select .metric-card-label--binary-toggle{
    cursor: pointer;
    border-radius: 8px;
    margin: -4px -6px;
    padding: 4px 6px;
    transition: color 0.15s, background 0.15s;
}


.metric-card--binary-select .metric-card-label--binary-toggle:hover{
    background: rgba(0, 0, 0, 0.04);
}


.metric-card--binary-select.metric-card--binary-select-active .metric-card-label--binary-toggle{
    color: var(--c-teal);
    font-weight: 700;
}


.metric-card.expanded .metric-card-label{
    color: var(--c-teal);
}


.metric-card-body{
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}


.metric-card.expanded .metric-card-body, .metric-card-body--always{
    max-height: 200px;
}


.metric-card-slider-wrap{
    padding: 0 14px 14px;
}


/* Composite Score card pinned at top of METRIC FILTERS section */


.planning-commercial-section .metric-category-label{
    padding: 10px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(0, 0, 0, 0.45);
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}


.planning-commercial-cards{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    padding: 8px 12px 10px;
}


.planning-commercial-card.keyword-chip{
    font-size: 11px;
    padding: 4px 11px;
    font-weight: 600;
}


.metric-card--composite{
    border-color: var(--c-teal);
}


.composite-score-header{
    cursor: default;
}


.composite-reset-btn{
    padding: 2px 8px;
    font-size: 11px;
    flex-shrink: 0;
    margin-left: 4px;
}


/* 2-option categorical filter chips */

.metric-chips{
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 2px 14px 12px;
}


.metric-chip{
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.8);
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}


.metric-chip:hover{
    border-color: var(--c-teal);
    color: var(--c-teal);
    background: rgba(81, 162, 182, 0.08);
}


.metric-chip.active{
    background: rgba(81, 162, 182, 0.12);
    border-color: var(--c-teal);
    color: var(--c-teal);
    font-weight: 600;
}


/* Gradient slider track inside metric cards (matches map DISCRETE_PALETTE 1–5) */

.metric-gradient-slider.noUi-target{
    background: var(--grad-legend);
    height: 6px;
    border-radius: 4px;
    border: none;
    box-shadow: none;
}


.metric-gradient-slider .noUi-connect{
    background: transparent;
}


.metric-gradient-slider .noUi-handle, .metric-gradient-slider.noUi-horizontal .noUi-handle{
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    top: -7px !important;
    right: -9px !important;
    background: var(--c-white);
    border: 2px solid var(--c-teal) !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    cursor: grab;
}


.metric-gradient-slider .noUi-handle:active{
    cursor: grabbing;
}


.metric-gradient-slider .noUi-handle::before, .metric-gradient-slider .noUi-handle::after{
    display: none;
}


/* Context label prefix inside top-bar pills */


.map-top-bar-icon{
    flex-shrink: 0;
    color: var(--c-text);
}


.map-top-bar-pill:hover .map-top-bar-icon, .map-top-bar-pill[aria-expanded="true"] .map-top-bar-icon{
    color: var(--c-teal);
}


.map-top-bar-chevron{
    font-size: 12px;
    color: var(--c-text);
    opacity: 0.6;
    margin-left: 2px;
}


.map-popover[hidden]{
    display: none;
}


/* Competitors filter card uses standard metric-card styles + accent */


.metric-card--competitors .metric-card-label{
    color: var(--c-magenta);
}


.metric-card--flag{
    padding-bottom: 0;
}

.metric-card--flag .metric-card-header{
    padding: 10px 12px;
    cursor: default;
}

.metric-flag-remove{
    background: none;
    border: none;
    font-size: 13px;
    color: var(--c-text-dim);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    border-radius: 4px;
}

.metric-flag-remove:hover{
    color: var(--c-magenta);
    background: rgba(0,0,0,0.06);
}


.sidebar-header .close-btn{
    display: none;
}


/* Business Welcome Modal & Survey */


/* Survey Step Styles */

.survey-header{
    margin-bottom: 18px;
}


.survey-progress-bar
{
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
    width: 100%;
}


.survey-progress-fill
{
    height: 100%;
    background: var(--grad-teal-magenta);
    border-radius: 2px;
    transition: width 0.35s ease;
    min-width: 4px;
}


.survey-step-info
{
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: right;
}


.survey-question-text{
    font-size: 19px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 10px;
    line-height: 1.35;
}


.survey-disclaimer{
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 14px;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(201,57,163,0.06);
    border-left: 2px solid var(--c-magenta);
    border-radius: 0 6px 6px 0;
}


.survey-option.selected{
    background: rgba(201,57,163,0.08);
    border-color: var(--c-magenta);
    box-shadow: 0 0 0 2px rgba(201,57,163,0.2);
}


.survey-nav{
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}


.btn-survey-nav{
    padding: 8px 14px;
    border: 1px solid rgba(201,57,163,0.3);
    border-radius: 8px;
    background: rgba(201,57,163,0.06);
    color: rgba(0, 0, 0, 0.7);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}


.btn-survey-nav:hover{
    background: rgba(201,57,163,0.15);
    border-color: rgba(201,57,163,0.6);
    color: var(--c-text);
}


/* Survey checkpoint screen */


/* Live hex count in survey nav */


/* Business Criteria (Biz Focus) Section */

.biz-focus-section{
    padding: 10px 14px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}


.analysis-biz-focus{
    border-bottom: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 0;
}


.biz-focus-section-inner{
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.biz-focus-details > .biz-focus-rows{
    margin-top: 8px;
}


.biz-focus-title{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0,0,0,0.45);
}


.biz-focus-chip{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 8px;
    background: rgba(201,57,163,0.08);
    border: 1px solid rgba(201,57,163,0.32);
    border-radius: 20px;
    font-size: 11px;
    color: var(--c-text);
    cursor: pointer;
    transition: background 0.15s ease;
}


.biz-focus-chip:hover{ background: rgba(201,57,163,0.2); }


.biz-focus-empty{
    font-size: 11px;
    color: rgba(0,0,0,0.3);
    font-style: italic;
}


/* Raw / Advanced Filters Collapsible Toggle */


/* Biz Focus Rows (full question + answer) */

.biz-focus-rows{
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.biz-focus-row{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
}


.biz-focus-row-q{
    font-size: 11px;
    color: rgba(0,0,0,0.45);
    line-height: 1.3;
}


.biz-focus-row-a{
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}


.biz-inline-select{
    width: 100%;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(81,162,182,0.4);
    background: var(--c-white);
    color: var(--c-text);
    font-weight: 600;
    cursor: pointer;
}


.biz-focus-answer-val{
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text);
    flex: 1;
}


/* Answer popover for inline editing */


.popover-option.selected{
    background: rgba(81,162,182,0.12);
    color: var(--c-teal);
    font-weight: 600;
}


/* Business Type Picker in Survey */

.survey-biz-picker{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.survey-biz-sections{
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 4px;
    padding-bottom: 4px;
}

.survey-biz-sections::-webkit-scrollbar{
    width: 8px;
}

.survey-biz-sections::-webkit-scrollbar-track{
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.survey-biz-sections::-webkit-scrollbar-thumb{
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}


.survey-biz-footer{
    position: sticky;
    bottom: 0;
    background: var(--c-white);
    border-top: 1px solid var(--c-border-light);
    padding: 10px 0 4px;
    margin-top: 4px;
}


.survey-biz-footer .startup-footer-status.has-selection{
    color: var(--c-teal);
    font-weight: 600;
}


/* Loading/empty state inside picker */

.survey-city-none{
    font-size: 11px;
    color: rgba(0,0,0,0.5);
    font-style: italic;
    padding: 4px 0;
}


/* All picker steps: header/nav stay fixed-size, picker grows to fill */

.modal-content.city-mode{
    overflow: hidden;
}


.modal-content.city-mode .survey-header, .modal-content.city-mode .survey-step-icon, .modal-content.city-mode .survey-question-text, .modal-content.city-mode .survey-disclaimer, .modal-content.city-mode .survey-nav{
    flex-shrink: 0;
}


/* Onboarding step emoji icon */

.survey-step-icon{
    font-size: 36px;
    text-align: center;
    margin: 4px 0 8px;
    line-height: 1;
}


/* City search input */

.survey-city-toolbar{
    flex-shrink: 0;
    padding: 0 0 8px;
}

.survey-city-search{
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid var(--c-border-light);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.15s;
}

.survey-city-search:focus{
    border-color: var(--c-magenta);
    background: var(--c-white);
}


/* Keyword / competitors picker inside modal — inherit startup-sections scrolling */

/* Light theme overrides for new components */


/* Multi-select hint & edit mode badge */


/* Force readable option text inside the white survey modal */

.modal-content .survey-option, .modal-content .survey-option-label, .modal-content .startup-section-title, .modal-content .startup-section-counter, .modal-content .survey-city-none{
    color: rgba(0, 0, 0, 0.72);
}


.modal-content .survey-option.selected{
    color: var(--c-text);
}


/* ── Color Legend ── */

.map-color-control .control-group{
    min-width: 180px;
    max-width: 260px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 8px 12px 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.map-color-control .control-group label{
    font-size: 10px;
}

.map-color-control .filter-select{
    padding: 6px 10px;
    font-size: 12px;
}

.color-legend{
    position: relative;
    top: auto;
    left: auto;
    z-index: 400;
    background: var(--c-glass);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: auto;
    max-width: 200px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    pointer-events: auto;
}

/* Vertical 5-step discrete color legend (top = highest, bottom = lowest) */

.color-legend-steps{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-step{
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-step-swatch{
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.legend-step-label{
    font-size: 11px;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
}

.color-legend-description{
    font-size: 11px;
    color: var(--c-text-dim);
    margin-top: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-width: 160px;
}


/* ── Hex Value Tooltip ── */

.hex-value-tooltip{
    position: fixed;
    z-index: 500;
    background: var(--c-text);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: opacity 0.15s;
}


/* Title line inside tooltip (added by JS via <strong>) */

.hex-value-tooltip strong{
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
    font-size: 12.5px;
}


/* Right Panel (Top Locations) */


#right-panel::-webkit-scrollbar, #right-panel::-webkit-scrollbar-track, #right-panel::-webkit-scrollbar-thumb{
    width: 0;
    background: transparent;
}


/* Right panel toggle button */


.toggle-icon{
    font-size: 15px;
}


@keyframes toggle-nudge {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}


/* Right panel tab bar */


/* Score gradient legend in right panel */


.rp-legend-labels{
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}


.top-locations-list{
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.top-locations-empty{
    font-size: 13px;
    color: var(--c-text-dim);
    padding: 12px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.03);
}


/* Row 1: rank + name + score */

.top-locations-item-row{
    display: flex;
    align-items: center;
    gap: 10px;
}


.top-locations-item-rank{
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


.top-locations-item-title{
    flex: 1;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin: 0;
}


.top-locations-item-score{
    font-weight: 800;
    font-size: 15px;
    color: var(--primary);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}


/* Inline options for biz focus criteria */


.biz-focus-inline-opt.selected{
    background: rgba(201,57,163,0.15);
    color: var(--c-magenta);
    border-color: var(--c-magenta);
    font-weight: 600;
}


/* Disabled Ask AI survey checkpoint button */


/* ===== Claritina Copilot ===== */

.Claritina-fab{
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 5000;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(13,8,135,0.25);
    background: var(--c-white);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

.Claritina-fab:hover{
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.Claritina-fab.active{
    border-color: var(--c-copilot);
}

.Claritina-avatar{
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.Claritina-has-notification::after{
    content: '';
    position: absolute;
    top: 2px; right: 2px;
    width: 14px; height: 14px;
    background: var(--c-error-vivid);
    border-radius: 50%;
    border: 2px solid var(--c-white);
    animation: ClaritinaPulse 1.5s infinite;
}

@keyframes ClaritinaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}


.Claritina-panel{
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 5001;
    width: 320px;
    max-height: 420px;
    background: var(--c-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: ClaritinaSlideUp 0.25s ease;
}

.Claritina-panel.open{
    display: flex;
}

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


.Claritina-panel-header{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-divider);
    background: linear-gradient(135deg, #f8f7ff, var(--c-white));
}

.Claritina-panel-avatar{
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.Claritina-panel-name{
    font-weight: 700;
    font-size: 15px;
    color: var(--c-copilot-dark);
    flex: 1;
}

.Claritina-panel-close{
    background: none;
    border: none;
    font-size: 20px;
    color: var(--c-gray-light);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.Claritina-panel-close:hover{ color: var(--c-text-dim); }


.Claritina-panel-body{
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.Claritina-message{
    background: #f4f3ff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--c-text-dim);
}

.Claritina-message strong{
    display: block;
    margin-bottom: 4px;
    color: var(--c-copilot-dark);
}

.Claritina-message-new{
    animation: ClaritinaMessageIn 0.3s ease;
}

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


.Claritina-action-btn{
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: var(--c-copilot);
    color: var(--c-white);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.Claritina-action-btn:hover{ background: var(--c-copilot); }


.Claritina-highlight{
    outline: 3px solid var(--c-copilot) !important;
    outline-offset: 2px;
    animation: ClaritinaHighlightPulse 0.6s ease 2;
}

@keyframes ClaritinaHighlightPulse {
    0%, 100% { outline-color: var(--c-copilot); }
    50% { outline-color: var(--c-copilot-mid); }
}


/* Help button — reused for copilot toggle */

.tour-help-btn{
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(13,8,135,0.3);
    background: rgba(13,8,135,0.06);
    color: var(--c-copilot);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.tour-help-btn:hover{
    background: rgba(13,8,135,0.12);
    border-color: rgba(13,8,135,0.5);
}


@media (max-width: 600px) {
    .Claritina-fab {
        bottom: 16px;
        right: 16px;
        width: 48px; height: 48px;
    }
    .Claritina-avatar { width: 36px; height: 36px; }
    .Claritina-panel {
        bottom: 74px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: 60vh;
    }
}


/* ===== Journey Progress (in Claritina panel) ===== */

.Claritina-journey-progress{
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--c-divider);
}

.Claritina-journey-progress-bar{
    flex: 1;
    height: 6px;
    background: #e8e7f0;
    border-radius: 3px;
    overflow: hidden;
}

.Claritina-journey-progress-fill{
    height: 100%;
    background: linear-gradient(90deg, var(--c-copilot), var(--c-copilot-mid));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.Claritina-journey-label{
    font-size: 11px;
    color: var(--c-gray-mid);
    white-space: nowrap;
}


/* ===== Auth UI ===== */

.auth-user-area{
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--c-text-dim);
    position: relative;
}

.auth-avatar-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.auth-avatar-initials{
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.auth-dropdown-photo{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.auth-profile-text{
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}


.auth-modal{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6000;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
}

.auth-modal.active{ display: flex; }

.auth-modal-content{
    background: var(--c-white);
    border-radius: 16px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.auth-modal-content h3{
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--c-copilot-dark);
}

.auth-modal-content p{
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--c-gray-dim);
}

#telegram-login-container{
    min-height: 40px;
    display: flex;
    justify-content: center;
}

.auth-telegram-container{
    min-height: 40px;
    display: flex;
    justify-content: center;
}

.auth-providers{
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 4px;
}

.auth-google-btn{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: #ffffff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.15s, background 0.15s;
}

.auth-google-btn:hover{
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.auth-google-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285F4 0%, #EA4335 50%, #FBBC05 75%, #34A853 100%);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.auth-divider{
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--c-gray-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before, .auth-divider::after{
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.08);
}

.auth-error{
    margin-top: 14px;
    padding: 8px 12px;
    background: #fdecea;
    color: #b3261e;
    border-radius: 4px;
    font-size: 13px;
}


/* ===== Favorites Button ===== */


.btn-fav{
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: transform 0.15s;
}

.btn-fav:hover{ transform: scale(1.15); }

.btn-fav.active{ animation: favPop 0.3s ease; }

@keyframes favPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}


/* ===== Favorites Panel ===== */

.favorites-panel.open{ right: 0; }

.favorites-list{
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.favorites-empty{
    text-align: center;
    color: var(--c-gray-light);
    font-size: 13px;
    padding: 24px 12px;
}

.favorites-item-info{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.favorites-biz{ color: var(--c-text-light); }

.favorites-hex{ color: var(--c-gray-light); font-size: 11px; font-family: var(--font-mono); }

.favorites-item-actions{
    display: flex;
    gap: 4px;
}

.btn-fav-fly, .btn-fav-remove{
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.btn-fav-remove:hover{ background: rgba(229,62,62,0.1); }


@media (max-width: 600px) {
    .favorites-panel {
        width: 100%;
        right: -100%;
        border-radius: 0;
        top: 50px;
    }
    .auth-modal-content { padding: 24px 16px; }
}


/* Site Footer */

.site-footer{
    text-align: center;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--c-gray-light);
    background: transparent;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
}


.keyword-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyword-overlay.hidden{ display: none; }

.keyword-overlay-inner{
    background: rgba(255, 255, 255, 0.97);
    color: var(--c-text);
    border-radius: 14px;
    padding: 28px 32px 20px;
    max-width: 640px;
    width: 92vw;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    position: relative;
}

.keyword-overlay-close{
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--c-gray-light);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.keyword-overlay-close:hover{ color: var(--c-text-dim); }

.keyword-picker-subtitle{
    font-size: 0.82rem;
    color: var(--c-gray-dim);
    margin-bottom: 16px;
}

.keyword-chips{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 4px 0;
}

.keyword-picker-actions .btn-secondary{
    background: var(--c-input-bg);
    color: var(--c-text-light);
    border: 1px solid var(--c-border);
}

.keyword-picker-actions .btn-secondary:hover{ background: var(--c-hover); }

.keyword-picker-actions .btn-primary{
    background: var(--c-teal);
    color: var(--c-white);
    font-weight: 600;
}

.keyword-picker-actions .btn-primary:hover{ background: var(--c-teal-mid); }

#keyword-count-badge{
    font-size: 0.78rem;
    background: rgba(255,255,255,0.35);
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}


.startup-window{
    padding: 28px 28px 0;
}

.startup-toolbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.startup-ai-btn
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--c-teal);
    color: var(--c-white);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 2px 8px rgba(81, 162, 182, 0.25);
}

.startup-ai-btn:hover
{
    background: var(--c-teal-mid);
}

.startup-expand-btn{
    background: none;
    border: none;
    color: rgba(0,0,0,0.5);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 0;
}

.startup-expand-btn:hover{
    color: var(--c-teal);
}


/* Sections container */

.startup-sections{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 72px;
}


/* Section card (<details>) */


/* Section header (summary) */

.startup-section-header::-webkit-details-marker{ display: none; }

.startup-section-header::marker{ display: none; }


.startup-section-icon{
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.startup-section-info{
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.startup-section-chevron{
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    position: relative;
}

.startup-section-chevron::after{
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(0,0,0,0.35);
    border-bottom: 2px solid rgba(0,0,0,0.35);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.startup-section[open] .startup-section-chevron::after{
    transform: rotate(-135deg);
    top: 6px;
}


/* Section body */

.startup-section-body{
    padding: 0 16px 16px;
    border-top: 1px solid var(--c-border-light);
}

/* In business picker: limit expanded body height and scroll */

.survey-biz-picker .startup-section-body{
    max-height: 40vh;
    overflow-y: auto;
}

.survey-biz-picker .startup-section{
    overflow: visible;
}


/* Sub-groups */

.startup-subgroup{
    padding-top: 12px;
}

.startup-subgroup-label{
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0,0,0,0.45);
    font-weight: 600;
    margin-bottom: 6px;
}

.startup-subgroup-note{
    font-size: 0.72rem;
    color: rgba(0,0,0,0.35);
    font-style: italic;
    margin-bottom: 6px;
}


/* Items — reuses .keyword-chips / .keyword-chip from competition picker */

.startup-subgroup .keyword-chips{
    justify-content: flex-start;
    padding: 4px 0;
}


/* Sticky footer */

.startup-footer{
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--c-border);
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.startup-footer-status{
    flex: 1;
    font-size: 0.82rem;
    color: rgba(0,0,0,0.45);
}

.startup-reset-btn{
    background: none;
    border: none;
    color: rgba(0,0,0,0.45);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 6px 0;
    white-space: nowrap;
}

.startup-reset-btn:hover{
    color: var(--c-text);
}

.startup-apply-btn{
    flex-shrink: 0;
    padding: 10px 24px;
    border-radius: 8px;
    background: var(--c-teal);
    color: var(--c-white);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.startup-apply-btn:hover{
    background: var(--c-teal-mid);
}


/* Mobile tweaks for startup window */

@media (max-width: 600px) {
    .startup-window {
        padding: 20px 16px 0;
    }
    .startup-subgroup .keyword-chips {
        gap: 6px;
    }
    .startup-section-header {
        gap: 8px;
        padding: 12px;
    }
    .startup-section-icon svg {
        width: 28px;
        height: 28px;
    }
}


#competition-count-badge{
    font-size: 0.78rem;
    background: rgba(255,255,255,0.35);
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}


#active-filters{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.metric-filter-card.color-active{
    border-color: var(--c-teal);
    box-shadow: 0 0 0 1px var(--c-teal) inset;
}


/* Light theme overrides for new components */

.metric-filter-card.color-active .metric-filter-color-icon{ opacity: 1; }

.prefer-btn.active{
    background: var(--c-teal);
    color: var(--c-white);
    border-color: var(--c-teal);
    font-weight: 600;
}

.metric-filter-slider .range-slider{
    margin: 4px 0;
}

.metric-filter-slider .range-input{
    width: 60px;
    font-size: 0.75rem;
    padding: 2px 4px;
    background: var(--c-input-bg);
    border: 1px solid var(--c-border);
    color: var(--c-text-dim);
    border-radius: 4px;
    text-align: center;
}

.metric-filter-card.prefer-low .noUi-connect{
    background: var(--grad-legend-rev);
}


#color-by-label{
    font-size: 0.78rem;
    color: var(--c-gray-mid);
    padding: 2px 8px;
    margin-bottom: 2px;
}


/* Biz Config City Chips (Figma style) */

.biz-city-area{
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.biz-city-chips{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.biz-city-chip{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 16px;
    background: rgba(81, 162, 182, 0.1);
    border: 1px solid rgba(81, 162, 182, 0.3);
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text);
    white-space: nowrap;
}

.biz-city-chip-remove{
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.35);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.biz-city-chip-remove:hover{ color: var(--c-error-soft); }

.biz-city-add-wrapper{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.biz-city-add-btn{
    background: none;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--c-teal);
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-start;
}

.biz-city-add-btn:hover{
    border-color: var(--c-teal);
    background: rgba(81, 162, 182, 0.05);
}

.biz-city-search-wrapper{
    position: relative;
}


.city-search-input{
    width: 100%;
    padding: 5px 8px;
    font-size: 0.8rem;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-input-bg);
    color: var(--c-text);
    outline: none;
}

.city-search-input:focus{ border-color: var(--c-teal); }

.city-search-dropdown{
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.city-search-option{
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--c-text);
}

.city-search-option:hover{
    background: var(--c-hover);
}


/* ══════════════════════════════════════════════════════════════
   ONBOARDING MODAL — MOBILE SMALL-SCREEN COMPATIBILITY
   Targets: ≤768px (tablet) and ≤480px (phone / bottom-sheet)
   ══════════════════════════════════════════════════════════════ */


/* ── Tablet: tighten spacing, keep desktop layout ── */

@media (max-width: 768px) {
    .modal-content {
        padding: 20px 20px 14px;
    }
    .survey-step-icon {
        font-size: 28px;
        margin: 2px 0 6px;
    }
    .survey-question-text {
        font-size: 17px;
    }
    .survey-header {
        margin-bottom: 12px;
    }
    /* Cap section bodies tighter so accordion doesn't push nav off screen */
    .survey-biz-picker .startup-section-body {
        max-height: 32vh;
    }
}


/* ── Phone: bottom-sheet layout + compact density ── */

@media (max-width: 480px) {
    /* Slide up from bottom edge instead of centering */
    .modal.active {
        align-items: flex-end;
    }
    .modal-content {
        width: 100vw;
        max-width: 100vw;
        border-radius: 16px 16px 0 0;
        padding: 16px 16px 10px;
        max-height: 92vh;
    }
    /* Header/nav stay fixed-size; all steps now get city-mode class */
    .modal-content .survey-header,
    .modal-content .survey-step-icon,
    .modal-content .survey-question-text,
    .modal-content .survey-disclaimer,
    .modal-content .survey-nav {
        flex-shrink: 0;
    }
    .survey-header {
        margin-bottom: 8px;
    }
    .survey-step-icon {
        font-size: 24px;
        margin: 0 0 4px;
    }
    .survey-question-text {
        font-size: 15px;
        margin-bottom: 6px;
    }
    .survey-disclaimer {
        font-size: 11px;
        padding: 6px 10px;
        margin-bottom: 8px;
    }
    /* Business type grid: always 2 columns on phone */
    .survey-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 10px;
    }
    .survey-option {
        padding: 10px 6px;
        min-height: 64px;
    }
    .survey-option-icon { font-size: 18px; }
    .survey-option-label { font-size: 11px; }
    /* Navigation bar */
    .survey-nav {
        gap: 6px;
        margin-bottom: 8px;
    }
    .btn-survey-nav {
        font-size: 12px;
        padding: 8px 12px;
    }
    /* Accordion section headers: less vertical padding */
    .modal-content .startup-section-header {
        padding: 10px 12px;
    }
    /* Cap section bodies tighter */
    .survey-biz-picker .startup-section-body {
        max-height: 28vh;
    }
    /* City search input */
    .survey-city-search {
        font-size: 13px;
        padding: 7px 10px;
    }
    /* Close button repositioned for bottom-sheet */
    .modal-close {
        top: 10px;
        right: 14px;
    }
}


/* ===== Analysis Popup Overlay ===== */


.analysis-popup{
    /* Scoped tokens: muted icon/label color used by header controls */
    --c-popup-muted: rgba(0, 0, 0, 0.45);

    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    /* Above sidebar (999), top panel (1000), favorites (4000), Claritina (5001) */
    z-index: 5500;
    background: var(--c-white);
    border: 1px solid var(--c-border-light);
    border-radius: var(--radius-card);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 2px 10px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Slide-in from right; default = off-screen */
    transform: translateX(calc(100% + 24px));
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}


.analysis-popup.analysis-popup--open{
    transform: translateX(0);
}


.analysis-popup[hidden]{
    display: none !important;
}


.analysis-popup-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--c-glass);
    border-bottom: 1px solid var(--c-border-light);
    flex-shrink: 0;
    gap: 12px;
}


.analysis-popup-title{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    min-width: 0;
}


.analysis-popup-icon{
    font-size: 17px;
}


.analysis-popup-location-info{
    font-size: 12px;
    font-weight: 400;
    color: var(--c-popup-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.analysis-popup-header-actions{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}


.analysis-popup-standalone-link, .analysis-popup-close{
    color: var(--c-popup-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}


.analysis-popup-standalone-link:hover, .analysis-popup-close:hover{
    background: var(--c-hover);
    color: var(--c-text);
}


.analysis-popup-close{
    width: 30px;
    height: 30px;
    font-size: 22px;
    line-height: 1;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}


.analysis-popup-body{
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
}


/* Override page-absolute positioning when layout lives inside popup */

.analysis-popup #page-analysis, .analysis-popup .analysis-popup-body > .analysis-layout{
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 0;
    height: auto;
}


.analysis-popup .analysis-popup-body > .analysis-layout{
    gap: 12px;
}


.analysis-popup #analysis-map{
    height: 42vh;
    min-height: 340px;
}


@media (max-width: 600px) {
    .analysis-popup {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .analysis-popup #analysis-map {
        height: 34vh;
        min-height: 240px;
    }
}

/* ===== /Analysis Popup Overlay ===== */


/* ── Analysis popup: enhanced header (demo rm-header style) ── */

.analysis-popup .rm-header{
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
    background: var(--c-white);
}


.rm-title{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}


.rm-loc{
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Business type badge */


.rm-biz-badge:empty{ display: none; }


/* Share button + dropdown */

.rm-share-wrap{
    position: relative;
}


.rm-share-btn{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-white);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}


.rm-share-btn:hover{
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light-2);
}


.rm-share-dropdown{
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--c-white);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    min-width: 150px;
    z-index: 5600;
    display: none;
    padding: 4px 0;
}


.rm-share-dropdown.open{ display: block; }


.rm-share-item{
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
    transition: background 0.12s;
}


.rm-share-item:hover{
    background: var(--primary-light-2);
    color: var(--primary);
}


/* AI empty state in analysis right column */

.rm-ai-empty{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 20px;
    gap: 8px;
}


/* Shared btn-secondary (already used for transport buttons, extend here) */

.btn-secondary
{
    background: var(--c-white);
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}


.btn-secondary:hover:not(:disabled){
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light-2);
}


.btn-secondary:disabled{
    opacity: 0.45;
    cursor: not-allowed;
}


/* Ensure [hidden] overrides display:flex on panel divs */

.area-overview-panel[hidden], .top-locations-panel[hidden]{
    display: none !important;
}


.ao-back-btn{
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    align-self: flex-start;
    margin-bottom: 2px;
}


.ao-back-btn:hover{ color: var(--primary); }


.ao-title{
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}


.ao-score-card{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
}


.ao-score-icon{
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}


.ao-score-text{ display: flex; flex-direction: column; gap: 2px; }


.ao-score-value{
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}


.ao-score-of{
    font-weight: 600;
    color: var(--text);
}


.ao-rows{
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.ao-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text);
}


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

.ao-row-value{ font-weight: 700; color: var(--text); }

.ao-empty{ font-size: 12px; }


.ao-row.ao-row-block{
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}


.ao-keywords{
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.ao-kw-row{
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 4px 0;
}


.ao-kw-icon{
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}


.ao-kw-icon.pass{ background: #62B97D; }

.ao-kw-icon.fail{ background: #E58A8A; }

.ao-kw-icon.unknown{ background: var(--text-tertiary); }


.ao-kw-row.fail .ao-kw-label{ color: var(--text-tertiary); }

.ao-kw-label{ font-weight: 500; color: var(--text); }


/* Neighborhood card */

.ao-neighborhood-name{
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}


.ao-neighborhood-desc{
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 8px;
}


.ao-commercial-badge{
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill, 20px);
    white-space: nowrap;
}


/* Keyword row actual value */

.ao-kw-value{
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}


#sidebar
{
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: var(--card-bg);
    backdrop-filter: none;
    border-right: 1px solid var(--border);
    z-index: 50;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}


.lsb-top
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--card-bg);
}


.lsb-new-search
{
    background: var(--counter-bg);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    color: var(--c-text);
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}


.lsb-new-search:hover
{
    background: var(--border-strong);
    border-color: var(--primary);
    color: var(--text);
    border: none;
}


/* ALL-CAPS sidebar section labels — unify with .lsb-metrics-label */

.sidebar-section-title, #sidebar .metric-category-label{
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: transparent;
    border: none;
    padding: 18px 0 10px;
}


.metric-filters-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 18px 8px;
}


.metric-filters-edit-btn
{
    background: none;
    border: none;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}


.metric-filters-edit-btn:hover
{
    background: var(--primary-light-2);
}


/* COLORING <select> → pill dropdown look */


/* Composite score & metric cards */

.composite-score-cards
{
    padding: 0 18px 4px;
}


.metric-card
{
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding-bottom: 4px;
    border-color: var(--border);
}


.metric-card.expanded
{
    border-color: var(--primary);
}


.metric-card-label
{
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}


.metric-card-range
{
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light-2);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}


.metric-groups
{
    padding: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* Planning suitability — keep current visual unchanged (only normalize container spacing) */


/* noUiSlider — solid primary (replaces rainbow gradient) */

.metric-gradient-slider.noUi-target, .composite-slider.noUi-target{
    background: var(--counter-bg);
    height: 6px;
    border-radius: 5px;
    border: none;
    box-shadow: none;
}


.metric-gradient-slider .noUi-connect, .composite-slider .noUi-connect{
    background: var(--primary);
}


.metric-gradient-slider .noUi-handle, .metric-gradient-slider.noUi-horizontal .noUi-handle, .composite-slider .noUi-handle{
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    top: -7px !important;
    right: -9px !important;
    background: #fff;
    border: 2.5px solid var(--primary) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
    cursor: grab;
}


.metric-gradient-slider .noUi-handle:active, .composite-slider .noUi-handle:active{
    cursor: grabbing;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}


#right-panel.open
{
    transform: translateX(0);
}


#right-panel:not(.open){
    transform: translateX(calc(100% + 24px));
}


#right-panel .filter-section
{
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}


/* Tab bar — segmented-control look */


.top-locations-panel
{
    padding-top: 0;
}


.rp-legend
{
    margin-bottom: 16px;
}


.rp-legend-bar
{
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #FEF3C7 0%, #FCD34D 35%, #F59E0B 65%, #DC2626 100%);
    margin-bottom: 6px;
}


.top-locations-subtitle
{
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px;
}


.top-locations-item.top-locations-item--active
{
    box-shadow: 0 4px 12px var(--primary-tint);
}


/* Area Overview — already aligned with designer; minor tightening */


.ao-similar-btn
{
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}


.ao-similar-btn:hover
{
    background: var(--primary-light-2);
    border-color: var(--primary);
    color: var(--primary);
}


.ao-report-btn
{
    background: var(--primary);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 2px 10px var(--primary-tint);
}


.ao-report-btn:hover
{
    background: var(--primary-hover);
    box-shadow: 0 4px 14px var(--primary-tint);
}


/* Right-panel toggle — relocate for floating panel */

#right-panel.open + .right-panel-toggle
{
    right: 372px;
    animation: none;
}


.right-panel-toggle
{
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: var(--primary);
    color: var(--c-white);
    border: none;
    border-radius: 24px 0 0 24px;
    padding: 10px 14px 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: -2px 0 12px var(--primary-tint);
    display: flex;
    align-items: center;
    gap: 5px;
    animation: toggle-nudge 3s ease-in-out 2s 3;
}


.right-panel-toggle:hover
{
    background: var(--primary-hover);
    box-shadow: -2px 0 18px var(--primary-tint);
}


/* ---------- UNIFIED ELEMENT CLASSES (cross-block) ---------- */

/* .info-card / .hi-stat-row / .hi-section-title — single source of truth */


/* Sidebar now owns the brand → repurpose #top-panel as a floating right-side controls bar */


/* Brand is in left sidebar now — hide here */

.top-panel-header{
    display: none !important;
}


/* Viewport badge — pill */

.viewport-coverage-badge
{
    background: var(--counter-bg);
    color: var(--counter-text);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid var(--border);
}


/* Perfect-score toggle — pill */


/* AI Analysis button — primary CTA */

.btn-ai-analysis
{
    align-self: center;
    margin-left: auto;
    padding: 8px 14px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px var(--primary-tint);
}


.btn-ai-analysis:hover{
    background: var(--primary-hover);
    box-shadow: 0 3px 12px var(--primary-tint);
}


/* Favorites — circular icon button */

.btn-favorites, .tour-help-btn{
    background: var(--counter-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: var(--text);
}


.btn-favorites:hover, .tour-help-btn:hover{
    background: var(--primary-light-2);
    border-color: var(--primary);
}


.auth-login-btn
{
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-btn);
    border: 1.5px solid rgba(13,8,135,0.3);
    background: var(--primary);
    transition: background 0.15s;
}


.auth-login-btn:hover
{
    background: var(--primary-hover);
}


.auth-avatar-btn
{
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--primary-light);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
    color: var(--primary);
    font-weight: 700;
}


.auth-avatar-btn:hover
{
    box-shadow: 0 0 0 3px rgba(13,8,135,0.18);
    border-color: var(--primary);
}


/* Biz config + Competitors pills bar — restyle to designer */

.map-top-bar
{
    position: fixed;
    /* Designer: compact top row to the right of the color selector */
    top: 16px;
    left: 588px;
    right: auto;
    transform: none;
    z-index: 850;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    pointer-events: none;
}


.map-top-bar-pills
{
    display: flex;
    align-items: stretch;
    background: var(--card-bg);
    backdrop-filter: none;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    pointer-events: auto;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
}


.map-top-bar-pill
{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}


.map-top-bar-pill:hover, .map-top-bar-pill[aria-expanded="true"]
{
    background: var(--primary-light-2);
    color: var(--primary);
}


.map-top-bar-icon, .map-top-bar-pill:hover .map-top-bar-icon, .map-top-bar-pill[aria-expanded="true"] .map-top-bar-icon{
    color: inherit;
}


.map-top-bar-divider
{
    width: 1px;
    background: var(--border);
    align-self: stretch;
    margin: 6px 0;
}


.tb-label
{
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 12px;
    margin-right: -4px;
}


/* ---------- BLOCK 5: PROFILE PANEL (auth-* polish) ---------- */

.auth-profile-dropdown
{
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    min-width: 240px;
    z-index: 5000;
    padding: 6px;
    margin-top: 8px;
}


.auth-profile-info
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: var(--counter-bg);
    margin-bottom: 4px;
}


.auth-dropdown-name
{
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.auth-dropdown-email
{
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.auth-dropdown-divider
{
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}


.auth-dropdown-item
{
    display: flex;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    background: transparent;
    border: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 8px;
    font-weight: 500;
    align-items: center;
    gap: 8px;
}


.auth-dropdown-item:hover
{
    background: var(--primary-light-2);
    color: var(--primary);
}


.auth-dropdown-logout
{
    color: #d32f2f;
}


.auth-dropdown-logout:hover{
    background: #fde8e8;
    color: #b02020;
}


/* AI Generate button relocated to header (.rm-h-right) */

.rm-ai-btn, .btn-ai-analysis-prominent{
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--primary-tint);
    transition: background 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


.rm-ai-btn:hover, .btn-ai-analysis-prominent:hover{
    background: var(--primary-hover);
    box-shadow: 0 3px 14px var(--primary-tint);
}


/* Hide the now-empty action row (biz-type label is duplicated in header badge) */

/* Scope to popup only — analysis.html standalone page still uses inline biz type */

.analysis-popup .analysis-action-row
{
    position: sticky;
    top: 0;
    padding: 0;
    margin-bottom: 12px;
    border: none;
    background: transparent;
}


.analysis-popup .analysis-biz-type-ctrl{
    display: none; /* duplicate of #analysis-popup-biz-badge in header */
}


/* Report modal header — designer spacing */

.analysis-popup-header.rm-header{
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    gap: 12px;
}


.rm-h-left
{
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}


.rm-h-right
{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}


.rm-biz-badge
{
    display: inline-block;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}


.analysis-popup-close.rm-close{
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}


.analysis-popup-close.rm-close:hover{
    background: var(--counter-bg);
    color: var(--text);
}


.modal-content
{
    background: var(--modal-bg);
    color: var(--text);
    border: none;
    border-radius: var(--radius-modal);
    padding: 0;
    max-width: 720px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-modal);
    animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}


.modal-content h2
{
    font-size: 32px;
    font-weight: 700;
    background: var(--grad-magenta-teal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    color: var(--text);
}


.modal-content > p
{
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}


.modal-content .survey-question-text
{
    padding: 0 32px;
    margin-top: 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text);
}


.modal-content .survey-disclaimer
{
    padding: 0 32px;
    color: var(--text-tertiary);
}


/* ---------- BLOCK 8: SEARCH HISTORY MODAL (.sh-*) ---------- */

.sh-modal{
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}


.sh-modal-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}


.sh-modal-content{
    position: relative;
    background: var(--modal-bg);
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-modal);
    width: min(680px, 92vw);
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.sh-modal-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}


.sh-modal-title{
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}


.sh-modal-close{
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}


.sh-modal-close:hover{
    background: var(--counter-bg);
    color: var(--text);
}


.sh-panel{
    overflow-y: auto;
    padding: 16px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* Empty / loading placeholders */

.sh-empty, .sh-loading{
    padding: 28px 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}


/* Search row */


.sh-search-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}


.sh-search-name{
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.sh-delete-btn{
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.sh-delete-btn:hover{
    background: #fde8e8;
    color: #b02020;
}


.sh-search-meta{
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}


.sh-bookmark-count{
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}


.sh-bookmarks{
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.sh-load-bookmarks-btn{
    background: var(--counter-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-btn);
    padding: 7px 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
}


.sh-load-bookmarks-btn:hover{
    background: var(--primary-light-2);
    border-color: var(--primary);
    color: var(--primary);
}


.sh-bk-hex{
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}


.sh-bk-report-badge{
    color: var(--primary);
}


.sh-bk-open-btn{
    background: var(--primary);
    color: #fff !important;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}


.sh-bk-open-btn:hover{
    background: var(--primary-hover);
}


.sh-bk-remove-btn{
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}


.sh-bk-remove-btn:hover{
    background: #fde8e8;
    color: #b02020;
}


/* Brand logo: support <img> in .lsb-logo (drop solid M box) */

.lsb-logo
{
    width: 30px;
    height: 30px;
    background: transparent !important;
    border-radius: 8px;
    display: block;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    object-fit: contain;
}

img.lsb-logo{
    width: 30px;
    height: 30px;
    padding: 0;
    box-shadow: none;
}


/* Top panel reduced to designer's profile-panel cluster */

#top-panel
{
    position: fixed;
    top: 16px !important;
    left: auto !important;
    right: 16px !important;
    height: auto;
    background: transparent !important;
    backdrop-filter: none;
    border-bottom: none !important;
    z-index: 200;
    padding: 0 !important;
    transition: background 0.3s ease, border-color 0.3s ease;
    -webkit-backdrop-filter: none;
    border: none !important;
    border-radius: 14px;
    box-shadow: none !important;
    width: auto !important;
}


.top-panel-content
{
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px !important;
    padding-bottom: 0;
    justify-content: flex-end;
    padding: 0 !important;
}


.top-panel-controls
{
    display: flex;
    gap: 8px !important;
    align-items: center;
    flex: 0 0 auto;
}


/* Drop elements that don't exist in the designer's design */

#top-panel #viewport-coverage-badge, #top-panel .perfect-toggle, #top-panel #go-analysis-btn, #top-panel #tour-help-btn{
    display: none !important;
}


/* Map extends full height — no top panel bar consuming space */

#map
{
    position: absolute;
    top: 0 !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh !important;
    z-index: 0;
}


/* 5/5 toggle row inside sidebar */

.lsb-perfect-row{
    padding: 10px 16px 4px;
    display: flex;
    align-items: center;
}


.lsb-perfect-row .perfect-toggle{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--counter-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all 0.15s;
}


.lsb-perfect-row .perfect-toggle:hover{
    background: var(--primary-light-2);
    border-color: var(--primary);
    color: var(--primary);
}


.lsb-perfect-row .perfect-toggle:has(input:checked){
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}


/* Favorites → match designer's .pp-bm-btn (white card, 42×42, rounded) */


/* Login button → designer's .btn-login pill */

#top-panel .auth-login-btn{
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(68, 182, 197, 0.3);
}

#top-panel .auth-login-btn:hover{
    background: var(--primary-hover);
}


/* Avatar → designer's .pp-trigger (white card with rounded radius) */

#top-panel .auth-avatar-btn{
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.2s;
}

#top-panel .auth-avatar-btn:hover{
    border-color: var(--primary);
}


/* Hide all custom tooltips */

.filter-tooltip, .hex-value-tooltip{ display: none !important; }


/* Sticky "Full report" footer inside AI description col */

.ai-col-footer{
    margin-top: auto;
    padding: 12px 0 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    bottom: 0;
    background: var(--c-glass, #f8fafc);
}


.ai-col-full-report-btn{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: var(--primary, #0d0887);
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: opacity 0.15s;
}

.ai-col-full-report-btn:hover{ opacity: 0.88; }


/* Override panel padding — now handled by ao-scroll-area */

.area-overview-panel
{
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    overflow-y: hidden;
    flex: 1;
    padding-top: 0;
    overflow: hidden !important;
}


/* Scrollable inner area */

.ao-scroll-area{
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* Sticky footer: two buttons always visible side by side */

.ao-footer-actions{
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    margin-top: 6px;
    padding: 8px 18px 10px;
    border-top: 1px solid var(--border);
    background: var(--panel-bg, #fff);
}


.ao-footer-actions .ao-similar-btn, .ao-footer-actions .ao-report-btn{
    flex: 1;
    padding: 12px 8px;
    font-size: 13px;
    border-radius: 10px;
}

.ao-footer-actions .ao-report-btn{
    width: 100%;
}

body.right-panel-open .maplibregl-ctrl-top-right,
body.right-panel-open .mapboxgl-ctrl-top-right{
    right: 360px;
}

body.right-panel-open .maplibregl-ctrl-bottom-right,
body.right-panel-open .mapboxgl-ctrl-bottom-right{
    right: 360px;
}


/* Title row: bookmark button + h2 on one line */

.ao-title-row{
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px 0;
}


.ao-title-row .ao-title{ margin: 0; }


.ao-bookmark-btn{
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    transition: transform 0.15s;
}


.ao-bookmark-btn:hover{ transform: scale(1.15); }


/* Commercial suitability: badge only, no label row */

.ao-commercial-row
{
    margin-top: 8px;
    align-items: center;
}


/* Move legend to be tighter to the sidebar top-left corner */

.map-color-control
{
    position: fixed;
    top: 80px !important;
    left: 368px !important;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
}


/* Give the "Colored by: …" label a proper framed card so it's readable over the map */

#color-by-label:not(:empty){
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text, #333);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14);
    white-space: nowrap;
    display: inline-block;
}


/* Normalize Planning Suitability — remove distinctive card box so it matches
   other filter sections (flat, no border/background) */

.planning-commercial-section
{
    margin: 0 0 4px !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border-color: var(--border);
}


@media (max-width: 767px) {
    .map-color-control {
        top: 80px !important;
        left: 12px !important;
    }
}


/* ───────────────────────────────────────────────────────────────────
   District-lock UI (two-phase loading: experiment/new-interface)
   - Other districts in the city picker show as unavailable while the
     user is locked to their initial district.
   ─────────────────────────────────────────────────────────────────── */

.startup-section--unavailable .startup-section-header{
    cursor: default;
}

.startup-section--unavailable .keyword-chip{
    cursor: not-allowed;
}

.district-lock-badge{
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(0,0,0,0.45);
    background: rgba(0,0,0,0.07);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}


/* Auth: small toast shown after Google popup closes while backend
   exchange completes. Replaces the heavy login modal so the user can
   start interacting with the map immediately. */

.auth-session-loading{
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    background: var(--c-white, #fff);
    color: var(--c-text, #1a1a1a);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
    border: 1px solid var(--c-border, rgba(0,0,0,0.12));
}


/* Search-history: per-search "Open" button (restores onboarding answers
   without selecting a hex). Lives in the search row header next to the
   delete (×) button. */

.sh-search-header .sh-open-search-btn{
    margin-left: auto;
    margin-right: 6px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-teal, #51A2B6);
    background: var(--c-teal-light, rgba(81, 162, 182, 0.15));
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sh-search-header .sh-open-search-btn:hover{
    background: var(--c-teal, #51A2B6);
    color: #fff;
}


#sidebar.lsb{
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 319px;
    background: #fff;
    border-right: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: opacity .5s ease .2s, transform .5s ease .2s;
}


body.results #sidebar.lsb{
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}


#sidebar.lsb .lsb-top{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    min-height: 64px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: #fff;
}


#sidebar.lsb .lsb-logo, #sidebar.lsb img.lsb-logo{
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
}


#sidebar.lsb .lsb-brand{
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.01em;
    flex: 1;
    color: var(--text);
}


#sidebar.lsb .lsb-new-search{
    background: var(--counter-bg);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}


#sidebar.lsb .lsb-new-search:hover{
    background: var(--border-strong);
}


#sidebar.lsb .lsb-scroll{
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    padding-bottom: 18px;
}


#sidebar.lsb .lsb-scroll::-webkit-scrollbar{ width: 5px; }

#sidebar.lsb .lsb-scroll::-webkit-scrollbar-thumb{
    background: var(--border-strong);
    border-radius: 3px;
}


#sidebar.lsb .lsb-perfect-row{
    padding: 16px 16px 0;
}


#sidebar.lsb .lsb-star-toggle{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex: 0 0 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    gap: 10px;
    align-self: stretch;
    border-radius: 12px;
    border: 1px solid var(--slate-200, #E2E8F0);
    background: var(--white, #FFF);
    cursor: pointer;
}


#sidebar.lsb .lsb-star-toggle-label{
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}


#sidebar.lsb .lsb-hidden-checkbox{
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}


.toggle-switch{
    width: 36px;
    height: 20px;
    background: var(--border-strong);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}


.toggle-switch.on{ background: var(--primary); }


.toggle-thumb{
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}


.toggle-switch.on .toggle-thumb{ left: 18px; }


#sidebar.lsb .lsb-metrics-label{
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: .06em;
    line-height: 24px;
    padding: 0;
}


#sidebar.lsb .planning-commercial-section{
    border: none !important;
    background: transparent !important;
    margin: 24px 0 0 !important;
    padding: 0 16px 8px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible !important;
}


#sidebar.lsb .planning-commercial-cards{
    margin-top: 16px;
    height: 66px;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0;
}


#sidebar.lsb .z-check-row{
    display: flex;
    align-items: center;
    gap: 8px;
    height: 14px;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    line-height: 14px;
    font-weight: 500;
    color: var(--text);
}


#sidebar.lsb .z-check{
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}


#sidebar.lsb #metrics-section{
    width: 100%;
    box-sizing: border-box;
    margin-top: 24px;
    padding: 0 19px 0 16px;
}


#sidebar.lsb #metrics-body{
    padding: 12px 0 0;
}


#sidebar.lsb .metric-filters-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
}


#sidebar.lsb .metric-filters-header .lsb-metrics-label{ padding-right: 0; }


#sidebar.lsb .metric-filters-edit-btn{
    display: none;
}


/* Sidebar metric-card type, matching the Figma component (slate/50 surface,
   menu-item header with leading icon, label and trailing range, no inline
   reset action, slider on its own row). */

#sidebar.lsb #metrics-body{
    padding: 12px 0 0;
}

#sidebar.lsb .composite-score-cards{
    padding: 0 0 4px;
}

#sidebar.lsb .mc, #sidebar.lsb .metric-card{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 76px;
    gap: 8px;
    padding: 4px 8px 12px;
    margin-bottom: 8px;
    background: #F8FAFC;
    border: none;
    border-radius: 8px;
    overflow: visible;
}

#sidebar.lsb .mc-header, #sidebar.lsb .metric-card-header{
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    justify-content: flex-start;
}

#sidebar.lsb .mc-icon{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1;
}

#sidebar.lsb .mc-name, #sidebar.lsb .metric-card-label{
    flex: 1 0 0;
    min-width: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sidebar.lsb .mc-range-display, #sidebar.lsb .metric-card-range{
    flex-shrink: 0;
    background: none;
    padding: 0;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}

#sidebar.lsb .metric-card .percentile-btn,
#sidebar.lsb .metric-card .metric-pct-btn,
#sidebar.lsb .metric-card .composite-reset-btn,
#sidebar.lsb .metric-card .metric-flag-remove{
    display: none;
}

#sidebar.lsb .metric-card-body, #sidebar.lsb .metric-card-body--always{
    max-height: none;
    overflow: visible;
}

#sidebar.lsb .metric-card-slider-wrap, #sidebar.lsb .mc-slider-wrap{
    padding: 0 8px;
    min-height: 20px;
}


#sidebar.lsb .metric-gradient-slider.noUi-target, #sidebar.lsb .composite-slider.noUi-target{
    background: var(--border-strong);
    height: 3px;
    border-radius: 2px;
    border: none;
    box-shadow: none;
}


#sidebar.lsb .metric-gradient-slider .noUi-connect, #sidebar.lsb .composite-slider .noUi-connect{
    background: var(--primary);
}


#sidebar.lsb .metric-gradient-slider .noUi-handle, #sidebar.lsb .metric-gradient-slider.noUi-horizontal .noUi-handle, #sidebar.lsb .composite-slider .noUi-handle{
    width: 16px !important;
    height: 16px !important;
    border-radius: 50%;
    border: 2px solid var(--primary) !important;
    background: #fff;
    top: -7px !important;
    right: -8px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    cursor: grab;
}


#sidebar.lsb .metric-gradient-slider .noUi-handle:active, #sidebar.lsb .composite-slider .noUi-handle:active{
    cursor: grabbing;
    box-shadow: 0 2px 8px rgba(68,182,197,.35);
}


#sidebar.lsb .metric-gradient-slider .noUi-handle::before, #sidebar.lsb .metric-gradient-slider .noUi-handle::after, #sidebar.lsb .composite-slider .noUi-handle::before, #sidebar.lsb .composite-slider .noUi-handle::after{
    display: none;
}


/* Floating top coloring selector */

.coloring-float{
    position: fixed;
    top: 16px;
    left: 368px;
    transform: none;
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    padding: 6px;
    border-radius: 100px;
    box-shadow: var(--shadow-modal);
    z-index: 950;
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease .2s;
}


body.results .coloring-float{
    opacity: 1;
    pointer-events: auto;
}


.cf-divider{
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 2px;
}


.cf-trigger{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    border-radius: 99px;
    white-space: nowrap;
}


.cf-trigger:hover{ background: var(--primary-light-2); }


.cf-panel{
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-modal);
    z-index: 960;
    display: none;
    padding: 4px 0;
    scrollbar-width: thin;
}


.cf-panel.open{ display: block; }


.cf-item{
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}


.cf-item:hover{ background: var(--primary-light-2); }


.cf-item.active{
    background: var(--primary);
    color: #fff;
}


.cf-range-divider, .cf-range-mini{
    display: none;
}


.cf-range-divider.show, .cf-range-mini.show{
    display: inline-flex;
}


.cf-range-mini{
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}


.cf-native-select{
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}


@media (max-width: 767px) {
    #sidebar.lsb {
        width: 320px;
        max-width: calc(100vw - 24px);
    }

    .map-top-bar {
        left: 12px;
        right: 12px;
        top: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .map-top-bar-city,
    .map-top-bar-pills {
        max-width: 100%;
    }

    .coloring-float {
        top: 12px;
        left: 12px;
        right: 12px;
        transform: none;
        max-width: calc(100vw - 18px);
    }

    .map-color-control {
        left: 12px;
        top: 76px;
    }
}


/* Tab bar — same pill segmented look */

.rp-tabs
{
    display: flex;
    background: var(--counter-bg);
    border-radius: 10px;
    padding: 3px;
    margin: 0 0 14px;
    flex-shrink: 0;
    gap: 2px;
}


.rp-tab
{
    flex: 1;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .12s, color .12s;
    font-family: inherit;
    white-space: nowrap;
}


.rp-tab:hover:not(.active)
{
    color: var(--text);
}


.rp-tab.active
{
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    font-weight: 600;
}


/* Area overview / top-locations cards — match sidebar metric-card */

.ao-card
{
    background: #F5F7F9;
    border: none;
    border-radius: 10px;
    padding: 16px;
    box-shadow: none;
}


.ao-section-title
{
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
}


.top-locations-item
{
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 10px;
    background: #F5F7F9;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0;
}


.top-locations-item:hover, .top-locations-item.top-locations-item--active
{
    border-color: var(--primary);
    background: var(--primary-light-2);
    transform: none;
    border: none;
}


/* Scrollbar inside right panel */

#right-panel
{
    position: fixed;
    right: 16px;
    top: 88px;
    bottom: 16px;
    width: 340px;
    background: #fff;
    backdrop-filter: none;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 50;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 20px;
    transition: transform 0.3s ease;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    scrollbar-width: thin;
}

#right-panel::-webkit-scrollbar{ width: 5px; }

#right-panel::-webkit-scrollbar-thumb{
    background: var(--border-strong);
    border-radius: 3px;
}


.map-popover
{
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-modal);
    padding: 16px;
    min-width: 320px;
    max-width: 420px;
    max-height: 70vh;
    overflow-y: auto;
    pointer-events: auto;
    border: 1px solid var(--border);
}


.favorites-panel
{
    position: fixed;
    top: 60px;
    right: -340px;
    z-index: 4000;
    width: 320px;
    max-height: calc(100vh - 80px);
    background: #fff;
    border-radius: 14px 0 0 14px;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}


.favorites-panel-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
    color: var(--text);
}


.favorites-panel-close
{
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
}


.favorites-panel-close:hover
{
    color: var(--text);
}


.favorites-item
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
    background: #F5F7F9;
    cursor: pointer;
    border: none;
}


.favorites-item:hover
{
    background: var(--primary-light-2);
}


.favorites-score
{
    font-weight: 700;
    color: var(--primary);
}


.startup-section
{
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}


.startup-section[open]
{
    border-color: var(--border-strong);
}


.startup-section-header
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.12s;
    /* Safari: reset native summary appearance so display:flex renders content */
    -webkit-appearance: none;
    appearance: none;
}


.startup-section-header:hover
{
    background: var(--primary-light-2);
}


.startup-section-title
{
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}


.startup-section-subtitle
{
    font-size: 12px;
    color: var(--text-tertiary);
}


.startup-section-counter
{
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--counter-bg);
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
}


.startup-section-counter.has-selection
{
    color: var(--primary);
    background: var(--primary-light-2);
    font-weight: 600;
}


.keyword-chip
{
    display: inline-block;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--counter-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}


.keyword-chip:hover
{
    background: var(--primary-light-2);
    color: var(--primary);
    border-color: var(--primary);
}


.keyword-chip.selected
{
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--primary-tint);
    border-color: var(--primary);
}


.metric-category-label, #sidebar .metric-category-label{
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-tertiary);
    padding: 14px 4px 8px;
    background: transparent;
    border: none;
}


.sh-search-row
{
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #F5F7F9;
    padding: 12px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}


.sh-search-row:hover
{
    border-color: var(--primary);
    box-shadow: none;
    background: var(--primary-light-2);
}


.sh-bookmark-row
{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--counter-bg);
    border-radius: 8px;
    font-size: 12.5px;
}


/* ===== Alpha mode: hide temporary auth and bookmark UI ===== */

#auth-login-btn, #auth-user-area, #ao-bookmark-btn, #analysis-fav-btn, #favorites-panel, .btn-favorites, .ao-bookmark-btn{
    display: none !important;
}


/* ===== Locked "Your Search" summary bar in sidebar ===== */

.lsb-search-summary{
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--primary-light-2, #f0f7ff);
    display: none; /* shown by JS once criteria are set */
}


.lsb-search-summary-label{
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--primary, #3a7cff);
    text-transform: uppercase;
    margin-bottom: 6px;
}


.lsb-search-tags{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}


.lsb-search-tag{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--primary-light, #ddeaff);
    border: 1px solid var(--primary-light-3, #b8d0ff);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark, #1a4fa8);
    cursor: default;
    user-select: none;
}


/* Top-bar city pill shares the locked visual style */

.map-top-bar-city
{
    pointer-events: none;
    background: var(--primary-light, #ddeaff) !important;
    backdrop-filter: none;
    border-radius: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    border: 1px solid var(--border);
    padding: 10px 16px;
    white-space: nowrap;
    -webkit-backdrop-filter: none;
    border-color: var(--primary-light-3, #b8d0ff) !important;
    color: var(--primary-dark, #1a4fa8) !important;
    cursor: default !important;
}


/* Business config pill gets the same locked style */

#biz-config-pill{
    background: var(--primary-light, #ddeaff) !important;
    border-color: var(--primary-light-3, #b8d0ff) !important;
    color: var(--primary-dark, #1a4fa8) !important;
}


/* Competitors pill keeps the interactive "editable" look */

#competitors-pill{
    background: var(--card-bg, #fff);
    border-color: var(--border);
    color: var(--text);
}





/* Hide city pill from top bar (shown in biz-config popover instead) */

#map-top-city-indicator{
    display: none !important;
}


/* Biz-config popover: read-only locked view */

.biz-focus-readonly .biz-focus-row-a{
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark, #1a4fa8);
}


.biz-focus-readonly .biz-city-chip{
    background: var(--primary-light, #ddeaff);
    border: 1px solid var(--primary-light-3, #b8d0ff);
    color: var(--primary-dark, #1a4fa8);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    cursor: default;
    user-select: none;
}