/* ── IDX Market Data WordPress Plugin Styles ──────────────────────────────
   Designed to look clean on any theme. Override with your theme's CSS. */

/* ── Stats Widget ──────────────────────────────────────────────────────── */

.idx-md-stats-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 700px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.idx-md-stats-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.idx-md-stats-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.idx-md-stats-area {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0ea5e9;
    background: #e0f2fe;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.idx-md-stats-period {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
}

.idx-md-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.idx-md-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.idx-md-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.idx-md-stat-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* Color modifiers */
.idx-md-active .idx-md-stat-value,
.idx-md-good   .idx-md-stat-value  { color: #16a34a; }

.idx-md-pending .idx-md-stat-value,
.idx-md-neutral .idx-md-stat-value { color: #d97706; }

.idx-md-sold .idx-md-stat-value,
.idx-md-price .idx-md-stat-value   { color: #0284c7; }

.idx-md-slow .idx-md-stat-value    { color: #dc2626; }

.idx-md-stats-footer {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.idx-md-stats-sync {
    font-size: 0.7rem;
    color: #cbd5e1;
}

/* ── Sold Listings Table ──────────────────────────────────────────────── */

.idx-md-sold-listings {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 900px;
    overflow-x: auto;
}

.idx-md-sold-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem !important;
}

.idx-md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.idx-md-table th {
    text-align: left;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.idx-md-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.idx-md-table tbody tr:hover td {
    background: #f8fafc;
}

.idx-md-table-footer {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem !important;
}

/* ── Report Embed ────────────────────────────────────────────────────── */

.idx-md-report-embed {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.idx-md-report-embed iframe {
    display: block;
}

.idx-md-report-link {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: #0ea5e9;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background 0.15s;
}

.idx-md-report-link:hover { background: #0284c7; }

/* ── Errors / Empty States ───────────────────────────────────────────── */

.idx-md-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.idx-md-empty {
    color: #64748b;
    font-size: 0.875rem;
    font-style: italic;
}

/* ── Responsive (market stats) ───────────────────────────────────────── */

@media (max-width: 480px) {
    .idx-md-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .idx-md-stats-period {
        width: 100%;
        margin-left: 0;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   IDX Property Search Widget
   ══════════════════════════════════════════════════════════════════════ */

.idx-search-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
    width: 100%;
}

.idx-search-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem !important;
    color: #0f172a;
}

/* ── Shared inputs ────────────────────────────────────────────────── */

.idx-input,
.idx-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.idx-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.idx-input:focus,
.idx-select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.idx-input::placeholder { color: #94a3b8; }

/* ── Filter bar (quick search row) ───────────────────────────────── */

.idx-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.idx-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 140px;
    min-width: 120px;
}

.idx-filter-group label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.idx-filter-location { flex: 2 1 200px; }
.idx-filter-price    { flex: 2 1 220px; }

.idx-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.idx-range-inputs .idx-input {
    flex: 1;
    min-width: 0;
}
.idx-range-sep {
    color: #94a3b8;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.idx-price-input::-webkit-inner-spin-button,
.idx-price-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Search button ────────────────────────────────────────────────── */

.idx-btn-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
    align-self: flex-end;
    height: 38px;
}
.idx-btn-search:hover { background: #0284c7; }

/* ── Advanced filters toggle ──────────────────────────────────────── */

.idx-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.idx-btn-advanced {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.idx-btn-advanced:hover { border-color: #0ea5e9; color: #0ea5e9; }

.idx-adv-chevron { transition: transform 0.2s; }

.idx-active-filter-count {
    font-size: 0.75rem;
    color: #0ea5e9;
    background: #e0f2fe;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-weight: 500;
}

/* ── Advanced panel ───────────────────────────────────────────────── */

.idx-advanced-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.idx-adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.idx-adv-col-title {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #94a3b8 !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.idx-adv-col .idx-filter-group { margin-bottom: 0.75rem; }

.idx-field-hint {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    display: block;
}

/* Checkboxes */
.idx-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.idx-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #334155;
}
.idx-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #0ea5e9;
    cursor: pointer;
    flex-shrink: 0;
}

.idx-adv-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.idx-btn-clear {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.15s;
}
.idx-btn-clear:hover { border-color: #94a3b8; color: #334155; }

/* ── Results bar ─────────────────────────────────────────────────── */

.idx-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.idx-results-count {
    font-size: 0.875rem;
    color: #64748b;
}

.idx-sort-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
}
.idx-sort-wrap .idx-select {
    width: auto;
    min-width: 160px;
    padding: 0.35rem 2rem 0.35rem 0.6rem;
}

/* ── Card grid ───────────────────────────────────────────────────── */

.idx-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ── Listing card ────────────────────────────────────────────────── */

.idx-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}
.idx-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

/* Photo or color banner */
.idx-card-photo {
    height: 180px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.idx-card-banner {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.idx-banner-icon { font-size: 2rem; line-height: 1; }
.idx-banner-type {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
}

.idx-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.idx-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.idx-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

/* Status badges */
.idx-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.idx-badge-active    { background: #dcfce7; color: #15803d; }
.idx-badge-pending   { background: #fef9c3; color: #a16207; }
.idx-badge-sold      { background: #dbeafe; color: #1d4ed8; }
.idx-badge-withdrawn { background: #f1f5f9; color: #64748b; }

.idx-card-address {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 !important;
    line-height: 1.3;
}

.idx-card-city {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 !important;
}

/* Feature chips */
.idx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}
.idx-chip {
    background: #f1f5f9;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

/* Feature tags (pool, waterfront, etc.) */
.idx-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.idx-feature-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    letter-spacing: 0.03em;
}
.idx-tag-new   { background: #fef9c3; color: #854d0e; }
.idx-tag-water { background: #dbeafe; color: #1e40af; }
.idx-tag-pool  { background: #e0f2fe; color: #0369a1; }

.idx-card-details {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0 !important;
}

.idx-card-school {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0 !important;
}

.idx-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f8fafc;
}

.idx-card-dom {
    font-size: 0.7rem;
    color: #94a3b8;
}

.idx-tour-link {
    font-size: 0.7rem;
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
}
.idx-tour-link:hover { text-decoration: underline; }

.idx-card-mls {
    font-size: 0.65rem;
    color: #cbd5e1;
    margin-top: 0.25rem;
}

/* ── Pagination ──────────────────────────────────────────────────── */

.idx-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 0;
}

.idx-page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.idx-page-btn:hover:not(:disabled) { border-color: #0ea5e9; color: #0ea5e9; }
.idx-page-btn:disabled { opacity: 0.4; cursor: default; }

.idx-page-info { font-size: 0.8rem; color: #94a3b8; }

/* ── State displays ──────────────────────────────────────────────── */

.idx-state-loading,
.idx-state-empty,
.idx-state-initial {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.idx-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: idx-spin 0.7s linear infinite;
}
@keyframes idx-spin { to { transform: rotate(360deg); } }

.idx-btn-clear-empty {
    margin-top: 0.25rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .idx-filter-bar {
        flex-direction: column;
    }
    .idx-filter-group {
        flex: 1 1 100%;
    }
    .idx-btn-search {
        width: 100%;
        justify-content: center;
    }
    .idx-adv-grid {
        grid-template-columns: 1fr;
    }
    .idx-cards-grid {
        grid-template-columns: 1fr;
    }
    .idx-results-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .idx-md-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .idx-md-stats-period {
        width: 100%;
        margin-left: 0;
    }
}

/* ── AI Search Bar ─────────────────────────────────────────────────────────── */

.idx-ai-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 100%);
    border: 1px solid #2d3f5e;
    border-radius: 14px;
    padding: 1.5rem 1.75rem 1.25rem;
    margin-bottom: 0;
}

.idx-ai-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7dd3fc;
    margin-bottom: 0.875rem;
}

.idx-ai-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.idx-ai-input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    border: 1.5px solid #2d3f5e;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #f1f5f9;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}

.idx-ai-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
    background: rgba(255,255,255,0.06);
}

.idx-ai-input::placeholder { color: #3d5478; }

.idx-btn-ai-search {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 12px rgba(14,165,233,0.35);
}

.idx-btn-ai-search:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(14,165,233,0.45);
}

.idx-btn-ai-search:active { transform: translateY(0); opacity: 1; }

.idx-ai-examples {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #3d5478;
    line-height: 1.6;
}

.idx-ai-example {
    color: #60a5fa;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(96,165,250,0.35);
    text-underline-offset: 2px;
    transition: color 0.12s;
}

.idx-ai-example:hover { color: #93c5fd; text-decoration-color: rgba(147,197,253,0.6); }

.idx-ai-parsed {
    margin-top: 0.875rem;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.idx-ai-parsed-label {
    font-size: 0.75rem;
    color: #4a6080;
    margin-right: 0.25rem;
}

.idx-ai-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    background: rgba(14,165,233,0.12);
    border: 1px solid rgba(14,165,233,0.28);
    border-radius: 999px;
    font-size: 0.78rem;
    color: #7dd3fc;
    font-weight: 500;
}

/* ── Mode divider ──────────────────────────────────────────────────────────── */

.idx-mode-divider {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.25rem 0 1rem;
    color: #475569;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.idx-mode-divider::before,
.idx-mode-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #1e293b;
}

.idx-mode-divider span {
    padding: 0 0.875rem;
    white-space: nowrap;
}

/* ── Responsive: AI bar ────────────────────────────────────────────────────── */

@media (max-width: 540px) {
    .idx-ai-input-row { flex-direction: column; align-items: stretch; }
    .idx-btn-ai-search { justify-content: center; }
    .idx-ai-bar { padding: 1.25rem 1rem 1rem; }
}

/* ============================================================
   IDX Property Visualizer Widget
   ============================================================ */

.idx-viz-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  border: 1px solid #1e3250;
  border-radius: 14px;
  overflow: hidden;
  color: #e2e8f0;
  margin: 1.5rem 0;
}

/* ── Header ── */
.idx-viz-header {
  padding: 1.1rem 1.4rem 0.9rem;
  border-bottom: 1px solid #1e3250;
}
.idx-viz-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #f0f6ff;
  margin: 0 0 0.2rem;
}
.idx-viz-title svg {
  width: 18px; height: 18px;
  color: #818cf8;
  flex-shrink: 0;
}
.idx-viz-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

/* ── Stage: before / after comparison ── */
.idx-viz-stage {
  position: relative;
  width: 100%;
  min-height: 260px;
  background: #0a0f1e;
  user-select: none;
  cursor: crosshair;
}
.idx-viz-before-wrap,
.idx-viz-after-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: clip-path 0s; /* instant when dragging */
}
/* Stacking: before on top by default, both layered */
.idx-viz-before-wrap { z-index: 2; }
.idx-viz-after-wrap  { z-index: 1; }

.idx-viz-before-img,
.idx-viz-result-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* No-photo placeholder */
.idx-viz-no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 260px;
  color: #334155;
}
.idx-viz-no-photo svg {
  width: 52px; height: 52px;
  opacity: 0.4;
}
.idx-viz-no-photo p {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

/* After placeholder (waiting state) */
.idx-viz-after-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 260px;
  color: #334155;
}
.idx-viz-after-placeholder svg {
  width: 52px; height: 52px;
  opacity: 0.25;
}
.idx-viz-after-placeholder p {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
  text-align: center;
  max-width: 200px;
}

/* Loading spinner */
.idx-viz-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(10,15,30,0.82);
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.idx-viz-loading[style*="display: "]:not([style*="display: none"]) {
  display: flex !important;
}
.idx-viz-spinner {
  width: 44px; height: 44px;
  border: 3px solid #1e3250;
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: idx-spin 0.8s linear infinite;
}
@keyframes idx-spin { to { transform: rotate(360deg); } }
.idx-viz-loading p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
}
.idx-viz-loading-steps {
  font-size: 0.78rem !important;
  color: #475569 !important;
  animation: idx-pulse 2s ease-in-out infinite;
}
@keyframes idx-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* Before / after labels */
.idx-viz-label-before,
.idx-viz-label-after {
  position: absolute;
  top: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 4;
}
.idx-viz-label-before {
  left: 0.75rem;
  background: rgba(0,0,0,0.55);
  color: #e2e8f0;
}
.idx-viz-label-after {
  right: 0.75rem;
  background: rgba(99,102,241,0.85);
  color: #fff;
}

/* Drag handle */
.idx-viz-slider-handle {
  display: none; /* shown by JS after result */
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  background: #818cf8;
  z-index: 6;
  cursor: ew-resize;
  transform: translateX(-50%);
}
.idx-viz-slider-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 2px 8px rgba(99,102,241,0.6);
}
.idx-viz-slider-handle::after {
  content: '◀ ▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 0px));
  color: #fff;
  font-size: 8px;
  pointer-events: none;
  white-space: nowrap;
}

/* Action bar (download / reset) */
.idx-viz-action-bar {
  display: none;
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  display: flex;
  gap: 0.5rem;
  display: none; /* toggled by JS */
}
.idx-viz-download-btn,
.idx-viz-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.idx-viz-download-btn {
  background: rgba(30,50,80,0.92);
  color: #93c5fd;
  border: 1px solid #2d3f5e;
}
.idx-viz-download-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.idx-viz-reset-btn {
  background: rgba(30,50,80,0.92);
  color: #f87171;
  border: 1px solid #2d3f5e;
}
.idx-viz-reset-btn:hover { opacity: 0.85; }
.idx-viz-download-btn svg,
.idx-viz-reset-btn svg { width: 13px; height: 13px; }

/* ── Controls panel ── */
.idx-viz-controls {
  padding: 1.1rem 1.4rem 1.4rem;
}

/* Preset grid */
.idx-viz-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.idx-viz-preset-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.idx-viz-preset-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.idx-viz-preset {
  background: #1a2744;
  color: #cbd5e1;
  border: 1px solid #2d3f5e;
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.8rem;
}
.idx-viz-preset:focus {
  outline: none;
  border-color: #818cf8;
  background-color: #1e2f55;
}

/* Applied chips */
.idx-viz-applied {
  display: none; /* shown by JS when chips exist */
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.idx-viz-applied-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.idx-viz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
}
.idx-viz-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 20px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.idx-viz-chip svg {
  width: 10px; height: 10px;
  flex-shrink: 0;
}
.idx-viz-clear-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.idx-viz-clear-btn:hover { color: #f87171; }

/* Free-text input row */
.idx-viz-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.idx-viz-textarea {
  flex: 1;
  background: #1a2744;
  color: #e2e8f0;
  border: 1px solid #2d3f5e;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
  transition: border-color 0.15s;
  font-family: inherit;
}
.idx-viz-textarea::placeholder { color: #475569; }
.idx-viz-textarea:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.idx-viz-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
  align-self: flex-end;
}
.idx-viz-generate-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.5);
}
.idx-viz-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.idx-viz-generate-btn svg { width: 16px; height: 16px; }

/* Intensity slider */
.idx-viz-intensity-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.idx-viz-intensity-label { white-space: nowrap; }
.idx-viz-strength-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #6366f1 0%, #8b5cf6 100%);
  outline: none;
  cursor: pointer;
}
.idx-viz-strength-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
  cursor: pointer;
}
.idx-viz-strength-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #818cf8;
  border: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
  cursor: pointer;
}
.idx-viz-strength-value {
  min-width: 100px;
  text-align: right;
  color: #a5b4fc;
  font-weight: 600;
}

/* Hint text */
.idx-viz-hint {
  font-size: 0.75rem;
  color: #334155;
  margin-top: 0.25rem;
}
.idx-viz-hint kbd {
  background: #1e3250;
  border: 1px solid #2d3f5e;
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  font-family: inherit;
  font-size: 0.72rem;
}

/* Error */
.idx-viz-error {
  display: none;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  color: #fca5a5;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .idx-viz-presets {
    grid-template-columns: 1fr 1fr;
  }
  .idx-viz-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .idx-viz-generate-btn {
    justify-content: center;
  }
  .idx-viz-intensity-row {
    flex-wrap: wrap;
  }
  .idx-viz-strength-value {
    text-align: left;
  }
}
@media (max-width: 400px) {
  .idx-viz-presets {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   IDX CMA Widget
   ============================================================ */

.idx-cma-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  border: 1px solid #1e3250;
  border-radius: 14px;
  overflow: hidden;
  color: #e2e8f0;
  margin: 1.5rem 0;
}

/* ── Header ── */
.idx-cma-header {
  padding: 1.2rem 1.5rem 1rem;
  border-bottom: 1px solid #1e3250;
}
.idx-cma-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f0f6ff;
  margin: 0 0 0.25rem;
}
.idx-cma-title svg { width: 18px; height: 18px; color: #38bdf8; flex-shrink: 0; }
.idx-cma-subtitle { margin: 0; font-size: 0.82rem; color: #64748b; }

/* ── Form ── */
.idx-cma-form { padding: 1.2rem 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }

.idx-cma-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.idx-cma-full-row { grid-template-columns: 1fr 200px; }
.idx-cma-field { display: flex; flex-direction: column; gap: 0.3rem; }
.idx-cma-field--narrow { max-width: 200px; }

.idx-cma-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.idx-cma-hint { font-size: 0.7rem; color: #334155; margin-top: 0.15rem; }

.idx-cma-input {
  background: #1a2744;
  color: #e2e8f0;
  border: 1px solid #2d3f5e;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.idx-cma-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}
.idx-cma-input::placeholder { color: #334155; }
select.idx-cma-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.8rem;
  cursor: pointer;
}

/* Amenity toggles */
.idx-cma-amenities-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.idx-cma-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}
.idx-cma-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #38bdf8;
  cursor: pointer;
}

/* Advanced collapse */
.idx-cma-advanced { border: 1px solid #1e3250; border-radius: 8px; overflow: hidden; }
.idx-cma-advanced-toggle {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  list-style: none;
  background: #0d1b2e;
}
.idx-cma-advanced-toggle::-webkit-details-marker { display: none; }
.idx-cma-advanced[open] .idx-cma-advanced-toggle { border-bottom: 1px solid #1e3250; }
.idx-cma-advanced-fields { padding: 0.85rem; background: #0d1b2e; }

/* Action row */
.idx-cma-action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.idx-cma-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(56,189,248,0.35);
  white-space: nowrap;
}
.idx-cma-submit-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56,189,248,0.45);
}
.idx-cma-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.idx-cma-submit-btn svg { width: 16px; height: 16px; }
.idx-cma-sizing-note { font-size: 0.75rem; color: #334155; }

/* Loading */
.idx-cma-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
}
.idx-cma-loading[style*="display: "]:not([style*="display: none"]) { display: flex !important; }
.idx-cma-spinner {
  width: 40px; height: 40px;
  border: 3px solid #1e3250;
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: idx-spin 0.8s linear infinite;
}
.idx-cma-loading p { margin: 0; font-size: 0.85rem; color: #94a3b8; }
.idx-cma-loading-sub { font-size: 0.76rem !important; color: #475569 !important; animation: idx-pulse 2s ease-in-out infinite; }

/* Error */
.idx-cma-error {
  display: none;
  margin: 0 1.5rem 1rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  color: #fca5a5;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
}

/* ── Results ── */
.idx-cma-results { padding: 0 1.5rem 1.5rem; }

/* Value banner */
.idx-cma-value-banner {
  background: linear-gradient(135deg, #0c1f3f, #132040);
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.1rem;
  text-align: center;
}
.idx-cma-value-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin-bottom: 0.35rem;
}
.idx-cma-value-point {
  font-size: 2rem;
  font-weight: 800;
  color: #f0f9ff;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.idx-cma-value-range { font-size: 0.88rem; color: #93c5fd; margin-bottom: 0.3rem; }
.idx-cma-value-meta  { font-size: 0.76rem; color: #475569; }

/* Search summary */
.idx-cma-search-summary {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.idx-cma-search-summary strong { color: #94a3b8; }
.idx-cma-rural-badge {
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.3);
  color: #fbbf24;
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Warnings */
.idx-cma-warnings {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.idx-cma-warning-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #fde68a;
}
.idx-cma-warning-item svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

/* Section title */
.idx-cma-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}
.idx-cma-section-title svg { width: 14px; height: 14px; }

/* Comp cards */
.idx-cma-comps { display: flex; flex-direction: column; gap: 1rem; }

.idx-cma-comp-card {
  background: #111d35;
  border: 1px solid #1e3250;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.idx-cma-comp-rank {
  position: absolute;
  top: 0.6rem; left: 0.6rem;
  background: #38bdf8;
  color: #0c1825;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 20px;
  padding: 0.15rem 0.5rem;
  z-index: 2;
}

/* Comp top section */
.idx-cma-comp-top {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
}
.idx-cma-comp-photo-wrap { position: relative; background: #0a0f1e; }
.idx-cma-comp-photo { display: block; width: 100%; height: 100%; object-fit: cover; max-height: 180px; }
.idx-cma-comp-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  color: #1e3250;
}
.idx-cma-comp-no-photo svg { width: 36px; height: 36px; }

.idx-cma-comp-info { padding: 1rem 1.1rem; }
.idx-cma-comp-addr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.idx-cma-comp-addr {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  flex: 1;
}
.idx-cma-comp-city  { font-size: 0.75rem; color: #475569; margin-bottom: 0.6rem; }
.idx-cma-comp-stats { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.idx-cma-comp-price { font-size: 1.2rem; font-weight: 800; color: #38bdf8; }
.idx-cma-comp-ppsf  { font-size: 0.77rem; color: #64748b; }

.idx-cma-comp-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.idx-cma-comp-details span {
  background: #1a2744;
  border: 1px solid #2d3f5e;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.74rem;
  color: #94a3b8;
}
.idx-cma-comp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 0.4rem;
}
.idx-cma-comp-meta strong { color: #64748b; }
.idx-cma-comp-amenities { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.idx-cma-amenity {
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  border-radius: 20px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
}
.idx-cma-amenity--blue {
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.3);
  color: #7dd3fc;
}

/* Distance badge */
.idx-cma-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 20px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.idx-cma-badge svg { width: 10px; height: 10px; }
.idx-cma-badge--green  { background: rgba(34,197,94,0.15);  border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }
.idx-cma-badge--blue   { background: rgba(56,189,248,0.15); border: 1px solid rgba(56,189,248,0.3); color: #7dd3fc; }
.idx-cma-badge--yellow { background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.3); color: #fde68a; }
.idx-cma-badge--gray   { background: rgba(100,116,139,0.15);border: 1px solid rgba(100,116,139,0.3);color: #94a3b8; }

/* Adjustments section */
.idx-cma-comp-adj {
  background: #0d1b2e;
  border-top: 1px solid #1e3250;
  padding: 0.85rem 1.1rem;
}
.idx-cma-adj-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}
.idx-cma-adj-header svg { width: 12px; height: 12px; }
.idx-cma-adj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.idx-cma-adj-table th {
  text-align: left;
  color: #334155;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid #1e3250;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.idx-cma-adj-table td {
  padding: 0.25rem 0.4rem;
  color: #94a3b8;
  border-bottom: 1px solid #0f172a;
}
.idx-cma-adj-table tfoot td {
  border-top: 1px solid #1e3250;
  border-bottom: none;
  color: #e2e8f0;
  padding-top: 0.4rem;
}
.idx-cma-adj-pos { color: #86efac !important; }
.idx-cma-adj-neg { color: #f87171 !important; }
.idx-cma-no-adj { font-size: 0.78rem; color: #334155; margin: 0; font-style: italic; }

/* Adjustment legend */
.idx-cma-adj-legend {
  font-size: 0.74rem;
  color: #334155;
  line-height: 1.5;
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: #0d1b2e;
  border: 1px solid #1e3250;
  border-radius: 8px;
}
.idx-cma-adj-legend strong { color: #475569; }

/* No comps */
.idx-cma-no-comps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  color: #334155;
  text-align: center;
}
.idx-cma-no-comps svg { width: 36px; height: 36px; opacity: 0.4; }
.idx-cma-no-comps p { margin: 0; font-size: 0.85rem; color: #475569; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .idx-cma-full-row { grid-template-columns: 1fr; }
  .idx-cma-field--narrow { max-width: 100%; }
  .idx-cma-comp-top { grid-template-columns: 1fr; }
  .idx-cma-comp-photo { max-height: 160px; width: 100%; }
  .idx-cma-comp-no-photo { min-height: 80px; }
  .idx-cma-value-point { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .idx-cma-field-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   CLIENT PORTAL — Login Modal
   ============================================================ */

.idx-portal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s ease;
}
.idx-portal-modal-overlay--visible { opacity: 1; }

.idx-portal-modal {
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    transform: translateY(8px);
    transition: transform .25s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.idx-portal-modal-overlay--visible .idx-portal-modal { transform: translateY(0); }

.idx-portal-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: none; background: transparent;
    cursor: pointer; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #666;
    transition: background .15s;
}
.idx-portal-modal-close:hover { background: #f0f0f0; color: #222; }
.idx-portal-modal-close svg { width: 18px; height: 18px; }

.idx-portal-modal-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg,#0073aa,#005d8a);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
}
.idx-portal-modal-icon svg { width: 26px; height: 26px; }

.idx-portal-modal-headline {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 6px;
    color: #1d2327;
}
.idx-portal-modal-sub {
    font-size: .875rem;
    color: #666;
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── Modal tabs ── */
.idx-portal-modal-tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 20px;
    gap: 0;
}
.idx-portal-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-size: .875rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color .15s;
}
.idx-portal-tab--active { color: #0073aa; }
.idx-portal-tab--active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: #0073aa;
    border-radius: 2px 2px 0 0;
}

/* ── Modal form ── */
.idx-portal-field { margin-bottom: 14px; }
.idx-portal-label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}
.idx-portal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #b91c1c;
    font-size: .8125rem;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.idx-portal-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0073aa, #005d8a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.idx-portal-submit-btn:hover:not(:disabled) { opacity: .9; }
.idx-portal-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============================================================
   CLIENT PORTAL — Dashboard (logged-in view)
   ============================================================ */

.idx-portal-wrap { font-family: inherit; max-width: 960px; margin: 0 auto; }

.idx-portal-header {
    background: linear-gradient(135deg, #0073aa 0%, #005d8a 100%);
    border-radius: 12px;
    padding: 28px 28px 20px;
    color: #fff;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.idx-portal-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.idx-portal-welcome { font-size: 1.25rem; font-weight: 700; }
.idx-portal-email   { font-size: .875rem; opacity: .8; margin-top: 2px; }

/* Dashboard tabs */
.idx-portal-dash-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
    gap: 4px;
    flex-wrap: wrap;
}
.idx-portal-dash-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: .875rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: color .15s, background .15s;
}
.idx-portal-dash-tab:hover { background: #f5f5f5; color: #222; }
.idx-portal-dash-tab--active { color: #0073aa; }
.idx-portal-dash-tab--active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: #0073aa;
}

/* Dashboard pane */
.idx-portal-dash-pane { padding: 4px 0; }

/* ── Saved homes grid ── */
.idx-portal-saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.idx-portal-saved-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    position: relative;
    transition: box-shadow .2s, opacity .3s;
}
.idx-portal-saved-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.idx-portal-saved-photo {
    width: 100%; height: 160px;
    object-fit: cover; display: block;
}
.idx-portal-saved-no-photo {
    width: 100%; height: 160px;
    background: #f0f2f5;
    display: flex; align-items: center; justify-content: center;
    color: #bbb;
}
.idx-portal-saved-no-photo svg { width: 40px; height: 40px; }
.idx-portal-saved-info { padding: 14px 14px 12px; }
.idx-portal-saved-addr {
    font-size: .9375rem; font-weight: 600; color: #1d2327;
    margin-bottom: 4px; line-height: 1.3;
}
.idx-portal-saved-price {
    font-size: .9375rem; color: #0073aa; font-weight: 600;
    margin-bottom: 4px;
}
.idx-portal-saved-details { font-size: .8125rem; color: #666; }
.idx-portal-status-badge {
    display: inline-block;
    background: #e8f4fd; color: #0073aa;
    border-radius: 10px; padding: 1px 8px;
    font-size: .75rem; font-weight: 600;
    text-transform: capitalize;
    vertical-align: middle;
}

/* Heart button (injected onto listing cards) */
.idx-heart-btn {
    position: absolute;
    top: 10px; right: 10px;
    width: 36px; height: 36px;
    border: none;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #ccc;
    transition: color .15s, background .15s, transform .15s;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    z-index: 10;
}
.idx-heart-btn svg { width: 18px; height: 18px; }
.idx-heart-btn:hover { transform: scale(1.1); color: #e11d48; background: #fff; }
.idx-heart--saved { color: #e11d48; background: #fff; }
.idx-heart--saved svg { fill: #e11d48; }

/* ── My Home CMA panel ── */
.idx-my-home-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.idx-my-home-form .idx-my-home-address { flex: 1; min-width: 220px; }
.idx-my-home-form button { white-space: nowrap; }

.idx-my-home-loading {
    text-align: center; padding: 24px; color: #666; font-size: .9375rem;
}
.idx-my-home-value-card {
    background: linear-gradient(135deg, #1d2327 0%, #2c3338 100%);
    border-radius: 10px;
    padding: 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 12px;
}
.idx-my-home-label {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; opacity: .7; margin-bottom: 6px;
}
.idx-my-home-value {
    font-size: 2.5rem; font-weight: 800; letter-spacing: -1px;
}
.idx-my-home-range {
    font-size: .875rem; opacity: .7; margin-top: 4px;
}
.idx-my-home-meta {
    font-size: .8125rem; opacity: .6; margin-top: 8px;
}

/* ── Activity log in portal ── */
.idx-portal-activity-list { list-style: none; margin: 0; padding: 0; }
.idx-portal-activity-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: .875rem;
}
.idx-portal-activity-icon {
    width: 32px; height: 32px;
    background: #f0f2f5; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.idx-portal-activity-text { color: #1d2327; line-height: 1.4; }
.idx-portal-activity-time { color: #999; font-size: .8125rem; margin-top: 2px; }

/* ── Misc portal notes ── */
.idx-portal-note {
    color: #666; font-size: .9375rem;
    padding: 20px;
    background: #f9f9f9; border-radius: 8px; text-align: center;
}
.idx-portal-disclaimer {
    font-size: .8125rem; color: #888; margin-top: 12px; font-style: italic;
}
.idx-portal-err-msg {
    background: #fef2f2; border: 1px solid #fecaca;
    color: #b91c1c; border-radius: 6px; padding: 10px 14px;
    font-size: .875rem;
}

/* ============================================================
   TAX RECORDS WIDGET
   ============================================================ */

.idx-tax-wrap {
    font-family: inherit;
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 0;
}

.idx-tax-header { margin-bottom: 20px; }
.idx-tax-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.25rem; font-weight: 700; color: #1d2327;
    margin: 0 0 6px;
}
.idx-tax-title svg { width: 22px; height: 22px; color: #0073aa; flex-shrink: 0; }
.idx-tax-subtitle { font-size: .875rem; color: #666; margin: 0; }

/* Search row */
.idx-tax-search-row {
    display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.idx-tax-address-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1.5px solid #ddd; border-radius: 8px;
    font-size: .9375rem; color: #1d2327;
    outline: none; transition: border-color .15s;
}
.idx-tax-address-input:focus { border-color: #0073aa; }
.idx-tax-search-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    background: #0073aa; color: #fff;
    border: none; border-radius: 8px;
    font-size: .9375rem; font-weight: 600;
    cursor: pointer; transition: background .15s; white-space: nowrap;
}
.idx-tax-search-btn:hover { background: #005d8a; }
.idx-tax-search-btn svg { width: 16px; height: 16px; }

/* Detected banner */
.idx-tax-detected {
    display: flex; align-items: center; gap: 8px;
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 8px; padding: 10px 14px;
    font-size: .875rem; color: #166534;
    margin-bottom: 14px;
}
.idx-tax-detected svg { width: 16px; height: 16px; flex-shrink: 0; }

/* No match notice */
.idx-tax-no-match {
    display: flex; align-items: center; gap: 8px;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; padding: 10px 14px;
    font-size: .875rem; color: #92400e;
    margin-bottom: 14px;
}
.idx-tax-no-match svg { width: 16px; height: 16px; flex-shrink: 0; }

/* County cards */
.idx-tax-counties { display: flex; flex-direction: column; gap: 12px; }

.idx-tax-county-card {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 8px;
    align-items: start;
    transition: border-color .15s, box-shadow .15s;
}
.idx-tax-county-card:hover { border-color: #0073aa; box-shadow: 0 2px 8px rgba(0,115,170,.1); }
.idx-tax-county-card--detected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 2px 12px rgba(0,115,170,.12);
}

.idx-tax-county-icon { font-size: 1.5rem; padding-top: 2px; }

.idx-tax-county-info { }
.idx-tax-county-name {
    font-size: 1rem; font-weight: 700; color: #1d2327;
    display: flex; align-items: center; gap: 8px;
}
.idx-tax-detected-badge {
    background: #0073aa; color: #fff;
    border-radius: 10px; padding: 1px 10px;
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px;
}
.idx-tax-county-cities {
    font-size: .8125rem; color: #666; margin-top: 3px;
}

.idx-tax-county-links {
    display: flex; flex-direction: column; gap: 6px;
    align-items: flex-end; justify-self: end;
}
.idx-tax-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: .8125rem; font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}
.idx-tax-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.idx-tax-link--primary {
    background: #0073aa; color: #fff;
}
.idx-tax-link--primary:hover { background: #005d8a; color: #fff; }
.idx-tax-link:not(.idx-tax-link--primary) {
    background: #f0f2f5; color: #444;
}
.idx-tax-link:not(.idx-tax-link--primary):hover { background: #e0e4e8; color: #222; }

.idx-tax-county-phone {
    grid-column: 2; grid-row: 2;
    display: flex; align-items: center; gap: 5px;
    font-size: .8rem; color: #888;
}
.idx-tax-county-phone svg { width: 13px; height: 13px; }

.idx-tax-disclaimer {
    font-size: .8rem; color: #aaa;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.5;
    font-style: italic;
}

/* ============================================================
   RESPONSIVE — Portal & Tax
   ============================================================ */

@media (max-width: 640px) {
    .idx-portal-modal { padding: 28px 20px 22px; }
    .idx-portal-saved-grid { grid-template-columns: 1fr; }
    .idx-portal-header { padding: 20px 16px; gap: 12px; }
    .idx-portal-welcome { font-size: 1.1rem; }

    .idx-tax-county-card {
        grid-template-columns: 30px 1fr;
        grid-template-rows: auto auto auto;
    }
    .idx-tax-county-links {
        grid-column: 1 / -1; grid-row: 3;
        flex-direction: row; flex-wrap: wrap; justify-self: stretch;
    }
    .idx-tax-link { flex: 1; justify-content: center; }
}
