/* Tactivela · modules/teams — scope: .tm  (cards, tabs, rows: design system components)
   Phone first; tablet and PC rules are in the media queries at the end. */
.tm .tm-scroll { padding-bottom: 96px; }
.tm .tm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tm .tm-head .tk-section-label { margin: 0; }
.tm .tm-list, .tm .tm-col { display: flex; flex-direction: column; gap: 8px; }
.tm .tm-tcw { display: flex; align-items: center; gap: 6px; }
.tm .tm-tc-edit { flex-shrink: 0; }
.tm .tm-tc { flex: 1; min-width: 0; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; text-align: left; color: var(--tk-text); font: inherit;
  transition: border-color var(--tk-dur) var(--tk-ease); }
.tm .tm-tc:hover { border-color: var(--tk-violet); }
.tm .tm-tile { width: 44px; height: 44px; }
.tm .tm-tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tm .tm-tc-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm .tm-tc-mt { font-size: var(--tk-fs-meta); color: var(--tk-text-muted); }
.tm .tm-chev { color: var(--tk-text-subtle); }
.tm .tk-card--current .tm-chev { color: var(--tk-now); }
/* squad */
.tm .tm-squad { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tm .tm-none { display: none; }
.tm .tm-squad.none > * { display: none; }
.tm .tm-squad.none > .tm-none { display: block; }
.tm .tm-sq-col { display: flex; flex-direction: column; gap: 10px; }   /* the .tk-column inside each sub-tab body */
.tm .tm-num { width: 76px; flex: none; }
.tm .tm-type { width: 132px; flex: none; }
.tm .tm-mins { width: 96px; flex: none; }
.tm .tm-pr { gap: 10px; }
.tm .tm-pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.tm .tm-pr-main .tk-row__name { max-width: 100%; }
.tm .tm-meta { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--tk-fs-meta); color: var(--tk-text-subtle); }
.tm .tm-num-empty { background: transparent; border: var(--tk-border) dashed var(--tk-now-dim); color: var(--tk-text-subtle); }
.tm .tm-num-opp { background: var(--tk-opponent); }
.tm .tm-empty-row { background: transparent; }
/* RPE records */
.tm .tm-lr { gap: 10px; }
.tm .tm-lr-top { display: flex; align-items: center; gap: 8px; }
/* training load */
.tm .tm-ldtab { display: flex; flex-direction: column; gap: 10px; }
.tm .tm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tm .tk-stat__value small { font-size: 13px; font-weight: 700; margin-left: 3px; color: var(--tk-text-subtle); }
.tm .tk-stat__note.up { color: var(--tk-warn); } .tm .tk-stat__note.dn { color: var(--tk-ok); }
.tm .tm-ld-note { margin: 0; padding: 10px 12px; border-radius: var(--tk-radius); background: var(--tk-card); }
.tm .tm-ld { display: flex; flex-direction: column; border: var(--tk-hairline) solid var(--tk-line); border-radius: var(--tk-radius); overflow: hidden; }
.tm .tm-ld-h, .tm .tm-ld-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 56px 82px; gap: 6px; align-items: center; padding: 8px 10px; }
.tm .tm-ld-h { font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tk-text-subtle); background: var(--tk-surface); }
.tm .tm-ld-h span:not(:first-child), .tm .tm-ld-row > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.tm .tm-ld-row { background: var(--tk-card); border-top: var(--tk-hairline) solid var(--tk-line); font-size: var(--tk-fs-body-s); color: var(--tk-text-muted); }
.tm .tm-ld-nm { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--tk-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm .tm-ld-nm .tk-row__num { width: 28px; height: 28px; font-size: 14px; }
.tm .tm-ld-z { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.tm .tm-ld-z b { font-family: var(--tk-font-display); font-size: 17px; font-weight: 800; }
.tm .tm-ld-z small { font-size: 11px; }
/* RPE sheet */
.tm .tm-rpe-sub { margin: -6px 0 0; color: var(--tk-text-muted); font-size: var(--tk-fs-body-s); }
.tm .tm-rpe-list { max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.tm .tm-rpe-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: var(--tk-hairline) solid var(--tk-line); }
.tm .tm-rpe-p { display: flex; align-items: center; gap: 10px; }
.tm .tm-rpe-p .tk-row__name { flex: 1; font-size: 16px; }
.tm .tm-rpe-v { font-size: var(--tk-fs-meta); color: var(--tk-text-muted); }
.tm .tm-rpe-sum { display: flex; justify-content: space-between; gap: 8px; font-size: var(--tk-fs-body-s); color: var(--tk-text-muted); padding-top: 4px; }
.tm .tm-rpe-sum strong { color: var(--tk-now); }

/* ---------- Larger screens (design system 6.6); nothing above changes ----------
   Tablet (700px and up): the Teams list and each Squad sub-tab already sit in a centred
   .tk-column (teams.js). The tabs bar still runs edge to edge, but its four buttons are
   capped at a quarter of the column and centred instead of stretching across the panel.
   The add button moves in from the panel's corner to sit by the column (as Sessions does),
   a player's (or RPE record's) whole row height is the edit target, and a meta line wraps
   rather than being cut off (text-overflow cannot apply to the inline-flex .tm-meta).
   PC (1100px and up): the column widens to --tk-column-wide and team cards, player rows and
   RPE records go two abreast (each row keeps its number, name and remove button); a form
   or a line of help text keeps to one reading column, so a form is never split. Training
   load puts the team summary (stats, then the note) beside the player table. The add
   button follows the wide column. */
@media (min-width: 700px) {
  .tm .tm-squad > .tk-tabs { justify-content: center; }
  .tm .tm-squad > .tk-tabs > .tk-tab { flex: 0 1 calc(var(--tk-column) / 4); }
  .tm .tk-fab { right: max(var(--tk-space-4), calc(50% - var(--tk-column) / 2 + var(--tk-space-4))); }   /* the add button stays by the column */
  .tm .tm-pr-main { min-height: var(--tk-touch); align-self: stretch; justify-content: center; }        /* edit target: the row's full height, name still centred */
  .tm .tm-pr-main > .tk-row__name { flex: none; }                                                     /* its flex: 1 would grow down the taller button */
  .tm .tm-meta { white-space: normal; overflow-wrap: anywhere; }                                        /* meta lines wrap, never cut mid-word */
}
@media (min-width: 1100px) {
  .tm .tm-column { max-width: var(--tk-column-wide); }
  .tm .tk-fab { right: max(var(--tk-space-4), calc(50% - var(--tk-column-wide) / 2 + var(--tk-space-4))); }
  .tm .tm-list, .tm .tm-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm .tm-list > .tk-empty, .tm .tm-col > .tk-empty { grid-column: 1 / -1; }
  .tm .tm-tcw { align-items: stretch; }               /* cards side by side share a height */
  .tm .tm-tc-edit { align-self: center; }
  .tm .tm-sq-col > .row, .tm .tm-sq-col > .note, .tm .tm-sq-col > .tm-rpe-add { max-width: var(--tk-column); }
  .tm .tm-ldtab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: auto 1fr;
    column-gap: var(--tk-space-6); row-gap: var(--tk-space-3); align-items: start; }
  .tm .tm-ldtab .tm-stats { grid-column: 1; grid-row: 1; grid-template-columns: minmax(0, 1fr); }
  .tm .tm-ldtab .tm-ld-note { grid-column: 1; grid-row: 2; }
  .tm .tm-ldtab .tm-ld { grid-column: 2; grid-row: 1 / span 2; }
}
