  :root{
    --sidebar-w: 320px;
    --accent: #2b7a78;
    --bg: #f7f8fa;
    --banner-height: 48px;
  }
  html,body,#map { height:100%; margin:0; padding:0; }
  body { 
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; 
    background:var(--bg);
    overflow: hidden; /* Prevent body scroll on mobile */
    display: flex;
    flex-direction: column;
    height: 100vh;
  }
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden; /* Prevent app scroll */
    min-height: 0;
  }

  /* Sidebar */
  .sidebar {
    padding: 12px;
    box-sizing: border-box;
    border-right: 1px solid rgba(0,0,0,0.06);
    background: linear-gradient(180deg,#fff,#f6fafb);
    display:flex;
    flex-direction:column;
    overflow-y: hidden;
    height: 100%;
  }
  .header {
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
    flex-shrink: 0;
  }
  .title { font-weight:700; font-size:16px; color:#0a2433; }
  .subtitle { font-size:12px; color:#6d7680; font-weight:600; }
  .description { 
    font-size:11px; 
    color:#556; 
    margin-top:4px; 
    line-height:1.3;
    display: none; /* Hide by default to save space */
  }
  .about-btn {
    margin-top:4px;
    padding:4px 8px;
    font-size:10px;
    background:rgba(43, 122, 120, 0.1);
    color:var(--accent);
    border:1px solid rgba(43, 122, 120, 0.2);
    border-radius:4px;
    cursor:pointer;
    transition:all 0.2s ease;
  }
  .about-btn:hover {
    background:var(--accent);
    color:white;
  }
  .controls { 
    display:flex; 
    flex-direction:column; 
    gap:6px; 
    margin:6px 0; 
    align-items:stretch;
    flex-shrink: 0;
  }
  .sidebar button {
    padding:8px;
    border-radius:6px;
    background:var(--accent);
    color:white;
    border:none;
  }
  
  /* Floating Filter Panel */
  .filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .filter-panel.open {
    transform: translateX(0);
  }
  
  .filter-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), #239b96);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  .filter-panel-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .filter-panel-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transform-origin: center center;
  }
  
  .filter-panel-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
  }
  
  .filter-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  /* Add padding at bottom for better scroll experience */
  .filter-panel-content::after {
    content: '';
    display: block;
    height: 20px;
    flex-shrink: 0;
  }
  
  /* Sticky footer for clear filters button */
  .filter-panel-footer {
    padding: 16px 20px;
    background: white;
    border-top: 2px solid rgba(0,0,0,0.06);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
  }
  
  /* Unified Search */
  .unified-search {
    display: none; /* Removed from filter panel */
  }
  
  /* Filter Sections */
  .filter-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }
  
  .filter-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .filter-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #0a2433;
    margin-bottom: 4px;
  }
  
  /* Legend in Filter Panel */
  .legend-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .legend-compact .legend-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
  }
  
  .legend-compact .legend-row:hover {
    background: rgba(43, 122, 120, 0.08);
    transform: translateX(2px);
  }
  
  .legend-compact .legend-row.active {
    background: rgba(43, 122, 120, 0.15);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
    font-weight: 600;
  }
  
  .legend-compact .legend-row.active::after {
    content: "✓";
    position: absolute;
    right: 8px;
    color: var(--accent);
    font-weight: bold;
    font-size: 14px;
  }
  
  .legend-compact .legend-row span:first-of-type {
    flex: 1;
    font-size: 13px;
  }
  
  .legend-compact .status-count {
    font-size: 11px;
    color: #6d7680;
    background: rgba(0,0,0,0.05);
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
    font-weight: 600;
  }
  
  .legend-compact .legend-row.active .status-count {
    background: var(--accent);
    color: white;
  }
  
  .legend-compact .color-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
  }
  
  .legend-compact .color-box.all-status {
    background: linear-gradient(135deg, 
      #3b76ff 0%, #3b76ff 16.66%,
      #ff9f1c 16.66%, #ff9f1c 33.33%,
      #d7263d 33.33%, #d7263d 50%,
      #2ecc71 50%, #2ecc71 66.66%,
      #6c5ce7 66.66%, #6c5ce7 83.33%,
      #34495e 83.33%, #34495e 100%
    );
  }
  
  /* Date Range Filter */
  .date-range-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .date-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .date-input-group label {
    font-size: 12px;
    color: #334;
    font-weight: 500;
  }
  
  .date-input-group input[type="date"] {
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
  }
  
  .date-input-group input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(43, 122, 120, 0.1);
  }
  
  /* Checkbox Filters */
  .checkbox-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
  }
  
  .checkbox-label:hover {
    background: rgba(0,0,0,0.03);
  }
  
  .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
  }
  
  /* Clear Filters Button (Sticky Footer) */
  .clear-filters-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .clear-filters-btn::before {
    content: "✕";
    font-size: 18px;
    font-weight: bold;
  }
  
  .clear-filters-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
  }
  
  .clear-filters-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
  }
  
  .clear-filters-btn:disabled {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
  }
  
  .clear-filters-btn:disabled::before {
    opacity: 0.5;
  }
  
  /* Filter Toggle Button */
  .filter-toggle-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 122, 120, 0.3);
  }
  
  .filter-toggle-btn .filter-icon {
    font-size: 18px;
  }
  
  /* Active filters badge - desktop shows count, mobile shows dot */
  .active-filters-badge {
    background: #d7263d;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
  }
  
  /* Unified Search Bar (on map) - fluid width with gap from filter button */
  .unified-search-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 200px; /* Space for filter button (width ~160px) + 40px gap */
    max-width: 500px;
    margin: 0 auto; /* Center within available space */
    z-index: 1500;
    pointer-events: auto;
  }
  
  .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px 20px;
    transition: all 0.3s ease;
  }
  
  .search-input-wrapper:focus-within {
    box-shadow: 0 6px 20px rgba(43, 122, 120, 0.3);
    border: 2px solid var(--accent);
    padding: 10px 18px;
  }
  
  .search-input-wrapper .search-icon {
    font-size: 18px;
    margin-right: 10px;
    color: #6d7680;
  }
  
  .unified-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: #0a2433;
    min-width: 0; /* Allow flex item to shrink below content size */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .unified-search-bar input::placeholder {
    color: #adb5bd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .search-clear-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    color: #6d7680;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 8px;
    transition: all 0.2s ease;
  }
  
  .search-clear-btn:hover {
    background: rgba(0,0,0,0.1);
    color: #0a2433;
  }
  
  /* Search Results Dropdown */
  .search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1600;
  }
  
  .search-results-section {
    padding: 12px 0;
  }
  
  .search-results-section:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  
  .search-results-header {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #6d7680;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .search-result-item:hover {
    background: rgba(43, 122, 120, 0.08);
  }
  
  .search-result-item.selected {
    background: rgba(43, 122, 120, 0.15);
  }
  
  .search-result-icon {
    font-size: 20px;
    flex-shrink: 0;
  }
  
  .search-result-content {
    flex: 1;
    min-width: 0;
  }
  
  .search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #0a2433;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .search-result-subtitle {
    font-size: 12px;
    color: #6d7680;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .search-no-results {
    padding: 20px;
    text-align: center;
    color: #6d7680;
    font-size: 13px;
  }
  
  /* Filter Panel Overlay */
  .filter-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .filter-panel-overlay.visible {
    opacity: 1;
    pointer-events: all;
  }
  
  #clearFilters {
    background: #6c757d !important;
    color: white !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    transition: all 0.2s ease !important;
  }
  
  #clearFilters:hover {
    background: #5a6268 !important;
    transform: none !important;
  }
  
  .add-estate-section {
    margin: 6px 0;
    flex-shrink: 0;
  }
  
  .add-estate-btn {
    width: 100% !important;
    padding: 10px 12px !important;
    background: linear-gradient(135deg, var(--accent), #239b96) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 6px rgba(43, 122, 120, 0.3) !important;
  }
  
  .add-estate-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(43, 122, 120, 0.4) !important;
    background: linear-gradient(135deg, #239b96, var(--accent)) !important;
  }
  
  .add-estate-btn.drawing-mode {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    animation: pulse 2s infinite !important;
  }
  
  .add-estate-btn.drawing-mode:hover {
    transform: translateY(-1px) !important;
    background: linear-gradient(135deg, #e67e22, #d35400) !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4) !important;
  }
  
  @keyframes pulse {
    0% { box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3); }
    50% { box-shadow: 0 4px 12px rgba(243, 156, 18, 0.6); }
    100% { box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3); }
  }
  
  .add-estate-btn .add-icon {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
  }
  
  .add-estate-btn small {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 400;
  }
  button { cursor:pointer; }
  .list { 
    overflow-y:auto; 
    overflow-x: hidden;
    margin-top:6px; 
    padding-bottom:8px; 
    flex:1;
    min-height: 0; /* Critical for flexbox scrolling */
  }
  
  /* Scrollbar styling */
  .list::-webkit-scrollbar {
    width: 6px;
  }
  
  .list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
  }
  
  .list::-webkit-scrollbar-thumb {
    background: rgba(43, 122, 120, 0.3);
    border-radius: 3px;
  }
  
  .list::-webkit-scrollbar-thumb:hover {
    background: rgba(43, 122, 120, 0.5);
  }
  .estate-item {
    padding:6px 8px; 
    border-radius:4px; 
    margin-bottom:4px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    display:flex; 
    justify-content:space-between; 
    align-items:center;
    gap:6px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
  }
  
  .estate-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    border-color: rgba(43, 122, 120, 0.2);
    z-index: 20;
    position: relative;
  }
  
  .estate-item:hover::after {
    content: "Click to zoom to location";
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease 0.5s forwards;
    pointer-events: none;
  }
  
  @keyframes fadeIn {
    to { opacity: 1; }
  }
  
  .estate-content {
    flex: 1;
  }
  
  .estate-item.selected {
    border: 2px solid var(--accent) !important;
    background: rgba(43, 122, 120, 0.05) !important;
    box-shadow: 0 2px 8px rgba(43, 122, 120, 0.2) !important;
  }
  
  .estate-item.selected .estate-content::after {
    content: "📍";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: var(--accent);
  }
  .estate-meta { 
    font-size:12px; 
    color:#0b3040; 
    flex: 1;
    line-height: 1.3;
  }
  
  .estate-meta strong {
    font-size: 13px;
    font-weight: 600;
    color: #0a2433;
    display: block;
    margin-bottom: 2px;
  }
  
  .estate-actions { 
    display:flex; 
    gap:6px; 
    flex-shrink: 0;
    align-items: flex-start;
  }
  

  .contact-section {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
  }

  .contact-btn {
    width: 100%;
    padding: 6px 10px;
    background: rgba(43, 122, 120, 0.1);
    color: var(--accent);
    border: 1px solid rgba(43, 122, 120, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    text-align: center;
  }

  .contact-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(43, 122, 120, 0.3);
  }

  .filter-group { display:flex; gap:8px; }
  .filter-group > div { flex:1; }
  label { font-size:12px; color:#334; display:block; margin-bottom:4px; }

  /* Map container (right column) */
  #map {
    position: relative;
    height: 100%;
    min-height: 400px;
  }
  
  /* Reposition Leaflet zoom controls to bottom right corner with maximum specificity */
  #map .leaflet-control-container .leaflet-top.leaflet-left,
  .leaflet-control-container .leaflet-top.leaflet-left {
    top: auto !important;
    left: auto !important;
    bottom: 40px !important;
    right: 20px !important;
  }
  
  #map .leaflet-control-zoom,
  .leaflet-control-zoom {
    border: 2px solid rgba(0,0,0,0.1) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  }
  
  #map .leaflet-control-zoom a,
  .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 20px !important;
  }
  
  /* Filter toggle button - position relative to map */
  .filter-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    pointer-events: auto;
  }

  /* Tablet/medium screens - reduce gap as space gets tighter */
  @media (max-width:1200px){
    .unified-search-bar {
      right: 180px; /* Reduce gap slightly */
      max-width: 450px;
    }
    
    .unified-search-bar input {
      font-size: 14px;
    }
  }
  
  @media (max-width:1000px){
    .unified-search-bar {
      right: 170px;
      max-width: 400px;
    }
    
    .unified-search-bar input {
      font-size: 14px;
    }
    
    .search-input-wrapper {
      padding: 10px 16px;
    }
  }
  
  /* Intermediate breakpoint for smoother transition */
  @media (max-width:800px){
    .unified-search-bar {
      right: 160px;
      max-width: 350px;
    }
    
    .filter-toggle-btn {
      padding: 10px 16px;
    }
    
    .unified-search-bar input {
      font-size: 13px;
    }
    
    .search-input-wrapper {
      padding: 10px 14px;
    }
    
    .search-input-wrapper .search-icon {
      font-size: 16px;
      margin-right: 8px;
    }
  }
  
  /* Small screens - map and results split screen (no overlay) */
  @media (max-width:700px){
    body {
      display: flex;
      flex-direction: column;
    }
    
    .app { 
      grid-template-columns: 1fr; 
      grid-template-rows: 45vh 1fr; /* Map 45%, Results 55% */
      flex: 1;
      overflow: hidden; /* Prevent page scrolling */
      min-height: 0;
    }
    
    #map { 
      order: 1;
      height: 100%;
      width: 100%;
      overflow: hidden;
    }
    
    .sidebar { 
      order: 2;
      height: 100%;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      border-right: none;
      border-top: 2px solid rgba(0,0,0,0.1);
      padding: 8px;
      background: linear-gradient(180deg,#fff,#f6fafb);
    }
    
    /* Maximize results list space */
    .sidebar .list {
      flex: 1;
      overflow-y: auto;
      min-height: 0;
      padding-bottom: 4px;
      margin-top: 2px;
    }
    
    /* Compact header on mobile */
    .sidebar .header {
      margin-bottom: 4px;
      padding: 0;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
    }
    
    .sidebar .title {
      font-size: 13px;
      line-height: 1.2;
      font-weight: 700;
    }
    
    .sidebar .subtitle {
      font-size: 9px;
      line-height: 1.2;
      font-weight: 500;
      color: #7f8c8d;
    }
    
    .sidebar .about-btn {
      font-size: 9px;
      padding: 3px 6px;
      margin-top: 2px;
      border-radius: 4px;
      align-self: flex-start;
    }
    
    /* Compact controls */
    .sidebar .controls {
      margin: 4px 0;
      gap: 2px;
    }
    
    .add-estate-btn {
      padding: 8px 10px !important;
      font-size: 12px !important;
      border-radius: 6px !important;
    }
    
    .add-estate-btn .add-icon {
      font-size: 16px !important;
      margin-right: 4px;
    }
    
    /* Contact section fixed at bottom of sidebar */
    .contact-section {
      margin-top: 2px;
      padding-top: 4px;
      border-top: 1px solid rgba(0,0,0,0.06);
      flex-shrink: 0;
      background: linear-gradient(180deg,rgba(255,255,255,0.9),#f6fafb);
    }
    
    .contact-btn {
      padding: 4px 6px;
      font-size: 9px;
    }
    
    /* Compact estate items */
    .estate-item {
      padding: 4px 5px;
      margin-bottom: 2px;
    }
    
    .estate-meta {
      font-size: 10px;
      line-height: 1.3;
    }
    
    .estate-meta strong {
      font-size: 11px;
      margin-bottom: 1px;
    }
    
    /* Compact badges */
    .badge {
      padding: 2px 5px;
      font-size: 9px;
    }
    
    /* Compact voting buttons */
    .estate-votes {
      margin-top: 2px;
      padding: 2px 4px;
      gap: 3px;
    }
    
    .estate-votes button {
      padding: 1px 4px;
      font-size: 9px;
      min-width: 16px;
    }
    
    .estate-votes span {
      font-size: 9px;
      min-width: 12px;
    }
    
    /* Filter panel takes full width on mobile */
    .filter-panel {
      width: 100vw;
      max-width: 100vw;
    }
    
    /* Filter toggle button - circular icon button for mobile, fixed to viewport */
    .filter-toggle-btn {
      position: fixed;
      top: calc(var(--banner-height) + 10px); /* Account for banner */
      right: 10px;
      padding: 0;
      font-size: 13px;
      min-width: 44px;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      justify-content: center;
      align-items: center;
      border-width: 2px;
      z-index: 1500;
    }
    
    .filter-toggle-btn .filter-text {
      display: none;
    }
    
    .filter-toggle-btn .filter-icon {
      font-size: 20px;
      line-height: 1;
    }
    
    /* Active filters badge - red dot in upper right corner */
    .filter-toggle-btn .active-filters-badge {
      position: absolute;
      top: -2px;
      right: -2px;
      min-width: 12px;
      height: 12px;
      padding: 0;
      border-radius: 50%;
      background: #d7263d;
      border: 2px solid white;
      font-size: 0; /* Hide the number, just show the dot */
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    /* Unified search bar - leave space for filter button, fixed to viewport */
    .unified-search-bar {
      position: fixed;
      top: calc(var(--banner-height) + 10px); /* Account for banner */
      left: 10px;
      right: 80px; /* Space for 44px button + 10px margin + 16px gap = 70px, using 80px for safety */
      max-width: none;
      margin: 0;
      z-index: 1500;
    }
    
    .search-input-wrapper {
      padding: 10px 14px;
    }
    
    .search-input-wrapper .search-icon {
      font-size: 16px;
      margin-right: 8px;
    }
    
    .unified-search-bar input {
      font-size: 14px;
    }
    
    /* Zoom controls for mobile - bottom right of map area */
    #map .leaflet-control-container .leaflet-top.leaflet-left,
    .leaflet-control-container .leaflet-top.leaflet-left {
      bottom: 20px !important; /* 20px from bottom of map */
      right: 10px !important;
      top: auto !important;
      left: auto !important;
    }
  }
  
  /* Extra small screens - further optimize spacing */
  @media (max-width:400px){
    .unified-search-bar {
      position: fixed;
      left: 8px;
      right: 70px; /* Increased from 60px to ensure no overlap */
      z-index: 1500;
    }
    
    .filter-toggle-btn {
      position: fixed;
      right: 8px;
      padding: 0;
      min-width: 40px;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      z-index: 1500;
    }
    
    .filter-toggle-btn .filter-icon {
      font-size: 18px;
    }
    
    .filter-toggle-btn .active-filters-badge {
      top: -2px;
      right: -2px;
      min-width: 10px;
      height: 10px;
    }
    
    .search-input-wrapper {
      padding: 8px 12px;
    }
  }

  /* status badges */
  .badge { padding:4px 8px; border-radius:999px; color:white; font-weight:600; font-size:12px; }
  .s-unk { background:#3b76ff; }      /* unknown */
  .s-uc { background:#ff9f1c; }      /* under construction */
  .s-ind { background:#d7263d; }      /* site induction required */
  .s-open { background:#2ecc71; }     /* open to public */
  .s-res { background:#6c5ce7; }      /* restricted */
  .s-dis { background:#34495e; }      /* disqualified */

  small.hint { color:#546; font-size:12px; display:block; margin-top:6px; }
  

  .meta-details, .survey-details { font-size:11px; color:#556; margin-top:4px; }
  .survey-details h5 { margin: 8px 0 4px 0; font-size:12px; }
  
  .estate-votes { 
    display: flex; 
    gap: 4px; 
    align-items: center; 
    margin-top: 4px;
    padding: 3px 6px;
    background: rgba(0,0,0,0.02);
    border-radius: 4px;
    font-size: 11px;
  }

  .estate-votes button { 
    background: rgba(255,255,255,0.8); 
    color: #555; 
    padding: 2px 6px; 
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 20px;
    position: relative;
    z-index: 10;
  }

  .estate-votes .upvote-btn {
    color: #27ae60;
    border-color: rgba(39, 174, 96, 0.3);
  }

  .estate-votes .upvote-btn:hover {
    background: rgba(39, 174, 96, 0.1);
    border-color: #27ae60;
  }

  .estate-votes .downvote-btn {
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
  }

  .estate-votes .downvote-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
  }

  /* Ensure tooltips appear above all other elements */
  .estate-votes button:hover {
    z-index: 1000;
  }

  .estate-votes button:hover {
    background: white;
    transform: scale(1.05);
  }

  .estate-votes button.voted-up {
    background: #27ae60;
    color: white;
    border-color: #229954;
    transform: scale(1.1);
  }

  .estate-votes button.voted-down {
    background: #e74c3c;
    color: white;
    border-color: #cb4335;
    transform: scale(1.1);
  }

  /* Hover states for voted buttons - invert colors for visibility */
  .estate-votes button.voted-up:hover {
    background: white;
    color: #27ae60;
    border-color: #27ae60;
    transform: scale(1.15);
  }

  .estate-votes button.voted-down:hover {
    background: white;
    color: #e74c3c;
    border-color: #e74c3c;
    transform: scale(1.15);
  }

  .estate-votes span {
    font-weight: 600;
    color: #666;
    min-width: 16px;
    text-align: center;
  }

  /* Modal Styles */
  .modal-backdrop { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:3000; display:flex; align-items:center; justify-content:center; }
  .modal-content { background:white; border-radius:8px; box-shadow:0 10px 30px rgba(0,0,0,0.1); width:90%; max-width:500px; display:flex; flex-direction:column; max-height:90vh; }
  .modal-header { padding:12px 16px; border-bottom:1px solid #eee; display:flex; justify-content:space-between; align-items:center; }
  .modal-header h5 { font-size:16px; margin:0; }
  .modal-close { background:transparent; border:none; font-size:24px; cursor:pointer; padding:0 8px; color:#888; }
  .modal-body { padding:16px; overflow-y:auto; }
  .modal-footer { padding:12px 16px; border-top:1px solid #eee; text-align:right; }
  .modal-footer button { padding: 8px 16px; border-radius:6px; border:none; }
  .modal-footer button:first-child { background:#eee; color:#333; margin-right:8px; }
  #saveModalButton { background:var(--accent); color:white; }
  .form-group { margin-bottom:12px; }
  .form-group label { font-weight:600; font-size:13px; display:block; margin-bottom:4px; }
  .form-group input, .form-group select, .form-group textarea { width:100%; padding:8px; border:1px solid #ccc; border-radius:4px; font-size:14px; box-sizing:border-box; }
  .form-group textarea { min-height:80px; resize:vertical; }

  /* About Modal Styles */
  .about-modal { max-width:700px; max-height:80vh; }
  .about-content { max-height:60vh; overflow-y:auto; }
  
  .tab-container { width:100%; }
  .tabs { 
    display:flex; 
    border-bottom:2px solid #eee; 
    margin-bottom:16px; 
  }
  .tab-btn { 
    padding:8px 16px; 
    background:none; 
    border:none; 
    cursor:pointer; 
    font-size:13px;
    color:#666;
    border-bottom:2px solid transparent;
    transition:all 0.2s ease;
  }
  .tab-btn.active { 
    color:var(--accent); 
    border-bottom-color:var(--accent);
    font-weight:600;
  }
  .tab-btn:hover { color:var(--accent); }
  
  .tab-content { display:none; }
  .tab-content.active { display:block; }
  .tab-content h3 { color:var(--accent); margin-top:0; }
  .tab-content h4 { color:#334; margin-top:16px; margin-bottom:8px; }
  .tab-content p { line-height:1.5; margin-bottom:12px; }
  .tab-content ul { margin-bottom:12px; }
  .tab-content li { margin-bottom:4px; line-height:1.4; }

  /* Contribution Agreement Styles */
  .contribution-agreement {
    background: rgba(43, 122, 120, 0.05);
    border: 1px solid rgba(43, 122, 120, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .agreement-content p {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #334;
  }
  
  .agreement-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
  }
  
  .agreement-checkbox input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
  }
  
  .agreement-checkbox a {
    color: var(--accent);
    text-decoration: underline;
  }
  
  .agreement-checkbox a:hover {
    color: #239b96;
  }
  
  #saveModalButton:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
  }
/* Inp
ut Validation Styles */
.validation-error {
  border-color: #d7263d !important;
  background-color: rgba(215, 38, 61, 0.05) !important;
}

.validation-success {
  border-color: #2ecc71 !important;
  background-color: rgba(46, 204, 113, 0.05) !important;
}

.validation-message {
  font-size: 11px;
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 3px;
  line-height: 1.3;
}

.validation-message.error {
  color: #d7263d;
  background-color: rgba(215, 38, 61, 0.1);
  border: 1px solid rgba(215, 38, 61, 0.2);
}

.validation-message.success {
  color: #2ecc71;
  background-color: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

/* Form field focus states with validation */
input.validation-error:focus,
textarea.validation-error:focus,
select.validation-error:focus {
  outline: 2px solid rgba(215, 38, 61, 0.3);
  outline-offset: 2px;
}

input.validation-success:focus,
textarea.validation-success:focus,
select.validation-success:focus {
  outline: 2px solid rgba(46, 204, 113, 0.3);
  outline-offset: 2px;
}

/* Security indicator styles */
.security-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 4px;
  z-index: 10000;
}

.security-indicator.secure {
  background-color: rgba(46, 204, 113, 0.9);
  color: white;
}

.security-indicator.warning {
  background-color: rgba(255, 159, 28, 0.9);
  color: white;
}

.security-indicator.error {
  background-color: rgba(215, 38, 61, 0.9);
  color: white;
}

/* House Ads - Integrated Design */

/* Top Banner - Persistent strip across top */
.house-ad-banner {
  background: linear-gradient(90deg, #2b7a78 0%, #17252a 100%);
  color: white;
  padding: 10px 20px;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  height: var(--banner-height);
  box-sizing: border-box;
  flex-shrink: 0;
}

.house-ad-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  max-width: 1200px;
  cursor: pointer;
  opacity: 0;
  animation: fadeInAd 0.5s ease forwards;
}

.house-ad-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.house-ad-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.house-ad-banner-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.house-ad-banner-description {
  font-size: 13px;
  opacity: 0.9;
  margin: 0;
}

.house-ad-banner-cta {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
  margin-left: 8px;
}

/* Sidebar Ad - Integrated into results panel */
.house-ad-sidebar {
  margin: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.house-ad-sidebar:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 122, 120, 0.15);
}

.house-ad-content {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeInAd 0.5s ease forwards;
}

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

.house-ad-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.house-ad-text {
  flex: 1;
  min-width: 0;
}

.house-ad-title {
  font-size: 13px;
  font-weight: 600;
  color: #0c4a6e;
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.house-ad-description {
  font-size: 11px;
  color: #0369a1;
  margin: 0;
  line-height: 1.3;
}

.house-ad-cta {
  font-size: 10px;
  color: #2b7a78;
  font-weight: 600;
  margin-top: 2px;
  display: inline-block;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  :root {
    --banner-height: 42px;
  }
  
  .house-ad-banner {
    padding: 8px 12px;
  }
  
  .house-ad-banner-content {
    gap: 8px;
  }
  
  .house-ad-banner-icon {
    font-size: 20px;
  }
  
  .house-ad-banner-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  
  .house-ad-banner-title {
    font-size: 13px;
  }
  
  .house-ad-banner-description {
    font-size: 11px;
    display: none; /* Hide description on mobile for cleaner look */
  }
  
  .house-ad-banner-cta {
    font-size: 11px;
    margin-left: 0;
  }
  
  .house-ad-sidebar {
    margin: 8px;
    padding: 8px 10px;
  }
  
  .house-ad-content {
    gap: 8px;
  }
  
  .house-ad-icon {
    font-size: 24px;
  }
  
  .house-ad-title {
    font-size: 12px;
    margin-bottom: 1px;
  }
  
  .house-ad-description {
    font-size: 10px;
    line-height: 1.2;
  }
  
  .house-ad-cta {
    font-size: 9px;
    margin-top: 1px;
  }
}

