/* Result view: the result column and banner stack, balance headline, status
   badges, the usage stat grid, and the key-detail rows. */

/* ---------- Result layout ---------- */
.result {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.result-banners {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Balance headline */
.balance-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-7);
  flex-wrap: wrap;
}
.balance-main {
  min-width: 0;
}
.balance-label {
  display: block;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.balance-value {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  color: var(--foreground);
}
.balance-value.is-negative {
  color: var(--destructive);
}
.balance-hint {
  display: block;
  margin-top: var(--space-2);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.balance-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
  text-align: right;
}
.key-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  word-break: break-all;
}
.badge-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Badges (same palette as the admin panel) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: #525252;
  color: #ffffff;
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success {
  background: #0f766e;
  border-color: #0f766e;
}
.badge-info {
  background: #2563eb;
  border-color: #2563eb;
}
.badge-warning {
  background: #b45309;
  border-color: #b45309;
}
.badge-error {
  background: #dc2626;
  border-color: #dc2626;
}
/* One slate step darker than the admin panel's #94a3b8, which renders white
   11px bold text at 2.56:1 and fails WCAG AA. This carries the "Usage" badge on
   every ledger row, so it has to be readable; #64748b measures 4.76:1. */
.badge-muted {
  background: #64748b;
  border-color: #64748b;
}

/* Stat grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.2;
}
.stat-icon {
  flex: none;
  opacity: 0.45;
  font-size: var(--text-base);
}
.stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  overflow-wrap: anywhere;
}
.stat-value--danger {
  color: var(--destructive);
}
.stat-sub {
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  line-height: 1.35;
  min-height: 1rem;
}

/* Detail rows */
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-7);
  margin: 0;
}
.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.detail-term {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  /* The value can wrap; the label must not. A long operator-set key name
     otherwise squeezes this cell until "Key name" splits into "Key" / "name". */
  flex: none;
  white-space: nowrap;
}
.detail-desc {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

