.crow-study-note {
  border: 1px solid var(--border-c);
  border-left: 5px solid var(--link-c);
  border-radius: 0.5rem;
  background: var(--quote-bg);
  color: var(--fg);
  padding: 1rem;
  margin: 1rem 0 1.5rem;
}

.byline,
.subtitle {
  text-align: center;
  color: var(--muted-fg);
}

.subtitle {
  max-width: 56rem;
  margin: 0 auto 1.25rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 1.75rem;
}

.metric {
  border: 1px solid var(--border-c);
  border-radius: 0.5rem;
  background: var(--card-bg);
  padding: 0.9rem;
}

.metric span {
  display: block;
  color: var(--muted-fg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.table-wrap table {
  min-width: 42rem;
}

.crow-study-heatmap a {
  display: block;
  width: min(100%, 58rem);
}

.crow-study-heatmap img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-c);
  background: #fffdf8;
}

.wallet-guard-chart {
  width: 100%;
  margin: 1.5rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border-c);
  border-radius: 0.5rem;
  background: var(--card-bg);
}

.wallet-guard-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.wallet-guard-chart h3 {
  margin: 0;
  color: var(--article-h1h3);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.25;
}

.wallet-guard-chart-detail,
.wallet-guard-chart-status {
  margin: 0.25rem 0 0;
  color: var(--muted-fg);
  font-size: 0.82rem;
}

.wallet-guard-active-cell {
  min-width: 18rem;
  padding: 0.75rem;
  border: 1px solid var(--border-c);
  border-radius: 0.5rem;
  background: var(--bg);
}

.wallet-guard-active-cell strong {
  display: block;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 1.45rem;
  line-height: 1.1;
}

.wallet-guard-active-cell span {
  display: block;
  margin-top: 0.25rem;
  color: var(--fg);
  font-size: 0.78rem;
  line-height: 1.35;
}

.wallet-guard-active-cell dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.65rem 0 0;
}

.wallet-guard-active-cell dt {
  color: var(--muted-fg);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.wallet-guard-active-cell dd {
  margin: 0.15rem 0 0;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.wallet-guard-heatmap-scroll {
  overflow: auto;
  padding-bottom: 0.35rem;
}

.wallet-guard-heatmap-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  font-family: var(--font-mono);
}

.wallet-guard-heatmap-grid th,
.wallet-guard-heatmap-grid td {
  padding: 0;
  border: 0;
}

.wallet-guard-corner {
  width: 11rem;
  color: var(--muted-fg);
  font-size: 0.65rem;
  text-align: right;
}

.wallet-guard-attacker-heading {
  width: 1.45rem;
  min-width: 1.45rem;
  color: var(--muted-fg);
  font-size: 0.6rem;
  line-height: 1;
  text-align: center;
}

.wallet-guard-row-heading {
  position: sticky;
  left: 0;
  z-index: 1;
  max-width: 11rem;
  padding-right: 0.45rem;
  overflow: hidden;
  color: var(--fg);
  background: var(--card-bg);
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-guard-cell-wrapper {
  width: 1.35rem;
  height: 1.35rem;
}

.wallet-guard-cell {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 0.2rem;
  transition:
    outline-color 120ms ease,
    transform 120ms ease;
}

.wallet-guard-cell:hover,
.wallet-guard-cell:focus {
  outline: 2px solid var(--ring-c);
  outline-offset: 1px;
  transform: scale(1.06);
}

.wallet-guard-cell.is-selected {
  box-shadow: 0 0 0 2px var(--ring-c);
}

.wallet-guard-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--muted-fg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.wallet-guard-legend div {
  width: min(16rem, 55vw);
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, hsl(145 72% 24%), hsl(72 72% 36%), hsl(0 72% 48%));
}

@media (max-width: 760px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-guard-chart {
    padding: 0.75rem;
  }

  .wallet-guard-chart-header {
    display: block;
  }

  .wallet-guard-active-cell {
    min-width: 0;
    margin-top: 0.75rem;
  }

  .wallet-guard-active-cell dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-guard-corner,
  .wallet-guard-row-heading {
    width: 8rem;
    max-width: 8rem;
  }
}
