body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f6f8;
  color: #121417;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.topbar h1,
.panel h2 {
  margin: 0 0 8px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

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

.panel {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 16px;
}

.span-2 {
  grid-column: span 2;
}

.metric {
  font-size: 28px;
  font-weight: 700;
}

.subtle {
  color: #5f6b7a;
  font-size: 14px;
}

.basket {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.basket-item {
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafbfc;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e9ef;
  text-align: left;
}

th {
  background: #fafbfc;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e9ef;
  border-radius: 6px;
  background: #fafbfc;
}

.history-item strong {
  font-size: 14px;
}

.history-item span {
  color: #5f6b7a;
  font-size: 13px;
}

.heatmap-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.equity-chart-wrap {
  margin: 12px 0 16px 0;
  border: 1px solid #e5e9ef;
  border-radius: 6px;
  background: #fafbfc;
  overflow: hidden;
}

#equity-chart {
  width: 100%;
  height: 340px;
  display: block;
}

#equity-series-table {
  margin-top: 8px;
  font-size: 13px;
}

.heatmap-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 1px;
  font-size: 12px;
}

.heatmap-table th,
.heatmap-table td {
  border: none;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}

.heatmap-table thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.heatmap-row-label {
  position: sticky;
  left: 0;
  background: #ffffff;
  text-align: left !important;
  font-weight: 700;
  z-index: 1;
}

.empty-state {
  color: #5f6b7a;
  font-size: 14px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}
