/* trade_hub.css — /trade_machine. Builds on stats_hub.css. */

.muted { color: var(--muted); }
img.on-dark { background: var(--navy-2); border-radius: 50%; padding: 3px; }
.sal-note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.sal-team { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sal-team img { width: 22px; height: 22px; object-fit: contain; }
.sal-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--rule); background: #fff; white-space: nowrap; }
.sal-chip.room { color: #1E7B45; background: #E7F5EC; border-color: #BFE3CC; }
.sal-chip.over { color: var(--ink); background: var(--paper); }
.sal-chip.tax { color: #8A4B00; background: var(--gold-tint); border-color: #F1D49A; }
.sal-chip.a1 { color: #B42318; background: #FDECEA; border-color: #F5C6C1; }
.sal-chip.a2 { color: #fff; background: #B42318; border-color: #B42318; }
.btn[disabled] { opacity: .5; cursor: default; }

/* team columns */
.tm-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tm-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tm-grid.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tm-card { background: var(--card); border: 1px solid var(--rule); border-top: 5px solid var(--team, var(--rule)); display: flex; flex-direction: column; min-width: 0; }
.tm-card.empty { border-top-color: var(--rule); }
.tm-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.tm-head img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.tm-pick { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink);
  font-family: var(--cond); font-size: 21px; font-weight: 700; padding: 0 8px; cursor: pointer; }
.tm-x { flex: none; width: 30px; height: 30px; border: 1px solid var(--rule); border-radius: 50%; background: #fff; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.tm-x:hover { background: var(--paper); color: var(--ink); }
.tm-hint { color: var(--muted); padding: 24px 14px 30px; margin: 0; text-align: center; }
.tm-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.tm-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tm-list { max-height: 560px; overflow-y: auto; }
.tm-sub { padding: 8px 14px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); background: var(--paper); border-bottom: 1px solid var(--rule-soft); }

.tm-p { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule-soft); border-left: 4px solid transparent;
  background: #fff; padding: 8px 12px 8px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.tm-p:hover { background: var(--row-alt); }
.tm-p.on { background: var(--sort); border-left-color: var(--team, var(--accent)); }
.tm-chk { flex: none; width: 18px; height: 18px; border: 1.5px solid #9AA6B2; border-radius: 4px; background: #fff; position: relative; }
.tm-p.on .tm-chk { background: var(--navy); border-color: var(--navy); }
.tm-p.on .tm-chk::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tm-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-n b { font-weight: 600; font-size: 14.5px; }
.tm-n small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-to { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); }
.tm-s { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tm-s b { font-family: var(--cond); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-b { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 0 5px; border-radius: 3px; border: 1px solid var(--rule); color: var(--muted); background: #fff; }
.tm-b.s-NG { background: #FFF1DE; border-color: #F1D49A; color: #8A4B00; }
.tm-b.s-TO { background: #E3EEFB; border-color: #BFD6F2; color: var(--accent-ink); }
.tm-b.s-PO { background: #EFE6FA; border-color: #D8C6F0; color: #5B3A8C; }
.tm-b.s-MO { background: #E2F4F1; border-color: #BCE3DC; color: #1C6B5E; }
.tm-b.s-EST { font-style: italic; }
.tm-b.tw { color: var(--accent-ink); }

/* summary */
.tm-summary { margin-top: 22px; }
.tm-banner { padding: 14px 18px; border: 1px solid var(--rule); background: var(--card); margin-bottom: 14px; font-size: 15px; }
.tm-banner.wait { color: var(--muted); text-align: center; }
.tm-banner.ok { background: #E7F5EC; border-color: #BFE3CC; color: #14532D; }
.tm-banner.bad { background: #FDECEA; border-color: #F5C6C1; color: #7A1A12; }
.tm-res { background: var(--card); border: 1px solid var(--rule); border-top: 5px solid var(--team); padding: 12px 14px 14px; min-width: 0; }
.tm-rhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tm-rhead img { width: 30px; height: 30px; object-fit: contain; }
.tm-res h3 { font-family: var(--cond); font-size: 22px; line-height: 1.05; margin: 0; flex: 1; min-width: 0; }
.tm-verdict { flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tm-res.ok .tm-verdict { background: #E7F5EC; color: #1E7B45; }
.tm-res.bad .tm-verdict { background: #B42318; color: #fff; }
.tm-res.idle { opacity: .75; }
.tm-res.idle .tm-verdict { background: var(--paper); color: var(--muted); }
.tm-io { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tm-io h4 { margin: 0 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tm-io ul { list-style: none; margin: 0; padding: 0; }
.tm-io li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--rule-soft); font-size: 14px; }
.tm-io li:last-child { border-bottom: 0; }
.tm-io p { margin: 0; font-size: 14px; }
.tm-ln { flex: 1; min-width: 0; font-weight: 600; }
.tm-ln small { color: var(--muted); font-weight: 500; }
.tm-amt { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.tm-amt small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.tm-deadline { margin: -6px 0 14px; font-size: 13.5px; color: #8A4B00; }
.tm-dest { height: 26px; font-size: 12px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; max-width: 130px; }
.tm-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 12px 0 10px; }
.tm-nums div { background: var(--row-alt); padding: 6px 8px; min-width: 0; }
.tm-nums dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tm-nums dd { margin: 0; font-family: var(--cond); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-res .up, .tm-future td.up { color: #B42318; }
.tm-res .down, .tm-future td.down { color: #1E7B45; }
.tm-after { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.tm-rule { font-size: 13.5px; margin: 10px 0 0; }
.tm-issues, .tm-notes { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; }
.tm-issues li { color: #9B1C12; margin-bottom: 4px; }
.tm-notes li { color: #8A4B00; }
.tm-roster { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

.tm-future { margin-top: 18px; }
.tm-future h3 { font-family: var(--cond); font-size: 24px; margin: 0 0 8px; }
.tm-future td { font-variant-numeric: tabular-nums; }
.tm-foot { margin-top: 18px; text-align: center; }

/* three or four teams side by side: two figures per row */
.tm-grid.n3 .tm-nums, .tm-grid.n4 .tm-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tm-grid.n4 .tm-io li { flex-wrap: wrap; }
.tm-grid.n4 .tm-dest { max-width: 100%; }

@media (max-width: 1100px) {
  .tm-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .tm-grid.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tm-grid, .tm-grid.n3, .tm-grid.n4 { grid-template-columns: 1fr; }
  .tm-list { max-height: 420px; }
  .tm-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* rule flags on roster rows */
.tm-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tm-flag { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 0 6px; border-radius: 3px; border: 1px solid var(--rule); background: #fff; color: var(--muted); white-space: nowrap; }
.tm-flag.no { color: #9B1C12; background: #FDECEA; border-color: #F5C6C1; }
.tm-notes li.move { color: #8A4B00; }

/* how to get it done */
.tm-fix { margin-top: 18px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent); padding: 14px 18px; }
.tm-fix h3 { font-family: var(--cond); font-size: 24px; margin: 0 0 4px; }
.tm-fix ul { list-style: none; margin: 0; padding: 0; }
.tm-fix li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.tm-fix ul li:first-child { border-top: 0; }
.tm-fix li .btn { flex: none; }
.tm-fixsub { margin: 12px 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
@media (max-width: 600px) { .tm-fix li { flex-direction: column; align-items: flex-start; gap: 6px; } }
