/* =====================================================================
 * Utility classes — replace repeated inline style="..." patterns.
 * Adding these is additive; converting call sites is incremental.
 *
 * The seven patterns below cover the highest-repetition inline styles
 * found across Scanner, Analysis, and other feature cards.
 * Each token-anchored so theme changes only require touching tokens.
 * ===================================================================== */

/* — Metric blocks (header label + big value + subline) — */
.u-metric-label {
  font-size: var(--text-xs);          /* 11px */
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.u-metric-value {
  font-size: var(--text-md);          /* 14px */
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.u-metric-sub {
  font-size: var(--text-xs);          /* 11px */
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}

/* — Body / quiet text — */
.u-quiet      { color: var(--text-muted); }
/* — Common list-row pattern: clickable, padded, bordered — */

/* — Generic "nothing here" inline empty (smaller than .empty-state) — */
.u-pane-empty {
  color: var(--text-muted);
  padding: 12px;
  text-align: center;
  font-size: var(--text-sm);
}

/* — Layout shorthands — */
.u-right        { text-align: right; }
.u-grow-center  { flex: 1; text-align: center; }

/* === Refresh Button === */
.mac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--button-border, var(--border));
  background: var(--button-bg, var(--bg-secondary));
  color: var(--button-text, var(--text-primary));
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--button-shadow, none);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

.mac-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--button-hover-shadow, var(--shadow-sm));
}

.mac-btn:active {
  transform: translateY(0);
}

.mac-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.mac-btn:disabled,
.mac-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.mac-btn--primary {
  --button-bg: var(--accent);
  --button-text: var(--text-on-accent);
  --button-border: var(--accent-border);
  --button-shadow: var(--shadow-btn-primary);
  --button-hover-shadow: var(--shadow-btn-primary);
}

.mac-btn--secondary {
  --button-bg: var(--pill-bg);
  --button-text: var(--text-secondary);
  --button-border: var(--glass-edge);
  --button-shadow: var(--shadow-sm);
  --button-hover-shadow: var(--shadow-md);
}

.mac-btn--ghost {
  --button-bg: transparent;
  --button-text: var(--text-muted);
  --button-border: var(--border);
}

.mac-btn--success {
  --button-bg: var(--green-bg);
  --button-text: var(--green);
  --button-border: color-mix(in srgb, var(--green) 42%, transparent);
}

.mac-btn--sm {
  min-height: 30px;
  padding: 0 12px;
  border-radius:var(--radius-sm);
  font-size: 12px;
}

.mac-btn--lg {
  min-height: 42px;
  padding: 0 20px;
  border-radius:var(--radius-md);
  font-size: 14px;
  font-weight: 800;
}

.refresh-btn {
  background: var(--pill-bg);
  border: 1px solid var(--glass-edge);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius:var(--radius-pill);
  cursor: pointer;
  font-size: var(--text-md);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}
.refresh-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.refresh-btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* The Scanner Backtest Range Toggle was removed 2026-07-02 — the leaderboard
   is now always all-history, so .backtest-range-toggle / .backtest-range-btn
   are dead. (A few interleaved .backtest-range-btn fragments remain in the
   shared gold-rim selector lists in components-overrides.css; those get
   cleared in the CSS-lift pass.) */

/* === Cards === */
.card {
  /* Glass on the mesh: a white hairline and a soft shadow. No blur. */
  background: var(--surface-card);
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  padding: 24px;
  transition: box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1), border-color 250ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}
.card:hover { box-shadow: var(--shadow-md); }
.card:active { box-shadow: var(--shadow-card); }

/* Scanner / backtest data tables, dense data:
   tabular figures so numbers don't jitter, a quiet row hover, and the
   existing border separators instead of zebra striping. */
.sc-data-table { font-variant-numeric: tabular-nums; }

/* Card headers: centered, larger (must be BEFORE media queries) */
.card-header-bar {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
}

.an-pill:hover { border-color: var(--blue) !important; color: var(--blue) !important; }

/* === Trade Recap === */
.rv-stat-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.rv-stat-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  text-align: center;
}

.rv-stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.rv-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
}

.recap-dropzone {
  border: 2px dashed var(--border);
  border-radius:var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
  background: var(--bg-card);
}

.recap-dropzone:hover {
  border-color: var(--green);
  background: var(--green-bg);
}
.recap-dropzone:active {
  border-color: var(--green);
  background: var(--green-bg);
  transform: scale(0.98);
}

.behavior-flag {
  padding: 10px 12px;
  border-radius:var(--radius-sm);
  border-left: 3px solid;
  background: var(--bg-secondary);
  margin-bottom: 8px;
}

.behavior-flag.high { border-color: var(--red); }
.behavior-flag.medium { border-color: var(--amber); }
.behavior-flag.good { border-color: var(--green); }

.recap-section-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-edge);
  border-radius:var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.recap-section-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
}

.recap-section-body { padding: 14px 16px; }
