  :root{
    --sidebar-w: 320px;
    --accent: #2b7a78;
    --bg: #f7f8fa;
  }
  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); }
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 0;
    height: 100vh;
  }

  /* 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;
  }
  .header {
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
  }
  .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:6px; 
    line-height:1.4; 
  }
  .about-btn {
    margin-top:8px;
    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:8px; margin:8px 0; align-items:stretch; }
  
  .accordion {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
  }
  
  .accordion-header {
    padding: 8px 12px;
    background: rgba(0,0,0,0.02);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #334;
    transition: background-color 0.2s ease;
  }
  
  .accordion-header:hover {
    background: rgba(0,0,0,0.04);
  }
  
  .accordion-icon {
    transition: transform 0.3s ease;
    font-size: 10px;
  }
  
  .accordion.collapsed .accordion-icon {
    transform: rotate(-90deg);
  }
  
  .accordion-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }
  
  .accordion.collapsed .accordion-content {
    max-height: 0;
    padding: 0 8px;
  }
  .controls select, .controls input[type="text"], .controls input[type="date"] {
    padding:8px;
    border-radius:6px;
    border:1px solid rgba(0,0,0,0.1);
    background:white;
    font-size:13px;
    width: 100%;
    box-sizing: border-box;
  }
  .sidebar button {
    padding:8px;
    border-radius:6px;
    background:var(--accent);
    color:white;
    border:none;
  }
  
  #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: 8px 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; margin-top:8px; padding-bottom:8px; flex:1; }
  .estate-item {
    padding:8px 10px; 
    border-radius:6px; 
    margin-bottom:6px;
    background: white;
    box-shadow: 0 1px 4px 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:8px;
    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;
  }
  

  .legend { margin-top:8px; font-size:11px; color:#233; }
  .legend-row { display:flex; gap:6px; align-items:center; margin-top:3px; }
  .color-box { width:14px; height:10px; border-radius:2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); }

  .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;
  }

  /* small responsive */
  @media (max-width:900px){
    .app { grid-template-columns: 1fr; grid-template-rows: 320px 1fr; }
    .sidebar { order:2; height:320px; overflow:auto; }
    #map { order:1; }
  }

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

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