/* Casca igual ao profile-card */
.history-shell {
  padding: 20px;
}

/* ====== Grid ====== */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

/* ====== Card ====== */

.history-item {
  /* o .card já dá borda/raio/sombra */
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}

/* Mostra contorno só para teclado (não no clique do mouse) */
.card-link:focus {
  outline: none;
}

.card-link:focus:not(:focus-visible) {
  outline: none;
}

.card-link:focus-visible {
  outline: 3px solid rgba(255, 106, 0, .35);
  outline-offset: 3px;
}

.card-main {
  padding: 14px
}

/* Topo do card */
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.who {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.who__name {
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--ink)
}

.who__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-item .badge {
  position: static;
  top: auto;
  right: auto;
  min-width: auto;
  height: auto;
  box-shadow: none;
  color: #000;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}

.badge--age::before {
  content: "🎂"
}

.when {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 2px
}

.when__date {
  font-weight: 800
}

.when__time {
  font-size: 12px;
  color: var(--muted)
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px
}

.foot__hint {
  font-size: 12px;
  color: var(--muted)
}

/* Empty / Error (mesma cara dos cards globais) */
.empty {
  grid-column: 1/-1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--elev);
  padding: 18px;
  text-align: center;
}

.empty--error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b
}

/* Skeleton */
.skeleton {
  grid-column: 1/-1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--elev);
  padding: 14px;
}

.skeleton__line {
  height: 12px;
  background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
  background-size: 200% 100%;
  border-radius: 999px;
  margin: 10px 0;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

@media (max-width:640px) {
  .history-grid {
    grid-template-columns: 1fr
  }
}