:root{
  --bg:#0b1020;
  --panel:#0f172a;
  --card:#111c36;
  --text:#e6e8ee;
  --muted:#9aa4b2;
  --border:rgba(255,255,255,0.12);
  --accent:#22c55e;
  --accent2:#60a5fa;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: #0a0f1f;
  color: var(--text);
}

code{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}

.app{
  height:100vh;
  display:grid;
  grid-template-columns: 380px 1fr;
}

.sidebar{
  height:100vh;
  display:flex;
  flex-direction:column;
  background: linear-gradient(180deg, rgba(15,23,42,1) 0%, rgba(10,15,31,1) 100%);
  border-right:1px solid var(--border);
  overflow:hidden;
}

.sidebar__header{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  padding:16px 16px 12px;
  border-bottom:1px solid var(--border);
}

.brand{font-weight:800; letter-spacing:.2px; font-size:18px}
.muted{color:var(--muted)}
.small{font-size:12px}

.iconBtn{
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  width:34px; height:34px;
  border-radius:12px;
  cursor:pointer;
}
.iconBtn:hover{background:rgba(255,255,255,.06)}

.panel{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  overflow:auto;
  max-height: 48vh;
}

.row{display:flex; gap:10px; align-items:center}
.row.between{justify-content:space-between}
.grow{flex:1}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{background:rgba(255,255,255,.06)}
.btn.small{padding:8px 10px; border-radius:12px; font-size:12px}
.btn.primary{background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.55)}
.btn.primary:hover{background: rgba(34,197,94,.24)}

.field{margin-top:12px}
.label{font-weight:700; font-size:12px; margin-bottom:6px; display:block; color:#cfd6e2}

.input{
  width:100%;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  color: var(--text);
  padding:10px 12px;
  border-radius:14px;
  outline:none;
}
.input:focus{border-color: rgba(96,165,250,.55); box-shadow: 0 0 0 3px rgba(96,165,250,.16)}

.chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.chip{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  cursor:pointer;
  user-select:none;
  display:flex;
  align-items:center;
  gap:8px;
}
.chip input{accent-color: var(--accent)}
.chip:hover{background:rgba(255,255,255,.06)}
.chip.on{border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.14)}

.details{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:16px;
  padding:10px 12px;
  background: rgba(255,255,255,.02);
}
.details summary{
  cursor:pointer;
  font-weight:800;
  font-size:13px;
}

.results{
  display:flex;
  flex-direction:column;
  flex:1;
  overflow:hidden;
}
.results__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 16px;
  border-bottom:1px solid var(--border);
}
.results__list{
  padding:10px 10px 14px;
  overflow:auto;
}
.card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius:18px;
  padding:12px;
  margin:0 6px 10px;
  cursor:pointer;
}
.card:hover{background:rgba(255,255,255,.06)}
.card__top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.badge{font-size:11px; padding:4px 8px; border-radius:999px; background: rgba(255,255,255,.08); border:1px solid var(--border)}
.card__title{font-weight:800}
.card__addr{font-size:12px; color:var(--muted); margin-top:4px}
.card__meta{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px}

.pill{font-size:11px; padding:4px 8px; border-radius:999px; background: rgba(96,165,250,.14); border:1px solid rgba(96,165,250,.35)}
.pill.good{background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.35)}
.pill.warn{background: rgba(244,63,94,.10); border-color: rgba(244,63,94,.35)}

.mapWrap{
  position:relative;
  height:100vh;
  overflow:hidden;
}
.map{height:100%; width:100%}

.floatingBtn{
  position:absolute;
  left:14px;
  top:14px;
  z-index:10;
  border:1px solid var(--border);
  background: rgba(10,15,31,.75);
  backdrop-filter: blur(10px);
  color: var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  display:none;
}

.toast{
  position:absolute;
  left:14px;
  bottom:14px;
  z-index:10;
  max-width:420px;
  padding:10px 12px;
  border-radius:14px;
  border: 1px solid var(--border);
  background: rgba(10,15,31,.80);
  backdrop-filter: blur(10px);
  color: var(--text);
  box-shadow: var(--shadow);
  display:none;
}
.toast.show{display:block}

.compareBar{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  z-index:11;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid rgba(34,197,94,.40);
  background: rgba(10,15,31,.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.compareBar.hidden{display:none}
.compareBar__title{font-weight:900}
.compareBar__right{display:flex; gap:10px}

.modal.hidden{display:none}
.modal{
  position:fixed; inset:0;
  z-index:100;
}
.modal__backdrop{
  position:absolute; inset:0;
  background: rgba(2,6,23,.72);
}
.modal__panel{
  position:relative;
  width:min(980px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  margin:12px auto;
  border-radius:22px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.modal__title{font-weight:900; font-size:16px}
.modal__content{padding:14px 16px; overflow:auto}

.table{
  width:100%;
  border-collapse: collapse;
  font-size:13px;
}
.table th, .table td{
  border-bottom:1px solid var(--border);
  padding:10px 8px;
  vertical-align:top;
}
.table th{color:#cfd6e2; text-align:left}
.table .mutedCell{color:var(--muted)}

@media (max-width: 900px){
  .app{grid-template-columns: 1fr}
  .sidebar{
    position:absolute;
    top:0; left:0; bottom:0;
    width:min(420px, 92vw);
    z-index:50;
    transform: translateX(-110%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open{transform: translateX(0)}
  .floatingBtn{display:inline-flex}
}
