.market-heatmap-root{
  margin:16px 0 0 0;
}

.market-heatmap{
  border:1px solid rgba(148,163,184,.16);
  background:rgba(8,13,22,.68);
  border-radius:18px;
  padding:14px;
  box-shadow:0 16px 50px rgba(0,0,0,.22);
}

.hm-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.hm-title{
  color:#f8fafc;
  font-weight:900;
  font-size:16px;
  letter-spacing:.2px;
}

.hm-sub{
  color:#94a3b8;
  font-size:12px;
  margin-top:3px;
}

.hm-count{
  color:#cbd5e1;
  font-size:12px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:999px;
  padding:5px 9px;
  background:rgba(15,23,42,.55);
}

.hm-sectors{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:stretch;
}

.hm-sector{
  border:1px solid rgba(148,163,184,.13);
  background:rgba(15,23,42,.44);
  border-radius:14px;
  padding:10px;
  min-width:0;
}

.hm-sector-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:8px;
  gap:8px;
}

.hm-sector-name{
  color:#e5e7eb;
  font-weight:850;
  font-size:13px;
}

.hm-sector-avg{
  font-size:12px;
  font-weight:850;
}

.hm-sector-avg.pos{ color:#16e0a2; }
.hm-sector-avg.neg{ color:#ff5876; }

.hm-grid{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
}

.hm-tile{
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  min-height:32px;
  padding:5px 4px;
  cursor:pointer;
  color:#f8fafc;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  line-height:1.05;
  transition:transform .12s ease, filter .12s ease;
}

.hm-tile:hover{
  transform:translateY(-1px);
  filter:brightness(1.08);
}

.hm-sym{
  font-weight:850;
  font-size:10px;
}

.hm-val{
  font-weight:700;
  font-size:9px;
  opacity:.92;
  margin-top:3px;
}

.hm-g5{ background:rgba(22,224,162,.46); }
.hm-g2{ background:rgba(22,224,162,.34); }
.hm-g1{ background:rgba(22,224,162,.22); }
.hm-r5{ background:rgba(255,88,118,.50); }
.hm-r2{ background:rgba(255,88,118,.36); }
.hm-r1{ background:rgba(255,88,118,.24); }
.hm-n{ background:rgba(100,116,139,.20); }

@media(max-width:768px){
  .market-heatmap{
    padding:12px;
    border-radius:16px;
  }

  .hm-sectors{
    grid-template-columns:1fr;
  }

  .hm-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .hm-tile{
    min-height:36px;
  }
}


/* Treemap sizing */
.hm-sector{
  min-height:132px;
}

.hm-grid .hm-tile{
  min-width:58px;
}

@media(max-width:768px){
  .hm-sector{
    flex:1 1 100% !important;
  }

  .hm-grid .hm-tile{
    flex:1 1 72px !important;
  }
}

/* Heatmap visual polish */
.market-heatmap{
  background:
    radial-gradient(circle at top left, rgba(22,224,162,.08), transparent 28%),
    linear-gradient(135deg, rgba(8,13,22,.94), rgba(11,18,32,.86));
  border-color:rgba(96,165,250,.22);
}

.hm-title{
  font-size:19px;
}

.hm-sub{
  color:#9fb0c7;
}

.hm-sectors{
  gap:10px;
}

.hm-sector{
  background:
    linear-gradient(180deg, rgba(15,23,42,.78), rgba(10,15,25,.76));
  border-color:rgba(148,163,184,.18);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.hm-sector-head{
  border-bottom:1px solid rgba(148,163,184,.10);
  padding-bottom:7px;
}

.hm-sector-name{
  font-size:14px;
  letter-spacing:.15px;
}

.hm-sector-avg{
  font-size:13px;
}

.hm-tile{
  border:none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 6px 16px rgba(0,0,0,.16);
}

.hm-g5{ background:linear-gradient(135deg, rgba(22,224,162,.70), rgba(16,185,129,.46)); }
.hm-g2{ background:linear-gradient(135deg, rgba(22,224,162,.52), rgba(16,185,129,.34)); }
.hm-g1{ background:linear-gradient(135deg, rgba(22,224,162,.34), rgba(16,185,129,.22)); }

.hm-r5{ background:linear-gradient(135deg, rgba(255,88,118,.72), rgba(190,52,85,.52)); }
.hm-r2{ background:linear-gradient(135deg, rgba(255,88,118,.52), rgba(190,52,85,.36)); }
.hm-r1{ background:linear-gradient(135deg, rgba(255,88,118,.34), rgba(190,52,85,.24)); }

.hm-n{
  background:linear-gradient(135deg, rgba(71,85,105,.36), rgba(30,41,59,.32));
}

.hm-sym{
  font-size:11px;
  text-shadow:0 1px 2px rgba(0,0,0,.35);
}

.hm-val{
  opacity:.95;
}


/* Heatmap polish v2 */
.hm-meta{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
}

.hm-stat{
  color:#cbd5e1;
  font-size:11px;
  font-weight:800;
  border:1px solid rgba(148,163,184,.16);
  border-radius:999px;
  padding:5px 8px;
  background:rgba(15,23,42,.55);
}

.hm-stat.pos{ color:#16e0a2; }
.hm-stat.neg{ color:#ff5876; }

.hm-sector-pos{
  box-shadow:
    inset 0 0 34px rgba(22,224,162,.045),
    inset 0 1px 0 rgba(255,255,255,.035);
}

.hm-sector-neg{
  box-shadow:
    inset 0 0 34px rgba(255,88,118,.05),
    inset 0 1px 0 rgba(255,255,255,.035);
}

.hm-tile{
  position:relative;
  overflow:hidden;
}

.hm-tile::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, rgba(255,255,255,.10), transparent 45%);
  opacity:.35;
  pointer-events:none;
}

.hm-tile:hover{
  transform:translateY(-2px) scale(1.025);
  z-index:5;
  box-shadow:
    0 0 18px rgba(255,255,255,.08),
    0 10px 24px rgba(0,0,0,.28);
}

@media(max-width:768px){
  .hm-meta{
    justify-content:flex-start;
  }

  .hm-stat{
    font-size:10px;
    padding:4px 7px;
  }
}


.hm-sector-breadth{
  margin-top:2px;
  font-size:11px;
  font-weight:700;
  opacity:.82;
}

.hm-sector-breadth .g{
  color:#16e0a2;
}

.hm-sector-breadth .r{
  color:#ff5b79;
}

.hm-sector-breadth .dot{
  color:#64748b;
  margin:0 4px;
}


.hm-sector-titlebox{
  min-width:0;
}

.hm-sector-breadth{
  margin-top:2px;
  font-size:11px;
  font-weight:700;
  opacity:.82;
}

.hm-sector-breadth .g{ color:#16e0a2; }
.hm-sector-breadth .r{ color:#ff5b79; }
.hm-sector-breadth .dot{
  color:#64748b;
  margin:0 4px;
}


.hm-tooltip{
  position:fixed;
  z-index:99999;
  min-width:190px;
  max-width:260px;
  padding:10px 11px;
  border-radius:12px;
  border:1px solid rgba(96,165,250,.28);
  background:rgba(7,13,20,.96);
  box-shadow:0 16px 40px rgba(0,0,0,.45);
  color:#e5e7eb;
  pointer-events:none;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .10s ease, transform .10s ease;
  font-size:12px;
}

.hm-tooltip.show{
  opacity:1;
  transform:translateY(0);
}

.hm-tip-symbol{
  font-size:15px;
  font-weight:900;
  color:#f8fafc;
  margin-bottom:2px;
}

.hm-tip-line{
  color:#93a4ba;
  font-size:11px;
  margin-bottom:8px;
}

.hm-tip-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:3px 0;
  border-top:1px solid rgba(148,163,184,.10);
}

.hm-tip-row span{
  color:#94a3b8;
}

.hm-tip-row b{
  color:#f8fafc;
}

