/* ===========================================================================
   markets.css — /markets hub + asset cards. Loaded via $extra_css only on the
   markets pages. Uses finscans design tokens (--bullish/--bearish/--neutral,
   --accent, --bg-card, --border, --radius…). Card technical parts render once
   the symbol bridge is wired; until then the fundamental-first layout stands.
   =========================================================================== */

/* Shared mono stack for all numeric/label bits on these pages. */
.mkt-buttons, .mkt-card, .mkt-pager { --mkt-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; }

/* ── Market buttons ─────────────────────────────────────────────────────── */
.mkt-buttons { display: flex; gap: 9px; flex-wrap: wrap; margin: 4px 0 28px; }
.mkt-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .92rem; font-weight: 500;
  color: var(--text); background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 9px 16px; border-radius: var(--radius-pill);
  text-decoration: none; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.mkt-btn:hover { border-color: var(--accent); color: var(--accent); }
.mkt-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mkt-btn .cnt { font-family: var(--mkt-mono); font-size: 11px; opacity: .7; }

/* ── Card grid ──────────────────────────────────────────────────────────── */
.mkt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── Asset card ─────────────────────────────────────────────────────────── */
.mkt-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.mkt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border); }

.mkt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mkt-idl { min-width: 0; }
.mkt-sym { font-family: var(--mkt-mono); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 7px; color: var(--text); }
.mkt-flame { font-size: 12px; }
.mkt-name { font-size: 12px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-type { font-family: var(--mkt-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); background: var(--bg-subtle); border: 1px solid var(--border); padding: 3px 8px; border-radius: var(--radius-pill); white-space: nowrap; }

/* price + 24h change + 7-day sparkline */
.mkt-priced { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 12px; }
.mkt-price { font-family: var(--mkt-mono); font-size: 23px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; color: var(--text); }
.mkt-chg { font-family: var(--mkt-mono); font-size: 13.5px; font-weight: 600; margin-top: 3px; }
.mkt-chg.bullish { color: var(--bullish); }
.mkt-chg.bearish { color: var(--bearish); }
.mkt-chg.neutral { color: var(--text-muted); }
.mkt-sparkwrap { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.mkt-spark { display: block; }
.mkt-sparklab { font-family: var(--mkt-mono); font-size: 9px; color: var(--text-light); letter-spacing: .04em; }

/* fused overall bias (fundamental-only for now) */
.mkt-fuse { margin-top: 13px; padding: 11px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mkt-fuse-lab { font-family: var(--mkt-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.mkt-dim { color: var(--text-light); font-weight: 500; }
.mkt-fuse-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.mkt-dir { font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.mkt-dir.bullish { color: var(--bullish); }
.mkt-dir.bearish { color: var(--bearish); }
.mkt-dir.neutral { color: var(--neutral); }
/* Strength: 5 segments + a word — readable at a glance. */
.mkt-segs { display: inline-flex; gap: 3px; align-items: center; margin-left: auto; }
.mkt-segs i { width: 7px; height: 12px; border-radius: 2px; background: var(--border); display: block; }
.mkt-segs i.on.bullish { background: var(--bullish); }
.mkt-segs i.on.bearish { background: var(--bearish); }
.mkt-segs i.on.neutral { background: var(--neutral); }
.mkt-str { font-family: var(--mkt-mono); font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.mkt-fuse-note { font-size: 11.5px; color: var(--text-muted); margin-top: 9px; }
.mkt-fuse-note.ok { color: var(--bullish); }
.mkt-fuse-note.warn { color: #a4691a; }

/* 3-horizon breakdown */
.mkt-horizons { display: flex; gap: 7px; margin-top: 11px; }
.mkt-hz { flex: 1; text-align: center; padding: 6px 4px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px; }
.mkt-hl { display: block; font-family: var(--mkt-mono); font-size: 9px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
.mkt-ha { display: block; font-size: 15px; font-weight: 700; line-height: 1.1; margin-top: 1px; }
.mkt-ha.bullish { color: var(--bullish); }
.mkt-ha.bearish { color: var(--bearish); }
.mkt-ha.neutral { color: var(--neutral); }
.mkt-soft b { color: var(--text); }

.mkt-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }
.mkt-foot--min { margin-top: 16px; }
.mkt-soft { font-family: var(--mkt-mono); font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.mkt-d { width: 6px; height: 6px; border-radius: 50%; background: #C77E1E; opacity: .7; }
.mkt-go { font-family: var(--mkt-mono); font-size: 11px; color: var(--accent); font-weight: 600; }

@media (max-width: 820px) { .mkt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .mkt-grid { grid-template-columns: 1fr; } }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.mkt-pager { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 28px; flex-wrap: wrap; }
.mkt-pg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-muted);
  font-size: .9rem; font-weight: 600; text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.mkt-pg:hover { color: var(--text); border-color: var(--text-muted); }
.mkt-pg.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mkt-pg.off { opacity: .4; pointer-events: none; }
.mkt-pg.ell { border: none; background: none; pointer-events: none; min-width: 20px; }