/* Painel — Mesa Spot */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(820px 420px at 12% -8%, rgba(226, 179, 74, 0.06), transparent 55%),
    var(--bg);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.page-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}
.page-spinner {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 2px solid rgba(140, 160, 185, 0.18);
  border-top-color: var(--gold);
  animation: boot-spin 0.75s linear infinite;
}
.page-loader p {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
body.is-booting .shell { visibility: hidden; pointer-events: none; }
body:not(.is-booting) .page-loader {
  opacity: 0; visibility: hidden; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .page-spinner { animation: none; border-top-color: var(--gold); opacity: 0.85; }
  .page-loader { transition: none; }
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  animation: live-pulse 2.6s ease-out infinite;
}
.live-dot.off { background: #5a6578; animation: none; opacity: 0.7; }
@keyframes live-pulse {
  0%, 100% { opacity: 0.7; box-shadow: 0 0 0 0 rgba(78, 201, 168, 0.35); }
  50% { opacity: 1; box-shadow: 0 0 0 4px rgba(78, 201, 168, 0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Estado compacto — contexto, não herói */
.status-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.85rem 0.65rem 0.95rem;
  margin-bottom: var(--space);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(226, 179, 74, 0.05), transparent 32%),
    var(--panel);
  overflow: hidden;
}
.status-strip::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), transparent);
}
.status-id {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 auto;
}
.status-copy { min-width: 0; }
.ex-logo {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: #0b0e11;
  border: 1px solid var(--line);
  padding: 5px;
  overflow: hidden;
}
.ex-logo img, .ex-logo svg {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.ex-title {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ex-sub {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 28rem);
}
.ex-meta {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.ex-meta::-webkit-scrollbar { display: none; }
.tag {
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 550;
  white-space: nowrap;
}
.tag.good { color: var(--good); border-color: rgba(78,201,168,0.28); background: rgba(78,201,168,0.08); }
.tag.bad { color: var(--bad); border-color: rgba(217,123,104,0.3); background: rgba(217,123,104,0.08); }
.tag.gold { color: var(--gold); border-color: rgba(226,179,74,0.32); background: rgba(226,179,74,0.08); }
.tag.warn { color: var(--warn); border-color: rgba(212,160,23,0.35); background: rgba(212,160,23,0.1); }
.tag.scale { color: var(--gold); border-color: rgba(226,179,74,0.35); background: rgba(226,179,74,0.08); }

.kpis {
  --tape: rgba(226, 179, 74, 0.55);
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  isolation: isolate;
}
.kpis::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), rgba(226,179,74,0.15));
  z-index: 2;
}
.kpis::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tape) 18%, rgba(78,201,168,0.55) 48%, var(--tape) 78%, transparent);
  background-size: 220% 100%;
  animation: tape-scan 4.8s ease-in-out infinite;
  opacity: 0.85;
  z-index: 2;
  pointer-events: none;
}
@keyframes tape-scan {
  0%, 100% { background-position: 100% 0; opacity: 0.55; }
  50% { background-position: 0% 0; opacity: 1; }
}
.kpi {
  min-width: 0;
  padding: 0.95rem 1rem 1.05rem;
  border-right: 1px solid var(--line);
}
.kpi:last-child { border-right: none; }
.kpi .label {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .value {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .hint {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body:not(.is-booting) .kpi {
  animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body:not(.is-booting) .kpi:nth-child(1) { animation-delay: 0.04s; }
body:not(.is-booting) .kpi:nth-child(2) { animation-delay: 0.1s; }
body:not(.is-booting) .kpi:nth-child(3) { animation-delay: 0.16s; }
body:not(.is-booting) .kpi:nth-child(4) { animation-delay: 0.22s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .kpis::after { animation: none; opacity: 0.7; }
  body:not(.is-booting) .kpi { animation: none; }
}

/* Markets */
.markets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.market {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.75rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.15s ease;
}
.market:hover { border-color: var(--line-strong); }
.market .pair {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1rem;
  white-space: nowrap;
}
.market .price {
  grid-column: 1;
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.market .price.up { color: var(--good); }
.market .price.down { color: var(--bad); }
.market .price .tick {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}
.market.market-open {
  opacity: 0.72;
  padding: 0.7rem 1rem;
}
.market.market-open .gates,
.market.market-open .setup-meter { display: none; }
.market.market-open .badge {
  grid-row: 1;
  align-self: center;
}
.market .badge {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--line);
}
.badge-wait { color: var(--muted); background: rgba(255,255,255,0.03); }
.badge-buy { color: var(--good); background: rgba(78, 201, 168,0.1); border-color: rgba(78, 201, 168,0.25); }
.badge-sell { color: var(--bad); background: rgba(217, 123, 104,0.1); border-color: rgba(217, 123, 104,0.25); }
.badge-hold { color: var(--gold); background: rgba(226, 179, 74,0.1); border-color: rgba(226, 179, 74,0.28); }
.market .gates {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: 0.1rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
}
.gate {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--muted);
  white-space: nowrap;
}
.gate-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.gate-ok { color: var(--good); }
.gate-ok .gate-dot { background: var(--good); }
.gate-wait { color: var(--gold); }
.gate-wait .gate-dot {
  background: var(--gold);
  animation: pulse 1.8s ease-out infinite;
}
.gate-near { color: var(--text); }
.gate-near .gate-dot { background: var(--good); opacity: 0.75; }
.gate-block { color: var(--bad); }
.gate-block .gate-dot { background: var(--bad); }
.gate-hold { color: var(--gold); }
.gate-hold .gate-dot { background: var(--gold); }
.gate-meta {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  font-weight: 500;
}
.market .setup {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  margin-top: 0.1rem;
}
.setup-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  min-width: 0;
}
.setup-label {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.setup-pct {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.setup-pct.buy { color: var(--good); }
.setup-pct.exit, .setup-pct.sell { color: var(--bad); }
.setup-pct.hold { color: var(--gold); }

/* Positions — max 3/linha; auto-fit preenche a largura se houver menos */
.pos-board {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, max(14.5rem, calc((100% - 1rem) / 3))), 1fr)
  );
  gap: 0.5rem;
}
.pos-card {
  --accent: rgba(226, 179, 74, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}
.pos-card.is-closing {
  opacity: 0.55;
  pointer-events: none;
}
.pos-card.is-up { --accent: rgba(78, 201, 168, 0.55); }
.pos-card.is-down { --accent: rgba(217, 123, 104, 0.5); }
.pos-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.45rem;
}
.pos-card .pair {
  font-family: var(--display);
  font-weight: 650;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.pos-card .invest {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}
.pos-card-pnl {
  text-align: right;
  flex-shrink: 0;
}
.pos-card-pnl .pnl {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.pos-card-pnl .pnl-pct {
  margin-top: 0.06rem;
  font-size: 0.66rem;
  font-weight: 650;
  color: var(--muted);
}
.pos-card-pnl .pnl-pct.pos { color: var(--good); }
.pos-card-pnl .pnl-pct.neg { color: var(--bad); }
.pos-rail {
  --pct: 0;
  --fill: rgba(78, 201, 168, 0.22);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255,255,255,0.04);
}
.pos-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--pct) * 1%);
  max-width: 100%;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent),
    var(--fill);
  background-size: 120% 100%, 100% 100%;
  animation: rail-shimmer 2.4s ease-in-out infinite;
  transition: width 0.45s ease, background-color 0.25s ease;
  pointer-events: none;
  z-index: 0;
}
.pos-rail.under { --fill: rgba(217, 123, 104, 0.28); border-color: rgba(217, 123, 104, 0.18); }
.pos-rail.ok { --fill: rgba(78, 201, 168, 0.22); }
.pos-rail.done { --fill: rgba(78, 201, 168, 0.38); border-color: rgba(78, 201, 168, 0.22); }
@keyframes rail-shimmer {
  0%, 100% { background-position: 100% 0, 0 0; opacity: 0.85; }
  50% { background-position: -20% 0, 0 0; opacity: 1; }
}
.pos-rail .node {
  position: relative;
  z-index: 1;
  min-width: 0;
  text-align: center;
}
.pos-rail .node:first-child { text-align: left; }
.pos-rail .node:last-child { text-align: right; }
.pos-rail .lbl {
  display: block;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.06rem;
}
.pos-rail .val {
  display: block;
  color: var(--text);
  font-weight: 650;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-rail .link {
  position: relative;
  z-index: 1;
  width: 0.55rem;
  height: 1px;
  background: rgba(255,255,255,0.12);
  align-self: center;
  margin-top: 0.6rem;
}
.pos-progress {
  --pct: 0;
  --bar: var(--accent);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: center;
}
.pos-progress.under { --bar: rgba(217, 123, 104, 0.65); }
.pos-progress.under .pct { color: var(--bad); }
.pos-progress.done { --bar: rgba(78, 201, 168, 0.75); }
.pos-progress.scale { --bar: rgba(226, 179, 74, 0.75); }
.pos-progress.scale.done { --bar: rgba(226, 179, 74, 0.95); }
.pos-meters {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-top: 0.35rem;
}
.pos-scale-slot {
  margin-top: 0.4rem;
}
.pos-progress .track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.pos-progress .fill {
  height: 100%;
  width: calc(var(--pct) * 1%);
  border-radius: inherit;
  background: var(--bar);
  transition: width 0.35s ease, background 0.2s ease;
}
.pos-progress .pct {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 2.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pos-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.pos-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.58rem;
  font-weight: 650;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
.pos-chip.wait { color: var(--gold); border-color: rgba(226, 179, 74,0.35); background: rgba(226, 179, 74,0.08); }
.pos-chip.good { color: var(--good); border-color: rgba(78, 201, 168,0.3); background: rgba(78, 201, 168,0.1); }
.pos-chip.bad { color: var(--bad); border-color: rgba(217, 123, 104,0.3); background: rgba(217, 123, 104,0.08); }

.pos-layers {
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.layer-row {
  --pct: 0;
  display: grid;
  grid-template-columns: auto 1.7fr auto 1.7fr minmax(2.4rem, 1.6fr);
  grid-template-areas:
    "idx in qty tp prog";
  column-gap: 0.5rem;
  align-items: center;
  min-width: 0;
  padding: 0.26rem 0.3rem 0.26rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  font-variant-numeric: tabular-nums;
}
.layer-row .lr-idx {
  grid-area: idx;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.03rem 0.36rem;
  line-height: 1.4;
  white-space: nowrap;
  text-align: center;
}
.layer-row .lr-in {
  grid-area: in;
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
  min-width: 0;
}
.layer-row .lr-tp {
  grid-area: tp;
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
  min-width: 0;
}
.layer-row .lr-lbl {
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.layer-row .lr-px {
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-row .lr-qty {
  grid-area: qty;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-row .lr-prog {
  grid-area: prog;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.layer-row .lr-fill {
  display: block;
  height: 100%;
  width: calc(var(--pct) * 1%);
  border-radius: inherit;
  background: var(--good);
  transition: width 0.35s ease, background 0.2s ease;
}
/* Camada mais perto de fechar (líder) */
.layer-row.lead {
  border-color: rgba(226, 179, 74, 0.55);
  background: rgba(226, 179, 74, 0.08);
  box-shadow: 0 0 0 1px rgba(226, 179, 74, 0.16) inset;
}
/* Última camada aberta */
.layer-row.last .lr-idx {
  color: var(--good);
  border-color: rgba(78, 201, 168, 0.4);
  background: rgba(78, 201, 168, 0.1);
}
/* Abaixo da entrada da camada */
.layer-row.under .lr-fill { background: var(--bad); }
.layer-row.under .lr-px { color: var(--bad); }
/* TP da camada atingido (prestes a fechar) */
.layer-row.done .lr-fill { background: var(--good); }
.layer-row.done .lr-px { color: var(--good); }
/* Camada já fechada no TP próprio */
.layer-row.closed {
  opacity: 0.55;
  border-color: rgba(78, 201, 168, 0.25);
}
.layer-row.closed .lr-idx {
  color: var(--good);
  border-color: rgba(78, 201, 168, 0.35);
  background: rgba(78, 201, 168, 0.1);
}
.layer-row.closed .lr-px { color: var(--good); }
.layer-row.closed .lr-fill { background: var(--good); }

.tag.scale {
  color: var(--gold);
  border-color: rgba(226, 179, 74, 0.35);
  background: rgba(226, 179, 74, 0.08);
}

.setup-meter {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin-top: 0.15rem;
}
.setup-meter > span {
  display: block;
  height: 100%;
  border-radius: 0;
  background: rgba(226, 179, 74, 0.7);
  transition: width 0.35s ease;
}
.setup-meter.ready > span { background: rgba(78, 201, 168, 0.85); }
.setup-meter.open > span { background: rgba(78, 201, 168, 0.45); }

.field { min-width: 0; }
.field .k {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field .v {
  margin-top: 0.2rem;
  font-weight: 600;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats strip under history title */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}
.stat {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.stat .k {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat .v {
  margin-top: 0.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Área de trabalho: risco depois vigilância (sempre em coluna) */
.desk {
  display: grid;
  gap: var(--space-lg);
}
.desk > .block {
  margin-bottom: 0;
}
.desk-risk[hidden] { display: none !important; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: none; }
  .kpi:nth-child(1),
  .kpi:nth-child(2) { border-bottom: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .markets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-strip { align-items: flex-start; }
  .ex-meta { margin-left: 0; width: 100%; }
  .ex-sub { max-width: 100%; white-space: normal; }
  .pos-hide-sm { display: none; }
}
@media (max-width: 640px) {
  .markets { grid-template-columns: 1fr; }
  .pos-hide-xs { display: none; }
  .kpi { padding: 0.75rem 0.8rem; }
  .status-id { width: 100%; }
}
