/**
 * Shared Recent Calculations card UI (United States calculator source of truth).
 * Box/layout tokens for toolbar, cards, delete control, empty state.
 * China keeps equal visual weight for all cards (no faded older entries).
 */

.recent-calculations-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.recent-calculations-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
  margin: 0;
}
.recent-history-toggle {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #2563eb;
  background: transparent;
  border: none;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}
.recent-history-toggle:hover,
.recent-history-toggle:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  outline: none;
}
.recent-calculations-panel {
  margin-top: 0.25rem;
}
.recent-calculations-cards {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.recent-calc-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s ease, opacity 0.15s;
  opacity: 1;
}
.recent-calc-card--latest,
.recent-calc-card--older {
  border-color: #e5e7eb;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  opacity: 1;
}
.recent-calc-card .recent-calc-val {
  color: #0f172a;
  font-weight: 600;
}
.recent-calc-card .recent-calc-label {
  color: #64748b;
}
.recent-calc-card .recent-calc-line--meta {
  color: #94a3b8;
  font-weight: 400;
}
.recent-calc-card:has(.recent-calc-card-text:hover) {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(15,23,42,0.09);
  transform: translateY(-1px);
  cursor: pointer;
}
.recent-calc-card:has(.recent-calc-card-text:active) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(15,23,42,0.07);
  border-color: #94a3b8;
}
.recent-calc-card:has(.recent-calc-card-text:focus-visible) {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.recent-calc-card-text {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  text-align: left;
  border-radius: 0.45rem;
  -webkit-tap-highlight-color: transparent;
}
.recent-calc-card-text:focus,
.recent-calc-card-text:focus-visible {
  outline: none;
}
.recent-calc-line {
  font-size: 0.8125rem;
  line-height: 1.35;
}
.recent-calc-line--gross,
.recent-calc-line--net {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: baseline;
}
.recent-calc-line--net {
  margin-top: 1px;
}
.recent-calc-line--meta {
  margin-top: 0.28rem;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #94a3b8;
  font-weight: 400;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.recent-calc-label {
  font-weight: 500;
  color: #64748b;
  min-width: 0;
}
.recent-calc-val {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.recent-calc-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  box-shadow: none;
  align-self: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.recent-calc-delete:hover,
.recent-calc-delete:focus-visible {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
  outline: none;
}
.recent-calc-delete:focus-visible {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.recent-calc-delete svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}
.recent-calculations-empty {
  padding: 0.85rem 0.75rem;
  border-radius: 0.75rem;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  text-align: center;
}
.recent-calculations-empty-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.3rem 0;
}
.recent-calculations-empty-hint {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.45;
  margin-top: 0;
  margin-bottom: 0;
  text-align: left;
}
@media (prefers-reduced-motion: reduce) {
  .recent-calc-card {
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  }
  .recent-calc-card:has(.recent-calc-card-text:hover),
  .recent-calc-card:has(.recent-calc-card-text:active),
  .recent-calc-card.recent-calc-card--pop {
    transform: none;
  }
}
