:root {
    --bg-dark: #ffffff;
    --bg-main: #f8fafb;
    --bg-light: #f0f4f8;
    --bg-card: #ffffff;
    --bg-secondary: #f5f7fa;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #8896a6;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-dark: #1e40af;
    --border-color: #e2e8f0;
    --border-light: #edf2f7;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(135deg, #f0f4f8 0%, #e8f0f7 50%, #f5f8fc 100%);
    background-size: 20px 20px, 100% 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
    text-align: right;
    color: var(--text-primary);
    position: relative;
    overflow: auto;
}

body.results-mode {
    justify-content: flex-start;
    padding: 0 16px 24px 16px;
    overflow-y: auto;
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.04), transparent);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    z-index: 0;
}

/* ═══════ CONTAINER / FORM ═══════ */
.container {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(37,99,235,0.06), 0 20px 80px rgba(0,0,0,0.06);
    padding: 36px;
    max-width: 640px;
    width: 100%;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(30px);
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

.container.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    max-width: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.container::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,0.3), transparent);
    opacity: 0.5;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    position: relative;
    z-index: 2;
}

.header-text { text-align: center; }

h1 {
    color: var(--text-primary);
    font-size: 2.4em;
    font-weight: 700;
    margin: 0;
    letter-spacing: -1px;
    font-family: 'Space Mono', monospace;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin: 4px 0 0 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.form-section {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.address-fields-grid {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.form-group { margin-bottom: 14px; }

.form-label {
    display: block;
    color: var(--text-primary);
    font-size: 0.7em;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    background: #ffffff;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.text-input::placeholder { color: var(--text-muted); opacity: 0.6; }

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(37,99,235,0.15);
}

.text-input-number {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    background: #ffffff;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.text-input-number::placeholder { color: var(--text-muted); opacity: 0.6; }
.text-input-number:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 12px rgba(37,99,235,0.15); }

/* ═══════ AUTOCOMPLETE DROPDOWN ═══════ */
.ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: -2px;
}

.ac-dropdown.visible { display: block; }

.ac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

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

.ac-item:hover,
.ac-item.active {
    background: rgba(37,99,235,0.08);
}

.ac-street {
    font-weight: 600;
}

.ac-hood {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: auto;
    padding-right: 8px;
}

/* Optional fields */
.optional-section {
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
    animation: slideDown 0.6s ease;
    transition: all 0.3s ease;
}

.optional-section:hover {
    box-shadow: 0 0 20px rgba(37,99,235,0.06);
    border-color: var(--border-color);
}

.form-group-compact { margin-bottom: 8px; }

.form-label-compact {
    display: inline-block;
    color: var(--text-primary);
    font-size: 0.65em;
    font-weight: 600;
    margin-right: 6px;
    min-width: 60px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.optional-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.radio-group-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.radio-label-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
}

.radio-label-inline:hover { color: var(--text-primary); }

.radio-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
    appearance: none;
    border: 2px solid var(--border-color);
    background: #ffffff;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.radio-input:checked {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--accent);
}

.radio-input:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.text-input-compact {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82em;
    background: #ffffff;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.text-input-compact::placeholder { color: var(--text-muted); opacity: 0.5; }
.text-input-compact:focus { outline: none; border-color: var(--accent); }

.room-selector-compact {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.82em;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.room-selector-compact:focus { outline: none; border-color: var(--accent); }

/* ═══════ BUTTONS ═══════ */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 24px rgba(37,99,235,0.15);
    border: 1px solid #2563eb;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 36px rgba(37,99,235,0.3);
}

.btn-new-analysis {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-new-analysis:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.28);
}

/* ═══════ RESULTS CONTAINER ═══════ */
.properties-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.properties-container.results-view {
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: none;
    margin: 0 auto;
    padding: 12px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: visible;
    background: transparent;
    gap: 16px;
}

/* ═══════ TITLE CARD ═══════ */
.title-card {
    background: linear-gradient(135deg,
        rgba(30, 64, 175, 0.55),
        rgba(13, 71, 161, 0.45),
        rgba(37, 99, 235, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    padding: 18px 28px;
    margin: 0;
    box-shadow:
        0 8px 32px rgba(30, 64, 175, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    animation: slideDown 0.4s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
}

/* Expanded header state when scrolling */
.title-card.scrolled {
    border-radius: 0 0 14px 14px;
    margin: 0 -20px;
    padding: 14px 28px;
    border-top: none;
    box-shadow:
        0 4px 24px rgba(30, 64, 175, 0.30),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.title-card-content h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 3px;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.title-address {
    font-size: 19px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.title-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ═══════ RESULTS LAYOUT ═══════ */
.results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* ═══════ OVERALL SCORE CARD ═══════ */
.score-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    gap: 32px;
    align-items: center;
    backdrop-filter: blur(20px);
    animation: slideDown 0.5s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.sc-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.sc-ring {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.sc-ring svg {
    width: 100%;
    height: 100%;
}

.sc-ring-fill {
    transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1);
}

.sc-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

.sc-number {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.sc-max {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}



.sc-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sc-breakdown-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.sc-bd-label {
    width: 110px;
    flex-shrink: 0;
    text-align: right;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-wrap: nowrap;
}

.sc-bd-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.sc-bd-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(.4,0,.2,1);
}

.sc-bd-val {
    font-weight: 700;
    font-size: 12px;
    width: 28px;
    text-align: left;
    flex-shrink: 0;
}

.sc-bd-weight {
    font-weight: 400;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    margin-right: 2px;
}

.top-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ═══════ MAP ═══════ */
.map-card {
    background: #f3f7fc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* ═══ Map/Aerial toggle bar ═══ */
.map-toggle-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #eaf0f7, #e2eaf3);
    border-bottom: 1px solid var(--border-color);
}

.map-toggle-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.map-toggle-btn.active {
    background: #fff;
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.map-toggle-btn:not(.active):hover {
    background: rgba(255,255,255,0.5);
    color: #333;
}

.aerial-govmap-link {
    margin-right: auto;
    margin-left: 0;
    font-size: 11px;
    font-weight: 600;
    color: #4a90d9;
    text-decoration: none;
    background: #e8f0fe;
    padding: 3px 10px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.aerial-govmap-link:hover {
    background: #4a90d9;
    color: #fff;
}

/* ═══ View layers ═══ */
.map-view-layer {
    display: none;
}

.map-view-layer.active {
    display: block;
}

#map {
    width: 100%;
    height: 380px;
}

/* ═══ Aerial image ═══ */
.aerial-img-wrap {
    position: relative;
    overflow: hidden;
    background: #e9eef4;
    min-height: 280px;
}

.aerial-img {
    display: block;
    width: 100%;
    height: auto;
}

.aerial-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(233, 238, 244, 0.8);
}

.aerial-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #ccd5e0;
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ═══ Aerial pin ═══ */
.aerial-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

.aerial-pin-dot {
    width: 14px;
    height: 14px;
    background: #00d084;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,208,132,0.5), 0 2px 8px rgba(0,0,0,0.3);
}

.aerial-pin-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0,208,132,0.4);
    border-radius: 50%;
    animation: aerial-ping 2s ease-out infinite;
}

@keyframes aerial-ping {
    0% { transform: translate(-50%,-50%) scale(0.7); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(1.8); opacity: 0; }
}

/* ═══════ ENVIRONMENT CARD ═══════ */
.env-card {
    background: linear-gradient(135deg, #f3f7fc, #ecf2f9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    flex: 1;
}

.env-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.env-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.env-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(37,99,235,0.04);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.em-icon { font-size: 18px; flex-shrink: 0; }
.em-data { display: flex; flex-direction: column; }
.em-val { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.em-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.2px; font-weight: 500; }

/* Elevation comparison — wider tile */
.elev-metric-wide {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══════ POI OVERVIEW CARD ═══════ */
.poi-card {
    background: linear-gradient(135deg, #f3f7fc, #ecf2f9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    flex: 1;
}

.poi-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.poi-total {
    background: var(--accent);
    color: var(--bg-dark);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
}

.poi-bubbles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.poi-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(37,99,235,0.02);
    opacity: 0.4;
    transition: all 0.2s;
}

.poi-bubble.filled {
    opacity: 1;
    border-color: rgba(37,99,235,0.2);
    background: rgba(37,99,235,0.05);
}

.pb-icon { font-size: 14px; }
.pb-count { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.pb-label { font-size: 9px; color: var(--text-muted); }

/* ═══════ SECTION CARD ═══════ */
.section-card {
    background: linear-gradient(135deg, #f3f7fc, #ecf2f9);
    border: 1px solid var(--border-color);
    border-right: 3px solid rgba(37, 99, 235, 0.25);
    border-radius: 12px;
    padding: 16px 18px;
    animation: slideDown 0.4s ease both;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.3px;
}

/* ═══ Collapsible section toggle ═══ */
.section-title.sec-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.section-title.sec-toggle:hover {
    color: #4a90d9;
}

.sec-chevron {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.sec-collapsed .sec-chevron {
    transform: rotate(-90deg);
}

.sec-count {
    font-size: 11px;
    font-weight: 700;
    background: #4a90d9;
    color: #fff;
    padding: 1px 7px;
    border-radius: 10px;
    margin-right: 2px;
}

.sec-collapsible > .items-grid,
.sec-collapsible > .no-data-inline {
    transition: max-height 0.3s ease, opacity 0.25s ease;
    overflow: hidden;
}

.sec-collapsed > .items-grid,
.sec-collapsed > .no-data-inline {
    max-height: 0 !important;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.sec-collapsed .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ═══════ COMPACT ITEMS ═══════ */
.items-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.items-grid::-webkit-scrollbar { width: 4px; }
.items-grid::-webkit-scrollbar-track { background: transparent; }
.items-grid::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 4px; }

.compact-item {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(37,99,235,0.03);
    transition: all 0.2s ease;
}

.compact-item:hover {
    border-color: var(--accent);
    background: rgba(37,99,235,0.06);
}

.ci-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ci-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.ci-meta {
    font-size: 10.5px;
    color: var(--text-muted);
    background: rgba(37,99,235,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.ci-body {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ci-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ci-meta-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.plan-link-inline {
    font-size: 10px;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(52,152,219,0.08);
    border: 1px solid rgba(52,152,219,0.15);
    transition: all 0.2s;
    white-space: nowrap;
}

.plan-link-inline:hover {
    background: rgba(52,152,219,0.15);
    color: #2980b9;
}

.ci-footer {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.plan-link {
    font-size: 11px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color 0.2s;
}
.ci-plan-purpose {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
    line-height: 1.5;
    padding: 4px 8px;
    background: #f0f7ff;
    border-radius: 4px;
    border-right: 3px solid #3498db;
}
.ci-plan-purpose .purpose-label {
    font-weight: 600;
    color: #3498db;
}
.plan-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ═══════ TRAFFIC DENSITY BAR ═══════ */
.traffic-density-bar {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(37,99,235,0.04);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.td-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.td-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.td-score {
    font-size: 13px;
    font-weight: 700;
}

.td-bar-wrap {
    position: relative;
    padding-top: 22px;
}

.td-track {
    display: flex;
    direction: rtl;
    width: 100%;
    height: 12px;
    background: rgba(37,99,235,0.06);
    border-radius: 6px;
    overflow: hidden;
    gap: 1px;
}

.td-score-marker {
    position: absolute;
    top: 0;
    transform: translateX(50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.td-marker-label {
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.td-marker-line {
    width: 2px;
    height: 12px;
    border-radius: 1px;
    margin-top: 1px;
}

.td-scale {
    position: relative;
    width: 100%;
    height: 18px;
    margin-top: 3px;
}

.td-scale-num {
    position: absolute;
    transform: translateX(50%);
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.8;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    top: 0;
}

.td-scale-num[style*="right:0%"] {
    transform: translateX(100%);
}

.td-scale-num[style*="right:100%"] {
    transform: translateX(0%);
}

.td-scale-tick {
    position: absolute;
    transform: translateX(50%);
    width: 1.5px;
    height: 6px;
    background: var(--text-secondary);
    opacity: 0.45;
    top: 2px;
}

.td-scale-dot {
    position: absolute;
    transform: translateX(50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.35;
    top: 5px;
}

.td-seg {
    height: 100%;
    min-width: 4px;
    transition: width 0.6s ease, opacity 0.2s;
    cursor: pointer;
}

.td-seg:hover {
    opacity: 0.7;
}

.td-bar-tooltip {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 10;
}

.td-bar-tooltip.visible {
    opacity: 1;
}

.td-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.td-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.td-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-secondary);
}

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

/* ═══════ MAP ANALYSIS ═══════ */
.ma-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.ma-title {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.ma-bar-wrap {
    position: relative;
}

.ma-bar {
    display: flex;
    height: 28px;
    border-radius: 7px;
    overflow: hidden;
    background: #eee;
    gap: 1px;
}

.ma-bar-seg {
    transition: width 0.6s ease, opacity 0.2s;
    min-width: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ma-seg-text {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 3px;
    pointer-events: none;
    line-height: 1;
}

.ma-bar-seg:hover {
    opacity: 0.75;
}

/* Parent .ma-bar has border-radius + overflow:hidden, segments need no radius */

.ma-bar-tooltip {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 10;
}

.ma-bar-tooltip.visible {
    opacity: 1;
}

.ma-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.ma-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.ma-legend-item {
    font-size: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 3px;
}

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

.ma-metrics {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.ma-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 6px 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ma-metric-val {
    font-size: 17px;
    font-weight: 700;
}

.ma-metric-label {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    font-weight: 500;
}

/* ═══════ NOISE FACTORS ═══════ */
.noise-tag {
    font-size: 10.5px;
    color: var(--text-secondary);
    background: rgba(37,99,235,0.06);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 500;
}

/* Noise row: score + inline factors */
.env-noise-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.env-noise-row .env-metric {
    flex-shrink: 0;
}

.noise-factors-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* ═══════ PLAN TABS ═══════ */
.plans-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(37,99,235,0.05);
    border-radius: 8px;
    padding: 3px;
}

.plans-tab {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.plans-tab:hover {
    color: var(--text-primary);
    background: rgba(37,99,235,0.08);
}

.plans-tab.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

.plans-tab .sec-count {
    font-size: 10px;
    margin-right: 4px;
    opacity: 0.8;
}

.plans-tab-content {
    display: none;
}

.plans-tab-content.active {
    display: block;
}

/* ═══════ METRIC INFO TOOLTIP (all env cubes) ═══════ */
.metric-has-info {
    position: relative;
}

.metric-info-trigger {
    position: absolute;
    top: 3px;
    left: 3px;
    cursor: help;
    line-height: 1;
    color: var(--text-muted);
}

.metric-info-svg {
    width: 13px;
    height: 13px;
    display: block;
    transition: opacity 0.2s;
}

.metric-info-trigger:hover .metric-info-svg {
    opacity: 1 !important;
}

.metric-info-trigger:hover .metric-info-svg circle { opacity: 0.7; }
.metric-info-trigger:hover .metric-info-svg text { opacity: 0.8; }

.metric-info-tip {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: -20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    width: 220px;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    direction: rtl;
    text-align: right;
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-secondary);
    pointer-events: none;
}

.metric-info-trigger:hover .metric-info-tip {
    display: block;
}

.metric-info-tip strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    font-size: 11.5px;
}

/* ═══════ COMMUNITY COMPLAINTS ═══════ */
.complaints-content {
    padding: 4px 0;
}

.complaints-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 0;
}

.complaints-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.complaints-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.complaint-item {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    padding: 6px 10px;
    background: rgba(37,99,235,0.04);
    border-radius: 6px;
    border-right: 3px solid var(--accent);
}

.complaints-note {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

/* ═══════ BADGES ═══════ */
.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-red { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.badge-yellow { background: rgba(245,166,35,0.15); color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.badge-green { background: rgba(0,208,132,0.15); color: #00d084; border: 1px solid rgba(0,208,132,0.3); }

/* ═══════ NO DATA ═══════ */
.no-data-inline {
    padding: 12px;
    text-align: center;
    color: var(--accent);
    font-size: 12.5px;
    background: rgba(37,99,235,0.05);
    border-radius: 8px;
    border: 1px dashed rgba(37,99,235,0.2);
}

/* ═══════ POI DETAIL GRID ═══════ */
.poi-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.poi-category {
    background: rgba(37,99,235,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.poi-cat-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.poi-count {
    background: var(--accent);
    color: var(--bg-dark);
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
    margin-right: auto;
}

.poi-cat-list { display: flex; flex-direction: column; gap: 3px; }

.poi-cat-item {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 3px 0;
    border-bottom: 1px solid rgba(37,99,235,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poi-sub {
    font-size: 9.5px;
    color: var(--text-muted);
    margin-right: 4px;
}

.poi-cat-more {
    font-size: 10px;
    color: var(--accent);
    text-align: center;
    padding-top: 3px;
    cursor: pointer;
    border-radius: 4px;
    padding: 4px 6px;
    transition: background 0.2s, color 0.2s;
    font-weight: 600;
    user-select: none;
}

.poi-cat-more:hover {
    background: rgba(37,99,235,0.1);
    color: #1d4ed8;
}

/* ═══════ SUMMARY ═══════ */
.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.summary-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.summary-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.summary-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ═══════ PROGRESS CARD ═══════ */
.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 20px 14px;
    margin-bottom: 0;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.progress-status-icon { font-size: 18px; }

.progress-status-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-track {
    height: 5px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-steps {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pstep {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pstep-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(37,99,235,0.08);
    font-weight: 600;
}

.pstep-done {
    border-color: transparent;
    color: var(--text-muted);
    background: rgba(37,99,235,0.04);
    text-decoration: line-through;
    opacity: 0.5;
}

/* ═══════ EARLY MAP CARD ═══════ */
.early-map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.early-map-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.emap-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.early-map-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    height: 260px;
}

#early-map {
    width: 100%;
    height: 260px;
}

/* AI unavailable state */
.summary-unavailable {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    margin-top: 10px;
}
.su-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.su-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.su-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ═══════ NEIGHBORHOOD PRICES ═══════ */
.neighborhood-prices-content {
    padding: 0 4px;
}

/* Index badges row */
.np-indexes {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.np-index {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
}
.np-idx-icon { font-size: 18px; }
.np-idx-val {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}
.np-idx-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Room price cards grid */
.np-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.np-room-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.np-room-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.np-room-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
}
.np-change {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
}
.np-up {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}
.np-down {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

/* Chart */
.np-chart-wrapper {
    margin: 10px 0 16px;
}
.np-chart-legend {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.np-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}
.np-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.np-chart-svg {
    width: 100%;
    height: auto;
    max-height: 220px;
}

/* Footer */
.np-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}
.np-source {
    font-size: 11px;
    color: var(--text-muted);
}
.np-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    transition: all 0.2s;
}
.np-link:hover {
    background: var(--accent);
    color: #fff;
}

/* Not found / not supported state */
.np-not-found {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
}
.np-nf-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.np-nf-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.np-nf-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
.np-nf-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.np-nf-text a:hover {
    text-decoration: underline;
}



/* ═══════ HOUSING MIX (תמהיל דיור) ═══════ */
.hm-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hm-donut-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
    padding: 8px 0;
}
.hm-donut {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.hm-donut-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--card-bg);
}
.hm-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}
.hm-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hm-legend-item strong {
    font-weight: 700;
    margin-right: 2px;
    font-size: 15px;
}
/* Room distribution */
.hm-rooms {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
}
.hm-rooms-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}
.hm-rooms-bars {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: flex-end;
    height: 100px;
}
.hm-room-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 50px;
}
.hm-room-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.hm-room-bar-bg {
    width: 24px;
    height: 70px;
    background: rgba(150, 150, 150, 0.15);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.hm-room-bar-fill {
    width: 100%;
    background: linear-gradient(to top, #42A5F5, #66BB6A);
    border-radius: 6px;
    transition: height 0.5s ease;
}
.hm-room-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
/* Extra stats */
.hm-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 8px 0;
}
.hm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.hm-stat-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.hm-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.hm-footer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* ═══════ CRIME REPORTS ═══════ */
.crime-content {
    padding: 0;
}

.crime-types-list {
    margin-top: 12px;
}

.crime-types-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 0 14px;
}

.crime-type-item {
    padding: 6px 14px;
    border-bottom: 1px solid var(--border-light);
}

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

.crime-type-bar-bg {
    height: 6px;
    background: rgba(231,76,60,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.crime-type-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(231,76,60,0.6), rgba(231,76,60,0.9));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.crime-type-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
}

.crime-type-name {
    color: var(--text-primary);
    font-weight: 500;
}

.crime-type-count {
    color: var(--text-secondary);
    font-size: 11px;
}

.crime-expand-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 6px 0;
    background: #f5f8fc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.crime-expand-btn:hover {
    background: #e8f0fe;
    border-color: var(--accent-light);
    color: var(--accent);
}

.crime-footer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 14px 8px;
    border-top: 1px solid var(--border-color);
    line-height: 1.5;
    margin-top: 8px;
}


/* ═══════ LOADING / ERROR ═══════ */
.loading-card {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 16px;
}

.loading-spinner {
    font-size: 14px;
    color: var(--accent-light);
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

.error-card {
    background: rgba(255,100,100,0.08);
    border: 1px solid rgba(255,100,100,0.25);
    border-radius: 10px;
    padding: 14px;
    color: #ff6464;
    text-align: center;
}

.error-card p { margin: 0; font-size: 13px; }

/* ═══════ ANIMATIONS ═══════ */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.form-section {
    transition: all 0.5s ease;
    transform-origin: top center;
}

.form-section.form-hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 900px) {
    .top-row {
        grid-template-columns: 1fr;
    }

    .side-panel {
        flex-direction: row;
    }

    .poi-bubbles {
        grid-template-columns: repeat(4, 1fr);
    }

    .poi-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    body { padding: 10px; }

    .container { padding: 20px; }

    h1 { font-size: 1.8em; }

    .top-row { grid-template-columns: 1fr; }

    .side-panel { flex-direction: column; }

    .poi-bubbles { grid-template-columns: repeat(4, 1fr); }

    .poi-detail-grid { grid-template-columns: 1fr; }

    .properties-container.results-view { padding: 12px; gap: 12px; }

    .title-card {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .title-card.scrolled {
        margin: 0 -12px;
        padding: 10px 18px;
    }

    .title-card-content h2 { font-size: 16px; }
    .title-address { font-size: 16px; }

    .score-card {
        flex-direction: column;
        gap: 16px;
        padding: 20px 16px;
    }

    .sc-main {
        flex-direction: column;
        gap: 12px;
    }

    .sc-ring {
        width: 90px;
        height: 90px;
    }

    .sc-number {
        font-size: 30px;
    }

    .sc-bd-label {
        width: 80px;
        font-size: 10px;
    }

    .address-fields-grid {
        grid-template-columns: 1fr 1fr;
    }

    .env-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════ SCROLLBAR ═══════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 6px; }

/* ═══════ SCORE BREAKDOWN INFO ICONS ═══════ */
.sc-info-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.sc-info-icon {
    color: var(--text-muted);
    transition: color 0.2s;
}

.sc-info-trigger:hover .sc-info-icon {
    color: var(--accent);
}

.sc-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: #333;
    line-height: 1.5;
    white-space: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 210px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    text-align: right;
}

.sc-info-trigger:hover .sc-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ═══════ MA CALCULATION INFO ═══════ */
.ma-calc-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ma-calc-section {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.ma-calc-section strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
}

/* ═══════ SCHOOLS CARD ═══════ */
.schools-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

.sch-stage-group {
    margin-bottom: 8px;
}

.sch-stage-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 8px 14px 6px;
    background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(37,99,235,0.02));
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid rgba(37,99,235,0.15);
    margin-bottom: 8px;
}

.sch-stage-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    opacity: 0.8;
}

.sch-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.2s;
    margin-bottom: 8px;
}

.sch-card:last-child {
    margin-bottom: 0;
}

.sch-card:hover {
    border-color: var(--accent);
}

.sch-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.sch-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sch-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
}

.sch-name:hover {
    color: var(--accent);
    text-decoration: underline;
}

.sch-stage {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    font-weight: 500;
}

.sch-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.sch-dist {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.sch-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.sch-scores {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.sch-score-item {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    cursor: default;
}

.sch-ranks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.sch-rank-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(245, 166, 35, 0.1);
    color: #f5a623;
    border: 1px solid rgba(245, 166, 35, 0.2);
}

.sch-footer {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    opacity: 0.7;
}

/* Stage group sections */
.sch-stage-group {
    margin-bottom: 8px;
}

.sch-stage-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 14px 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2px;
}

.sch-stage-count {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-muted);
}

/* Per-school score badge */
.sch-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.sch-school-score {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.sch-school-score small {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.5;
}

/* Bagrut items - slightly highlighted */
.sch-bagrut {
    font-weight: 500;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════════
   DEBUG MENU PANEL - FIXED POSITION TOP RIGHT
   ═══════════════════════════════════════════════════════════════════════════════ */

.debug-menu-toggle-fixed {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 2000;
}

.debug-menu-toggle-fixed:hover {
    background: var(--bg-light);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.debug-menu-toggle-fixed:active {
    transform: scale(0.95);
}

body.results-mode .debug-menu-toggle-fixed,
body.results-mode .debug-menu-panel-fixed {
    display: none;
}

.debug-menu-panel-fixed {
    position: fixed;
    top: 80px;
    left: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    width: 360px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1999;
    animation: debugMenuSlideIn 0.3s ease;
}

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

.debug-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.debug-menu-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.debug-menu-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.debug-menu-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.debug-menu-content {
    padding: 20px;
}

.debug-option {
    margin-bottom: 20px;
}

.debug-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.debug-toggle-input {
    width: 44px;
    height: 24px;
    appearance: none;
    background: #cbd5e0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.debug-toggle-input:checked {
    background: var(--accent);
}

.debug-toggle-input::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    right: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.debug-toggle-input:checked::before {
    transform: translateX(-20px);
}

.debug-toggle-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.debug-stats {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.debug-stats h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.debug-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.debug-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.debug-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.debug-quick-access {
    margin-top: 24px;
}

.debug-quick-access h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.quick-address-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.quick-address-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.quick-address-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-address-item:hover {
    background: var(--bg-light);
    border-color: var(--accent-light);
    transform: translateX(-2px);
}

.quick-address-text {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.quick-address-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RECENT SEARCHES SECTION (Below Main Card)
   ═══════════════════════════════════════════════════════════════════════════════ */

.recent-searches-section {
    max-width: 640px;
    width: 100%;
    margin: 16px auto 0;
    padding: 0 16px;
    z-index: 1;
}

body.results-mode .recent-searches-section {
    display: none !important;
    margin: 0;
    padding: 0;
    height: 0;
}

.recent-searches-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.recent-searches-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.recent-search-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.recent-search-item:hover {
    background: var(--bg-light);
    border-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.08);
}

.recent-search-item:active {
    transform: translateY(0);
}

.recent-search-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.recent-search-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 12px;
}

/* ═══════════════════════════════════════════════════════════
   CRIME DEBUG PANEL
   ═══════════════════════════════════════════════════════════ */
.crime-debug-panel {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%);
    border: 2px solid #ffcc00;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.15);
}

.crime-debug-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 204, 0, 0.3);
}

.crime-debug-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #cc8800;
    margin: 0 0 12px;
}

/* Debug metrics row */
.crime-debug-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cdm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 14px;
    border-radius: 8px;
    min-width: 70px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}
.cdm-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
}
.cdm-label {
    font-size: 10px;
    color: #8b6914;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
}

/* Threshold bar */
.crime-debug-thresholds {
    margin: 16px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}
.crime-debug-thresholds h5 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #cc8800;
    font-weight: 700;
}
.cdt-bar {
    position: relative;
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: visible;
    margin-bottom: 4px;
}
.cdt-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: filter 0.2s;
}
.cdt-seg:first-child { border-radius: 0 6px 6px 0; }
.cdt-seg:last-child { border-radius: 6px 0 0 6px; }
.cdt-seg:hover { filter: brightness(1.1); }
.cdt-seg-label {
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
}
.cdt-marker {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}
.cdt-marker-arrow {
    font-size: 14px;
    color: #333;
    line-height: 1;
}
.cdt-marker-val {
    position: absolute;
    top: -16px;
    font-size: 11px;
    font-weight: 800;
    color: #333;
    background: rgba(255,255,255,0.9);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cdt-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #8b6914;
    padding: 2px 0;
    font-family: 'Space Mono', monospace;
}

/* Score computation steps */
.crime-debug-steps {
    margin: 16px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}
.crime-debug-steps h5 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #cc8800;
    font-weight: 700;
}
.cds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.cds-table th {
    padding: 6px 8px;
    text-align: right;
    font-weight: 700;
    color: #cc8800;
    border-bottom: 1px solid #ffe066;
    font-size: 11px;
}
.cds-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #fff5cc;
}
.cds-table .cds-detail {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}
.cds-table .cds-base td {
    color: #888;
    font-style: italic;
}
.cds-table .cds-final td {
    border-top: 2px solid #ffcc00;
    padding-top: 8px;
}

/* Crime breakdown table */
.crime-debug-table-wrap {
    max-height: 500px;
    overflow-y: auto;
    margin: 16px 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #ffe066;
}
.crime-debug-table-wrap h5 {
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    color: #cc8800;
    font-weight: 700;
    background: linear-gradient(to bottom, #fff9e6, #fff5cc);
    border-bottom: 1px solid #ffe066;
    position: sticky;
    top: 0;
    z-index: 11;
}

.crime-debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.crime-debug-table thead {
    position: sticky;
    top: 36px;
    background: linear-gradient(to bottom, #fff9e6, #fff5cc);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.crime-debug-table th {
    padding: 8px 6px;
    text-align: right;
    font-weight: 700;
    color: #cc8800;
    border-bottom: 2px solid #ffcc00;
    font-size: 11px;
    white-space: nowrap;
}

.crime-debug-table td {
    padding: 6px;
    border-bottom: 1px solid #fff5cc;
    vertical-align: middle;
}

.crime-debug-table tbody tr:hover {
    background: #fffef5;
}

.crime-debug-table .crime-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 250px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.crime-tier-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.crime-debug-table .crime-type {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 150px;
}

.crime-debug-table .crime-count {
    text-align: center;
    font-weight: 700;
    color: #e74c3c;
}

.crime-debug-table .crime-weight {
    text-align: center;
}

.crime-debug-table .crime-contribution {
    text-align: center;
    font-size: 12px;
}

.crime-debug-table .crime-contribution strong {
    color: #2563eb;
    font-weight: 700;
}

.crime-debug-table .contribution-pct {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    font-family: 'Space Mono', monospace;
}

.crime-debug-table .crime-quarters {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.reset-weight-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #8896a6;
    transition: all 0.2s;
}

.reset-weight-btn:hover {
    background: #f0f4f8;
    border-color: #2563eb;
    color: #2563eb;
}

/* Tier legend */
.crime-debug-tiers {
    margin: 16px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}
.crime-debug-tiers h5 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #cc8800;
    font-weight: 700;
}
.cdt-tier-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cdt-tier-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}
.cdt-tier-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cdt-tier-name {
    font-weight: 600;
    color: var(--text-primary);
}
.cdt-tier-range {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}

.crime-debug-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 16px;
}

.crime-debug-btn {
    background: linear-gradient(135deg, #ffcc00 0%, #ffaa00 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(255, 170, 0, 0.3);
}

.crime-debug-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 170, 0, 0.4);
}

.crime-debug-btn:active {
    transform: translateY(0);
}

.crime-debug-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.crime-debug-btn.secondary {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.crime-debug-btn.secondary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.weight-slider-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
}

.weight-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e2e8f0 0%, #ffaa00 50%, #e74c3c 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.weight-slider::-webkit-slider-thumb:hover {
    background: #1e40af;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.4);
}

.weight-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.weight-slider::-moz-range-thumb:hover {
    background: #1e40af;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.4);
}

.weight-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    font-family: 'Space Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════
   COMPARISON MODE
   ═══════════════════════════════════════════════════════════ */

/* Compare button in title card */
.btn-compare-address {
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.3), rgba(46, 204, 113, 0.25));
    color: #ffffff;
    border: 1px solid rgba(0, 208, 132, 0.4);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 208, 132, 0.15);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-compare-address:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 208, 132, 0.35);
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.45), rgba(46, 204, 113, 0.4));
}

/* Compare input row */
.compare-input-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

.compare-fields {
    display: flex;
    gap: 8px;
    position: relative;
}

.compare-fields .ac-dropdown {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border-radius: 0 0 8px 8px;
}

.compare-fields .ac-dropdown .ac-item {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.compare-fields .ac-dropdown .ac-item:hover,
.compare-fields .ac-dropdown .ac-item.active {
    background: rgba(37, 99, 235, 0.3);
}

.compare-fields .ac-dropdown .ac-hood {
    color: rgba(255, 255, 255, 0.5);
}

.compare-city-input,
.compare-street-input,
.compare-apt-input {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.compare-city-input { flex: 1; width: 100%; }
.compare-street-input { flex: 1; width: 100%; }
.compare-apt-input { flex: 1; text-align: center; width: 100%; }

.compare-field-wrap {
    position: relative;
}
.compare-field-city { flex: 2; }
.compare-field-street { flex: 2; }
.compare-field-apt { flex: 0.6; }

.compare-city-input::placeholder,
.compare-street-input::placeholder,
.compare-apt-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.compare-city-input:focus,
.compare-street-input:focus,
.compare-apt-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.18);
}

.compare-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-compare-go {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    border: none;
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-compare-go:hover {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-compare-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-compare-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Loading spinner for compare */
.compare-loading {
    width: 100%;
    text-align: center;
    padding: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.compare-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Comparison header */
.comparison-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.comparison-header .title-card-actions {
    justify-content: center;
}

.comparison-header-addresses {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.comparison-addr {
    flex: 1;
    text-align: center;
}

.comparison-addr-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.comparison-addr-text {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.comparison-vs {
    font-size: 14px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    flex-shrink: 0;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

/* Split container */
.comparison-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

/* Each column */
.comparison-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compact-addr-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.02));
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

/* Compact score card */
.compact-score-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px;
    backdrop-filter: blur(20px);
}

.compact-score-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    justify-content: center;
}

.compact-ring {
    width: 80px;
    height: 80px;
}

.compact-ring .sc-number {
    font-size: 28px;
}

.compact-ring .sc-max {
    font-size: 12px;
}

.compact-score-label {
    font-size: 18px;
    font-weight: 800;
}

.compact-breakdown .sc-breakdown-row {
    font-size: 11px;
}

.compact-breakdown .sc-bd-label {
    width: 100px;
    font-size: 10px;
}

.compact-breakdown .sc-bd-bar {
    min-width: 40px;
}

/* Compact section cards */
.compact-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    transition: box-shadow 0.2s;
}

.compact-section-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.compact-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.compact-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    text-align: center;
}

.compact-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.compact-metric-val {
    font-size: 16px;
    font-weight: 800;
}

.compact-metric-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Compact info grid - more descriptive layout */
.compact-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compact-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s;
}

.compact-info-row:hover {
    background: rgba(37, 99, 235, 0.04);
}

.compact-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.compact-info-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: left;
}

/* Compact POI row */
.compact-poi-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.compact-poi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--bg-secondary);
    min-width: 44px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.compact-poi-item.has-items {
    opacity: 1;
}

.compact-poi-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Responsive comparison */
@media (max-width: 800px) {
    .comparison-split {
        grid-template-columns: 1fr;
    }

    .comparison-header-addresses {
        flex-direction: column;
        gap: 8px;
    }

    .comparison-vs {
        font-size: 12px;
    }

    .compact-score-header {
        flex-direction: column;
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════ */