.local-grid-panel {
  grid-column: 1 / -1;
}

.grid-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.grid-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.grid-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.local-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.local-grid-card {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}

.local-grid-card figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.local-grid-card figcaption > div:first-child {
  display: grid;
  gap: 4px;
}

.local-grid-card figcaption strong {
  color: var(--text);
  font-size: 13px;
}

.local-grid-card figcaption span,
.local-grid-card footer {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.grid-card-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grid-card-stats span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
  color: var(--text);
}

.local-grid {
  --grid-size: 5;
  display: grid;
  grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
  gap: 5px;
  width: min(100%, 380px);
  margin: 0 auto;
  aspect-ratio: 1;
}

.local-grid-point {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 7px;
  color: #fff;
  font-size: clamp(9px, 1.4vw, 12px);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.grid-rank-top3 {
  background: #15803d;
}

.grid-rank-top10 {
  background: #f59e0b;
}

.grid-rank-visible {
  background: #e55c3e;
}

.grid-rank-missing {
  background: #94a3b8;
}

.local-grid-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.grid-report-link {
  color: var(--primary);
  text-decoration: none;
}

.grid-report-link:hover {
  text-decoration: underline;
}

.local-grid-empty {
  max-width: none;
}

@media (max-width: 760px) {
  .grid-legend {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .local-grid-card {
    padding: 10px;
  }

  .local-grid-card figcaption {
    flex-direction: column;
  }

  .grid-card-stats {
    justify-content: flex-start;
  }
}
