/* Market depth & buy/sell pressure heatmap (kse-market-depth-heatmap.js): markets page and dashboard card. */
.kse-market-depth-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--kse-line);
}

.kse-market-depth-section h2 {
  margin: 0 0 8px;
  color: #12304a;
  font-size: 1.2rem;
  font-weight: 800;
}

.kse-market-depth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 12px;
  color: #536b7e;
  font-size: 0.75rem;
}

.kse-market-depth-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kse-market-depth-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #d7e3ec;
}

.kse-market-depth-legend .is-sell { background: #ef8e91; }
.kse-market-depth-legend .is-balanced { background: #e8d38a; }
.kse-market-depth-legend .is-buy { background: #73c9a2; }

.kse-market-depth-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 42px;
  grid-auto-flow: dense;
  gap: 6px;
}

.kse-market-depth-tile {
  grid-column: span var(--depth-span, 1);
  grid-row: span 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid rgba(30, 60, 80, 0.08);
  border-radius: 8px;
  color: #12304a;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.kse-market-depth-tile:hover { filter: saturate(1.15); transform: translateY(-1px); }
.kse-market-depth-tile.is-buy { background: linear-gradient(135deg, #e3f7ee, #a9e2c8); }
.kse-market-depth-tile.is-balanced { background: linear-gradient(135deg, #fff8df, #f1dda0); }
.kse-market-depth-tile.is-sell { background: linear-gradient(135deg, #fff0ef, #f4b8b7); }
.kse-market-depth-tile.is-stale { background: #e6ebef; color: #687987; }
.kse-market-depth-tile strong { font-size: 0.82rem; line-height: 1; }
.kse-market-depth-pressure { font-size: 0.72rem; font-weight: 800; }
.kse-market-depth-total { font-size: 0.68rem; font-weight: 700; }
.kse-market-depth-sides { display: flex; justify-content: space-between; gap: 4px; font-size: 0.59rem; }
.kse-market-depth-sides i { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.kse-market-depth-status { margin: 10px 0 0; color: #697f90; font-size: 0.75rem; }
.kse-market-depth-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 12px 0 0; }
.kse-market-depth-controls label { display: flex; flex-direction: column; gap: 3px; color: #536b7e; font-size: 0.72rem; font-weight: 700; }
.kse-market-depth-controls input[type="search"], .kse-market-depth-controls select { min-height: 34px; padding: 5px 8px; border: 1px solid #cfdbe5; border-radius: 7px; background: #fff; color: #12304a; font-size: 0.8rem; }
.kse-market-depth-controls input[type="search"] { width: 130px; }
.kse-market-depth-controls .kse-market-depth-check { flex-direction: row; align-items: center; gap: 6px; min-height: 34px; }

@media (max-width: 680px) {
  .kse-market-depth-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 38px; gap: 5px; }
  .kse-market-depth-tile { padding: 6px; }
  .kse-market-depth-tile strong { font-size: 0.75rem; }
  .kse-market-depth-sides { font-size: 0.52rem; }
  .kse-market-depth-controls label { flex: 1 1 40%; }
  .kse-market-depth-controls input[type="search"] { width: 100%; }
}

/* Dashboard card: Market Movers style (lw-tabs + lw-table) with a buy/sell split bar per stock. */
.lw-depth-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.lw-depth-toolbar .lw-tabs { flex-wrap: nowrap; margin: 0; }
.lw-depth-toolbar .lw-tab { white-space: nowrap; }
.lw-depth-index { min-width: 0; }
.lw-depth-index select { width: 100%; max-width: 130px; height: 24px; padding: 0 6px; border: 1px solid #d7e1ee; border-radius: 5px; background: #f8fafc; color: #425466; font-size: 0.71rem; font-weight: 700; cursor: pointer; }
.lw-depth-table td { vertical-align: middle; }
.lw-depth-table th:nth-child(2), .lw-depth-table td:nth-child(2) { width: 48%; }
.lw-depth-table td.num { font-weight: 700; white-space: nowrap; }
.lw-depth-split { display: flex; height: 6px; overflow: hidden; border-radius: 999px; background: #cf3f4d; }
.lw-depth-split span { background: #0b8f5f; }
.lw-depth .kse-market-depth-status { margin: 7px 2px 0; color: #94a3b8; font-size: 0.68rem; }
