/* ============================================================
   Alpha Finance v2: Prediction Markets (/prediction-markets/)
   Loaded after sentiment.css, whose hero, feed line and segmented
   control it reuses. Only what is new to this page lives here: the
   market cards, their category chips and probability bars, the two
   grids, the live pulse and the change flashes.
   ============================================================ */

/* one colour per category; crypto and macro come from the tokens,
   geopolitics needs a hue the palette does not have */
:root { --pm-geo: #6ea8e0; }

/* ---------- hero: the page has no stat tiles, so the hero is one column ---------- */

.snthero .pm-hero { padding: 26px 0 22px; max-width: 760px; }
.snthero .pm-hero .dek { max-width: 640px; }

/* the live pulse and the "updated Ns ago" ticker, on the feed line */
.feed .pm-live { display: inline-flex; align-items: center; gap: 8px; }
.pm-pulse { position: relative; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.feed.is-live .pm-pulse { background: var(--lime); }
.feed.is-live .pm-pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; background: var(--lime); opacity: 0.5;
  animation: pm-pulse 1.8s ease-out infinite;
}
@keyframes pm-pulse { 0% { transform: scale(0.5); opacity: 0.5; } 100% { transform: scale(2.4); opacity: 0; } }
.feed .pm-live b { font-variant-numeric: tabular-nums; }

/* ---------- section heads: the count, the tabs ---------- */

.pm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: -4px 0 14px; }
.pm-head .seg { margin-right: auto; }
.pm-note { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted); }

/* ---------- grids ---------- */

.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pm-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- the card ---------- */

.pm-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 16px 17px 15px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  transition: border-color 0.15s;
}
.pm-card:hover { border-color: var(--line-2); }

/* top row: category chip, the day's volume */
.pm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pm-cat {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
.pm-cat.c-crypto { color: var(--lime); background: color-mix(in srgb, var(--lime) 13%, transparent); }
.pm-cat.c-macro { color: var(--heat); background: color-mix(in srgb, var(--heat) 14%, transparent); }
.pm-cat.c-geo { color: var(--pm-geo); background: color-mix(in srgb, var(--pm-geo) 15%, transparent); }
.pm-v24 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-v24 b { font-weight: 500; color: var(--text-2); }

/* the question, with the market's image beside it */
.pm-q { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; }
.pm-img { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.pm-t { font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text); letter-spacing: -0.005em; }

/* outcomes: name, bar, figure */
.pm-outs { display: flex; flex-direction: column; gap: 7px; }
.pm-out { display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.pm-on { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-out.lead .pm-on { color: var(--text); }
.pm-bar { display: block; height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.pm-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--faint); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.pm-out.lead .pm-bar i { background: var(--lime-dim); }
.pm-op { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.pm-op.flash-up { animation: pm-flash-up 1.6s ease-out; }
.pm-op.flash-down { animation: pm-flash-down 1.6s ease-out; }
@keyframes pm-flash-up { 0%, 30% { color: var(--pos-text); } 100% { color: var(--text); } }
@keyframes pm-flash-down { 0%, 30% { color: var(--neg-text); } 100% { color: var(--text); } }

/* footer: lifetime volume, the end date */
.pm-foot {
  display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pm-src { align-self: flex-start; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.03em; color: var(--lime); text-decoration: none; }
.pm-src:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- states ---------- */

.pm-empty {
  grid-column: 1 / -1; padding: 38px 20px; text-align: center;
  border: 1px dashed var(--line); border-radius: 8px;
  font-size: 13px; color: var(--muted);
}
.pm-more {
  display: block; width: 100%; margin-top: 12px; padding: 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); cursor: pointer;
}
.pm-more:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .pm-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .pm-grid, .pm-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .pm-out { grid-template-columns: minmax(0, 96px) minmax(0, 1fr) 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-bar i { transition: none; }
  .feed.is-live .pm-pulse::after, .pm-op.flash-up, .pm-op.flash-down { animation: none; }
}
