/* ── History View — Spoonfull Crash Companion™ ───────────────────────────── */
.history-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.history-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.history-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.history-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.history-item {
  padding: 12px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-time {
  font-size: 12px;
  color: var(--text-faint);
}

.history-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 10px;
}

.history-sender-other {
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.history-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 10px;
}

.history-text-tag {
  font-style: italic;
}

.history-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.history-card-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border-subtle);
}

.history-footer {
  padding: 10px 14px 14px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

@media (min-width: 640px) {
  .history-view {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
  }
}
