/* team-roster.css */
/* team-roster.css - the Teams page's Roster and Lineups & rooms tabs (public/js/team-roster.js), and at the end the
 * v2 polish for the page's other sections. Built on v2.css. */
.trs { --good: var(--dx-good, #3ddc84); --crit-c: var(--crit, #ff5470); --warn-c: var(--warn, #ffb020); --info-c: var(--info, #6aa8ff); }
.trs [data-rk="Bronze"] { --rk: #b4773f; } .trs [data-rk="Silver"] { --rk: #a9b3bd; } .trs [data-rk="Gold"] { --rk: #d9a92a; }
.trs [data-rk="Platinum"] { --rk: #4fb8b0; } .trs [data-rk="Diamond"] { --rk: #7b9dff; }
[data-theme="daylight"] .trs [data-rk="Bronze"] { --rk: #98602a; } [data-theme="daylight"] .trs [data-rk="Silver"] { --rk: #6b7885; }
[data-theme="daylight"] .trs [data-rk="Gold"] { --rk: #a87a00; } [data-theme="daylight"] .trs [data-rk="Platinum"] { --rk: #1f8a82; }
[data-theme="daylight"] .trs [data-rk="Diamond"] { --rk: #3d63d6; }
.trs-sub { display: block; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.trs-none { color: var(--text-4); font-size: 13px; }
.trs-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin: 4px 0 14px; }
.trs-nexthead { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.trs-title { margin: 4px 0 2px; font-family: var(--v2-font-display); font-size: 24px; font-weight: 700; border: 0; padding: 0; }
.trs-lus { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.trs-lumini { display: flex; flex-direction: column; gap: 6px; box-shadow: inset 3px 0 0 var(--lu); }
.trs-lumname { color: var(--text-2); font-size: 13px; }
.trs-lumini b { font-family: var(--v2-font-display); font-size: 22px; }
.trs-lumini small { font-size: 13px; color: var(--text-3); font-weight: 600; }
.trs-bar { height: 4px; border-radius: 4px; background: var(--v2-line-2); overflow: hidden; }
.trs-bar i { display: block; height: 100%; background: var(--accent); }
.trs-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tm-kvb { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.tm-kvb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.kv .v.is-good { color: var(--good); } .kv .v.is-crit { color: var(--crit-c, var(--crit)); } .kv .v.is-warn { color: var(--warn-c, var(--warn)); } .kv .v.is-info { color: var(--info-c, var(--info)); }
.sl-rail .trs-lus { grid-template-columns: minmax(0, 1fr); gap: 12px; }
#teamsBody .trs-table td { height: auto; white-space: normal; }
.trs-kpi { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; min-height: 84px; padding: 12px 14px; color: var(--text-2); font: inherit; cursor: default; }
button.trs-kpi { cursor: pointer; }
.trs-kpi-v { font-family: var(--v2-font-display); font-size: 30px; line-height: 1; }
.trs-kpi-v.is-good { color: var(--good); } .trs-kpi-v.is-crit { color: var(--crit-c); } .trs-kpi-v.is-warn { color: var(--warn-c); } .trs-kpi-v.is-info { color: var(--info-c); }
.trs-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.trs-search { flex: 1 1 200px; max-width: 320px; min-height: var(--v2-h-md); }
.trs-seg { display: inline-flex; flex-wrap: wrap; }
.trs-seg > button { min-height: 32px; border: 0; background: none; box-shadow: none; }
.trs-tablewrap { padding: 0; overflow-x: auto; }
.trs-table { width: 100%; border-collapse: collapse; }
.trs-table th, .trs-table td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--v2-line); }
.trs-table tbody tr { box-shadow: inset 3px 0 0 var(--crit-c); }
.trs-table tbody tr.is-ok { box-shadow: inset 3px 0 0 var(--good); }
.trs-table td.trs-empty { text-align: center; color: var(--text-3); box-shadow: none; }
.trs-who { display: flex; gap: 10px; align-items: center; min-width: 170px; }
.trs-who b { display: block; }
.trs-av { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--v2-raise); border: 1px solid var(--v2-line-2);
    font: 700 12px var(--v2-font-display); color: var(--text-2); object-fit: cover; }
.trs-rk { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 4px 9px 6px; border-radius: var(--v2-r-sm); white-space: nowrap; overflow: hidden;
    font: 700 13px var(--v2-font-display); color: var(--rk); border: 1px solid color-mix(in srgb, var(--rk) 55%, transparent); background: color-mix(in srgb, var(--rk) 13%, transparent); }
.trs-rk::before { content: "◆"; font-size: 10px; margin-right: 4px; }
.trs-rk i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--rk); }
.trs-why { display: block; margin-top: 6px; font-size: 13px; color: var(--text-2); max-width: 340px; line-height: 1.45; }
.trs-why em { display: block; color: var(--text-4); font-size: 12px; }
.trs-av-is-good { color: var(--good); font-weight: 600; } .trs-av-is-warn { color: var(--warn-c); font-weight: 600; } .trs-av-is-crit { color: var(--crit-c); font-weight: 600; } .trs-av-none { color: var(--text-3); }
.trs-acts { white-space: nowrap; } .trs-acts .v2-btn + .v2-btn { margin-left: 6px; }
.trs-lu { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--v2-r-pill); font: 700 13px var(--v2-font-display); white-space: nowrap;
    color: color-mix(in srgb, var(--lu) 80%, var(--text)); background: color-mix(in srgb, var(--lu) 18%, transparent); border: 1px solid color-mix(in srgb, var(--lu) 60%, transparent); }
.trs-lu.is-none { --lu: var(--text-3); }
.trs-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 22px 0 6px; }
.trs-h h3 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.trs-rooms { margin-top: 12px; --sl-card: 300px; }   /* .sl-cards.fit lays the room cards out */
.trs-room { display: flex; flex-direction: column; gap: 12px; }
.trs-roomhead { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.trs-roomhead h4 { margin: 4px 0 2px; font-family: var(--v2-font-display); font-size: 20px; }
.trs-pick { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.trs-result b.is-good { color: var(--good); }
.trs-result .v2-label { margin: 10px 0 6px; }
.trs-names { display: flex; flex-wrap: wrap; gap: 6px; }
.trs-name { padding: 4px 10px; border-radius: var(--v2-r-pill); background: var(--v2-raise); border: 1px solid var(--v2-line); font-size: 13px; }
.trs-held { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--text-3); }
.trs-held b { color: var(--text); }
.trs-new { display: flex; flex-wrap: wrap; gap: 8px; }
.trs-new input { min-height: var(--v2-h-md); }
.trs-lgrid { margin-top: 10px; align-items: start; --sl-card: 290px; }
.trs-lchead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trs-rules { margin: 10px 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.trs-mem { list-style: none; margin: 0; padding: 0; }
.trs-mem li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--v2-line); }
.trs-mem .trs-av { width: 28px; height: 28px; font-size: 11px; }
.trs-mname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.trs-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--crit-c); }
.trs-dot.is-good { background: var(--good); }
.trs-movesel { flex: none; width: 118px; min-height: 30px; font-size: 13px; padding-top: 2px; padding-bottom: 2px; }
.trs-lacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.trs-next-act { margin-top: 12px; }
.trs-open { text-decoration: none; min-height: var(--v2-h-sm); display: inline-flex; align-items: center; }
.trs-dlg { width: min(560px, calc(100vw - 32px)); }
.trs-dlg .trs-rk[data-rk="Bronze"] { --rk: #b4773f; } .trs-dlg [data-rk="Silver"] { --rk: #a9b3bd; } .trs-dlg [data-rk="Gold"] { --rk: #d9a92a; }
.trs-dlg [data-rk="Platinum"] { --rk: #4fb8b0; } .trs-dlg [data-rk="Diamond"] { --rk: #7b9dff; }
.trs-form { display: flex; flex-direction: column; gap: 12px; }
.trs-form h3 { margin: 0; font-family: var(--v2-font-display); font-size: 22px; }
.trs-form textarea { width: 100%; box-sizing: border-box; }
.trs-form .v2-seg { display: inline-flex; gap: 2px; align-self: flex-start; }
.trs-form .v2-seg label { padding: 7px 14px; cursor: pointer; border-radius: var(--v2-r-sm); color: var(--text-2); }
.trs-form .v2-seg label:has(input:checked) { background: var(--v2-overlay); color: var(--text-hi, var(--text)); box-shadow: inset 0 -2px 0 var(--accent); }
.trs-form .v2-seg input { position: absolute; opacity: 0; pointer-events: none; }
.trs-dacts { display: flex; flex-wrap: wrap; gap: 8px; }
.trs-dhead { display: flex; justify-content: space-between; align-items: flex-start; }
.trs-rulecard { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.trs-lv { width: 100%; }
.trs-lvrow { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.trs-lvrow input[type="range"] { flex: 1 1 auto; min-width: 80px; accent-color: var(--accent); }
.trs-lvrow output { min-width: 3.2em; font-weight: 700; color: var(--text); }
.trs-tg { display: flex; gap: 8px; align-items: center; }
.trs-rsum { margin: 0; font-size: 14px; }
.trs-teamreq { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 14px; }
.trs-teamreq b { color: var(--text-hi); font-weight: 600; }
.trs-rulecard .tm-err { margin: 0; }
.trs-slot { min-height: 120px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) {
    .trs-top { grid-template-columns: minmax(0, 1fr); }
    .trs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Phones: each driver is a card. */
@media (max-width: 680px) {
    .trs-kpis { grid-template-columns: 1fr 1fr; }
    .trs-nexthead { flex-direction: column; }
    .trs-search { max-width: none; }
    #teamsBody .trs-tablewrap { background: none; border: 0; box-shadow: none; overflow: visible; }
    #teamsBody .trs-table td[data-pri] { display: block; }   /* each driver is a card: nothing is hidden by width */
    #teamsBody .trs-table tbody td { background: none; }
    .trs-table, .trs-table tbody { display: block; min-width: 0; }
    .trs-table thead { display: none; }
    .trs-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 14px 14px 14px 18px; margin-bottom: 12px;
        background: var(--v2-panel); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); }
    .trs-table td { display: block; padding: 0; border: 0; }
    .trs-table td::before { content: attr(data-l); display: block; margin-bottom: 4px; font: 600 11px var(--v2-font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
    .trs-table td[data-l=""]::before, .trs-table td[data-l="Driver"]::before { display: none; }
    .trs-table td[data-l="Driver"], .trs-table td[data-l="Eligible for next race"], .trs-table td.trs-acts { grid-column: 1 / -1; }
    .trs-table td select { width: 100%; }
    .trs-who { min-width: 0; }
    .trs-roomhead { flex-direction: column; }
    .trs-pick { width: 100%; }
}
.trs-lvrow > span:last-child { white-space: nowrap; }

/* ---- The rest of the Teams page (teams.js, team-ops.js, team-reports.js) on the same v2 language as the Roster tab.
 * Scoped to #teamsBody: team-ops.js injects its own <style> after this file, so the id keeps these on top. */

#teamsBody .tm-newwrap { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#teamsBody .tm-newwrap .tm-newrace { margin-left: 0; }
#teamsBody .tm-newlu { max-width: 220px; }

#teamsBody .tm-team { padding: 20px 22px; border-radius: var(--v2-r-lg); border-color: var(--v2-line); }
#teamsBody .tm-side > .tm-block, #teamsBody .tm-side > .to-req { margin: 0; padding: 12px 14px; border: 1px solid var(--v2-line); border-radius: var(--r-lg, 10px); background: var(--v2-panel); }
#teamsBody .tm-block { margin-top: 24px; padding-top: 20px; border-top-color: var(--v2-line); }
#teamsBody .tm-block:first-child { margin-top: 0; padding-top: 0; }
#teamsBody .tm-block h3, #teamReports h3 { margin: 0 0 12px; font-family: var(--v2-font-display); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
#teamsBody .tm-note { color: var(--text-3); font-size: 13px; line-height: 1.5; }
#teamsBody .tm-emptybox { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px 24px; border: 1px dashed var(--v2-line-2); border-radius: var(--v2-r-md); }
#teamsBody .tm-emptybox .tm-empty { margin: 0; }

/* Small actions: one secondary-button look everywhere (Make owner, Remove, Remind, Close, Open plan...). */
#teamsBody .tm-mini { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; background: var(--v2-raise); color: var(--text-2);
    border: 1px solid var(--v2-line-2); border-radius: var(--v2-r-md); font-family: var(--v2-font-display); font-size: 13px; font-weight: 600; box-shadow: none; text-decoration: none; }
#teamsBody .tm-mini:hover { background: var(--v2-overlay); color: var(--text-hi, var(--text)); border-color: var(--line-3, var(--v2-line-2)); }
#teamsBody .tm-mini.tm-danger { background: transparent; color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
#teamsBody .tm-mini.tm-danger:hover { background: var(--crit-dim); border-color: var(--crit); color: var(--crit); }

/* Members */
#teamsBody .tm-memlist { margin: 0; }
#teamsBody .tm-memlist li { gap: 12px; min-height: 56px; padding: 10px 4px; border-top-color: var(--v2-line); }
#teamsBody .tm-memlist .tm-mname { flex: 1 1 auto; min-width: 0; font-size: 15px; }
#teamsBody .tm-memlist li > .tm-mini:first-of-type { margin-left: 0; }
#teamsBody .tm-memlist select { min-height: 34px; min-width: 120px; text-transform: capitalize; }
#teamsBody .tm-role { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--v2-r-pill); font-family: var(--v2-font-display); font-size: 11px; font-weight: 700;
    letter-spacing: .06em; background: var(--v2-wash, var(--accent-dim)); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* Races: name and status on top, details under, the link on the right. */
#teamsBody li.tm-race { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 6px; }
#teamsBody .tm-rname { grid-column: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-family: var(--v2-font-display); font-size: 17px; color: var(--text-hi, var(--text)); }
#teamsBody .tm-rdate { margin: 0; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-3); }
#teamsBody .tm-rmeta { grid-column: 1; font-size: 13px; color: var(--text-3); }
#teamsBody .tm-rwhere { display: inline; color: var(--text-2); }
#teamsBody .tm-rwhere::after { content: " · "; color: var(--text-4); }
#teamsBody .tm-rlinks { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
#teamsBody .to-st { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--v2-r-pill); font-family: var(--v2-font-display); font-size: 11px; font-weight: 700;
    letter-spacing: .06em; color: var(--info, var(--text-2)); border-color: color-mix(in srgb, var(--info, #6aa8ff) 40%, transparent); background: var(--info-dim, transparent); }
#teamsBody .to-st-live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--v2-wash, var(--accent-dim)); }
#teamsBody .to-st-finished { color: var(--text-3); border-color: var(--v2-line-2); background: var(--v2-hover); }

/* Availability: the ask form as one inset box, each poll a card. */
#teamsBody .tm-block:has(> .to-srcs) { padding: 18px 20px; background: var(--v2-inset); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); }
#teamsBody .tm-block:has(> .to-srcs) .tm-note { margin-bottom: 0; }
#teamsBody .to-src { min-height: 36px; padding: 0 12px; border-radius: var(--v2-r-md); border-color: var(--v2-line-2); font-family: var(--v2-font-display); font-weight: 600; }
#teamsBody .to-form { margin-top: 10px; }
#teamsBody .tm-block + .to-req, #teamsBody .tm-block + .tm-empty { margin-top: 20px; }
#teamsBody .to-req, #teamsBody .tr-race, #teamsBody .to-tile { background: var(--v2-panel); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); box-shadow: var(--v2-shadow-1); }
#teamsBody .to-req { padding: 16px 20px; margin-bottom: 14px; }
#teamsBody .to-req h3 { margin: 0 0 2px; font-family: var(--v2-font-display); font-size: 19px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text-hi, var(--text)); }
#teamsBody .to-by { font-size: 13px; margin-bottom: 4px; }
#teamsBody .to-slot { padding: 14px 0; gap: 8px 16px; border-top-color: var(--v2-line); }
#teamsBody .to-slot-h b { font-family: var(--v2-font-display); font-size: 15px; }
#teamsBody .to-ans { gap: 4px; padding: 3px; min-width: 0; background: var(--v2-inset); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); }
#teamsBody .to-ans button { min-width: 64px; min-height: 32px; border: 0; border-radius: var(--v2-r-sm); box-shadow: none; font-family: var(--v2-font-display); font-weight: 600; color: var(--text-3); }
#teamsBody .to-ans button[aria-pressed="true"] { background: var(--v2-overlay); color: var(--text-hi, var(--text)); box-shadow: inset 0 -2px 0 var(--accent); }
#teamsBody .to-ans button[aria-pressed="true"][data-to-ans="maybe"] { box-shadow: inset 0 -2px 0 var(--warn); }
#teamsBody .to-ans button[aria-pressed="true"][data-to-ans="no"] { box-shadow: inset 0 -2px 0 var(--crit); }
#teamsBody .to-who { font-size: 13px; gap: 4px 16px; }
#teamsBody .to-acts { gap: 8px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--v2-line); }

#teamsBody .to-bestbox { margin-bottom: 20px; }
#teamsBody .to-best { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
#teamsBody .to-best li { padding: 12px 16px; background: var(--v2-panel); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); }
#teamsBody .to-best li:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#teamsBody .to-best-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }
#teamsBody .to-best-h b { font-family: var(--v2-font-display); font-size: 15px; }
#teamsBody .to-best-h .tm-note { margin: 0; }

/* Stats */
#teamsBody .to-tiles { gap: 12px; margin-bottom: 18px; }
#teamsBody .to-tile { padding: 16px 18px; }
#teamsBody .to-tile b { font-family: var(--v2-font-display); font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-hi, var(--text)); }
#teamsBody .to-tile span { display: block; margin-top: 6px; font-size: 13px; color: var(--text-3); }
#teamsBody .to-tiles + .table-wrap td { padding: 12px 14px; font-size: 14px; }
#teamsBody .to-tiles + .table-wrap th { padding: 10px 14px; }

/* Reports */
#teamsBody .tr-race { padding: 16px 20px; margin-bottom: 14px; }
#teamsBody .tr-head { align-items: center; gap: 6px 12px; padding-bottom: 6px; }
#teamsBody .tr-head b { font-family: var(--v2-font-display); font-size: 19px; color: var(--text-hi, var(--text)); }
#teamsBody .tr-meta { font-size: 13px; }
#teamsBody .tr-bar { display: inline-block; width: 120px; }
#teamsBody .tr-list li { gap: 8px 12px; min-height: 56px; padding: 10px 0; border-top-color: var(--v2-line); }
#teamsBody .tr-name { font-weight: 600; font-size: 15px; }
#teamsBody .tr-pill { font-size: 11px; letter-spacing: .06em; }
#teamsBody .tr-acts .v2-btn, #teamsBody .tr-acts .btn-primary { min-height: 32px; padding: 0 12px; font-size: 13px; }
#teamsBody .trs-mem .pp-av { width: 28px !important; height: 28px !important; font-size: 12px !important; }

@media (max-width: 680px) {
    #teamsBody .tm-head h2 { font-size: 22px; }
    #teamsBody .tm-head .tm-newrace { margin-left: 0; flex: 1 1 100%; }
    #teamsBody .tm-head .tm-newwrap { margin-left: 0; flex: 1 1 100%; }
    #teamsBody .tm-newlu { max-width: none; flex: 1 1 100%; }
    #teamsBody .tm-subtabs { width: auto; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
    #teamsBody .tm-team { padding: 14px; }
    #teamsBody .tm-memlist li { flex-wrap: wrap; }
    #teamsBody .tm-memlist .tm-mname { flex-basis: calc(100% - 140px); }
    #teamsBody .to-req, #teamsBody .tr-race { padding: 14px; }
    #teamsBody .tm-block:has(> .to-srcs) { padding: 14px; }
    #teamsBody .to-slot { grid-template-columns: minmax(0, 1fr); }
    #teamsBody .to-ans { width: 100%; box-sizing: border-box; }
    #teamsBody .to-ans button { flex: 1; min-width: 0; }
    #teamsBody li.tm-race { grid-template-columns: minmax(0, 1fr); }
    #teamsBody .tm-rlinks { grid-column: 1; grid-row: auto; margin-top: 6px; }
    #teamsBody .tr-bar { width: 100%; }
}

/* team-find.css */
/* team-find.css: the Teams page's finder sections (markup: public/js/team-find.js). Values copied from
   StintLabs-research/feature-demos/fable-review-2026-11-16/teams-find/mockup.html with the literals swapped for site tokens; the filter bar,
   rank chips, sub-tabs, states, explainer and notice come from lmu-section.css (.lmu-page is on <main>). */

.tf { --tf-good: var(--lmu-good, var(--accent)); --tf-r: var(--lmu-r-ctl, 6px); --tf-font-display: var(--v2-font-display, var(--font-display, inherit)); }
.tf .muted { color: var(--text-3); }
.tf .num { font-variant-numeric: tabular-nums; }
/* The section lead: who this door is for, the way to the other one, the stats line on the right (wraps on phones). */
.tf-lead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; margin: 0 0 var(--s3, 12px); }
.tf-lead p { margin: 0; color: var(--text-2); font-size: 13px; }
.tf-lead .tf-link { font-weight: 600; text-decoration: none; }
.tf-lead .tf-link:hover, .tf-lead .tf-link:focus-visible { text-decoration: underline; }
.tf-stats { margin: 0; color: var(--text-3); font-size: 12px; white-space: normal; }
@media (max-width: 720px) { .tf-lead { flex-direction: column; gap: 4px; } }
/* The Teams rail (team-find.js subtabsHtml): a thin rule before the finder pair; a right edge fade while it scrolls (teams.js). */
.tabs.tf-fade { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.tf-top:focus { outline: none; box-shadow: var(--v2-focus, var(--lmu-focus)); }
.tf .lmu-notice { border-left-color: var(--accent); }
.tf .lmu-notice button { margin-left: 8px; vertical-align: middle; }
.tf-rankgrp { flex-wrap: wrap; }

/* Buttons: primary; quiet and outline are lmu-btn-q / lmu-btn-o. */
.tf-btn-p { height: var(--lmu-h-ctl, 30px); min-height: 0; margin: 0; padding: 0 14px; border: 1px solid var(--accent); border-radius: var(--tf-r); background: var(--accent); color: var(--ink); font: 700 12px/1 var(--v2-font-ui, inherit); white-space: nowrap; box-shadow: none; transform: none; }
.tf-btn-p:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.tf-btn-p[disabled] { opacity: .55; cursor: default; }

/* Listing cards. */
.tf-cards { align-items: start; }   /* .sl-cards (v2.css) sets the columns */
.tf-lc { position: relative; display: grid; gap: 10px; padding: 14px 16px 12px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box, 10px); background: var(--panel); min-width: 0; }
.tf-lc > * { min-width: 0; }   /* grid items: never let a nowrap name set the card's width */
.tf-lc:hover { border-color: var(--line-3); }
.tf-lc.is-mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tf-lc-head { display: flex; align-items: flex-start; gap: 10px; }
.tf-av { flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-hi); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.tf-av.team { border-radius: var(--tf-r); }
.tf-lc-who { flex: 1; min-width: 0; }
.tf-lc-name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-nat { display: inline-block; padding: 0 5px; border: 1px solid var(--line-3); border-radius: 3px; font: 700 10px/16px var(--v2-font-ui, inherit); letter-spacing: .06em; color: var(--text-3); }
.tf-lc-sub { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-lc-sub b { color: var(--text-2); font-weight: 600; }
/* Match score ring: the number is the message; the ring repeats it. */
.tf-score { flex: none; display: grid; justify-items: center; gap: 2px; width: 58px; }
.tf-score .ring { --p: 0; --sc: var(--text-3); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--sc) calc(var(--p) * 1%), var(--line-2) 0); }
.tf-score .ring span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--text-hi); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tf-score small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.tf-score small.mine { color: var(--accent-soft, var(--accent)); }
.tf-score.s-strong .ring { --sc: var(--tf-good); } .tf-score.s-strong small { color: var(--tf-good); }
.tf-score.s-good .ring { --sc: var(--accent-soft, var(--accent)); }
.tf-score.s-fair .ring { --sc: var(--text-2); }
.tf-score.s-weak .ring { --sc: var(--line-3); }
/* Rank badges: the roster's "S1 · 58%" with a thin progress bar, colored by rank (tokens from lmu-section.css). */
.tf [data-rk="Bronze"] { --rk: var(--rank-bronze); } .tf [data-rk="Silver"] { --rk: var(--rank-silver); }
.tf [data-rk="Gold"] { --rk: var(--rank-gold); } .tf [data-rk="Platinum"] { --rk: var(--rank-platinum); }
.tf-rkb { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--rk) 55%, var(--line-3)); border-radius: 3px; background: color-mix(in srgb, var(--rk) 10%, var(--bg-2)); color: var(--text-hi); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; }
.tf-rkb::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rk); }
.tf-rkb i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--rk); }
.tf-rkb .k, .tf-chip .k { color: var(--text-3); font-weight: 700; font-size: 10px; letter-spacing: .06em; }
.tf-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tf-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line-3); border-radius: 3px; background: var(--bg-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tf-chip.ev { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-3)); color: var(--text-hi); }
.tf-chip.ok { border-color: color-mix(in srgb, var(--tf-good) 45%, var(--line-3)); }
.tf-chip.no { border-color: color-mix(in srgb, var(--crit) 45%, var(--line-3)); color: var(--text-2); }
/* Two-column fact grid: label above value. */
.tf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 14px; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.tf-facts dt { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tf-facts dd { margin: 1px 0 0; color: var(--text); font-variant-numeric: tabular-nums; }
.tf-facts dd small { color: var(--text-3); font-size: 12px; }
.tf-facts dd .tf-chips { margin-top: 4px; }
.tf-facts .wide { grid-column: 1 / -1; }
.tf-note { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.tf-note::before { content: "\201C"; color: var(--text-3); } .tf-note::after { content: "\201D"; color: var(--text-3); }
/* Reasons for the score: a details that opens a signed list. */
.tf-why summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; color: var(--accent-soft, var(--accent)); font-size: 12px; font-weight: 600; }
.tf-why summary::-webkit-details-marker { display: none; }
.tf-why summary::after { content: "\25BE"; color: var(--text-3); font-size: 10px; }
.tf-why[open] summary::after { content: "\25B4"; }
.tf-reasons { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }
.tf-reasons li { display: grid; grid-template-columns: 2.6em 1fr; gap: 8px; align-items: baseline; }
.tf-reasons li b { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; color: var(--text-3); }
.tf-reasons li.pos b { color: var(--tf-good); } .tf-reasons li.neg b { color: var(--warn); } .tf-reasons li.neg.hard b { color: var(--crit); }
.tf-lc-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tf-lc-acts .sp { flex: 1; }
.tf-lc-acts .state { font-size: 12px; color: var(--text-3); }
.tf-lc-acts .state.ok { color: var(--tf-good); }
.tf-seats { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; }
.tf-seats i { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line-3); }
.tf-seats i.f { background: var(--text-3); border-color: var(--text-3); }
.tf-seats i.o { border-color: var(--accent); background: var(--accent-dim); }

/* Cards and the profile editor. */
.tf-card { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box, 10px); background: var(--panel); min-width: 0; }
.tf-card h2 { margin: 0 0 4px; font: 600 20px/1.2 var(--tf-font-display); color: var(--text-hi); }
.tf-card h2 + p { margin: 0 0 12px; color: var(--text-3); font-size: 13px; }
.tf-card .f { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.tf-card .f:first-of-type { border-top: 0; padding-top: 4px; }
.tf-card .f .lmu-lbl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tf-card .f .lmu-lbl small { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-3); }
.tf-card .help { margin: 0; color: var(--text-3); font-size: 12px; }
.tf-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-checks label { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-pill, 999px); background: var(--bg-2); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.tf-checks label:hover { color: var(--text-hi); border-color: var(--accent); }
.tf-checks label:has(input:checked) { border-color: var(--accent); background: var(--v2-wash, rgba(var(--accent-rgb), .13)); color: var(--text-hi); }
.tf-checks label:has(input:checked)::before { content: "\2713"; font-size: 11px; color: var(--accent-soft, var(--accent)); }
.tf-checks label:has(input:focus-visible) { box-shadow: var(--v2-focus, var(--lmu-focus)); }
/* The box itself is hidden but stays the focusable, labelled control; the pill and the check glyph show the state. */
.tf-checks input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; pointer-events: none; }
.tf textarea.tf-note-in { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.4; width: 100%; font-size: 13px; }
/* Availability grid: 7 days by 4 blocks, click to toggle. Stored in UTC, drawn in the viewer's time zone. */
.tf-avgrid { display: grid; grid-template-columns: 104px repeat(7, 1fr); gap: 3px; font-size: 11px; color: var(--text-3); max-width: 560px; }
@media (max-width: 480px) { .tf-avgrid { grid-template-columns: 64px repeat(7, 1fr); } .tf-avgrid .r .muted { display: none; } }
.tf-avgrid .h { text-align: center; font-weight: 700; letter-spacing: .04em; padding-bottom: 2px; }
.tf-avgrid .r { align-self: center; padding-right: 6px; white-space: nowrap; }
.tf-avgrid button { height: 24px; min-height: 0; min-width: 0; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 3px; background: var(--bg-2); box-shadow: none; transform: none; }
.tf-avgrid button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 35%, var(--bg-2)); border-color: var(--accent); }
.tf-avgrid button:hover { border-color: var(--accent); }
.tf-form-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.tf-form-foot .sp { flex: 1; font-size: 12px; }

.tf-pick { display: flex; flex-wrap: wrap; gap: 6px; }
/* One selected pill style for every pick (races, presets, class and language checks): wash fill, accent border, a check. */
.tf-pick button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: 0; padding: 0 12px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-pill, 999px); background: var(--bg-2); box-shadow: none; transform: none; color: var(--text-2); font: 600 12px/1.2 var(--v2-font-ui, inherit); }
.tf-pick button[aria-pressed="true"] { border-color: var(--accent); background: var(--v2-wash, rgba(var(--accent-rgb), .13)); color: var(--text-hi); }
.tf-pick button[aria-pressed="true"]::before { content: "\2713"; font-size: 11px; color: var(--accent-soft, var(--accent)); }
.tf-pick button:focus-visible { outline: none; box-shadow: var(--v2-focus, var(--lmu-focus)); }
.tf-pick + .tf-link { margin-top: 6px; font-size: 12px; }
.tf-pick button:hover:not([aria-pressed="true"]) { color: var(--text-hi); border-color: var(--accent); }
.tf-card .f > .tf-link { justify-self: start; font-size: 12px; }
.tf-link { min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; color: var(--accent-soft, var(--accent)); font: inherit; text-decoration: underline; cursor: pointer; }
.tft-manage { margin: 0 0 14px; }

/* The driver finder profile (automatic): the card, the one line form, the notices, the switch. */
.tf-profile { margin: 0 0 14px; }
.tf-profile h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tf-profile h2 small { font: 500 12px/1 var(--v2-font-ui, inherit); color: var(--text-3); }
.tf-profile .tf-known { margin: 6px 0 2px; }
.tf-profile > .help { margin: 0 0 10px; }
.tf-profile .f:first-of-type { border-top: 1px solid var(--line-2); padding-top: 12px; }
/* Visibility: a dot and its words (never color alone). */
.tf-vis { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--v2-font-ui, inherit); color: var(--tf-good); }
.tf-vis::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tf-vis.off { color: var(--text-3); }
.tf-chip.auto::after { content: "auto"; font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); border-left: 1px solid var(--line-3); padding-left: 5px; }
.tf-pickrow { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.tf-pickrow .tf-link { font-size: 12px; }
.tf-card .f .tf-pick + .tf-pick { margin-top: 4px; }
.tf-nonote { margin: 0; color: var(--text-3); font-size: 12px; }
.tf-crit { color: var(--crit); }
.tf .lmu-notice.tf-notice { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.tf .lmu-notice.tf-notice.warn { border-left-color: var(--warn); }
.tf-notice .grow { flex: 1 1 320px; min-width: 0; }
.tf-notice .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tf .tf-notice .acts button { margin-left: 0; }
.tf-pline { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 var(--s3, 12px); padding: 10px 14px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--tf-r); background: var(--panel); font-size: 13px; color: var(--text-2); }
.tf-pline .grow { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.tf-pline b { color: var(--text-hi); }
.tf-pline.off { border-left-color: var(--line-3); }
/* Switch (Hide me here; Recruiting and Hide team in team-find-teams.js): label[role=switch], 34 by 20, accent when on. */
.tf-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 4px; border-radius: var(--lmu-r-pill, 999px); font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.tf-switch i { position: relative; flex: none; width: 34px; height: 20px; border-radius: var(--lmu-r-pill, 999px); background: var(--line-3); transition: background .15s; }
.tf-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-hi); transition: transform .15s; }
.tf-switch[aria-checked="true"] { color: var(--text-hi); }
.tf-switch[aria-checked="true"] i { background: var(--accent); }
.tf-switch[aria-checked="true"] i::after { transform: translateX(14px); }
.tf-switch:focus-visible { outline: none; box-shadow: var(--v2-focus, var(--lmu-focus)); }
@media (prefers-reduced-motion: reduce) { .tf-switch i, .tf-switch i::after { transition: none; } }
@media (max-width: 720px) {
    .tf-vis { margin-left: 0; flex-basis: 100%; }
    .tf-profile .tf-form-foot .sp { flex-basis: 100%; }
    .tf-profile .tf-form-foot .tf-btn-p { flex: 1; height: 38px; font-size: 13px; }
}

/* team-find-requests.css */
/* team-find-requests.css - Find a teammate: the Requests view, the request dialog and the badges
 * (public/js/team-find-requests.js). Values from the feature mockup, on the site's tokens (v2.css, lmu-section.css). */
.tfr, .tfr-dlg { --tfr-good: var(--dx-good, #3ddc84); --tfr-crit: var(--crit, #ff5470); --tfr-warn: var(--warn, #ffb020); --tfr-bg2: var(--bg-2, var(--panel-2)); }
.tfr .tfr-muted, .tfr-dlg .tfr-muted { color: var(--text-3); }
.tfr .tfr-small, .tfr-dlg .tfr-small { font-size: 12px; }

/* Sub-tab rail of the preview shim, and the counts. */
.tfr-subrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tfr-subrow .tfr-hint { margin: 0 0 16px; color: var(--text-3); font-size: 12px; }
.tfr-cnt-badge { display: inline-block; min-width: 18px; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--bg, #000); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.lmu-subtabs .lmu-tab-badge, .tabs .lmu-tab-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--bg, #000); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; font-variant-numeric: tabular-nums; }

/* Two columns, Inbox and Sent. */
.tfr-cols { align-items: start; }   /* .sl-grid (v2.css): Inbox and Sent are .c6 */
.tfr-col { min-width: 0; }
.tfr-col h2 { margin: 0 0 8px; font: 600 20px/1.2 var(--v2-font-display, inherit); color: var(--text-hi); border: 0; padding: 0; }
.tfr-col h2 small { margin-left: 8px; font: 500 12px/1 inherit; font-family: inherit; color: var(--text-3); }
.tfr-req { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); margin-bottom: 8px; }
.tfr-req > * { min-width: 0; }   /* grid items: a long name never widens the card */
.tfr-head { display: flex; align-items: center; gap: 10px; }
.tfr-av { flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-hi); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.tfr-av.team { border-radius: 6px; }
.tfr-head .people-av, .tfr-head img { flex: none; border-radius: 50%; }
.tfr-who { flex: 1; min-width: 0; }
.tfr-name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tfr-name .tfr-muted { font-weight: 500; }
.tfr-sub { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tfr-msg { margin: 0; padding: 8px 10px; border-left: 2px solid var(--line-3); color: var(--text-2); font-size: 13px; line-height: 1.45; background: var(--tfr-bg2); border-radius: 0 3px 3px 0; overflow-wrap: anywhere; }
.tfr-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--text-3); font-size: 12px; }
.tfr-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tfr-acts .sp, .tfr-reveal .sp { flex: 1; }
/* #728: the Flagged row (a driver who misses the team's requirements), the inbox kind headings, the race select. */
.tfr-flag { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 6px 10px; border-left: 2px solid var(--warn, #ffb020); border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--warn, #ffb020) 8%, var(--bg-2, var(--panel))); color: var(--text-2); font-size: 12px; line-height: 1.4; }
.tfr-kind { margin: 4px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tfr-kind small { margin-left: 6px; font-weight: 600; letter-spacing: 0; }
.tfr-dlg select.tfr-sel { display: block; width: 100%; box-sizing: border-box; height: 32px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line-3); border-radius: 6px; background: var(--tfr-bg2, var(--bg-2)); color: var(--text); font: inherit; font-size: 13px; }

/* Status pills. */
.tfr-pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tfr-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tfr-pill.wait { color: var(--tfr-warn); background: var(--warn-dim, color-mix(in srgb, var(--tfr-warn) 14%, var(--panel))); }
.tfr-pill.ok { color: var(--tfr-good); background: color-mix(in srgb, var(--tfr-good) 14%, var(--panel)); }
.tfr-pill.no { color: var(--text-3); }

/* The reveal box: both handles, only after both sides accepted. */
.tfr-reveal { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 10px; border: 1px dashed color-mix(in srgb, var(--tfr-good) 45%, var(--line-3)); border-radius: 6px; font-size: 13px; color: var(--text-2); }
.tfr-reveal code { font: 600 13px/1 ui-monospace, Consolas, monospace; color: var(--text-hi); }

/* Match ring (when the server sends a match summary). */
.tfr-score { flex: none; display: grid; justify-items: center; gap: 2px; width: 58px; }
.tfr-score .ring { --p: 0; --sc: var(--text-3); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--sc) calc(var(--p) * 1%), var(--line-2) 0); }
.tfr-score .ring span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--text-hi); font: 700 15px/1 var(--v2-font-display, inherit); font-variant-numeric: tabular-nums; }
.tfr-score small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.tfr-score.s-strong .ring { --sc: var(--tfr-good); } .tfr-score.s-strong small { color: var(--tfr-good); }
.tfr-score.s-good .ring { --sc: var(--accent-soft, var(--accent)); }
.tfr-score.s-fair .ring { --sc: var(--text-2); }
.tfr-score.s-weak .ring { --sc: var(--line-3); }

/* Buttons, the mockup's three weights. */
.tfr .tfr-btn-q, .tfr .tfr-btn-o, .tfr .tfr-btn-p, .tfr-dlg .tfr-btn-q, .tfr-dlg .tfr-btn-o, .tfr-dlg .tfr-btn-p {
    height: 30px; min-height: 0; margin: 0; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: none; transform: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tfr .tfr-btn-q, .tfr-dlg .tfr-btn-q { padding: 0 10px; border: 1px solid transparent; background: none; color: var(--text-2); }
.tfr .tfr-btn-q:hover, .tfr-dlg .tfr-btn-q:hover { color: var(--text-hi); background: var(--v2-hover, var(--surface-2)); }
.tfr .tfr-btn-o, .tfr-dlg .tfr-btn-o { border: 1px solid var(--line-3); background: var(--tfr-bg2); color: var(--text-hi); }
.tfr .tfr-btn-o:hover, .tfr-dlg .tfr-btn-o:hover { border-color: var(--accent); }
.tfr .tfr-btn-p, .tfr-dlg .tfr-btn-p { padding: 0 14px; border: 1px solid var(--accent); background: var(--accent); color: var(--bg, #000); }
.tfr .tfr-btn-p:hover, .tfr-dlg .tfr-btn-p:hover { background: var(--accent-soft, var(--accent)); border-color: var(--accent-soft, var(--accent)); }
.tfr button[disabled], .tfr-dlg button[disabled] { opacity: .55; cursor: default; }
.tfr .tfr-crit, .tfr-dlg .tfr-crit { color: var(--tfr-crit); }
.tfr-dlg .tfr-btn-o.tfr-crit { border-color: color-mix(in srgb, var(--tfr-crit) 45%, var(--line-3)); }

/* Request dialog: centered on desktop, bottom sheet on phones. */
.tfr-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; }
.tfr-dlg { width: min(100%, 520px); max-height: 90vh; overflow: auto; padding: 18px 20px; border: 1px solid var(--line-3); border-radius: 10px; background: var(--panel-2); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); display: grid; gap: 12px; font-size: 14px; }
.tfr-dlg > * { min-width: 0; }
.tfr-dlg h2 { margin: 0; font: 600 20px/1.2 var(--v2-font-display, inherit); color: var(--text-hi); border: 0; padding: 0; }
.tfr-to { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); font-size: 13px; }
.tfr-to .tfr-av { width: 30px; height: 30px; font-size: 11px; }
.tfr-to b { color: var(--text-hi); }
.tfr-dlg label.tfr-tg { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.tfr-dlg label.tfr-tg input { margin: 3px 0 0; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.tfr-dlg label.tfr-tg b { color: var(--text-hi); font-weight: 600; }
.tfr-dlg label.tfr-block { display: block; }
.tfr-dlg [hidden] { display: none; }
.tfr-lbl { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tfr-lbl small { font-weight: 500; letter-spacing: 0; text-transform: none; }
.tfr-dlg textarea.tfr-inp { display: block; width: 100%; box-sizing: border-box; min-height: 72px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line-3); border-radius: 6px; background: var(--tfr-bg2); color: var(--text); font: inherit; font-size: 13px; line-height: 1.4; resize: vertical; }
.tfr-dlg textarea.tfr-inp:focus { outline: none; border-color: var(--accent); box-shadow: var(--v2-focus, 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent)); }
.tfr-reasons { display: grid; gap: 8px; }
.tfr-dacts { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.tfr-dacts .tfr-cnt { margin-right: auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.tfr-fine { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.45; }

@media (max-width: 720px) {
    .tfr-subrow .tfr-hint { display: none; }
    .tfr-scrim { align-items: end; padding: 0; }
    .tfr-dlg { width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
    .tfr-dlg { animation: tfr-up .18s ease-out; }
    @keyframes tfr-up { from { transform: translateY(8px); opacity: 0; } }
}

/* team-find-teams.css */
/* team-find-teams.css - Find a team: team cards, the team profile card, the rank spread and the requirements editor;
 * Open seats: the event board (manager notice, lineup cards, rule badges, seats) and the
 * post dialog's slot grid (public/js/team-find-teams.js). Values from the feature mockup, on the site's tokens;
 * the dialog shell, buttons and sub-tab rail come from team-find-requests.css. */
.tft { --tft-good: var(--dx-good, #3ddc84); --tft-crit: var(--crit, #ff5470); --tft-warn: var(--warn, #ffb020); --tft-bg2: var(--bg-2, var(--panel-2)); }
.tft .tft-muted, .tft-dlg .tft-muted { color: var(--text-3); }
.tft [data-rk="Bronze"] { --rk: var(--rank-bronze, #cd8a4e); } .tft [data-rk="Silver"] { --rk: var(--rank-silver, #c3cbd6); }
.tft [data-rk="Gold"] { --rk: var(--rank-gold, #e6b93d); } .tft [data-rk="Platinum"] { --rk: var(--rank-platinum, #7fd4e6); }

/* Buttons: the primary weight (lmu-section.css has the outline and quiet ones). */
.tft .tft-btn-p { height: var(--lmu-h-ctl, 30px); min-height: 0; margin: 0; padding: 0 14px; border: 1px solid var(--accent); border-radius: var(--lmu-r-ctl, 6px); background: var(--accent); color: var(--bg, #000); font: 600 13px/1 var(--v2-font-ui, inherit); white-space: nowrap; box-shadow: none; transform: none; cursor: pointer; }
.tft .tft-btn-p:hover { background: var(--accent-soft, var(--accent)); border-color: var(--accent-soft, var(--accent)); }
.tft button[disabled] { opacity: .55; cursor: default; }

/* The manager's "post your lineup" notice. */
.tft-notice { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--lmu-r-ctl, 6px); background: var(--panel); font-size: 13px; color: var(--text-2); }
.tft-notice b { color: var(--text-hi); }
.tft-notice .grow { flex: 1 1 320px; min-width: 0; }
.tft-notice .acts { display: flex; gap: 8px; }

/* Cards. */
.tft-cards { align-items: start; }   /* .sl-cards (v2.css) sets the columns */
.tft-lc { position: relative; display: grid; gap: 10px; padding: 14px 16px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); min-width: 0; }
.tft-lc > * { min-width: 0; }   /* grid items: a long name never widens the card */
.tft-lc:hover { border-color: var(--line-3); }
.tft-lc.is-mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tft-head { display: flex; align-items: flex-start; gap: 10px; }
.tft-av { flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--surface-3); color: var(--text-hi); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.tft-who { flex: 1; min-width: 0; }
.tft-name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tft-nat { display: inline-block; padding: 0 5px; border: 1px solid var(--line-3); border-radius: 4px; font: 700 10px/16px var(--v2-font-ui, inherit); letter-spacing: .06em; color: var(--text-3); }
.tft-sub { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tft-sub b { color: var(--text-2); font-weight: 600; }
.tft-yours { flex: none; align-self: center; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-soft, var(--accent)); }
.tft-seats { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; }
.tft-seats i { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line-3); }
.tft-seats i.f { background: var(--text-3); border-color: var(--text-3); }
.tft-seats i.o { border-color: var(--accent); background: var(--accent-dim, transparent); }

/* Chips and rule badges. */
.tft-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tft-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line-3); border-radius: 4px; background: var(--tft-bg2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tft-chip.ev { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-3)); color: var(--text-hi); }
.tft-chip.ok { border-color: color-mix(in srgb, var(--tft-good) 45%, var(--line-3)); color: var(--tft-good); }
.tft-chip.no { border-color: color-mix(in srgb, var(--tft-crit) 45%, var(--line-3)); color: var(--text-2); }
.tft-rkb { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--rk, var(--line-3)) 55%, var(--line-3)); border-radius: 4px; background: color-mix(in srgb, var(--rk, transparent) 10%, var(--tft-bg2)); color: var(--text-hi); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tft-rkb::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rk, var(--text-3)); }
.tft-rkb .k { color: var(--text-3); font-weight: 700; font-size: 10px; letter-spacing: .06em; }

/* Facts, note, reasons, actions. */
.tft-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 14px; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.tft-facts dt { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tft-facts dd { margin: 1px 0 0; color: var(--text); font-variant-numeric: tabular-nums; }
.tft-facts dd.tft-chips { margin-top: 4px; }
.tft-facts .wide { grid-column: 1 / -1; }
.tft-note { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.tft-note::before { content: "\201C"; color: var(--text-3); } .tft-note::after { content: "\201D"; color: var(--text-3); }
.tft-why summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; color: var(--accent-soft, var(--accent)); font-size: 12px; font-weight: 600; }
.tft-why summary::-webkit-details-marker { display: none; }
.tft-why summary::after { content: "\25BE"; color: var(--text-3); font-size: 10px; }
.tft-why[open] summary::after { content: "\25B4"; }
.tft-reasons { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }
.tft-reasons li { display: grid; grid-template-columns: 2.6em 1fr; gap: 8px; align-items: baseline; }
.tft-reasons li b { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }
.tft-reasons li.pos b { color: var(--tft-good); } .tft-reasons li.neg b, .tft-reasons li.zero b { color: var(--tft-warn); }
.tft-reasons li.zero.hard b { color: var(--tft-crit); }
.tft-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tft-acts .sp { flex: 1; }
.tft-acts .state { font-size: 12px; color: var(--text-3); }
.tft-acts .state.ok { color: var(--tft-good); }

/* Post dialog: inputs, the seats stepper, language chips and the 7 by 4 slot grid. */
.tft-step { display: inline-flex; align-items: center; margin-top: 6px; border: 1px solid var(--line-3); border-radius: 6px; background: var(--bg-2, var(--panel)); }
.tft-step button { width: 32px; height: 30px; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; color: var(--text-2); font-size: 16px; cursor: pointer; }
.tft-step button:hover { color: var(--text-hi); }
.tft-step button:focus-visible { outline: none; box-shadow: var(--v2-focus, 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent)); }
.tft-step output { min-width: 32px; text-align: center; font-weight: 700; color: var(--text-hi); font-variant-numeric: tabular-nums; }
.tft-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.tft-langs .tf-link { font-size: 12px; }
.tft-dlg .tft-pre, .tft-dlg .tf-checks { margin-top: 6px; }
.tft-dlg .tft-inp { display: block; width: 100%; box-sizing: border-box; height: 32px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line-3); border-radius: 6px; background: var(--bg-2, var(--panel)); color: var(--text); font: inherit; font-size: 13px; }
.tft-dlg .tft-inp:focus { outline: none; border-color: var(--accent); box-shadow: var(--v2-focus, 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent)); }
.tft-grid { display: grid; grid-template-columns: 44px repeat(4, 1fr); gap: 3px; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.tft-grid .h { text-align: center; font-weight: 700; letter-spacing: .04em; padding-bottom: 2px; }
.tft-grid .h small { display: block; font-weight: 500; letter-spacing: 0; }
.tft-grid .r { align-self: center; padding-right: 6px; white-space: nowrap; }
.tft-grid button { height: 26px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2, var(--panel)); box-shadow: none; transform: none; cursor: pointer; }
.tft-grid button:hover { border-color: var(--accent); }
.tft-grid button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 35%, var(--bg-2, var(--panel))); border-color: var(--accent); }

@media (max-width: 720px) {
    .tft-notice .acts { width: 100%; }
}
.tft-teamlink { color: inherit; text-decoration: none; }
.tft-teamlink:hover, .tft-teamlink:focus-visible { text-decoration: underline; }

/* Direction 2 (#728): team finder profiles, requirement chips, the rank spread and the requirements editor.
 * Rank colors also inside the dialogs (they sit on body, outside .tft). */
.tft-dlg { --tft-warn: var(--warn, #ffb020); --tft-good: var(--dx-good, #3ddc84); --tft-crit: var(--crit, #ff5470); }
.tft-dlg [data-rk="Bronze"], .tf-spread [data-rk="Bronze"] { --rk: var(--rank-bronze, #cd8a4e); }
.tft-dlg [data-rk="Silver"], .tf-spread [data-rk="Silver"] { --rk: var(--rank-silver, #c3cbd6); }
.tft-dlg [data-rk="Gold"], .tf-spread [data-rk="Gold"] { --rk: var(--rank-gold, #e6b93d); }
.tft-dlg [data-rk="Platinum"], .tf-spread [data-rk="Platinum"] { --rk: var(--rank-platinum, #7fd4e6); }
.tft .tft-chip .k { color: var(--text-3); font-weight: 700; font-size: 10px; letter-spacing: .06em; }
.tft-chip.miss, .tft-rkb.miss { border-color: color-mix(in srgb, var(--tft-warn) 70%, var(--line-3)); color: var(--text-hi); }
.tft-chip.no { color: var(--text-hi); }
.tf-spread { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border: 1px solid var(--line-3); border-radius: 4px; background: var(--bg-2, var(--panel)); font-size: 12px; font-weight: 600; color: var(--text-2); }
.tf-spread .k { color: var(--text-3); font-weight: 700; font-size: 10px; letter-spacing: .06em; margin-right: 3px; }
.tf-spread i { width: 9px; height: 9px; border-radius: 50%; background: var(--rk, var(--text-3)); }
.tf-spread .n { margin-left: 4px; font-variant-numeric: tabular-nums; }
.tft .lmu-subrow { margin-bottom: 12px; }

/* The team profile card (owners and managers). */
.tft-prof { display: grid; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.tft-prof h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 16px; font-weight: 650; color: var(--text-hi); border: 0; padding: 0; }
.tft-prof h2 small { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.tft-prof h2:focus, .tft-vis:focus, .tft-prev:focus { outline: none; box-shadow: var(--v2-focus, 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent)); border-radius: 6px; }
.tft-vis { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.tft-vis::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tft-good); }
.tft-vis.mute::before, .tft-vis.off::before { background: var(--text-3); }
.tft-vis.off { color: var(--text-3); }
.tft-help { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.4; }
.tft-f { display: grid; gap: 6px; }
.tft-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tft-lbl small { font-weight: 500; letter-spacing: 0; text-transform: none; }
.tft-prev { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line-3); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.tft-prev b { color: var(--text-hi); font-weight: 600; }
.tft-prev .sp, .tft-foot .sp { flex: 1; }
.tft-seat { display: inline-flex; align-items: center; gap: 4px; }
.tft .tft-sm { height: 24px; padding: 0 8px; font-size: 12px; }
.tft-foot { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--text-3); }

/* The requirements editor (a .tfr-dlg sheet). */
.tft-rqdlg { max-width: 620px; }
.tft-reqs { display: grid; gap: 14px; margin: 4px 0 12px; }
.tft-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.tft-dlg .tft-row .tft-inp { width: auto; margin-top: 0; }
.tft-dlg .tft-row .tft-pct { width: 72px; }
.tft-dlg .tft-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--line-3); border-radius: 4px; background: var(--bg-2, var(--panel)); color: var(--text-2); font-size: 12px; font-weight: 600; }
.tft-strict { grid-template-columns: 1fr auto; align-items: start; gap: 12px; }
.tft-strict b { color: var(--text-hi); font-weight: 600; font-size: 13px; }
.tft-strict .tft-help { margin-top: 2px; }
@media (max-width: 720px) {
    .tft-vis { margin-left: 0; width: 100%; }
    .tft-prev .lmu-btn-o { width: 100%; }
}

/* teams.css */
/* teams.css: the Teams page (teams.html, teams.js). <main class="sl-page"> takes the shared layer from v2.css (.sl-head,
 * .tabs, .card, .tbl, .sl-grid, .sl-rail-layout, .sl-cards, .chip, .btn); lmu-section.css still supplies the small controls.
 * team-roster.css styles the Roster sections and the v2 look under #teamsBody. Page-only pieces carry the tm- prefix.
 * The Saved data page borrows .tm-picks / .tm-pickfield, which stay in app.css. */

/* ---- Header: avatar before the name, the team rating chip after the subtitle, a primary 30px button ---- */
#teamsHead .sl-head h1 { min-width: 0; overflow-wrap: anywhere; }
#teamsHead .sl-head h1 .pp-av { flex: none; font-size: 15px; }
#teamsHead .sl-head .right .lmu-sel { max-width: 240px; }
.tm-btn-p { border-color: var(--accent); background: var(--accent); color: var(--ink); font-weight: 700; }
.tm-btn-p:hover { border-color: var(--accent); filter: brightness(1.08); }
.tm-danger-o { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, var(--line-3)); }
.tm-danger-o:hover { border-color: var(--crit); }
.lmu-btn-q.tm-danger:hover { color: var(--crit); }
.tm-newwrap { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#teamsBody .tm-newlu, #teamsHead .tm-newlu { min-height: 0; max-width: 220px; }

/* ---- The inline create / join form, one row under the header ---- */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 12px;
    border: 1px solid var(--line-3); border-radius: 8px; background: var(--panel-2, var(--panel)); }
.inline-form label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.inline-form input { flex: 1 1 220px; min-width: 0; height: 30px; min-height: 0; margin: 0; }
.inline-form input[aria-invalid="true"] { border-color: var(--crit); }
.inline-form .tm-err { flex-basis: 100%; margin: 0; color: var(--crit); font-size: 13px; }
.inline-form .tm-hint { flex-basis: 100%; margin: 0; color: var(--text-3); font-size: 12px; }

/* ---- Sections: the rail, then the body box (Members drops the box: its cards are the frame) ---- */
/* The section rail is the system .tabs row, with buttons (role=tab) in place of links; the finder pair sits after a separator. */
.sl-page .tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sl-page .tabs .tf-sep { flex: none; align-self: center; width: 1px; height: 18px; margin: 0 6px; background: var(--v2-line-2); }
.sl-page .tabs .lmu-tab-badge { color: var(--ink); }
/* The sections draw their own cards, so the body is no longer one boxed panel. */
.tm-team, .tm-compare { margin-bottom: 14px; }
.tm-compare { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }

/* ---- Members: the .sl-grid. The Members card spans two rows so the side cards stack beside it; from an 1800 window it is three columns (6 / 3 / 3). ---- */
.tm-members .mem { grid-row: span 2; }
.tm-side { display: grid; gap: var(--sl-gap); align-content: start; min-width: 0; }
.tm-nums .tm-acts, .tm-next .tm-acts { margin-top: 10px; }
.tm-next .kv { margin-top: 10px; }
@media (min-width: 1800px) { .tm-members .mem { grid-column: span 6; grid-row: auto; } .tm-members .c4.l, .tm-members .c4.r { grid-column: span 3; } }
.tm-card { min-width: 0; padding: 14px 16px; }
.tm-card:not(.card) { border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.tm-card > h2, .tm-card-head h2 { margin: 0 0 10px; padding: 0; border: 0; font-size: 15px; font-weight: 600; color: var(--text-hi, var(--text)); }
.tm-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tm-card h3 { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tm-card .tm-block:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.tm-memlist { list-style: none; margin: 0; padding: 0; }
.tm-memlist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.tm-memlist li:first-child { border-top: 0; }
.tm-memlist .tm-mname { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tm-av { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; }
.tm-av-none { background: var(--panel-2); }
.tm-mname { font-weight: 600; }
.tm-mname em { font-style: normal; font-weight: 400; color: var(--text-4); font-size: 0.85em; }
.tm-role { font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 4px; padding: 0 5px; }
/* A name with no account behind it yet. Stated, not warned about: they drive stints like anyone else. */
.tm-pending { color: var(--text-4); border-color: var(--line); text-transform: none; letter-spacing: 0; }
.tm-unlinked .tm-mname { color: var(--text-2); }
.tm-handle { font-weight: 400; color: var(--text-4); font-size: 0.85em; }
.tm-mini { margin-left: auto; min-height: 26px; padding: 0 9px; background: none; color: var(--text-4); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.78rem; cursor: pointer; }
.tm-mini:hover { color: var(--text); border-color: var(--line-2); }
.tm-mini.tm-danger:hover { color: var(--crit); border-color: var(--crit-dim); }

/* ---- Invite card: the code and the two copy buttons, open; the QR and settings under the explainer ---- */
.tm-invbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2, var(--bg-2)); }
.tm-invbox .tm-note { margin: 4px 0 0; }
.tm-invacts { display: grid; gap: 6px; }
.tm-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; font-size: 1.05rem; color: var(--text-hi, var(--text)); overflow-wrap: anywhere; }
.tm-invset { margin: 10px 0 0; }
.tm-invset-body { display: grid; gap: 10px; justify-items: start; margin-top: 10px; }
.tm-invset-body .tm-note { margin: 0; }
.tm-qr { display: block; width: 200px; height: 200px; border-radius: 6px; }
@media (max-width: 480px) { .tm-invbox { grid-template-columns: minmax(0, 1fr); } .tm-invacts { grid-template-columns: 1fr 1fr; } }

.tm-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.tm-block:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.tm-block h3 { margin: 0 0 8px; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.tm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tm-k { color: var(--text-3); font-size: 0.82rem; min-width: 106px; }
.tm-row input { min-height: 30px; flex: 1 1 140px; min-width: 0; }
.tm-seg { min-height: 28px; padding: 0 10px; background: none; color: var(--text-4); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.78rem; cursor: pointer; }
.tm-seg.is-on { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }
.tm-act { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; }
.tm-act:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Compare ---- */
#teamCompareTable { width: auto; min-width: 0; }
.table-wrap:has(> #teamCompareTable) { width: max-content; max-width: 100%; }
#teamCompareTable td { font-variant-numeric: tabular-nums; white-space: nowrap; }
#teamCompareTable .tm-name { font-weight: 600; }
#teamCompareTable .tm-x { color: var(--text-4); }
#teamCompareTable .tm-best { color: var(--accent); font-weight: 600; }
#teamCompareTable tr.tm-me td { background: color-mix(in srgb, var(--accent-dim) 55%, transparent); }
/* The wet line sits under its driver's dry line, so it reads as the same person. */
#teamCompareTable tr.tm-wet td { border-top: 0; padding-top: 0; }
#teamCompareTable tr.tm-wet .tm-name { font-weight: 400; padding-left: 1.4em; }
/* On a phone the table scrolls sideways: keep the driver's name in view. */
#teamCompareTable .tm-name { position: sticky; left: 0; z-index: 1; background: var(--panel); }
#teamCompareTable tr.tm-me td.tm-name {
    background: linear-gradient(color-mix(in srgb, var(--accent-dim) 55%, transparent), color-mix(in srgb, var(--accent-dim) 55%, transparent)), var(--panel); }
/* Sortable headers, the team-best row, and each driver's gap to it. */
.tm-sort { background: none; border: 0; padding: 2px 0; color: inherit; font: inherit; cursor: pointer; }
.tm-sort:hover { color: var(--accent); }
.tm-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
#teamCompareTable tr.tm-teambest > * { border-bottom: 2px solid var(--line-2); }
#teamCompareTable tr.tm-teambest th { text-align: left; color: var(--text-3); }
.tm-delta { display: block; font-size: var(--fs-micro); font-weight: 400; color: var(--text-4); }

/* ---- Races: one row per race, with its own links ---- */
.tm-races { list-style: none; margin: 0; padding: 0; }
.tm-races li { border-top: 1px solid var(--line); }
.tm-races li:first-child { border-top: 0; }
.tm-race { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 6px; color: var(--text-2); border-radius: 7px; }
.tm-rname { font-weight: 600; min-width: 180px; }
.tm-rmeta { color: var(--text-3); font-size: 0.83rem; }
.tm-rdate { margin-left: 6px; font-weight: 400; font-size: 0.8rem; color: var(--text-4); }
.tm-rwhere { display: block; color: var(--text-2); }
.tm-rlinks { display: flex; gap: 6px; margin-left: auto; }
a.tm-mini { display: inline-flex; align-items: center; text-decoration: none; margin-left: 0; }

.tm-wait, .tm-empty { color: var(--text-3); font-size: 0.87rem; max-width: 74ch; }
.tm-note { color: var(--text-4); font-size: 0.8rem; margin: 10px 0 0; max-width: 74ch; }
/* [728] This team: the Find a team rows (switches from team-find.css .tf-switch). */
.tm-frow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.tm-frow b { color: var(--text-hi); font-weight: 600; font-size: 0.87rem; }
.tm-frow p { margin: 2px 0 0; color: var(--text-3); font-size: 0.8rem; max-width: 48ch; }
.tm-frow p:focus { outline: none; box-shadow: var(--v2-focus, 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent)); border-radius: 4px; }
.tm-frow > :last-child { flex: none; }

/* ---- No team yet: what a team gives you, the three steps, the two actions ---- */
.tm-pitch { margin: 18px 0 0; }   /* the .sl-grid fills the page; no 900px column */
.tm-gets { list-style: none; margin: 0; padding: 0; }
.tm-gets li { display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--accent); }
.tm-h3 { margin: 0 0 8px; font: 600 22px/1.2 var(--font-display); color: var(--text-hi); }
.tm-p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.tm-gets b { color: var(--text-hi, var(--text)); font-size: 1rem; }
.tm-gets span { color: var(--text-2); font-size: .9rem; line-height: 1.5; }
.tm-how { list-style: none; counter-reset: th; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; padding: 0; color: var(--text-2); }
.tm-how li { counter-increment: th; display: inline-flex; align-items: center; gap: 8px; }
.tm-how li::before { content: counter(th); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 800; font-size: 13px; }
.tm-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.tm-acts :is(.btn-primary, .btn-ghost) { min-height: 44px; padding: 0 20px; display: inline-flex; align-items: center; font-weight: 700; }
.tm-acts .btn-ghost { border: 1px solid var(--line-2); border-radius: 8px; }

/* ---- The dialog (teams.js ask) ---- */
dialog.dlg { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-3); border-radius: 12px; background: var(--panel-2, var(--panel)); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-body { display: grid; gap: 12px; padding: 18px 18px 16px; }
.dlg h2 { margin: 0; padding: 0; border: 0; font-size: 16px; font-weight: 600; color: var(--text-hi, var(--text)); }
.dlg p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.dlg .acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tm-choices { display: grid; gap: 6px; }
.tm-choices label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.tm-choices input { margin: 0; accent-color: var(--accent); }
.tm-dlgfield { width: 100%; height: 32px; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .tm-k { min-width: 0; width: 100%; }
    .tm-memlist li { flex-wrap: wrap; }
    .tm-mini { min-height: 32px; }
    .tm-rname { min-width: 0; width: 100%; }
    .tm-rlinks { margin-left: 0; }
}

/* discord-invite.js (#596): one quiet Join the StintLab Discord line. */
.di-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-3); font-size: 0.87rem; }
.di-card p { margin: 0; flex: 1 1 220px; min-width: 0; }
.di-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.di-card a:focus-visible, .di-card button:focus-visible, .di-line a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tm-done .di-line { display: block; margin-top: 4px; }

/* Team directory in the page head (#707): a quiet button; under 720px a plain link under the subtitle instead, so the
   primary buttons (New team, Join with a code, New race) stay on one line. */
.tm-dir-link { display: none; margin: 4px 0 0; font-size: 13px; }
.tm-dir-link a { color: var(--accent); }
@media (max-width: 720px) {
    .lmu-head .tm-dir-btn, .sl-head .tm-dir-btn { display: none; }
    .tm-dir-link { display: block; }
}

/* ---- Account invites (teams.js: the Invite a driver card, the picker, "Invited, waiting", "Invited to") ---- */
.ti-sub { margin: 14px 0 4px; font: 700 var(--fs-micro, 11px) var(--font-display); letter-spacing: var(--caps, .08em); text-transform: uppercase; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.ti-sub::after { content: ""; flex: 1; height: 1px; background: var(--v2-line, var(--line)); }
.ti-count { font-weight: 600; letter-spacing: 0; }
.tm-invite .tm-pickbtn { margin-top: 10px; }
.ti-code { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 8px; border: 1px dashed var(--line-3); border-radius: var(--r-md, 8px); background: var(--bg-2); }
.ti-code .tm-code { font: 700 18px var(--font-display); letter-spacing: .14em; margin-right: auto; }
.tm-av-wait { width: 32px; height: 32px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; border: 1px dashed var(--text-4); color: var(--text-3); font: 700 11px var(--font-display); box-sizing: border-box; }
.tm-invwait li { background: color-mix(in srgb, var(--info) 6%, transparent); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.tm-invwait .tm-mname { display: grid; gap: 2px; }
.tm-meta { font-size: 12px; color: var(--text-3); }
.tm-wacts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ti-list { list-style: none; margin: 0; padding: 0; }
.ti-p { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--v2-line, var(--line)); }
.ti-list > .ti-p:first-child { border-top: 0; }
.ti-p > .pp-av, .ti-p > .tm-av-wait { grid-row: 1 / 3; }
.ti-p .n { font: 650 14px/1.25 var(--font-display); color: var(--text-hi); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ti-p .n em { font: 400 12px var(--font-ui); color: var(--text-3); }
.ti-p .m { grid-column: 2; font-size: 12px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.ti-p .a { grid-column: 3; grid-row: 1 / 3; display: flex; gap: 6px; align-items: center; }
.ti-p.off { opacity: .6; }
.ti-why { font: 700 10px var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--accent-soft, var(--accent)); }
.ti-ok { color: var(--good); font: 700 12px var(--font-display); white-space: nowrap; }
.tm-pk-wrap { position: fixed; inset: 0; z-index: 900; display: flex; justify-content: center; align-items: flex-start; padding: 72px 12px 24px; }
.tm-pk-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.tm-pk { position: relative; width: 100%; max-width: 620px; max-height: min(720px, calc(100vh - 96px)); display: flex; flex-direction: column; background: var(--v2-raise, var(--panel)); border: 1px solid var(--v2-line-2, var(--line-2)); border-radius: var(--r-lg, 12px); box-shadow: var(--v2-shadow-2); }
.tm-pk header { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.tm-pk h2 { margin: 0; padding: 0; border: 0; font: 650 18px var(--font-display); color: var(--text-hi); flex: 1; }
.tm-pk .x { width: 32px; height: 32px; border: 0; background: none; color: var(--text-3); font-size: 20px; cursor: pointer; border-radius: var(--r-md, 8px); }
.tm-pk .q { margin: 0 14px; display: block; }
.tm-pk .q input { width: 100%; height: 40px; margin: 0; padding: 0 12px; border: 1px solid var(--line-3); border-radius: var(--r-md, 8px); background: var(--bg-2); color: var(--text); font: 14px var(--font-ui); box-sizing: border-box; }
.tm-pk .q input:focus { outline: none; box-shadow: var(--v2-focus); border-color: var(--accent); }
.tm-pk .body { overflow: auto; padding: 4px 14px 8px; flex: 1; }
.tm-pk footer { padding: 10px 14px; border-top: 1px solid var(--v2-line, var(--line)); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.tm-pk footer span { margin-right: auto; }
.tm-pk-none { margin-top: 12px; padding: 14px; border: 1px dashed var(--line-3); border-radius: var(--r-md, 8px); color: var(--text-3); font-size: 13px; }
.tm-pk-none b { display: block; color: var(--text-hi); margin-bottom: 2px; }
.tm-pk-none .tm-acts { margin-top: 10px; }
.tm-invited { margin-bottom: var(--sl-gap, 16px); }
.tm-invited-row + .tm-invited-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--v2-line, var(--line)); }
.tm-invited .tm-acts { margin-top: 8px; }
.tm-invited .tm-note, .tm-dlghtml .tm-note { margin: 0; }
.tm-dlghtml { display: grid; gap: 6px; }
@media (max-width: 760px) {
    .tm-pk-wrap { padding: 28px 0 0; align-items: stretch; }
    .tm-pk { max-width: none; max-height: none; border-radius: 16px 16px 0 0; border-bottom: 0; }
    .tm-pk .q input { font-size: 16px; height: 44px; }
    .ti-p .a { grid-column: 2; grid-row: auto; margin-top: 4px; }
    .ti-p .a .btn { min-height: 36px; padding: 0 14px; }
    .tm-invite .tm-pickbtn .btn { width: 100%; }
}

