/* Screen styles for the markets group. Tokens and shared components live in ../app.css; use var(--…) tokens only. */

/* ---- Shared within the group ------------------------------------------------- */
.mkt-row { margin-bottom: var(--space-md); }

/* Tag values (types) read in sentence case */
.mkt-type .tag { display: inline-block; }
.mkt-type .tag::first-letter { text-transform: uppercase; }

/* On a phone the column that names the row stays in view while the rest scrolls */
@media (max-width: 48rem) {
  .mkt-pin table.t th:first-child,
  .mkt-pin table.t td:first-child { position: sticky; left: 0; z-index: 1; background: var(--glass-solid); box-shadow: inset -1px 0 0 var(--color-rule), inset 0 -1px 0 var(--color-row); }
  .mkt-pin table.t th:first-child { box-shadow: inset -1px 0 0 var(--color-rule), inset 0 -1px 0 var(--color-rule); }
}

/* ---- Markets: venue split beside the pair opener, then the pair list ---------- */
.mkt-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-md); align-items: start; margin-bottom: var(--space-md); }
@media (max-width: 60rem) { .mkt-top { grid-template-columns: minmax(0, 1fr); } }
.mkt-venue-table { margin-top: var(--space-sm); }
.mkt-open { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
.mkt-open .btn { justify-self: start; }
.mkt-field { display: grid; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.mkt-field input { width: 100%; }
.mkt-examples { margin: var(--space-md) 0 0; padding-top: var(--space-sm); box-shadow: inset 0 1px 0 var(--color-row); font-size: var(--text-sm); line-height: 1.6; color: var(--color-muted); text-wrap: pretty; }
.mkt-pair-tools { flex-wrap: wrap; }
.mkt-pair-tools input { width: 14rem; }
@media (max-width: 40rem) { .mkt-pair-tools, .mkt-pair-tools input { width: 100%; } }

/* ---- Pair: the quote leads, chart beside its fill summary, then the tape ---- */
.mkt-pair-title { font-size: var(--text-xl); }
.mkt-quote-card { margin-bottom: var(--space-md); }
.mkt-quote { display: grid; grid-template-columns: minmax(14rem, auto) minmax(0, 1fr); align-items: stretch; }
.mkt-last { display: flex; flex-direction: column; justify-content: center; gap: var(--space-2xs); padding: var(--space-lg); }
.mkt-last .big { font: 500 var(--text-3xl)/1.1 var(--font-display); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; color: var(--color-ink); }
.mkt-chg { font-size: var(--text-md); font-weight: 500; font-variant-numeric: tabular-nums; }
.mkt-chg .muted { font-size: var(--text-xs); font-weight: 400; }
.mkt-meta { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); font-size: var(--text-xs); color: var(--color-muted); }
.mkt-tally { margin: 0; box-shadow: none; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.mkt-tally .tile:first-child { margin-left: 0; }
.mkt-tally .tile { display: flex; flex-direction: column; justify-content: center; padding: var(--space-lg); }
.mkt-skel-quote { grid-column: 1 / -1; height: 40px; width: 60%; margin: var(--space-lg); }
@media (max-width: 48rem) {
  .mkt-quote { grid-template-columns: minmax(0, 1fr); }
  .mkt-last { padding-bottom: var(--space-md); }
  .mkt-tally { grid-template-columns: repeat(2, minmax(0, 1fr)); box-shadow: inset 0 1px 0 var(--color-rule); }
  .mkt-tally .tile { padding: var(--space-md) var(--space-lg); box-shadow: inset 1px 0 0 var(--color-rule), inset 0 -1px 0 var(--color-rule); margin-bottom: -1px; }
}

.mkt-pair-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(20rem, 1fr); gap: var(--space-md); align-items: start; margin-bottom: var(--space-md); }
@media (max-width: 75rem) { .mkt-pair-grid { grid-template-columns: minmax(0, 1fr); } }
.mkt-chart-card { padding: var(--space-md) var(--space-lg) var(--space-lg); }
.mkt-chart-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-lg); margin-bottom: var(--space-sm); }
.mkt-ctl { display: flex; min-width: 0; max-width: 100%; }
.mkt-mode { margin-left: auto; }
.mkt-skel-chart { height: 480px; }
.mkt-vf { margin: 0; padding: 0 var(--space-lg); }
.mkt-vf:empty { display: none; }
@media (max-width: 40rem) {
  .mkt-chart-card { padding: var(--space-md); }
  .mkt-mode { margin-left: 0; }
  .mkt-vf { padding: 0 var(--space-md); }
}

/* ---- Trades: filters sit on the tape they filter ------------------------------ */
.mkt-filters { padding-bottom: var(--space-xs); }
.mkt-taker { width: 16rem; }
@media (max-width: 40rem) { .mkt-taker { width: 100%; } }

/* ---- Asset: identity leads beside its markets, then its activity -------------- */
.mkt-asset-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-md); align-items: start; margin-bottom: var(--space-lg); }
@media (max-width: 75rem) { .mkt-asset-grid { grid-template-columns: minmax(0, 1fr); } }
.mkt-asset-grid .kv code { word-break: break-all; }
.mkt-tabs .tabs { margin-bottom: var(--space-md); }

/* ---- Pools -------------------------------------------------------------------- */
.mkt-pool-filter { width: 14rem; }
@media (max-width: 40rem) { .mkt-pool-filter { width: 100%; } }
