/* views/teams.css: the Teams screen (controls, ranked list as one sticker tile; table-like on desktop). Colors only through tokens. */
.teams .screen-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.tm-controls { display: grid; gap: 14px; }
.tm-seg .seg { display: flex; }
.tm-seg .segwrap, .tm-season .segwrap { display: block; }
.tm-seg .seg-btn { flex: 1; }
.tm-season .seg { display: flex; }
.tm-season .seg-btn { flex: 1; }
.tm-filters { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 12px; align-items: center; padding-right: 4px; }
.tm-filters .search { grid-column: 1 / -1; }
.tm-filters .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* the select keeps its label for screen readers only */
.tm-chips { display: flex; gap: 8px; }
.tm-chip { flex: none; min-height: 44px; min-width: 56px; padding: 0 14px; border: 2px solid var(--edge); border-radius: 999px; background: var(--ctl-f); color: var(--ink);
  font: 800 .9375rem/1.2 var(--font-body); -webkit-tap-highlight-color: transparent; transition: transform var(--dur-fast) var(--ease); }
.tm-chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--on-primary); box-shadow: 3px 3px 0 var(--edge); transform: translate(-1px, -1px); }
.tm-chip[aria-pressed="true"] { border-color: var(--edge); }
.tm-season { display: grid; gap: 8px; }

.tm-section { display: grid; gap: 10px; align-content: start; }
.tm-sum { margin: 0; color: var(--muted); }
.tm-count { margin: 0 0 4px; }
.tm-list { min-width: 0; }
.tm-listhost > .callout { margin-bottom: 14px; }

/* the whole ranked list is one sticker tile, rows split by dashed lines */
.rows.tm-list { gap: 0; padding: 0; background: var(--paper-f); border: 2px solid var(--paper-e); border-radius: var(--r-tile); box-shadow: var(--hard) var(--hard) 0 var(--paper-s); overflow: hidden; margin-right: 4px; margin-bottom: 4px; }
.tm-list > .row { border: 0; border-radius: 0; box-shadow: none; background: none; }
.tm-list > .row + .row, .tm-list > .tm-head + .row { border-top: 2px dashed color-mix(in srgb, var(--paper-e) 45%, transparent); }
a.row.tm-row:hover, a.row.tm-row:active { transform: none; box-shadow: none; background: var(--ab-fill); }

/* phone row: team sticker, name, the view's number with a thin bar */
.tm-row { min-height: 68px; }
.tm-rank, .tm-col, .tm-chev, .tm-head { display: none; }
.tm-row .row-title { font-size: 1.0625rem; }
.tm-metric { flex: none; display: grid; justify-items: end; gap: 2px; width: 104px; }
.tm-val { font: 800 1.25rem/1.1 var(--font-display); font-stretch: var(--stretch); font-variant-numeric: tabular-nums; }
.tm-sub { display: inline-flex; align-items: center; gap: 4px; font: 700 .8125rem/1.3 var(--font-body); color: var(--tx-mu); white-space: nowrap; }
.tm-sub:empty { display: none; }
.tm-sub .delta { font-size: .8125rem; gap: 2px; }
.tm-metric .progress, .tm-col .progress { width: 100%; margin-top: 4px; }
.tm-div { position: relative; display: block; width: 100%; height: 16px; margin-top: 4px; border: 2px solid var(--paper-e); border-radius: 999px; background: var(--trk); overflow: hidden; }
.tm-div::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--paper-e); }
.tm-div-fill { position: absolute; top: 0; bottom: 0; }
.tm-div-fill.is-pos { left: 50%; background: var(--bar); border-right: 2px solid var(--paper-e); }
.tm-div-fill.is-neg { right: 50%; background: var(--neg); border-left: 2px solid var(--paper-e); }

/* desktop: one wide table-like tile */
@media (min-width: 1024px) {
  .teams .screen-body { gap: 24px; }
  .tm-controls { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 24px; }
  .tm-seg .seg { display: inline-flex; }
  .tm-seg .segwrap { overflow: visible; }
  .tm-seg .seg-btn { flex: none; }
  .tm-filters { grid-template-columns: minmax(200px, 1fr) auto minmax(180px, 220px); gap: 12px; }
  .tm-filters .search { grid-column: auto; }
  .tm-chips { flex: none; }
  .tm-season { display: flex; align-items: center; gap: 12px; }
  .tm-season .seg { display: inline-flex; }
  .tm-season .seg-btn { flex: none; }

  .tm-list { --tm-cols: 28px 36px minmax(150px, 1fr) 64px 110px 118px 100px 132px 16px; }
  .tm-head, .tm-row { display: grid; grid-template-columns: var(--tm-cols); align-items: center; column-gap: 12px; padding-inline: 22px 16px; }
  .tm-head { min-height: 52px; background: var(--ab-fill); font: 800 .8125rem/1.3 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--tx-mu); border-bottom: 2px solid var(--paper-e); }
  .tm-head .tm-rank, .tm-head .tm-col { display: block; }
  .tm-row { min-height: 70px; }
  .tm-rank { display: block; font: 800 .9375rem/1 var(--font-body); color: var(--tx-mu); text-align: right; font-variant-numeric: tabular-nums; }
  .tm-col { display: grid; justify-items: start; gap: 2px; align-content: center; }
  .tm-row .tm-c-rec { font: 800 1rem/1.2 var(--font-body); color: var(--tx-mu); }
  .tm-in { display: none; }
  .tm-col.is-sorted .tm-val { color: var(--tx); }
  .tm-col:not(.is-sorted) .tm-val { font-weight: 700; color: var(--tx-mu); font-size: 1.125rem; }
  .tm-metric { display: none; }
  .tm-chev { display: inline-flex; }
  .tm-row .row-detail { display: block; }
  .tm-sortbtn { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; margin-left: -8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
  .tm-sortbtn svg { width: 14px; height: 14px; }
  .tm-sortbtn.is-on { color: var(--tx); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .tm-sortbtn:hover { background: var(--ab-fill); }
  .tm-col .progress, .tm-col .tm-div { width: 100%; max-width: 110px; }
}
