/* ============================================================
   QuickMLS — Instant Property Intelligence
   Dark/Light theme, full-detail hero with comp swap
   ============================================================ */

/* ── DARK THEME (default) ────────────────────────────────── */
:root,
[data-theme="dark"] {
    --bg:          #0d1117;
    --bg-card:     #161b22;
    --bg-card2:    #1c2333;
    --border:      #30363d;
    --text:        #e6edf3;
    --text-dim:    #8b949e;
    --text-bright: #ffffff;
    --accent:      #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.15);
    --green:       #3fb950;
    --orange:      #d29922;
    --red:         #f85149;
    --purple:      #bc8cff;
    --radius:      12px;
    --radius-sm:   8px;
    --shadow:      0 2px 12px rgba(0,0,0,0.4);
    --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── LIGHT THEME ─────────────────────────────────────────── */
[data-theme="light"] {
    --bg:          #f0f2f5;
    --bg-card:     #ffffff;
    --bg-card2:    #f6f8fa;
    --border:      #d0d7de;
    --text:        #1f2328;
    --text-dim:    #656d76;
    --text-bright: #000000;
    --accent:      #0969da;
    --accent-glow: rgba(9, 105, 218, 0.12);
    --green:       #1a7f37;
    --orange:      #9a6700;
    --red:         #cf222e;
    --purple:      #8250df;
    --shadow:      0 2px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── LOADER ───────────────────────────────────────────── */
.loader {
    position: fixed; inset: 0;
    background: rgba(13, 17, 23, 0.92);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 9999;
}
[data-theme="light"] .loader { background: rgba(240, 242, 245, 0.92); }
.loader.hidden { display: none; }
.loader-spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { margin-top: 16px; color: var(--text-dim); font-size: 14px; }

/* ── APP ──────────────────────────────────────────────── */
.app {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* ── HEADER ───────────────────────────────────────────── */
.header { text-align: center; margin-bottom: 32px; }
.header-top-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.header-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.header-icon { font-size: 28px; }
.header h1 {
    font-size: 32px; font-weight: 800; letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.header-tagline { color: var(--text-dim); font-size: 15px; margin-top: 6px; }

.header-controls {
    display: flex; align-items: center; gap: 12px;
}
.header-user {
    font-size: 13px; color: var(--text-dim); font-weight: 500;
}
.header-logout {
    font-size: 18px; color: var(--text-dim); text-decoration: none;
    padding: 4px; border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.header-logout:hover { color: var(--red); background: rgba(248,81,73,0.1); }

/* ── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle-wrap { display: flex; justify-content: center; margin-top: 10px; }
.theme-toggle {
    position: relative; display: inline-block;
    width: 56px; height: 28px; cursor: pointer;
}
.theme-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 28px; transition: background 0.3s;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 6px;
}
.toggle-icon { font-size: 14px; line-height: 1; z-index: 1; }
.toggle-icon.sun { color: var(--orange); }
.toggle-icon.moon { color: var(--accent); }
.toggle-slider::after {
    content: '';
    position: absolute; left: 3px; top: 3px;
    width: 20px; height: 20px;
    background: var(--accent); border-radius: 50%;
    transition: transform 0.3s;
}
.theme-toggle input:checked + .toggle-slider::after {
    transform: translateX(27px);
}

/* ── SEARCH BAR ───────────────────────────────────────── */
.search-bar { margin-bottom: 32px; }
.search-inner {
    display: flex; align-items: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 4px 6px 4px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-inner:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-icon { font-size: 18px; margin-right: 10px; opacity: 0.5; }
.search-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); font-size: 16px; font-family: var(--font); padding: 12px 0;
}
.search-input::placeholder { color: var(--text-dim); }
.search-clear {
    background: none; border: none; color: var(--text-dim);
    font-size: 22px; cursor: pointer; padding: 8px; line-height: 1;
}
.search-clear:hover { color: var(--text); }
.search-go {
    background: var(--accent); color: #000; border: none;
    font-weight: 700; font-size: 14px; padding: 10px 20px;
    border-radius: var(--radius-sm); cursor: pointer;
}
.search-go:hover { opacity: 0.85; }
[data-theme="light"] .search-go { color: #fff; }
.hidden { display: none !important; }

/* ── RADIUS CONTROL ──────────────────────────────────────── */
.radius-control {
    margin-bottom: 16px; padding: 14px 16px 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.radius-header {
    margin-bottom: 10px;
}
.radius-header label {
    font-size: 13px; color: var(--text-dim); font-weight: 500;
}
#radiusLabel {
    font-weight: 700; color: var(--accent);
}
.radius-slider-wrap {
    position: relative; width: 100%;
}
.radius-slider-wrap input[type="range"] {
    width: 100%; height: 6px;
    -webkit-appearance: none; appearance: none;
    background: var(--border); border-radius: 3px; outline: none;
    margin: 0; display: block;
}
.radius-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.radius-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.radius-ticks {
    display: flex; justify-content: space-between;
    padding: 6px 0 0; position: relative;
    pointer-events: none;
}
.radius-ticks span {
    font-size: 10px; color: var(--text-dim);
    text-align: center; width: 0; display: flex; justify-content: center;
    position: relative; cursor: pointer; pointer-events: auto;
    user-select: none;
}
.radius-ticks span::before {
    content: '';
    position: absolute; top: -8px; left: 50%;
    transform: translateX(-50%);
    width: 1px; height: 5px;
    background: var(--text-dim); opacity: 0.5;
}
.radius-ticks span:hover { color: var(--accent); }
.radius-ticks span.active { color: var(--accent); font-weight: 700; }

/* ── SEND TO CLIENT ──────────────────────────────────────── */
.send-client-bar {
    display: flex; justify-content: flex-end;
    margin-bottom: 12px;
}
.send-client-btn {
    background: var(--green); color: #fff; border: none;
    font-weight: 700; font-size: 14px; padding: 10px 20px;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: opacity 0.15s;
}
.send-client-btn:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════
   HERO — Full-detail property section
   ═══════════════════════════════════════════════════════ */
.hero-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
}

/* ── Photo Carousel ───────────────────────────────────── */
.hero-carousel-wrap {
    position: relative;
    width: 100%;
    height: 420px;
    background: var(--bg-card2);
    overflow: hidden;
}
.hero-carousel {
    width: 100%; height: 100%;
    position: relative;
}
.carousel-slide {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.carousel-slide.active { opacity: 1; z-index: 1; }
.carousel-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 64px; color: var(--text-dim);
    opacity: 1;
}
.carousel-empty span { font-size: 14px; margin-top: 8px; }

.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 10; background: rgba(0,0,0,0.6); border: none;
    color: #fff; font-size: 36px; padding: 8px 14px;
    cursor: pointer; border-radius: 8px;
    transition: background 0.15s;
}
.carousel-arrow:hover { background: rgba(0,0,0,0.85); }
.carousel-left { left: 12px; }
.carousel-right { right: 12px; }

.carousel-counter {
    position: absolute; bottom: 12px; right: 16px; z-index: 10;
    background: rgba(0,0,0,0.65); color: #fff;
    font-size: 13px; padding: 4px 12px; border-radius: 16px;
}

.hero-status-badge {
    position: absolute; top: 16px; left: 16px; z-index: 10;
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 6px 16px; border-radius: 20px;
}
.hero-status-badge.active     { background: rgba(63,185,80,0.9);  color: #fff; }
.hero-status-badge.pending    { background: rgba(210,153,34,0.9); color: #fff; }
.hero-status-badge.closed     { background: rgba(248,81,73,0.9);  color: #fff; }
.hero-status-badge.contract   { background: rgba(188,140,255,0.9); color: #fff; }
.hero-status-badge.off-market { background: rgba(100,110,120,0.9); color: #fff; }

/* ── Hero Body ────────────────────────────────────────── */
.hero-body { padding: 28px; }

/* ── Off-Market Contact Panel ────────────────────────── */
.off-market-panel {
    margin: 24px 0 8px;
    padding: 32px 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    text-align: center;
}
.off-market-panel .omp-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.7;
}
.off-market-panel .omp-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0 0 12px;
    letter-spacing: 0.2px;
}
.off-market-panel .omp-message {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 auto 24px;
}
.off-market-panel .omp-cta {
    display: inline-block;
    padding: 13px 32px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 8px;
    transition: opacity 0.15s;
    margin-bottom: 20px;
}
.off-market-panel .omp-cta:hover { opacity: 0.85; }
.off-market-panel .omp-contacts {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.off-market-panel .omp-contact-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.off-market-panel .omp-contact-link:hover { text-decoration: underline; }
.off-market-panel .omp-agent-line {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.hero-address-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; flex-wrap: wrap;
}
.hero-address {
    font-size: 26px; font-weight: 800; color: var(--text-bright); line-height: 1.2;
}
.hero-city-line { font-size: 15px; color: var(--text-dim); margin-top: 4px; }

.hero-price-block { text-align: right; flex-shrink: 0; }
.hero-price { font-size: 30px; font-weight: 800; color: var(--green); }
.hero-price-sqft { font-size: 14px; color: var(--text-dim); margin-top: 2px; }

/* ── Stats Bar ────────────────────────────────────────── */
.hero-stats-bar {
    display: flex; flex-wrap: wrap; gap: 0;
    margin-top: 24px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden;
}
.hero-stat {
    flex: 1; min-width: 80px;
    text-align: center; padding: 14px 8px;
    border-right: 1px solid var(--border);
    background: var(--bg-card2);
}
.hero-stat:last-child { border-right: none; }
.hero-stat span {
    display: block; font-size: 20px; font-weight: 700; color: var(--text-bright);
}
.hero-stat small {
    display: block; font-size: 11px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px;
}

/* ── Tags ─────────────────────────────────────────────── */
.hero-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 20px;
}
.tag {
    font-size: 12px; background: var(--bg-card2);
    border: 1px solid var(--border); padding: 5px 12px;
    border-radius: 6px; color: var(--text-dim);
}

/* ── Agent Cards ──────────────────────────────────────── */
.hero-agents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 24px;
}
.agent-card {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.agent-role {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--accent); font-weight: 700; margin-bottom: 6px;
}
.agent-name {
    font-size: 17px; font-weight: 700; color: var(--text-bright); margin-bottom: 2px;
}
.agent-office {
    font-size: 13px; color: var(--text-dim); margin-bottom: 10px;
}
.agent-contacts {
    display: flex; flex-direction: column; gap: 6px;
}
.agent-contact-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--accent); text-decoration: none; font-size: 14px;
}
.agent-contact-link:hover { text-decoration: underline; }
.agent-no-contact { color: var(--text-dim); font-size: 13px; }

/* ── Property Details Grid (LEFT-JUSTIFIED) ──────────── */
.hero-details-grid { margin-top: 24px; }
.hero-details-grid h4 {
    font-size: 16px; font-weight: 700; color: var(--text-bright);
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
}
.detail-item {
    display: flex; justify-content: flex-start; align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    gap: 12px;
}
.detail-label {
    font-size: 13px; color: var(--text-dim); flex-shrink: 0; min-width: 120px;
}
.detail-value {
    font-size: 13px; color: var(--text); text-align: left; word-break: break-word;
}

/* ── Remarks ──────────────────────────────────────────── */
.hero-remarks {
    margin-top: 24px;
}
.hero-remarks h4 {
    font-size: 16px; font-weight: 700; color: var(--text-bright);
    margin-bottom: 10px;
}
.hero-remarks p {
    font-size: 14px; line-height: 1.7; color: var(--text);
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 18px;
}
.hero-private-remarks h4 { color: var(--orange); }
.hero-private-remarks p {
    border-color: rgba(210, 153, 34, 0.3);
    background: rgba(210, 153, 34, 0.06);
}

/* ── Meta ─────────────────────────────────────────────── */
.hero-meta {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.meta-row {
    font-size: 13px; color: var(--text-dim);
    margin-bottom: 6px;
}
.meta-row strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════
   MAP + COMPS SECTION
   ═══════════════════════════════════════════════════════ */
.section-title {
    font-size: 18px; font-weight: 700; margin-bottom: 16px;
    color: var(--text-bright);
    display: flex; align-items: center; gap: 8px;
}
.comp-count { font-size: 14px; font-weight: 500; color: var(--text-dim); }

.map-container {
    width: 100%; height: 400px;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); margin-bottom: 16px;
}

/* ── Comp Type Filters ────────────────────────────────── */
.comp-filters {
    margin-bottom: 14px; padding: 12px 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.comp-filters-inner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.comp-filters-label {
    font-size: 13px; font-weight: 600; color: var(--text-dim); margin-right: 4px;
}
.comp-filters-sep {
    color: var(--border); font-size: 16px;
}
.comp-filter-cb {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text); cursor: pointer;
    padding: 5px 10px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-card2);
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.comp-filter-cb:hover { border-color: var(--accent); }
.comp-filter-cb input { cursor: pointer; accent-color: var(--accent); }
.comp-filter-cb input:checked + span { color: var(--accent); font-weight: 600; }

/* ── Comp Cards ───────────────────────────────────────── */
.comps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.comp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.comp-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(88, 166, 255, 0.12);
}
.comp-card-img {
    width: 100%; height: 160px;
    background-size: cover; background-position: center;
    background-color: var(--bg-card2);
}
.comp-card-img-empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--text-dim);
}
.comp-card-body { padding: 14px; }
.comp-card-status {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px;
}
.comp-card-status.active   { color: var(--green); }
.comp-card-status.pending  { color: var(--orange); }
.comp-card-status.closed   { color: var(--red); }
.comp-card-status.contract { color: var(--purple); }

.comp-card-price { font-size: 20px; font-weight: 700; color: var(--text-bright); }
.comp-card-addr {
    font-size: 13px; color: var(--text-dim); margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comp-card-stats {
    display: flex; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--text-dim);
}
.comp-card-stats span { color: var(--text); font-weight: 600; }
.comp-card-distance { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.comp-card-agent {
    font-size: 12px; color: var(--accent); margin-top: 6px;
}
.comp-card-swap {
    font-size: 12px; color: var(--accent); font-weight: 600;
    margin-top: 10px; padding-top: 8px;
    border-top: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.15s;
}
.comp-card:hover .comp-card-swap { opacity: 1; }

/* ── NO RESULTS ───────────────────────────────────────── */
.no-results { text-align: center; padding: 60px 20px; }
.no-results-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.no-results p { color: var(--text-dim); font-size: 16px; }

/* ── LEAFLET POPUP ────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important; color: var(--text) !important;
    border-radius: var(--radius-sm) !important; border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; }
.leaflet-popup-content b { color: var(--text-bright); }
.popup-price { color: var(--green); font-weight: 700; font-size: 15px; }
.popup-addr { color: var(--text-dim); font-size: 12px; }

/* ═══════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════ */
.login-screen {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    padding: 20px;
}
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 40px;
    width: 100%; max-width: 380px;
    text-align: center; box-shadow: var(--shadow);
}
.login-card .header-brand { justify-content: center; margin-bottom: 8px; }
.login-subtitle {
    color: var(--text-dim); font-size: 14px; margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    font-size: 15px; color: var(--text); font-family: var(--font);
    outline: none; transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--accent); }
.login-form input::placeholder { color: var(--text-dim); }
.login-btn {
    background: var(--accent); color: #000; border: none;
    font-weight: 700; font-size: 15px; padding: 12px;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: opacity 0.15s; margin-top: 4px;
}
.login-btn:hover { opacity: 0.85; }
.login-error {
    color: var(--red); font-size: 13px; margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   SEND TO CLIENT MODAL
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 9998; padding: 20px;
}
.modal-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.modal-close {
    background: none; border: none; color: var(--text-dim);
    font-size: 24px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }

.send-form { display: flex; flex-direction: column; gap: 10px; }
.send-form label { font-size: 13px; font-weight: 600; color: var(--text); }
.send-form input {
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    font-size: 15px; color: var(--text); font-family: var(--font);
    outline: none;
}
.send-form input:focus { border-color: var(--accent); }
.send-name-input {
    width: 100%; box-sizing: border-box;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    font-size: 15px; color: var(--text); font-family: var(--font);
    outline: none; margin-bottom: 4px;
}
.send-name-input:focus { border-color: var(--accent); }
.send-name-input::placeholder { color: var(--text-dim); }
.send-submit-btn {
    background: var(--green); color: #fff; border: none;
    font-weight: 700; font-size: 14px; padding: 12px;
    border-radius: var(--radius-sm); cursor: pointer;
    margin-top: 4px;
}
.send-submit-btn:hover { opacity: 0.85; }
.send-message-textarea {
    width: 100%; box-sizing: border-box;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    font-size: 13px; color: var(--text); font-family: var(--font);
    line-height: 1.6; outline: none; resize: vertical;
    margin-top: 10px;
}
.send-message-textarea:focus { border-color: var(--accent); }

/* ── Contact Search Autocomplete ──────────────────────── */
.contact-search-wrap {
    position: relative;
}
.contact-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    max-height: 200px; overflow-y: auto; z-index: 10;
    margin-top: 2px;
}
.contact-item {
    padding: 10px 14px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.contact-item:last-child { border-bottom: none; }
.contact-item:hover { background: var(--bg-card2); }
.contact-item.contact-none {
    color: var(--text-dim); cursor: default; font-size: 13px;
    justify-content: center;
}
.contact-name { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.contact-phone { font-size: 13px; color: var(--accent); }

.send-status { font-size: 13px; color: var(--accent); margin-top: 4px; }
.send-status-error { color: var(--red); }
.send-status-warn { color: var(--orange); }

.send-result { text-align: center; padding: 12px 0; }
.send-result-icon { font-size: 36px; margin-bottom: 8px; }
.send-result p { font-size: 15px; color: var(--green); font-weight: 600; }
.send-result-url {
    font-size: 12px; color: var(--accent); margin-top: 8px;
    word-break: break-all;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px;
    user-select: all;
}
.send-actions {
    display: flex; gap: 10px; margin-top: 14px; justify-content: center;
}
.send-action-btn {
    background: var(--accent); color: #000; border: none;
    font-weight: 700; font-size: 14px; padding: 10px 20px;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: opacity 0.15s;
}
.send-action-btn:hover { opacity: 0.85; }
[data-theme="light"] .send-action-btn { color: #fff; }
.send-action-share {
    background: var(--green); color: #fff;
}

/* ═══════════════════════════════════════════════════════
   CLIENT VIEW — Agent Footer
   ═══════════════════════════════════════════════════════ */
.client-agent-footer {
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.client-agent-photo {
    text-align: center;
}
.client-agent-photo img {
    width: 220px; height: auto;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}
.client-agent-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px; width: 100%;
}
.client-agent-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px;
    text-align: center;
}
.client-agent-name {
    font-size: 18px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px;
}
.client-agent-title {
    font-size: 13px; color: var(--text-dim); margin-bottom: 12px;
}
.client-agent-contacts {
    display: flex; flex-direction: column; gap: 6px;
}
.client-agent-contacts a {
    color: var(--accent); text-decoration: none; font-size: 14px;
}
.client-agent-contacts a:hover { text-decoration: underline; }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 640px) {
    .app { padding: 16px 12px 60px; }
    .header h1 { font-size: 26px; }
    .header-top-row { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .hero-carousel-wrap { height: 280px; }
    .hero-address { font-size: 20px; }
    .hero-price { font-size: 24px; }
    .hero-address-row { flex-direction: column; }
    .hero-price-block { text-align: left; }
    .hero-stats-bar { flex-wrap: wrap; }
    .hero-stat { min-width: 70px; padding: 10px 6px; }
    .hero-stat span { font-size: 17px; }
    .hero-agents { grid-template-columns: 1fr; }
    .details-grid { grid-template-columns: 1fr; }
    .map-container { height: 300px; }
    .comps-list { grid-template-columns: 1fr; }
    .carousel-arrow { font-size: 28px; padding: 6px 10px; }
    .client-agent-footer { grid-template-columns: 1fr; }
    .radius-control { flex-wrap: wrap; }
}

/* ── Google Places dropdown ───────────────────────────── */
.pac-container {
    background: var(--bg-card) !important; border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important; box-shadow: var(--shadow) !important;
    margin-top: 4px; font-family: var(--font) !important;
}
.pac-item {
    background: var(--bg-card) !important; color: var(--text) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 8px 14px !important; font-size: 14px !important;
    cursor: pointer !important; line-height: 1.5 !important;
}
.pac-item:hover, .pac-item-selected { background: var(--bg-card2) !important; }
.pac-item-query { color: var(--text-bright) !important; font-weight: 600 !important; }
.pac-matched { color: var(--accent) !important; font-weight: 700 !important; }
.pac-icon { display: none !important; }
.pac-item span:not(.pac-item-query):not(.pac-matched) { color: var(--text-dim) !important; }
