/* 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-teal: var(--primary);
    --c-teal-light: var(--primary-tint);
    --c-teal-mid: var(--primary-hover);
    --c-teal-dark: var(--primary-hover);
    --c-bg: var(--bg);
    --c-bg-accent: var(--primary-light-2);
    --c-text: var(--text);
    --c-text-dim: var(--text);
    --c-text-light: var(--text-secondary);
    --c-text-muted: var(--text-secondary);
    --c-text-secondary: var(--text-secondary);
    --c-text-dark: var(--text);
    --c-text-heading: var(--text);
    --c-white: #ffffff;
    --c-black: #000000;
    --c-glass: rgba(255, 255, 255, 0.95);
    --c-border: var(--border);
    --c-border-light: var(--border);
    --c-hover: rgba(15, 23, 42, 0.06);
    --c-input-bg: var(--counter-bg);
    --c-divider: var(--border);
    --c-link: var(--primary);

    /* Accent palette (kept for charts/legends/error states) */
    --c-magenta: #C939A3;
    --c-purple: #8B5FA8;
    --c-magenta-light: rgba(201, 57, 163, 0.15);
    --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);
    --c-error: #D32F2F;
    --c-error-dark: #b91c1c;
    --c-error-alt: #dc3545;
    --c-error-soft: #ee4444;
    --c-error-vivid: #e53e3e;
    --c-indigo: #4f46e5;
    --c-indigo-dark: #4338ca;
    --c-copilot: #0D0887;
    --c-copilot-mid: #6c63ff;
    --c-copilot-dark: #1a1a2e;
    --c-near-black: #111111;
    --c-near-black-2: #222222;
    --c-gray-dark: #444444;
    --c-gray-dim: #666666;
    --c-gray-mid: #888888;
    --c-gray-light: #999999;
    --c-gray-faint: #aaaaaa;
    --c-gray-subtle: #bbbbbb;

    /* 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-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.landing-header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--c-text);
}

.landing-logo-mark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--grad-magenta-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--c-white);
}

.landing-logo-text {
    text-decoration: none;
    color: var(--c-text);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.landing-link {
    font-size: 14px;
    color: rgba(0,0,0,0.7);
    text-decoration: none;
}

.landing-link:hover {
    color: var(--c-text);
}

.landing-link-secondary {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.02);
}

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

.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-hero {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.4fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 36px;
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.landing-eyebrow {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.55);
}

.landing-title {
    font-size: 30px;
    line-height: 1.25;
    font-weight: 700;
}

.landing-subtitle {
    font-size: 15px;
    color: rgba(0,0,0,0.7);
    max-width: 36rem;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.landing-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: var(--grad-magenta-teal);
    color: var(--c-white);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(201,57,163,0.35);
}

.landing-btn-primary:hover {
    filter: brightness(1.05);
}

.landing-btn-ghost {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.6);
    font-size: 13px;
}

.landing-supported {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.landing-supported-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.5);
}

.landing-supported-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.landing-chip {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.9);
}

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

.landing-chip-soon {
    color: rgba(0,0,0,0.6);
}

.landing-hero-card {
    background: var(--c-glass);
    border-radius: 16px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.landing-hero-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.landing-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: rgba(0,0,0,0.72);
}

.landing-steps li strong {
    display: block;
    margin-bottom: 2px;
}

.landing-feedback {
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.landing-feedback-inner {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 3fr);
    gap: 20px;
    align-items: flex-start;
}

.landing-feedback-copy h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.landing-feedback-copy p {
    font-size: 14px;
    color: rgba(0,0,0,0.7);
}

.landing-feedback-form {
    background: var(--c-glass);
    border-radius: 14px;
    padding: 14px 16px 16px;
    border: 1px solid rgba(0,0,0,0.08);
}

.landing-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.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;
}

.landing-feedback-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.landing-feedback-status {
    font-size: 12px;
    color: rgba(0,0,0,0.55);
}

.landing-feedback-status-success {
    color: var(--c-teal-dark);
}

.landing-feedback-status-error {
    color: var(--c-error-dark);
}

@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;
}

.about-contact-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-contact-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
}

.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-photo-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(0,0,0,0.5);
}

.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 */
#map {
    position: absolute;
    top: 80px; /* Account for top panel */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - 80px);
    z-index: 0;
}

/* Top Horizontal Panel */
#top-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0 32px;
    transition: background 0.3s ease, border-color 0.3s ease;
}


.top-panel-content {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 48px;
    padding-bottom: 12px;
}

.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;
}


.top-panel-controls {
    display: flex;
    gap: 24px;
    align-items: center;
    flex: 1;
}

.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 {
    position: fixed;
    left: 0;
    top: 80px; /* Below top panel */
    bottom: 0;
    width: 380px;
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 999;
    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;
}

/* ── Sidebar brand header ── */
.lsb-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--c-glass);
}

.lsb-logo {
    width: 30px;
    height: 30px;
    background: var(--grad-magenta-teal);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

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

.lsb-new-search {
    background: var(--counter-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 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(--primary-light-2);
    border-color: var(--primary);
    color: var(--primary);
}

/* 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 */
.filter-group-section {
    margin-bottom: 4px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
}

.filter-group-section-header {
    list-style: none;
    cursor: pointer;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(0,0,0,0.55);
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    outline: none;
    transition: background 0.15s;
}

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

.filter-group-section-header::before {
    content: '▶';
    font-size: 7px;
    opacity: 0.5;
    transition: transform 0.18s;
    flex-shrink: 0;
}

.filter-group-section[open] > .filter-group-section-header::before {
    transform: rotate(90deg);
}

.filter-group-section-header:hover {
    background: rgba(0,0,0,0.08);
    color: rgba(0,0,0,0.8);
}

.filter-group-section-body {
    padding: 10px 12px 4px;
}

/* Sub-scores collapsible inside Scores section */
.sub-scores-details {
    margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 6px;
}
.sub-scores-summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: rgba(0,0,0,0.45);
    padding: 4px 0;
    list-style: none;
    user-select: none;
}
.sub-scores-summary::-webkit-details-marker { display: none; }
.sub-scores-summary::marker { display: none; }
.sub-scores-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    font-size: 10px;
    transition: transform 0.15s ease;
}
.sub-scores-details[open] > .sub-scores-summary::before {
    transform: rotate(90deg);
}
.sub-scores-body {
    padding-left: 8px;
}

.filters-collapsible {
    max-height: none;
    overflow: visible;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.filters-collapsible.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.filter-group {
    margin-bottom: 10px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.filter-label-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.filter-label-row .selected-value-indicator {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--c-error);
    font-size: 13px;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.filter-label-row .selected-value-indicator:empty {
    display: none;
}

.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-values {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
}

.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;
}

.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 {
    -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-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 {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.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);
}

.sidebar-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 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 {
    align-self: center;
    margin-left: auto;
    padding: 7px 14px;
    background: rgba(201, 57, 163, 0.08);
    border: 1px solid rgba(201, 57, 163, 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-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;
}


.city-selection-wrapper {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.city-selection-wrapper h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    color: rgba(0, 0, 0, 0.75);
}

.city-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.city-actions button {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 8px;
    background: rgba(81, 162, 182, 0.08);
    border: 1px solid rgba(81, 162, 182, 0.25);
    color: var(--c-text);
}

.city-actions button:hover {
    background: rgba(81, 162, 182, 0.15);
    border-color: rgba(81, 162, 182, 0.4);
}

.city-selection-list {
    max-height: 220px;
    overflow-y: auto;
}

.city-group {
    margin-bottom: 10px;
}

.city-group summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
    margin-bottom: 6px;
    list-style: none;
    display: flex;
    align-items: center;
}

.city-group summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 4px;
    font-size: 10px;
    transition: transform 0.15s ease;
}

.city-group[open] > summary::before {
    transform: rotate(90deg);
}

.city-group summary::-webkit-details-marker {
    display: none;
}

.district-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.district-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--c-magenta);
}

.district-count {
    font-weight: 400;
    color: rgba(0, 0, 0, 0.45);
    font-size: 11px;
}

.city-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 5px;
    color: rgba(0, 0, 0, 0.75);
}

.city-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.city-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(201, 57, 163, 0.1);
    border: 1px solid rgba(201, 57, 163, 0.25);
    border-radius: 999px;
    font-size: 11px;
    color: var(--c-text);
}

.city-chip button {
    background: transparent;
    border: none;
    color: inherit;
    padding: 0;
    font-size: 12px;
    box-shadow: none;
    line-height: 1;
}

#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-group {
    margin-bottom: 2px;
}
.poi-type-group > summary {
    cursor: pointer;
    list-style: none;
    padding: 6px 0;
}
.poi-type-group > summary::-webkit-details-marker { display: none; }
.poi-type-group > summary::before {
    content: '▸ ';
    font-size: 11px;
    color: rgba(0,0,0,0.4);
}
.poi-type-group[open] > summary::before {
    content: '▾ ';
}
.poi-type-group.poi-highlight > summary {
    color: var(--c-teal);
    font-weight: 600;
}
.poi-type-count {
    font-weight: 400;
    color: rgba(0,0,0,0.45);
    font-size: 12px;
}

.poi-category-row:hover {
    background: rgba(81,162,182,0.08);
}
.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-controls {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analysis-control-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analysis-control-row label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.analysis-layer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.analysis-layer-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.75);
}

.analysis-layer-controls input[type="checkbox"] {
    accent-color: var(--c-teal);
}

.analysis-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.analysis-bar-row {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    align-items: center;
    gap: 10px;
}

.analysis-bar-label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.75);
}

.analysis-bar-track {
    height: 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
}

.analysis-bar-fill {
    height: 100%;
    background: var(--grad-rainbow);
    border-radius: 999px;
}

.analysis-bar-value {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.75);
    min-width: 56px;
    text-align: right;
}

.analysis-baseline-text {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.65);
}

/* ─── Analysis panel compact metrics ─── */
.analysis-panel-card {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

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

.analysis-panel-topbar h3 {
    margin: 0;
    font-size: 16px;
    white-space: nowrap;
}

.analysis-biz-ctrl {
    flex: 1;
    min-width: 180px;
}

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

.analysis-topbar-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.analysis-ctrl-sm {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.analysis-ctrl-sm label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0,0,0,0.45);
}

.filter-select-sm {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.2);
    color: var(--c-text-dim);
    max-width: 160px;
}

.analysis-check-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(0,0,0,0.6);
    cursor: pointer;
    padding-bottom: 2px;
}

.analysis-check-label input[type="checkbox"] {
    accent-color: var(--c-teal);
}

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

.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);
}

.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) */
.metric-row {
    display: grid;
    grid-template-columns: 1fr 44px 56px;
    align-items: center;
    gap: 6px;
}

/* 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;
}

.metric-unit {
    font-size: 9px;
    font-weight: 400;
    color: rgba(0,0,0,0.4);
}

/* Total Score collapsible — triangle left of the row */
.total-score-details {
    margin: 0;
}

.total-score-details > summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: 14px 1fr 44px 56px;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    user-select: none;
    outline: none;
}

.total-score-details > summary::-webkit-details-marker { display: none; }
.total-score-details > summary::marker { display: none; }

.total-score-details > summary::before {
    content: '▶';
    font-size: 8px;
    color: rgba(0,0,0,0.35);
    transition: transform 0.18s;
    display: inline-block;
    text-align: center;
}

.total-score-details[open] > summary::before {
    transform: rotate(90deg);
}

.total-score-details > summary:hover::before {
    color: rgba(0,0,0,0.7);
}

.score-details-body {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 20px;
}

/* gradient bar fill specifically for scores section */
.scores-fill {
    background: var(--grad-rainbow);
}

/* 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 */
.metric-info-logo {
    width: 12px;
    height: 12px;
    opacity: 0.35;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    border-radius: 2px;
    filter: brightness(0);
}

.metric-info-logo:hover {
    opacity: 0.8;
}

/* 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-description {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.7);
    margin-top: 6px;
}
.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);
}

.analysis-empty {
    font-size: 11px;
    color: rgba(0,0,0,0.35);
    font-style: italic;
    padding: 4px 0;
}





/* 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-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
}

.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);
}

.btn-google-maps {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-light);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-google-maps:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--c-text);
    border-color: rgba(0, 0, 0, 0.25);
}

#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-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.info-label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--c-text);
    transition: color 0.3s ease;
}

.info-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--c-magenta);
}

.info-section strong {
    display: block;
    font-size: 14px;
    color: var(--c-magenta);
    margin-bottom: 8px;
}

.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-result {
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-text);
    transition: color 0.3s ease;
}

.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-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;
}

.viewport-coverage-badge {
    background: rgba(81, 162, 182, 0.12);
    color: var(--c-teal);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.perfect-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--c-copilot);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.perfect-toggle input { margin: 0; cursor: pointer; }

/* 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;
}

.modal-content {
    background: var(--modal-bg);
    color: var(--c-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;
}

/* 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-question-text {
    padding: 0 32px;
    margin-top: 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.modal-content .survey-disclaimer {
    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-dots {
    display: flex;
    gap: 6px;
    padding: 22px 32px 0;
}

.survey-step-dot {
    height: 4px;
    flex: 1;
    background: var(--counter-bg);
    border-radius: 2px;
    transition: background 0.4s;
}

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

/* Modernised progress bar */
.survey-progress-bar {
    height: 4px;
    background: var(--counter-bg);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.survey-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.survey-step-info {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* AI pill button in modal toolbar */
.startup-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(81, 162, 182, 0.25);
}

.startup-ai-btn:hover { background: var(--primary-hover); }
.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 {
    flex: 1;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.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-biz-preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.survey-biz-preset-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    cursor: pointer;
    background: #fff;
    transition: all 0.18s;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.survey-biz-preset-card:hover {
    border-color: var(--primary);
    background: var(--primary-light-2);
    transform: translateY(-1px);
}

.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; }

.survey-biz-preset-icon {
    font-size: 22px;
    margin-bottom: 8px;
    display: block;
}

.survey-biz-preset-title {
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.survey-biz-preset-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* City quick-pick chips */
.survey-city-chip {
    background: var(--primary-light-2);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.survey-city-chip:hover { background: var(--primary-tint); }

.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); }

.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;
}

.modal-content > p {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.65);
    margin-bottom: 32px;
    line-height: 1.6;
}

.modal-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.feature h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 8px;
}

.feature p {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.55);
    line-height: 1.4;
}

.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);
}

.modal-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-checkbox input {
    margin-right: 8px;
    cursor: pointer;
}

.btn-text {
    background: none;
    border: none;
    color: var(--c-teal);
    font-size: 13px;
    padding: 8px 0;
    cursor: pointer;
    text-decoration: underline;
    box-shadow: none;
    width: 100%;
    text-align: center;
}

.btn-text:hover {
    color: var(--c-magenta);
    transform: none;
}

.filter-group.hidden {
    display: none;
}

@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) */
.landuse-filter-wrapper {
    margin-bottom: 16px;
}

.landuse-filter {
    margin-bottom: 0 !important;
}

.multi-select-dropdown {
    position: relative;
    width: 100%;
}

.multi-select-selected {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--c-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

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

.multi-select-selected::after {
    content: '▼';
    font-size: 10px;
    opacity: 0.6;
}

.multi-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.multi-select-actions {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.multi-select-actions button {
    flex: 1;
    padding: 6px 12px;
    background: rgba(201, 57, 163, 0.1);
    border: 1px solid rgba(201, 57, 163, 0.3);
    border-radius: 4px;
    color: var(--c-text);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multi-select-actions button:hover {
    background: rgba(201, 57, 163, 0.2);
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--c-text);
    transition: background 0.15s ease;
}

.multi-select-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.multi-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-magenta);
    cursor: pointer;
}

/* POI Filters Section */
.poi-filters-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.poi-filters-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-magenta);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poi-filter {
    background: rgba(201, 57, 163, 0.05);
    border-left: 3px solid var(--c-magenta);
    padding-left: 12px !important;
    margin-left: 0 !important;
}



/* Sidebar Header */
.sidebar-header {
    display: none;
}

.sidebar-title {
    display: none;
}

/* ============================
   Sidebar Sections (Collapsible)
   ============================ */
.sidebar-section {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.sidebar-section-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(0, 0, 0, 0.6);
}

.sidebar-section-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid rgba(0, 0, 0, 0.4);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-section-header[aria-expanded="false"] .sidebar-section-chevron {
    transform: rotate(-45deg);
}

.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 */
.sidebar-metrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
}

.sidebar-metrics-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

#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);
}

.metrics-eye-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: rgba(0, 0, 0, 0.45);
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.metrics-eye-toggle:hover {
    color: var(--c-teal);
    background: rgba(81, 162, 182, 0.1);
}

.metrics-eye-toggle.hidden svg {
    opacity: 0.3;
}

/* ============================
   Metrics Top Block (Composite Score + Percentile)
   ============================ */
.sidebar-metrics-top {
    padding: 14px 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-metrics-top > .sidebar-section-title {
    display: block;
    margin-bottom: 10px;
}

.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-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.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 */
.viewing-status {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    padding: 8px 0 12px;
    font-style: italic;
}

/* Metric Filters sub-header */
.metric-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
}

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

.metric-filters-edit-btn:hover {
    background: rgba(81, 162, 182, 0.1);
}

/* ============================
   Competitors Sidebar Section Body
   ============================ */
.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 rgba(201, 57, 163, 0.3);
    background: rgba(201, 57, 163, 0.06);
    color: var(--c-magenta);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.competitors-add-btn:hover {
    background: rgba(201, 57, 163, 0.12);
    border-color: var(--c-magenta);
}

.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: rgba(201, 57, 163, 0.08);
    border: 1px solid rgba(201, 57, 163, 0.2);
    color: var(--c-magenta);
    white-space: nowrap;
}


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

.metric-group {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
}

.metric-group-header {
    padding: 10px 12px;
    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);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-group-header::before {
    content: '▶';
    font-size: 6px;
    opacity: 0.4;
    transition: transform 0.18s;
    flex-shrink: 0;
}

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

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

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

/* Individual Metric Row */
.metric-row {
    display: flex;
    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-label {
    flex: 0 0 auto;
    width: 120px;
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-row-slider {
    flex: 1;
    min-width: 0;
}

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

.metric-row-value {
    flex: 0 0 auto;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    min-width: 52px;
    text-align: right;
}

.metric-row-remove {
    background: none;
    border: none;
    color: var(--c-gray-subtle);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

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

.metric-row-remove:hover {
    color: var(--c-error-soft);
}

/* 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);
}

.composite-score-desc {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.4);
    padding: 0 12px 6px;
}

/* Competitor POI section in metric groups */
.metric-group-competitor {
    border-color: rgba(201, 57, 163, 0.15);
}

.metric-group-competitor .metric-group-header {
    background: rgba(201, 57, 163, 0.04);
}

.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 Cards (expandable per-metric filter cards)
   ============================ */
.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 */
#metric-groups .sidebar-filter-section {
    margin-bottom: 8px;
}
#metric-groups .sidebar-filter-section .startup-section-header {
    gap: 10px;
    padding: 10px 12px;
}
#metric-groups .sidebar-filter-section .startup-section-icon svg {
    width: 28px;
    height: 28px;
}
#metric-groups .sidebar-filter-section .startup-section-title {
    font-size: 0.88rem;
}
#metric-groups .sidebar-filter-section .startup-section-subtitle {
    font-size: 0.72rem;
    line-height: 1.25;
}
#metric-groups .sidebar-filter-section .startup-section-body {
    padding: 0 10px 10px;
}

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

.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;
}

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

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

.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-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

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

.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-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-percentile-btns {
    display: flex;
    gap: 6px;
    padding: 0 14px 10px;
    flex-wrap: wrap;
}

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

/* Composite Score card pinned at top of METRIC FILTERS section */
.composite-score-cards {
    padding: 0 16px 4px;
}

.planning-commercial-section {
    margin: 0 16px 4px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
}

.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;
}

/* ============================
   Floating Map Top Bar (Business config + Competitors pills)
   ============================ */
.map-top-bar {
    position: fixed;
    top: 96px; /* 80px top-panel + 16px gap */
    right: 16px;
    left: auto;
    transform: none;
    z-index: 850;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.map-top-bar-pills {
    display: flex;
    align-items: stretch;
    background: var(--c-glass);
    backdrop-filter: blur(8px);
    border-radius: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    pointer-events: auto;
}

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

/* Context label prefix inside top-bar pills */
.tb-label {
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 12px;
    margin-right: -4px;
}

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

.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-top-bar-divider {
    width: 1px;
    background: var(--c-border-light);
    align-self: stretch;
    margin: 6px 0;
}

.map-popover {
    position: relative;
    background: var(--c-white);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 320px;
    max-width: 420px;
    max-height: 70vh;
    overflow-y: auto;
    pointer-events: auto;
}

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

/* ============================
   Color-By Dropdown Block (sidebar METRICS section)
   ============================ */
.color-by-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-by-select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--c-teal);
    border-radius: 10px;
    background: var(--c-white);
    color: var(--c-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2351A2B6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.color-by-select:focus {
    outline: none;
    border-color: var(--c-teal);
    box-shadow: 0 0 0 3px var(--c-teal-light);
}

.color-by-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 2px 0;
}

.color-by-range-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
}

.color-by-range-lbl {
    color: var(--c-text);
    opacity: 0.6;
}

/* Competitors filter card uses standard metric-card styles + accent */
.metric-card--competitors {
    border-color: var(--c-magenta-light);
}

.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-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-reset {
    padding: 7px 14px;
    background: rgba(201, 57, 163, 0.1);
    border: 1px solid rgba(201, 57, 163, 0.4);
    border-radius: 8px;
    color: var(--c-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: rgba(201, 57, 163, 0.2);
    border-color: rgba(201, 57, 163, 0.7);
}



/* Business Welcome Modal & Survey */
.modal-business-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--c-text-dim);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.3;
}

.modal-business-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.feature.step {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 170px;
}

.feature.step h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-magenta);
    margin: 8px 0 4px;
}

.feature.step p {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
    line-height: 1.3;
}

.feature.step .feature-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature.step.step3 .feature-icon {
    transform: scale(1.2);
}

/* Survey Step Styles */
.survey-header {
    margin-bottom: 18px;
}

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

.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;
    color: rgba(0, 0, 0, 0.4);
    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-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.survey-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 8px;
    background: rgba(0, 0, 0, 0.02);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: var(--c-text);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    min-height: 80px;
}

.survey-option:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(201,57,163,0.5);
}

.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-option-icon { font-size: 22px; line-height: 1; }
.survey-option-label { font-size: 12px; font-weight: 500; line-height: 1.3; }

.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);
}

.btn-survey-skip { margin-right: auto; }

/* Survey checkpoint screen */
.survey-checkpoint {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 8px;
    gap: 10px;
}

.survey-checkpoint-icon { font-size: 36px; line-height: 1; }

.survey-checkpoint-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-text);
    margin: 0;
}

.survey-checkpoint-desc {
    font-size: 13px;
    color: rgba(0,0,0,0.55);
    line-height: 1.5;
    margin: 0;
    max-width: 320px;
}

.survey-checkpoint-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    margin-top: 6px;
}

.btn-survey-checkpoint {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.03);
    color: var(--c-text);
}

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

.btn-checkpoint-continue { border-color: rgba(201,57,163,0.25); }
.btn-checkpoint-continue:hover { background: rgba(201,57,163,0.08); border-color: var(--c-magenta); }

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

.btn-checkpoint-ai { border-color: rgba(139,95,168,0.25); }
.btn-checkpoint-ai:hover { background: rgba(139,95,168,0.08); border-color: var(--c-purple); }

.btn-checkpoint-hint {
    font-size: 11px;
    font-weight: 400;
    color: rgba(0,0,0,0.45);
    margin-top: 2px;
}


/* Live hex count in survey nav */
.survey-hex-count {
    font-size: 12px;
    font-weight: 600;
    color: rgba(81, 162, 182, 1);
    margin-left: auto;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(81, 162, 182, 0.12);
    border-radius: 6px;
    transition: color 0.2s ease;
}

.survey-hex-count:empty {
    display: none;
}

.survey-hex-count-low {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.12);
}


.survey-next-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* 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 {
    margin: 0;
}

.biz-focus-details > summary {
    list-style: none;
    cursor: pointer;
    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);
    user-select: none;
    padding: 2px 0;
}

.biz-focus-details > summary::-webkit-details-marker { display: none; }
.biz-focus-details > summary::marker { display: none; }

.biz-focus-details > summary > span::before {
    content: '▶';
    font-size: 8px;
    color: rgba(0,0,0,0.35);
    transition: transform 0.18s;
    display: inline-block;
    margin-right: 5px;
}

.biz-focus-details[open] > summary > span::before {
    transform: rotate(90deg);
}

.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-edit {
    background: none;
    border: none;
    color: var(--c-teal);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.biz-focus-edit:hover { background: rgba(81,162,182,0.15); }

.biz-focus-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.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-chip-region {
    background: rgba(201,57,163,0.12);
    border-color: rgba(201,57,163,0.35);
    font-weight: 600;
}

.biz-focus-chip-remove {
    background: none;
    border: none;
    color: rgba(0,0,0,0.4);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
}

.biz-focus-chip-remove:hover { color: var(--c-text); }

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

/* Raw / Advanced Filters Collapsible Toggle */
.raw-filters-toggle > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(0,0,0,0.38);
    cursor: pointer;
    list-style: none;
    transition: color 0.15s ease;
    user-select: none;
}

.raw-filters-toggle > summary::-webkit-details-marker { display: none; }

.raw-filters-toggle > summary:hover { color: rgba(0,0,0,0.75); }

.raw-filters-toggle > summary::before {
    content: '▶';
    font-size: 8px;
    transition: transform 0.2s ease;
}

.raw-filters-toggle[open] > summary::before { transform: rotate(90deg); }


/* 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;
}

.biz-focus-change {
    background: none;
    border: 1px solid rgba(81,162,182,0.4);
    color: var(--c-teal);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.biz-focus-change:hover {
    background: rgba(81,162,182,0.15);
    border-color: var(--c-teal);
}

/* Answer popover for inline editing */
.biz-focus-popover {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
    background: var(--c-white);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 4px;
    min-width: 160px;
    max-width: 260px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}

.popover-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    color: rgba(0,0,0,0.7);
}

.popover-option:hover {
    background: rgba(81,162,182,0.08);
}

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

.popover-option input[type="checkbox"] {
    accent-color: var(--c-teal);
    flex-shrink: 0;
}

/* 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 */
.survey-multi-hint {
    font-size: 11px;
    font-weight: 400;
    color: rgba(0,0,0,0.38);
    margin-left: 4px;
}

.survey-edit-mode {
    color: var(--c-magenta);
    font-weight: 600;
}



/* 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 {
    position: fixed;
    top: 90px;
    left: 392px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
}
.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;
}
.color-legend-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-dim);
    text-align: center;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 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;
}

.hex-explore-popup {
    position: fixed;
    z-index: 520;
    pointer-events: auto;
    background: var(--c-glass);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.06);
}

.hex-explore-popup .btn-analysis {
    background: var(--c-glass);
    backdrop-filter: blur(6px);
    color: var(--c-near-black-2);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    width: 100%;
    cursor: pointer;
}

.hex-explore-popup .btn-analysis:hover:not(:disabled) {
    background: var(--c-glass);
    border-color: transparent;
}

/* Hex criteria checklist in explore popup */
.hex-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
    max-width: 220px;
}
.hex-criteria-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    line-height: 1.3;
    padding: 1px 0;
}
.hex-criteria-row.fail {
    opacity: 0.7;
}
.hex-check {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
}
.hex-check.pass { color: #22c55e; }
.hex-check.fail { color: #ef4444; }
.hex-check.unknown { color: #94a3b8; font-weight: 500; }
.hex-criteria-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--c-text-dim);
    font-weight: 600;
    flex-shrink: 0;
}
.hex-criteria-ans {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--c-text-light);
    font-weight: 400;
}
.hex-criteria-score {
    font-size: 12px;
    font-weight: 500;
    color: var(--c-gray-dark);
    margin-bottom: 5px;
    padding-top: 3px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Right Panel (Top Locations) */
#right-panel {
    position: fixed;
    right: 0;
    top: 80px;
    bottom: 0;
    width: 380px;
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0;
    transition: transform 0.3s ease;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
}

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

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

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

/* Right panel toggle button */
.right-panel-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: var(--c-teal);
    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 rgba(81,162,182,0.25);
    display: flex;
    align-items: center;
    gap: 5px;
    animation: toggle-nudge 3s ease-in-out 2s 3;
}

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

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

.right-panel-toggle:hover {
    background: var(--c-teal-mid);
    box-shadow: -2px 0 18px rgba(81,162,182,0.4);
}

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

/* Right panel tab bar */
.rp-tabs {
    display: flex;
    background: var(--c-bg-alt, #f1f5f9);
    border-radius: 10px;
    padding: 3px;
    margin: 12px 14px 8px;
    flex-shrink: 0;
}
.rp-tab {
    flex: 1;
    padding: 7px 10px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.rp-tab.active {
    background: var(--c-white, #fff);
    color: var(--text, #1e293b);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    font-weight: 600;
}

.top-locations-panel {
    padding-top: 14px;
}

/* Score gradient legend in right panel */
.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;
}

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

.top-locations-subtitle {
    font-size: 12px;
    color: var(--c-text-dim);
    margin: 4px 0 10px;
}

.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);
}

.top-locations-item {
    width: 100%;
    text-align: left;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    padding: 12px 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: translateX(-2px);
}

.top-locations-item.top-locations-item--active {
    box-shadow: 0 4px 12px rgba(81, 162, 182, 0.15);
}

/* 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-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.biz-focus-inline-opt {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
    color: rgba(0,0,0,0.55);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.15s ease;
    user-select: none;
}

.biz-focus-inline-opt:hover {
    background: rgba(201,57,163,0.1);
    border-color: rgba(201,57,163,0.3);
}

.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 */
.btn-survey-checkpoint:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 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-login-btn {
    font-size: 12px;
    color: var(--c-copilot);
    cursor: pointer;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1.5px solid rgba(13,8,135,0.3);
    background: rgba(13,8,135,0.06);
    transition: background 0.15s;
}
.auth-login-btn:hover { background: rgba(13,8,135,0.12); }
.auth-user-area {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--c-text-dim);
    position: relative;
}
.auth-avatar-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--c-primary, #0d0887);
    background: var(--c-primary, #0d0887);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}
.auth-avatar-btn:hover { box-shadow: 0 0 0 3px rgba(13,8,135,0.18); }
.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-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--c-white, #fff);
    border: 1px solid var(--c-border, #e0e0e0);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    min-width: 220px;
    z-index: 5000;
    padding: 12px 0 8px;
}
.auth-profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 10px;
}
.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-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-dropdown-email {
    font-size: 11px;
    color: var(--c-text-dim, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-dropdown-divider {
    border: none;
    border-top: 1px solid var(--c-border, #e0e0e0);
    margin: 0 0 4px;
}
.auth-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--c-text, #111);
    cursor: pointer;
    transition: background 0.12s;
}
.auth-dropdown-item:hover { background: var(--c-hover-bg, #f5f5f5); }
.auth-dropdown-logout { color: var(--c-error-vivid, #d32f2f); }

.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;
}
.auth-link-telegram-btn {
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 11px;
    background: rgba(34, 158, 217, 0.12);
    color: #1c7fb8;
    border: 1px solid rgba(34, 158, 217, 0.35);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.auth-link-telegram-btn:hover { background: rgba(34, 158, 217, 0.22); }

/* ===== Favorites Button ===== */
.btn-favorites {
    background: none;
    border: 1.5px solid rgba(13,8,135,0.3);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-favorites:hover { background: rgba(13,8,135,0.06); }

.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 {
    position: fixed;
    top: 60px;
    right: -340px;
    z-index: 4000;
    width: 320px;
    max-height: calc(100vh - 80px);
    background: var(--c-white);
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}
.favorites-panel.open { right: 0; }
.favorites-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-divider);
    font-weight: 700;
    font-size: 14px;
}
.favorites-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--c-gray-light);
    cursor: pointer;
}
.favorites-panel-close:hover { color: var(--c-text-dim); }
.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 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: #f8f7ff;
    cursor: pointer;
}
.favorites-item:hover { background: #eeedff; }
.favorites-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.favorites-score { font-weight: 700; color: var(--c-copilot); }
.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); }

.hex-popup-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}

@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 Picker Overlay
   ============================ */
.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-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.keyword-picker-subtitle {
    font-size: 0.82rem;
    color: var(--c-gray-dim);
    margin-bottom: 16px;
}
.keyword-group {
    margin-bottom: 14px;
}
.keyword-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--c-gray-mid);
    margin-bottom: 6px;
    font-weight: 600;
}
.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 4px 0;
}
.keyword-chip {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    border: none;
    background: rgba(81,162,182,0.08);
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.keyword-chip:hover { background: rgba(81,162,182,0.18); color: var(--c-text-dark); }
.keyword-chip.selected {
    background: var(--c-teal);
    color: var(--c-white);
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(81,162,182,0.25);
}
.keyword-picker-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 12px;
}
.keyword-picker-actions button {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s;
}
.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 Metrics Window
   ============================ */
.startup-window {
    padding: 28px 28px 0;
}
.startup-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.startup-ai-btn {
    padding: 7px 16px;
    border-radius: 20px;
    border: none;
    background: var(--c-teal);
    color: var(--c-white);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.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>) */
.startup-section {
    border: 1px solid var(--c-border-light);
    border-radius: 12px;
    background: var(--c-white);
    overflow: hidden;
}
.startup-section[open] {
    border-color: var(--c-border);
}

/* Section header (summary) */
.startup-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    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: rgba(0,0,0,0.02);
}
.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-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-text);
}
.startup-section-subtitle {
    font-size: 0.78rem;
    color: rgba(0,0,0,0.5);
}
.startup-section-counter {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(0,0,0,0.45);
    background: rgba(0,0,0,0.05);
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.startup-section-counter.has-selection {
    color: var(--c-teal);
    background: rgba(81,162,182,0.12);
    font-weight: 600;
}
.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;
}

.metric-filter-card-competitor .metric-filter-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.metric-filter-competitor-sub {
    font-size: 0.75rem;
    color: var(--c-muted, #6b7280);
    margin: -4px 0 8px 0;
    line-height: 1.35;
}
.metric-filter-edit-competition {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--c-border);
    background: var(--c-input-bg);
    cursor: pointer;
    color: inherit;
}
.metric-filter-edit-competition:hover {
    background: var(--c-hover);
}

/* ============================
   Active Filters Panel
   ============================ */
#active-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.metric-filter-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}
.metric-filter-card.color-active {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 1px var(--c-teal) inset;
}
.metric-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-filter-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-text);
}

/* Light theme overrides for new components */
.metric-filter-name:hover { color: var(--c-near-black); }
.metric-filter-color-icon {
    font-size: 0.7rem;
    color: var(--c-teal);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.metric-filter-card.color-active .metric-filter-color-icon { opacity: 1; }
.metric-filter-remove {
    background: none;
    border: none;
    color: var(--c-gray-faint);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.metric-filter-remove:hover { color: var(--c-error-soft); }
.metric-prefer-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}
.prefer-btn {
    flex: 1;
    padding: 3px 6px;
    font-size: 0.68rem;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-input-bg);
    color: var(--c-gray-mid);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}
.prefer-btn:hover { border-color: var(--c-teal); color: var(--c-text-light); }
.prefer-btn.active {
    background: var(--c-teal);
    color: var(--c-white);
    border-color: var(--c-teal);
    font-weight: 600;
}
.metric-filter-slider {
    padding-top: 4px;
}
.metric-filter-slider .range-slider {
    margin: 4px 0;
}
.metric-filter-slider .range-values {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.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);
}
.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--c-gray-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0 2px;
}

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

/* ============================
   Keyword Picker Button (in biz focus)
   ============================ */
.keyword-picker-btn {
    width: 100%;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px dashed var(--c-teal);
    background: transparent;
    color: var(--c-teal);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}
.keyword-picker-btn:hover {
    background: rgba(81,162,182,0.1);
    border-style: solid;
}

/* ============================
   City Search Bar
   ============================ */
.city-search-wrapper {
    position: relative;
    flex-direction: column;
    align-items: flex-start !important;
}
.city-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}
.city-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--c-teal);
    color: var(--c-white);
    white-space: nowrap;
}
.city-chip-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.city-chip-remove:hover { color: var(--c-white); }

/* 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-standalone-link {
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.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-action-row {
    position: sticky;
    top: 0;
}

.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-h-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.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;
}

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

/* Business type badge */
.rm-biz-badge {
    display: inline-block;
    background: var(--counter-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.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;
}

/* ==========================================================================
   Area Overview side panel (opens in right panel when a hex is selected)
   ========================================================================== */
.area-overview-panel {
    padding: 16px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
}
/* 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-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.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-score-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ao-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.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-age-bar {
    display: flex;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
}

.ao-age-bar-seg {
    height: 100%;
    background: var(--ao-seg-color, var(--primary));
}

.ao-age-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 11.5px;
    color: var(--text-tertiary);
}

.ao-age-legend-item::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ao-seg-color, var(--primary));
    margin-right: 4px;
    vertical-align: middle;
}

.ao-age-legend-item strong {
    font-weight: 700;
    color: var(--text);
    margin-left: 2px;
}

.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); }

.ao-similar-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    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);
}

.ao-report-btn {
    background: var(--primary);
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 4px 14px rgba(81, 162, 182, 0.25);
}

.ao-report-btn:hover { background: var(--primary-hover); }

/* 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-row { margin-top: 6px; align-items: center; }

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

.ao-commercial-likely {
    background: #d4f1e4;
    color: #1d7a4a;
}

.ao-commercial-check {
    background: #fff3cd;
    color: #856404;
}

.ao-commercial-unlikely {
    background: #fde8e8;
    color: #b02020;
}

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

/* ============================================================
   DESIGNER 2026 REDESIGN OVERRIDES
   Block 2 (left sidebar) + Block 4 (right sidebar)
   Visual-only changes — all IDs and JS wiring preserved.
   ============================================================ */

/* ---------- BLOCK 2: LEFT SIDEBAR ---------- */
#sidebar {
    top: 0;
    width: 320px;
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid var(--border);
    box-shadow: none;
    z-index: 50;
}

.lsb-top {
    padding: 16px 18px;
    background: var(--card-bg);
}

.lsb-logo {
    background: linear-gradient(135deg, var(--primary), var(--icon-color));
}

.lsb-new-search {
    border: none;
    padding: 6px 12px;
}

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

/* 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;
}

.sidebar-metrics-top {
    padding: 0 18px;
}

.metric-filters-header {
    padding: 6px 18px 8px;
}

.metric-filters-edit-btn {
    color: var(--primary);
}

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

/* COLORING <select> → pill dropdown look */
.color-by-block {
    margin-top: 4px;
}

.color-by-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.15s;
}

.color-by-select:hover,
.color-by-select:focus {
    border-color: var(--primary);
    outline: none;
}

.viewing-status {
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 8px 0 0;
    font-style: normal;
}

/* Composite score & metric cards */
.composite-score-cards {
    padding: 0 18px 4px;
}

.metric-card {
    border-radius: 10px;
    border-color: var(--border);
}

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

.metric-card-label {
    font-size: 13px;
}

.metric-card-range {
    color: var(--primary);
    background: var(--primary-light-2);
    border-radius: 6px;
}

.metric-groups {
    padding: 0 18px 18px;
}

.metric-group {
    background: var(--card-bg);
    border-color: var(--border);
    border-radius: 10px;
}

.metric-group-header {
    background: transparent;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    font-size: 11px;
}

/* Planning suitability — keep current visual unchanged (only normalize container spacing) */
.planning-commercial-section {
    margin: 4px 18px 8px;
    background: var(--card-bg);
    border-color: var(--border);
}

/* 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);
}

/* ---------- BLOCK 4: RIGHT SIDEBAR ---------- */
#right-panel {
    top: 88px;
    right: 16px;
    bottom: 16px;
    width: 340px;
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    padding: 20px;
    z-index: 50;
}

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

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

#right-panel .filter-section {
    padding-bottom: 8px;
}

/* Tab bar — segmented-control look */
.rp-tabs {
    background: var(--counter-bg);
    border-radius: 10px;
    padding: 3px;
    margin: 0 0 14px;
    gap: 2px;
}

.rp-tab {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.rp-tab:hover:not(.active) {
    color: var(--text);
}

.rp-tab.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

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

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

.rp-legend-bar {
    background: linear-gradient(90deg, #FEF3C7 0%, #FCD34D 35%, #F59E0B 65%, #DC2626 100%);
}

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

.top-locations-item {
    border-radius: 12px;
    padding: 14px;
    background: var(--card-bg);
}

.top-locations-item:hover,
.top-locations-item.top-locations-item--active {
    background: var(--primary-light-2);
    transform: translateX(-2px);
}

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

/* Area Overview — already aligned with designer; minor tightening */
.area-overview-panel {
    padding-top: 0;
    gap: 12px;
    display: flex;
    flex-direction: column;
}

.ao-card {
    box-shadow: none;
}

.ao-similar-btn {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
}

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

.ao-report-btn {
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    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;
}

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

.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 */
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
}

.hi-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hi-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 8px;
}

.hi-stat-row .lbl {
    color: var(--text-secondary);
}

.hi-stat-row .val {
    font-weight: 600;
    color: var(--text);
}

/* ---------- BLOCK 3: FLOATING TOP BAR ---------- */
/* Sidebar now owns the brand → repurpose #top-panel as a floating right-side controls bar */
#top-panel {
    position: fixed;
    top: 16px;
    left: 336px; /* sidebar 320 + gap 16 */
    right: 16px;
    height: auto;
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 8px 16px;
    z-index: 900;
}

.top-panel-content {
    gap: 16px;
    padding-bottom: 0;
    justify-content: flex-end;
}

/* Brand is in left sidebar now — hide here */
.top-panel-header {
    display: none !important;
}

.top-panel-controls {
    gap: 10px;
    flex: 0 0 auto;
}

/* Viewport badge — pill */
.viewport-coverage-badge {
    background: var(--counter-bg);
    color: var(--counter-text);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Perfect-score toggle — pill */
.perfect-toggle {
    background: var(--counter-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

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

/* AI Analysis button — primary CTA */
.btn-ai-analysis {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--primary-tint);
    transition: background 0.15s, box-shadow 0.15s;
}

.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 {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-btn);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.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);
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
}

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

/* Biz config + Competitors pills bar — restyle to designer */
.map-top-bar {
    /* Designer: centered floating pill bar at top */
    top: 16px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    align-items: flex-start;
}

.map-top-bar-pills {
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-card);
}

.map-top-bar-pill {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
}

.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 {
    background: var(--border);
}

.tb-label {
    color: var(--text-tertiary);
}

/* ---------- BLOCK 5: PROFILE PANEL (auth-* polish) ---------- */
.auth-profile-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    padding: 6px;
    min-width: 240px;
    margin-top: 8px;
}

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

.auth-dropdown-name {
    color: var(--text);
    font-weight: 700;
    font-size: 13.5px;
}

.auth-dropdown-email {
    color: var(--text-secondary);
    font-size: 12px;
}

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

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

.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;
}

/* ---------- BLOCK 6: REPORT MODAL header AI button ---------- */
/* 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 {
    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 {
    flex: 1;
    min-width: 0;
}

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

.rm-biz-badge {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
}

.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);
}

/* ---------- BLOCK 7: ONBOARDING MODAL polish (token alignment) ---------- */
.modal-content {
    background: var(--modal-bg);
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-modal);
    color: var(--text);
}

.modal-content h2 {
    color: var(--text);
    font-weight: 700;
}

.modal-content > p {
    color: var(--text-secondary);
}

.modal-content .survey-question-text {
    color: var(--text);
    font-weight: 700;
}

.modal-content .survey-disclaimer {
    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-row {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    padding: 12px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sh-search-row:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--primary-tint);
}

.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-bookmark-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--counter-bg);
    border-radius: 8px;
    font-size: 12.5px;
}

.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;
}

/* ============================================================
   BLOCK 9 — TOP PANEL: align to designer (mapinamo_demo_180526)
   The designer's layout has no central top bar — only a
   compact profile-cluster top-right (bookmarks + profile).
   Override BLOCK 3 here: strip the card chrome and hide
   elements that don't appear in the designer's design.
   ============================================================ */

/* Brand logo: support <img> in .lsb-logo (drop solid M box) */
.lsb-logo {
    background: transparent !important;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}
img.lsb-logo {
    width: 30px;
    height: 30px;
    padding: 0;
    box-shadow: none;
}

/* Top panel reduced to designer's profile-panel cluster */
#top-panel {
    left: auto !important;
    right: 16px !important;
    top: 16px !important;
    width: auto !important;
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    z-index: 200;
}

.top-panel-content {
    gap: 8px !important;
    padding: 0 !important;
    justify-content: flex-end;
}

.top-panel-controls {
    gap: 8px !important;
}

/* 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 {
    top: 0 !important;
    height: 100vh !important;
}

/* 5/5 toggle row inside sidebar */
.lsb-perfect-row {
    padding: 10px 18px 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) */
#top-panel .btn-favorites {
    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);
    color: var(--text-tertiary);
    font-size: 16px;
    transition: all 0.2s;
}
#top-panel .btn-favorites:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 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);
}

/* ── Block 10 — Tooltip hiding + AI col full-report footer ── */

/* 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; }


/* ── Block 11 — Area Overview panel layout, sticky footer, bookmark btn ── */

/* Override panel padding — now handled by ao-scroll-area */
.area-overview-panel {
    padding: 0 !important;
    overflow: hidden !important;
    gap: 0 !important;
}

/* Scrollable inner area */
.ao-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 12px;
    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;
    padding: 10px 18px 18px;
    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;
}

/* 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;
}

/* ── Block 12 — Legend position + title frame + planning-suitability normalise ── */

/* Move legend to be tighter to the sidebar top-left corner */
.map-color-control {
    top: 82px !important;
    left: 384px !important;
}

/* 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 {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 0 4px !important;
    overflow: visible !important;
}
