/*
 * Trade view stylesheet — Phase 3.3
 * Tokens come from design-system/pages/trade-view.md (kept dark+orange brand,
 * adopted Fira fonts + tier/recommendation/confidence colors + skeleton).
 */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #21262d;
  --border:    #30363d;
  --accent:    #f97316;
  --accent2:   #fb923c;
  --text:      #e6edf3;
  --text2:     #8b949e;
  --green:     #3fb950;
  --red:       #f85149;
  --warning:   #f59e0b;
  /* Tier badges */
  --tier-fast:    #3fb950;
  --tier-normal:  #d29922;
  --tier-slow:    #f97316;
  --tier-dead:    #f85149;
  --tier-unknown: #6e7681;
  /* Recommendations */
  --rec-buy:   #f97316;
  --rec-skip:  #6e7681;
  --rec-watch: #58a6ff;
  /* Confidence */
  --conf-high:   #3fb950;
  --conf-medium: #d29922;
  --conf-low:    #f85149;
  /* Typography */
  --font-body: 'Fira Sans', system-ui, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, Menlo, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/*
 * Universal [hidden] enforcement.
 * Some of our containers have explicit display: flex / grid in their own
 * rules (e.g. .modal-overlay, .aggregate-section, .filters-bar, .role-badge),
 * which override the user-agent's default `[hidden] { display: none }`. That
 * meant setting `.hidden = true` from JS *visibly* did nothing and the modal
 * couldn't be closed. This rule wins regardless.
 */
[hidden] { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:where(button, a, input, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.trade-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 50;
  flex-wrap: wrap;
  gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 18px; font-weight: 700; color: var(--text); }
.logo span { color: var(--accent); }
.back-link { color: var(--text2); font-size: 13px; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--accent); color: var(--accent);
}
.role-badge[hidden] { display: none; }
.btn-primary, .btn-secondary, .btn-danger, .btn-outline, .btn-icon {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { color: var(--red); border-color: rgba(248, 81, 73, 0.4); }
.btn-danger:hover { background: rgba(248, 81, 73, 0.08); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}
.btn-icon:hover { border-color: var(--red); color: var(--red); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Aggregate stats ─────────────────────────────────────────────── */
.aggregate-section {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.agg-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.agg-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text2);
}
.agg-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 700; color: var(--text);
}
.agg-value.highlight { color: var(--accent); }
.tier-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tier-count {
  font-family: var(--font-mono);
  font-size: 11px; padding: 2px 8px;
  border-radius: 4px; font-weight: 600;
}
.tier-count.fast    { background: rgba(63, 185, 80, 0.18);  color: var(--tier-fast); }
.tier-count.normal  { background: rgba(210, 153, 34, 0.18); color: var(--tier-normal); }
.tier-count.slow    { background: rgba(249, 115, 22, 0.18); color: var(--tier-slow); }
.tier-count.dead    { background: rgba(248, 81, 73, 0.18);  color: var(--tier-dead); }
.tier-count.unknown { background: rgba(110, 118, 129, 0.18); color: var(--tier-unknown); }

/* ── Filter bar ────────────────────────────────────────────────────── */
.filters-bar {
  background: var(--surface);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group > label {
  font-size: 11px; text-transform: uppercase; color: var(--text2);
  letter-spacing: 0.06em;
}
.filter-group select, .filter-group input[type="text"] {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}
.filter-group select:focus, .filter-group input:focus { border-color: var(--accent); }
.tier-filter { display: flex; gap: 6px; }
.tier-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}
.tier-btn.active[data-tier="FAST"]   { background: var(--tier-fast);   color: #fff; border-color: var(--tier-fast); }
.tier-btn.active[data-tier="NORMAL"] { background: var(--tier-normal); color: #fff; border-color: var(--tier-normal); }
.tier-btn.active[data-tier="SLOW"]   { background: var(--tier-slow);   color: #fff; border-color: var(--tier-slow); }
.tier-btn.active[data-tier="DEAD"]   { background: var(--tier-dead);   color: #fff; border-color: var(--tier-dead); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.toggle span { font-size: 13px; color: var(--text); }

/* ── Cards ────────────────────────────────────────────────────────── */
.cards-container {
  flex: 1;
  padding: 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.loading-state {
  text-align: center; padding: 48px 16px;
  color: var(--text2); font-size: 13px;
}
.empty-state {
  text-align: center; padding: 80px 24px; max-width: 480px; margin: 0 auto;
}
.empty-state h2 { font-size: 22px; margin: 16px 0 8px; }
.empty-state p { color: var(--text2); font-size: 14px; line-height: 1.5; margin-bottom: 24px; }
.empty-icon { font-size: 64px; opacity: 0.3; line-height: 1; }
.empty-state .btn-primary { display: inline-block; padding: 10px 24px; }

/* ── Trade card ──────────────────────────────────────────────────── */
.trade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 280px 1fr 1fr 220px;
  gap: 20px;
  position: relative;
  transition: border-color 200ms ease, transform 150ms ease;
}
.trade-card[data-state="loading"] {
  border-color: rgba(88, 166, 255, 0.3);
  animation: pulse-loading 2s infinite;
}
.trade-card[data-state="error"] { border-color: rgba(248, 81, 73, 0.4); }
.trade-card[data-bought="1"]::after {
  content: "BOUGHT";
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em;
  animation: fade-in 250ms ease;
}
.trade-card.fade-out { animation: fade-slide-up 250ms ease-in forwards; }

@keyframes pulse-loading { 0%, 100% { box-shadow: 0 0 0 0 rgba(88, 166, 255, 0); } 50% { box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.12); } }
@keyframes fade-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fade-slide-up { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-12px); } }
@keyframes skeleton-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; opacity: 0.6; }
  .trade-card[data-state="loading"] { animation: none; }
  .trade-card.fade-out { animation: none; opacity: 0; }
}

/* Card columns */
.col-identity, .col-pricing, .col-liquidity, .col-decision { min-width: 0; }
.col-identity { display: flex; flex-direction: column; gap: 8px; }
.item-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px;
}
.item-img-placeholder {
  width: 100%; aspect-ratio: 4 / 3;
  background: var(--surface2); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 11px;
}
.item-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-meta { display: flex; gap: 6px; align-items: center; }
.wear-badge {
  background: var(--surface2); padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.float-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 11px; color: var(--text2);
}

/* Float position bar */
.float-bar-container { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.float-bar-track {
  height: 6px;
  background: linear-gradient(90deg,
    #4ade80 0% 14%,
    #fbbf24 14% 50%,
    #f97316 50% 60%,
    #ef4444 60% 100%);
  border-radius: 3px; position: relative;
}
.float-marker {
  position: absolute; top: -2px;
  width: 3px; height: 10px;
  background: #fff;
  border-radius: 1px;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}
.float-label { font-size: 10px; color: var(--text2); }

.pattern-note, .sticker-note {
  font-size: 11px; color: var(--text2);
  background: var(--surface2);
  padding: 4px 8px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}

/* Pricing column */
.col-pricing {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
}
.price-source, .price-target {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.market-label {
  font-size: 10px; text-transform: uppercase;
  color: var(--text2); letter-spacing: 0.06em;
}
.price-big {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 700;
}
.price-note { font-size: 10px; color: var(--text2); }
.arrow-down { color: var(--text2); font-size: 16px; line-height: 1; }
.fees-row { font-size: 11px; color: var(--text2); margin-top: 4px; }
.net-profit {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 20px; font-weight: 700; color: var(--accent); margin-top: 8px;
}
.margin-row {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--text2);
}

/* Liquidity column */
.col-liquidity { display: flex; flex-direction: column; gap: 8px; }
.sparkline {
  width: 100%;
  max-width: 220px;
  height: 60px;
}
.sparkline-skeleton { width: 100%; height: 60px; border-radius: 6px; }
.liq-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.liq-stat {
  background: var(--surface2);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex; flex-direction: column;
}
.stat-label {
  font-size: 10px; text-transform: uppercase;
  color: var(--text2); letter-spacing: 0.06em;
}
.stat-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 600;
}

/* Phase 5.1: csgoskins cross-market signals */
.cs-summary {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.cs-pill {
  font-size: 10px; padding: 3px 8px; border-radius: 12px;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); white-space: nowrap;
}
.cs-breakdown {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface2); border-radius: 6px;
  padding: 6px 8px; font-size: 11px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.cs-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 8px; align-items: center;
}
.cs-row .cs-mkt { color: var(--text2); text-transform: lowercase; }
.cs-row .cs-price { color: var(--text); font-weight: 600; }
.cs-row .cs-qty { color: var(--text2); }
.cs-row .cs-vol { color: var(--text2); font-size: 10px; }

/* Phase 5.2: multi-target sell options + reverse-flow badge */
.reverse-flow-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid var(--accent);
  border-radius: 4px;
}
.sell-options-details {
  margin-top: 8px;
  font-size: 11px;
}
.sell-options-details summary {
  cursor: pointer;
  color: var(--text2);
  user-select: none;
  padding: 4px 0;
}
.sell-options-details summary:hover { color: var(--text); }
.sell-options-table {
  width: 100%; border-collapse: collapse; margin-top: 4px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.sell-options-table th,
.sell-options-table td {
  padding: 4px 6px; border-bottom: 1px solid var(--border);
  text-align: left;
}
.sell-options-table th {
  color: var(--text2); font-weight: 500; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.sell-options-table td.num { text-align: right; }
.sell-options-table tr.best-option td { color: var(--green); font-weight: 600; }
.sell-options-table .open-link {
  color: var(--accent); text-decoration: none;
}

/* Phase 5.1: Steam order book mini-table */
.order-book {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.ob-row { display: flex; justify-content: space-between; align-items: center; }
.ob-row .ob-label { color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; }
.ob-row .ob-value { color: var(--text); font-weight: 600; }
.demand-supply .ob-value.good { color: var(--green); }
.demand-supply .ob-value.ok { color: var(--accent); }
.demand-supply .ob-value.bad { color: var(--red); }

/* Spread bar */
.spread-bar {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 8px; font-size: 11px;
}
.spread-label { color: var(--text2); }
.spread-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}
.spread-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px;
  transition: width 300ms ease;
}
.spread-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 11px;
}

/* Decision column */
.col-decision { display: flex; flex-direction: column; gap: 8px; }
.tier-badge {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
  letter-spacing: 0.08em;
}
.tier-badge.tier-fast    { background: rgba(63, 185, 80, 0.18);  color: var(--tier-fast); }
.tier-badge.tier-normal  { background: rgba(210, 153, 34, 0.18); color: var(--tier-normal); }
.tier-badge.tier-slow    { background: rgba(249, 115, 22, 0.18); color: var(--tier-slow); }
.tier-badge.tier-dead    { background: rgba(248, 81, 73, 0.18);  color: var(--tier-dead); }
.tier-badge.tier-unknown { background: rgba(110, 118, 129, 0.18); color: var(--tier-unknown); }

.decision-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px;
}
.decision-row .dec-label { color: var(--text2); }
.decision-row .dec-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 500;
}
.decision-row.highlight .dec-value {
  color: var(--accent); font-weight: 700; font-size: 13px;
}

.recommendation {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--rec-watch);
  background: rgba(88, 166, 255, 0.06);
}
.recommendation.rec-buy   { border-left-color: var(--rec-buy);   background: rgba(249, 115, 22, 0.08); }
.recommendation.rec-skip  { border-left-color: var(--rec-skip);  background: rgba(110, 118, 129, 0.08); }
.recommendation.rec-watch { border-left-color: var(--rec-watch); background: rgba(88, 166, 255, 0.06); }
.rec-badge {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em;
}
.rec-buy   .rec-badge { color: var(--rec-buy); }
.rec-skip  .rec-badge { color: var(--rec-skip); }
.rec-watch .rec-badge { color: var(--rec-watch); }
.rec-reason { font-size: 11px; color: var(--text2); margin-top: 2px; line-height: 1.4; }

.confidence-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text2); }
.conf-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.conf-dot.conf-high   { background: var(--conf-high); }
.conf-dot.conf-medium { background: var(--conf-medium); }
.conf-dot.conf-low    { background: var(--conf-low); }
.stale-link { font-size: 10px; color: var(--accent); margin-left: auto; cursor: pointer; }
.stale-link:hover { text-decoration: underline; }

.action-buttons { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.action-buttons > .btn-primary, .action-buttons > .btn-outline { flex: 1; padding: 8px 10px; font-size: 12px; text-align: center; }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  animation: fade-in 200ms ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 90%; max-width: 420px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  font-size: 22px; line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: all 150ms ease;
}
.modal-close:hover { color: var(--text); border-color: var(--border); background: var(--surface2); }
.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal p { color: var(--text2); font-size: 13px; }
.modal label { font-size: 11px; text-transform: uppercase; color: var(--text2); letter-spacing: 0.06em; }
.modal input, .modal select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: 14px;
  font-family: var(--font-body); outline: none;
  width: 100%;
}
.modal input:focus, .modal select:focus { border-color: var(--accent); }
.modal-buttons { display: flex; gap: 8px; margin-top: 8px; }
.modal-buttons .btn-primary, .modal-buttons .btn-secondary { flex: 1; padding: 10px; }

/* ── Toasts ──────────────────────────────────────────────────────── */
#toastContainer {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300; pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  pointer-events: auto;
  animation: fade-in 200ms ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  max-width: 320px;
}
.toast.error { border-left-color: var(--red); }

/* ── Mobile (< 768px) ────────────────────────────────────────────── */
.filter-trigger-mobile { display: none; }
@media (max-width: 768px) {
  .trade-header { padding: 10px 14px; }
  .header-right .btn-primary, .header-right .btn-secondary, .header-right .btn-danger { padding: 6px 10px; font-size: 12px; }
  .aggregate-section {
    grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 12px 14px;
  }
  .agg-card { padding: 10px 12px; }
  .agg-value { font-size: 18px; }
  .filters-bar { display: none; }
  .filter-trigger-mobile {
    display: flex;
    position: sticky; top: 56px; z-index: 40;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    justify-content: space-between; align-items: center;
  }
  .filter-trigger-mobile button { padding: 6px 12px; }
  .filters-bar.open {
    display: flex; flex-direction: column;
    align-items: stretch; gap: 12px;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--surface);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    padding: 16px;
    max-height: 70vh; overflow-y: auto;
  }
  .filters-bar.open .filter-group { width: 100%; }
  .filters-bar.open select, .filters-bar.open input[type="text"] { flex: 1; min-width: 0; }
  .filters-bar.open .tier-filter { flex-wrap: wrap; }
  .cards-container { padding: 10px 12px; }
  .trade-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 12px; padding: 12px;
  }
  .col-identity, .col-pricing, .col-liquidity, .col-decision {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
  }
  .col-decision { border-bottom: 0; padding-bottom: 0; }
  .col-pricing { align-items: flex-start; }
  .sparkline { width: 100% !important; max-width: 100%; }
  .action-buttons { flex-direction: row; gap: 6px; }
  .modal { padding: 18px; }
}
