/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --c-magenta: #C939A3;
    --c-teal: #51A2B6;
    --c-purple: #8B5FA8;
    --c-text: #1a1a1a;
    --c-glass: rgba(255, 255, 255, 0.95);
    --c-border: rgba(0, 0, 0, 0.12);
    --c-border-light: rgba(0, 0, 0, 0.08);
    --c-hover: rgba(0, 0, 0, 0.08);
    --c-input-bg: rgba(0, 0, 0, 0.05);
    --c-magenta-light: rgba(201, 57, 163, 0.15);
    --c-teal-light: rgba(81, 162, 182, 0.15);
    --grad-magenta-teal: linear-gradient(135deg, var(--c-magenta) 0%, var(--c-teal) 100%);
    --grad-rainbow: linear-gradient(90deg, var(--c-teal) 0%, var(--c-purple) 50%, var(--c-magenta) 100%);
    --grad-rainbow-rev: linear-gradient(135deg, var(--c-magenta) 0%, var(--c-purple) 50%, var(--c-teal) 100%);
    --grad-teal-magenta: linear-gradient(90deg, var(--c-teal), var(--c-magenta));
    --radius-card: 12px;
    --radius-btn: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

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

.landing-page,
.about-page {
    min-height: 100vh;
    background: #f5f5f5;
    color: #1a1a1a;
}

.landing-body .about-page {
    background: #eef2fb;
}

.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: #1a1a1a;
}

.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: #fff;
}

.landing-logo-text {
    text-decoration: none;
    color: #1a1a1a;
}

.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: #1a1a1a;
}

.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: #eef2fb;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px 0;
    background-color: #eef2fb;
}

.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: #4b5563;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #111827;
}

.hero-container {
    max-width: 1400px;
    margin: 6px auto 32px;
    background-color: #eef2fb;
    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: #1e293b;
    line-height: 1.1;
    max-width: 900px;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #475569;
    max-width: 640px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-supported {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 28px;
}

.cta-button {
    background-color: #4f46e5;
    color: #ffffff;
    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: #4338ca;
    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: #1e293b;
    margin-bottom: 8px;
}

.landing-contact-intro {
    font-size: 0.95rem;
    color: #475569;
    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: #fff;
    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: #3a8a9a;
    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: #0f766e;
}

.landing-feedback-status-error {
    color: #b91c1c;
}

@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;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.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: #1a1a1a;
    border: 1px solid #1a1a1a;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
    margin-left: auto;
}

#share-btn:hover {
    background: #333;
    border-color: #333;
}

#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: auto;
    overflow-x: hidden;
    padding: 0 0 24px 0;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    transform: translateX(0);
}



#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: #D32F2F;
    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: #D32F2F;
    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: #1a1a1a;
    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: #ffffff;
    color: #1a1a1a;
}



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

.noUi-handle,
.noUi-horizontal .noUi-handle {
    background: #ffffff;
    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: #1a1a1a;
    font-size: 11px;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    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: #1a1a1a;
    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: #1a1a1a;
}

/* Similar hexes legend (analysis map) */
.similar-hex-legend {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    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: #555;
    font-size: 11px;
    font-weight: 500;
}
.similar-hex-clear-btn {
    margin-left: auto;
}
.similar-hex-legend-text {
    color: #555;
}

.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: #1a1a1a;
    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: #1a1a1a;
    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: #1a1a1a;
}

.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: #1a1a1a;
}

.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: #1a1a1a;
    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: #000;
}

/* 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: #ffffff;
    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: monospace;
}

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

.gmaps-link {
    color: #0066cc;
    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: #fff;
    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: #333;
    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: #fff;
    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: #333;
    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%, #0D0887 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;
}

.analysis-score-badge {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #0D0887;
    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: #1a1a1a;
}

#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: #1a1a1a;
}

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

#ai-panel-coords {
    color: #555;
    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: #1a1a1a;
}

.btn-google-maps {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    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: #1a1a1a;
    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: #1a1a1a;
    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: #1a1a1a;
    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: #1a1a1a;
    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: #333;
    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: #1a1a1a;
    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: #333;
    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: #333;
    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: #3a8a9a;
    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: #0D0887;
    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: #dc3545;
    font-size: 13px;
}

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

.info-error p {
    margin: 0;
    line-height: 1.4;
    color: #555;
}

/* Welcome Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(18px) saturate(1.2);
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 48px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    color: rgba(0, 0, 0, 0.5);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #000000;
    transform: rotate(90deg);
}

.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: #1a1a1a;
    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: #1a1a1a;
    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: #1a1a1a;
    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: #1a1a1a;
    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: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 10;
}

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

.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: #1a1a1a;
    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: #333333;
    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: #1a1a1a;
    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: #1a1a1a;
    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: #1a1a1a;
}

.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: #1a1a1a;
    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: #1a1a1a;
}

.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: #1a1a1a;
    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: #1a1a1a; }

.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: #fff;
    color: #1a1a1a;
    font-weight: 600;
    cursor: pointer;
}

.biz-focus-answer-val {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    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: #fff;
    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;
}
.survey-biz-selected {
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(201, 57, 163, 0.1);
    border: 1px solid rgba(201, 57, 163, 0.3);
}
.survey-biz-list {
    display: block;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 6px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

/* We use margin instead of flex gap to separate the categories */
.survey-biz-type-group {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px; 
}

.survey-biz-type-group:last-child {
    margin-bottom: 0;
}

/* Make the Chrome/Safari scrollbar slightly thicker and brighter */
.survey-biz-list::-webkit-scrollbar {
    width: 8px;
}
.survey-biz-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    margin: 4px 0;
}
.survey-biz-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
.survey-biz-type-group {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    overflow: hidden;
}
.survey-biz-type-header {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
    background: rgba(0,0,0,0.04);
}
.survey-biz-type-cats {
    list-style: none;
    margin: 0;
    padding: 2px 0 4px 0;
}
.survey-biz-cat-item {
    font-size: 13px;
    padding: 5px 12px 5px 20px;
    cursor: pointer;
    color: rgba(0,0,0,0.65);
    transition: background 0.15s;
    border-radius: 4px;
}
.survey-biz-cat-item:hover {
    background: rgba(0,0,0,0.05);
}
.survey-biz-cat-item.selected {
    color: var(--c-magenta);
    font-weight: 600;
    background: rgba(201,57,163,0.1);
}

/* City Picker in Survey */
.survey-city-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.survey-city-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 28px;
    padding: 4px 0;
}

.survey-city-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(201,57,163,0.15);
    border: 1px solid rgba(201,57,163,0.4);
    border-radius: 20px;
    font-size: 11px;
    color: #1a1a1a;
}

.survey-city-chip button {
    background: none;
    border: none;
    color: rgba(0,0,0,0.55);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.survey-city-chip button:hover { color: rgba(0,0,0,0.85); }

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

.survey-city-search {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    color: #1a1a1a;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.survey-city-search:focus { border-color: rgba(81,162,182,0.6); }

.survey-city-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 4px;
}

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

.survey-city-option:hover { background: rgba(0,0,0,0.05); }

.survey-city-option.selected {
    background: rgba(201,57,163,0.08);
    color: #1a1a1a;
}

.survey-city-option input[type=checkbox] {
    accent-color: var(--c-magenta);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

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

/* City hierarchy in survey modal */
.survey-city-district {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 2px;
}

.survey-city-district > summary {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(0,0,0,0.6);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.survey-city-district > summary::-webkit-details-marker { display: none; }

.survey-city-district > summary::before {
    content: '▶';
    font-size: 7px;
    transition: transform 0.15s ease;
    color: rgba(0,0,0,0.35);
}

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

.survey-city-district-count {
    font-size: 10px;
    color: rgba(0,0,0,0.4);
    font-weight: 400;
}

.survey-city-district-inner {
    padding: 0 4px 6px 16px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.survey-district-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
}
.survey-district-toggle input[type="checkbox"] {
    accent-color: #ffc107;
    cursor: pointer;
}

.survey-city-all-israel {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    padding: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}



/* Force readable option text inside the white survey modal */
.modal-content .survey-option,
.modal-content .survey-option-label,
.modal-content .survey-biz-cat-item,
.modal-content .survey-biz-type-header,
.modal-content .survey-city-option,
.modal-content .survey-city-district > summary,
.modal-content .survey-city-district-count,
.modal-content .survey-city-none {
    color: rgba(0, 0, 0, 0.72);
}

.modal-content .survey-option.selected,
.modal-content .survey-city-option.selected,
.modal-content .survey-biz-cat-item.selected {
    color: #1a1a1a;
}

/* ── 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: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 8px 16px 6px;
    min-width: 180px;
    max-width: 260px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    pointer-events: auto;
}
.color-legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.color-legend-bar {
    height: 12px;
    border-radius: 6px;
    width: 100%;
}
.color-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
    margin-top: 3px;
}




/* ── Hex Value Tooltip ── */
.hex-value-tooltip {
    position: fixed;
    z-index: 500;
    background: var(--c-glass);
    backdrop-filter: blur(6px);
    color: #222;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.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: #222;
    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-criteria-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    font-weight: 600;
    flex-shrink: 0;
}
.hex-criteria-ans {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
    font-weight: 400;
}
.hex-criteria-score {
    font-size: 12px;
    font-weight: 500;
    color: #444;
    margin-bottom: 5px;
    padding-top: 3px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Right Panel (Competition Filters) */
#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: auto;
    overflow-x: hidden;
    padding: 0 0 24px 0;
    transition: transform 0.3s ease;
    transform: translateX(100%);
}

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

#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: #fff;
    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: #3d8fa0;
    box-shadow: -2px 0 18px rgba(81,162,182,0.4);
}

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

/* 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: #fff;
    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: #0D0887;
}
.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: #e53e3e;
    border-radius: 50%;
    border: 2px solid #fff;
    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: #fff;
    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 #eee;
    background: linear-gradient(135deg, #f8f7ff, #fff);
}
.Claritina-panel-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.Claritina-panel-name {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
    flex: 1;
}
.Claritina-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.Claritina-panel-close:hover { color: #333; }

.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: #333;
}
.Claritina-message strong {
    display: block;
    margin-bottom: 4px;
    color: #1a1a2e;
}
.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: #0D0887;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.Claritina-action-btn:hover { background: #1a10a0; }

.Claritina-highlight {
    outline: 3px solid #0D0887 !important;
    outline-offset: 2px;
    animation: ClaritinaHighlightPulse 0.6s ease 2;
}
@keyframes ClaritinaHighlightPulse {
    0%, 100% { outline-color: #0D0887; }
    50% { outline-color: #6c63ff; }
}

/* 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: #0D0887;
    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 #eee;
}
.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, #0D0887, #6c63ff);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.Claritina-journey-label {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

/* ===== Auth UI ===== */
.auth-login-btn {
    font-size: 12px;
    color: #0D0887;
    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: #333;
}
.auth-logout-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
}
.auth-logout-btn:hover { color: #e53e3e; }

.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: #fff;
    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: #1a1a2e;
}
.auth-modal-content p {
    margin: 0 0 20px;
    font-size: 13px;
    color: #666;
}
#telegram-login-container {
    min-height: 40px;
    display: flex;
    justify-content: center;
}

/* ===== 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: #fff;
    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 #eee;
    font-weight: 700;
    font-size: 14px;
}
.favorites-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}
.favorites-panel-close:hover { color: #333; }
.favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.favorites-empty {
    text-align: center;
    color: #999;
    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: #0D0887; }
.favorites-biz { color: #555; }
.favorites-hex { color: #999; font-size: 11px; font-family: monospace; }
.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: #999;
    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: #1a1a2e;
    color: #e0e0e0;
    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.5);
    position: relative;
}
.keyword-overlay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.keyword-overlay-close:hover { color: #fff; }
.keyword-picker-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.keyword-picker-subtitle {
    font-size: 0.82rem;
    color: #8899aa;
    margin-bottom: 16px;
}
.keyword-group {
    margin-bottom: 14px;
}
.keyword-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6688aa;
    margin-bottom: 6px;
    font-weight: 600;
}
.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.keyword-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid #334;
    background: #222;
    color: #bbb;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}
.keyword-chip:hover { border-color: #51A2B6; color: #ddd; }
.keyword-chip.selected {
    background: #51A2B6;
    color: #fff;
    border-color: #51A2B6;
    font-weight: 600;
}
.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: #333;
    color: #ccc;
}
.keyword-picker-actions .btn-secondary:hover { background: #444; }
.keyword-picker-actions .btn-primary {
    background: #51A2B6;
    color: #fff;
    font-weight: 600;
}
.keyword-picker-actions .btn-primary:hover { background: #429aae; }
#keyword-count-badge {
    font-size: 0.78rem;
    background: rgba(255,255,255,0.2);
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

/* ============================
   Active Filters Panel
   ============================ */
#active-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.metric-filter-card {
    background: #1e1e2e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}
.metric-filter-card.color-active {
    border-color: #51A2B6;
    box-shadow: 0 0 0 1px #51A2B6 inset;
}
.metric-filter-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.metric-filter-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ccc;
    cursor: pointer;
}
.metric-filter-name:hover { color: #fff; }
.metric-filter-color-icon {
    font-size: 0.7rem;
    color: #51A2B6;
    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: #666;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.metric-filter-remove:hover { color: #e44; }
.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: #222;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 4px;
    text-align: center;
}

/* ============================
   Add Filter Dropdown
   ============================ */
#add-filter-wrapper {
    padding: 4px 0;
}
#add-filter-dropdown {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.82rem;
    background: #222;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
}
#add-filter-dropdown:hover { border-color: #51A2B6; }

/* ============================
   Color-By Label
   ============================ */
#color-by-label {
    font-size: 0.78rem;
    color: #8899aa;
    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 #51A2B6;
    background: transparent;
    color: #51A2B6;
    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;
}

