/* ---------- Histórico ---------- */
.history { display: grid; }

/* StatCards (branco / preto / azul) */
.hstats { display: grid; grid-template-columns: 1fr; gap: var(--grid-gutter); margin-bottom: var(--grid-gutter); }
@media (min-width: 600px) { .hstats { grid-template-columns: repeat(3, 1fr); } }
.hstat { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6); min-height: 196px; padding: var(--space-5); border-radius: var(--radius-md); background: var(--surface); color: var(--text); }
.hstat__top { display: flex; justify-content: space-between; font: 500 12px/16px var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.hstat__value { display: block; font: 300 clamp(56px, 6vw, 72px)/1 var(--font-display); letter-spacing: -.04em; }
.hstat__label { display: block; font: 400 14px/20px var(--font-text); margin-top: var(--space-2); }
.hstat--inverse { background: var(--surface-inverse); color: var(--on-inverse); }
.hstat--inverse .hstat__top { color: inherit; opacity: .75; }
.hstat--inverse .hstat__value { color: var(--accent-on-inverse); }
.hstat--brand { background: var(--brand); color: var(--on-brand); }
.hstat--brand .hstat__top { color: inherit; opacity: .85; }
@media (max-width: 599px) { .hstat { min-height: 0; gap: var(--space-5); } }

/* Tabela */
.history-table { background: var(--surface); border-radius: var(--radius-md); padding: var(--space-2) var(--space-5); }
.htable { width: 100%; border-collapse: collapse; }
.htable th { font: 500 12px/16px var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: var(--space-4) var(--space-3); text-align: left; white-space: nowrap; }
.htable td { padding: var(--space-4) var(--space-3); border-top: 1px solid var(--border); vertical-align: middle; font: 400 14px/20px var(--font-text); }
.htable th:first-child, .htable td:first-child { padding-left: 0; }
.htable th:last-child, .htable td:last-child { padding-right: 0; }
.htable__date { font-variant-numeric: tabular-nums; }
.htable__size { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.htable td.htable__score { font: 300 24px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Mobile: uma análise por card, sem scroll horizontal */
@media (max-width: 719px) {
  .history-table { background: none; padding: 0; }
  .htable, .htable tbody { display: block; }
  .htable thead { display: none; }
  .htable tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-2);
    background: var(--surface); border-radius: var(--radius-md); padding: var(--space-5); margin-bottom: var(--grid-gutter);
  }
  .htable td { display: block; border: 0; padding: 0; }
  .htable th:first-child, .htable td:first-child { padding-left: 0; }
  .htable td.htable__score { order: 1; flex: 1 1 auto; font-size: 40px; }
  .htable__verdict { order: 2; }
  .htable tr::after { content: ""; order: 3; flex-basis: 100%; height: 1px; background: var(--border); }
  .htable__kind, .htable__size, .htable__date { color: var(--text-muted); font-size: 13px; line-height: 18px; }
  .htable__kind { order: 4; color: var(--text); font-weight: 500; }
  .htable__size { order: 5; }
  .htable__date { order: 6; }
  .htable__kind::after, .htable__size::after { content: "·"; margin-left: var(--space-2); color: var(--text-muted); }
}

/* Estado vazio */
.history-empty {
  display: grid; gap: var(--space-5); justify-items: start;
  background: var(--surface-inverse); color: var(--on-inverse); border-radius: var(--radius-lg); padding: var(--space-8) var(--space-6);
}
.history-empty__title { font: 500 clamp(40px, 5.2vw, 64px)/1 var(--font-display); letter-spacing: -.03em; }
.history-empty__text { font: 400 18px/28px var(--font-text); max-width: 46ch; opacity: .8; }
.history-empty .btn--primary { background: var(--on-inverse); color: var(--surface-inverse); margin-top: var(--space-3); white-space: normal; }
@media (max-width: 599px) {
  .history-empty { padding: var(--space-7) var(--space-5); border-radius: var(--radius-md); }
  .history-empty__text { font-size: 16px; line-height: 24px; }
  .history-empty .btn { width: 100%; }
}

/* Link público (share) */
.htable__share { white-space: nowrap; }
.htable__link { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-accent); font: 500 14px/20px var(--font-text); text-decoration: none; }
.htable__link:hover { text-decoration: underline; }
.htable__link svg { width: 14px; height: 14px; }
.htable__none { color: var(--text-muted); }
@media (max-width: 719px) {
  .htable__share { order: 7; margin-left: auto; }
  .htable__share:has(.htable__none) { display: none; }
}

/* Tipo com ícone (imagem, vídeo, texto) */
.htable__kind-in { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.htable__kind-in svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
